paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
Collaborate to Defend Against Adversarial Attacks | Adversarially robust learning methods require invariant predictions to a small neighborhood of its natural inputs , thus often encountering insufficient model capacity . Learning multiple sub-models in an ensemble can mitigate this insufficiency , further improving both generalization and robustness . However , an ensemble still wastes the limited capacity of multiple models . To optimally utilize the limited capacity , this paper proposes to learn a collaboration among multiple sub-models . Compared with the ensemble , the collaboration enables the possibility of correct predictions even if there exists a single correct sub-model . Besides , learning a collaboration could enable every sub-model to fit its vulnerability area and reserve the rest of the sub-models to fit other vulnerability areas . To implement the idea , we propose a collaboration framework—CDA2 the abbreviation for Collaborate to Defend against Adversarial Attacks . CDA2 could effectively minimize the vulnerability overlap of all sub-models and then choose a representative sub-model to make correct predictions . Empirical experiments verify that CDA2 outperforms various ensemble methods against black-box and white-box adversarial attacks . 1 INTRODUCTION . Safety-critical applications ( such as in medicine and finance ) require the adversarial robustness of deep models ( Goodfellow et al. , 2015 ; Szegedy et al. , 2014 ) . An adversarially robust learning method requires invariant predictions to a small neighborhood of its natural inputs , thus often encountering insufficient model capacity ( Zhang et al. , 2021 ; Yu et al. , 2021a ) . This limits the further improvement of robustness and has the undesirable degradation of generalization ( Madry et al. , 2018 ) . Learning multiple sub-models in an ensemble ( Breiman , 1996 ; Freund et al. , 1996 ) can mitigate this insufficiency ( Pang et al. , 2019 ; Kariyappa & Qureshi , 2019 ; Yang et al. , 2020a ) . Remarkably , Pang et al . ( 2019 ) , Kariyappa & Qureshi ( 2019 ) and Yang et al . ( 2020a ) minimized the vulnerability overlaps between each pair of sub-models and improved both robustness and generalization over a single model . However , an ensemble wastes the limited capacity of multiple models . In the example of three sub-models ( see Figure 1 ( b ) ) , the adversarial input that lies in the black areas can fool the ensemble successfully , i.e. , more than half of sub-models must correctly classify the adversarial input . Therefore , the ensemble ’ s voting-based strategy excludes the possibility that true predictions remain with the minority . Besides , learning an ensemble requires more than half of the sub-models to fit the same vulnerability areas , which leaves the following question unanswered whether we could only leverage a single sub-model to fit a vulnerability area and reserve the rest of the sub-models to fit other vulnerability areas . To optimally utilize the limited capacity , this paper proposes to learn a collaboration among multiple sub-models . As shown in Figure 1 ( c ) , the adversarial input that lies in the vulnerability overlaps of all sub-models can undoubtedly fool the collaboration . Compared with the ensemble in Figure 1 ( b ) ) , collaboration enables the possibility of correct predictions even if there exists a single correct submodel merely . Besides , learning a collaboration could enable every sub-model to fit its vulnerability area , which could collectively fix broader vulnerability areas than the ensemble does . Then , submodels could collaboratively choose trustworthy ones to make the final predictions . To realize the idea , we propose a collaboration framework—Collaborate to Defend against Adversarial Attacks ( CDA2 ) ( Algorithms 1 and 2 ) . In CDA2 , each sub-model has dual heads : one outputs a vector of predicted probability fθ ( · ) ; another outputs a scalar that measures posterior probability density ( PPD ) of the prediction . In the training phase , given a natural or adversarial input x , each sub-model chooses an easy one ( s ) to feed itself . The PPD head is meanwhile updated by comparing the predicted probability on the true label—fyθ ( · ) ( a scalar ) . In the inference phase , given an input , CDA2 chooses a sub-model with the largest PPD value as the representative to output the prediction . We highlight our key contributions as follows . • We provide a new perspective on learning multiple sub-models for defending against adversarial attacks . We theoretically show the collaboration makes better decisions than the ensemble , which implies collaboration may fix broader vulnerability areas . • We propose a novel collaboration framework—CDA2 ( see Section 3.2 ) . In the training phase , CDA2could effectively minimize the vulnerability overlap of all sub-models ; In the inference phase , CDA2 could effectively choose a representative sub-model to make correct predictions . We also provide a comprehensive analysis illustrating the rationale of CDA2 . • Empirical experiments verify that CDA2 outperforms various ensemble methods against black-box and white-box adversarial attacks . 2 RELATED WORKS . Adversarial attack Adversarial attacks aim to craft the human-imperceptible adversarial input to fool the deep models . Adversarial attacks could be roughly divided into white-box attacks in which the adversary is fully aware of the model ’ s structures ( Goodfellow et al. , 2015 ; Moosavi-Dezfooli et al. , 2016 ; Carlini & Wagner , 2017b ; Chen et al. , 2018 ; Athalye et al. , 2018 ; Xiao et al. , 2018 ; Zheng et al. , 2019 ; Wong et al. , 2019 ; Mopuri et al. , 2019 ; Alaifari et al. , 2019 ; Sriramanan et al. , 2020 ; Wu et al. , 2020b ; Croce & Hein , 2020 ; Yu et al. , 2021b ) and black-box attacks in which the deep models are treated as black boxes to the adversary ( Cheng et al. , 2019 ; 2020 ; Wu et al. , 2020a ; Chen et al. , 2020a ; Li et al. , 2020a ; Rahmati et al. , 2020 ; Yan et al. , 2021b ; Hendrycks et al. , 2021 ; Dong et al. , 2018 ; Xie et al. , 2019 ) . This paper focuses on building effective defense and select both white-box and black-box attack methods as our robustness evaluation metrics . Adversarial defense Defending adversarial attacks is a challenging task and researchers have proposed various solutions . Certified defense tries to learn provably robust deep models against norm-bounded ( e.g. , ` 2 and ` ∞ ) perturbations ( Wong & Kolter , 2018 ; Tsuzuku et al. , 2018 ; Weng et al. , 2018 ; Mirman et al. , 2018 ; Hein & Andriushchenko , 2017 ; Lécuyer et al. , 2019 ; Xiao et al. , 2019 ; Cohen et al. , 2019 ; Balunovic & Vechev , 2020a ; Zhang et al. , 2020a ; Singla & Feizi , 2020 ; Balunovic & Vechev , 2020b ; Zou et al. , 2021 ) . Empirical defense leverages adversarial data to build effective defense such as adversary detection ( Metzen et al. , 2017 ; Li & Li , 2017 ; Carlini & Wagner , 2017a ; Tian et al. , 2018 ; Ma et al. , 2018b ; Lee et al. , 2018 ; Pang et al. , 2018 ; Smith & Gal , 2018 ; Roth et al. , 2019 ; Liu et al. , 2019 ; Yin & Rohde , 2020 ; Sperl et al. , 2020 ; Cohen et al. , 2020 ; Sheikholeslami et al. , 2021 ; Chen et al. , 2021a ; Yang et al. , 2020b ; Qin et al. , 2020 ; Tian et al. , 2021 ; Wu et al. , 2021 ) and adversarial training ( AT ) , in which AT stands out as the most effective defense . Researchers have investigated various aspects of AT , such as improving AT ’ s robustness or generalization ( Madry et al. , 2018 ; Yan et al. , 2018 ; Wu et al. , 2018 ; Cai et al. , 2018 ; Najafi et al. , 2019 ; Alayrac et al. , 2019 ; Carmon et al. , 2019 ; Farnia et al. , 2019 ; Song et al. , 2019 ; Zhang et al. , 2019b ; Wang et al. , 2019 ; Tramèr & Boneh , 2019 ; Zhang & Wang , 2019 ; Stutz et al. , 2020 ; Pang et al. , 2020 ; Gan et al. , 2020 ; Dong et al. , 2020 ; Zhang et al. , 2020b ; Chen et al. , 2020b ; Song et al. , 2020 ; Ding et al. , 2020 ; Wang et al. , 2020b ; Zhang et al. , 2021 ) , fixing AT ’ s undesirable robust overfitting ( Rice et al. , 2020 ; Chen et al. , 2021b ) , improving AT ’ s training efficiency ( Zhang et al. , 2019a ; Shafahi et al. , 2019 ; Zheng et al. , 2020 ; B.S . & Babu , 2020 ; Andriushchenko & Flammarion , 2020 ; Wong et al. , 2020 ) , understanding/interpreting AT ’ s unique traits ( Nakkiran , 2019 ; Yin et al. , 2019 ; Gao et al. , 2019 ; Cranko et al. , 2019 ; Zhang et al. , 2019c ; Liu et al. , 2020 ; Roth et al. , 2020 ; Wang et al. , 2020a ; Zhang et al. , 2020c ; Li et al. , 2020b ; Zou et al. , 2021 ; Mehrabi et al. , 2021 ; Xu et al. , 2021 ) , etc . Besides , researchers have alao actively investigated robust-structured models ( Cisse et al. , 2017 ; Xie et al. , 2020 ; Moosavi-Dezfooli et al. , 2019 ; Xie & Yuille , 2020 ; Yan et al. , 2021a ; Du et al. , 2021 ; Pang et al. , 2021 ) . Nevertheless , the above research thoroughly investigated a single model ; this paper focuses on the collaboration among multiple models for adversarial defense . Ensemble methods for adversarial robustness The most relevant studies are the ensemble methods . Ensemble methods such as bagging ( Breiman , 1996 ) and boosting ( Freund et al. , 1996 ) have been investigated for significantly improving the model ’ s generalization . Motivated by the benefits of ensemble methods in improving generalization , researchers introduced an ensemble to improve the model robustness ( Yang et al. , 2020a ; Kariyappa & Qureshi , 2019 ; Pang et al. , 2019 ; Tramèr et al. , 2018 ) . Tramèr et al . ( 2018 ) proposed to reduce the adversarial transferability by training a single model with adversarial examples from multiple pretrained sub-models . Pang et al . ( 2019 ) introduce a regularization method—ADP—to encourage high diversity in the non-maximal predictions of sub-models . Kariyappa & Qureshi ( 2019 ) improved the ensemble diversity by maximizing the introduced cosine distance between the gradients of sub-models with respect to the input . Yang et al . ( 2020a ) proposed to distill non-robust features in the input and diversify the adversarial vulnerability . These methods reduced overlaps of vulnerability areas between sub-models ( Yang et al. , 2020a ) . To further improve the ensembles , mixture-of-experts ( MOE ) assume that the problem space can be divided into multiple sub-problems through a gate module ; the gate module specifies each sub-model on a specific sub-problem ( Jacobs et al. , 1991 ; Ma et al. , 2018a ) . Nevertheless , to the best of our knowledge , MOE-based methods have been not applied to help adversarial robustness . Inspired by MOE , we propose the collaboration framework to defend against adversary attacks . | This paper proposes an ensemble or mixture-of-experts method to defend against adversarial examples. Though the authors prefer to use the term collaboration method to highlight its difference from vanilla ensemble. The main idea is that, during adversarial training, the sub-models are trained on each other's adversarial examples. Specifically: * for each training image, one adversarial example is generated per sub-model by carrying out an attack on each sub-model. * each adversarial example is (softly) assigned to the sub-model that has the lowest loss on it as a training image. * each sub-model has a second output called PPD that quantifies its confidence. * at inference time, for each input, the sub-model with the highest PPD produces the output. The rationale is that, because each sub-model only needs to cover part of the adversarial example space, they can do a better job. Experiments on CIFAR-10 with L_inf attacks are reported. | SP:ded3b9c368b22beec3fb0ea5361dab09fd2b48d0 |
Cross-Domain Lossy Compression as Optimal Transport with an Entropy Bottleneck | We study an extension of lossy compression where the reconstruction distribution is different from the source distribution in order to account for distributional shift due to processing . We formulate this as a generalization of optimal transport with an entropy bottleneck to account for the rate constraint due to compression . We provide expressions for the tradeoff between compression rate and the achievable distortion with and without shared common randomness between the encoder and decoder . demonstrate We study the examples of binary , uniform and Gaussian sources ( in an asymptotic setting ) in detail and demonstrate that shared randomness can strictly improve the tradeoff . For the case without common randomness and squared-Euclidean distortion , we show that the optimal solution partially decouples into the problem of optimal compression and transport and also characterize the penalty associated with fully decoupling them . We provide experimental results by training deep learning end-to-end compression systems for performing denoising on SVHN and super-resolution on MNIST , and demonstrate consistency with our theoretical results . 1 INTRODUCTION . Using deep neural networks for lossy image compression has proven to be effective , with ratedistortion performance capable of dominating general-purpose image codecs like JPEG , WebP or BPG ( Rippel & Bourdev , 2017 ; Agustsson et al. , 2017 ; Mentzer et al. , 2018 ) . More recently , many of these works have included generative aspects within the compression to synthesize realistic elements when the rate is otherwise too low to represent fine-grained details ( Tschannen et al. , 2018 ; Agustsson et al. , 2019 ; Mentzer et al. , 2020 ) . Though this has been found to deteriorate ratedistortion performance , it has generally resulted in more perceptually-pleasing image reconstruction by reducing artifacts such as pixelation and blur . Using a distributional constraint as a proxy for perceptual measure , several works have subsequently formalized this in a mathematical framework known as the rate-distortion-perception tradeoff ( Blau & Michaeli , 2018 ; 2019 ; Matsumoto , 2018 ; 2019 ; Theis & Wagner , 2021 ; Yan et al. , 2021 ; Zhang et al. , 2021 ) . As is conventional in lossy compression , these works address the scenario in which both low distortion , whereby each individual image reconstruction resembles the ground truth image , and closeness in distribution in which it is not easy to discriminate between image samples from the data-generating distribution and reconstruction distribution , are desirable . The underlying ideal in conventional compression systems is to have perfect reconstruction with respect to some ground truth input . However this is not the case in applications such as denoising , deblurring , or super-resolution ( SR ) , which require restoration from a degraded input image . In fact , in these cases a ground truth may not even be available . In such applications naturally the reconstruction distribution must match the original source rather than the degraded input distribution . A large body of literature has been devoted to various image restoration tasks , including several methods based on deep learning including both supervised ( e.g. , ( Blau & Michaeli , 2018 ) ) and unsupervised learning methods ( e.g. , ( Wang et al. , 2021b ) ) . Although most of the literature exclusively treats compression and restoration separately , in many application they can co-occur . For example , the encoder which records a degraded image may not be co-located with the decoder , but must transmit a compressed version of the image over a digital network . In turn , the decoder must perform both decompression and restoration simultaneously . To that end , we study an extension of lossy compression in which the reconstruction distribution is different than the source distribution to account for distributional shift due to processing . The problem can be described as a transformation from some source domain to a new target domain under a rate constraint , which generalizes optimal transport . This readily extends other works which view image restoration under the perception-distortion tradeoff ( Blau & Michaeli , 2018 ) or under optimal transport ( Wang et al. , 2021b ) . It also provides a generalization of the rate-distortion-perception problem ( Blau & Michaeli , 2019 ) where the reconstruction distribution must be close to the input distribution . Following ( Theis & Agustsson , 2021 ; Theis & Wagner , 2021 ) , we also utilize common randomness as a tool for compression in our setting . Our results are summarized as follows : • We provide a formulation of lossy compression with distribution shift as a generalization of optimal transport with an entropy constraint and identify the tradeoff between the compression rate and minimum achievable distortion both with and without common randomness at the encoder and decoder . We identify conditions under which the structure of the optimal solution partially decouples the problems of compression and transport , and discuss their architectural implications . We study the examples of binary , uniform and Gaussian sources ( in asymptotic regime ) in detail and demonstrate the utility of our theoretical bounds . • We train deep learning end-to-end compression systems for performing super-resolution on MNIST and denoising on SVHN . Our setup is unsupervised and to the best of our knowledge the first to integrate both compression and restoration at once using deep learning . We first demonstrate that by having common randomness at the encoder and decoder the achievable distortion-rate tradeoffs are lower than when such randomness is not present . Furthermore , we provide experimental validation of the architectural principle suggested by our theoretical analysis . 2 THEORETICAL FORMULATION We consider a setting where an input X ∼ pX is observed at the encoder , which is a degraded ( e.g. , noisy , lower resolution , etc ) version of the original source . It must be restored to an output Y ∼ pY at the decoder , where pY denotes the target distribution of interest . For example , if X denotes a noise-corrupted image and Y denotes the associated clear reconstruction , then pY can be selected to match the distribution of the original source . We will assume pX and pY are probability distributions over X , Y ⊆ Rn and require X and Y to be close with respect to some fidelity metric , which will be measured using a non-negative cost function d ( x , y ) over X × Y . We will refer to d ( · , · ) as the distortion measure and assume that it satisfies d ( x , y ) = 0 if and only if x = y . We further assume that X can not be directly revealed to the decoder , but instead must be transmitted over a bit interface with an average rate constraint . Such a scenario occurs naturally in many practical systems when the encoder and decoder are not co-located such as communication systems or storage systems . As one potential application , when aerial photographs are produced for remote sensing purposes , blurs are introduced by atmospheric turbulence , aberrations in the optical system and relative motion between camera and ground . In such scenarios unsupervised restoration is preferred as it is often intractable to accurately model such degradation processes and collection of paired training data can be time consuming or require significant human intervention . Unsupervised image restoration has been studied recently in Zhang et al . ( 2017 ) ; Pan et al . ( 2021 ) ; Wang et al . ( 2021b ) ; Menon et al . ( 2020 ) . These works also fix the reconstruction distribution Y ∼ pY and propose to minimize a distortion metric between the output and the degraded input as in our present work , but do not consider compression . 2.1 OPTIMAL TRANSPORT AND EXTENSIONS . Definition 1 ( Optimal Transport ) . Let Γ ( pX , pY ) be the set of all joint distributions pX , Y with marginals pX and pY . The classical optimal transport problem is defined as D ( pX , pY ) = inf pX , Y ∈Γ ( pX , pY ) E [ d ( X , Y ) ] , ( 1 ) where we refer to each pX , Y ∈ Γ ( pX , pY ) as a transport plan . Operationally the optimal transport plan in ( 1 ) minimizes the average distortion between the input and output while keeping the output distribution fixed to pY . This may generate a transport plan with potentially unbounded entropy , which may not be amenable in a rate-constrained setting . We therefore suggest a generalization to Definition 1 which constrains the entropy of the transport plan . It turns out that having common randomness at the encoder and decoder can help in this setting , so we will distinguish between when it is available and unavailable . Definition 2 ( Optimal Transport with Entropy Bottleneck — no Common Randomness ) . Let Mncr ( pX , pY ) denote the set of joint distributions pX , Z , Y compatible with the given marginal distributions pX , pY satisfying pX , Z , Y = pXpZ|XpY |Z . The optimal transport from pX to pY with an entropy bottleneck of R and without common randomness is defined as Dncr ( pX , pY , R ) , inf pX , Z , Y ∈Mncr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z ) ≤ R , ( 2 ) where H ( · ) denotes the Shannon entropy of a random variable . We note that when the rate constraintR is sufficiently large such that one can select Z = X or Z = Y in ( 2 ) , then Dncr ( pX , pY , R ) = D ( pX , pY ) in ( 1 ) . More generally , D ( pX , pY ) serves as a lower bound for Dncr ( pX , pY , R ) for any R > 0 . Definition 2 also has a natural operational interpretation in our setting . We can view the encoder as implementing the conditional distribution pZ|X to output a representation Z given the input X , and the decoder as implementing the conditional distribution pY |Z to output the reconstruction Y given the representation Z . The entropy constraint H ( Z ) ≤ R essentially guarantees that the representation Z can be losslessly transmitted at a rate close to R1 . It turns out that when we specialize to the squared Euclidean distance , we can without loss of optimality impose a more structured architecture for implementing the encoder and the decoder . Let W 22 ( · , · ) be the squared quadratic Wasserstein distance , by setting d ( X , Y ) = ||X − Y ||2 in Definition 1 . Theorem 1 . Let Dmse ( pX , pY , R ) , inf pX̂|X , pŶ |Y E [ ‖X − X̂‖2 ] + E [ ‖Y − Ŷ ‖2 ] +W 22 ( pX̂ , pŶ ) s.t . E [ X|X̂ ] = X̂ , E [ Y |Ŷ ] = Ŷ , H ( X̂ ) ≤ R , H ( Ŷ ) ≤ R , ( 3 ) and Dmse ( pX , R ) , inf pX̂|X E [ ‖X − X̂‖2 ] s.t . H ( X̂ ) ≤ R. ( 4 ) Moreover , let . Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) +W 2 2 ( pX̂∗ , pŶ ∗ ) , ( 5 ) Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) , ( 6 ) where pX̂∗ and pŶ ∗ are the marginal distributions induced by the minimizers pX̂∗|X and pŶ ∗|Y that attain Dmse ( pX , R ) and Dmse ( pY , R ) , respectively ( assuming the existence of such minimizers ) . Then under the squared Eucledian distortion measure , Dncr ( pX , pY , R ) = Dmse ( pX , pY , R ) . ( 7 ) In addition , we have Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) , ( 8 ) and both inequalities are tight when pX = pY . 1The source coding theorem guarantees that any discrete random variable Z can be losslessly compressed using a variable length code with average length of no more than H ( Z ) + 1 bits . Theorem 1 deconstructs Z into the quantizations X̂ of X and Ŷ of Y , and decomposes the overall distortion in ( 2 ) in terms of the losses due to quantization , transport , and dequantization in ( 3 ) . It also suggests a natural architecture that partially decouples compression and transport without loss of optimality . First , the sender uses the distribution pX̂|X to produce the compressed representation X̂ from X . This is then passed through a “ converter ” pŶ |X̂ to transform X̂ to an optimal representation Ŷ of Y . Finally , the receiver maps Ŷ back to Y using the conditional distribution pY |Ŷ . This is illustrated in Figure 1 . The entropy constraint H ( X̂ ) ≤ R in ( 2 ) essentially guarantees that X̂ can be losslessly transmitted to the decoder where the converter can be applied to map X̂ to Ŷ before outputting Y . Alternately the constraint H ( Ŷ ) ≤ R guarantees that the converter could also be implemented at the encoder and then Ŷ can be compressed and transmitted to the decoder . Finally note that our proposed architecture is symmetric2 with respect to the encoder and the decoder and in particular the procedure to transport Y to X would simply be the inverse of transporting X to Y , and indeed the distortion incurred by dequantizing pY |Ŷ is the same as the distortion incurred by quantizing pŶ |Y . For the special case of same source and target distribution , we have Dmse ( pX , pX , R ) = 2Dmse ( pX , R ) , implying that the rate required to achieve distortion D under no output distribution constraint ( and with the output alphabet relaxed to Rn ) achieves distortion 2D under the constraint that Y equals X in distribution . This recovers the result of Theorem 2 in Yan et al . ( 2021 ) for the one-shot setting . More generally , ( 8 ) shows that we may lower bound Dmse ( pX , pY , R ) by the distortion incurred when compressing X and Y individually , each at rate R , through ignoring the cost of transport . On the other hand , the upper bound corresponds to choosing the optimal rate-distortion representations X̂∗ , Ŷ ∗ for X , Y , then considering transport between them . The advantage of this approach is that knowledge of the other respective distribution is not necessary for design . Although not optimal in general , we will , in fact , provide an example where this is optimal in Section 2.2 . Finally , the following result implies that under mild regularity conditions , the optimal converter pŶ |X̂ can be realized as a ( deterministic ) bijection , and in the scalar case it can basically only take the form as illustrated in Figure 1 . Theorem 2 . Assume that Dncr ( pX , pY , R ) is a strictly decreasing function in a neighborhood of R = R∗ and Dncr ( pX , pY , R∗ ) is attained by pX , Z , Y . Let X̂ , E [ X|Z ] and Ŷ , E [ Y |Z ] . Then H ( X̂ ) = H ( Ŷ ) = R∗ , ( 9 ) E [ ‖X̂ − Ŷ ‖2 ] = W 22 ( pX̂ , pŶ ) , ( 10 ) and there is a bijection between X̂ and Ŷ . We remark that in general computing the optimal transport map is not straightforward . For the case of binary sources we can compute an exact characterization for Dncr as discussed in Section 2.2 . Furthermore as discussed in Appendix A.6 , W 22 ( pX̂ , pŶ ) can be computed in closed form when X̂ and Ŷ are scalar valued , which can be used to obtain upper bounds on Dncr . In our experimental results in Section 3 we use deep learning based methods to learn approximately optimal mappings . So far we have focused on the setting when there is no shared common randomness between the encoder and the decoder . We will now consider the setting when a shared random variable denoted by U is present at the encoder and decoder . We assume that the variable U is independent of the input X so that the decoder has no apriori information of the input . In practice the sender and receiver can agree on a pseudo-random number generator ahead of time and some kind of seed could be transmitted , after which both sides can generate the same U . We further discuss how shared randomness is used in practice in the experimental section . Definition 3 ( Optimal Transport with Entropy Bottleneck — with Common Randomness ) . Let Mcr ( pX , pY ) denote the set of joint distributions pU , X , Z , Y compatible with the given marginal 2We say that the problem is symmetric if it is invariant under reversing pX , pY with a new distortion measure defined by reversing the arguments of d ( · , · ) . distributions pX , pY and satisfying pU , X , Z , Y = pUpXpZ|X , UpY |Z , U , where pU represents the distribution of shared randomness . The optimal transport from pX to pY with entropy bottleneck R and common randomness is defined as Dcr ( pX , pY , R ) , inf pU , X , Z , Y ∈Mcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z|U ) ≤ R. ( 11 ) Note that we optimize over pU ( the distribution associated with shared randomness ) , in addition to pZ|X , U and pY |Z , U in ( 11 ) . Furthermore , Dcr ( pX , pY , R ) ≤ Dncr ( pX , pY , R ) in general , as we do not have access to shared randomness in Definition 2 . Also from the same argument that was made following Definition 2 , we have that Dcr ( pX , pY , R ) ≥ D ( pX , pY ) in Definition 1 . As with Definition 2 , we can also provide a natural operational interpretation . In particular , given the input X and common randomness U the encoder can output a compressed representation Z using the conditional distribution pZ|X , U . The representation Z can be losslessly compressed approximately to an average rate of R again by exploiting the shared randomness U . Finally the decoder , given Z and U can output the reconstruction Y using the conditional distribution pY |Z , U . An interesting difference with Definition 2 is that the setup is no longer symmetric between encoder and decoder , as X is independent of U but Y is not . The following result provides a simplification to the architecture in Definition 3 . Theorem 3 . Let Qcr ( pX , pY ) denote the set of joint distributions pU , X , Y compatible with the given marginals pX , pY satisfying pU , X , Y = pUpXpY |U , X as well as H ( Y |U , X ) = 0 . Then Dcr ( pX , pY , R ) = inf pU , X , Y ∈Qcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Y |U ) ≤ R. ( 12 ) Before discussing the implications of Theorem 3 we remark on a technical point . Because the Shannon entropy is defined only for discrete random variables , U must be chosen in a way such that Y |U = u is discrete for each u , even for continuous ( X , Y ) . This is known to be possible , e.g. , Li & El Gamal ( 2018 ) have provided a general construction for a U with this property , with additional quantitative guarantees to ensure that U is informative of Y . In the finite alphabet case we show in Appendix A.3 that optimization of U can be formulated as a linear program . We next discuss the implication of Theorem 3 . First note that the problem can be modelled with only pY |U , X producing a reconstruction Y without the need for the intermediate representation Z , much like the conventional optimal transport in Definition 1 . The condition H ( Y |U , X ) = 0 also implies that the transport plan is deterministic when conditioned on the shared randomness , which plays the role of stochasticity . Furthermore in this architecture the encoder should compute the representation Y given the sourceX and the shared random-variable U ( which corresponds to the transport problem ) and then compress it losslessly at a rate close to H ( Y |U ) ( which corresponds to the compression problem ) . The receiver only needs to decompress and reconstruct Y . This is in contrast to the case without common randomness in Theorem 1 where the reconstruction Y must be generated at the decoder . | The paper explores the problem of learned compression scheme for the specific setup where the source and target distributions are not the same (such as in restoring a degraded image). The authors formulate the problem as an optimal transport problem with entropy constraints to control the compression rate. They further argue that the use of common randomness in the encoder and decoder improves the rate-distortion tradeoff and dcoument it on denoising and super-resolution experiments. | SP:fb5766dfb5a0f870cb82c716da2df06aa41086b2 |
Cross-Domain Lossy Compression as Optimal Transport with an Entropy Bottleneck | We study an extension of lossy compression where the reconstruction distribution is different from the source distribution in order to account for distributional shift due to processing . We formulate this as a generalization of optimal transport with an entropy bottleneck to account for the rate constraint due to compression . We provide expressions for the tradeoff between compression rate and the achievable distortion with and without shared common randomness between the encoder and decoder . demonstrate We study the examples of binary , uniform and Gaussian sources ( in an asymptotic setting ) in detail and demonstrate that shared randomness can strictly improve the tradeoff . For the case without common randomness and squared-Euclidean distortion , we show that the optimal solution partially decouples into the problem of optimal compression and transport and also characterize the penalty associated with fully decoupling them . We provide experimental results by training deep learning end-to-end compression systems for performing denoising on SVHN and super-resolution on MNIST , and demonstrate consistency with our theoretical results . 1 INTRODUCTION . Using deep neural networks for lossy image compression has proven to be effective , with ratedistortion performance capable of dominating general-purpose image codecs like JPEG , WebP or BPG ( Rippel & Bourdev , 2017 ; Agustsson et al. , 2017 ; Mentzer et al. , 2018 ) . More recently , many of these works have included generative aspects within the compression to synthesize realistic elements when the rate is otherwise too low to represent fine-grained details ( Tschannen et al. , 2018 ; Agustsson et al. , 2019 ; Mentzer et al. , 2020 ) . Though this has been found to deteriorate ratedistortion performance , it has generally resulted in more perceptually-pleasing image reconstruction by reducing artifacts such as pixelation and blur . Using a distributional constraint as a proxy for perceptual measure , several works have subsequently formalized this in a mathematical framework known as the rate-distortion-perception tradeoff ( Blau & Michaeli , 2018 ; 2019 ; Matsumoto , 2018 ; 2019 ; Theis & Wagner , 2021 ; Yan et al. , 2021 ; Zhang et al. , 2021 ) . As is conventional in lossy compression , these works address the scenario in which both low distortion , whereby each individual image reconstruction resembles the ground truth image , and closeness in distribution in which it is not easy to discriminate between image samples from the data-generating distribution and reconstruction distribution , are desirable . The underlying ideal in conventional compression systems is to have perfect reconstruction with respect to some ground truth input . However this is not the case in applications such as denoising , deblurring , or super-resolution ( SR ) , which require restoration from a degraded input image . In fact , in these cases a ground truth may not even be available . In such applications naturally the reconstruction distribution must match the original source rather than the degraded input distribution . A large body of literature has been devoted to various image restoration tasks , including several methods based on deep learning including both supervised ( e.g. , ( Blau & Michaeli , 2018 ) ) and unsupervised learning methods ( e.g. , ( Wang et al. , 2021b ) ) . Although most of the literature exclusively treats compression and restoration separately , in many application they can co-occur . For example , the encoder which records a degraded image may not be co-located with the decoder , but must transmit a compressed version of the image over a digital network . In turn , the decoder must perform both decompression and restoration simultaneously . To that end , we study an extension of lossy compression in which the reconstruction distribution is different than the source distribution to account for distributional shift due to processing . The problem can be described as a transformation from some source domain to a new target domain under a rate constraint , which generalizes optimal transport . This readily extends other works which view image restoration under the perception-distortion tradeoff ( Blau & Michaeli , 2018 ) or under optimal transport ( Wang et al. , 2021b ) . It also provides a generalization of the rate-distortion-perception problem ( Blau & Michaeli , 2019 ) where the reconstruction distribution must be close to the input distribution . Following ( Theis & Agustsson , 2021 ; Theis & Wagner , 2021 ) , we also utilize common randomness as a tool for compression in our setting . Our results are summarized as follows : • We provide a formulation of lossy compression with distribution shift as a generalization of optimal transport with an entropy constraint and identify the tradeoff between the compression rate and minimum achievable distortion both with and without common randomness at the encoder and decoder . We identify conditions under which the structure of the optimal solution partially decouples the problems of compression and transport , and discuss their architectural implications . We study the examples of binary , uniform and Gaussian sources ( in asymptotic regime ) in detail and demonstrate the utility of our theoretical bounds . • We train deep learning end-to-end compression systems for performing super-resolution on MNIST and denoising on SVHN . Our setup is unsupervised and to the best of our knowledge the first to integrate both compression and restoration at once using deep learning . We first demonstrate that by having common randomness at the encoder and decoder the achievable distortion-rate tradeoffs are lower than when such randomness is not present . Furthermore , we provide experimental validation of the architectural principle suggested by our theoretical analysis . 2 THEORETICAL FORMULATION We consider a setting where an input X ∼ pX is observed at the encoder , which is a degraded ( e.g. , noisy , lower resolution , etc ) version of the original source . It must be restored to an output Y ∼ pY at the decoder , where pY denotes the target distribution of interest . For example , if X denotes a noise-corrupted image and Y denotes the associated clear reconstruction , then pY can be selected to match the distribution of the original source . We will assume pX and pY are probability distributions over X , Y ⊆ Rn and require X and Y to be close with respect to some fidelity metric , which will be measured using a non-negative cost function d ( x , y ) over X × Y . We will refer to d ( · , · ) as the distortion measure and assume that it satisfies d ( x , y ) = 0 if and only if x = y . We further assume that X can not be directly revealed to the decoder , but instead must be transmitted over a bit interface with an average rate constraint . Such a scenario occurs naturally in many practical systems when the encoder and decoder are not co-located such as communication systems or storage systems . As one potential application , when aerial photographs are produced for remote sensing purposes , blurs are introduced by atmospheric turbulence , aberrations in the optical system and relative motion between camera and ground . In such scenarios unsupervised restoration is preferred as it is often intractable to accurately model such degradation processes and collection of paired training data can be time consuming or require significant human intervention . Unsupervised image restoration has been studied recently in Zhang et al . ( 2017 ) ; Pan et al . ( 2021 ) ; Wang et al . ( 2021b ) ; Menon et al . ( 2020 ) . These works also fix the reconstruction distribution Y ∼ pY and propose to minimize a distortion metric between the output and the degraded input as in our present work , but do not consider compression . 2.1 OPTIMAL TRANSPORT AND EXTENSIONS . Definition 1 ( Optimal Transport ) . Let Γ ( pX , pY ) be the set of all joint distributions pX , Y with marginals pX and pY . The classical optimal transport problem is defined as D ( pX , pY ) = inf pX , Y ∈Γ ( pX , pY ) E [ d ( X , Y ) ] , ( 1 ) where we refer to each pX , Y ∈ Γ ( pX , pY ) as a transport plan . Operationally the optimal transport plan in ( 1 ) minimizes the average distortion between the input and output while keeping the output distribution fixed to pY . This may generate a transport plan with potentially unbounded entropy , which may not be amenable in a rate-constrained setting . We therefore suggest a generalization to Definition 1 which constrains the entropy of the transport plan . It turns out that having common randomness at the encoder and decoder can help in this setting , so we will distinguish between when it is available and unavailable . Definition 2 ( Optimal Transport with Entropy Bottleneck — no Common Randomness ) . Let Mncr ( pX , pY ) denote the set of joint distributions pX , Z , Y compatible with the given marginal distributions pX , pY satisfying pX , Z , Y = pXpZ|XpY |Z . The optimal transport from pX to pY with an entropy bottleneck of R and without common randomness is defined as Dncr ( pX , pY , R ) , inf pX , Z , Y ∈Mncr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z ) ≤ R , ( 2 ) where H ( · ) denotes the Shannon entropy of a random variable . We note that when the rate constraintR is sufficiently large such that one can select Z = X or Z = Y in ( 2 ) , then Dncr ( pX , pY , R ) = D ( pX , pY ) in ( 1 ) . More generally , D ( pX , pY ) serves as a lower bound for Dncr ( pX , pY , R ) for any R > 0 . Definition 2 also has a natural operational interpretation in our setting . We can view the encoder as implementing the conditional distribution pZ|X to output a representation Z given the input X , and the decoder as implementing the conditional distribution pY |Z to output the reconstruction Y given the representation Z . The entropy constraint H ( Z ) ≤ R essentially guarantees that the representation Z can be losslessly transmitted at a rate close to R1 . It turns out that when we specialize to the squared Euclidean distance , we can without loss of optimality impose a more structured architecture for implementing the encoder and the decoder . Let W 22 ( · , · ) be the squared quadratic Wasserstein distance , by setting d ( X , Y ) = ||X − Y ||2 in Definition 1 . Theorem 1 . Let Dmse ( pX , pY , R ) , inf pX̂|X , pŶ |Y E [ ‖X − X̂‖2 ] + E [ ‖Y − Ŷ ‖2 ] +W 22 ( pX̂ , pŶ ) s.t . E [ X|X̂ ] = X̂ , E [ Y |Ŷ ] = Ŷ , H ( X̂ ) ≤ R , H ( Ŷ ) ≤ R , ( 3 ) and Dmse ( pX , R ) , inf pX̂|X E [ ‖X − X̂‖2 ] s.t . H ( X̂ ) ≤ R. ( 4 ) Moreover , let . Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) +W 2 2 ( pX̂∗ , pŶ ∗ ) , ( 5 ) Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) , ( 6 ) where pX̂∗ and pŶ ∗ are the marginal distributions induced by the minimizers pX̂∗|X and pŶ ∗|Y that attain Dmse ( pX , R ) and Dmse ( pY , R ) , respectively ( assuming the existence of such minimizers ) . Then under the squared Eucledian distortion measure , Dncr ( pX , pY , R ) = Dmse ( pX , pY , R ) . ( 7 ) In addition , we have Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) , ( 8 ) and both inequalities are tight when pX = pY . 1The source coding theorem guarantees that any discrete random variable Z can be losslessly compressed using a variable length code with average length of no more than H ( Z ) + 1 bits . Theorem 1 deconstructs Z into the quantizations X̂ of X and Ŷ of Y , and decomposes the overall distortion in ( 2 ) in terms of the losses due to quantization , transport , and dequantization in ( 3 ) . It also suggests a natural architecture that partially decouples compression and transport without loss of optimality . First , the sender uses the distribution pX̂|X to produce the compressed representation X̂ from X . This is then passed through a “ converter ” pŶ |X̂ to transform X̂ to an optimal representation Ŷ of Y . Finally , the receiver maps Ŷ back to Y using the conditional distribution pY |Ŷ . This is illustrated in Figure 1 . The entropy constraint H ( X̂ ) ≤ R in ( 2 ) essentially guarantees that X̂ can be losslessly transmitted to the decoder where the converter can be applied to map X̂ to Ŷ before outputting Y . Alternately the constraint H ( Ŷ ) ≤ R guarantees that the converter could also be implemented at the encoder and then Ŷ can be compressed and transmitted to the decoder . Finally note that our proposed architecture is symmetric2 with respect to the encoder and the decoder and in particular the procedure to transport Y to X would simply be the inverse of transporting X to Y , and indeed the distortion incurred by dequantizing pY |Ŷ is the same as the distortion incurred by quantizing pŶ |Y . For the special case of same source and target distribution , we have Dmse ( pX , pX , R ) = 2Dmse ( pX , R ) , implying that the rate required to achieve distortion D under no output distribution constraint ( and with the output alphabet relaxed to Rn ) achieves distortion 2D under the constraint that Y equals X in distribution . This recovers the result of Theorem 2 in Yan et al . ( 2021 ) for the one-shot setting . More generally , ( 8 ) shows that we may lower bound Dmse ( pX , pY , R ) by the distortion incurred when compressing X and Y individually , each at rate R , through ignoring the cost of transport . On the other hand , the upper bound corresponds to choosing the optimal rate-distortion representations X̂∗ , Ŷ ∗ for X , Y , then considering transport between them . The advantage of this approach is that knowledge of the other respective distribution is not necessary for design . Although not optimal in general , we will , in fact , provide an example where this is optimal in Section 2.2 . Finally , the following result implies that under mild regularity conditions , the optimal converter pŶ |X̂ can be realized as a ( deterministic ) bijection , and in the scalar case it can basically only take the form as illustrated in Figure 1 . Theorem 2 . Assume that Dncr ( pX , pY , R ) is a strictly decreasing function in a neighborhood of R = R∗ and Dncr ( pX , pY , R∗ ) is attained by pX , Z , Y . Let X̂ , E [ X|Z ] and Ŷ , E [ Y |Z ] . Then H ( X̂ ) = H ( Ŷ ) = R∗ , ( 9 ) E [ ‖X̂ − Ŷ ‖2 ] = W 22 ( pX̂ , pŶ ) , ( 10 ) and there is a bijection between X̂ and Ŷ . We remark that in general computing the optimal transport map is not straightforward . For the case of binary sources we can compute an exact characterization for Dncr as discussed in Section 2.2 . Furthermore as discussed in Appendix A.6 , W 22 ( pX̂ , pŶ ) can be computed in closed form when X̂ and Ŷ are scalar valued , which can be used to obtain upper bounds on Dncr . In our experimental results in Section 3 we use deep learning based methods to learn approximately optimal mappings . So far we have focused on the setting when there is no shared common randomness between the encoder and the decoder . We will now consider the setting when a shared random variable denoted by U is present at the encoder and decoder . We assume that the variable U is independent of the input X so that the decoder has no apriori information of the input . In practice the sender and receiver can agree on a pseudo-random number generator ahead of time and some kind of seed could be transmitted , after which both sides can generate the same U . We further discuss how shared randomness is used in practice in the experimental section . Definition 3 ( Optimal Transport with Entropy Bottleneck — with Common Randomness ) . Let Mcr ( pX , pY ) denote the set of joint distributions pU , X , Z , Y compatible with the given marginal 2We say that the problem is symmetric if it is invariant under reversing pX , pY with a new distortion measure defined by reversing the arguments of d ( · , · ) . distributions pX , pY and satisfying pU , X , Z , Y = pUpXpZ|X , UpY |Z , U , where pU represents the distribution of shared randomness . The optimal transport from pX to pY with entropy bottleneck R and common randomness is defined as Dcr ( pX , pY , R ) , inf pU , X , Z , Y ∈Mcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z|U ) ≤ R. ( 11 ) Note that we optimize over pU ( the distribution associated with shared randomness ) , in addition to pZ|X , U and pY |Z , U in ( 11 ) . Furthermore , Dcr ( pX , pY , R ) ≤ Dncr ( pX , pY , R ) in general , as we do not have access to shared randomness in Definition 2 . Also from the same argument that was made following Definition 2 , we have that Dcr ( pX , pY , R ) ≥ D ( pX , pY ) in Definition 1 . As with Definition 2 , we can also provide a natural operational interpretation . In particular , given the input X and common randomness U the encoder can output a compressed representation Z using the conditional distribution pZ|X , U . The representation Z can be losslessly compressed approximately to an average rate of R again by exploiting the shared randomness U . Finally the decoder , given Z and U can output the reconstruction Y using the conditional distribution pY |Z , U . An interesting difference with Definition 2 is that the setup is no longer symmetric between encoder and decoder , as X is independent of U but Y is not . The following result provides a simplification to the architecture in Definition 3 . Theorem 3 . Let Qcr ( pX , pY ) denote the set of joint distributions pU , X , Y compatible with the given marginals pX , pY satisfying pU , X , Y = pUpXpY |U , X as well as H ( Y |U , X ) = 0 . Then Dcr ( pX , pY , R ) = inf pU , X , Y ∈Qcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Y |U ) ≤ R. ( 12 ) Before discussing the implications of Theorem 3 we remark on a technical point . Because the Shannon entropy is defined only for discrete random variables , U must be chosen in a way such that Y |U = u is discrete for each u , even for continuous ( X , Y ) . This is known to be possible , e.g. , Li & El Gamal ( 2018 ) have provided a general construction for a U with this property , with additional quantitative guarantees to ensure that U is informative of Y . In the finite alphabet case we show in Appendix A.3 that optimization of U can be formulated as a linear program . We next discuss the implication of Theorem 3 . First note that the problem can be modelled with only pY |U , X producing a reconstruction Y without the need for the intermediate representation Z , much like the conventional optimal transport in Definition 1 . The condition H ( Y |U , X ) = 0 also implies that the transport plan is deterministic when conditioned on the shared randomness , which plays the role of stochasticity . Furthermore in this architecture the encoder should compute the representation Y given the sourceX and the shared random-variable U ( which corresponds to the transport problem ) and then compress it losslessly at a rate close to H ( Y |U ) ( which corresponds to the compression problem ) . The receiver only needs to decompress and reconstruct Y . This is in contrast to the case without common randomness in Theorem 1 where the reconstruction Y must be generated at the decoder . | This paper addresses the problem of lossy compression when the source and target distributions differ. As example domains, the authors look at denoising (the distribution of noisy images and "clean" images are not the same) and super-resolution (again, the distribution of low-res and high-res images are different) both addressed as unsupervised learning problems, i.e. the noisy/clean and low/high-res training data are unpaired. The problem is treated as optimal transport (to account for the domain shift) with an entropy bottleneck (to account for the rate constraint needed to achieve compression). The authors derive theoretical bounds for the achievable distortion in two scenarios (with and without a source of shared randomness between the sender and the receiver), and they show that a shared source of randomness strictly improves rate-distortion performance. The Wasserstein distance used in a Wasserstein GAN framework accounts for the distribution difference between the input and output domains. | SP:fb5766dfb5a0f870cb82c716da2df06aa41086b2 |
Cross-Domain Lossy Compression as Optimal Transport with an Entropy Bottleneck | We study an extension of lossy compression where the reconstruction distribution is different from the source distribution in order to account for distributional shift due to processing . We formulate this as a generalization of optimal transport with an entropy bottleneck to account for the rate constraint due to compression . We provide expressions for the tradeoff between compression rate and the achievable distortion with and without shared common randomness between the encoder and decoder . demonstrate We study the examples of binary , uniform and Gaussian sources ( in an asymptotic setting ) in detail and demonstrate that shared randomness can strictly improve the tradeoff . For the case without common randomness and squared-Euclidean distortion , we show that the optimal solution partially decouples into the problem of optimal compression and transport and also characterize the penalty associated with fully decoupling them . We provide experimental results by training deep learning end-to-end compression systems for performing denoising on SVHN and super-resolution on MNIST , and demonstrate consistency with our theoretical results . 1 INTRODUCTION . Using deep neural networks for lossy image compression has proven to be effective , with ratedistortion performance capable of dominating general-purpose image codecs like JPEG , WebP or BPG ( Rippel & Bourdev , 2017 ; Agustsson et al. , 2017 ; Mentzer et al. , 2018 ) . More recently , many of these works have included generative aspects within the compression to synthesize realistic elements when the rate is otherwise too low to represent fine-grained details ( Tschannen et al. , 2018 ; Agustsson et al. , 2019 ; Mentzer et al. , 2020 ) . Though this has been found to deteriorate ratedistortion performance , it has generally resulted in more perceptually-pleasing image reconstruction by reducing artifacts such as pixelation and blur . Using a distributional constraint as a proxy for perceptual measure , several works have subsequently formalized this in a mathematical framework known as the rate-distortion-perception tradeoff ( Blau & Michaeli , 2018 ; 2019 ; Matsumoto , 2018 ; 2019 ; Theis & Wagner , 2021 ; Yan et al. , 2021 ; Zhang et al. , 2021 ) . As is conventional in lossy compression , these works address the scenario in which both low distortion , whereby each individual image reconstruction resembles the ground truth image , and closeness in distribution in which it is not easy to discriminate between image samples from the data-generating distribution and reconstruction distribution , are desirable . The underlying ideal in conventional compression systems is to have perfect reconstruction with respect to some ground truth input . However this is not the case in applications such as denoising , deblurring , or super-resolution ( SR ) , which require restoration from a degraded input image . In fact , in these cases a ground truth may not even be available . In such applications naturally the reconstruction distribution must match the original source rather than the degraded input distribution . A large body of literature has been devoted to various image restoration tasks , including several methods based on deep learning including both supervised ( e.g. , ( Blau & Michaeli , 2018 ) ) and unsupervised learning methods ( e.g. , ( Wang et al. , 2021b ) ) . Although most of the literature exclusively treats compression and restoration separately , in many application they can co-occur . For example , the encoder which records a degraded image may not be co-located with the decoder , but must transmit a compressed version of the image over a digital network . In turn , the decoder must perform both decompression and restoration simultaneously . To that end , we study an extension of lossy compression in which the reconstruction distribution is different than the source distribution to account for distributional shift due to processing . The problem can be described as a transformation from some source domain to a new target domain under a rate constraint , which generalizes optimal transport . This readily extends other works which view image restoration under the perception-distortion tradeoff ( Blau & Michaeli , 2018 ) or under optimal transport ( Wang et al. , 2021b ) . It also provides a generalization of the rate-distortion-perception problem ( Blau & Michaeli , 2019 ) where the reconstruction distribution must be close to the input distribution . Following ( Theis & Agustsson , 2021 ; Theis & Wagner , 2021 ) , we also utilize common randomness as a tool for compression in our setting . Our results are summarized as follows : • We provide a formulation of lossy compression with distribution shift as a generalization of optimal transport with an entropy constraint and identify the tradeoff between the compression rate and minimum achievable distortion both with and without common randomness at the encoder and decoder . We identify conditions under which the structure of the optimal solution partially decouples the problems of compression and transport , and discuss their architectural implications . We study the examples of binary , uniform and Gaussian sources ( in asymptotic regime ) in detail and demonstrate the utility of our theoretical bounds . • We train deep learning end-to-end compression systems for performing super-resolution on MNIST and denoising on SVHN . Our setup is unsupervised and to the best of our knowledge the first to integrate both compression and restoration at once using deep learning . We first demonstrate that by having common randomness at the encoder and decoder the achievable distortion-rate tradeoffs are lower than when such randomness is not present . Furthermore , we provide experimental validation of the architectural principle suggested by our theoretical analysis . 2 THEORETICAL FORMULATION We consider a setting where an input X ∼ pX is observed at the encoder , which is a degraded ( e.g. , noisy , lower resolution , etc ) version of the original source . It must be restored to an output Y ∼ pY at the decoder , where pY denotes the target distribution of interest . For example , if X denotes a noise-corrupted image and Y denotes the associated clear reconstruction , then pY can be selected to match the distribution of the original source . We will assume pX and pY are probability distributions over X , Y ⊆ Rn and require X and Y to be close with respect to some fidelity metric , which will be measured using a non-negative cost function d ( x , y ) over X × Y . We will refer to d ( · , · ) as the distortion measure and assume that it satisfies d ( x , y ) = 0 if and only if x = y . We further assume that X can not be directly revealed to the decoder , but instead must be transmitted over a bit interface with an average rate constraint . Such a scenario occurs naturally in many practical systems when the encoder and decoder are not co-located such as communication systems or storage systems . As one potential application , when aerial photographs are produced for remote sensing purposes , blurs are introduced by atmospheric turbulence , aberrations in the optical system and relative motion between camera and ground . In such scenarios unsupervised restoration is preferred as it is often intractable to accurately model such degradation processes and collection of paired training data can be time consuming or require significant human intervention . Unsupervised image restoration has been studied recently in Zhang et al . ( 2017 ) ; Pan et al . ( 2021 ) ; Wang et al . ( 2021b ) ; Menon et al . ( 2020 ) . These works also fix the reconstruction distribution Y ∼ pY and propose to minimize a distortion metric between the output and the degraded input as in our present work , but do not consider compression . 2.1 OPTIMAL TRANSPORT AND EXTENSIONS . Definition 1 ( Optimal Transport ) . Let Γ ( pX , pY ) be the set of all joint distributions pX , Y with marginals pX and pY . The classical optimal transport problem is defined as D ( pX , pY ) = inf pX , Y ∈Γ ( pX , pY ) E [ d ( X , Y ) ] , ( 1 ) where we refer to each pX , Y ∈ Γ ( pX , pY ) as a transport plan . Operationally the optimal transport plan in ( 1 ) minimizes the average distortion between the input and output while keeping the output distribution fixed to pY . This may generate a transport plan with potentially unbounded entropy , which may not be amenable in a rate-constrained setting . We therefore suggest a generalization to Definition 1 which constrains the entropy of the transport plan . It turns out that having common randomness at the encoder and decoder can help in this setting , so we will distinguish between when it is available and unavailable . Definition 2 ( Optimal Transport with Entropy Bottleneck — no Common Randomness ) . Let Mncr ( pX , pY ) denote the set of joint distributions pX , Z , Y compatible with the given marginal distributions pX , pY satisfying pX , Z , Y = pXpZ|XpY |Z . The optimal transport from pX to pY with an entropy bottleneck of R and without common randomness is defined as Dncr ( pX , pY , R ) , inf pX , Z , Y ∈Mncr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z ) ≤ R , ( 2 ) where H ( · ) denotes the Shannon entropy of a random variable . We note that when the rate constraintR is sufficiently large such that one can select Z = X or Z = Y in ( 2 ) , then Dncr ( pX , pY , R ) = D ( pX , pY ) in ( 1 ) . More generally , D ( pX , pY ) serves as a lower bound for Dncr ( pX , pY , R ) for any R > 0 . Definition 2 also has a natural operational interpretation in our setting . We can view the encoder as implementing the conditional distribution pZ|X to output a representation Z given the input X , and the decoder as implementing the conditional distribution pY |Z to output the reconstruction Y given the representation Z . The entropy constraint H ( Z ) ≤ R essentially guarantees that the representation Z can be losslessly transmitted at a rate close to R1 . It turns out that when we specialize to the squared Euclidean distance , we can without loss of optimality impose a more structured architecture for implementing the encoder and the decoder . Let W 22 ( · , · ) be the squared quadratic Wasserstein distance , by setting d ( X , Y ) = ||X − Y ||2 in Definition 1 . Theorem 1 . Let Dmse ( pX , pY , R ) , inf pX̂|X , pŶ |Y E [ ‖X − X̂‖2 ] + E [ ‖Y − Ŷ ‖2 ] +W 22 ( pX̂ , pŶ ) s.t . E [ X|X̂ ] = X̂ , E [ Y |Ŷ ] = Ŷ , H ( X̂ ) ≤ R , H ( Ŷ ) ≤ R , ( 3 ) and Dmse ( pX , R ) , inf pX̂|X E [ ‖X − X̂‖2 ] s.t . H ( X̂ ) ≤ R. ( 4 ) Moreover , let . Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) +W 2 2 ( pX̂∗ , pŶ ∗ ) , ( 5 ) Dncr ( pX , pY , R ) , Dmse ( pX , R ) +Dmse ( pY , R ) , ( 6 ) where pX̂∗ and pŶ ∗ are the marginal distributions induced by the minimizers pX̂∗|X and pŶ ∗|Y that attain Dmse ( pX , R ) and Dmse ( pY , R ) , respectively ( assuming the existence of such minimizers ) . Then under the squared Eucledian distortion measure , Dncr ( pX , pY , R ) = Dmse ( pX , pY , R ) . ( 7 ) In addition , we have Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) ≥ Dncr ( pX , pY , R ) , ( 8 ) and both inequalities are tight when pX = pY . 1The source coding theorem guarantees that any discrete random variable Z can be losslessly compressed using a variable length code with average length of no more than H ( Z ) + 1 bits . Theorem 1 deconstructs Z into the quantizations X̂ of X and Ŷ of Y , and decomposes the overall distortion in ( 2 ) in terms of the losses due to quantization , transport , and dequantization in ( 3 ) . It also suggests a natural architecture that partially decouples compression and transport without loss of optimality . First , the sender uses the distribution pX̂|X to produce the compressed representation X̂ from X . This is then passed through a “ converter ” pŶ |X̂ to transform X̂ to an optimal representation Ŷ of Y . Finally , the receiver maps Ŷ back to Y using the conditional distribution pY |Ŷ . This is illustrated in Figure 1 . The entropy constraint H ( X̂ ) ≤ R in ( 2 ) essentially guarantees that X̂ can be losslessly transmitted to the decoder where the converter can be applied to map X̂ to Ŷ before outputting Y . Alternately the constraint H ( Ŷ ) ≤ R guarantees that the converter could also be implemented at the encoder and then Ŷ can be compressed and transmitted to the decoder . Finally note that our proposed architecture is symmetric2 with respect to the encoder and the decoder and in particular the procedure to transport Y to X would simply be the inverse of transporting X to Y , and indeed the distortion incurred by dequantizing pY |Ŷ is the same as the distortion incurred by quantizing pŶ |Y . For the special case of same source and target distribution , we have Dmse ( pX , pX , R ) = 2Dmse ( pX , R ) , implying that the rate required to achieve distortion D under no output distribution constraint ( and with the output alphabet relaxed to Rn ) achieves distortion 2D under the constraint that Y equals X in distribution . This recovers the result of Theorem 2 in Yan et al . ( 2021 ) for the one-shot setting . More generally , ( 8 ) shows that we may lower bound Dmse ( pX , pY , R ) by the distortion incurred when compressing X and Y individually , each at rate R , through ignoring the cost of transport . On the other hand , the upper bound corresponds to choosing the optimal rate-distortion representations X̂∗ , Ŷ ∗ for X , Y , then considering transport between them . The advantage of this approach is that knowledge of the other respective distribution is not necessary for design . Although not optimal in general , we will , in fact , provide an example where this is optimal in Section 2.2 . Finally , the following result implies that under mild regularity conditions , the optimal converter pŶ |X̂ can be realized as a ( deterministic ) bijection , and in the scalar case it can basically only take the form as illustrated in Figure 1 . Theorem 2 . Assume that Dncr ( pX , pY , R ) is a strictly decreasing function in a neighborhood of R = R∗ and Dncr ( pX , pY , R∗ ) is attained by pX , Z , Y . Let X̂ , E [ X|Z ] and Ŷ , E [ Y |Z ] . Then H ( X̂ ) = H ( Ŷ ) = R∗ , ( 9 ) E [ ‖X̂ − Ŷ ‖2 ] = W 22 ( pX̂ , pŶ ) , ( 10 ) and there is a bijection between X̂ and Ŷ . We remark that in general computing the optimal transport map is not straightforward . For the case of binary sources we can compute an exact characterization for Dncr as discussed in Section 2.2 . Furthermore as discussed in Appendix A.6 , W 22 ( pX̂ , pŶ ) can be computed in closed form when X̂ and Ŷ are scalar valued , which can be used to obtain upper bounds on Dncr . In our experimental results in Section 3 we use deep learning based methods to learn approximately optimal mappings . So far we have focused on the setting when there is no shared common randomness between the encoder and the decoder . We will now consider the setting when a shared random variable denoted by U is present at the encoder and decoder . We assume that the variable U is independent of the input X so that the decoder has no apriori information of the input . In practice the sender and receiver can agree on a pseudo-random number generator ahead of time and some kind of seed could be transmitted , after which both sides can generate the same U . We further discuss how shared randomness is used in practice in the experimental section . Definition 3 ( Optimal Transport with Entropy Bottleneck — with Common Randomness ) . Let Mcr ( pX , pY ) denote the set of joint distributions pU , X , Z , Y compatible with the given marginal 2We say that the problem is symmetric if it is invariant under reversing pX , pY with a new distortion measure defined by reversing the arguments of d ( · , · ) . distributions pX , pY and satisfying pU , X , Z , Y = pUpXpZ|X , UpY |Z , U , where pU represents the distribution of shared randomness . The optimal transport from pX to pY with entropy bottleneck R and common randomness is defined as Dcr ( pX , pY , R ) , inf pU , X , Z , Y ∈Mcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Z|U ) ≤ R. ( 11 ) Note that we optimize over pU ( the distribution associated with shared randomness ) , in addition to pZ|X , U and pY |Z , U in ( 11 ) . Furthermore , Dcr ( pX , pY , R ) ≤ Dncr ( pX , pY , R ) in general , as we do not have access to shared randomness in Definition 2 . Also from the same argument that was made following Definition 2 , we have that Dcr ( pX , pY , R ) ≥ D ( pX , pY ) in Definition 1 . As with Definition 2 , we can also provide a natural operational interpretation . In particular , given the input X and common randomness U the encoder can output a compressed representation Z using the conditional distribution pZ|X , U . The representation Z can be losslessly compressed approximately to an average rate of R again by exploiting the shared randomness U . Finally the decoder , given Z and U can output the reconstruction Y using the conditional distribution pY |Z , U . An interesting difference with Definition 2 is that the setup is no longer symmetric between encoder and decoder , as X is independent of U but Y is not . The following result provides a simplification to the architecture in Definition 3 . Theorem 3 . Let Qcr ( pX , pY ) denote the set of joint distributions pU , X , Y compatible with the given marginals pX , pY satisfying pU , X , Y = pUpXpY |U , X as well as H ( Y |U , X ) = 0 . Then Dcr ( pX , pY , R ) = inf pU , X , Y ∈Qcr ( pX , pY ) E [ d ( X , Y ) ] s.t . H ( Y |U ) ≤ R. ( 12 ) Before discussing the implications of Theorem 3 we remark on a technical point . Because the Shannon entropy is defined only for discrete random variables , U must be chosen in a way such that Y |U = u is discrete for each u , even for continuous ( X , Y ) . This is known to be possible , e.g. , Li & El Gamal ( 2018 ) have provided a general construction for a U with this property , with additional quantitative guarantees to ensure that U is informative of Y . In the finite alphabet case we show in Appendix A.3 that optimization of U can be formulated as a linear program . We next discuss the implication of Theorem 3 . First note that the problem can be modelled with only pY |U , X producing a reconstruction Y without the need for the intermediate representation Z , much like the conventional optimal transport in Definition 1 . The condition H ( Y |U , X ) = 0 also implies that the transport plan is deterministic when conditioned on the shared randomness , which plays the role of stochasticity . Furthermore in this architecture the encoder should compute the representation Y given the sourceX and the shared random-variable U ( which corresponds to the transport problem ) and then compress it losslessly at a rate close to H ( Y |U ) ( which corresponds to the compression problem ) . The receiver only needs to decompress and reconstruct Y . This is in contrast to the case without common randomness in Theorem 1 where the reconstruction Y must be generated at the decoder . | The paper focuses on a very particular kind of lossy compression, which they call "cross-domain lossy compression". It basically amounts to encode a degraded version of the signal at the encoder while being able to reconstruct some better version at the decoder, while maintaining interesting rate constraints. As such, this scenario puts together signal compression and denoising/super-resolution, so that I can definitely say it comes with interesting applications. Technically, the authors show that the problem can be nicely formulated as a special kind of optimal transport under entropy constraints, which gives an interesting flavour to their contribution and much theoretical grounding for their proposed method. | SP:fb5766dfb5a0f870cb82c716da2df06aa41086b2 |
Learning Time-dependent PDE Solver using Message Passing Graph Neural Networks | 1 INTRODUCTION . Physical phenomena are generally modeled through partial differential equations ( PDEs ) that govern the dynamic evolution or static solution of a physical system . Numerically solving partial differential equations is an important aspect of scientific and mathematical modeling in a broad range of fields including physics , biology , material science , and finance . There have been many efforts to develop efficient and accurate numerical solvers for PDEs using different techniques including finite difference ( LeVeque , 2007 ; Shashkov & Steinberg , 2018 ) , finite volume ( Eymard et al. , 2000 ; Brenner et al. , 2008 ) , and finite element schemes ( Reddy , 2014 ; Wriggers , 2008 ) . While these methods have been successful in producing accurate solutions , major challenges for accelerating and reducing computational cost when the governing PDE is known , and also determining the governing PDE when the physical system is unknown , remains to be addressed , problems such as those in climate modeling , turbulent flow , contact problems , or plastic material deformation . With the recent developments in deep learning , faster algorithms have been proposed to evaluate the response of a physical system , using only observational data . While deep learning approaches , such as multi-layer perceptron ( MLP ) or convolutional neural networks ( CNNs ) , are powerful in learning PDE solutions , they are , however , restricted to a specific discretization of the physical domain in which they are trained . As a result , the learned model is limited to a specific domain and can not be generalized to solve on different domains or for different discretizations , although the underlying physics remains to be the same . New training is required for any change in the physical domain or discretization . Here we propose a discretization and domain invariant neural network time-dependent PDE solver based on message passing graph neural nets ( MPGNN ) which is trained on a sample domain with different discretizations . The trained MPGNN can then be used to solve for different discretization or even on other domains as long as the underlying physics remains the same . We further show that a recurrent version of MPGNN can be used to find a temporal sequence of solutions to a PDE . 2 RELATED WORKS . One class of neural-net-based PDE solvers focuses on using neural networks as proxies of PDEs and aims at finding the solution by minimizing a loss that corresponds to the solution satisfying the governing equations and the boundary conditions ( Raissi et al. , 2017a ; b ; Lagaris et al. , 1998 ; Weinan & Yu , 2018 ; Sirignano & Spiliopoulos , 2018 ; Khoo et al. , 2021 ) . Although such an approach helps to find the one-time solution of a PDE with an instance of parameters , a slight modification to the PDE parameters , boundary conditions , or the domain requires re-training of the network . Another approach to solving PDEs is to use convolutional neural nets and snapshots of observations over the discretized input domain and to learn the dynamic evolution of a PDE ( Long et al. , 2018 ; Shi et al. , 2020 ) . Further modifications such as using residual connections ( Ruthotto & Haber , 2020 ) , or autoregressive dense encoder-decoder ( Geneva & Zabaras , 2020 ) , or symbolic multi-layer neural network ( Long et al. , 2019 ) in addition to the CNN can be used to improve the results . While these models do not require prior knowledge of the PDE , they are limited to domain discretization ( as a result can not be generalized to arbitrary domains ) and are limited to certain time discretization ( as a result unable to handle temporally and spatially sparse or non-uniform observations ) . Inspired by the discretization techniques in solving PDEs , a class of methods uses observational data to learn the discretization approximation required for the updates in classical computational PDE solver methods ( Bar-Sinai et al. , 2019 ; Kochkov et al. , 2021 ; Zhuang et al. , 2021 ; Han et al. , 2018 ) . In this approach , a neural network is used for better interpolation at coarse scale to be used in the framework of traditional numerical discretization . These methods are used in conjunction with classical numerical methods and can improve the accuracy and accelerate the solutions of the traditional numerical schemes ( Kochkov et al. , 2021 ) . Although these methods have been shown to generalize to new parameter regimes of a PDE , they are still bounded to the initially trained discretization and can not be used for arbitrary domains without re-training . Lastly , a class of neural PDE solvers focus on graph representation of the discretized mesh datastructure to approximate the PDE solution ( Li et al. , 2020a ; b ; Iakovlev et al. , 2020 ; Belbute-Peres et al. , 2020 ) . The numerical solution of a PDE is an approximation of the solution on discrete locations comprising a discretized mesh of continuous space . Each node represents a region in the continuous space and the approximate solution of the PDE in that region is assigned to the representative node . The discretized mesh forms a graph where each node is used to model the state of the system and forms a connectivity graph connecting to the neighboring nodes . This method has successfully been used to solve time-independent PDEs with different mesh sizes on the same physical domain ( Li et al. , 2020a ) . The connectivity and the location of the nodes can further be optimized to learn the solution with different levels of precision ( Alet et al. , 2019 ) . If the PDE includes long-range interactions , which happens mostly in time-independent PDEs , a multi-level graph neural network framework to encapsulate long-range interactions can be used to improve the results ( Li et al. , 2020b ) . In contrast to time-independent PDEs , in the case of time-dependent PDEs , it has been shown that a continuous-time model similar to physics informed neural nets but with a graph neural network can be used to recover system ’ s dynamics with sparse observational data recorded at irregular times ( Iakovlev et al. , 2020 ; Poli et al. , 2019 ) . Recently , it have been shown that message passing graph neural networks can be used to implement powerful physical simulation engines ( Pfaff et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) . The state of a physical system can be expressed using a particle-based method as a reduced order model . The particles are then expressed as nodes in a graph and the message passing neural network learns to compute the dynamics of the particles ( Sanchez-Gonzalez et al. , 2020 ) . In addition to particle-based methods , mesh-based methods have been shown to be successful in physical simulations ( Pfaff et al. , 2020 ) . Such graph-based models , first encodes the input data into a latent space and then process it in the latent space ( reduced model ) , and to obtain the physical results decode the data back to the physical space . Here , we first show why graph neural networks can generalize to learn fast PDE solvers inspired by finite difference schemes . We introduce domain invariant features and boundary conditions inspired by classical PDE solvers to improve the generalization of the learned PDE solver operator . With the introduced features , we show that message passing graph neural network architecture efficiently fits the classical PDE solvers and can learn time-stepping/solver operators for linear and nonlinear PDEs with different boundary conditions . We further demonstrate that our trained graph neural network solver can be generalized to solve PDEs on physical domains different from the domain that it is trained on . This is beneficial to train GNN on a sample of small domains for even with unknown dynamics , and further , explore the dynamic behavior on different larger physical domains . Lastly , we show that a recurrent version of our MPGNN can be used to predict the temporal sequence of solutions to a PDE . 3 TIME-DEPENDENT PDES . We consider continuous dynamical system u ( x , t ) ∈ R evolving over time t ∈ R+ and spatial coordinate x ∈ Ω ⊂ Rd where Ω is a bounded d-dimensional domain . We assume the system is governed by a partial differential equation of the form ut = N [ u ; λ ] ( 1 ) where N [ · ; λ ] denotes the linear/nonlinear differential operator ( s ) parameterized by the vector λ . In the above general form , the temporal evolution of the current state ut depends on the differential operator N [ · ; λ ] which may include various spatial derivatives of the state including∇u , ∇2u , etc . Depending on the differential operator N , appropriate boundary conditions on ∂Ω is required for a well-posed PDE with a unique solution . Such PDE model is the cornerstone of mathematical models and is widely used to model various systems , from fluid dynamics , thermal sciences , to acoustics , and quantum mechanics . As an example , ut = N [ u ; λ ] = λ1∇2u + λ2 · ∇u constitutes a convection diffusion equation for u ∈ R as variable of interest , where λ = λ1 , λ2 are the diffusitivity and the velocity field vector with which the quantity is moving with . The state of the system at each time can be obtained using its initial state and time integration as u ( x , t ) = u ( x , 0 ) + ∫ t 0 N ( u ; λ ) dt . Numerous numerical techniques such as Finite Elements , Spectral Methods , Finite Difference , or Finite Volume techniques have been developed to efficiently approximate the differential operator N ( · ; λ ) and solve for a dynamical system over time . In all numerical schemes , the domain is first discretized with a mesh , the differential operator is approximated locally using neighboring points , and the solution is calculated over small time steps using a time integrator such as Euler ’ s scheme , i.e. , un+1 ( xi ) = u n ( xi ) + δtF ( un ( xi ) , ∇un ( xi ) , ∇2un ( xi ) , · · · ; λ ( xi ) ) ( 2 ) where the superscript n shows the solution over discretised time tn , and the differential operator N ( u ; λ ) = F ( u , ∇u , ∇2u , · · · ; λ ) shows that it contains information about local spatial derivatives . As an example , consider solving heat equation , ut = D∇2u , where D is the diffusion constant and ∇2u = ∂2u/∂x2 + ∂2u/∂y2 , on an structured grid shown in Fig . 1a . Let uni , j be the discretized solution at time t = nδt and spatial location x = iδx and y = jδy where δt , δx , and δy are the time , horizontal , and vertical spatial discretization respectively . The time and spatial derivatives in the heat equation can be expanded using Taylor series at each discretized point , where ∂uni , j/∂t = ( u n+1 i , j − uni , j ) /δt , ∂2uni , j/∂x 2 = ( uni+1 , j − 2uni , j + uni+1 , j ) /δx2 , and etc . Re-writing the equation for an arbitrary discretized point , we find un+1i , j = u n i , j + δtF where F = α ( ui , j+1 − ui , j ) + α ( ui , j−1 − ui , j ) + β ( ui+1 , j − ui , j ) + β ( ui−1 , j − ui , j ) , where α = Dδt/δx2 and β = Dδt/δy2 . Solving for this equation for all the points along with the boundary conditions the updates for the discretized points can be achieved . Note that here the update rule can be seen as the summation of updates that only depend on neighboring points . Although in this example with a simple linear equation and a structured grid it was easy to find the update rule F , given an arbitrary domain that requires a triangular mesh for discretization ( see Fig . 1b ) and a nonlinear governing equation the update rule is not straight forward to be worked out . Our objective here is to learn the approximation of the differential operator using a graph representation of the domain with message passing neural networks . Since in a general PDE the differential operator F ( u , ∇u , ∇2u , · · · ; λ ) contains local spatial derivatives and only local neighboring values at a point are relevant to approximate the differential operator at that point . As a result , a graph neural network is a promising framework to approximate the above right-hand side for the next value predictions . | A message passing graph neural network is used to predict the time-dependent solution to a family of PDEs. The PDE parameters, initial conditions, and boundary conditions are input to the network, an it outputs the solution 1 time-step into the future. The authors show how to train such a system on the Heat equation, Navier-Stokes, and advection-diffusion equations. The flexibility of the message passing graph neural network permits its deployment on a diverse set of geometries and boundary conditions. | SP:2f72777598a3d3624e8d27821bb0a2830ec9e153 |
Learning Time-dependent PDE Solver using Message Passing Graph Neural Networks | 1 INTRODUCTION . Physical phenomena are generally modeled through partial differential equations ( PDEs ) that govern the dynamic evolution or static solution of a physical system . Numerically solving partial differential equations is an important aspect of scientific and mathematical modeling in a broad range of fields including physics , biology , material science , and finance . There have been many efforts to develop efficient and accurate numerical solvers for PDEs using different techniques including finite difference ( LeVeque , 2007 ; Shashkov & Steinberg , 2018 ) , finite volume ( Eymard et al. , 2000 ; Brenner et al. , 2008 ) , and finite element schemes ( Reddy , 2014 ; Wriggers , 2008 ) . While these methods have been successful in producing accurate solutions , major challenges for accelerating and reducing computational cost when the governing PDE is known , and also determining the governing PDE when the physical system is unknown , remains to be addressed , problems such as those in climate modeling , turbulent flow , contact problems , or plastic material deformation . With the recent developments in deep learning , faster algorithms have been proposed to evaluate the response of a physical system , using only observational data . While deep learning approaches , such as multi-layer perceptron ( MLP ) or convolutional neural networks ( CNNs ) , are powerful in learning PDE solutions , they are , however , restricted to a specific discretization of the physical domain in which they are trained . As a result , the learned model is limited to a specific domain and can not be generalized to solve on different domains or for different discretizations , although the underlying physics remains to be the same . New training is required for any change in the physical domain or discretization . Here we propose a discretization and domain invariant neural network time-dependent PDE solver based on message passing graph neural nets ( MPGNN ) which is trained on a sample domain with different discretizations . The trained MPGNN can then be used to solve for different discretization or even on other domains as long as the underlying physics remains the same . We further show that a recurrent version of MPGNN can be used to find a temporal sequence of solutions to a PDE . 2 RELATED WORKS . One class of neural-net-based PDE solvers focuses on using neural networks as proxies of PDEs and aims at finding the solution by minimizing a loss that corresponds to the solution satisfying the governing equations and the boundary conditions ( Raissi et al. , 2017a ; b ; Lagaris et al. , 1998 ; Weinan & Yu , 2018 ; Sirignano & Spiliopoulos , 2018 ; Khoo et al. , 2021 ) . Although such an approach helps to find the one-time solution of a PDE with an instance of parameters , a slight modification to the PDE parameters , boundary conditions , or the domain requires re-training of the network . Another approach to solving PDEs is to use convolutional neural nets and snapshots of observations over the discretized input domain and to learn the dynamic evolution of a PDE ( Long et al. , 2018 ; Shi et al. , 2020 ) . Further modifications such as using residual connections ( Ruthotto & Haber , 2020 ) , or autoregressive dense encoder-decoder ( Geneva & Zabaras , 2020 ) , or symbolic multi-layer neural network ( Long et al. , 2019 ) in addition to the CNN can be used to improve the results . While these models do not require prior knowledge of the PDE , they are limited to domain discretization ( as a result can not be generalized to arbitrary domains ) and are limited to certain time discretization ( as a result unable to handle temporally and spatially sparse or non-uniform observations ) . Inspired by the discretization techniques in solving PDEs , a class of methods uses observational data to learn the discretization approximation required for the updates in classical computational PDE solver methods ( Bar-Sinai et al. , 2019 ; Kochkov et al. , 2021 ; Zhuang et al. , 2021 ; Han et al. , 2018 ) . In this approach , a neural network is used for better interpolation at coarse scale to be used in the framework of traditional numerical discretization . These methods are used in conjunction with classical numerical methods and can improve the accuracy and accelerate the solutions of the traditional numerical schemes ( Kochkov et al. , 2021 ) . Although these methods have been shown to generalize to new parameter regimes of a PDE , they are still bounded to the initially trained discretization and can not be used for arbitrary domains without re-training . Lastly , a class of neural PDE solvers focus on graph representation of the discretized mesh datastructure to approximate the PDE solution ( Li et al. , 2020a ; b ; Iakovlev et al. , 2020 ; Belbute-Peres et al. , 2020 ) . The numerical solution of a PDE is an approximation of the solution on discrete locations comprising a discretized mesh of continuous space . Each node represents a region in the continuous space and the approximate solution of the PDE in that region is assigned to the representative node . The discretized mesh forms a graph where each node is used to model the state of the system and forms a connectivity graph connecting to the neighboring nodes . This method has successfully been used to solve time-independent PDEs with different mesh sizes on the same physical domain ( Li et al. , 2020a ) . The connectivity and the location of the nodes can further be optimized to learn the solution with different levels of precision ( Alet et al. , 2019 ) . If the PDE includes long-range interactions , which happens mostly in time-independent PDEs , a multi-level graph neural network framework to encapsulate long-range interactions can be used to improve the results ( Li et al. , 2020b ) . In contrast to time-independent PDEs , in the case of time-dependent PDEs , it has been shown that a continuous-time model similar to physics informed neural nets but with a graph neural network can be used to recover system ’ s dynamics with sparse observational data recorded at irregular times ( Iakovlev et al. , 2020 ; Poli et al. , 2019 ) . Recently , it have been shown that message passing graph neural networks can be used to implement powerful physical simulation engines ( Pfaff et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) . The state of a physical system can be expressed using a particle-based method as a reduced order model . The particles are then expressed as nodes in a graph and the message passing neural network learns to compute the dynamics of the particles ( Sanchez-Gonzalez et al. , 2020 ) . In addition to particle-based methods , mesh-based methods have been shown to be successful in physical simulations ( Pfaff et al. , 2020 ) . Such graph-based models , first encodes the input data into a latent space and then process it in the latent space ( reduced model ) , and to obtain the physical results decode the data back to the physical space . Here , we first show why graph neural networks can generalize to learn fast PDE solvers inspired by finite difference schemes . We introduce domain invariant features and boundary conditions inspired by classical PDE solvers to improve the generalization of the learned PDE solver operator . With the introduced features , we show that message passing graph neural network architecture efficiently fits the classical PDE solvers and can learn time-stepping/solver operators for linear and nonlinear PDEs with different boundary conditions . We further demonstrate that our trained graph neural network solver can be generalized to solve PDEs on physical domains different from the domain that it is trained on . This is beneficial to train GNN on a sample of small domains for even with unknown dynamics , and further , explore the dynamic behavior on different larger physical domains . Lastly , we show that a recurrent version of our MPGNN can be used to predict the temporal sequence of solutions to a PDE . 3 TIME-DEPENDENT PDES . We consider continuous dynamical system u ( x , t ) ∈ R evolving over time t ∈ R+ and spatial coordinate x ∈ Ω ⊂ Rd where Ω is a bounded d-dimensional domain . We assume the system is governed by a partial differential equation of the form ut = N [ u ; λ ] ( 1 ) where N [ · ; λ ] denotes the linear/nonlinear differential operator ( s ) parameterized by the vector λ . In the above general form , the temporal evolution of the current state ut depends on the differential operator N [ · ; λ ] which may include various spatial derivatives of the state including∇u , ∇2u , etc . Depending on the differential operator N , appropriate boundary conditions on ∂Ω is required for a well-posed PDE with a unique solution . Such PDE model is the cornerstone of mathematical models and is widely used to model various systems , from fluid dynamics , thermal sciences , to acoustics , and quantum mechanics . As an example , ut = N [ u ; λ ] = λ1∇2u + λ2 · ∇u constitutes a convection diffusion equation for u ∈ R as variable of interest , where λ = λ1 , λ2 are the diffusitivity and the velocity field vector with which the quantity is moving with . The state of the system at each time can be obtained using its initial state and time integration as u ( x , t ) = u ( x , 0 ) + ∫ t 0 N ( u ; λ ) dt . Numerous numerical techniques such as Finite Elements , Spectral Methods , Finite Difference , or Finite Volume techniques have been developed to efficiently approximate the differential operator N ( · ; λ ) and solve for a dynamical system over time . In all numerical schemes , the domain is first discretized with a mesh , the differential operator is approximated locally using neighboring points , and the solution is calculated over small time steps using a time integrator such as Euler ’ s scheme , i.e. , un+1 ( xi ) = u n ( xi ) + δtF ( un ( xi ) , ∇un ( xi ) , ∇2un ( xi ) , · · · ; λ ( xi ) ) ( 2 ) where the superscript n shows the solution over discretised time tn , and the differential operator N ( u ; λ ) = F ( u , ∇u , ∇2u , · · · ; λ ) shows that it contains information about local spatial derivatives . As an example , consider solving heat equation , ut = D∇2u , where D is the diffusion constant and ∇2u = ∂2u/∂x2 + ∂2u/∂y2 , on an structured grid shown in Fig . 1a . Let uni , j be the discretized solution at time t = nδt and spatial location x = iδx and y = jδy where δt , δx , and δy are the time , horizontal , and vertical spatial discretization respectively . The time and spatial derivatives in the heat equation can be expanded using Taylor series at each discretized point , where ∂uni , j/∂t = ( u n+1 i , j − uni , j ) /δt , ∂2uni , j/∂x 2 = ( uni+1 , j − 2uni , j + uni+1 , j ) /δx2 , and etc . Re-writing the equation for an arbitrary discretized point , we find un+1i , j = u n i , j + δtF where F = α ( ui , j+1 − ui , j ) + α ( ui , j−1 − ui , j ) + β ( ui+1 , j − ui , j ) + β ( ui−1 , j − ui , j ) , where α = Dδt/δx2 and β = Dδt/δy2 . Solving for this equation for all the points along with the boundary conditions the updates for the discretized points can be achieved . Note that here the update rule can be seen as the summation of updates that only depend on neighboring points . Although in this example with a simple linear equation and a structured grid it was easy to find the update rule F , given an arbitrary domain that requires a triangular mesh for discretization ( see Fig . 1b ) and a nonlinear governing equation the update rule is not straight forward to be worked out . Our objective here is to learn the approximation of the differential operator using a graph representation of the domain with message passing neural networks . Since in a general PDE the differential operator F ( u , ∇u , ∇2u , · · · ; λ ) contains local spatial derivatives and only local neighboring values at a point are relevant to approximate the differential operator at that point . As a result , a graph neural network is a promising framework to approximate the above right-hand side for the next value predictions . | The paper presents a method for learning mesh-based simulation of partial differential equations using graph neural networks (GNNs). The authors train the GNN to match a reference solution and demonstrate that the trained GNN can generalize to solving PDEs on different domains. Additionally, the authors show a recurrent variant of the network that can solve time-dependent PDEs. The method is shown to work on a number of test problems, including advection-diffusion and Navier-Stokes equations. Overall, the authors show that GNN-based simulation is a promising approach for improving the flexibility and generalization of learned PDE solvers. | SP:2f72777598a3d3624e8d27821bb0a2830ec9e153 |
Learning Time-dependent PDE Solver using Message Passing Graph Neural Networks | 1 INTRODUCTION . Physical phenomena are generally modeled through partial differential equations ( PDEs ) that govern the dynamic evolution or static solution of a physical system . Numerically solving partial differential equations is an important aspect of scientific and mathematical modeling in a broad range of fields including physics , biology , material science , and finance . There have been many efforts to develop efficient and accurate numerical solvers for PDEs using different techniques including finite difference ( LeVeque , 2007 ; Shashkov & Steinberg , 2018 ) , finite volume ( Eymard et al. , 2000 ; Brenner et al. , 2008 ) , and finite element schemes ( Reddy , 2014 ; Wriggers , 2008 ) . While these methods have been successful in producing accurate solutions , major challenges for accelerating and reducing computational cost when the governing PDE is known , and also determining the governing PDE when the physical system is unknown , remains to be addressed , problems such as those in climate modeling , turbulent flow , contact problems , or plastic material deformation . With the recent developments in deep learning , faster algorithms have been proposed to evaluate the response of a physical system , using only observational data . While deep learning approaches , such as multi-layer perceptron ( MLP ) or convolutional neural networks ( CNNs ) , are powerful in learning PDE solutions , they are , however , restricted to a specific discretization of the physical domain in which they are trained . As a result , the learned model is limited to a specific domain and can not be generalized to solve on different domains or for different discretizations , although the underlying physics remains to be the same . New training is required for any change in the physical domain or discretization . Here we propose a discretization and domain invariant neural network time-dependent PDE solver based on message passing graph neural nets ( MPGNN ) which is trained on a sample domain with different discretizations . The trained MPGNN can then be used to solve for different discretization or even on other domains as long as the underlying physics remains the same . We further show that a recurrent version of MPGNN can be used to find a temporal sequence of solutions to a PDE . 2 RELATED WORKS . One class of neural-net-based PDE solvers focuses on using neural networks as proxies of PDEs and aims at finding the solution by minimizing a loss that corresponds to the solution satisfying the governing equations and the boundary conditions ( Raissi et al. , 2017a ; b ; Lagaris et al. , 1998 ; Weinan & Yu , 2018 ; Sirignano & Spiliopoulos , 2018 ; Khoo et al. , 2021 ) . Although such an approach helps to find the one-time solution of a PDE with an instance of parameters , a slight modification to the PDE parameters , boundary conditions , or the domain requires re-training of the network . Another approach to solving PDEs is to use convolutional neural nets and snapshots of observations over the discretized input domain and to learn the dynamic evolution of a PDE ( Long et al. , 2018 ; Shi et al. , 2020 ) . Further modifications such as using residual connections ( Ruthotto & Haber , 2020 ) , or autoregressive dense encoder-decoder ( Geneva & Zabaras , 2020 ) , or symbolic multi-layer neural network ( Long et al. , 2019 ) in addition to the CNN can be used to improve the results . While these models do not require prior knowledge of the PDE , they are limited to domain discretization ( as a result can not be generalized to arbitrary domains ) and are limited to certain time discretization ( as a result unable to handle temporally and spatially sparse or non-uniform observations ) . Inspired by the discretization techniques in solving PDEs , a class of methods uses observational data to learn the discretization approximation required for the updates in classical computational PDE solver methods ( Bar-Sinai et al. , 2019 ; Kochkov et al. , 2021 ; Zhuang et al. , 2021 ; Han et al. , 2018 ) . In this approach , a neural network is used for better interpolation at coarse scale to be used in the framework of traditional numerical discretization . These methods are used in conjunction with classical numerical methods and can improve the accuracy and accelerate the solutions of the traditional numerical schemes ( Kochkov et al. , 2021 ) . Although these methods have been shown to generalize to new parameter regimes of a PDE , they are still bounded to the initially trained discretization and can not be used for arbitrary domains without re-training . Lastly , a class of neural PDE solvers focus on graph representation of the discretized mesh datastructure to approximate the PDE solution ( Li et al. , 2020a ; b ; Iakovlev et al. , 2020 ; Belbute-Peres et al. , 2020 ) . The numerical solution of a PDE is an approximation of the solution on discrete locations comprising a discretized mesh of continuous space . Each node represents a region in the continuous space and the approximate solution of the PDE in that region is assigned to the representative node . The discretized mesh forms a graph where each node is used to model the state of the system and forms a connectivity graph connecting to the neighboring nodes . This method has successfully been used to solve time-independent PDEs with different mesh sizes on the same physical domain ( Li et al. , 2020a ) . The connectivity and the location of the nodes can further be optimized to learn the solution with different levels of precision ( Alet et al. , 2019 ) . If the PDE includes long-range interactions , which happens mostly in time-independent PDEs , a multi-level graph neural network framework to encapsulate long-range interactions can be used to improve the results ( Li et al. , 2020b ) . In contrast to time-independent PDEs , in the case of time-dependent PDEs , it has been shown that a continuous-time model similar to physics informed neural nets but with a graph neural network can be used to recover system ’ s dynamics with sparse observational data recorded at irregular times ( Iakovlev et al. , 2020 ; Poli et al. , 2019 ) . Recently , it have been shown that message passing graph neural networks can be used to implement powerful physical simulation engines ( Pfaff et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) . The state of a physical system can be expressed using a particle-based method as a reduced order model . The particles are then expressed as nodes in a graph and the message passing neural network learns to compute the dynamics of the particles ( Sanchez-Gonzalez et al. , 2020 ) . In addition to particle-based methods , mesh-based methods have been shown to be successful in physical simulations ( Pfaff et al. , 2020 ) . Such graph-based models , first encodes the input data into a latent space and then process it in the latent space ( reduced model ) , and to obtain the physical results decode the data back to the physical space . Here , we first show why graph neural networks can generalize to learn fast PDE solvers inspired by finite difference schemes . We introduce domain invariant features and boundary conditions inspired by classical PDE solvers to improve the generalization of the learned PDE solver operator . With the introduced features , we show that message passing graph neural network architecture efficiently fits the classical PDE solvers and can learn time-stepping/solver operators for linear and nonlinear PDEs with different boundary conditions . We further demonstrate that our trained graph neural network solver can be generalized to solve PDEs on physical domains different from the domain that it is trained on . This is beneficial to train GNN on a sample of small domains for even with unknown dynamics , and further , explore the dynamic behavior on different larger physical domains . Lastly , we show that a recurrent version of our MPGNN can be used to predict the temporal sequence of solutions to a PDE . 3 TIME-DEPENDENT PDES . We consider continuous dynamical system u ( x , t ) ∈ R evolving over time t ∈ R+ and spatial coordinate x ∈ Ω ⊂ Rd where Ω is a bounded d-dimensional domain . We assume the system is governed by a partial differential equation of the form ut = N [ u ; λ ] ( 1 ) where N [ · ; λ ] denotes the linear/nonlinear differential operator ( s ) parameterized by the vector λ . In the above general form , the temporal evolution of the current state ut depends on the differential operator N [ · ; λ ] which may include various spatial derivatives of the state including∇u , ∇2u , etc . Depending on the differential operator N , appropriate boundary conditions on ∂Ω is required for a well-posed PDE with a unique solution . Such PDE model is the cornerstone of mathematical models and is widely used to model various systems , from fluid dynamics , thermal sciences , to acoustics , and quantum mechanics . As an example , ut = N [ u ; λ ] = λ1∇2u + λ2 · ∇u constitutes a convection diffusion equation for u ∈ R as variable of interest , where λ = λ1 , λ2 are the diffusitivity and the velocity field vector with which the quantity is moving with . The state of the system at each time can be obtained using its initial state and time integration as u ( x , t ) = u ( x , 0 ) + ∫ t 0 N ( u ; λ ) dt . Numerous numerical techniques such as Finite Elements , Spectral Methods , Finite Difference , or Finite Volume techniques have been developed to efficiently approximate the differential operator N ( · ; λ ) and solve for a dynamical system over time . In all numerical schemes , the domain is first discretized with a mesh , the differential operator is approximated locally using neighboring points , and the solution is calculated over small time steps using a time integrator such as Euler ’ s scheme , i.e. , un+1 ( xi ) = u n ( xi ) + δtF ( un ( xi ) , ∇un ( xi ) , ∇2un ( xi ) , · · · ; λ ( xi ) ) ( 2 ) where the superscript n shows the solution over discretised time tn , and the differential operator N ( u ; λ ) = F ( u , ∇u , ∇2u , · · · ; λ ) shows that it contains information about local spatial derivatives . As an example , consider solving heat equation , ut = D∇2u , where D is the diffusion constant and ∇2u = ∂2u/∂x2 + ∂2u/∂y2 , on an structured grid shown in Fig . 1a . Let uni , j be the discretized solution at time t = nδt and spatial location x = iδx and y = jδy where δt , δx , and δy are the time , horizontal , and vertical spatial discretization respectively . The time and spatial derivatives in the heat equation can be expanded using Taylor series at each discretized point , where ∂uni , j/∂t = ( u n+1 i , j − uni , j ) /δt , ∂2uni , j/∂x 2 = ( uni+1 , j − 2uni , j + uni+1 , j ) /δx2 , and etc . Re-writing the equation for an arbitrary discretized point , we find un+1i , j = u n i , j + δtF where F = α ( ui , j+1 − ui , j ) + α ( ui , j−1 − ui , j ) + β ( ui+1 , j − ui , j ) + β ( ui−1 , j − ui , j ) , where α = Dδt/δx2 and β = Dδt/δy2 . Solving for this equation for all the points along with the boundary conditions the updates for the discretized points can be achieved . Note that here the update rule can be seen as the summation of updates that only depend on neighboring points . Although in this example with a simple linear equation and a structured grid it was easy to find the update rule F , given an arbitrary domain that requires a triangular mesh for discretization ( see Fig . 1b ) and a nonlinear governing equation the update rule is not straight forward to be worked out . Our objective here is to learn the approximation of the differential operator using a graph representation of the domain with message passing neural networks . Since in a general PDE the differential operator F ( u , ∇u , ∇2u , · · · ; λ ) contains local spatial derivatives and only local neighboring values at a point are relevant to approximate the differential operator at that point . As a result , a graph neural network is a promising framework to approximate the above right-hand side for the next value predictions . | This paper presents a graph neural network approach by using a message-passing model to find efficient PDE solvers. It further shows that the trained solver can find a temporal sequence of PDE solutions in different domains. The proposed method is a nice idea and has been well verified. However, given the very limited scope of application in this paper, only toy environments with high-resolution numerical data sets can be used, more detailed ablation and comparison experiments may be required to ablate the model in a more refined manner. | SP:2f72777598a3d3624e8d27821bb0a2830ec9e153 |
Graph-Relational Domain Adaptation | 1 INTRODUCTION . Generalization of machine learning methods hinges on the assumption that training and test data follows the same distribution . Such an assumption no longer holds when one trains a model in some domains ( source domains ) , and tests it in other domains ( target domains ) where data follows different distributions . Domain adaptation ( DA ) aims at improving performance in this setting by aligning data from the source and target domains so that a model trained in source domains can generalize better in target domains ( Ben-David et al. , 2010 ; Ganin et al. , 2016 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ) . Existing DA methods tend to enforce uniform alignment , i.e. , to treat every domain equally and align them all perfectly . However , in practice the domains are often heterogeneous ; one can expect DA to work well when the source domains are close to the target domains , but not when they are too far from each other ( Zhao et al. , 2019 ; Wang et al. , 2020 ) . Such heterogeneity can often be captured by a graph , where the domains realize the nodes , and the adjacency between two domains can be captured by an edge ( see Fig . 1 ) . For example , to capture the similarity of weather in the US , we can construct a graph where each state is treated as a node and the physical proximity between two states results in an edge . There are also many other scenarios where the relation among domains can be naturally captured by a graph , such as the taxonomies of products in retail or connections among research fields of academic papers . Given a domain graph , we can tailor the adaptation of domains to the graph , rather than dictating the data from all the domains to align perfectly regardless of the graph structure . One naïve DA method for such graph-relational domains is to perform DA for each pair of neighboring domains separately . Unfortunately , due to the strict alignment between each domain pair , this method will still lead to uniform alignment so long as the graph is connected . To generalize DA to the graphrelational domains , we argue that an ideal method should ( 1 ) only enforce uniform alignment when the domain graph is a clique ( i.e. , every two domains are adjacent ) , and ( 2 ) more importantly , relax uniform alignment to adapt more flexibly across domains according to any non-clique domain graph , thereby naturally incorporating information on the domain adjacency . In this paper , we generalize adversarial DA methods and replace the traditional binary ( or multi-class ) discriminator with a novel graph discriminator : instead of distinguishing among different domains , our graph discriminator takes as input the encodings of data to reconstruct the domain graph . We show that our method enjoys the following theoretical guarantees : it recovers classic DA when the the domain graph is a clique , and realizes intuitive alignments for other types of graphs such as chains and stars ( see Fig . 4 ) . We summarize our contributions as follows : • We propose to use a graph to characterize domain relations and develop graph-relational domain adaptation ( GRDA ) as the first general adversarial DA method to adapt across domains living on a graph . • We provide theoretical analysis showing that at equilibrium , our method can retain the capability of uniform alignment when the domain graph is a clique , and achieve non-trivial alignment for other types of graphs . • Empirical results on both synthetic and real-world datasets demonstrate the superiority of our method over the state-of-the-art DA methods . 2 RELATED WORK . Adversarial Domain Adaptation . There have been extensive prior works on domain adaptation ( Pan & Yang , 2009 ; Pan et al. , 2010 ; Long et al. , 2018 ; Saito et al. , 2018 ; Sankaranarayanan et al. , 2018 ; Zhang et al. , 2019 ; Peng et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) . Typically they aim to align the distributions of the source and target domains with the hope that the predictor trained on labeled source data can generalize well on target data . Such alignment can be achieved by either directly matching their distributions ’ statistics ( Pan et al. , 2010 ; Tzeng et al. , 2014 ; Sun & Saenko , 2016 ; Peng et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) or training deep learning models with an additional adversarial loss ( Ganin et al. , 2016 ; Zhao et al. , 2017 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ; Kuroki et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ) . The latter , i.e. , adversarial domain adaptation , has received increasing attention and popularity because of its theoretical guarantees ( Goodfellow et al. , 2014 ; Zhao et al. , 2018 ; Zhang et al. , 2019 ; Zhao et al. , 2019 ) , its ability to train end-to-end with neural networks , and consequently its promising empirical performance . These methods typically treat every domain equally and enforce uniform alignment between source-domain data and target-domain data ; this is done by generating domain-invariant encodings , where domain invariance is achieved by training the encoder to fool the discriminator that classifies the domain index . In contrast , we naturally relax such uniform alignment using a graph discriminator to reconstruct a domain graph that describes domain adjacency . Domain Adaptation Related to Graphs . There are also works related to both DA and graphs . Usually they focus on adaptation between two domains where data points themselves are graphs . For example , ( Pilancı & Vural , 2019 ; Pilanci & Vural , 2020 ) use frequency analysis to align the data graphs between the source domain and the target domains , and ( Alam et al. , 2018 ; Ding et al. , 2018 ) perform label propagation on the data graph . In contrast , GRDA considers a setting completely different from the above references . Instead of focusing on adapting between two domains with data points in the form of graphs ( e.g. , each data point itself is a node ) , GRDA adapts across multiple domains ( e.g. , with each state in the US as a domain ) according to a domain graph ( i.e. , each domain is a node ) . Therefore the methods above are not applicable to our setting . Note that ( Mancini et al. , 2019 ) uses metadata-weighted batch normalization to propagate information among domains with similar metadata , but it is not an adversarial domain adaptation method . It is orthogonal to GRDA and can be used as a backbone network to further improve GRDA ’ s performance ( see the Appendix for empirical results ) . It is also worth noting that , in this paper , we assume the domain graph is given . It would be interesting future work to combine GRDA with domain relation inference methods ( e.g. , domain embeddings ( Peng et al. , 2020 ) ) when there is a natural but unobserved graph relation among domains . 3 METHOD . In this section , we will first briefly introduce the problem setting and then elaborate our domain adaptation method . 3.1 PROBLEM SETTING AND NOTATION . We focus on the unsupervised domain adaptation setting with N domains in total . Each domain has a discrete domain index u ∈ U = [ N ] , { 1 , . . . , N } , belonging to either the source domain index set Us or the target domain index set Ut . The relationship between domains is described by a domain graph with the adjacency matrix A = [ Aij ] , where i and j index nodes ( domains ) in the graph . Given labeled data { ( xsl , ysl , usl ) } nl=1 from source domains ( usl ∈ Us ) , unlabeled data { xtl , utl } ml=1 from target domains ( utl ∈ Ut ) , and the domain graph described by A , we want to predict the label { ytl } ml=1 for data from target domains . Note that the domain graph is defined on domains with each domain ( node ) containing multiple data points . 3.2 GRAPH-RELATIONAL DOMAIN ADAPTATION ( GRDA ) . Overview . We use an adversarial learning framework to perform adaptation across graph-relational domains . The adversarial game consists of three players : ( 1 ) an encoder E , which takes as input a datum xl , the associated domain index ul , and the adjacency matrix A to generate an encoding el = E ( xl , ul , A ) , ( 2 ) a predictor F , which makes predictions based on the encoding el , and ( 3 ) a graph discriminator D , which guides the encoding to adapt across graph-relational domains . Specifically , the discriminator D takes in a mini-batch of B encodings el ( l ∈ [ B ] ) , and tries to reconstruct the domain graph A . By letting the encoder E play adversarially against the discriminator D , the graph-relational information of domains will be removed from the encoding el in order to make the discriminator D incapable of reconstructing the graph . Note that the graph discriminator in our adversarial game is different from classic discriminators which classify the domain index , as shown in Fig . 2 . Formally , GRDA performs a minimax optimization with the following loss function : min E , F max D Lf ( E , F ) − λdLd ( D , E ) , ( 1 ) where Lf ( E , F ) is the predictor loss and Ld ( D , E ) is the discriminator loss , and λd is a hyperparameter balancing them two . Below we discussed these two terms in detail . Predictor . In Eqn . 1 , the predictor loss Lf ( E , F ) is defined as Lf ( E , F ) , Es [ hp ( F ( E ( xl , ul , A ) ) , y ) ] , where the expectation Es is taken over the sourcedomain data distribution ps ( x , y , u ) . hp ( · , · ) is a predictor loss function for the task ( e.g. , L2 loss for regression ) . Encoder and Node Embeddings . Given an input tuple ( xl , ul , A ) , the encoder E first computes a graph-informed domain embedding zul based on the domain index ul and the domain graph A . Then we feed zul along with xl into a neural network to obtain the final encoding el . Formally we have el = E ( xl , ul , A ) = f ( xl , zul ) , ( 2 ) where f ( · , · ) is a trainable neural network . In theory , any embeddings for node ( domain ) indices should work equally well so long as they are distinct from one another ( thus forming a bijection to the set of domains [ N ] ) . Here we pre-train the embeddings by a reconstruction loss for simplicity , and our intuition is that good embeddings of nodes should inform us of ( thus reconstruct ) the graph structure . Suppose the nodes indices i and j are sampled independently and identically from the marginal domain index distribution p ( u ) ; the reconstruction loss is written as Lg = Ei , j∼p ( u ) [ −Aij log σ ( z > i zj ) − ( 1−Aij ) log ( 1− σ ( z > i zj ) ) ] , where σ ( x ) = 11+e−x is the sigmoid function . Note that in general we could use any node embedding methods ( Grover & Leskovec , 2016 ; Tang et al. , 2015 ; Kipf & Welling , 2016b ) , but this is not the focus of this paper . For fair comparison , we use exactly the same encoder , i.e. , E ( x , u , A ) , for all the methods in the experiments of Sec . 5 . Graph Discriminator . The discriminator loss Ld ( D , E ) in Eqn . 1 is defined as Ld ( D , E ) , E ( x1 , u1 ) , ( x2 , u2 ) [ h ( x1 , u1 , x2 , u2 ) ] , ( 3 ) h ( x1 , u1 , x2 , u2 ) =−Au1 , u2 log σ ( ẑ > 1 ẑ2 ) − ( 1−Au1 , u2 ) log ( 1− σ ( ẑ > 1 ẑ2 ) , where ẑ1 = D ( E ( x1 , u1 , A ) ) , ẑ2 = D ( E ( x2 , u2 , A ) ) are the discriminator ’ s reconstructions of node embeddings . The expectation E is taken over a pair of i.i.d . samples ( x1 , u1 ) , ( x2 , u2 ) from the joint data distribution p ( x , u ) . The discriminator loss Ld ( D , E ) essentially quantifies how well the reconstructed node embedding ẑ1 , ẑ2 preserve the information of the original connections , or , equivalently , A . We refer readers to the Appendix for detailed model architectures . Due to the adversarial nature of how the discriminator D and the encoder E engage with the loss , the discriminator D would aim to recover the domain graph via the adjacency structure ( A ) , while the encoder E would prevent the discriminator D from doing so . Intuitively , if the discriminator D is powerful enough to uncover any information regarding the domain graph in the encoding el , the optimal encoder E will have to remove all the information regarding graph-relational domains in the encoding el , thus successfully adapting across graph-relational domains . We will formally elaborate the above arguments further in the next section . | This paper explore multi-target domain adaptation by graph. For this setting, It is not suitable to treat equally every domain, and align them all perfectly. To remedy this problem, In this paper authors propose the graph-based method to learn the adjacency between domains. In this paper, authors propose adversarial learning method, which refers the encoder and the discriminator. What is more, authors show the theoretical analysis for this problem. The reported results shows that the proposed method successfully generalizes uniform alignment. | SP:7d857c6edf4f0229f9d73e57dc58a5853ff8d838 |
Graph-Relational Domain Adaptation | 1 INTRODUCTION . Generalization of machine learning methods hinges on the assumption that training and test data follows the same distribution . Such an assumption no longer holds when one trains a model in some domains ( source domains ) , and tests it in other domains ( target domains ) where data follows different distributions . Domain adaptation ( DA ) aims at improving performance in this setting by aligning data from the source and target domains so that a model trained in source domains can generalize better in target domains ( Ben-David et al. , 2010 ; Ganin et al. , 2016 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ) . Existing DA methods tend to enforce uniform alignment , i.e. , to treat every domain equally and align them all perfectly . However , in practice the domains are often heterogeneous ; one can expect DA to work well when the source domains are close to the target domains , but not when they are too far from each other ( Zhao et al. , 2019 ; Wang et al. , 2020 ) . Such heterogeneity can often be captured by a graph , where the domains realize the nodes , and the adjacency between two domains can be captured by an edge ( see Fig . 1 ) . For example , to capture the similarity of weather in the US , we can construct a graph where each state is treated as a node and the physical proximity between two states results in an edge . There are also many other scenarios where the relation among domains can be naturally captured by a graph , such as the taxonomies of products in retail or connections among research fields of academic papers . Given a domain graph , we can tailor the adaptation of domains to the graph , rather than dictating the data from all the domains to align perfectly regardless of the graph structure . One naïve DA method for such graph-relational domains is to perform DA for each pair of neighboring domains separately . Unfortunately , due to the strict alignment between each domain pair , this method will still lead to uniform alignment so long as the graph is connected . To generalize DA to the graphrelational domains , we argue that an ideal method should ( 1 ) only enforce uniform alignment when the domain graph is a clique ( i.e. , every two domains are adjacent ) , and ( 2 ) more importantly , relax uniform alignment to adapt more flexibly across domains according to any non-clique domain graph , thereby naturally incorporating information on the domain adjacency . In this paper , we generalize adversarial DA methods and replace the traditional binary ( or multi-class ) discriminator with a novel graph discriminator : instead of distinguishing among different domains , our graph discriminator takes as input the encodings of data to reconstruct the domain graph . We show that our method enjoys the following theoretical guarantees : it recovers classic DA when the the domain graph is a clique , and realizes intuitive alignments for other types of graphs such as chains and stars ( see Fig . 4 ) . We summarize our contributions as follows : • We propose to use a graph to characterize domain relations and develop graph-relational domain adaptation ( GRDA ) as the first general adversarial DA method to adapt across domains living on a graph . • We provide theoretical analysis showing that at equilibrium , our method can retain the capability of uniform alignment when the domain graph is a clique , and achieve non-trivial alignment for other types of graphs . • Empirical results on both synthetic and real-world datasets demonstrate the superiority of our method over the state-of-the-art DA methods . 2 RELATED WORK . Adversarial Domain Adaptation . There have been extensive prior works on domain adaptation ( Pan & Yang , 2009 ; Pan et al. , 2010 ; Long et al. , 2018 ; Saito et al. , 2018 ; Sankaranarayanan et al. , 2018 ; Zhang et al. , 2019 ; Peng et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) . Typically they aim to align the distributions of the source and target domains with the hope that the predictor trained on labeled source data can generalize well on target data . Such alignment can be achieved by either directly matching their distributions ’ statistics ( Pan et al. , 2010 ; Tzeng et al. , 2014 ; Sun & Saenko , 2016 ; Peng et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) or training deep learning models with an additional adversarial loss ( Ganin et al. , 2016 ; Zhao et al. , 2017 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ; Kuroki et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ) . The latter , i.e. , adversarial domain adaptation , has received increasing attention and popularity because of its theoretical guarantees ( Goodfellow et al. , 2014 ; Zhao et al. , 2018 ; Zhang et al. , 2019 ; Zhao et al. , 2019 ) , its ability to train end-to-end with neural networks , and consequently its promising empirical performance . These methods typically treat every domain equally and enforce uniform alignment between source-domain data and target-domain data ; this is done by generating domain-invariant encodings , where domain invariance is achieved by training the encoder to fool the discriminator that classifies the domain index . In contrast , we naturally relax such uniform alignment using a graph discriminator to reconstruct a domain graph that describes domain adjacency . Domain Adaptation Related to Graphs . There are also works related to both DA and graphs . Usually they focus on adaptation between two domains where data points themselves are graphs . For example , ( Pilancı & Vural , 2019 ; Pilanci & Vural , 2020 ) use frequency analysis to align the data graphs between the source domain and the target domains , and ( Alam et al. , 2018 ; Ding et al. , 2018 ) perform label propagation on the data graph . In contrast , GRDA considers a setting completely different from the above references . Instead of focusing on adapting between two domains with data points in the form of graphs ( e.g. , each data point itself is a node ) , GRDA adapts across multiple domains ( e.g. , with each state in the US as a domain ) according to a domain graph ( i.e. , each domain is a node ) . Therefore the methods above are not applicable to our setting . Note that ( Mancini et al. , 2019 ) uses metadata-weighted batch normalization to propagate information among domains with similar metadata , but it is not an adversarial domain adaptation method . It is orthogonal to GRDA and can be used as a backbone network to further improve GRDA ’ s performance ( see the Appendix for empirical results ) . It is also worth noting that , in this paper , we assume the domain graph is given . It would be interesting future work to combine GRDA with domain relation inference methods ( e.g. , domain embeddings ( Peng et al. , 2020 ) ) when there is a natural but unobserved graph relation among domains . 3 METHOD . In this section , we will first briefly introduce the problem setting and then elaborate our domain adaptation method . 3.1 PROBLEM SETTING AND NOTATION . We focus on the unsupervised domain adaptation setting with N domains in total . Each domain has a discrete domain index u ∈ U = [ N ] , { 1 , . . . , N } , belonging to either the source domain index set Us or the target domain index set Ut . The relationship between domains is described by a domain graph with the adjacency matrix A = [ Aij ] , where i and j index nodes ( domains ) in the graph . Given labeled data { ( xsl , ysl , usl ) } nl=1 from source domains ( usl ∈ Us ) , unlabeled data { xtl , utl } ml=1 from target domains ( utl ∈ Ut ) , and the domain graph described by A , we want to predict the label { ytl } ml=1 for data from target domains . Note that the domain graph is defined on domains with each domain ( node ) containing multiple data points . 3.2 GRAPH-RELATIONAL DOMAIN ADAPTATION ( GRDA ) . Overview . We use an adversarial learning framework to perform adaptation across graph-relational domains . The adversarial game consists of three players : ( 1 ) an encoder E , which takes as input a datum xl , the associated domain index ul , and the adjacency matrix A to generate an encoding el = E ( xl , ul , A ) , ( 2 ) a predictor F , which makes predictions based on the encoding el , and ( 3 ) a graph discriminator D , which guides the encoding to adapt across graph-relational domains . Specifically , the discriminator D takes in a mini-batch of B encodings el ( l ∈ [ B ] ) , and tries to reconstruct the domain graph A . By letting the encoder E play adversarially against the discriminator D , the graph-relational information of domains will be removed from the encoding el in order to make the discriminator D incapable of reconstructing the graph . Note that the graph discriminator in our adversarial game is different from classic discriminators which classify the domain index , as shown in Fig . 2 . Formally , GRDA performs a minimax optimization with the following loss function : min E , F max D Lf ( E , F ) − λdLd ( D , E ) , ( 1 ) where Lf ( E , F ) is the predictor loss and Ld ( D , E ) is the discriminator loss , and λd is a hyperparameter balancing them two . Below we discussed these two terms in detail . Predictor . In Eqn . 1 , the predictor loss Lf ( E , F ) is defined as Lf ( E , F ) , Es [ hp ( F ( E ( xl , ul , A ) ) , y ) ] , where the expectation Es is taken over the sourcedomain data distribution ps ( x , y , u ) . hp ( · , · ) is a predictor loss function for the task ( e.g. , L2 loss for regression ) . Encoder and Node Embeddings . Given an input tuple ( xl , ul , A ) , the encoder E first computes a graph-informed domain embedding zul based on the domain index ul and the domain graph A . Then we feed zul along with xl into a neural network to obtain the final encoding el . Formally we have el = E ( xl , ul , A ) = f ( xl , zul ) , ( 2 ) where f ( · , · ) is a trainable neural network . In theory , any embeddings for node ( domain ) indices should work equally well so long as they are distinct from one another ( thus forming a bijection to the set of domains [ N ] ) . Here we pre-train the embeddings by a reconstruction loss for simplicity , and our intuition is that good embeddings of nodes should inform us of ( thus reconstruct ) the graph structure . Suppose the nodes indices i and j are sampled independently and identically from the marginal domain index distribution p ( u ) ; the reconstruction loss is written as Lg = Ei , j∼p ( u ) [ −Aij log σ ( z > i zj ) − ( 1−Aij ) log ( 1− σ ( z > i zj ) ) ] , where σ ( x ) = 11+e−x is the sigmoid function . Note that in general we could use any node embedding methods ( Grover & Leskovec , 2016 ; Tang et al. , 2015 ; Kipf & Welling , 2016b ) , but this is not the focus of this paper . For fair comparison , we use exactly the same encoder , i.e. , E ( x , u , A ) , for all the methods in the experiments of Sec . 5 . Graph Discriminator . The discriminator loss Ld ( D , E ) in Eqn . 1 is defined as Ld ( D , E ) , E ( x1 , u1 ) , ( x2 , u2 ) [ h ( x1 , u1 , x2 , u2 ) ] , ( 3 ) h ( x1 , u1 , x2 , u2 ) =−Au1 , u2 log σ ( ẑ > 1 ẑ2 ) − ( 1−Au1 , u2 ) log ( 1− σ ( ẑ > 1 ẑ2 ) , where ẑ1 = D ( E ( x1 , u1 , A ) ) , ẑ2 = D ( E ( x2 , u2 , A ) ) are the discriminator ’ s reconstructions of node embeddings . The expectation E is taken over a pair of i.i.d . samples ( x1 , u1 ) , ( x2 , u2 ) from the joint data distribution p ( x , u ) . The discriminator loss Ld ( D , E ) essentially quantifies how well the reconstructed node embedding ẑ1 , ẑ2 preserve the information of the original connections , or , equivalently , A . We refer readers to the Appendix for detailed model architectures . Due to the adversarial nature of how the discriminator D and the encoder E engage with the loss , the discriminator D would aim to recover the domain graph via the adjacency structure ( A ) , while the encoder E would prevent the discriminator D from doing so . Intuitively , if the discriminator D is powerful enough to uncover any information regarding the domain graph in the encoding el , the optimal encoder E will have to remove all the information regarding graph-relational domains in the encoding el , thus successfully adapting across graph-relational domains . We will formally elaborate the above arguments further in the next section . | This paper proposes a new model called GRDA to relax the uniform alignment which ignores topological structures among different domains. GRDA uses a domain graph to encode domain adjacency. The authors also generalize the existing adversarial learning framework with a novel graph discriminator using encoding conditioned graph embeddings. Detailed math inductions and proofs are given. Empirical results on both synthetic and real-world datasets demonstrate the superiority of this method. | SP:7d857c6edf4f0229f9d73e57dc58a5853ff8d838 |
Graph-Relational Domain Adaptation | 1 INTRODUCTION . Generalization of machine learning methods hinges on the assumption that training and test data follows the same distribution . Such an assumption no longer holds when one trains a model in some domains ( source domains ) , and tests it in other domains ( target domains ) where data follows different distributions . Domain adaptation ( DA ) aims at improving performance in this setting by aligning data from the source and target domains so that a model trained in source domains can generalize better in target domains ( Ben-David et al. , 2010 ; Ganin et al. , 2016 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ) . Existing DA methods tend to enforce uniform alignment , i.e. , to treat every domain equally and align them all perfectly . However , in practice the domains are often heterogeneous ; one can expect DA to work well when the source domains are close to the target domains , but not when they are too far from each other ( Zhao et al. , 2019 ; Wang et al. , 2020 ) . Such heterogeneity can often be captured by a graph , where the domains realize the nodes , and the adjacency between two domains can be captured by an edge ( see Fig . 1 ) . For example , to capture the similarity of weather in the US , we can construct a graph where each state is treated as a node and the physical proximity between two states results in an edge . There are also many other scenarios where the relation among domains can be naturally captured by a graph , such as the taxonomies of products in retail or connections among research fields of academic papers . Given a domain graph , we can tailor the adaptation of domains to the graph , rather than dictating the data from all the domains to align perfectly regardless of the graph structure . One naïve DA method for such graph-relational domains is to perform DA for each pair of neighboring domains separately . Unfortunately , due to the strict alignment between each domain pair , this method will still lead to uniform alignment so long as the graph is connected . To generalize DA to the graphrelational domains , we argue that an ideal method should ( 1 ) only enforce uniform alignment when the domain graph is a clique ( i.e. , every two domains are adjacent ) , and ( 2 ) more importantly , relax uniform alignment to adapt more flexibly across domains according to any non-clique domain graph , thereby naturally incorporating information on the domain adjacency . In this paper , we generalize adversarial DA methods and replace the traditional binary ( or multi-class ) discriminator with a novel graph discriminator : instead of distinguishing among different domains , our graph discriminator takes as input the encodings of data to reconstruct the domain graph . We show that our method enjoys the following theoretical guarantees : it recovers classic DA when the the domain graph is a clique , and realizes intuitive alignments for other types of graphs such as chains and stars ( see Fig . 4 ) . We summarize our contributions as follows : • We propose to use a graph to characterize domain relations and develop graph-relational domain adaptation ( GRDA ) as the first general adversarial DA method to adapt across domains living on a graph . • We provide theoretical analysis showing that at equilibrium , our method can retain the capability of uniform alignment when the domain graph is a clique , and achieve non-trivial alignment for other types of graphs . • Empirical results on both synthetic and real-world datasets demonstrate the superiority of our method over the state-of-the-art DA methods . 2 RELATED WORK . Adversarial Domain Adaptation . There have been extensive prior works on domain adaptation ( Pan & Yang , 2009 ; Pan et al. , 2010 ; Long et al. , 2018 ; Saito et al. , 2018 ; Sankaranarayanan et al. , 2018 ; Zhang et al. , 2019 ; Peng et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) . Typically they aim to align the distributions of the source and target domains with the hope that the predictor trained on labeled source data can generalize well on target data . Such alignment can be achieved by either directly matching their distributions ’ statistics ( Pan et al. , 2010 ; Tzeng et al. , 2014 ; Sun & Saenko , 2016 ; Peng et al. , 2019 ; Nguyen-Meidine et al. , 2021 ) or training deep learning models with an additional adversarial loss ( Ganin et al. , 2016 ; Zhao et al. , 2017 ; Tzeng et al. , 2017 ; Zhang et al. , 2019 ; Kuroki et al. , 2019 ; Chen et al. , 2019 ; Dai et al. , 2019 ) . The latter , i.e. , adversarial domain adaptation , has received increasing attention and popularity because of its theoretical guarantees ( Goodfellow et al. , 2014 ; Zhao et al. , 2018 ; Zhang et al. , 2019 ; Zhao et al. , 2019 ) , its ability to train end-to-end with neural networks , and consequently its promising empirical performance . These methods typically treat every domain equally and enforce uniform alignment between source-domain data and target-domain data ; this is done by generating domain-invariant encodings , where domain invariance is achieved by training the encoder to fool the discriminator that classifies the domain index . In contrast , we naturally relax such uniform alignment using a graph discriminator to reconstruct a domain graph that describes domain adjacency . Domain Adaptation Related to Graphs . There are also works related to both DA and graphs . Usually they focus on adaptation between two domains where data points themselves are graphs . For example , ( Pilancı & Vural , 2019 ; Pilanci & Vural , 2020 ) use frequency analysis to align the data graphs between the source domain and the target domains , and ( Alam et al. , 2018 ; Ding et al. , 2018 ) perform label propagation on the data graph . In contrast , GRDA considers a setting completely different from the above references . Instead of focusing on adapting between two domains with data points in the form of graphs ( e.g. , each data point itself is a node ) , GRDA adapts across multiple domains ( e.g. , with each state in the US as a domain ) according to a domain graph ( i.e. , each domain is a node ) . Therefore the methods above are not applicable to our setting . Note that ( Mancini et al. , 2019 ) uses metadata-weighted batch normalization to propagate information among domains with similar metadata , but it is not an adversarial domain adaptation method . It is orthogonal to GRDA and can be used as a backbone network to further improve GRDA ’ s performance ( see the Appendix for empirical results ) . It is also worth noting that , in this paper , we assume the domain graph is given . It would be interesting future work to combine GRDA with domain relation inference methods ( e.g. , domain embeddings ( Peng et al. , 2020 ) ) when there is a natural but unobserved graph relation among domains . 3 METHOD . In this section , we will first briefly introduce the problem setting and then elaborate our domain adaptation method . 3.1 PROBLEM SETTING AND NOTATION . We focus on the unsupervised domain adaptation setting with N domains in total . Each domain has a discrete domain index u ∈ U = [ N ] , { 1 , . . . , N } , belonging to either the source domain index set Us or the target domain index set Ut . The relationship between domains is described by a domain graph with the adjacency matrix A = [ Aij ] , where i and j index nodes ( domains ) in the graph . Given labeled data { ( xsl , ysl , usl ) } nl=1 from source domains ( usl ∈ Us ) , unlabeled data { xtl , utl } ml=1 from target domains ( utl ∈ Ut ) , and the domain graph described by A , we want to predict the label { ytl } ml=1 for data from target domains . Note that the domain graph is defined on domains with each domain ( node ) containing multiple data points . 3.2 GRAPH-RELATIONAL DOMAIN ADAPTATION ( GRDA ) . Overview . We use an adversarial learning framework to perform adaptation across graph-relational domains . The adversarial game consists of three players : ( 1 ) an encoder E , which takes as input a datum xl , the associated domain index ul , and the adjacency matrix A to generate an encoding el = E ( xl , ul , A ) , ( 2 ) a predictor F , which makes predictions based on the encoding el , and ( 3 ) a graph discriminator D , which guides the encoding to adapt across graph-relational domains . Specifically , the discriminator D takes in a mini-batch of B encodings el ( l ∈ [ B ] ) , and tries to reconstruct the domain graph A . By letting the encoder E play adversarially against the discriminator D , the graph-relational information of domains will be removed from the encoding el in order to make the discriminator D incapable of reconstructing the graph . Note that the graph discriminator in our adversarial game is different from classic discriminators which classify the domain index , as shown in Fig . 2 . Formally , GRDA performs a minimax optimization with the following loss function : min E , F max D Lf ( E , F ) − λdLd ( D , E ) , ( 1 ) where Lf ( E , F ) is the predictor loss and Ld ( D , E ) is the discriminator loss , and λd is a hyperparameter balancing them two . Below we discussed these two terms in detail . Predictor . In Eqn . 1 , the predictor loss Lf ( E , F ) is defined as Lf ( E , F ) , Es [ hp ( F ( E ( xl , ul , A ) ) , y ) ] , where the expectation Es is taken over the sourcedomain data distribution ps ( x , y , u ) . hp ( · , · ) is a predictor loss function for the task ( e.g. , L2 loss for regression ) . Encoder and Node Embeddings . Given an input tuple ( xl , ul , A ) , the encoder E first computes a graph-informed domain embedding zul based on the domain index ul and the domain graph A . Then we feed zul along with xl into a neural network to obtain the final encoding el . Formally we have el = E ( xl , ul , A ) = f ( xl , zul ) , ( 2 ) where f ( · , · ) is a trainable neural network . In theory , any embeddings for node ( domain ) indices should work equally well so long as they are distinct from one another ( thus forming a bijection to the set of domains [ N ] ) . Here we pre-train the embeddings by a reconstruction loss for simplicity , and our intuition is that good embeddings of nodes should inform us of ( thus reconstruct ) the graph structure . Suppose the nodes indices i and j are sampled independently and identically from the marginal domain index distribution p ( u ) ; the reconstruction loss is written as Lg = Ei , j∼p ( u ) [ −Aij log σ ( z > i zj ) − ( 1−Aij ) log ( 1− σ ( z > i zj ) ) ] , where σ ( x ) = 11+e−x is the sigmoid function . Note that in general we could use any node embedding methods ( Grover & Leskovec , 2016 ; Tang et al. , 2015 ; Kipf & Welling , 2016b ) , but this is not the focus of this paper . For fair comparison , we use exactly the same encoder , i.e. , E ( x , u , A ) , for all the methods in the experiments of Sec . 5 . Graph Discriminator . The discriminator loss Ld ( D , E ) in Eqn . 1 is defined as Ld ( D , E ) , E ( x1 , u1 ) , ( x2 , u2 ) [ h ( x1 , u1 , x2 , u2 ) ] , ( 3 ) h ( x1 , u1 , x2 , u2 ) =−Au1 , u2 log σ ( ẑ > 1 ẑ2 ) − ( 1−Au1 , u2 ) log ( 1− σ ( ẑ > 1 ẑ2 ) , where ẑ1 = D ( E ( x1 , u1 , A ) ) , ẑ2 = D ( E ( x2 , u2 , A ) ) are the discriminator ’ s reconstructions of node embeddings . The expectation E is taken over a pair of i.i.d . samples ( x1 , u1 ) , ( x2 , u2 ) from the joint data distribution p ( x , u ) . The discriminator loss Ld ( D , E ) essentially quantifies how well the reconstructed node embedding ẑ1 , ẑ2 preserve the information of the original connections , or , equivalently , A . We refer readers to the Appendix for detailed model architectures . Due to the adversarial nature of how the discriminator D and the encoder E engage with the loss , the discriminator D would aim to recover the domain graph via the adjacency structure ( A ) , while the encoder E would prevent the discriminator D from doing so . Intuitively , if the discriminator D is powerful enough to uncover any information regarding the domain graph in the encoding el , the optimal encoder E will have to remove all the information regarding graph-relational domains in the encoding el , thus successfully adapting across graph-relational domains . We will formally elaborate the above arguments further in the next section . | This work optimizes the adversarial domain adaption model by generalizing the uniform domain alignment with a domain encoding graph. The proposed method is simple and easy to follow, and the overall idea is clearly described. Some experiments show the effectiveness of the proposed method on both synthetic and real-world datasets. | SP:7d857c6edf4f0229f9d73e57dc58a5853ff8d838 |
Exploiting Redundancy: Separable Group Convolutional Networks on Lie Groups | 1 INTRODUCTION . Minsky & Papert ( 1988 ) suggest that the power of the perceptron comes from its ability to learn to discard irrelevant information . In other words ; information that does not bear significance to the current task does not influence representations built by the network . According to Minsky & Papert ( 1988 ) , this leads to a definition of perceptrons in terms of the symmetry groups their learned representations are invariant to . Progress in geometric deep learning has shown the power of pro-actively equipping models with such geometric structure as inductive bias , reducing model complexity and improving generalisation and performance ( Bronstein et al. , 2017 ) . An early example of such geometric inductive bias at work can be seen in the convolutional layer in a CNN ( LeCun et al. , 1998 ) . CNNs have been instrumental in conquering computer vision tasks , and much of their success has been attributed to their use of the convolution operator , which commutes with the action of the translation group . This property , known as equivariance to translation , comes about as a result of the application of the same convolution kernel throughout an input signal , enabling the CNN to learn to detect the same features at any location in the input signal , directly exploiting translational symmetries that naturally occur in many tasks . Although invariance to object-identity preserving transformations has long been recognised as a desirable model characteristic in machine learning literature ( Kondor , 2008 ; Cohen , 2013 ; Sifre & Mallat , 2014 ) , only recently Cohen & Welling ( 2016a ) introduced the Group Equivariant CNN ( G-CNN ) as a natural extension of the CNN ( LeCun et al. , 1998 ) , generalising its equivariance properties to group actions beyond translation . The layers of a G-CNN are explicitly designed to be equivariant to such transformations , hence the model is no longer burdened with learning invariance to transformations that leave object identity intact . It has since been shown that equivariant deep learning approaches may serve as a solution in fields that as of yet remain inaccessible to machine learning due to scarce availability of labelled data , or when compact model design due to limited computational power is required ( Winkels & Cohen , 2018 ; Linmans et al. , 2018 ; Bekkers , 2019 ) . Complexity and redundancy issues impeding regular group convolutions A growing body of work shows applications of G-CNNs consistently and decisively outperforming classical CNNs ( Worrall et al. , 2017 ; Weiler et al. , 2018a ; Bekkers et al. , 2018 ; Esteves et al. , 2018 ; Bekkers , 2019 ; Worrall & Welling , 2019 ; Sosnovik et al. , 2021b ) . However , a practical challenge impeding application to larger groups is the computational complexity of regular group convolutions , which scales exponentially with the dimensionality of the group . Furthermore , Lengyel & van Gemert ( 2021 ) show that group convolution filters in the original formulation of the G-CNN by Cohen & Welling ( 2016a ) exhibit considerable redundancies along the group axis for the p4m and Z2 groups . Similar observations motivated depthwise separable convolutions ( Chollet , 2017 ) , which not only increased parameter efficiency but also model performance ; observed correlations between weights are explicitly enforced with further parameter sharing through the use of kernels separable along spatial and channel dimensions . We address the observations of redundancy along with the scalability issues of regular G-CNNs in their current form . Our paper contains the following contributions : • We introduce separable group convolutions for affine Lie groups Rn oH , sharing the kernels for translation elements x ∈ Rn along subgroup elements h ∈ H . See Fig . 1 for an overview . • We propose the use of a SIREN ( Sitzmann et al. , 2020 ) as kernel parameterisation in the Lie algebra - imposing a fixed number of parameters per convolution kernel , regardless of the resolution at which this kernel is sampled , and ensuring smoothness over the Lie group . • Separable group convolutions allow us to build Sim ( 2 ) -CNNs , which we thoroughly experiment with . We show equivariance to Sim ( 2 ) increases accuracy over a range of vision benchmarks . • To achieve equivariance to continuous affine Lie groups , we propose a random sampling method over subgroups H for approximating the group convolution operation . First , we position this work within the area of equivariant deep learning by giving an overview of related works , and explaining which current issues we are addressing with this work . We derive separable group convolutions , and show how they may be applied to continuous groups . Lastly , we apply these ideas by experimenting with implementations for roto-translations in 2D ( SE ( 2 ) ) , dilation and translation in 2D ( R2 oR+ ) and dilation , rotation and translation in 2D ( Sim ( 2 ) ) . 2 RELATED WORK . Group equivariant convolutional neural networks Broadly speaking , research on G-CNNs can be divided into two approaches . First , Regular G-CNNs use the left-regular representation of the group of interest to learn representations of scalar functions over the group manifold , or a quotient space of the group . The left-regular representation acts on the convolution kernels , yielding an orbit of the kernel under the group action . Convolving the input using these transformed filters , a feature map defined over the group is obtained at each layer . This approach most naturally extends the conventional CNN , where convolution kernels are transformed under elements of the translation group . Regular G-CNNs have been implemented for discrete groups ( Cohen & Welling , 2016a ; Winkels & Cohen , 2018 ; Worrall & Brostow , 2018 ) , compact continuous groups ( Marcos et al. , 2017 ; Bekkers et al. , 2018 ) and arbitrary non-compact continuous Lie groups ( Bekkers , 2019 ; Finzi et al. , 2020 ; Romero et al. , 2020 ) . However , practical implementations for continuous groups often require some form of discretisation of the group , possibly introducing discretisation artefacts , and requiring a choice of resolution over the group . For the second class , steerable G-CNNs , representation theory is used to compute a basis of equivariant functions for a given group , which are subsequently used to parameterise convolution kernels ( Cohen & Welling , 2016b ; Weiler et al. , 2018a ; b ; Sosnovik et al. , 2019 ; 2021a ) . Although steerable G-CNNs decouple the cardinality of the group from the dimensionality of the feature maps , this approach is only compatible with compact groups . The current paper may , in approach , be compared to Bekkers ( 2019 ) and Finzi et al . ( 2020 ) , who define convolution kernels on the Lie algebra of continuous groups to enable convolutions on their manifold . Similarly , we make use of the Lie algebra and exponential map to obtain convolution kernels on the group , but separate the kernels by subgroups . Bekkers ( 2019 ) defines a set of basis vectors in the Lie algebra , which , when combined with the exponential map , allow for the identification of group elements by a vector in Rn . Subsequently , a set of B-splines is defined on the algebra , which form a basis to expand convolution kernels in . A linear combination of these bases creates a locally continuous function on the Lie algebra defining a convolution kernel and its behaviour under transformations of the group . Although this method allows for direct control over kernel smoothness , the learned convolution filters are limited in their expressivity by their basis functions . Finzi et al . ( 2020 ) instead use an MLP to learn convolution kernels on the Lie algebra , which in addition allows them to handle point cloud data . The MLP is constructed to learn kernel values at ( arbitrary ) relative offsets in the Lie algebra . In contrast , we propose to use SIRENs ( Sitzmann et al. , 2020 ) to parameterise convolution kernels , as they have been shown to outperform other forms of MLPs in parameterising convolution kernels ( Romero et al. , 2021 ) , and offer more explicit control over kernel smoothness : a desirable property for addressing discretisation artefacts that occur when modelling features on continuous groups ( see App . A.6 ) . Separable filters in machine learning In image processing , spatially separable filters have long been known to increase parameter- and computational efficiency , and learning such constrained filters may even increase model performance ( Rigamonti et al. , 2013 ) . In Sifre & Mallat ( 2014 ) , authors investigate SE ( 2 ) -invariant feature learning through scattering convolutions , and propose separating the group convolution operation for affine groups into a cascade of two filterings , the first along the spatial dimensions Rn , and the second along subgroup dimension H . From this , authors derive a separable approach to the convolution operation with learnable filters as used in CNNs . This formulation has since been named the depthwise-separable convolution ( Chollet , 2017 ) , a special case of the Network-In-Network principle ( Lin et al. , 2013 ) which forms the basis for the success of the Inception architectures ( Szegedy et al. , 2015 ) . In depthwise separable convolutions , each input channel first gets convolved using a ( set of ) kernel ( s ) with limited spatial support . Afterwards , a 1x1 convolution is used to project the feature set detected in the input channels to the output space . Chollet ( 2017 ) speculates that the Inception architectures are successful due to the explicit separation of spatial and channel mapping functions , whereas in conventional CNNs , kernels are tasked with simultaneously mapping inter-channel and spatial correlations . Haase & Amthor ( 2020 ) argue that the original formulation of the depthwise-separable convolution reinforces inter-kernel correlations , but does not in fact leverage intra-kernel correlations . Subsequently , they propose an inverse ordering of the operations given in depthwise-separable convolutions , sharing the same spatial kernel along the input channels , and show convincing results . Extending this investigation of learned convolution filters to the original G-CNN ( Cohen & Welling , 2016a ) , Lengyel & van Gemert ( 2021 ) remark on the high degree of correlation found among filters along the rotation axis , and propose to share the same spatial kernel for every rotation feature map . We attempt to generalise this approach , proposing separable convolutions on arbitrary affine Lie groups . 3 BACKGROUND . In the following section we give the theoretical background for implementing group convolutions for arbitrary affine Lie groups . We assume familiarity with the basics of group theory and provide the relevant concepts in Appx . A.1 and Appx . A.4 . For simplicity of notation , we initially assume that our input signal/feature map f has a single channel . Lifting convolutions To preserve information on the pose of features in the input , an equivariant convolution operation is achieved by lifting a function from the input space to ( a homogeneous space of ) the group . As we are interested in real signals , specifically image data living on R2 , we assume the Lie group of interest H is taken in semidirect product with the domain of our data ; G=R2 oH . In group convolutions , a given kernel is left-acted by all transformations in G , thereby generating a signal on the higher dimensional space G instead of R2 . Hence , the output feature maps disentangle poses through a domain expansion , e.g . positions plus rotations or scales . For a given group element h ∈ H , kernel k , and location ~x in the input domain R2 , the lifting convolution is given by : ( f ∗lifting k ) ( g ) = ∫ R2 f ( x̃ ) kh ( x̃− x ) dx̃ . ( 1 ) where g= ( x , h ) and kh= 1| deth|Lh [ k ] is the kernel k : R 2 → R transformed via the action of group element h via Lh [ k ] ( x ) : = k ( h−1x ) , and with deth the determinant of the matrix representation of h that acts on Rd . The output of lifting convolutions yields a G-feature map with the original two spatial input dimensions ( R2 ) , and an additional group dimension ( H ) . See Fig . 10 . Group convolutions Now that the data is lifted to the domain of the group , we continue with group convolutions in subsequent layers . Given a kernel k ( now a function on G ) , Haar measures dg̃ and dh̃ on the group G and sub-group H respectively , group convolutions are given by : ( f ∗group k ) ( g ) = ∫ G f ( g̃ ) k ( g−1 · g̃ ) dg̃ = ∫ G f ( g̃ ) Lgk ( g̃ ) dg̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) LxLhk ( x̃ , h̃ ) 1 |h| dx̃ dh̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) k ( h−1 ( x̃− x ) , h−1 · h̃ ) 1 |h| dx̃ dh̃ . ( 2 ) Evaluating this convolution for every group element g ∈ G , we again obtain a function defined on G. As we know G=R2 oH , we can factor this operation into a transformation of a kernel k by a group element h ∈ H , kh=Lh ( k ) , followed by a convolution at every spatial location in f . See Fig . 11 . Achieving invariance Using lifting and group convolution operations , we can construct convolutional layers that co-vary with the action of the group and explicitly preserve pose information throughout the representations of the network . In most cases , we ultimately want a representation that is invariant to transformations of the input in order to achieve invariance to these identity-preserving transformations . This is achieved by aggregating the information at all group elements in a feature map with an operation invariant to the group action , e.g. , max- , mean- or sum-projection . In practice , this is done after the last group convolution , and is followed by one or more fully connected layers . | This paper discusses considerable parameter redundancy in regular group convolution networks and then proposes separable convolution kernels to share the weights over the subgroups. Besides, the authors explored the equivariance of three different groups and presented a continuous parameterization scheme. Evaluations on several datasets show that their proposed method gains improved performance and computational efficiency. | SP:9992fd409c6c0e990191bf3fe181a01951ea51c6 |
Exploiting Redundancy: Separable Group Convolutional Networks on Lie Groups | 1 INTRODUCTION . Minsky & Papert ( 1988 ) suggest that the power of the perceptron comes from its ability to learn to discard irrelevant information . In other words ; information that does not bear significance to the current task does not influence representations built by the network . According to Minsky & Papert ( 1988 ) , this leads to a definition of perceptrons in terms of the symmetry groups their learned representations are invariant to . Progress in geometric deep learning has shown the power of pro-actively equipping models with such geometric structure as inductive bias , reducing model complexity and improving generalisation and performance ( Bronstein et al. , 2017 ) . An early example of such geometric inductive bias at work can be seen in the convolutional layer in a CNN ( LeCun et al. , 1998 ) . CNNs have been instrumental in conquering computer vision tasks , and much of their success has been attributed to their use of the convolution operator , which commutes with the action of the translation group . This property , known as equivariance to translation , comes about as a result of the application of the same convolution kernel throughout an input signal , enabling the CNN to learn to detect the same features at any location in the input signal , directly exploiting translational symmetries that naturally occur in many tasks . Although invariance to object-identity preserving transformations has long been recognised as a desirable model characteristic in machine learning literature ( Kondor , 2008 ; Cohen , 2013 ; Sifre & Mallat , 2014 ) , only recently Cohen & Welling ( 2016a ) introduced the Group Equivariant CNN ( G-CNN ) as a natural extension of the CNN ( LeCun et al. , 1998 ) , generalising its equivariance properties to group actions beyond translation . The layers of a G-CNN are explicitly designed to be equivariant to such transformations , hence the model is no longer burdened with learning invariance to transformations that leave object identity intact . It has since been shown that equivariant deep learning approaches may serve as a solution in fields that as of yet remain inaccessible to machine learning due to scarce availability of labelled data , or when compact model design due to limited computational power is required ( Winkels & Cohen , 2018 ; Linmans et al. , 2018 ; Bekkers , 2019 ) . Complexity and redundancy issues impeding regular group convolutions A growing body of work shows applications of G-CNNs consistently and decisively outperforming classical CNNs ( Worrall et al. , 2017 ; Weiler et al. , 2018a ; Bekkers et al. , 2018 ; Esteves et al. , 2018 ; Bekkers , 2019 ; Worrall & Welling , 2019 ; Sosnovik et al. , 2021b ) . However , a practical challenge impeding application to larger groups is the computational complexity of regular group convolutions , which scales exponentially with the dimensionality of the group . Furthermore , Lengyel & van Gemert ( 2021 ) show that group convolution filters in the original formulation of the G-CNN by Cohen & Welling ( 2016a ) exhibit considerable redundancies along the group axis for the p4m and Z2 groups . Similar observations motivated depthwise separable convolutions ( Chollet , 2017 ) , which not only increased parameter efficiency but also model performance ; observed correlations between weights are explicitly enforced with further parameter sharing through the use of kernels separable along spatial and channel dimensions . We address the observations of redundancy along with the scalability issues of regular G-CNNs in their current form . Our paper contains the following contributions : • We introduce separable group convolutions for affine Lie groups Rn oH , sharing the kernels for translation elements x ∈ Rn along subgroup elements h ∈ H . See Fig . 1 for an overview . • We propose the use of a SIREN ( Sitzmann et al. , 2020 ) as kernel parameterisation in the Lie algebra - imposing a fixed number of parameters per convolution kernel , regardless of the resolution at which this kernel is sampled , and ensuring smoothness over the Lie group . • Separable group convolutions allow us to build Sim ( 2 ) -CNNs , which we thoroughly experiment with . We show equivariance to Sim ( 2 ) increases accuracy over a range of vision benchmarks . • To achieve equivariance to continuous affine Lie groups , we propose a random sampling method over subgroups H for approximating the group convolution operation . First , we position this work within the area of equivariant deep learning by giving an overview of related works , and explaining which current issues we are addressing with this work . We derive separable group convolutions , and show how they may be applied to continuous groups . Lastly , we apply these ideas by experimenting with implementations for roto-translations in 2D ( SE ( 2 ) ) , dilation and translation in 2D ( R2 oR+ ) and dilation , rotation and translation in 2D ( Sim ( 2 ) ) . 2 RELATED WORK . Group equivariant convolutional neural networks Broadly speaking , research on G-CNNs can be divided into two approaches . First , Regular G-CNNs use the left-regular representation of the group of interest to learn representations of scalar functions over the group manifold , or a quotient space of the group . The left-regular representation acts on the convolution kernels , yielding an orbit of the kernel under the group action . Convolving the input using these transformed filters , a feature map defined over the group is obtained at each layer . This approach most naturally extends the conventional CNN , where convolution kernels are transformed under elements of the translation group . Regular G-CNNs have been implemented for discrete groups ( Cohen & Welling , 2016a ; Winkels & Cohen , 2018 ; Worrall & Brostow , 2018 ) , compact continuous groups ( Marcos et al. , 2017 ; Bekkers et al. , 2018 ) and arbitrary non-compact continuous Lie groups ( Bekkers , 2019 ; Finzi et al. , 2020 ; Romero et al. , 2020 ) . However , practical implementations for continuous groups often require some form of discretisation of the group , possibly introducing discretisation artefacts , and requiring a choice of resolution over the group . For the second class , steerable G-CNNs , representation theory is used to compute a basis of equivariant functions for a given group , which are subsequently used to parameterise convolution kernels ( Cohen & Welling , 2016b ; Weiler et al. , 2018a ; b ; Sosnovik et al. , 2019 ; 2021a ) . Although steerable G-CNNs decouple the cardinality of the group from the dimensionality of the feature maps , this approach is only compatible with compact groups . The current paper may , in approach , be compared to Bekkers ( 2019 ) and Finzi et al . ( 2020 ) , who define convolution kernels on the Lie algebra of continuous groups to enable convolutions on their manifold . Similarly , we make use of the Lie algebra and exponential map to obtain convolution kernels on the group , but separate the kernels by subgroups . Bekkers ( 2019 ) defines a set of basis vectors in the Lie algebra , which , when combined with the exponential map , allow for the identification of group elements by a vector in Rn . Subsequently , a set of B-splines is defined on the algebra , which form a basis to expand convolution kernels in . A linear combination of these bases creates a locally continuous function on the Lie algebra defining a convolution kernel and its behaviour under transformations of the group . Although this method allows for direct control over kernel smoothness , the learned convolution filters are limited in their expressivity by their basis functions . Finzi et al . ( 2020 ) instead use an MLP to learn convolution kernels on the Lie algebra , which in addition allows them to handle point cloud data . The MLP is constructed to learn kernel values at ( arbitrary ) relative offsets in the Lie algebra . In contrast , we propose to use SIRENs ( Sitzmann et al. , 2020 ) to parameterise convolution kernels , as they have been shown to outperform other forms of MLPs in parameterising convolution kernels ( Romero et al. , 2021 ) , and offer more explicit control over kernel smoothness : a desirable property for addressing discretisation artefacts that occur when modelling features on continuous groups ( see App . A.6 ) . Separable filters in machine learning In image processing , spatially separable filters have long been known to increase parameter- and computational efficiency , and learning such constrained filters may even increase model performance ( Rigamonti et al. , 2013 ) . In Sifre & Mallat ( 2014 ) , authors investigate SE ( 2 ) -invariant feature learning through scattering convolutions , and propose separating the group convolution operation for affine groups into a cascade of two filterings , the first along the spatial dimensions Rn , and the second along subgroup dimension H . From this , authors derive a separable approach to the convolution operation with learnable filters as used in CNNs . This formulation has since been named the depthwise-separable convolution ( Chollet , 2017 ) , a special case of the Network-In-Network principle ( Lin et al. , 2013 ) which forms the basis for the success of the Inception architectures ( Szegedy et al. , 2015 ) . In depthwise separable convolutions , each input channel first gets convolved using a ( set of ) kernel ( s ) with limited spatial support . Afterwards , a 1x1 convolution is used to project the feature set detected in the input channels to the output space . Chollet ( 2017 ) speculates that the Inception architectures are successful due to the explicit separation of spatial and channel mapping functions , whereas in conventional CNNs , kernels are tasked with simultaneously mapping inter-channel and spatial correlations . Haase & Amthor ( 2020 ) argue that the original formulation of the depthwise-separable convolution reinforces inter-kernel correlations , but does not in fact leverage intra-kernel correlations . Subsequently , they propose an inverse ordering of the operations given in depthwise-separable convolutions , sharing the same spatial kernel along the input channels , and show convincing results . Extending this investigation of learned convolution filters to the original G-CNN ( Cohen & Welling , 2016a ) , Lengyel & van Gemert ( 2021 ) remark on the high degree of correlation found among filters along the rotation axis , and propose to share the same spatial kernel for every rotation feature map . We attempt to generalise this approach , proposing separable convolutions on arbitrary affine Lie groups . 3 BACKGROUND . In the following section we give the theoretical background for implementing group convolutions for arbitrary affine Lie groups . We assume familiarity with the basics of group theory and provide the relevant concepts in Appx . A.1 and Appx . A.4 . For simplicity of notation , we initially assume that our input signal/feature map f has a single channel . Lifting convolutions To preserve information on the pose of features in the input , an equivariant convolution operation is achieved by lifting a function from the input space to ( a homogeneous space of ) the group . As we are interested in real signals , specifically image data living on R2 , we assume the Lie group of interest H is taken in semidirect product with the domain of our data ; G=R2 oH . In group convolutions , a given kernel is left-acted by all transformations in G , thereby generating a signal on the higher dimensional space G instead of R2 . Hence , the output feature maps disentangle poses through a domain expansion , e.g . positions plus rotations or scales . For a given group element h ∈ H , kernel k , and location ~x in the input domain R2 , the lifting convolution is given by : ( f ∗lifting k ) ( g ) = ∫ R2 f ( x̃ ) kh ( x̃− x ) dx̃ . ( 1 ) where g= ( x , h ) and kh= 1| deth|Lh [ k ] is the kernel k : R 2 → R transformed via the action of group element h via Lh [ k ] ( x ) : = k ( h−1x ) , and with deth the determinant of the matrix representation of h that acts on Rd . The output of lifting convolutions yields a G-feature map with the original two spatial input dimensions ( R2 ) , and an additional group dimension ( H ) . See Fig . 10 . Group convolutions Now that the data is lifted to the domain of the group , we continue with group convolutions in subsequent layers . Given a kernel k ( now a function on G ) , Haar measures dg̃ and dh̃ on the group G and sub-group H respectively , group convolutions are given by : ( f ∗group k ) ( g ) = ∫ G f ( g̃ ) k ( g−1 · g̃ ) dg̃ = ∫ G f ( g̃ ) Lgk ( g̃ ) dg̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) LxLhk ( x̃ , h̃ ) 1 |h| dx̃ dh̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) k ( h−1 ( x̃− x ) , h−1 · h̃ ) 1 |h| dx̃ dh̃ . ( 2 ) Evaluating this convolution for every group element g ∈ G , we again obtain a function defined on G. As we know G=R2 oH , we can factor this operation into a transformation of a kernel k by a group element h ∈ H , kh=Lh ( k ) , followed by a convolution at every spatial location in f . See Fig . 11 . Achieving invariance Using lifting and group convolution operations , we can construct convolutional layers that co-vary with the action of the group and explicitly preserve pose information throughout the representations of the network . In most cases , we ultimately want a representation that is invariant to transformations of the input in order to achieve invariance to these identity-preserving transformations . This is achieved by aggregating the information at all group elements in a feature map with an operation invariant to the group action , e.g. , max- , mean- or sum-projection . In practice , this is done after the last group convolution , and is followed by one or more fully connected layers . | The paper builds group convolutional neural networks based on the depth-wise separable convolution operations, which are commonly seen in modern CNNs. The authors demonstrate that the $Sim(2)$-equivariant can be achieved in such separable convolution operations. In the implementation, the authors borrow the SIREN approach for parameterizing the proposed group convolutions. Finally, the experimental analysis shows good improvement over other types of group convolutions. | SP:9992fd409c6c0e990191bf3fe181a01951ea51c6 |
Exploiting Redundancy: Separable Group Convolutional Networks on Lie Groups | 1 INTRODUCTION . Minsky & Papert ( 1988 ) suggest that the power of the perceptron comes from its ability to learn to discard irrelevant information . In other words ; information that does not bear significance to the current task does not influence representations built by the network . According to Minsky & Papert ( 1988 ) , this leads to a definition of perceptrons in terms of the symmetry groups their learned representations are invariant to . Progress in geometric deep learning has shown the power of pro-actively equipping models with such geometric structure as inductive bias , reducing model complexity and improving generalisation and performance ( Bronstein et al. , 2017 ) . An early example of such geometric inductive bias at work can be seen in the convolutional layer in a CNN ( LeCun et al. , 1998 ) . CNNs have been instrumental in conquering computer vision tasks , and much of their success has been attributed to their use of the convolution operator , which commutes with the action of the translation group . This property , known as equivariance to translation , comes about as a result of the application of the same convolution kernel throughout an input signal , enabling the CNN to learn to detect the same features at any location in the input signal , directly exploiting translational symmetries that naturally occur in many tasks . Although invariance to object-identity preserving transformations has long been recognised as a desirable model characteristic in machine learning literature ( Kondor , 2008 ; Cohen , 2013 ; Sifre & Mallat , 2014 ) , only recently Cohen & Welling ( 2016a ) introduced the Group Equivariant CNN ( G-CNN ) as a natural extension of the CNN ( LeCun et al. , 1998 ) , generalising its equivariance properties to group actions beyond translation . The layers of a G-CNN are explicitly designed to be equivariant to such transformations , hence the model is no longer burdened with learning invariance to transformations that leave object identity intact . It has since been shown that equivariant deep learning approaches may serve as a solution in fields that as of yet remain inaccessible to machine learning due to scarce availability of labelled data , or when compact model design due to limited computational power is required ( Winkels & Cohen , 2018 ; Linmans et al. , 2018 ; Bekkers , 2019 ) . Complexity and redundancy issues impeding regular group convolutions A growing body of work shows applications of G-CNNs consistently and decisively outperforming classical CNNs ( Worrall et al. , 2017 ; Weiler et al. , 2018a ; Bekkers et al. , 2018 ; Esteves et al. , 2018 ; Bekkers , 2019 ; Worrall & Welling , 2019 ; Sosnovik et al. , 2021b ) . However , a practical challenge impeding application to larger groups is the computational complexity of regular group convolutions , which scales exponentially with the dimensionality of the group . Furthermore , Lengyel & van Gemert ( 2021 ) show that group convolution filters in the original formulation of the G-CNN by Cohen & Welling ( 2016a ) exhibit considerable redundancies along the group axis for the p4m and Z2 groups . Similar observations motivated depthwise separable convolutions ( Chollet , 2017 ) , which not only increased parameter efficiency but also model performance ; observed correlations between weights are explicitly enforced with further parameter sharing through the use of kernels separable along spatial and channel dimensions . We address the observations of redundancy along with the scalability issues of regular G-CNNs in their current form . Our paper contains the following contributions : • We introduce separable group convolutions for affine Lie groups Rn oH , sharing the kernels for translation elements x ∈ Rn along subgroup elements h ∈ H . See Fig . 1 for an overview . • We propose the use of a SIREN ( Sitzmann et al. , 2020 ) as kernel parameterisation in the Lie algebra - imposing a fixed number of parameters per convolution kernel , regardless of the resolution at which this kernel is sampled , and ensuring smoothness over the Lie group . • Separable group convolutions allow us to build Sim ( 2 ) -CNNs , which we thoroughly experiment with . We show equivariance to Sim ( 2 ) increases accuracy over a range of vision benchmarks . • To achieve equivariance to continuous affine Lie groups , we propose a random sampling method over subgroups H for approximating the group convolution operation . First , we position this work within the area of equivariant deep learning by giving an overview of related works , and explaining which current issues we are addressing with this work . We derive separable group convolutions , and show how they may be applied to continuous groups . Lastly , we apply these ideas by experimenting with implementations for roto-translations in 2D ( SE ( 2 ) ) , dilation and translation in 2D ( R2 oR+ ) and dilation , rotation and translation in 2D ( Sim ( 2 ) ) . 2 RELATED WORK . Group equivariant convolutional neural networks Broadly speaking , research on G-CNNs can be divided into two approaches . First , Regular G-CNNs use the left-regular representation of the group of interest to learn representations of scalar functions over the group manifold , or a quotient space of the group . The left-regular representation acts on the convolution kernels , yielding an orbit of the kernel under the group action . Convolving the input using these transformed filters , a feature map defined over the group is obtained at each layer . This approach most naturally extends the conventional CNN , where convolution kernels are transformed under elements of the translation group . Regular G-CNNs have been implemented for discrete groups ( Cohen & Welling , 2016a ; Winkels & Cohen , 2018 ; Worrall & Brostow , 2018 ) , compact continuous groups ( Marcos et al. , 2017 ; Bekkers et al. , 2018 ) and arbitrary non-compact continuous Lie groups ( Bekkers , 2019 ; Finzi et al. , 2020 ; Romero et al. , 2020 ) . However , practical implementations for continuous groups often require some form of discretisation of the group , possibly introducing discretisation artefacts , and requiring a choice of resolution over the group . For the second class , steerable G-CNNs , representation theory is used to compute a basis of equivariant functions for a given group , which are subsequently used to parameterise convolution kernels ( Cohen & Welling , 2016b ; Weiler et al. , 2018a ; b ; Sosnovik et al. , 2019 ; 2021a ) . Although steerable G-CNNs decouple the cardinality of the group from the dimensionality of the feature maps , this approach is only compatible with compact groups . The current paper may , in approach , be compared to Bekkers ( 2019 ) and Finzi et al . ( 2020 ) , who define convolution kernels on the Lie algebra of continuous groups to enable convolutions on their manifold . Similarly , we make use of the Lie algebra and exponential map to obtain convolution kernels on the group , but separate the kernels by subgroups . Bekkers ( 2019 ) defines a set of basis vectors in the Lie algebra , which , when combined with the exponential map , allow for the identification of group elements by a vector in Rn . Subsequently , a set of B-splines is defined on the algebra , which form a basis to expand convolution kernels in . A linear combination of these bases creates a locally continuous function on the Lie algebra defining a convolution kernel and its behaviour under transformations of the group . Although this method allows for direct control over kernel smoothness , the learned convolution filters are limited in their expressivity by their basis functions . Finzi et al . ( 2020 ) instead use an MLP to learn convolution kernels on the Lie algebra , which in addition allows them to handle point cloud data . The MLP is constructed to learn kernel values at ( arbitrary ) relative offsets in the Lie algebra . In contrast , we propose to use SIRENs ( Sitzmann et al. , 2020 ) to parameterise convolution kernels , as they have been shown to outperform other forms of MLPs in parameterising convolution kernels ( Romero et al. , 2021 ) , and offer more explicit control over kernel smoothness : a desirable property for addressing discretisation artefacts that occur when modelling features on continuous groups ( see App . A.6 ) . Separable filters in machine learning In image processing , spatially separable filters have long been known to increase parameter- and computational efficiency , and learning such constrained filters may even increase model performance ( Rigamonti et al. , 2013 ) . In Sifre & Mallat ( 2014 ) , authors investigate SE ( 2 ) -invariant feature learning through scattering convolutions , and propose separating the group convolution operation for affine groups into a cascade of two filterings , the first along the spatial dimensions Rn , and the second along subgroup dimension H . From this , authors derive a separable approach to the convolution operation with learnable filters as used in CNNs . This formulation has since been named the depthwise-separable convolution ( Chollet , 2017 ) , a special case of the Network-In-Network principle ( Lin et al. , 2013 ) which forms the basis for the success of the Inception architectures ( Szegedy et al. , 2015 ) . In depthwise separable convolutions , each input channel first gets convolved using a ( set of ) kernel ( s ) with limited spatial support . Afterwards , a 1x1 convolution is used to project the feature set detected in the input channels to the output space . Chollet ( 2017 ) speculates that the Inception architectures are successful due to the explicit separation of spatial and channel mapping functions , whereas in conventional CNNs , kernels are tasked with simultaneously mapping inter-channel and spatial correlations . Haase & Amthor ( 2020 ) argue that the original formulation of the depthwise-separable convolution reinforces inter-kernel correlations , but does not in fact leverage intra-kernel correlations . Subsequently , they propose an inverse ordering of the operations given in depthwise-separable convolutions , sharing the same spatial kernel along the input channels , and show convincing results . Extending this investigation of learned convolution filters to the original G-CNN ( Cohen & Welling , 2016a ) , Lengyel & van Gemert ( 2021 ) remark on the high degree of correlation found among filters along the rotation axis , and propose to share the same spatial kernel for every rotation feature map . We attempt to generalise this approach , proposing separable convolutions on arbitrary affine Lie groups . 3 BACKGROUND . In the following section we give the theoretical background for implementing group convolutions for arbitrary affine Lie groups . We assume familiarity with the basics of group theory and provide the relevant concepts in Appx . A.1 and Appx . A.4 . For simplicity of notation , we initially assume that our input signal/feature map f has a single channel . Lifting convolutions To preserve information on the pose of features in the input , an equivariant convolution operation is achieved by lifting a function from the input space to ( a homogeneous space of ) the group . As we are interested in real signals , specifically image data living on R2 , we assume the Lie group of interest H is taken in semidirect product with the domain of our data ; G=R2 oH . In group convolutions , a given kernel is left-acted by all transformations in G , thereby generating a signal on the higher dimensional space G instead of R2 . Hence , the output feature maps disentangle poses through a domain expansion , e.g . positions plus rotations or scales . For a given group element h ∈ H , kernel k , and location ~x in the input domain R2 , the lifting convolution is given by : ( f ∗lifting k ) ( g ) = ∫ R2 f ( x̃ ) kh ( x̃− x ) dx̃ . ( 1 ) where g= ( x , h ) and kh= 1| deth|Lh [ k ] is the kernel k : R 2 → R transformed via the action of group element h via Lh [ k ] ( x ) : = k ( h−1x ) , and with deth the determinant of the matrix representation of h that acts on Rd . The output of lifting convolutions yields a G-feature map with the original two spatial input dimensions ( R2 ) , and an additional group dimension ( H ) . See Fig . 10 . Group convolutions Now that the data is lifted to the domain of the group , we continue with group convolutions in subsequent layers . Given a kernel k ( now a function on G ) , Haar measures dg̃ and dh̃ on the group G and sub-group H respectively , group convolutions are given by : ( f ∗group k ) ( g ) = ∫ G f ( g̃ ) k ( g−1 · g̃ ) dg̃ = ∫ G f ( g̃ ) Lgk ( g̃ ) dg̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) LxLhk ( x̃ , h̃ ) 1 |h| dx̃ dh̃ = ∫ R2 ∫ H f ( x̃ , h̃ ) k ( h−1 ( x̃− x ) , h−1 · h̃ ) 1 |h| dx̃ dh̃ . ( 2 ) Evaluating this convolution for every group element g ∈ G , we again obtain a function defined on G. As we know G=R2 oH , we can factor this operation into a transformation of a kernel k by a group element h ∈ H , kh=Lh ( k ) , followed by a convolution at every spatial location in f . See Fig . 11 . Achieving invariance Using lifting and group convolution operations , we can construct convolutional layers that co-vary with the action of the group and explicitly preserve pose information throughout the representations of the network . In most cases , we ultimately want a representation that is invariant to transformations of the input in order to achieve invariance to these identity-preserving transformations . This is achieved by aggregating the information at all group elements in a feature map with an operation invariant to the group action , e.g. , max- , mean- or sum-projection . In practice , this is done after the last group convolution , and is followed by one or more fully connected layers . | The paper proposes to use separable convolutions along the group dimension in the type of group CNNs proposed by Finzi et al [1]. The motivation is the same as the popular depthwise separable convolutions for conventional CNNs: reducing parameter redundancy to increase efficiency and accuracy. Experiments on rotated MNIST, CIFAR10/100, and Galaxy10 show that the method outperforms the non-separable versions both in accuracy and speed. | SP:9992fd409c6c0e990191bf3fe181a01951ea51c6 |
GeoDiff: A Geometric Diffusion Model for Molecular Conformation Generation | 1 INTRODUCTION . Graph representation learning has achieved huge success for molecule modeling in various tasks ranging from property prediction ( Gilmer et al. , 2017 ; Duvenaud et al. , 2015 ) to molecule generation ( Jin et al. , 2018 ; Shi et al. , 2020 ) , where typically a molecule is represented as an atom-bond graph . Despite its effectiveness in various applications , a more intrinsic and informative representation for molecules is the 3D geometry , also known as conformation , where atoms are represented as their Cartesian coordinates . The 3D structures determine the biological and physical properties of molecules and hence play a key role in many applications such as computational drug and material design ( Thomas et al. , 2018 ; Gebauer et al. , 2021 ; Jing et al. , 2021 ; Batzner et al. , 2021 ) . Unfortunately , how to predict stable molecular conformation remains a challenging problem . Traditional methods based on molecular dynamics ( MD ) or Markov chain Monte Carlo ( MCMC ) are very computationally expensive , especially for large molecules ( Hawkins , 2017 ) . Recently , significant progress has been made with machine learning approaches , especially with deep generative models . For example , Simm & Hernandez-Lobato ( 2020 ) ; Xu et al . ( 2021b ) studied predicting atomic distances with variational autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) and flow-based models ( Dinh et al. , 2017 ) respectively . Shi et al . ( 2021 ) proposed to use denoising score matching ( Song & Ermon , 2019 ; 2020 ) to estimate the gradient fields over atomic distances , through which the gradient fields over atomic coordinates can be calculated . Ganea et al . ( 2021 ) studied generating conformations by predicting both bond lengths and angles . As molecular conformations are roto-translational invariant , these approaches circumvent directly modeling atomic coordinates by leveraging intermediate geometric variables such as atomic distances , bond and torsion angles , which are roto-translational invariant . As a result , they are able to achieve very compelling performance . However , as all these approaches seek to indirectly model the intermediate geometric variables , they have inherent limitations in either training or inference process ( see Sec . 2 for a detailed description ) . Therefore , an ideal solution would still be directly modeling the atomic coordinates and at the same time taking the roto-translational invariance property into account . In this paper , we propose such a solution called GEODIFF , a principled probabilistic framework based on denoising diffusion models ( Sohl-Dickstein et al. , 2015 ) . Our approach is inspired by the diffusion process in nonequilibrium thermodynamics ( De Groot & Mazur , 2013 ) . We view atoms as particles in a thermodynamic system , which gradually diffuse from the original states to a noisy distribution in contact with a heat bath . At each time step , stochastic noises are added to the atomic positions . Our high-level idea is learning to reverse the diffusion process , which recovers the target geometric distribution from the noisy distribution . In particular , inspired by recent progress of denoising diffusion models on image generation ( Ho et al. , 2020 ; Song et al. , 2020 ) , we view the noisy geometries at different timesteps as latent variables , and formulate both the forward diffusion and reverse denoising process as Markov chains . Our goal is to learn the transition kernels such that the reverse process can recover realistic conformations from the chaotic positions sampled from a noise distribution . However , extending existing methods to geometric generation is highly non-trivial : a direct application of diffusion models on the conformation generation task lead to poor generation quality . As mentioned above , molecular conformations are roto-translational invariant , i.e. , the estimated ( conditional ) likelihood should be unaffected by translational and rotational transformations ( Köhler et al. , 2020 ) . To this end , we first theoretically show that a Markov process starting from an roto-translational invariant prior distribution and evolving with roto-translational equivariant Markov kernels can induce an roto-translational invariant density function . We further provide practical parameterization to define a roto-translational invariant prior distribution and a Markov kernel imposing the equivariance constraints . In addition , we derive a weighted variational lower bound of the conditional likelihood of molecular conformations , which also enjoys the rototranslational invariance and can be efficiently optimized . A unique strength of GEODIFF is that it directly acts on the atomic coordinates and entirely bypasses the usage of intermediate elements for both training and inference . This general formulation enjoys several crucial advantages . First , the model can be naturally trained end-to-end without involving any sophisticated techniques like bilevel programming ( Xu et al. , 2021b ) , which benefits from small optimization variances . Besides , instead of solving geometries from bond lengths or angles , the one-stage sampling fashion avoids accumulating any intermediate error , and therefore leads to more accurate predicted structures . Moreover , GEODIFF enjoys a high model capacity to approximate the complex distribution of conformations . Thus , the model can better estimate the highly multi-modal distribution and generate structures with high quality and diversity . We conduct comprehensive experiments on multiple benchmarks , including conformation generation and property prediction tasks . Numerical results show that GEODIFF consistently outperforms existing state-of-the-art machine learning approaches , and by a large margin on the more challenging large molecules . The significantly superior performance demonstrate the high capacity to model the complex distribution of molecular conformations and generate both diverse and accurate molecules . 2 RELATED WORK . Recently , various deep generative models have been proposed for conformation generation . Among them , CVGAE ( Mansimov et al. , 2019 ) first proposed a VAE model to directly generate 3D atomic coordinates , which fails to preserve the roto-translation equivariance property of conformations and suffers from poor performance . To address this problem , the majority of subsequent models are based on intermediate geometric elements such as atomic distances and torsion angles . A favorable property of these elements is the roto-translational invariance , ( e.g . atomic distances does not change when rotating the molecule ) , which has been shown to be an important inductive bias for molecular geometry modeling ( Köhler et al. , 2020 ) . However , such a decomposition suffers from several drawbacks for either training or sampling . For example , GRAPHDG ( Simm & HernandezLobato , 2020 ) and CGCF ( Xu et al. , 2021a ) proposed to predict the interatomic distance matrix by VAE and Flow respectively , and then solve the geometry through the Distance Geometry ( DG ) technique ( Liberti et al. , 2014 ) , which searches reasonable coordinates that matches with the predicted distances . CONFVAE further improves this pipeline by designing an end-to-end framework via bilevel optimization ( Xu et al. , 2021b ) . However , all these approaches suffer from the accumulated error problem , meaning that the noise in the predicted distances will misguide the coordinate searching process and lead to inaccurate or even erroneous structures . To overcome this problem , CONFGF ( Shi et al. , 2021 ) proposed to learn the gradient of the log-likelihood w.r.t coordinates . However , in practice the model is still aided by intermediate geometric elements , in that it first estimates the gradient w.r.t interatomic distances via denoising score matching ( DSM ) ( Song & Ermon , 2019 ; 2020 ) , and then derives the gradient of coordinates using the chain rule . The problem is , by learning the distance gradient via DSM , the model is fed with perturbed distance matrices , which may violate the triangular inequality or even contain negative values . As a consequence , the model is actually learned over invalid distance matrices but tested with valid ones calculated from coordinates , making it suffer from serious out-of-distribution ( Hendrycks & Gimpel , 2016 ) problem . Most recently , Ganea et al . ( 2021 ) proposed a highly systematic ( rule-based ) pipeline named GEOMOL , which learns to predict a set of geometric quantities ( i.e . length and angles ) and then reconstruct the local and global structures of the conformation in a sophisticated procedure . Despite its effectiveness , this method can be only adopted to molecules with a specific pattern , which limits it from wide applications . In our experiments , the pattern requirement filtered out nearly one third of molecular graphs , making it incomparable in our setting . Besides , there has also been efforts to use reinforcement learning for conformation search Gogineni et al . ( 2020 ) . Nevertheless , this method relies on rigid rotor approximation and can only model the torsion angles , and thus fundamentally differs from other approaches . 3 PRELIMINARIES . 3.1 NOTATIONS AND PROBLEM DEFINITION . Notations . In this paper each molecule with n atoms is represented as an undirected graph G = 〈V , E〉 , where V = { vi } ni=1 is the set of vertices representing atoms and E = { eij | ( i , j ) ⊆ |V| × |V| } is the set of edges representing inter-atomic bonds . Each node vi ∈ V describes the atomic attributes , e.g. , the element type . Each edge eij ∈ E describes the corresponding connection between vi and vj , and is labeled with its chemical type . In addition , we also assign the unconnected edges with a virtual type . For the geometry , each atom in V is embedded by a coordinate vector c ∈ R3 into the 3-dimensional space , and the full set of positions ( i.e. , the conformation ) can be represented as a matrix C = [ c1 , c2 , · · · , cn ] ∈ Rn×3 . Problem Definition . The task of molecular conformation generation is a conditional generative problem , where we are interested in generating stable conformations for a provided graph G. Given multiple graphs G , and for each G given its conformations C as i.i.d samples from an underlying Boltzmann distribution ( Noé et al. , 2019 ) , our goal is learning a generative model pθ ( C|G ) , which is easy to draw samples from , to approximate the Boltzmann function . 3.2 EQUIVARIANCE . Equivariance is ubiquitous in machine learning for atomic systems , e.g. , the vectors of atomic dipoles or forces should rotate accordingly w.r.t . the conformation coordinates ( Thomas et al. , 2018 ; Weiler et al. , 2018 ; Fuchs et al. , 2020 ; Miller et al. , 2020 ; Simm et al. , 2021 ; Batzner et al. , 2021 ) . It has shown effectiveness to integrate such inductive bias into model parameterization for modeling 3D geometry , which is critical for the generalization capacity ( Köhler et al. , 2020 ; Satorras et al. , 2021a ) . Formally , a function F : X → Y is equivariant w.r.t a group G if : F ◦ Tg ( x ) = Sg ◦ F ( x ) , ( 1 ) where Tg and Sg are transformations for an element g ∈ G , acting on the vector spaces X and Y , respectively . In this work , we consider the SE ( 3 ) group , i.e. , the group of rotation , translation in 3D space . This requires the estimated likelihood unaffected with translational and rotational transformations , and we will elaborate on how our method satisfy this property in Sec . 4 . | The work introduces a novel **GeoDiff** model for conformation generation task, based on a promising diffusion model approach that shows state-of-the-art results in other domains. The authors improved and adapted the concept of the diffusion model for the new domain so that it can work with rotation and translation invariant objects, such as conformations - authors introduced an architecture based on SE(3)-equivariant Graph Field Network (GFN) for parameterizing Markov kernels, also used roto-translational invariant starter density. The main contributions of the paper are: the authors are the first who propose an architecture based on principal novel generative diffusion framework for molecular conformation generation and explore suitable roto-translational invariant architecture to parameterize the kernel of the method. Experiments show that the proposed model outperforms recent state-of-the-art approaches with a huge gap on **Conformation Generation** and **Property Prediction** tasks. | SP:121aa1ba84bd06178156dc6e2329827ae08431cb |
GeoDiff: A Geometric Diffusion Model for Molecular Conformation Generation | 1 INTRODUCTION . Graph representation learning has achieved huge success for molecule modeling in various tasks ranging from property prediction ( Gilmer et al. , 2017 ; Duvenaud et al. , 2015 ) to molecule generation ( Jin et al. , 2018 ; Shi et al. , 2020 ) , where typically a molecule is represented as an atom-bond graph . Despite its effectiveness in various applications , a more intrinsic and informative representation for molecules is the 3D geometry , also known as conformation , where atoms are represented as their Cartesian coordinates . The 3D structures determine the biological and physical properties of molecules and hence play a key role in many applications such as computational drug and material design ( Thomas et al. , 2018 ; Gebauer et al. , 2021 ; Jing et al. , 2021 ; Batzner et al. , 2021 ) . Unfortunately , how to predict stable molecular conformation remains a challenging problem . Traditional methods based on molecular dynamics ( MD ) or Markov chain Monte Carlo ( MCMC ) are very computationally expensive , especially for large molecules ( Hawkins , 2017 ) . Recently , significant progress has been made with machine learning approaches , especially with deep generative models . For example , Simm & Hernandez-Lobato ( 2020 ) ; Xu et al . ( 2021b ) studied predicting atomic distances with variational autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) and flow-based models ( Dinh et al. , 2017 ) respectively . Shi et al . ( 2021 ) proposed to use denoising score matching ( Song & Ermon , 2019 ; 2020 ) to estimate the gradient fields over atomic distances , through which the gradient fields over atomic coordinates can be calculated . Ganea et al . ( 2021 ) studied generating conformations by predicting both bond lengths and angles . As molecular conformations are roto-translational invariant , these approaches circumvent directly modeling atomic coordinates by leveraging intermediate geometric variables such as atomic distances , bond and torsion angles , which are roto-translational invariant . As a result , they are able to achieve very compelling performance . However , as all these approaches seek to indirectly model the intermediate geometric variables , they have inherent limitations in either training or inference process ( see Sec . 2 for a detailed description ) . Therefore , an ideal solution would still be directly modeling the atomic coordinates and at the same time taking the roto-translational invariance property into account . In this paper , we propose such a solution called GEODIFF , a principled probabilistic framework based on denoising diffusion models ( Sohl-Dickstein et al. , 2015 ) . Our approach is inspired by the diffusion process in nonequilibrium thermodynamics ( De Groot & Mazur , 2013 ) . We view atoms as particles in a thermodynamic system , which gradually diffuse from the original states to a noisy distribution in contact with a heat bath . At each time step , stochastic noises are added to the atomic positions . Our high-level idea is learning to reverse the diffusion process , which recovers the target geometric distribution from the noisy distribution . In particular , inspired by recent progress of denoising diffusion models on image generation ( Ho et al. , 2020 ; Song et al. , 2020 ) , we view the noisy geometries at different timesteps as latent variables , and formulate both the forward diffusion and reverse denoising process as Markov chains . Our goal is to learn the transition kernels such that the reverse process can recover realistic conformations from the chaotic positions sampled from a noise distribution . However , extending existing methods to geometric generation is highly non-trivial : a direct application of diffusion models on the conformation generation task lead to poor generation quality . As mentioned above , molecular conformations are roto-translational invariant , i.e. , the estimated ( conditional ) likelihood should be unaffected by translational and rotational transformations ( Köhler et al. , 2020 ) . To this end , we first theoretically show that a Markov process starting from an roto-translational invariant prior distribution and evolving with roto-translational equivariant Markov kernels can induce an roto-translational invariant density function . We further provide practical parameterization to define a roto-translational invariant prior distribution and a Markov kernel imposing the equivariance constraints . In addition , we derive a weighted variational lower bound of the conditional likelihood of molecular conformations , which also enjoys the rototranslational invariance and can be efficiently optimized . A unique strength of GEODIFF is that it directly acts on the atomic coordinates and entirely bypasses the usage of intermediate elements for both training and inference . This general formulation enjoys several crucial advantages . First , the model can be naturally trained end-to-end without involving any sophisticated techniques like bilevel programming ( Xu et al. , 2021b ) , which benefits from small optimization variances . Besides , instead of solving geometries from bond lengths or angles , the one-stage sampling fashion avoids accumulating any intermediate error , and therefore leads to more accurate predicted structures . Moreover , GEODIFF enjoys a high model capacity to approximate the complex distribution of conformations . Thus , the model can better estimate the highly multi-modal distribution and generate structures with high quality and diversity . We conduct comprehensive experiments on multiple benchmarks , including conformation generation and property prediction tasks . Numerical results show that GEODIFF consistently outperforms existing state-of-the-art machine learning approaches , and by a large margin on the more challenging large molecules . The significantly superior performance demonstrate the high capacity to model the complex distribution of molecular conformations and generate both diverse and accurate molecules . 2 RELATED WORK . Recently , various deep generative models have been proposed for conformation generation . Among them , CVGAE ( Mansimov et al. , 2019 ) first proposed a VAE model to directly generate 3D atomic coordinates , which fails to preserve the roto-translation equivariance property of conformations and suffers from poor performance . To address this problem , the majority of subsequent models are based on intermediate geometric elements such as atomic distances and torsion angles . A favorable property of these elements is the roto-translational invariance , ( e.g . atomic distances does not change when rotating the molecule ) , which has been shown to be an important inductive bias for molecular geometry modeling ( Köhler et al. , 2020 ) . However , such a decomposition suffers from several drawbacks for either training or sampling . For example , GRAPHDG ( Simm & HernandezLobato , 2020 ) and CGCF ( Xu et al. , 2021a ) proposed to predict the interatomic distance matrix by VAE and Flow respectively , and then solve the geometry through the Distance Geometry ( DG ) technique ( Liberti et al. , 2014 ) , which searches reasonable coordinates that matches with the predicted distances . CONFVAE further improves this pipeline by designing an end-to-end framework via bilevel optimization ( Xu et al. , 2021b ) . However , all these approaches suffer from the accumulated error problem , meaning that the noise in the predicted distances will misguide the coordinate searching process and lead to inaccurate or even erroneous structures . To overcome this problem , CONFGF ( Shi et al. , 2021 ) proposed to learn the gradient of the log-likelihood w.r.t coordinates . However , in practice the model is still aided by intermediate geometric elements , in that it first estimates the gradient w.r.t interatomic distances via denoising score matching ( DSM ) ( Song & Ermon , 2019 ; 2020 ) , and then derives the gradient of coordinates using the chain rule . The problem is , by learning the distance gradient via DSM , the model is fed with perturbed distance matrices , which may violate the triangular inequality or even contain negative values . As a consequence , the model is actually learned over invalid distance matrices but tested with valid ones calculated from coordinates , making it suffer from serious out-of-distribution ( Hendrycks & Gimpel , 2016 ) problem . Most recently , Ganea et al . ( 2021 ) proposed a highly systematic ( rule-based ) pipeline named GEOMOL , which learns to predict a set of geometric quantities ( i.e . length and angles ) and then reconstruct the local and global structures of the conformation in a sophisticated procedure . Despite its effectiveness , this method can be only adopted to molecules with a specific pattern , which limits it from wide applications . In our experiments , the pattern requirement filtered out nearly one third of molecular graphs , making it incomparable in our setting . Besides , there has also been efforts to use reinforcement learning for conformation search Gogineni et al . ( 2020 ) . Nevertheless , this method relies on rigid rotor approximation and can only model the torsion angles , and thus fundamentally differs from other approaches . 3 PRELIMINARIES . 3.1 NOTATIONS AND PROBLEM DEFINITION . Notations . In this paper each molecule with n atoms is represented as an undirected graph G = 〈V , E〉 , where V = { vi } ni=1 is the set of vertices representing atoms and E = { eij | ( i , j ) ⊆ |V| × |V| } is the set of edges representing inter-atomic bonds . Each node vi ∈ V describes the atomic attributes , e.g. , the element type . Each edge eij ∈ E describes the corresponding connection between vi and vj , and is labeled with its chemical type . In addition , we also assign the unconnected edges with a virtual type . For the geometry , each atom in V is embedded by a coordinate vector c ∈ R3 into the 3-dimensional space , and the full set of positions ( i.e. , the conformation ) can be represented as a matrix C = [ c1 , c2 , · · · , cn ] ∈ Rn×3 . Problem Definition . The task of molecular conformation generation is a conditional generative problem , where we are interested in generating stable conformations for a provided graph G. Given multiple graphs G , and for each G given its conformations C as i.i.d samples from an underlying Boltzmann distribution ( Noé et al. , 2019 ) , our goal is learning a generative model pθ ( C|G ) , which is easy to draw samples from , to approximate the Boltzmann function . 3.2 EQUIVARIANCE . Equivariance is ubiquitous in machine learning for atomic systems , e.g. , the vectors of atomic dipoles or forces should rotate accordingly w.r.t . the conformation coordinates ( Thomas et al. , 2018 ; Weiler et al. , 2018 ; Fuchs et al. , 2020 ; Miller et al. , 2020 ; Simm et al. , 2021 ; Batzner et al. , 2021 ) . It has shown effectiveness to integrate such inductive bias into model parameterization for modeling 3D geometry , which is critical for the generalization capacity ( Köhler et al. , 2020 ; Satorras et al. , 2021a ) . Formally , a function F : X → Y is equivariant w.r.t a group G if : F ◦ Tg ( x ) = Sg ◦ F ( x ) , ( 1 ) where Tg and Sg are transformations for an element g ∈ G , acting on the vector spaces X and Y , respectively . In this work , we consider the SE ( 3 ) group , i.e. , the group of rotation , translation in 3D space . This requires the estimated likelihood unaffected with translational and rotational transformations , and we will elaborate on how our method satisfy this property in Sec . 4 . | This paper tackles the problem of conditional generation of molecular conformations (i.e. 3D cartesian atom positions) given a molecular graph. The authors formulate the generation process via diffusion probabilistic models; Conformations are generated by learning a reverse diffusion process from isotropic gaussian noise to molecular conformations. They use a SE(3) invariant formulation of the diffusion process based on Kohler et al 2020, and they operate directly on atomic positions (i.e. a point cloud) instead of interatomic distances or an intermediate bond geometry representation. The authors show state of the art results evaluated by COV/MAT metrics on GEOM-Drugs and GEOM-QM9 datasets. | SP:121aa1ba84bd06178156dc6e2329827ae08431cb |
GeoDiff: A Geometric Diffusion Model for Molecular Conformation Generation | 1 INTRODUCTION . Graph representation learning has achieved huge success for molecule modeling in various tasks ranging from property prediction ( Gilmer et al. , 2017 ; Duvenaud et al. , 2015 ) to molecule generation ( Jin et al. , 2018 ; Shi et al. , 2020 ) , where typically a molecule is represented as an atom-bond graph . Despite its effectiveness in various applications , a more intrinsic and informative representation for molecules is the 3D geometry , also known as conformation , where atoms are represented as their Cartesian coordinates . The 3D structures determine the biological and physical properties of molecules and hence play a key role in many applications such as computational drug and material design ( Thomas et al. , 2018 ; Gebauer et al. , 2021 ; Jing et al. , 2021 ; Batzner et al. , 2021 ) . Unfortunately , how to predict stable molecular conformation remains a challenging problem . Traditional methods based on molecular dynamics ( MD ) or Markov chain Monte Carlo ( MCMC ) are very computationally expensive , especially for large molecules ( Hawkins , 2017 ) . Recently , significant progress has been made with machine learning approaches , especially with deep generative models . For example , Simm & Hernandez-Lobato ( 2020 ) ; Xu et al . ( 2021b ) studied predicting atomic distances with variational autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) and flow-based models ( Dinh et al. , 2017 ) respectively . Shi et al . ( 2021 ) proposed to use denoising score matching ( Song & Ermon , 2019 ; 2020 ) to estimate the gradient fields over atomic distances , through which the gradient fields over atomic coordinates can be calculated . Ganea et al . ( 2021 ) studied generating conformations by predicting both bond lengths and angles . As molecular conformations are roto-translational invariant , these approaches circumvent directly modeling atomic coordinates by leveraging intermediate geometric variables such as atomic distances , bond and torsion angles , which are roto-translational invariant . As a result , they are able to achieve very compelling performance . However , as all these approaches seek to indirectly model the intermediate geometric variables , they have inherent limitations in either training or inference process ( see Sec . 2 for a detailed description ) . Therefore , an ideal solution would still be directly modeling the atomic coordinates and at the same time taking the roto-translational invariance property into account . In this paper , we propose such a solution called GEODIFF , a principled probabilistic framework based on denoising diffusion models ( Sohl-Dickstein et al. , 2015 ) . Our approach is inspired by the diffusion process in nonequilibrium thermodynamics ( De Groot & Mazur , 2013 ) . We view atoms as particles in a thermodynamic system , which gradually diffuse from the original states to a noisy distribution in contact with a heat bath . At each time step , stochastic noises are added to the atomic positions . Our high-level idea is learning to reverse the diffusion process , which recovers the target geometric distribution from the noisy distribution . In particular , inspired by recent progress of denoising diffusion models on image generation ( Ho et al. , 2020 ; Song et al. , 2020 ) , we view the noisy geometries at different timesteps as latent variables , and formulate both the forward diffusion and reverse denoising process as Markov chains . Our goal is to learn the transition kernels such that the reverse process can recover realistic conformations from the chaotic positions sampled from a noise distribution . However , extending existing methods to geometric generation is highly non-trivial : a direct application of diffusion models on the conformation generation task lead to poor generation quality . As mentioned above , molecular conformations are roto-translational invariant , i.e. , the estimated ( conditional ) likelihood should be unaffected by translational and rotational transformations ( Köhler et al. , 2020 ) . To this end , we first theoretically show that a Markov process starting from an roto-translational invariant prior distribution and evolving with roto-translational equivariant Markov kernels can induce an roto-translational invariant density function . We further provide practical parameterization to define a roto-translational invariant prior distribution and a Markov kernel imposing the equivariance constraints . In addition , we derive a weighted variational lower bound of the conditional likelihood of molecular conformations , which also enjoys the rototranslational invariance and can be efficiently optimized . A unique strength of GEODIFF is that it directly acts on the atomic coordinates and entirely bypasses the usage of intermediate elements for both training and inference . This general formulation enjoys several crucial advantages . First , the model can be naturally trained end-to-end without involving any sophisticated techniques like bilevel programming ( Xu et al. , 2021b ) , which benefits from small optimization variances . Besides , instead of solving geometries from bond lengths or angles , the one-stage sampling fashion avoids accumulating any intermediate error , and therefore leads to more accurate predicted structures . Moreover , GEODIFF enjoys a high model capacity to approximate the complex distribution of conformations . Thus , the model can better estimate the highly multi-modal distribution and generate structures with high quality and diversity . We conduct comprehensive experiments on multiple benchmarks , including conformation generation and property prediction tasks . Numerical results show that GEODIFF consistently outperforms existing state-of-the-art machine learning approaches , and by a large margin on the more challenging large molecules . The significantly superior performance demonstrate the high capacity to model the complex distribution of molecular conformations and generate both diverse and accurate molecules . 2 RELATED WORK . Recently , various deep generative models have been proposed for conformation generation . Among them , CVGAE ( Mansimov et al. , 2019 ) first proposed a VAE model to directly generate 3D atomic coordinates , which fails to preserve the roto-translation equivariance property of conformations and suffers from poor performance . To address this problem , the majority of subsequent models are based on intermediate geometric elements such as atomic distances and torsion angles . A favorable property of these elements is the roto-translational invariance , ( e.g . atomic distances does not change when rotating the molecule ) , which has been shown to be an important inductive bias for molecular geometry modeling ( Köhler et al. , 2020 ) . However , such a decomposition suffers from several drawbacks for either training or sampling . For example , GRAPHDG ( Simm & HernandezLobato , 2020 ) and CGCF ( Xu et al. , 2021a ) proposed to predict the interatomic distance matrix by VAE and Flow respectively , and then solve the geometry through the Distance Geometry ( DG ) technique ( Liberti et al. , 2014 ) , which searches reasonable coordinates that matches with the predicted distances . CONFVAE further improves this pipeline by designing an end-to-end framework via bilevel optimization ( Xu et al. , 2021b ) . However , all these approaches suffer from the accumulated error problem , meaning that the noise in the predicted distances will misguide the coordinate searching process and lead to inaccurate or even erroneous structures . To overcome this problem , CONFGF ( Shi et al. , 2021 ) proposed to learn the gradient of the log-likelihood w.r.t coordinates . However , in practice the model is still aided by intermediate geometric elements , in that it first estimates the gradient w.r.t interatomic distances via denoising score matching ( DSM ) ( Song & Ermon , 2019 ; 2020 ) , and then derives the gradient of coordinates using the chain rule . The problem is , by learning the distance gradient via DSM , the model is fed with perturbed distance matrices , which may violate the triangular inequality or even contain negative values . As a consequence , the model is actually learned over invalid distance matrices but tested with valid ones calculated from coordinates , making it suffer from serious out-of-distribution ( Hendrycks & Gimpel , 2016 ) problem . Most recently , Ganea et al . ( 2021 ) proposed a highly systematic ( rule-based ) pipeline named GEOMOL , which learns to predict a set of geometric quantities ( i.e . length and angles ) and then reconstruct the local and global structures of the conformation in a sophisticated procedure . Despite its effectiveness , this method can be only adopted to molecules with a specific pattern , which limits it from wide applications . In our experiments , the pattern requirement filtered out nearly one third of molecular graphs , making it incomparable in our setting . Besides , there has also been efforts to use reinforcement learning for conformation search Gogineni et al . ( 2020 ) . Nevertheless , this method relies on rigid rotor approximation and can only model the torsion angles , and thus fundamentally differs from other approaches . 3 PRELIMINARIES . 3.1 NOTATIONS AND PROBLEM DEFINITION . Notations . In this paper each molecule with n atoms is represented as an undirected graph G = 〈V , E〉 , where V = { vi } ni=1 is the set of vertices representing atoms and E = { eij | ( i , j ) ⊆ |V| × |V| } is the set of edges representing inter-atomic bonds . Each node vi ∈ V describes the atomic attributes , e.g. , the element type . Each edge eij ∈ E describes the corresponding connection between vi and vj , and is labeled with its chemical type . In addition , we also assign the unconnected edges with a virtual type . For the geometry , each atom in V is embedded by a coordinate vector c ∈ R3 into the 3-dimensional space , and the full set of positions ( i.e. , the conformation ) can be represented as a matrix C = [ c1 , c2 , · · · , cn ] ∈ Rn×3 . Problem Definition . The task of molecular conformation generation is a conditional generative problem , where we are interested in generating stable conformations for a provided graph G. Given multiple graphs G , and for each G given its conformations C as i.i.d samples from an underlying Boltzmann distribution ( Noé et al. , 2019 ) , our goal is learning a generative model pθ ( C|G ) , which is easy to draw samples from , to approximate the Boltzmann function . 3.2 EQUIVARIANCE . Equivariance is ubiquitous in machine learning for atomic systems , e.g. , the vectors of atomic dipoles or forces should rotate accordingly w.r.t . the conformation coordinates ( Thomas et al. , 2018 ; Weiler et al. , 2018 ; Fuchs et al. , 2020 ; Miller et al. , 2020 ; Simm et al. , 2021 ; Batzner et al. , 2021 ) . It has shown effectiveness to integrate such inductive bias into model parameterization for modeling 3D geometry , which is critical for the generalization capacity ( Köhler et al. , 2020 ; Satorras et al. , 2021a ) . Formally , a function F : X → Y is equivariant w.r.t a group G if : F ◦ Tg ( x ) = Sg ◦ F ( x ) , ( 1 ) where Tg and Sg are transformations for an element g ∈ G , acting on the vector spaces X and Y , respectively . In this work , we consider the SE ( 3 ) group , i.e. , the group of rotation , translation in 3D space . This requires the estimated likelihood unaffected with translational and rotational transformations , and we will elaborate on how our method satisfy this property in Sec . 4 . | This paper describes and tests GeoDiff, an end-to-end denoising diffusion model for generating molecular conformations from a molecular graph. The idea is to learn how to denoise a random conformation so as to generate a realistic structure of a small molecule. To do so, a molecular structure is first transformed into a random configuration from an uncorrelated multivariate normal distribution via a diffusion process (forward process). By training a backwards model that inverts the diffusion process, molecular conformations can then be generated from white noise. The reverse process is modeled as a sequence of Markov kernels where each kernel is a Gaussian whose means are neural networks that are trained based on the forward trajectories. Molecular conformations are directly parameterized in Cartesian coordinates. Therefore, an important property that should be imposed on the reverse process is *equivariance*. Equivariance refers to the following behavior of a mapping under the action of a group: Transforming the input and then mapping it to some output is the same as applying the mapping first and then transforming the output. Here, the relevant group, the special Euclidean group $SE(3)$, is formed by the rigid transformations in $\mathbb R^3$. Equivariance is implemented by drawing the initial conformation from a distribution that is invariant under rigid transformations (isotropic Gaussian that removes the center of mass) and by using equivariant Markov kernels for the reverse process. The equivariance of the Markov kernels is implemented with equivariant convolutional layers (graph field network (GFN)). Two invariant objective functions for training are derived ("alignment approach" and "chain-rule approach"). GeoDiff is tested on two standard benchmarks and shows a superior performance compared to other molecular configuration generators. Also property predictions made by GeoDiff are better than with concurrent methods. | SP:121aa1ba84bd06178156dc6e2329827ae08431cb |
Feature Flow Regularization: Improving Structured Sparsity in Deep Neural Networks | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved huge success in a wide range of applications . Meanwhile , DNNs require considerably more computational cost and storage space as they become deeper in order to achieve higher accuracy . Denil et al . ( 2013 ) demonstrated that there is significant redundancy in the parameterization of DNNs . The Lottery Ticket Hypothesis ( Frankle & Carbin , 2019 ) conjectures that there exist sparse sub-networks that can obtain a comparable accuracy with the original network when trained in isolation . Model compression methods have been proposed to balance accuracy and model complexity , e.g . weight pruning ( Drucker & Le Cun , 1992 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; Guo et al. , 2016 ; Hu et al. , 2016 ; Li et al. , 2016 ) and quantization ( Gong et al. , 2014 ) , low-rank approximation ( Denton et al. , 2014 ; Jaderberg et al. , 2014 ; Liu et al. , 2015 ) , and sparsity structure learning ( Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Zhou et al. , 2016 ; Liu et al. , 2017 ; Louizos et al. , 2018 ; Gao et al. , 2019 ; Yuan et al. , 2020 ) . Weight pruning removes less important parameters in the network . In particular , filter pruning ( Li et al. , 2016 ) removes entire filters in the network together with their related channels , which can compress and accelerate DNNs efficiently . Existing structured pruning methods can be divided into two categories : parameter-based methods ( Li et al. , 2016 ; Molchanov et al. , 2016 ; Liu et al. , 2017 ; He et al. , 2018 ; Lin et al. , 2019 ; He et al. , 2019 ; Zhuang et al. , 2020 ; Liebenwein et al. , 2020 ) that use some criteria to identify unimportant filters and remove them , and feature-based methods ( Luo et al. , 2017 ; He et al. , 2017 ; Zhuang et al. , 2018 ; Ye et al. , 2018 ; Li et al. , 2020 ; Lin et al. , 2020 ; Tang et al. , 2020 ) that select unimportant feature maps and then remove related filters and channels . For example , Li et al . ( 2020 ) incorporated two feature map selections : discovering features with low diversity and removing features that have high similarities with others . In this paper , we propose a new regularization method on the trajectory connecting features of adjacent hidden layers , namely feature flow regularization ( FFR ) . FFR smooths the trajectory of features , which implicitly improves the structured sparsity in DNN . Our motivation is that the trajectory of data along the network reflects the DNN structure . Shorter and straighter trajectory corresponds to an efficient and sparse structure of DNN . An illustration is given in Figure 1b . Our main contributions are : ( 1 ) We propose a new regularization ( FFR ) on the trajectory connecting the features of hidden layers , to improve the structured sparsity in DNN from a perspective of the trajectory of data along the network . This method is different from the existing sparsity structure learning methods , which directly impose regularization or constraints on the parameters . Our method is also different from those pruning methods based on feature maps , which use the information of the feature map individually or in pairs ( for similarity ) without global relationship . ( 2 ) We analyze the effect of FFR applied to convolutional layer and residual layer , and show that FFR encourages DNN to learn a sparse structure during training by penalizing the sparsity of both parameters and features . ( 3 ) Experimental results show that FFR achieves a comparable or even better pruning ratio in terms of parameters and FLOPs than recent state-of-the-art pruning methods . 2 RELATED WORK . Filter pruning . Various criteria for filter selection in pruning have been proposed . Li et al . ( 2016 ) used L1 norm to select unimportant filters and removed the filters whose norm is lower than the given threshold together with their connecting feature maps . Molchanov et al . ( 2016 ) measured the importance of filters based on the change in the cost function induced by pruning . Luo et al . ( 2017 ) ; He et al . ( 2017 ) formulated pruning as a constraint optimization problem and selected most representative neurons based on minimizing the reconstitution error . Lin et al . ( 2019 ) pruned filters as well as other structures by generative adversarial learning . He et al . ( 2019 ) pruned redundant filters utilizing geometric correlation among filters in the same layer . Hu et al . ( 2016 ) ; Zhuang et al . ( 2018 ) ; Li et al . ( 2020 ) ; Lin et al . ( 2020 ) removed filters based on the information , e.g . sparsity , rank or diversity , of feature maps that are generated by the filters . Our method learns sparse DNN during training and adopts magnitude-based pruning scheme after training . Sparsity regularization . Some studies introduced sparsity regularization to find sparse structure of DNN . A commonly used strategy is to impose group Lasso and relaxed L0 regularization ( Zhou et al. , 2016 ; Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Louizos et al. , 2018 ) . Liu et al . ( 2017 ) ; Huang & Wang ( 2018 ) associated a scaling factor with feature maps and imposed regularization on these scaling factors during training to automatically identify unimportant channels . The feature maps with small scaling factor values will be pruned . Gao et al . ( 2019 ) imposed a Cross-Layer grouping and a Variance Aware regularization on the parameters to improve the structured sparsity for residual models . Zhuang et al . ( 2020 ) used polarization regularizer on scaling factors . Yuan et al . ( 2020 ) proposed a method to dynamically grow deep networks by continuously sparsifying structured parameter sets . Different from these available methods that directly introduce regularization on the parameters or scaling factors , our FFR imposes regularization on the trajectory connecting features of hidden layers to control the parameters and enforce structured sparsity implicitly . 3 METHOD . 3.1 FEATURE FLOW REGULARIZATION . We define feature flow as the trajectory formed by connecting the output features of adjacent hidden layers . For a DNN , the collection of trajectories with different input data from the training dataset reflect the network structure . We control these trajectories to obtain a sparse network . Consider the forward propagation of a DNN with L layers { xl } l=0,1 , ... , L : xl+1 = hl ( xl , wl ) , ( 1 ) where xl+1 is the output feature of the l-th layer , hl is the mapping in the l-th layer , and wl is the collection of trainable parameters . Introducing a temporal partition : { tl = l/L } Ll=0 with time interval ∆t = 1/L , and regarding xl as the value of a function x ( t ) at time step tl , without considering dimensional consistency , Eq . ( 1 ) can be rewritten as ( He et al. , 2016 ; E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) x ( tl+1 ) = x ( tl ) + ∆t · ĥl ( x ( tl ) , wl ) , ( 2 ) where ĥl = ( hl − xl ) /∆t . This can be interpreted as a discretization of evolution along a trajectory of the network described by an ordinary differential equation ( E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) dx ( t ) dt = ĥ ( x ( t ) , w ( t ) , t ) . ( 3 ) The feature flow is the trajectory formed by connecting features of { xl } , and is denoted by Γ { xl } . See Figure 1a for an illustration of the feature flow . We regard the trajectory x ( t ) as well as the feature flow trajectory Γ { xl } as a ” curve ” . Recall that for a curve γ ( t ) : [ 0 , 1 ] → RD with arc length parameter s , its length C ( γ ) and total absolute curvature K ( γ ) are C ( γ ) : = ∫ 1 0 ‖γ′ ( t ) ‖dt , K ( γ ) : = ∫ C ( γ ) 0 |κ ( s ) |ds , ( 4 ) where κ ( s ) = ‖γ′′ ( s ) ‖ is the curvature of the curve . We introduce feature flow regularization ( FFR ) to improve the structured sparsity of DNN , borrowing the definitions of length and total absolute curvature of a curve to the feature flow , i.e. , the trajectory formed by connecting features of hidden layers . For a feature flow associated with hidden layer features { xl } l=0,1 , ... , L , the FFR is R ( x ) : = k1C ( x ) + k2K ( x ) , ( 5 ) where C ( x ) = L−1∑ l=0 ‖xl+1 − xl‖ , K ( x ) = L−1∑ l=1 ‖xl+1 − 2xl + xl−1‖ , ( 6 ) with ‖ · ‖ being the L1 norm , and k1 , k2 > 0 the hyperparameters . Here up to some constant factors , C ( x ) ∼ ∑L−1 l=0 ‖x′ ( tl ) ‖ is an approximation of the total length of the trajectory x ( t ) , and K ( x ) ∼ ∑L−1 l=1 |κ ( tl ) | is an approximation of its total absolute curvature , where { xl = x ( tl ) } is a discretization of trajectory x ( t ) with time partition { tl = l/L } Ll=0 . FFR smooths the feature flow by controlling the length and curvature . Intuitively , the length term in Eq . ( 6 ) makes the feature flow short , and the curvature term in Eq . ( 6 ) keeps the feature flow from bending too much . As a result , DNN trained under FFR has a more sparse structure ; See demonstration in Figure 1b . More quantitative analysis is given in Sec . 4 . We further give an illustration example in Figure 1c , which is a two-dimensional visualization showing the smooth effect of FFR on the feature flow of a ResNet . In this example , the input , features and output are all points in two dimensions , and the feature flows are actual curves in two dimensions . We can see that the feature flow under FFR is shorter and straighter . More detail of this illustration example is given in Appendix Sec . A.1 . The curvature term also encourages more uniform distribution of hidden features on the trajectory from the input to the output , which makes it easier and more accurate to learn with sparse parameters ; see the discussion in appendix A.4 and Figure 7 3.2 FFR APPLIED TO DNN AND PRUNING . For a DNN and training dataset { ( x ( j ) , y ( j ) } N j=1 , using Eq . ( 5 ) , the FFR is : R ( X ( j ) ) = k1 L−1∑ i=0 ‖x ( j ) l+1 − x ( j ) l ‖+ k2 L−1∑ i=1 ‖x ( j ) l+1 − 2x ( j ) l + x ( j ) l−1‖ , ( 7 ) where X ( j ) = { xl , l = 0 , . . . , L } ( j ) denotes the set of output features of hidden layers for the j-th input data . The loss function with FFR in training is : 1 N N∑ j=1 [ J ( x ( j ) , y ( j ) , W ) +R ( X ( j ) ) ] , ( 8 ) where J ( x , y , W ) is the loss function before applying FFR . Note that two hidden states xl , xl+1 may have different dimensions . To fix the dimension mismatch problem , we adopt the same strategy as He et al . ( 2016 ) , i.e , using a linear projection Pl by the shortcut connections to match the dimensions . We replace xl in Eq . ( 7 ) by Plxl , where Pl is the learnt projection matrix and will be treated as learnable parameters in training . In implementation , we first group the features according to the stage ( features dimensions ) : X ( j ) = G⋃ g=1 { xg,1 , xg,2 , . . . , xg , lg } ( j ) , L = G∑ g=1 lg . ( 9 ) Here G is the number of stages in X ( j ) and lg is the number of hidden layers in stage g. Secondly , we use the projection matrix to link different groups since the dimensional mismatch only occurs at the first feature of each stage . Using this method , the FFR of X ( j ) becomes : R ( X ( j ) ) = k1 G∑ g=1 ‖x ( j ) g,1 − Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=1 ‖x ( j ) g , i+1 − x ( j ) g , i‖ + k2 G∑ g=1 ‖x ( j ) g,2 − 2x ( j ) g,1 + Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=2 ‖x ( j ) g , i+1 − 2x ( j ) g , i + x ( j ) g , i−1‖ . ( 10 ) In the meantime , the hyperparameters k1 , k2 may vary with the feature dimensions so that FFR can uniformly control the features at different stages . In our experiments , we adjust k1 , k2 to be inversely proportional to the scale of feature maps . Moreover , the FFR process can be generalized to the case where we choose features every several layers . We can denote the selected hidden layers as L = { li , i = 0 , 1 , . . . , m , m = # L } . Then we apply FFR to the feature flow that connects the features in the set X ( j ) = { xl , l ∈ L } . After training , we conduct one-shot filter pruning : removing filters with small magnitude and removing channels in the next layer that convolve with the feature maps generated by the pruned filters . Finally , we fine tune the pruned network for a few epochs . Our FFR training and pruning method is summarized in Algorithm 1 . Algorithm 1 FFR Training and One-shot Pruning Require : training dataset { ( x ( j ) , y ( j ) } N j=1 , a neural network and hyperparameters k1 , k2 . Pre-step 1 : group the features in X = { xl , l ∈ L } according to the stage as in Eq . ( 9 ) , Pre-step 2 : write down FFRR ( X ( j ) ) in Eq . ( 10 ) for each paired data ( x ( j ) , y ( j ) ) . Training step : train the network under loss function with FFR given in Eq . ( 8 ) . Pruning step : remove filters and the corresponding channels in the trained model , fine tune the pruned model for a few epochs . return a compact neural network . | The paper proposes a new method, called feature flow regularization, for structured sparsity and pruning in deep neural networks. In the proposed method, the length and curvature of trajectories connecting the features of adjacent hidden layers are penalized which is claimed to implicitly result in structured sparsity. Experiments compare the method with several state-of-the-art methods on two datasets and architectures. | SP:c10b7d4dba47fd80673b0eea34d98b182658ec19 |
Feature Flow Regularization: Improving Structured Sparsity in Deep Neural Networks | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved huge success in a wide range of applications . Meanwhile , DNNs require considerably more computational cost and storage space as they become deeper in order to achieve higher accuracy . Denil et al . ( 2013 ) demonstrated that there is significant redundancy in the parameterization of DNNs . The Lottery Ticket Hypothesis ( Frankle & Carbin , 2019 ) conjectures that there exist sparse sub-networks that can obtain a comparable accuracy with the original network when trained in isolation . Model compression methods have been proposed to balance accuracy and model complexity , e.g . weight pruning ( Drucker & Le Cun , 1992 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; Guo et al. , 2016 ; Hu et al. , 2016 ; Li et al. , 2016 ) and quantization ( Gong et al. , 2014 ) , low-rank approximation ( Denton et al. , 2014 ; Jaderberg et al. , 2014 ; Liu et al. , 2015 ) , and sparsity structure learning ( Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Zhou et al. , 2016 ; Liu et al. , 2017 ; Louizos et al. , 2018 ; Gao et al. , 2019 ; Yuan et al. , 2020 ) . Weight pruning removes less important parameters in the network . In particular , filter pruning ( Li et al. , 2016 ) removes entire filters in the network together with their related channels , which can compress and accelerate DNNs efficiently . Existing structured pruning methods can be divided into two categories : parameter-based methods ( Li et al. , 2016 ; Molchanov et al. , 2016 ; Liu et al. , 2017 ; He et al. , 2018 ; Lin et al. , 2019 ; He et al. , 2019 ; Zhuang et al. , 2020 ; Liebenwein et al. , 2020 ) that use some criteria to identify unimportant filters and remove them , and feature-based methods ( Luo et al. , 2017 ; He et al. , 2017 ; Zhuang et al. , 2018 ; Ye et al. , 2018 ; Li et al. , 2020 ; Lin et al. , 2020 ; Tang et al. , 2020 ) that select unimportant feature maps and then remove related filters and channels . For example , Li et al . ( 2020 ) incorporated two feature map selections : discovering features with low diversity and removing features that have high similarities with others . In this paper , we propose a new regularization method on the trajectory connecting features of adjacent hidden layers , namely feature flow regularization ( FFR ) . FFR smooths the trajectory of features , which implicitly improves the structured sparsity in DNN . Our motivation is that the trajectory of data along the network reflects the DNN structure . Shorter and straighter trajectory corresponds to an efficient and sparse structure of DNN . An illustration is given in Figure 1b . Our main contributions are : ( 1 ) We propose a new regularization ( FFR ) on the trajectory connecting the features of hidden layers , to improve the structured sparsity in DNN from a perspective of the trajectory of data along the network . This method is different from the existing sparsity structure learning methods , which directly impose regularization or constraints on the parameters . Our method is also different from those pruning methods based on feature maps , which use the information of the feature map individually or in pairs ( for similarity ) without global relationship . ( 2 ) We analyze the effect of FFR applied to convolutional layer and residual layer , and show that FFR encourages DNN to learn a sparse structure during training by penalizing the sparsity of both parameters and features . ( 3 ) Experimental results show that FFR achieves a comparable or even better pruning ratio in terms of parameters and FLOPs than recent state-of-the-art pruning methods . 2 RELATED WORK . Filter pruning . Various criteria for filter selection in pruning have been proposed . Li et al . ( 2016 ) used L1 norm to select unimportant filters and removed the filters whose norm is lower than the given threshold together with their connecting feature maps . Molchanov et al . ( 2016 ) measured the importance of filters based on the change in the cost function induced by pruning . Luo et al . ( 2017 ) ; He et al . ( 2017 ) formulated pruning as a constraint optimization problem and selected most representative neurons based on minimizing the reconstitution error . Lin et al . ( 2019 ) pruned filters as well as other structures by generative adversarial learning . He et al . ( 2019 ) pruned redundant filters utilizing geometric correlation among filters in the same layer . Hu et al . ( 2016 ) ; Zhuang et al . ( 2018 ) ; Li et al . ( 2020 ) ; Lin et al . ( 2020 ) removed filters based on the information , e.g . sparsity , rank or diversity , of feature maps that are generated by the filters . Our method learns sparse DNN during training and adopts magnitude-based pruning scheme after training . Sparsity regularization . Some studies introduced sparsity regularization to find sparse structure of DNN . A commonly used strategy is to impose group Lasso and relaxed L0 regularization ( Zhou et al. , 2016 ; Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Louizos et al. , 2018 ) . Liu et al . ( 2017 ) ; Huang & Wang ( 2018 ) associated a scaling factor with feature maps and imposed regularization on these scaling factors during training to automatically identify unimportant channels . The feature maps with small scaling factor values will be pruned . Gao et al . ( 2019 ) imposed a Cross-Layer grouping and a Variance Aware regularization on the parameters to improve the structured sparsity for residual models . Zhuang et al . ( 2020 ) used polarization regularizer on scaling factors . Yuan et al . ( 2020 ) proposed a method to dynamically grow deep networks by continuously sparsifying structured parameter sets . Different from these available methods that directly introduce regularization on the parameters or scaling factors , our FFR imposes regularization on the trajectory connecting features of hidden layers to control the parameters and enforce structured sparsity implicitly . 3 METHOD . 3.1 FEATURE FLOW REGULARIZATION . We define feature flow as the trajectory formed by connecting the output features of adjacent hidden layers . For a DNN , the collection of trajectories with different input data from the training dataset reflect the network structure . We control these trajectories to obtain a sparse network . Consider the forward propagation of a DNN with L layers { xl } l=0,1 , ... , L : xl+1 = hl ( xl , wl ) , ( 1 ) where xl+1 is the output feature of the l-th layer , hl is the mapping in the l-th layer , and wl is the collection of trainable parameters . Introducing a temporal partition : { tl = l/L } Ll=0 with time interval ∆t = 1/L , and regarding xl as the value of a function x ( t ) at time step tl , without considering dimensional consistency , Eq . ( 1 ) can be rewritten as ( He et al. , 2016 ; E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) x ( tl+1 ) = x ( tl ) + ∆t · ĥl ( x ( tl ) , wl ) , ( 2 ) where ĥl = ( hl − xl ) /∆t . This can be interpreted as a discretization of evolution along a trajectory of the network described by an ordinary differential equation ( E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) dx ( t ) dt = ĥ ( x ( t ) , w ( t ) , t ) . ( 3 ) The feature flow is the trajectory formed by connecting features of { xl } , and is denoted by Γ { xl } . See Figure 1a for an illustration of the feature flow . We regard the trajectory x ( t ) as well as the feature flow trajectory Γ { xl } as a ” curve ” . Recall that for a curve γ ( t ) : [ 0 , 1 ] → RD with arc length parameter s , its length C ( γ ) and total absolute curvature K ( γ ) are C ( γ ) : = ∫ 1 0 ‖γ′ ( t ) ‖dt , K ( γ ) : = ∫ C ( γ ) 0 |κ ( s ) |ds , ( 4 ) where κ ( s ) = ‖γ′′ ( s ) ‖ is the curvature of the curve . We introduce feature flow regularization ( FFR ) to improve the structured sparsity of DNN , borrowing the definitions of length and total absolute curvature of a curve to the feature flow , i.e. , the trajectory formed by connecting features of hidden layers . For a feature flow associated with hidden layer features { xl } l=0,1 , ... , L , the FFR is R ( x ) : = k1C ( x ) + k2K ( x ) , ( 5 ) where C ( x ) = L−1∑ l=0 ‖xl+1 − xl‖ , K ( x ) = L−1∑ l=1 ‖xl+1 − 2xl + xl−1‖ , ( 6 ) with ‖ · ‖ being the L1 norm , and k1 , k2 > 0 the hyperparameters . Here up to some constant factors , C ( x ) ∼ ∑L−1 l=0 ‖x′ ( tl ) ‖ is an approximation of the total length of the trajectory x ( t ) , and K ( x ) ∼ ∑L−1 l=1 |κ ( tl ) | is an approximation of its total absolute curvature , where { xl = x ( tl ) } is a discretization of trajectory x ( t ) with time partition { tl = l/L } Ll=0 . FFR smooths the feature flow by controlling the length and curvature . Intuitively , the length term in Eq . ( 6 ) makes the feature flow short , and the curvature term in Eq . ( 6 ) keeps the feature flow from bending too much . As a result , DNN trained under FFR has a more sparse structure ; See demonstration in Figure 1b . More quantitative analysis is given in Sec . 4 . We further give an illustration example in Figure 1c , which is a two-dimensional visualization showing the smooth effect of FFR on the feature flow of a ResNet . In this example , the input , features and output are all points in two dimensions , and the feature flows are actual curves in two dimensions . We can see that the feature flow under FFR is shorter and straighter . More detail of this illustration example is given in Appendix Sec . A.1 . The curvature term also encourages more uniform distribution of hidden features on the trajectory from the input to the output , which makes it easier and more accurate to learn with sparse parameters ; see the discussion in appendix A.4 and Figure 7 3.2 FFR APPLIED TO DNN AND PRUNING . For a DNN and training dataset { ( x ( j ) , y ( j ) } N j=1 , using Eq . ( 5 ) , the FFR is : R ( X ( j ) ) = k1 L−1∑ i=0 ‖x ( j ) l+1 − x ( j ) l ‖+ k2 L−1∑ i=1 ‖x ( j ) l+1 − 2x ( j ) l + x ( j ) l−1‖ , ( 7 ) where X ( j ) = { xl , l = 0 , . . . , L } ( j ) denotes the set of output features of hidden layers for the j-th input data . The loss function with FFR in training is : 1 N N∑ j=1 [ J ( x ( j ) , y ( j ) , W ) +R ( X ( j ) ) ] , ( 8 ) where J ( x , y , W ) is the loss function before applying FFR . Note that two hidden states xl , xl+1 may have different dimensions . To fix the dimension mismatch problem , we adopt the same strategy as He et al . ( 2016 ) , i.e , using a linear projection Pl by the shortcut connections to match the dimensions . We replace xl in Eq . ( 7 ) by Plxl , where Pl is the learnt projection matrix and will be treated as learnable parameters in training . In implementation , we first group the features according to the stage ( features dimensions ) : X ( j ) = G⋃ g=1 { xg,1 , xg,2 , . . . , xg , lg } ( j ) , L = G∑ g=1 lg . ( 9 ) Here G is the number of stages in X ( j ) and lg is the number of hidden layers in stage g. Secondly , we use the projection matrix to link different groups since the dimensional mismatch only occurs at the first feature of each stage . Using this method , the FFR of X ( j ) becomes : R ( X ( j ) ) = k1 G∑ g=1 ‖x ( j ) g,1 − Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=1 ‖x ( j ) g , i+1 − x ( j ) g , i‖ + k2 G∑ g=1 ‖x ( j ) g,2 − 2x ( j ) g,1 + Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=2 ‖x ( j ) g , i+1 − 2x ( j ) g , i + x ( j ) g , i−1‖ . ( 10 ) In the meantime , the hyperparameters k1 , k2 may vary with the feature dimensions so that FFR can uniformly control the features at different stages . In our experiments , we adjust k1 , k2 to be inversely proportional to the scale of feature maps . Moreover , the FFR process can be generalized to the case where we choose features every several layers . We can denote the selected hidden layers as L = { li , i = 0 , 1 , . . . , m , m = # L } . Then we apply FFR to the feature flow that connects the features in the set X ( j ) = { xl , l ∈ L } . After training , we conduct one-shot filter pruning : removing filters with small magnitude and removing channels in the next layer that convolve with the feature maps generated by the pruned filters . Finally , we fine tune the pruned network for a few epochs . Our FFR training and pruning method is summarized in Algorithm 1 . Algorithm 1 FFR Training and One-shot Pruning Require : training dataset { ( x ( j ) , y ( j ) } N j=1 , a neural network and hyperparameters k1 , k2 . Pre-step 1 : group the features in X = { xl , l ∈ L } according to the stage as in Eq . ( 9 ) , Pre-step 2 : write down FFRR ( X ( j ) ) in Eq . ( 10 ) for each paired data ( x ( j ) , y ( j ) ) . Training step : train the network under loss function with FFR given in Eq . ( 8 ) . Pruning step : remove filters and the corresponding channels in the trained model , fine tune the pruned model for a few epochs . return a compact neural network . | This paper deals with network pruning from a fresh perspective. It essentially argues that networks that implement simple mappings are more amenable to pruning. The authors support this claim with experimental evidence. Personally I think this idea is intellectually appealing, and may have uses beyond the network pruning setting. Some concerns related to prior art linger. | SP:c10b7d4dba47fd80673b0eea34d98b182658ec19 |
Feature Flow Regularization: Improving Structured Sparsity in Deep Neural Networks | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved huge success in a wide range of applications . Meanwhile , DNNs require considerably more computational cost and storage space as they become deeper in order to achieve higher accuracy . Denil et al . ( 2013 ) demonstrated that there is significant redundancy in the parameterization of DNNs . The Lottery Ticket Hypothesis ( Frankle & Carbin , 2019 ) conjectures that there exist sparse sub-networks that can obtain a comparable accuracy with the original network when trained in isolation . Model compression methods have been proposed to balance accuracy and model complexity , e.g . weight pruning ( Drucker & Le Cun , 1992 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; Guo et al. , 2016 ; Hu et al. , 2016 ; Li et al. , 2016 ) and quantization ( Gong et al. , 2014 ) , low-rank approximation ( Denton et al. , 2014 ; Jaderberg et al. , 2014 ; Liu et al. , 2015 ) , and sparsity structure learning ( Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Zhou et al. , 2016 ; Liu et al. , 2017 ; Louizos et al. , 2018 ; Gao et al. , 2019 ; Yuan et al. , 2020 ) . Weight pruning removes less important parameters in the network . In particular , filter pruning ( Li et al. , 2016 ) removes entire filters in the network together with their related channels , which can compress and accelerate DNNs efficiently . Existing structured pruning methods can be divided into two categories : parameter-based methods ( Li et al. , 2016 ; Molchanov et al. , 2016 ; Liu et al. , 2017 ; He et al. , 2018 ; Lin et al. , 2019 ; He et al. , 2019 ; Zhuang et al. , 2020 ; Liebenwein et al. , 2020 ) that use some criteria to identify unimportant filters and remove them , and feature-based methods ( Luo et al. , 2017 ; He et al. , 2017 ; Zhuang et al. , 2018 ; Ye et al. , 2018 ; Li et al. , 2020 ; Lin et al. , 2020 ; Tang et al. , 2020 ) that select unimportant feature maps and then remove related filters and channels . For example , Li et al . ( 2020 ) incorporated two feature map selections : discovering features with low diversity and removing features that have high similarities with others . In this paper , we propose a new regularization method on the trajectory connecting features of adjacent hidden layers , namely feature flow regularization ( FFR ) . FFR smooths the trajectory of features , which implicitly improves the structured sparsity in DNN . Our motivation is that the trajectory of data along the network reflects the DNN structure . Shorter and straighter trajectory corresponds to an efficient and sparse structure of DNN . An illustration is given in Figure 1b . Our main contributions are : ( 1 ) We propose a new regularization ( FFR ) on the trajectory connecting the features of hidden layers , to improve the structured sparsity in DNN from a perspective of the trajectory of data along the network . This method is different from the existing sparsity structure learning methods , which directly impose regularization or constraints on the parameters . Our method is also different from those pruning methods based on feature maps , which use the information of the feature map individually or in pairs ( for similarity ) without global relationship . ( 2 ) We analyze the effect of FFR applied to convolutional layer and residual layer , and show that FFR encourages DNN to learn a sparse structure during training by penalizing the sparsity of both parameters and features . ( 3 ) Experimental results show that FFR achieves a comparable or even better pruning ratio in terms of parameters and FLOPs than recent state-of-the-art pruning methods . 2 RELATED WORK . Filter pruning . Various criteria for filter selection in pruning have been proposed . Li et al . ( 2016 ) used L1 norm to select unimportant filters and removed the filters whose norm is lower than the given threshold together with their connecting feature maps . Molchanov et al . ( 2016 ) measured the importance of filters based on the change in the cost function induced by pruning . Luo et al . ( 2017 ) ; He et al . ( 2017 ) formulated pruning as a constraint optimization problem and selected most representative neurons based on minimizing the reconstitution error . Lin et al . ( 2019 ) pruned filters as well as other structures by generative adversarial learning . He et al . ( 2019 ) pruned redundant filters utilizing geometric correlation among filters in the same layer . Hu et al . ( 2016 ) ; Zhuang et al . ( 2018 ) ; Li et al . ( 2020 ) ; Lin et al . ( 2020 ) removed filters based on the information , e.g . sparsity , rank or diversity , of feature maps that are generated by the filters . Our method learns sparse DNN during training and adopts magnitude-based pruning scheme after training . Sparsity regularization . Some studies introduced sparsity regularization to find sparse structure of DNN . A commonly used strategy is to impose group Lasso and relaxed L0 regularization ( Zhou et al. , 2016 ; Wen et al. , 2016 ; Alvarez & Salzmann , 2016 ; Louizos et al. , 2018 ) . Liu et al . ( 2017 ) ; Huang & Wang ( 2018 ) associated a scaling factor with feature maps and imposed regularization on these scaling factors during training to automatically identify unimportant channels . The feature maps with small scaling factor values will be pruned . Gao et al . ( 2019 ) imposed a Cross-Layer grouping and a Variance Aware regularization on the parameters to improve the structured sparsity for residual models . Zhuang et al . ( 2020 ) used polarization regularizer on scaling factors . Yuan et al . ( 2020 ) proposed a method to dynamically grow deep networks by continuously sparsifying structured parameter sets . Different from these available methods that directly introduce regularization on the parameters or scaling factors , our FFR imposes regularization on the trajectory connecting features of hidden layers to control the parameters and enforce structured sparsity implicitly . 3 METHOD . 3.1 FEATURE FLOW REGULARIZATION . We define feature flow as the trajectory formed by connecting the output features of adjacent hidden layers . For a DNN , the collection of trajectories with different input data from the training dataset reflect the network structure . We control these trajectories to obtain a sparse network . Consider the forward propagation of a DNN with L layers { xl } l=0,1 , ... , L : xl+1 = hl ( xl , wl ) , ( 1 ) where xl+1 is the output feature of the l-th layer , hl is the mapping in the l-th layer , and wl is the collection of trainable parameters . Introducing a temporal partition : { tl = l/L } Ll=0 with time interval ∆t = 1/L , and regarding xl as the value of a function x ( t ) at time step tl , without considering dimensional consistency , Eq . ( 1 ) can be rewritten as ( He et al. , 2016 ; E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) x ( tl+1 ) = x ( tl ) + ∆t · ĥl ( x ( tl ) , wl ) , ( 2 ) where ĥl = ( hl − xl ) /∆t . This can be interpreted as a discretization of evolution along a trajectory of the network described by an ordinary differential equation ( E , 2017 ; Lu et al. , 2017 ; Chen et al. , 2018 ) dx ( t ) dt = ĥ ( x ( t ) , w ( t ) , t ) . ( 3 ) The feature flow is the trajectory formed by connecting features of { xl } , and is denoted by Γ { xl } . See Figure 1a for an illustration of the feature flow . We regard the trajectory x ( t ) as well as the feature flow trajectory Γ { xl } as a ” curve ” . Recall that for a curve γ ( t ) : [ 0 , 1 ] → RD with arc length parameter s , its length C ( γ ) and total absolute curvature K ( γ ) are C ( γ ) : = ∫ 1 0 ‖γ′ ( t ) ‖dt , K ( γ ) : = ∫ C ( γ ) 0 |κ ( s ) |ds , ( 4 ) where κ ( s ) = ‖γ′′ ( s ) ‖ is the curvature of the curve . We introduce feature flow regularization ( FFR ) to improve the structured sparsity of DNN , borrowing the definitions of length and total absolute curvature of a curve to the feature flow , i.e. , the trajectory formed by connecting features of hidden layers . For a feature flow associated with hidden layer features { xl } l=0,1 , ... , L , the FFR is R ( x ) : = k1C ( x ) + k2K ( x ) , ( 5 ) where C ( x ) = L−1∑ l=0 ‖xl+1 − xl‖ , K ( x ) = L−1∑ l=1 ‖xl+1 − 2xl + xl−1‖ , ( 6 ) with ‖ · ‖ being the L1 norm , and k1 , k2 > 0 the hyperparameters . Here up to some constant factors , C ( x ) ∼ ∑L−1 l=0 ‖x′ ( tl ) ‖ is an approximation of the total length of the trajectory x ( t ) , and K ( x ) ∼ ∑L−1 l=1 |κ ( tl ) | is an approximation of its total absolute curvature , where { xl = x ( tl ) } is a discretization of trajectory x ( t ) with time partition { tl = l/L } Ll=0 . FFR smooths the feature flow by controlling the length and curvature . Intuitively , the length term in Eq . ( 6 ) makes the feature flow short , and the curvature term in Eq . ( 6 ) keeps the feature flow from bending too much . As a result , DNN trained under FFR has a more sparse structure ; See demonstration in Figure 1b . More quantitative analysis is given in Sec . 4 . We further give an illustration example in Figure 1c , which is a two-dimensional visualization showing the smooth effect of FFR on the feature flow of a ResNet . In this example , the input , features and output are all points in two dimensions , and the feature flows are actual curves in two dimensions . We can see that the feature flow under FFR is shorter and straighter . More detail of this illustration example is given in Appendix Sec . A.1 . The curvature term also encourages more uniform distribution of hidden features on the trajectory from the input to the output , which makes it easier and more accurate to learn with sparse parameters ; see the discussion in appendix A.4 and Figure 7 3.2 FFR APPLIED TO DNN AND PRUNING . For a DNN and training dataset { ( x ( j ) , y ( j ) } N j=1 , using Eq . ( 5 ) , the FFR is : R ( X ( j ) ) = k1 L−1∑ i=0 ‖x ( j ) l+1 − x ( j ) l ‖+ k2 L−1∑ i=1 ‖x ( j ) l+1 − 2x ( j ) l + x ( j ) l−1‖ , ( 7 ) where X ( j ) = { xl , l = 0 , . . . , L } ( j ) denotes the set of output features of hidden layers for the j-th input data . The loss function with FFR in training is : 1 N N∑ j=1 [ J ( x ( j ) , y ( j ) , W ) +R ( X ( j ) ) ] , ( 8 ) where J ( x , y , W ) is the loss function before applying FFR . Note that two hidden states xl , xl+1 may have different dimensions . To fix the dimension mismatch problem , we adopt the same strategy as He et al . ( 2016 ) , i.e , using a linear projection Pl by the shortcut connections to match the dimensions . We replace xl in Eq . ( 7 ) by Plxl , where Pl is the learnt projection matrix and will be treated as learnable parameters in training . In implementation , we first group the features according to the stage ( features dimensions ) : X ( j ) = G⋃ g=1 { xg,1 , xg,2 , . . . , xg , lg } ( j ) , L = G∑ g=1 lg . ( 9 ) Here G is the number of stages in X ( j ) and lg is the number of hidden layers in stage g. Secondly , we use the projection matrix to link different groups since the dimensional mismatch only occurs at the first feature of each stage . Using this method , the FFR of X ( j ) becomes : R ( X ( j ) ) = k1 G∑ g=1 ‖x ( j ) g,1 − Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=1 ‖x ( j ) g , i+1 − x ( j ) g , i‖ + k2 G∑ g=1 ‖x ( j ) g,2 − 2x ( j ) g,1 + Pgx ( j ) g−1 , l ( g−1 ) ‖+ lg−1∑ i=2 ‖x ( j ) g , i+1 − 2x ( j ) g , i + x ( j ) g , i−1‖ . ( 10 ) In the meantime , the hyperparameters k1 , k2 may vary with the feature dimensions so that FFR can uniformly control the features at different stages . In our experiments , we adjust k1 , k2 to be inversely proportional to the scale of feature maps . Moreover , the FFR process can be generalized to the case where we choose features every several layers . We can denote the selected hidden layers as L = { li , i = 0 , 1 , . . . , m , m = # L } . Then we apply FFR to the feature flow that connects the features in the set X ( j ) = { xl , l ∈ L } . After training , we conduct one-shot filter pruning : removing filters with small magnitude and removing channels in the next layer that convolve with the feature maps generated by the pruned filters . Finally , we fine tune the pruned network for a few epochs . Our FFR training and pruning method is summarized in Algorithm 1 . Algorithm 1 FFR Training and One-shot Pruning Require : training dataset { ( x ( j ) , y ( j ) } N j=1 , a neural network and hyperparameters k1 , k2 . Pre-step 1 : group the features in X = { xl , l ∈ L } according to the stage as in Eq . ( 9 ) , Pre-step 2 : write down FFRR ( X ( j ) ) in Eq . ( 10 ) for each paired data ( x ( j ) , y ( j ) ) . Training step : train the network under loss function with FFR given in Eq . ( 8 ) . Pruning step : remove filters and the corresponding channels in the trained model , fine tune the pruned model for a few epochs . return a compact neural network . | This paper proposes a regularization strategy for learning sparse deep CNN models. The Feature Flow Regularization (FFR), penalizes first and second order changes in the intermediate features between consecutive layers of the network. The intention of this regularization is to smooth the evolution of features and make sparse weights. | SP:c10b7d4dba47fd80673b0eea34d98b182658ec19 |
Contrastively Enforcing Distinctiveness for Multi-Label Classification | 1 INTRODUCTION . Multi-label image classification is a fundamental and practical computer vision task , where the goal is to predict a set of labels ( e.g. , objects or attributes ) associated with an input image . It is an essential component in many applications such as recommendation systems ( Jain et al. , 2016 ; Yang et al. , 2015 ) , medical image diagnosis ( Ge et al. , 2018b ) , and human attribute recognition ( Li et al. , 2016b ) . Compared to single-label cases , multi-label classification is usually more complex and challenging . Recently , contrastive learning ( CL ) ( Chen et al. , 2020 ; He et al. , 2020 ; Li et al. , 2020 ; Caron et al. , 2020 ; Bachman et al. , 2019 ) has been shown as an effective pretext approach to learn latent representations an unsupervised way , which can be further used for supervised tasks . In general , CL aims to pull together an anchor and a similar ( or positive ) sample in embedding space and push apart the anchor from many dissimilar ( or negative ) samples . Therefore , the choice of the positive and negative samples of an anchor is a key to achieving good performance with CL . In self-supervised CL ( Chen et al. , 2020 ) , the positive sample is defined as those augmented from the same image with the anchor , while the negative samples are all the other images in the minibatch . More recently , supervised CL ( Khosla et al. , 2020 ; Sun et al. , 2021 ; Yuan et al. , 2021 ; Huynh , 2021 ) has been proposed , where all the images with the same label as the anchor are considered as the positive samples and vice versa for the negative ones . Supervised CL has shown improvements in single-label image classifications than the self-supervised counterpart . With the above successful examples , CL has drawn significant research attention and has been applied in other tasks including image segmentation ( Wang et al. , 2021 ) , adversarial training ( Kim et al. , 2020 ) , and text to image learning ( Radford et al. , 2021 ) . Given the appealing properties and promising results of CL in single-label classification , it is natural to adapt it into multi-label cases to boost performance . However , this adaptation is non-trivial . In single-label cases , an image usually contains one salient object , thus , the label of the object can also be viewed as the unique label of the image . Therefore , it is reasonable to use one image-level representation of an image and to push the representation of the anchor close to its positive samples ( e.g , augmentations of the anchor or images with the same label as the anchor ) , as done in selfsupervised and supervised CL . However , with a single image-level representation for an image , it is hard to define the positive or negative samples for an anchor image by its multiple labels in the multi-label classification . For example , it would not be reasonable to assume that the image-level representations of images containing apples must always be close to each other , as apple is just one of many objects in those images and an apple may only take a small area of an image . As a result , this setting hinders the application of existing CL methods to multi-label classification . To bridge this gap , we in this paper propose a novel end-to-end framework for multi-label image classification that leverages the contrastive learning principle , termed MulCon or Multi-label Classification with Contrastive Loss . Instead of using image-level representations as in previous CL methods , we introduce a new module that learns multiple label-level representations of an image , which are generated with the attention from the globally class-specific embeddings to the image features learned by a convolutional neural network ( CNN ) . Each label-level embedding of an image corresponds to the image ’ s representation in the context of a specific label . With these definitions , the supervised CL loss can be applied . Specifically , if we look at one specific label and view a labellevel embedding of an image as the anchor in our proposed CL framework , it is straightforward to define the positive samples of an anchor , which are the label-level embeddings of the other images in the minibatch with the same label and vice versa for the negative samples . For example , instead of sharing an image-level representation with other objects , the apple object of an image has its own embedding and the embeddings of the apples of all the images in a minibatch are pushed close to each other . Therefore , our framework is intuitive in the multi-label setting . In this way , the CL loss can enforce the coherence and consistency of the label-level representations of images , which further provides more discriminative power of the prediction procedure based on these representations . The main contributions can be summarized as follows : 1 ) Contrastive learning has been shown successful in many single-label classification problems , however , it is non-trivial to apply it in multilabel classification . We propose an intuitive and conceptually simple framework that encompasses contrastive learning . 2 ) Along with the proposed framework , we also introduce a practical training scheme of contrastive learning for multi-label classification . 3 ) We conduct extensive experiments on large-scale benchmark datasets , showing that the proposed framework achieves the state-of-theart performance in multi-label image classification . 2 PROPOSED METHOD . In this section , we first discuss about the background knowledge and relevant notations and then elaborate on the details of the proposed framework , MulCon . 2.1 BACKGROUND AND NOTATIONS . Multi-label Classification Following the standard setting of multi-label image classification , we denote a minibatch of input images by X ∈ RN×W×H×3 , where N is the batch size , H and W are the height and width of the images . Each image xi ∈ X is associated with multiple labels selected from a set of L labels in total , which are denoted by a multi-hot binary vector yi ∈ { 0 , 1 } L. For an active label j of xi , yij = 1 and vice versa . Our task is to build an end-to-end model that takes xi to predict its labels yi . Attention The Attention mechanism ( Luong et al. , 2015 ; Xu et al. , 2015 ) has been widely used in various areas of computer vision and natural language processing , which enhances the important parts of the data of interest and fades out the rest . Assume that nq query vectors of size dq denoted as Q ∈ Rnq×dq , and nv key-value pairs denoted as K ∈ Rnv×dq , V ∈ Rnv×dv . The attention function maps the query vectors Q to outputs using the key-value pairs as follows : Att ( Q , K , V ) = ω ( QKT ) V ( 1 ) where the dot product ( QKT ) ∈ Rnq×nv and ω ( · ) is softmax function . The dot product returns the similarity of each query and key value . The output ω ( QKT ) V ∈ Rnq×dv is the weighted sum over V , where larger weight corresponds to larger similarity between query and key . A powerful extension to the above ( single- ) attention mechanism is the multi-head attention introduced in ( Vaswani et al. , 2017 ) , which allows the model to jointly attend to information from different representation subspaces at different positions . Instead of computing a single attention function , this method first projects Q , K , V onto h different vectors , respectively . An attention function Att ( · ) is applied individually to these h projections . The output is a linear transformation of the concatenation of all attention outputs : MultiAtt ( Q , K , V ) = concat ( O1 , O2 , · · · , Oh ) W o , Oi′ = Att ( QW q i′ , KW k i′ , V W v i′ ) for i ′ ∈ 1 , · · · , h , ( 2 ) whereW o , W qi′ , W k i′ , W v i′ are learnable parameters of some linear layers . QW q i′ ∈ R nq×dhq , KW ki′ ∈ Rnv×d h q , VW vi′ ∈ Rnv×d h v are vectors projected from Q , K , V respectively . dhq = dq/h and d h v = dv/h . Following the architecture of the transformer ( Vaswani et al. , 2017 ; Lee et al. , 2019 ) , we define the following multi-head attention block : MultiAttBlock ( Q , K , V ) = LayerNorm ( Q′ +Q′W q ′ ) , ( 3 ) Q′ = LayerNorm ( concat ( QW q1 , · · · , QW q h ) + MultiAtt ( Q , K , V ) ) where W q ′ ∈ Rdq×dq is a learnable linear layer . Base on the multi-head attention block , we further define a self-attention block as follows : SA ( X ) = MultiAttBlock ( X , X , X ) ( 4 ) Contrastive Learning Contrastive learning ( CL ) has been an increasingly popular and effective representation learning approach ( Chen et al. , 2020 ; He et al. , 2020 ; Khosla et al. , 2020 ) . As the first proposed CL approach , self-supervised CL ( Chen et al. , 2020 ) is proposed to learn presentations in an unsupervised manner . Specifically , a mini-batch is constructed from the original input images and their augmented versions . Given a minibatch of 2N instances I = { 1 ... 2N } and an anchor instance i ∈ I , the augmented version of i , denoted as ia ∈ I is considered the positive sample , and the other 2 ( N − 1 ) instances within the mini-batch are considered negative examples . The loss function of self-supervised CL is defined as follows : Lself = − ∑ i∈I log exp ( zi · zia/τ ) ∑ za∈A ( i ) exp ( zi · za/τ ) ( 5 ) where zi is the image embedding , zi · zia denotes the inner dot product between two embeddings , τ ∈ R+ is a scalar temperature parameter , and A ( i ) = I\zi . It can be seen that self-supervised CL pushes the embeddings of the samples augmented from the same image close to each other . More recently , the supervised CL ( Khosla et al. , 2020 ) adapts CL into the supervised settings , which utilizes the label information to select positive and negative samples . For supervised CL , the embeddings of the samples with the same labels are pushed close to each other , which achieves better performance in classification tasks . For more details of CL , we refer to Liu et al . ( 2021b ) . To our knowledge , CL has not been applied in solving multi-label classification yet . 2.2 PROPOSED METHOD . Unlike previous CL methods for single-label classification that use image-level representations , we propose to learn multiple label-level representations for each image , which facilitates the application of CL in multi-label classification . We introduce MulCon , which consists of three main neural network modules : the label-level embedding network , the contrastive learning projection network , and the classification networks as shown in Figure 1 . Label-Level Embedding Network As the key module of our framework , the label-level embedding network takes an image xi as input and outputs its label-level representations , denoted by gi ∈ RL×D , where each row of gi corresponds to the embedding of the image under the context of a specific label . Specifically , the label-level embedding network consists of two components : 1 ) The encoder block . We first adopt an encoder network that learns the image-level embedding as the backbone model as the backbone model : ri = Enc ( xi ) ∈ RC×H×W , where C , H , W are the number of channels , height , and width of the output . The backbone model can be implemented with an arbitrary model that learns good image features , e.g. , a convolutional neural network ( CNN ) such as ResNet ( He et al. , 2016 ) or visual transformer ( Dosovitskiy et al. , 2020 ) . We then reshape ri ∈ RWH×C for the next step ’ s processing . 2 ) The label-wise attention block . In this block , we introduce a set of vectors U ∈ RL×C , each row of which is to be learned as the global embedding for a specific label . To generate an image ’ s label-level embeddings gi , we propose a cascade of several self-attention blocks and a multi-head attention block to capture the interactions between ri and U as follows : ri = SA ( ri ) ; gi = MultiAttBlock ( U , ri , ri ) ; gi = SA ( gi ) . ( 6 ) To summarise , given an image xi , we first learn its representation ri ∈ RWH×C by the encoder , each row of which captures the feature of a location in the image . We then pass ri to a self-attention block that captures the interactions between the features of the image . Next , we feed ri to the multihead attention block , where the global label embeddings U is the query and ri is the key and value . As the sizes of the input and output channels of the multi-head attention are C and D , respectively , we have nq = nv = C and dq = nq = D for Eq . 2 . With the multi-head attention block , our model can learn the “ importance ” ( attention weight ) of the image feature to a specific label . For example , if an image contains an apple , the corresponding embedding is expected to be associated with a large attention weight from the apple label . The multi-headed attention can also help a label pay its attention to multiple objects in an image , i.e. , each of the attention heads can generate attention scores for a class-specific embedding over all the image-level embeddings . In this case , if an image consists of multiple apples , each of the apples receives a specific attention score from the apple label . Following up the multi-head attention is a self-attention block that implicitly helps improve label correlation . With the attention from all the labels , we can derive the label-level embeddings gi of the image from its image-label embedding ri . Contrastive Learning Projection Network After obtaining gi ∈ RL×D , we use gij ∈ RD to denote the label-level embedding of the input image i under the context of a specific label j ( j ∈ { 1 , · · · , L } ) . Following Chen et al . ( 2020 ) ; Khosla et al . ( 2020 ) , our framework includes a projection network Proj ( · ) that maps gij to a vector in another embedding space : zij = Proj ( gij ) ∈ Rdz , where the contrastive learning is performed . Classification Network Recall that the label-level embedding gij captures the input image i ’ s feature under the context of the label j . Thus , it can be used to predict whether j is active in i . Accordingly , we introduce a fully connected layer as a classifier f jc to predict the probability of the label j being active . Specifically , for each label j ∈ L the prediction score is sij = σ ( f jc ( gij ) ) ∈ ( 0 , 1 ) . We further denote si ∈ ( 0 , 1 ) L . | The authors introduce a new framework for multi-label classification that leverages supervise contrastive learning. The framework adds an attention mechanism on top of the image encoder. Thanks to that, per-label features can be obtained to perform label-wise contrastive learning. The proposed method (MulCon) is trained in two steps. The first step performs pre-training by optimizing only binary-cross entropy (BCE) loss. In the second step, the model is finetuned using a combination of BCE and proposed by the authors Label-Lebel Contrastive Loss. The experimental study on four datasets shows that the proposed approach achieves the new state-of-the-art results among other methods based on ResNet-101, on most from many performance measures. | SP:bb5fab1f649aa177369eefa14d9035b7ba87e8d9 |
Contrastively Enforcing Distinctiveness for Multi-Label Classification | 1 INTRODUCTION . Multi-label image classification is a fundamental and practical computer vision task , where the goal is to predict a set of labels ( e.g. , objects or attributes ) associated with an input image . It is an essential component in many applications such as recommendation systems ( Jain et al. , 2016 ; Yang et al. , 2015 ) , medical image diagnosis ( Ge et al. , 2018b ) , and human attribute recognition ( Li et al. , 2016b ) . Compared to single-label cases , multi-label classification is usually more complex and challenging . Recently , contrastive learning ( CL ) ( Chen et al. , 2020 ; He et al. , 2020 ; Li et al. , 2020 ; Caron et al. , 2020 ; Bachman et al. , 2019 ) has been shown as an effective pretext approach to learn latent representations an unsupervised way , which can be further used for supervised tasks . In general , CL aims to pull together an anchor and a similar ( or positive ) sample in embedding space and push apart the anchor from many dissimilar ( or negative ) samples . Therefore , the choice of the positive and negative samples of an anchor is a key to achieving good performance with CL . In self-supervised CL ( Chen et al. , 2020 ) , the positive sample is defined as those augmented from the same image with the anchor , while the negative samples are all the other images in the minibatch . More recently , supervised CL ( Khosla et al. , 2020 ; Sun et al. , 2021 ; Yuan et al. , 2021 ; Huynh , 2021 ) has been proposed , where all the images with the same label as the anchor are considered as the positive samples and vice versa for the negative ones . Supervised CL has shown improvements in single-label image classifications than the self-supervised counterpart . With the above successful examples , CL has drawn significant research attention and has been applied in other tasks including image segmentation ( Wang et al. , 2021 ) , adversarial training ( Kim et al. , 2020 ) , and text to image learning ( Radford et al. , 2021 ) . Given the appealing properties and promising results of CL in single-label classification , it is natural to adapt it into multi-label cases to boost performance . However , this adaptation is non-trivial . In single-label cases , an image usually contains one salient object , thus , the label of the object can also be viewed as the unique label of the image . Therefore , it is reasonable to use one image-level representation of an image and to push the representation of the anchor close to its positive samples ( e.g , augmentations of the anchor or images with the same label as the anchor ) , as done in selfsupervised and supervised CL . However , with a single image-level representation for an image , it is hard to define the positive or negative samples for an anchor image by its multiple labels in the multi-label classification . For example , it would not be reasonable to assume that the image-level representations of images containing apples must always be close to each other , as apple is just one of many objects in those images and an apple may only take a small area of an image . As a result , this setting hinders the application of existing CL methods to multi-label classification . To bridge this gap , we in this paper propose a novel end-to-end framework for multi-label image classification that leverages the contrastive learning principle , termed MulCon or Multi-label Classification with Contrastive Loss . Instead of using image-level representations as in previous CL methods , we introduce a new module that learns multiple label-level representations of an image , which are generated with the attention from the globally class-specific embeddings to the image features learned by a convolutional neural network ( CNN ) . Each label-level embedding of an image corresponds to the image ’ s representation in the context of a specific label . With these definitions , the supervised CL loss can be applied . Specifically , if we look at one specific label and view a labellevel embedding of an image as the anchor in our proposed CL framework , it is straightforward to define the positive samples of an anchor , which are the label-level embeddings of the other images in the minibatch with the same label and vice versa for the negative samples . For example , instead of sharing an image-level representation with other objects , the apple object of an image has its own embedding and the embeddings of the apples of all the images in a minibatch are pushed close to each other . Therefore , our framework is intuitive in the multi-label setting . In this way , the CL loss can enforce the coherence and consistency of the label-level representations of images , which further provides more discriminative power of the prediction procedure based on these representations . The main contributions can be summarized as follows : 1 ) Contrastive learning has been shown successful in many single-label classification problems , however , it is non-trivial to apply it in multilabel classification . We propose an intuitive and conceptually simple framework that encompasses contrastive learning . 2 ) Along with the proposed framework , we also introduce a practical training scheme of contrastive learning for multi-label classification . 3 ) We conduct extensive experiments on large-scale benchmark datasets , showing that the proposed framework achieves the state-of-theart performance in multi-label image classification . 2 PROPOSED METHOD . In this section , we first discuss about the background knowledge and relevant notations and then elaborate on the details of the proposed framework , MulCon . 2.1 BACKGROUND AND NOTATIONS . Multi-label Classification Following the standard setting of multi-label image classification , we denote a minibatch of input images by X ∈ RN×W×H×3 , where N is the batch size , H and W are the height and width of the images . Each image xi ∈ X is associated with multiple labels selected from a set of L labels in total , which are denoted by a multi-hot binary vector yi ∈ { 0 , 1 } L. For an active label j of xi , yij = 1 and vice versa . Our task is to build an end-to-end model that takes xi to predict its labels yi . Attention The Attention mechanism ( Luong et al. , 2015 ; Xu et al. , 2015 ) has been widely used in various areas of computer vision and natural language processing , which enhances the important parts of the data of interest and fades out the rest . Assume that nq query vectors of size dq denoted as Q ∈ Rnq×dq , and nv key-value pairs denoted as K ∈ Rnv×dq , V ∈ Rnv×dv . The attention function maps the query vectors Q to outputs using the key-value pairs as follows : Att ( Q , K , V ) = ω ( QKT ) V ( 1 ) where the dot product ( QKT ) ∈ Rnq×nv and ω ( · ) is softmax function . The dot product returns the similarity of each query and key value . The output ω ( QKT ) V ∈ Rnq×dv is the weighted sum over V , where larger weight corresponds to larger similarity between query and key . A powerful extension to the above ( single- ) attention mechanism is the multi-head attention introduced in ( Vaswani et al. , 2017 ) , which allows the model to jointly attend to information from different representation subspaces at different positions . Instead of computing a single attention function , this method first projects Q , K , V onto h different vectors , respectively . An attention function Att ( · ) is applied individually to these h projections . The output is a linear transformation of the concatenation of all attention outputs : MultiAtt ( Q , K , V ) = concat ( O1 , O2 , · · · , Oh ) W o , Oi′ = Att ( QW q i′ , KW k i′ , V W v i′ ) for i ′ ∈ 1 , · · · , h , ( 2 ) whereW o , W qi′ , W k i′ , W v i′ are learnable parameters of some linear layers . QW q i′ ∈ R nq×dhq , KW ki′ ∈ Rnv×d h q , VW vi′ ∈ Rnv×d h v are vectors projected from Q , K , V respectively . dhq = dq/h and d h v = dv/h . Following the architecture of the transformer ( Vaswani et al. , 2017 ; Lee et al. , 2019 ) , we define the following multi-head attention block : MultiAttBlock ( Q , K , V ) = LayerNorm ( Q′ +Q′W q ′ ) , ( 3 ) Q′ = LayerNorm ( concat ( QW q1 , · · · , QW q h ) + MultiAtt ( Q , K , V ) ) where W q ′ ∈ Rdq×dq is a learnable linear layer . Base on the multi-head attention block , we further define a self-attention block as follows : SA ( X ) = MultiAttBlock ( X , X , X ) ( 4 ) Contrastive Learning Contrastive learning ( CL ) has been an increasingly popular and effective representation learning approach ( Chen et al. , 2020 ; He et al. , 2020 ; Khosla et al. , 2020 ) . As the first proposed CL approach , self-supervised CL ( Chen et al. , 2020 ) is proposed to learn presentations in an unsupervised manner . Specifically , a mini-batch is constructed from the original input images and their augmented versions . Given a minibatch of 2N instances I = { 1 ... 2N } and an anchor instance i ∈ I , the augmented version of i , denoted as ia ∈ I is considered the positive sample , and the other 2 ( N − 1 ) instances within the mini-batch are considered negative examples . The loss function of self-supervised CL is defined as follows : Lself = − ∑ i∈I log exp ( zi · zia/τ ) ∑ za∈A ( i ) exp ( zi · za/τ ) ( 5 ) where zi is the image embedding , zi · zia denotes the inner dot product between two embeddings , τ ∈ R+ is a scalar temperature parameter , and A ( i ) = I\zi . It can be seen that self-supervised CL pushes the embeddings of the samples augmented from the same image close to each other . More recently , the supervised CL ( Khosla et al. , 2020 ) adapts CL into the supervised settings , which utilizes the label information to select positive and negative samples . For supervised CL , the embeddings of the samples with the same labels are pushed close to each other , which achieves better performance in classification tasks . For more details of CL , we refer to Liu et al . ( 2021b ) . To our knowledge , CL has not been applied in solving multi-label classification yet . 2.2 PROPOSED METHOD . Unlike previous CL methods for single-label classification that use image-level representations , we propose to learn multiple label-level representations for each image , which facilitates the application of CL in multi-label classification . We introduce MulCon , which consists of three main neural network modules : the label-level embedding network , the contrastive learning projection network , and the classification networks as shown in Figure 1 . Label-Level Embedding Network As the key module of our framework , the label-level embedding network takes an image xi as input and outputs its label-level representations , denoted by gi ∈ RL×D , where each row of gi corresponds to the embedding of the image under the context of a specific label . Specifically , the label-level embedding network consists of two components : 1 ) The encoder block . We first adopt an encoder network that learns the image-level embedding as the backbone model as the backbone model : ri = Enc ( xi ) ∈ RC×H×W , where C , H , W are the number of channels , height , and width of the output . The backbone model can be implemented with an arbitrary model that learns good image features , e.g. , a convolutional neural network ( CNN ) such as ResNet ( He et al. , 2016 ) or visual transformer ( Dosovitskiy et al. , 2020 ) . We then reshape ri ∈ RWH×C for the next step ’ s processing . 2 ) The label-wise attention block . In this block , we introduce a set of vectors U ∈ RL×C , each row of which is to be learned as the global embedding for a specific label . To generate an image ’ s label-level embeddings gi , we propose a cascade of several self-attention blocks and a multi-head attention block to capture the interactions between ri and U as follows : ri = SA ( ri ) ; gi = MultiAttBlock ( U , ri , ri ) ; gi = SA ( gi ) . ( 6 ) To summarise , given an image xi , we first learn its representation ri ∈ RWH×C by the encoder , each row of which captures the feature of a location in the image . We then pass ri to a self-attention block that captures the interactions between the features of the image . Next , we feed ri to the multihead attention block , where the global label embeddings U is the query and ri is the key and value . As the sizes of the input and output channels of the multi-head attention are C and D , respectively , we have nq = nv = C and dq = nq = D for Eq . 2 . With the multi-head attention block , our model can learn the “ importance ” ( attention weight ) of the image feature to a specific label . For example , if an image contains an apple , the corresponding embedding is expected to be associated with a large attention weight from the apple label . The multi-headed attention can also help a label pay its attention to multiple objects in an image , i.e. , each of the attention heads can generate attention scores for a class-specific embedding over all the image-level embeddings . In this case , if an image consists of multiple apples , each of the apples receives a specific attention score from the apple label . Following up the multi-head attention is a self-attention block that implicitly helps improve label correlation . With the attention from all the labels , we can derive the label-level embeddings gi of the image from its image-label embedding ri . Contrastive Learning Projection Network After obtaining gi ∈ RL×D , we use gij ∈ RD to denote the label-level embedding of the input image i under the context of a specific label j ( j ∈ { 1 , · · · , L } ) . Following Chen et al . ( 2020 ) ; Khosla et al . ( 2020 ) , our framework includes a projection network Proj ( · ) that maps gij to a vector in another embedding space : zij = Proj ( gij ) ∈ Rdz , where the contrastive learning is performed . Classification Network Recall that the label-level embedding gij captures the input image i ’ s feature under the context of the label j . Thus , it can be used to predict whether j is active in i . Accordingly , we introduce a fully connected layer as a classifier f jc to predict the probability of the label j being active . Specifically , for each label j ∈ L the prediction score is sij = σ ( f jc ( gij ) ) ∈ ( 0 , 1 ) . We further denote si ∈ ( 0 , 1 ) L . | This paper presents a contrastive learning based method for multi-label classification. In particular, authors propose to learn "label-level embeddings" for an image, thereby the multi-label classification problem can be transformed into a single-label one where contrastive learning can be naturally adapted. The proposed label-level embedding network involves self-attention and multi-head attention blocks that learn label-specific embeddings. Results were demonstrated by the experiments on two benchmark datasets (MS COCO and NUS-WIDE). | SP:bb5fab1f649aa177369eefa14d9035b7ba87e8d9 |
Contrastively Enforcing Distinctiveness for Multi-Label Classification | 1 INTRODUCTION . Multi-label image classification is a fundamental and practical computer vision task , where the goal is to predict a set of labels ( e.g. , objects or attributes ) associated with an input image . It is an essential component in many applications such as recommendation systems ( Jain et al. , 2016 ; Yang et al. , 2015 ) , medical image diagnosis ( Ge et al. , 2018b ) , and human attribute recognition ( Li et al. , 2016b ) . Compared to single-label cases , multi-label classification is usually more complex and challenging . Recently , contrastive learning ( CL ) ( Chen et al. , 2020 ; He et al. , 2020 ; Li et al. , 2020 ; Caron et al. , 2020 ; Bachman et al. , 2019 ) has been shown as an effective pretext approach to learn latent representations an unsupervised way , which can be further used for supervised tasks . In general , CL aims to pull together an anchor and a similar ( or positive ) sample in embedding space and push apart the anchor from many dissimilar ( or negative ) samples . Therefore , the choice of the positive and negative samples of an anchor is a key to achieving good performance with CL . In self-supervised CL ( Chen et al. , 2020 ) , the positive sample is defined as those augmented from the same image with the anchor , while the negative samples are all the other images in the minibatch . More recently , supervised CL ( Khosla et al. , 2020 ; Sun et al. , 2021 ; Yuan et al. , 2021 ; Huynh , 2021 ) has been proposed , where all the images with the same label as the anchor are considered as the positive samples and vice versa for the negative ones . Supervised CL has shown improvements in single-label image classifications than the self-supervised counterpart . With the above successful examples , CL has drawn significant research attention and has been applied in other tasks including image segmentation ( Wang et al. , 2021 ) , adversarial training ( Kim et al. , 2020 ) , and text to image learning ( Radford et al. , 2021 ) . Given the appealing properties and promising results of CL in single-label classification , it is natural to adapt it into multi-label cases to boost performance . However , this adaptation is non-trivial . In single-label cases , an image usually contains one salient object , thus , the label of the object can also be viewed as the unique label of the image . Therefore , it is reasonable to use one image-level representation of an image and to push the representation of the anchor close to its positive samples ( e.g , augmentations of the anchor or images with the same label as the anchor ) , as done in selfsupervised and supervised CL . However , with a single image-level representation for an image , it is hard to define the positive or negative samples for an anchor image by its multiple labels in the multi-label classification . For example , it would not be reasonable to assume that the image-level representations of images containing apples must always be close to each other , as apple is just one of many objects in those images and an apple may only take a small area of an image . As a result , this setting hinders the application of existing CL methods to multi-label classification . To bridge this gap , we in this paper propose a novel end-to-end framework for multi-label image classification that leverages the contrastive learning principle , termed MulCon or Multi-label Classification with Contrastive Loss . Instead of using image-level representations as in previous CL methods , we introduce a new module that learns multiple label-level representations of an image , which are generated with the attention from the globally class-specific embeddings to the image features learned by a convolutional neural network ( CNN ) . Each label-level embedding of an image corresponds to the image ’ s representation in the context of a specific label . With these definitions , the supervised CL loss can be applied . Specifically , if we look at one specific label and view a labellevel embedding of an image as the anchor in our proposed CL framework , it is straightforward to define the positive samples of an anchor , which are the label-level embeddings of the other images in the minibatch with the same label and vice versa for the negative samples . For example , instead of sharing an image-level representation with other objects , the apple object of an image has its own embedding and the embeddings of the apples of all the images in a minibatch are pushed close to each other . Therefore , our framework is intuitive in the multi-label setting . In this way , the CL loss can enforce the coherence and consistency of the label-level representations of images , which further provides more discriminative power of the prediction procedure based on these representations . The main contributions can be summarized as follows : 1 ) Contrastive learning has been shown successful in many single-label classification problems , however , it is non-trivial to apply it in multilabel classification . We propose an intuitive and conceptually simple framework that encompasses contrastive learning . 2 ) Along with the proposed framework , we also introduce a practical training scheme of contrastive learning for multi-label classification . 3 ) We conduct extensive experiments on large-scale benchmark datasets , showing that the proposed framework achieves the state-of-theart performance in multi-label image classification . 2 PROPOSED METHOD . In this section , we first discuss about the background knowledge and relevant notations and then elaborate on the details of the proposed framework , MulCon . 2.1 BACKGROUND AND NOTATIONS . Multi-label Classification Following the standard setting of multi-label image classification , we denote a minibatch of input images by X ∈ RN×W×H×3 , where N is the batch size , H and W are the height and width of the images . Each image xi ∈ X is associated with multiple labels selected from a set of L labels in total , which are denoted by a multi-hot binary vector yi ∈ { 0 , 1 } L. For an active label j of xi , yij = 1 and vice versa . Our task is to build an end-to-end model that takes xi to predict its labels yi . Attention The Attention mechanism ( Luong et al. , 2015 ; Xu et al. , 2015 ) has been widely used in various areas of computer vision and natural language processing , which enhances the important parts of the data of interest and fades out the rest . Assume that nq query vectors of size dq denoted as Q ∈ Rnq×dq , and nv key-value pairs denoted as K ∈ Rnv×dq , V ∈ Rnv×dv . The attention function maps the query vectors Q to outputs using the key-value pairs as follows : Att ( Q , K , V ) = ω ( QKT ) V ( 1 ) where the dot product ( QKT ) ∈ Rnq×nv and ω ( · ) is softmax function . The dot product returns the similarity of each query and key value . The output ω ( QKT ) V ∈ Rnq×dv is the weighted sum over V , where larger weight corresponds to larger similarity between query and key . A powerful extension to the above ( single- ) attention mechanism is the multi-head attention introduced in ( Vaswani et al. , 2017 ) , which allows the model to jointly attend to information from different representation subspaces at different positions . Instead of computing a single attention function , this method first projects Q , K , V onto h different vectors , respectively . An attention function Att ( · ) is applied individually to these h projections . The output is a linear transformation of the concatenation of all attention outputs : MultiAtt ( Q , K , V ) = concat ( O1 , O2 , · · · , Oh ) W o , Oi′ = Att ( QW q i′ , KW k i′ , V W v i′ ) for i ′ ∈ 1 , · · · , h , ( 2 ) whereW o , W qi′ , W k i′ , W v i′ are learnable parameters of some linear layers . QW q i′ ∈ R nq×dhq , KW ki′ ∈ Rnv×d h q , VW vi′ ∈ Rnv×d h v are vectors projected from Q , K , V respectively . dhq = dq/h and d h v = dv/h . Following the architecture of the transformer ( Vaswani et al. , 2017 ; Lee et al. , 2019 ) , we define the following multi-head attention block : MultiAttBlock ( Q , K , V ) = LayerNorm ( Q′ +Q′W q ′ ) , ( 3 ) Q′ = LayerNorm ( concat ( QW q1 , · · · , QW q h ) + MultiAtt ( Q , K , V ) ) where W q ′ ∈ Rdq×dq is a learnable linear layer . Base on the multi-head attention block , we further define a self-attention block as follows : SA ( X ) = MultiAttBlock ( X , X , X ) ( 4 ) Contrastive Learning Contrastive learning ( CL ) has been an increasingly popular and effective representation learning approach ( Chen et al. , 2020 ; He et al. , 2020 ; Khosla et al. , 2020 ) . As the first proposed CL approach , self-supervised CL ( Chen et al. , 2020 ) is proposed to learn presentations in an unsupervised manner . Specifically , a mini-batch is constructed from the original input images and their augmented versions . Given a minibatch of 2N instances I = { 1 ... 2N } and an anchor instance i ∈ I , the augmented version of i , denoted as ia ∈ I is considered the positive sample , and the other 2 ( N − 1 ) instances within the mini-batch are considered negative examples . The loss function of self-supervised CL is defined as follows : Lself = − ∑ i∈I log exp ( zi · zia/τ ) ∑ za∈A ( i ) exp ( zi · za/τ ) ( 5 ) where zi is the image embedding , zi · zia denotes the inner dot product between two embeddings , τ ∈ R+ is a scalar temperature parameter , and A ( i ) = I\zi . It can be seen that self-supervised CL pushes the embeddings of the samples augmented from the same image close to each other . More recently , the supervised CL ( Khosla et al. , 2020 ) adapts CL into the supervised settings , which utilizes the label information to select positive and negative samples . For supervised CL , the embeddings of the samples with the same labels are pushed close to each other , which achieves better performance in classification tasks . For more details of CL , we refer to Liu et al . ( 2021b ) . To our knowledge , CL has not been applied in solving multi-label classification yet . 2.2 PROPOSED METHOD . Unlike previous CL methods for single-label classification that use image-level representations , we propose to learn multiple label-level representations for each image , which facilitates the application of CL in multi-label classification . We introduce MulCon , which consists of three main neural network modules : the label-level embedding network , the contrastive learning projection network , and the classification networks as shown in Figure 1 . Label-Level Embedding Network As the key module of our framework , the label-level embedding network takes an image xi as input and outputs its label-level representations , denoted by gi ∈ RL×D , where each row of gi corresponds to the embedding of the image under the context of a specific label . Specifically , the label-level embedding network consists of two components : 1 ) The encoder block . We first adopt an encoder network that learns the image-level embedding as the backbone model as the backbone model : ri = Enc ( xi ) ∈ RC×H×W , where C , H , W are the number of channels , height , and width of the output . The backbone model can be implemented with an arbitrary model that learns good image features , e.g. , a convolutional neural network ( CNN ) such as ResNet ( He et al. , 2016 ) or visual transformer ( Dosovitskiy et al. , 2020 ) . We then reshape ri ∈ RWH×C for the next step ’ s processing . 2 ) The label-wise attention block . In this block , we introduce a set of vectors U ∈ RL×C , each row of which is to be learned as the global embedding for a specific label . To generate an image ’ s label-level embeddings gi , we propose a cascade of several self-attention blocks and a multi-head attention block to capture the interactions between ri and U as follows : ri = SA ( ri ) ; gi = MultiAttBlock ( U , ri , ri ) ; gi = SA ( gi ) . ( 6 ) To summarise , given an image xi , we first learn its representation ri ∈ RWH×C by the encoder , each row of which captures the feature of a location in the image . We then pass ri to a self-attention block that captures the interactions between the features of the image . Next , we feed ri to the multihead attention block , where the global label embeddings U is the query and ri is the key and value . As the sizes of the input and output channels of the multi-head attention are C and D , respectively , we have nq = nv = C and dq = nq = D for Eq . 2 . With the multi-head attention block , our model can learn the “ importance ” ( attention weight ) of the image feature to a specific label . For example , if an image contains an apple , the corresponding embedding is expected to be associated with a large attention weight from the apple label . The multi-headed attention can also help a label pay its attention to multiple objects in an image , i.e. , each of the attention heads can generate attention scores for a class-specific embedding over all the image-level embeddings . In this case , if an image consists of multiple apples , each of the apples receives a specific attention score from the apple label . Following up the multi-head attention is a self-attention block that implicitly helps improve label correlation . With the attention from all the labels , we can derive the label-level embeddings gi of the image from its image-label embedding ri . Contrastive Learning Projection Network After obtaining gi ∈ RL×D , we use gij ∈ RD to denote the label-level embedding of the input image i under the context of a specific label j ( j ∈ { 1 , · · · , L } ) . Following Chen et al . ( 2020 ) ; Khosla et al . ( 2020 ) , our framework includes a projection network Proj ( · ) that maps gij to a vector in another embedding space : zij = Proj ( gij ) ∈ Rdz , where the contrastive learning is performed . Classification Network Recall that the label-level embedding gij captures the input image i ’ s feature under the context of the label j . Thus , it can be used to predict whether j is active in i . Accordingly , we introduce a fully connected layer as a classifier f jc to predict the probability of the label j being active . Specifically , for each label j ∈ L the prediction score is sij = σ ( f jc ( gij ) ) ∈ ( 0 , 1 ) . We further denote si ∈ ( 0 , 1 ) L . | In this paper, the authors introduce the contrastive learning into multi-label classification. Specifically, the multi-label classification problem is first decomposed into a series of binary classification problems with label-level features extracted by the attention mechanism. Then, label-wise contrastive learning is performed on these binary classification problems respectively. Comparative experiment shows the proposed approach achieves the new state-of-the-art performance in multi-label image classification. However, the proposed adaption of contrastive learning for multi-label classification is a trivial generalization of existing contrastive learning for single-label classification, since contrastive learning is simply performed on the binary classification problem of each class label. And it is not a new idea to introduce the contrastive learning into multi-label classification. Besides, extracting label-level features via attention mechanism is a well-established technique in many existing works. Thus, if I had not missed something, the contribution of this paper is very limited. | SP:bb5fab1f649aa177369eefa14d9035b7ba87e8d9 |
A Variance Reduction Method for Neural-based Divergence Estimation | 1 INTRODUCTION . Divergences such as Kullback-Leibler ( KL ) divergence , f -divergences , Hellinger divergence , αdivergences and Rényi divergences , which were initially developed in the fields of information theory and statistical physics , are indispensable tools in a growing number of machine learning applications . They have been used in adversarial training of generative models ( Goodfellow et al. , 2014 ; Nowozin et al. , 2016 ) , in the estimation of generalization errors ( Esposito et al. , 2021 ) and hypothesis testing ( Broniatowski & Keziou , 2009 ) , to name a few . Mutual information ( MI ) , in particular , which is defined as the KL divergence between the joint distribution of a pair of variables and their marginals ( and can be generalized to divergences other than KL ) , plays a crucial role in Bayesian networks and ( conditional ) independence ( Cheng et al. , 2002 ) , self-supervised learning via contrastive losses ( van den Oord et al. , 2018 ; Le-Khac et al. , 2020 ) as well as in representation learning ( Hjelm et al. , 2019 ; Chen et al. , 2016 ) . Classical divergence estimators perform reasonably well for low dimensional cases , however they scale poorly to large , high dimensional datasets which are typically encountered in modern machine learning . The most compelling estimation approach of a divergence is via the optimization of a lower variational bound parametrized by neural networks . These lower bounds , which are likelihood-free approximations , are maximized in order to compute the divergence value at the optimizer . Wellknown variational representations are the Legendre transformation of an f -divergence ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) as well as the Donsker-Varadhan ( DV ) variational formula ( Donsker & Varadhan , 1983 ) for KL divergence and its extension to Rényi divergence ( Birrell et al. , 2020b ) . Their tractability stems from their objective functionals , which are computed from expected values and approximated using statistical averages from the available or generated samples . Despite the scalability and tractability , the estimation of a divergence based on variational formulas is a notoriously difficult problem . One challenge stems from the potentially high bias , since any approximation for the worst case scenario requires an exponential number of samples in order to attain the true divergence value ( McAllester & Stratos , 2020 ) . Additionally , the statistical variance , which scales exponentially with respect to the divergence ’ s value for certain variational estimators ( Song & Ermon , 2019 ) , is often prohibitively high . Focusing on the elevated MI , there are several further lower bounds ( Barber & Agakov , 2003 ; Belghazi et al. , 2018 ; van den Oord et al. , 2018 ; Poole et al. , 2019 ; Guo et al. , 2021 ) and a few upper bounds ( Cheng et al. , 2020 ; Poole et al. , 2019 ) which aim to provide more reliable estimates of MI in the low sample size regime . However , the majority of these MI estimators are not transferable to the general estimation of divergences and frequently produce instabilities during training which are further magnified by the small batch and/or sample size . In this paper , we propose to reduce a divergence estimator ’ s variance via an explicit variance penalty ( VP ) which is added to the objective functional . Our contributions are summarized as follows : • We present a novel variance reduction penalty for f -divergence and expand it via the delta method to the nonlinear setting , including the DV formula for KL divergence as well as the variational formula for the Rényi divergences . The proposed VP is able to flexibly trade off bias and variance . • We present numerical evidence on synthetic datasets that the proposed approach improves both mean squared error ( MSE ) and median absolute error ( MedAE ) in a range of sample sizes and types of divergences . Furthermore , we implemented the proposed VP in several other lower and upper bounds of MI , showing that our variance reduction approach is not restricted to particular variational formulas but it is generic and applicable to the majority of existing variational representations . • When applied to real datasets , we demonstrate the ability of the proposed approach to reduce the variance of the estimated Rényi divergence , thus enabling the detection of rare biological sub-populations which are otherwise difficult to identify . Interestingly , the baseline estimator is unstable when the order value is above one , but it becomes stable when the VP is added . • We also applied the VP to the disentangled representation learning of speech into its text , speaker , and style components . Results on objective evaluation metrics showed that the addition of the VP generally improves the training performance , as much as 18 % relative to the baseline systems . 1.1 RELATED WORK . There are several general-purpose variance reduction techniques in Monte Carlo stochastic sampling , with the most popular approaches being antithetic sampling or more broadly coupling methods , control of variates and importance sampling ( Robert & Casella , 2005 ; Glasserman , 2004 ; Srinivasan , 2013 ) . These methods have not been explicitly applied for the variational divergence estimation problem . We speculate that either they are not applicable due to the unavailability of analytical probability density formulas or they are inefficient ( e.g. , the control of variates approach requires a second estimator and potentially a second parametric model in order to be applied ) . Another way to reduce the variance is to restrict the function space to more smooth and/or controlled test ( or critic ) functions , balancing again between bias and variance . For instance , the restriction to Lipschitz continuous functions has the potential to reduce the variance since there exist favorable concentration inequality results for the Lipschitz space ( Wainwright , 2019 ) . In the GAN literature , Wasserstein GAN ( Gulrajani et al. , 2017 ) and spectral normalization ( Miyato et al. , 2018 ) impose Lipschitz continuity which resulted in signigicant gains in terms of training stability . Similarly , the restriction of test functions to an appropriately designed reproducing kernel Hilbert space could reduce the variance ( Sreekar et al. , 2020 ) . Such approaches can be combined with our proposed variance penalties , as our formulation allows for general test-function spaces . However , we do not focus on this point here . Given the importance of MI , several estimators aim towards improved statistical properties . Lower bounds such as MINE ( Belghazi et al. , 2018 ) , which uses the DV variational formula with an expo- nential moving average , NWJ estimator ( Nguyen et al. , 2010 ) and BA estimator ( Barber & Agakov , 2003 ) as well as upper bounds such as CLUB ( Cheng et al. , 2020 ) still have high variance . InfoNCE ( van den Oord et al. , 2018 ) is one of the few MI estimators that has low variance , but at the cost of either high bias or high computational cost due to the need for many negative samples and thus large batch size . Poole et al . ( 2019 ) and Guo et al . ( 2021 ) aim to clarify the relationships and trade-offs between those variational bounds . A different approach to reducing variance is by appropriately working on the gradients of the objective function ( Wen et al. , 2020 ; 2021 ) . Finally , we discuss the approach of truncating the test function inside a bounded region as proposed in ( Song & Ermon , 2019 ) . The determination of the truncation threshold is quite difficult since it requires an a priori understanding of the log-likelihood ratio . Moreover , a high truncation threshold will not affect the estimation since a high threshold implies no real benefit in terms of variance reduction . On the other hand , a low threshold will result in large bias . Overall , using a high truncation threshold in order to avoid extreme values is a good practice even though it will have a limited impact on variance reduction . 2 BACKGROUND ON VARIATIONAL FORMULAS FOR RÉNYI AND f -DIVERGENCES . While our variance reduction method can be applied to any divergence that possesses a variational formula , here our focus will be on the Rényi and f -divergences , including the KL divergence . For Rényi divergences an appropriate objective functional can be constructed from a difference of cumulant generating functions ( Birrell et al. , 2020b ) Rα ( Q‖P ) = sup g∈Mb ( Ω ) { 1 α− 1 logEQ [ e ( α−1 ) g ] − 1 α logEP [ eαg ] } , α 6= 0 , 1 . ( 1 ) Here Q and P are probability distributions on the set Ω , EQ and EP denote the expectations with respect to Q and P respectively , andMb ( Ω ) is the space of bounded measurable real-valued functions on Ω . For f divergences , f being a lower semicontinuous convex function with f ( 1 ) = 0 , one has the well-known Legendre transform variational formula ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) Df ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − EP [ f∗ ( g ) ] } , ( 2 ) where f∗ ( y ) = supx∈R { yx − f ( x ) } is the Legendre transform of f . Here and in the following , the function of g that is being optimized will be called the objective functional . Equation ( 2 ) can be generalized to the ( f , Γ ) -divergences ( Birrell et al. , 2020a ) , where Γ ⊂ Mb ( Ω ) is a restricted test-function space DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − ΛPf [ g ] } , ( 3 ) ΛPf [ g ] = inf ν∈R { ν + EP [ f∗ ( g − ν ) ] } . ( 4 ) In particular , if fKL ( x ) = x log ( x ) corresponds to the KL divergence then ΛPfKL [ g ] = log ( EP [ exp ( g ) ] ) ≡ Λ P [ g ] ( 5 ) is the classical cumulant generating function and equation ( 3 ) ( with Γ = Mb ( Ω ) ) becomes the Donsker-Varadhan variational formula ( Dupuis & Ellis. , 1997 , Appendix C.2 ) DKL ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − logEP [ eg ] } . ( 6 ) For general f , we will often write equation ( 3 ) as DΓf ( Q‖P ) = sup g∈Γ , ν∈R { EQ [ g − ν ] − EP [ f∗ ( g − ν ) ] } ( 7 ) and if Γ is closed under the shifts g 7→ g − ν , ν ∈ R then we can write it simply as DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − EP [ f∗ ( g ) ] } . ( 8 ) In particular , if Γ = Mb ( Ω ) then DΓf = Df . The generalizations of Rényi and KL divergence obtained by using a restricted space Γ in place of Mb ( Ω ) in equation ( 1 ) or equation ( 6 ) will be denoted by RΓα and D Γ KL , respectively . | This paper introduces a novel variance regularization to reduce the statistical variance of the variational based estimators for f-divergences and Renyi's divergence. The proposed regularization is based on the well-known delta method which provides the asymptotic variance and depends on the specific from of the variational bound under consideration. The approach is tested on different synthetic data sets for which the numerical results show that the variance is decreased relatively to the baseline estimator. In particular, this effects appears be more visible for high-orders of the Renyi's divergence. Finally, an application is provided for real biological datasets, disentanglement for speech signals into text, speaker and style components. | SP:6b85348e58ad1c9c4445956a69265cac16ce6b4a |
A Variance Reduction Method for Neural-based Divergence Estimation | 1 INTRODUCTION . Divergences such as Kullback-Leibler ( KL ) divergence , f -divergences , Hellinger divergence , αdivergences and Rényi divergences , which were initially developed in the fields of information theory and statistical physics , are indispensable tools in a growing number of machine learning applications . They have been used in adversarial training of generative models ( Goodfellow et al. , 2014 ; Nowozin et al. , 2016 ) , in the estimation of generalization errors ( Esposito et al. , 2021 ) and hypothesis testing ( Broniatowski & Keziou , 2009 ) , to name a few . Mutual information ( MI ) , in particular , which is defined as the KL divergence between the joint distribution of a pair of variables and their marginals ( and can be generalized to divergences other than KL ) , plays a crucial role in Bayesian networks and ( conditional ) independence ( Cheng et al. , 2002 ) , self-supervised learning via contrastive losses ( van den Oord et al. , 2018 ; Le-Khac et al. , 2020 ) as well as in representation learning ( Hjelm et al. , 2019 ; Chen et al. , 2016 ) . Classical divergence estimators perform reasonably well for low dimensional cases , however they scale poorly to large , high dimensional datasets which are typically encountered in modern machine learning . The most compelling estimation approach of a divergence is via the optimization of a lower variational bound parametrized by neural networks . These lower bounds , which are likelihood-free approximations , are maximized in order to compute the divergence value at the optimizer . Wellknown variational representations are the Legendre transformation of an f -divergence ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) as well as the Donsker-Varadhan ( DV ) variational formula ( Donsker & Varadhan , 1983 ) for KL divergence and its extension to Rényi divergence ( Birrell et al. , 2020b ) . Their tractability stems from their objective functionals , which are computed from expected values and approximated using statistical averages from the available or generated samples . Despite the scalability and tractability , the estimation of a divergence based on variational formulas is a notoriously difficult problem . One challenge stems from the potentially high bias , since any approximation for the worst case scenario requires an exponential number of samples in order to attain the true divergence value ( McAllester & Stratos , 2020 ) . Additionally , the statistical variance , which scales exponentially with respect to the divergence ’ s value for certain variational estimators ( Song & Ermon , 2019 ) , is often prohibitively high . Focusing on the elevated MI , there are several further lower bounds ( Barber & Agakov , 2003 ; Belghazi et al. , 2018 ; van den Oord et al. , 2018 ; Poole et al. , 2019 ; Guo et al. , 2021 ) and a few upper bounds ( Cheng et al. , 2020 ; Poole et al. , 2019 ) which aim to provide more reliable estimates of MI in the low sample size regime . However , the majority of these MI estimators are not transferable to the general estimation of divergences and frequently produce instabilities during training which are further magnified by the small batch and/or sample size . In this paper , we propose to reduce a divergence estimator ’ s variance via an explicit variance penalty ( VP ) which is added to the objective functional . Our contributions are summarized as follows : • We present a novel variance reduction penalty for f -divergence and expand it via the delta method to the nonlinear setting , including the DV formula for KL divergence as well as the variational formula for the Rényi divergences . The proposed VP is able to flexibly trade off bias and variance . • We present numerical evidence on synthetic datasets that the proposed approach improves both mean squared error ( MSE ) and median absolute error ( MedAE ) in a range of sample sizes and types of divergences . Furthermore , we implemented the proposed VP in several other lower and upper bounds of MI , showing that our variance reduction approach is not restricted to particular variational formulas but it is generic and applicable to the majority of existing variational representations . • When applied to real datasets , we demonstrate the ability of the proposed approach to reduce the variance of the estimated Rényi divergence , thus enabling the detection of rare biological sub-populations which are otherwise difficult to identify . Interestingly , the baseline estimator is unstable when the order value is above one , but it becomes stable when the VP is added . • We also applied the VP to the disentangled representation learning of speech into its text , speaker , and style components . Results on objective evaluation metrics showed that the addition of the VP generally improves the training performance , as much as 18 % relative to the baseline systems . 1.1 RELATED WORK . There are several general-purpose variance reduction techniques in Monte Carlo stochastic sampling , with the most popular approaches being antithetic sampling or more broadly coupling methods , control of variates and importance sampling ( Robert & Casella , 2005 ; Glasserman , 2004 ; Srinivasan , 2013 ) . These methods have not been explicitly applied for the variational divergence estimation problem . We speculate that either they are not applicable due to the unavailability of analytical probability density formulas or they are inefficient ( e.g. , the control of variates approach requires a second estimator and potentially a second parametric model in order to be applied ) . Another way to reduce the variance is to restrict the function space to more smooth and/or controlled test ( or critic ) functions , balancing again between bias and variance . For instance , the restriction to Lipschitz continuous functions has the potential to reduce the variance since there exist favorable concentration inequality results for the Lipschitz space ( Wainwright , 2019 ) . In the GAN literature , Wasserstein GAN ( Gulrajani et al. , 2017 ) and spectral normalization ( Miyato et al. , 2018 ) impose Lipschitz continuity which resulted in signigicant gains in terms of training stability . Similarly , the restriction of test functions to an appropriately designed reproducing kernel Hilbert space could reduce the variance ( Sreekar et al. , 2020 ) . Such approaches can be combined with our proposed variance penalties , as our formulation allows for general test-function spaces . However , we do not focus on this point here . Given the importance of MI , several estimators aim towards improved statistical properties . Lower bounds such as MINE ( Belghazi et al. , 2018 ) , which uses the DV variational formula with an expo- nential moving average , NWJ estimator ( Nguyen et al. , 2010 ) and BA estimator ( Barber & Agakov , 2003 ) as well as upper bounds such as CLUB ( Cheng et al. , 2020 ) still have high variance . InfoNCE ( van den Oord et al. , 2018 ) is one of the few MI estimators that has low variance , but at the cost of either high bias or high computational cost due to the need for many negative samples and thus large batch size . Poole et al . ( 2019 ) and Guo et al . ( 2021 ) aim to clarify the relationships and trade-offs between those variational bounds . A different approach to reducing variance is by appropriately working on the gradients of the objective function ( Wen et al. , 2020 ; 2021 ) . Finally , we discuss the approach of truncating the test function inside a bounded region as proposed in ( Song & Ermon , 2019 ) . The determination of the truncation threshold is quite difficult since it requires an a priori understanding of the log-likelihood ratio . Moreover , a high truncation threshold will not affect the estimation since a high threshold implies no real benefit in terms of variance reduction . On the other hand , a low threshold will result in large bias . Overall , using a high truncation threshold in order to avoid extreme values is a good practice even though it will have a limited impact on variance reduction . 2 BACKGROUND ON VARIATIONAL FORMULAS FOR RÉNYI AND f -DIVERGENCES . While our variance reduction method can be applied to any divergence that possesses a variational formula , here our focus will be on the Rényi and f -divergences , including the KL divergence . For Rényi divergences an appropriate objective functional can be constructed from a difference of cumulant generating functions ( Birrell et al. , 2020b ) Rα ( Q‖P ) = sup g∈Mb ( Ω ) { 1 α− 1 logEQ [ e ( α−1 ) g ] − 1 α logEP [ eαg ] } , α 6= 0 , 1 . ( 1 ) Here Q and P are probability distributions on the set Ω , EQ and EP denote the expectations with respect to Q and P respectively , andMb ( Ω ) is the space of bounded measurable real-valued functions on Ω . For f divergences , f being a lower semicontinuous convex function with f ( 1 ) = 0 , one has the well-known Legendre transform variational formula ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) Df ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − EP [ f∗ ( g ) ] } , ( 2 ) where f∗ ( y ) = supx∈R { yx − f ( x ) } is the Legendre transform of f . Here and in the following , the function of g that is being optimized will be called the objective functional . Equation ( 2 ) can be generalized to the ( f , Γ ) -divergences ( Birrell et al. , 2020a ) , where Γ ⊂ Mb ( Ω ) is a restricted test-function space DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − ΛPf [ g ] } , ( 3 ) ΛPf [ g ] = inf ν∈R { ν + EP [ f∗ ( g − ν ) ] } . ( 4 ) In particular , if fKL ( x ) = x log ( x ) corresponds to the KL divergence then ΛPfKL [ g ] = log ( EP [ exp ( g ) ] ) ≡ Λ P [ g ] ( 5 ) is the classical cumulant generating function and equation ( 3 ) ( with Γ = Mb ( Ω ) ) becomes the Donsker-Varadhan variational formula ( Dupuis & Ellis. , 1997 , Appendix C.2 ) DKL ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − logEP [ eg ] } . ( 6 ) For general f , we will often write equation ( 3 ) as DΓf ( Q‖P ) = sup g∈Γ , ν∈R { EQ [ g − ν ] − EP [ f∗ ( g − ν ) ] } ( 7 ) and if Γ is closed under the shifts g 7→ g − ν , ν ∈ R then we can write it simply as DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − EP [ f∗ ( g ) ] } . ( 8 ) In particular , if Γ = Mb ( Ω ) then DΓf = Df . The generalizations of Rényi and KL divergence obtained by using a restricted space Γ in place of Mb ( Ω ) in equation ( 1 ) or equation ( 6 ) will be denoted by RΓα and D Γ KL , respectively . | The paper proposes to adopt a variance penalty term to manipulate the divergence estimators. Experiments first investigated the correlations of the variance penalty and the bias and variance trade-offs. Then, the authors tested the proposed approaches on two real-world application (biological and speech synthesis) datasets. The results show that the proposed approach can effectively reduce the variance as compared to systems without including the variance penalty. | SP:6b85348e58ad1c9c4445956a69265cac16ce6b4a |
A Variance Reduction Method for Neural-based Divergence Estimation | 1 INTRODUCTION . Divergences such as Kullback-Leibler ( KL ) divergence , f -divergences , Hellinger divergence , αdivergences and Rényi divergences , which were initially developed in the fields of information theory and statistical physics , are indispensable tools in a growing number of machine learning applications . They have been used in adversarial training of generative models ( Goodfellow et al. , 2014 ; Nowozin et al. , 2016 ) , in the estimation of generalization errors ( Esposito et al. , 2021 ) and hypothesis testing ( Broniatowski & Keziou , 2009 ) , to name a few . Mutual information ( MI ) , in particular , which is defined as the KL divergence between the joint distribution of a pair of variables and their marginals ( and can be generalized to divergences other than KL ) , plays a crucial role in Bayesian networks and ( conditional ) independence ( Cheng et al. , 2002 ) , self-supervised learning via contrastive losses ( van den Oord et al. , 2018 ; Le-Khac et al. , 2020 ) as well as in representation learning ( Hjelm et al. , 2019 ; Chen et al. , 2016 ) . Classical divergence estimators perform reasonably well for low dimensional cases , however they scale poorly to large , high dimensional datasets which are typically encountered in modern machine learning . The most compelling estimation approach of a divergence is via the optimization of a lower variational bound parametrized by neural networks . These lower bounds , which are likelihood-free approximations , are maximized in order to compute the divergence value at the optimizer . Wellknown variational representations are the Legendre transformation of an f -divergence ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) as well as the Donsker-Varadhan ( DV ) variational formula ( Donsker & Varadhan , 1983 ) for KL divergence and its extension to Rényi divergence ( Birrell et al. , 2020b ) . Their tractability stems from their objective functionals , which are computed from expected values and approximated using statistical averages from the available or generated samples . Despite the scalability and tractability , the estimation of a divergence based on variational formulas is a notoriously difficult problem . One challenge stems from the potentially high bias , since any approximation for the worst case scenario requires an exponential number of samples in order to attain the true divergence value ( McAllester & Stratos , 2020 ) . Additionally , the statistical variance , which scales exponentially with respect to the divergence ’ s value for certain variational estimators ( Song & Ermon , 2019 ) , is often prohibitively high . Focusing on the elevated MI , there are several further lower bounds ( Barber & Agakov , 2003 ; Belghazi et al. , 2018 ; van den Oord et al. , 2018 ; Poole et al. , 2019 ; Guo et al. , 2021 ) and a few upper bounds ( Cheng et al. , 2020 ; Poole et al. , 2019 ) which aim to provide more reliable estimates of MI in the low sample size regime . However , the majority of these MI estimators are not transferable to the general estimation of divergences and frequently produce instabilities during training which are further magnified by the small batch and/or sample size . In this paper , we propose to reduce a divergence estimator ’ s variance via an explicit variance penalty ( VP ) which is added to the objective functional . Our contributions are summarized as follows : • We present a novel variance reduction penalty for f -divergence and expand it via the delta method to the nonlinear setting , including the DV formula for KL divergence as well as the variational formula for the Rényi divergences . The proposed VP is able to flexibly trade off bias and variance . • We present numerical evidence on synthetic datasets that the proposed approach improves both mean squared error ( MSE ) and median absolute error ( MedAE ) in a range of sample sizes and types of divergences . Furthermore , we implemented the proposed VP in several other lower and upper bounds of MI , showing that our variance reduction approach is not restricted to particular variational formulas but it is generic and applicable to the majority of existing variational representations . • When applied to real datasets , we demonstrate the ability of the proposed approach to reduce the variance of the estimated Rényi divergence , thus enabling the detection of rare biological sub-populations which are otherwise difficult to identify . Interestingly , the baseline estimator is unstable when the order value is above one , but it becomes stable when the VP is added . • We also applied the VP to the disentangled representation learning of speech into its text , speaker , and style components . Results on objective evaluation metrics showed that the addition of the VP generally improves the training performance , as much as 18 % relative to the baseline systems . 1.1 RELATED WORK . There are several general-purpose variance reduction techniques in Monte Carlo stochastic sampling , with the most popular approaches being antithetic sampling or more broadly coupling methods , control of variates and importance sampling ( Robert & Casella , 2005 ; Glasserman , 2004 ; Srinivasan , 2013 ) . These methods have not been explicitly applied for the variational divergence estimation problem . We speculate that either they are not applicable due to the unavailability of analytical probability density formulas or they are inefficient ( e.g. , the control of variates approach requires a second estimator and potentially a second parametric model in order to be applied ) . Another way to reduce the variance is to restrict the function space to more smooth and/or controlled test ( or critic ) functions , balancing again between bias and variance . For instance , the restriction to Lipschitz continuous functions has the potential to reduce the variance since there exist favorable concentration inequality results for the Lipschitz space ( Wainwright , 2019 ) . In the GAN literature , Wasserstein GAN ( Gulrajani et al. , 2017 ) and spectral normalization ( Miyato et al. , 2018 ) impose Lipschitz continuity which resulted in signigicant gains in terms of training stability . Similarly , the restriction of test functions to an appropriately designed reproducing kernel Hilbert space could reduce the variance ( Sreekar et al. , 2020 ) . Such approaches can be combined with our proposed variance penalties , as our formulation allows for general test-function spaces . However , we do not focus on this point here . Given the importance of MI , several estimators aim towards improved statistical properties . Lower bounds such as MINE ( Belghazi et al. , 2018 ) , which uses the DV variational formula with an expo- nential moving average , NWJ estimator ( Nguyen et al. , 2010 ) and BA estimator ( Barber & Agakov , 2003 ) as well as upper bounds such as CLUB ( Cheng et al. , 2020 ) still have high variance . InfoNCE ( van den Oord et al. , 2018 ) is one of the few MI estimators that has low variance , but at the cost of either high bias or high computational cost due to the need for many negative samples and thus large batch size . Poole et al . ( 2019 ) and Guo et al . ( 2021 ) aim to clarify the relationships and trade-offs between those variational bounds . A different approach to reducing variance is by appropriately working on the gradients of the objective function ( Wen et al. , 2020 ; 2021 ) . Finally , we discuss the approach of truncating the test function inside a bounded region as proposed in ( Song & Ermon , 2019 ) . The determination of the truncation threshold is quite difficult since it requires an a priori understanding of the log-likelihood ratio . Moreover , a high truncation threshold will not affect the estimation since a high threshold implies no real benefit in terms of variance reduction . On the other hand , a low threshold will result in large bias . Overall , using a high truncation threshold in order to avoid extreme values is a good practice even though it will have a limited impact on variance reduction . 2 BACKGROUND ON VARIATIONAL FORMULAS FOR RÉNYI AND f -DIVERGENCES . While our variance reduction method can be applied to any divergence that possesses a variational formula , here our focus will be on the Rényi and f -divergences , including the KL divergence . For Rényi divergences an appropriate objective functional can be constructed from a difference of cumulant generating functions ( Birrell et al. , 2020b ) Rα ( Q‖P ) = sup g∈Mb ( Ω ) { 1 α− 1 logEQ [ e ( α−1 ) g ] − 1 α logEP [ eαg ] } , α 6= 0 , 1 . ( 1 ) Here Q and P are probability distributions on the set Ω , EQ and EP denote the expectations with respect to Q and P respectively , andMb ( Ω ) is the space of bounded measurable real-valued functions on Ω . For f divergences , f being a lower semicontinuous convex function with f ( 1 ) = 0 , one has the well-known Legendre transform variational formula ( Broniatowski & Keziou , 2006 ; Nguyen et al. , 2010 ) Df ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − EP [ f∗ ( g ) ] } , ( 2 ) where f∗ ( y ) = supx∈R { yx − f ( x ) } is the Legendre transform of f . Here and in the following , the function of g that is being optimized will be called the objective functional . Equation ( 2 ) can be generalized to the ( f , Γ ) -divergences ( Birrell et al. , 2020a ) , where Γ ⊂ Mb ( Ω ) is a restricted test-function space DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − ΛPf [ g ] } , ( 3 ) ΛPf [ g ] = inf ν∈R { ν + EP [ f∗ ( g − ν ) ] } . ( 4 ) In particular , if fKL ( x ) = x log ( x ) corresponds to the KL divergence then ΛPfKL [ g ] = log ( EP [ exp ( g ) ] ) ≡ Λ P [ g ] ( 5 ) is the classical cumulant generating function and equation ( 3 ) ( with Γ = Mb ( Ω ) ) becomes the Donsker-Varadhan variational formula ( Dupuis & Ellis. , 1997 , Appendix C.2 ) DKL ( Q‖P ) = sup g∈Mb ( Ω ) { EQ [ g ] − logEP [ eg ] } . ( 6 ) For general f , we will often write equation ( 3 ) as DΓf ( Q‖P ) = sup g∈Γ , ν∈R { EQ [ g − ν ] − EP [ f∗ ( g − ν ) ] } ( 7 ) and if Γ is closed under the shifts g 7→ g − ν , ν ∈ R then we can write it simply as DΓf ( Q‖P ) = sup g∈Γ { EQ [ g ] − EP [ f∗ ( g ) ] } . ( 8 ) In particular , if Γ = Mb ( Ω ) then DΓf = Df . The generalizations of Rényi and KL divergence obtained by using a restricted space Γ in place of Mb ( Ω ) in equation ( 1 ) or equation ( 6 ) will be denoted by RΓα and D Γ KL , respectively . | This paper takes the variational view of the statistical estimation of statistical divergences. Standard variational formulas suffer from high variance when estimated with finite samples, this paper proposes to address the problem by adding a variance penalty regularisation term to the objective functional, thus trading variance for bias. The bias-variance trade-off is controlled via the regularisation coefficient. From this new formulation, the paper derives a new low-variance Neural Divergence Estimation Algorithm with the variance regularisation technique. | SP:6b85348e58ad1c9c4445956a69265cac16ce6b4a |
Temporal Efficient Training of Spiking Neural Network via Gradient Re-weighting | 1 INTRODUCTION . The advantages of Spiking neuron networks ( SNNs ) lie in their energy-saving and fast-inference computation when embedded on neuromorphic hardware such as TrueNorth ( DeBole et al. , 2019 ) and Loihi ( Davies et al. , 2018 ) . Such advantages originate from the biology-inspired binary spike transmitted mechanism , by which the networks avoid multiplication during inference . On the other hand , this mechanism also leads to difficulty in training very deep SNNs from scratch because the non-differentiable spike transmission hinders the powerful back-propagation approaches like gradient descents . Recently , many studies on converting artificial neuron networks ( ANNs ) to SNNs have demonstrated SNNs ’ comparable power in feature representation as ANNs ( Han & Roy , 2020 ; Deng & Gu , 2020 ; Li et al. , 2021a ) . Nevertheless , it is commonly agreed that the direct training method for high-performance SNN is still crucial since it distinguishes SNNs from converted ANNs , especially on neuromorphic datasets . The output layer ’ s spike frequency or the average membrane potential increment is commonly used as inference indicators in SNNs ( Shrestha & Orchard , 2018 ; Kim et al. , 2019 ) . The current standard direct training ( SDT ) methods regard the SNN as RNN and optimize inference indicators ’ distribution ( Wu et al. , 2018 ) . They adopt surrogate gradients ( SG ) to relieve the non-differentiability ( Lee et al. , 2016 ; Wu et al. , 2018 ; Zheng et al. , 2021 ) . However , the gradient descent with SG does not match with the loss landscape in SNN and is easy to get trapped in a local minimum with low generalizability . Although using suitable optimizers and weight decay help ease this problem , the performance of deep SNNs trained from scratch still suffers a big deficit compared to that of ANNs Deng et al . ( 2020 ) . Another training issue is the memory and time consumption , which increases B Corresponding author Standard Direct Training linearly with the simulation time . Rathi & Roy ( 2020 ) initializes the target network by a converted SNN to shorten the training epochs , indicating the possibility of high-performance SNN with limited activation time . The training problem due to the non-differentiable activation function has become the main obstruction of spiking neural network development . In this work , we examine the limitation of the traditional direct training approach with SG and propose the temporal efficient training ( TET ) algorithm . Instead of directly optimizing the integrated potential , TET optimizes every moment ’ s pre-synaptic inputs . As a result , it avoids the trap into local minima with low prediction error but a high second-order moment . Furthermore , since the TET applies optimization on each time point , the network naturally has more robust time scalability . Based on this characteristic , we propose the time inheritance training ( TIT ) , which reduces the training time by initializing the SNN with a smaller simulation length . With the help of TET , the performance of SNNs has improved on both static datasets and neuromorphic datasets . Figure 1 depicts the workflow of our approach . The following summarizes our main contributions : • We analyze the problem of training SNN with SG and propose the TET method , a new loss and gradient descent regime that succeeds in obtaining more generalizable SNNs . • We analyze the feasibility of TET and picture the loss landscape under both the SDT and TET setups to demonstrate TET ’ s advantage in better generalization . • Our sufficient experiments on both static datasets and neuromorphic datasets prove the effectiveness of the TET method . Especially on DVS-CIFAR10 , we report 83.17 % top-1 accuracy for the first time , which is over 10 % better than the current state-of-the-art result . 2 RELATED WORK . In recent years , SNNs have developed rapidly and received more and more attention from the research community . However , lots of challenging problems remain to be unsolved . In general , most works on SNN training have been carried out in two strategies : ANN-to-SNN conversion and direct training from scratch . ANN-to-SNN Conversion . Conversion approaches avoid the training problem by trading high accuracy through high latency . They convert a high-performing ANN to SNN and adjust the SNN parameters w.r.t the ANN activation value layer-by-layer ( Diehl et al. , 2015 ; 2016 ) . Some special techniques have been proposed to reduce the inference latency , such as the subtraction mechanism ( Rueckauer et al. , 2016 ; Han et al. , 2020 ) , robust normalization Rueckauer et al . ( 2016 ) , spike-norm ( Sengupta et al. , 2018 ) , and channel-wise normalization ( Kim et al. , 2019 ) . Recently , Deng & Gu ( 2020 ) decompose the conversion error to each layer and reduce it by bias shift . Li et al . ( 2021a ) suggest using adaptive threshold and layer-wise calibration to obtain high-performance SNNs that require a simulation length of less than 50 . However , converted methods significantly extend the inference latency , and they are not suitable for neuromorphic data ( Deng et al. , 2020 ) . Direct training . In this area , SNNs are regarded as special RNNs and training with BPTT ( Neftci et al. , 2019 ) . On the backpropagation process , The non-differentiable activation term is replaced with a surrogate gradient ( Lee et al. , 2016 ) . Compared with ANN-to-SNN conversion , direct training achieves high accuracy with few time steps but suffers more training costs ( Deng et al. , 2020 ) . Several studies suggest that surrogate gradient ( SG ) is helpful to obtain high-performance SNNs on both static datasets and neuromorphic datasets ( Wu et al. , 2019 ; Shrestha & Orchard , 2018 ; Li et al. , 2021b ) . On the backpropagation process , SG replaces the Dirac function with various shapes of curves . Exceptionally , Wu et al . ( 2018 ) first propose the STBP method and train SNNs on the ANN programming platform , which significantly promotes direct training development . Zheng et al . ( 2021 ) further proposes the tdBN algorithm to smooth the loss function and first realize training a large-scale SNN on ImageNet . Zhang & Li ( 2020 ) proposes TSSL-BP to break down error backpropagation across two types of inter-neuron and intra-neuron dependencies and achieve low-latency and high accuracy SNNs . Recently , Yang et al . ( 2021 ) designed a neighborhood aggregation ( NA ) method to use the multiple perturbed membrane potential waveforms in the neighborhood to compute the finite difference gradients and guide the weight updates . They significantly decrease the required training iterations and improve the SNN performance . 3 PRELIMINARY . 3.1 ITERATIVE LIF MODEL . We adopt the Leaky Integrate-and-Fire ( LIF ) model and translate it to an iterative expression with the Euler method ( Wu et al. , 2019 ) . Mathematically , the membrane potential is updated as u ( t+ 1 ) = τu ( t ) + I ( t ) , ( 1 ) where τ is the constant leaky factor , u ( t ) is the membrane potential at time t , and I ( t ) denotes the pre-synaptic inputs , which is the product of synaptic weight W and spiking input x ( t ) . Given a specific threshold Vth , the neuron fires a spike and u ( t ) reset to 0 when the u ( t ) exceeds the threshold . So the firing function and hard reset mechanism can be described as a ( t+ 1 ) = Θ ( u ( t+ 1 ) − Vth ) ( 2 ) u ( t+ 1 ) = u ( t+ 1 ) · ( 1− a ( t+ 1 ) ) , ( 3 ) where Θ denotes the Heaviside step function . The output spike a ( t + 1 ) will become the post synaptic spike and propagate to the next layer . In this study , we set the starting membrane u ( 0 ) to 0 , the threshold Vth to 1 , and the leaky factor τ to 0.5 for all experiments . The last layer ’ s spike frequency is typically used as the final classification index . However , adopting the LIF model on the last layer will lose information on the membrane potential and damage the performance , especially on complex tasks ( Kim et al. , 2019 ) . Instead , we integrate the pre-synaptic inputs I ( t ) with no decay or firing ( Rathi & Roy , 2020 ; Fang et al. , 2021 ) . Finally , we set the average membrane potential as the classification index and calculate the cross-entropy loss for training . 3.2 SURROGATE GRADIENT . Following the concept of direct training , we regard the SNN as RNN and calculate the gradients through spatial-temporal backpropagation ( STBP ) ( Wu et al. , 2018 ) : ∂L ∂W = ∑ t ∂L ∂a ( t ) ∂a ( t ) ∂u ( t ) ∂u ( t ) ∂I ( t ) ∂I ( t ) ∂W , ( 4 ) where the term ∂a ( t ) ∂u ( t ) is the gradient of the non-differentiability step function involving the derivative of Dirac ’ s δ-function that is typically replaced by surrogate gradients with a derivable curve . So far , there are various shapes of surrogate gradients , such as rectangular ( Wu et al. , 2018 ; 2019 ) , triangle ( Esser et al. , 2016 ; Rathi & Roy , 2020 ) , and exponential ( Shrestha & Orchard , 2018 ) curve . In this work , we choose the surrogate gradients shaped like triangles . Mathematically , it can describe as ∂a ( t ) ∂u ( t ) = 1 γ2 max ( 0 , γ − |u ( t ) − Vth| ) , ( 5 ) where the γ denotes the constraint factor that determines the sample range to activate the gradient . 3.3 BATCH NORMALIZATION FOR SNN . Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) is beneficial to accelerate training and increase performance since it can smooth the loss landscape during training ( Santurkar et al. , 2018 ) . Zheng et al . ( 2021 ) modified the forward time loop form and proposed threshold-dependent Batch Normalization ( tdBN ) to normalize the pre-synaptic inputs I in both spatial and temporal paradigms so that the BN can support spatial-temporal input . We adopt this setup with the extension of the time dimension to batch dimension 1 . In the inference process , the BN layer will be merged into the pre-convolutional layer , thus the inference rule of SNN remain the same but with modified weight : Ŵ←W γ α , b̂← β + ( b− µ ) γ α , ( 6 ) where µ , α are the running mean and standard deviation on both spatial and temporal paradigm , γ , β are the affine transformation parameters , and W , b are the parameters of the pre-convolutional layer . 4 METHODOLOGY . 4.1 FORMULA OF TRAINING SNN WITH SURROGATE GRADIENTS . Standard Direct Training . We use O ( t ) to represent pre-synaptic input I ( t ) of the output layer and calculate the cross-entropy loss . The loss function of standard direct training LSDT is : LSDT = LCE ( 1 T T∑ t=1 O ( t ) , y ) , ( 7 ) where T is the total simulation time , LCE denotes the cross-entropy loss , and y represents the target label . Following the chain rule , we obtain the gradient of W with softmax S ( · ) inference function : ∂LSDT ∂W = 1 T T∑ t=1 [ S ( Omean ) − ŷ ] ∂O ( t ) ∂W , ( 8 ) where Omean denotes the average of the output O ( t ) over time , and ŷ is the one-hot coding of y. Temporal Efficient Training . In this section , we come up with a new kind of loss function LTET to realize temporal efficient training ( TET ) . It constrains the output ( pre-synaptic inputs ) at each moment to be close to the target distribution . It is described as : LTET = 1 T · T∑ t=1 LCE [ O ( t ) , y ] . ( 9 ) Recalculate the gradient of weights under the loss function LTET , and we have : ∂LTET ∂W = 1 T T∑ t=1 [ S ( O ( t ) ) − ŷ ] · ∂O ( t ) ∂W . ( 10 ) | This paper proposes a new training approach, the temporal efficient training (TET). This algorithm utilizes a new loss function to improve the generalizability of SNNs. Further, a new training pipeline is presented to reduce the simulation time of SNNs. This work outperforms the SOTA on the static datasets and neuromorphic datasets. | SP:c5410665da3422fabd2f18575729293037c9fa3a |
Temporal Efficient Training of Spiking Neural Network via Gradient Re-weighting | 1 INTRODUCTION . The advantages of Spiking neuron networks ( SNNs ) lie in their energy-saving and fast-inference computation when embedded on neuromorphic hardware such as TrueNorth ( DeBole et al. , 2019 ) and Loihi ( Davies et al. , 2018 ) . Such advantages originate from the biology-inspired binary spike transmitted mechanism , by which the networks avoid multiplication during inference . On the other hand , this mechanism also leads to difficulty in training very deep SNNs from scratch because the non-differentiable spike transmission hinders the powerful back-propagation approaches like gradient descents . Recently , many studies on converting artificial neuron networks ( ANNs ) to SNNs have demonstrated SNNs ’ comparable power in feature representation as ANNs ( Han & Roy , 2020 ; Deng & Gu , 2020 ; Li et al. , 2021a ) . Nevertheless , it is commonly agreed that the direct training method for high-performance SNN is still crucial since it distinguishes SNNs from converted ANNs , especially on neuromorphic datasets . The output layer ’ s spike frequency or the average membrane potential increment is commonly used as inference indicators in SNNs ( Shrestha & Orchard , 2018 ; Kim et al. , 2019 ) . The current standard direct training ( SDT ) methods regard the SNN as RNN and optimize inference indicators ’ distribution ( Wu et al. , 2018 ) . They adopt surrogate gradients ( SG ) to relieve the non-differentiability ( Lee et al. , 2016 ; Wu et al. , 2018 ; Zheng et al. , 2021 ) . However , the gradient descent with SG does not match with the loss landscape in SNN and is easy to get trapped in a local minimum with low generalizability . Although using suitable optimizers and weight decay help ease this problem , the performance of deep SNNs trained from scratch still suffers a big deficit compared to that of ANNs Deng et al . ( 2020 ) . Another training issue is the memory and time consumption , which increases B Corresponding author Standard Direct Training linearly with the simulation time . Rathi & Roy ( 2020 ) initializes the target network by a converted SNN to shorten the training epochs , indicating the possibility of high-performance SNN with limited activation time . The training problem due to the non-differentiable activation function has become the main obstruction of spiking neural network development . In this work , we examine the limitation of the traditional direct training approach with SG and propose the temporal efficient training ( TET ) algorithm . Instead of directly optimizing the integrated potential , TET optimizes every moment ’ s pre-synaptic inputs . As a result , it avoids the trap into local minima with low prediction error but a high second-order moment . Furthermore , since the TET applies optimization on each time point , the network naturally has more robust time scalability . Based on this characteristic , we propose the time inheritance training ( TIT ) , which reduces the training time by initializing the SNN with a smaller simulation length . With the help of TET , the performance of SNNs has improved on both static datasets and neuromorphic datasets . Figure 1 depicts the workflow of our approach . The following summarizes our main contributions : • We analyze the problem of training SNN with SG and propose the TET method , a new loss and gradient descent regime that succeeds in obtaining more generalizable SNNs . • We analyze the feasibility of TET and picture the loss landscape under both the SDT and TET setups to demonstrate TET ’ s advantage in better generalization . • Our sufficient experiments on both static datasets and neuromorphic datasets prove the effectiveness of the TET method . Especially on DVS-CIFAR10 , we report 83.17 % top-1 accuracy for the first time , which is over 10 % better than the current state-of-the-art result . 2 RELATED WORK . In recent years , SNNs have developed rapidly and received more and more attention from the research community . However , lots of challenging problems remain to be unsolved . In general , most works on SNN training have been carried out in two strategies : ANN-to-SNN conversion and direct training from scratch . ANN-to-SNN Conversion . Conversion approaches avoid the training problem by trading high accuracy through high latency . They convert a high-performing ANN to SNN and adjust the SNN parameters w.r.t the ANN activation value layer-by-layer ( Diehl et al. , 2015 ; 2016 ) . Some special techniques have been proposed to reduce the inference latency , such as the subtraction mechanism ( Rueckauer et al. , 2016 ; Han et al. , 2020 ) , robust normalization Rueckauer et al . ( 2016 ) , spike-norm ( Sengupta et al. , 2018 ) , and channel-wise normalization ( Kim et al. , 2019 ) . Recently , Deng & Gu ( 2020 ) decompose the conversion error to each layer and reduce it by bias shift . Li et al . ( 2021a ) suggest using adaptive threshold and layer-wise calibration to obtain high-performance SNNs that require a simulation length of less than 50 . However , converted methods significantly extend the inference latency , and they are not suitable for neuromorphic data ( Deng et al. , 2020 ) . Direct training . In this area , SNNs are regarded as special RNNs and training with BPTT ( Neftci et al. , 2019 ) . On the backpropagation process , The non-differentiable activation term is replaced with a surrogate gradient ( Lee et al. , 2016 ) . Compared with ANN-to-SNN conversion , direct training achieves high accuracy with few time steps but suffers more training costs ( Deng et al. , 2020 ) . Several studies suggest that surrogate gradient ( SG ) is helpful to obtain high-performance SNNs on both static datasets and neuromorphic datasets ( Wu et al. , 2019 ; Shrestha & Orchard , 2018 ; Li et al. , 2021b ) . On the backpropagation process , SG replaces the Dirac function with various shapes of curves . Exceptionally , Wu et al . ( 2018 ) first propose the STBP method and train SNNs on the ANN programming platform , which significantly promotes direct training development . Zheng et al . ( 2021 ) further proposes the tdBN algorithm to smooth the loss function and first realize training a large-scale SNN on ImageNet . Zhang & Li ( 2020 ) proposes TSSL-BP to break down error backpropagation across two types of inter-neuron and intra-neuron dependencies and achieve low-latency and high accuracy SNNs . Recently , Yang et al . ( 2021 ) designed a neighborhood aggregation ( NA ) method to use the multiple perturbed membrane potential waveforms in the neighborhood to compute the finite difference gradients and guide the weight updates . They significantly decrease the required training iterations and improve the SNN performance . 3 PRELIMINARY . 3.1 ITERATIVE LIF MODEL . We adopt the Leaky Integrate-and-Fire ( LIF ) model and translate it to an iterative expression with the Euler method ( Wu et al. , 2019 ) . Mathematically , the membrane potential is updated as u ( t+ 1 ) = τu ( t ) + I ( t ) , ( 1 ) where τ is the constant leaky factor , u ( t ) is the membrane potential at time t , and I ( t ) denotes the pre-synaptic inputs , which is the product of synaptic weight W and spiking input x ( t ) . Given a specific threshold Vth , the neuron fires a spike and u ( t ) reset to 0 when the u ( t ) exceeds the threshold . So the firing function and hard reset mechanism can be described as a ( t+ 1 ) = Θ ( u ( t+ 1 ) − Vth ) ( 2 ) u ( t+ 1 ) = u ( t+ 1 ) · ( 1− a ( t+ 1 ) ) , ( 3 ) where Θ denotes the Heaviside step function . The output spike a ( t + 1 ) will become the post synaptic spike and propagate to the next layer . In this study , we set the starting membrane u ( 0 ) to 0 , the threshold Vth to 1 , and the leaky factor τ to 0.5 for all experiments . The last layer ’ s spike frequency is typically used as the final classification index . However , adopting the LIF model on the last layer will lose information on the membrane potential and damage the performance , especially on complex tasks ( Kim et al. , 2019 ) . Instead , we integrate the pre-synaptic inputs I ( t ) with no decay or firing ( Rathi & Roy , 2020 ; Fang et al. , 2021 ) . Finally , we set the average membrane potential as the classification index and calculate the cross-entropy loss for training . 3.2 SURROGATE GRADIENT . Following the concept of direct training , we regard the SNN as RNN and calculate the gradients through spatial-temporal backpropagation ( STBP ) ( Wu et al. , 2018 ) : ∂L ∂W = ∑ t ∂L ∂a ( t ) ∂a ( t ) ∂u ( t ) ∂u ( t ) ∂I ( t ) ∂I ( t ) ∂W , ( 4 ) where the term ∂a ( t ) ∂u ( t ) is the gradient of the non-differentiability step function involving the derivative of Dirac ’ s δ-function that is typically replaced by surrogate gradients with a derivable curve . So far , there are various shapes of surrogate gradients , such as rectangular ( Wu et al. , 2018 ; 2019 ) , triangle ( Esser et al. , 2016 ; Rathi & Roy , 2020 ) , and exponential ( Shrestha & Orchard , 2018 ) curve . In this work , we choose the surrogate gradients shaped like triangles . Mathematically , it can describe as ∂a ( t ) ∂u ( t ) = 1 γ2 max ( 0 , γ − |u ( t ) − Vth| ) , ( 5 ) where the γ denotes the constraint factor that determines the sample range to activate the gradient . 3.3 BATCH NORMALIZATION FOR SNN . Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) is beneficial to accelerate training and increase performance since it can smooth the loss landscape during training ( Santurkar et al. , 2018 ) . Zheng et al . ( 2021 ) modified the forward time loop form and proposed threshold-dependent Batch Normalization ( tdBN ) to normalize the pre-synaptic inputs I in both spatial and temporal paradigms so that the BN can support spatial-temporal input . We adopt this setup with the extension of the time dimension to batch dimension 1 . In the inference process , the BN layer will be merged into the pre-convolutional layer , thus the inference rule of SNN remain the same but with modified weight : Ŵ←W γ α , b̂← β + ( b− µ ) γ α , ( 6 ) where µ , α are the running mean and standard deviation on both spatial and temporal paradigm , γ , β are the affine transformation parameters , and W , b are the parameters of the pre-convolutional layer . 4 METHODOLOGY . 4.1 FORMULA OF TRAINING SNN WITH SURROGATE GRADIENTS . Standard Direct Training . We use O ( t ) to represent pre-synaptic input I ( t ) of the output layer and calculate the cross-entropy loss . The loss function of standard direct training LSDT is : LSDT = LCE ( 1 T T∑ t=1 O ( t ) , y ) , ( 7 ) where T is the total simulation time , LCE denotes the cross-entropy loss , and y represents the target label . Following the chain rule , we obtain the gradient of W with softmax S ( · ) inference function : ∂LSDT ∂W = 1 T T∑ t=1 [ S ( Omean ) − ŷ ] ∂O ( t ) ∂W , ( 8 ) where Omean denotes the average of the output O ( t ) over time , and ŷ is the one-hot coding of y. Temporal Efficient Training . In this section , we come up with a new kind of loss function LTET to realize temporal efficient training ( TET ) . It constrains the output ( pre-synaptic inputs ) at each moment to be close to the target distribution . It is described as : LTET = 1 T · T∑ t=1 LCE [ O ( t ) , y ] . ( 9 ) Recalculate the gradient of weights under the loss function LTET , and we have : ∂LTET ∂W = 1 T T∑ t=1 [ S ( O ( t ) ) − ŷ ] · ∂O ( t ) ∂W . ( 10 ) | The paper focusses on an important problem of improving supervised training of spiking neural nets (SNNs), as the current state of SNN training is lacking as compared to that for standard ANNs. The authors propose a couple simple but effective methods for improving both training efficiency and classification accuracy: temporal efficient training (TET) which simply accumulates error gradients for each time step, and time inheritance training (TIT), which is a repeated training schedule with increasing simulation times. In extensive experiments the authors demonstrate that their approach improves training time and accuracy. | SP:c5410665da3422fabd2f18575729293037c9fa3a |
Temporal Efficient Training of Spiking Neural Network via Gradient Re-weighting | 1 INTRODUCTION . The advantages of Spiking neuron networks ( SNNs ) lie in their energy-saving and fast-inference computation when embedded on neuromorphic hardware such as TrueNorth ( DeBole et al. , 2019 ) and Loihi ( Davies et al. , 2018 ) . Such advantages originate from the biology-inspired binary spike transmitted mechanism , by which the networks avoid multiplication during inference . On the other hand , this mechanism also leads to difficulty in training very deep SNNs from scratch because the non-differentiable spike transmission hinders the powerful back-propagation approaches like gradient descents . Recently , many studies on converting artificial neuron networks ( ANNs ) to SNNs have demonstrated SNNs ’ comparable power in feature representation as ANNs ( Han & Roy , 2020 ; Deng & Gu , 2020 ; Li et al. , 2021a ) . Nevertheless , it is commonly agreed that the direct training method for high-performance SNN is still crucial since it distinguishes SNNs from converted ANNs , especially on neuromorphic datasets . The output layer ’ s spike frequency or the average membrane potential increment is commonly used as inference indicators in SNNs ( Shrestha & Orchard , 2018 ; Kim et al. , 2019 ) . The current standard direct training ( SDT ) methods regard the SNN as RNN and optimize inference indicators ’ distribution ( Wu et al. , 2018 ) . They adopt surrogate gradients ( SG ) to relieve the non-differentiability ( Lee et al. , 2016 ; Wu et al. , 2018 ; Zheng et al. , 2021 ) . However , the gradient descent with SG does not match with the loss landscape in SNN and is easy to get trapped in a local minimum with low generalizability . Although using suitable optimizers and weight decay help ease this problem , the performance of deep SNNs trained from scratch still suffers a big deficit compared to that of ANNs Deng et al . ( 2020 ) . Another training issue is the memory and time consumption , which increases B Corresponding author Standard Direct Training linearly with the simulation time . Rathi & Roy ( 2020 ) initializes the target network by a converted SNN to shorten the training epochs , indicating the possibility of high-performance SNN with limited activation time . The training problem due to the non-differentiable activation function has become the main obstruction of spiking neural network development . In this work , we examine the limitation of the traditional direct training approach with SG and propose the temporal efficient training ( TET ) algorithm . Instead of directly optimizing the integrated potential , TET optimizes every moment ’ s pre-synaptic inputs . As a result , it avoids the trap into local minima with low prediction error but a high second-order moment . Furthermore , since the TET applies optimization on each time point , the network naturally has more robust time scalability . Based on this characteristic , we propose the time inheritance training ( TIT ) , which reduces the training time by initializing the SNN with a smaller simulation length . With the help of TET , the performance of SNNs has improved on both static datasets and neuromorphic datasets . Figure 1 depicts the workflow of our approach . The following summarizes our main contributions : • We analyze the problem of training SNN with SG and propose the TET method , a new loss and gradient descent regime that succeeds in obtaining more generalizable SNNs . • We analyze the feasibility of TET and picture the loss landscape under both the SDT and TET setups to demonstrate TET ’ s advantage in better generalization . • Our sufficient experiments on both static datasets and neuromorphic datasets prove the effectiveness of the TET method . Especially on DVS-CIFAR10 , we report 83.17 % top-1 accuracy for the first time , which is over 10 % better than the current state-of-the-art result . 2 RELATED WORK . In recent years , SNNs have developed rapidly and received more and more attention from the research community . However , lots of challenging problems remain to be unsolved . In general , most works on SNN training have been carried out in two strategies : ANN-to-SNN conversion and direct training from scratch . ANN-to-SNN Conversion . Conversion approaches avoid the training problem by trading high accuracy through high latency . They convert a high-performing ANN to SNN and adjust the SNN parameters w.r.t the ANN activation value layer-by-layer ( Diehl et al. , 2015 ; 2016 ) . Some special techniques have been proposed to reduce the inference latency , such as the subtraction mechanism ( Rueckauer et al. , 2016 ; Han et al. , 2020 ) , robust normalization Rueckauer et al . ( 2016 ) , spike-norm ( Sengupta et al. , 2018 ) , and channel-wise normalization ( Kim et al. , 2019 ) . Recently , Deng & Gu ( 2020 ) decompose the conversion error to each layer and reduce it by bias shift . Li et al . ( 2021a ) suggest using adaptive threshold and layer-wise calibration to obtain high-performance SNNs that require a simulation length of less than 50 . However , converted methods significantly extend the inference latency , and they are not suitable for neuromorphic data ( Deng et al. , 2020 ) . Direct training . In this area , SNNs are regarded as special RNNs and training with BPTT ( Neftci et al. , 2019 ) . On the backpropagation process , The non-differentiable activation term is replaced with a surrogate gradient ( Lee et al. , 2016 ) . Compared with ANN-to-SNN conversion , direct training achieves high accuracy with few time steps but suffers more training costs ( Deng et al. , 2020 ) . Several studies suggest that surrogate gradient ( SG ) is helpful to obtain high-performance SNNs on both static datasets and neuromorphic datasets ( Wu et al. , 2019 ; Shrestha & Orchard , 2018 ; Li et al. , 2021b ) . On the backpropagation process , SG replaces the Dirac function with various shapes of curves . Exceptionally , Wu et al . ( 2018 ) first propose the STBP method and train SNNs on the ANN programming platform , which significantly promotes direct training development . Zheng et al . ( 2021 ) further proposes the tdBN algorithm to smooth the loss function and first realize training a large-scale SNN on ImageNet . Zhang & Li ( 2020 ) proposes TSSL-BP to break down error backpropagation across two types of inter-neuron and intra-neuron dependencies and achieve low-latency and high accuracy SNNs . Recently , Yang et al . ( 2021 ) designed a neighborhood aggregation ( NA ) method to use the multiple perturbed membrane potential waveforms in the neighborhood to compute the finite difference gradients and guide the weight updates . They significantly decrease the required training iterations and improve the SNN performance . 3 PRELIMINARY . 3.1 ITERATIVE LIF MODEL . We adopt the Leaky Integrate-and-Fire ( LIF ) model and translate it to an iterative expression with the Euler method ( Wu et al. , 2019 ) . Mathematically , the membrane potential is updated as u ( t+ 1 ) = τu ( t ) + I ( t ) , ( 1 ) where τ is the constant leaky factor , u ( t ) is the membrane potential at time t , and I ( t ) denotes the pre-synaptic inputs , which is the product of synaptic weight W and spiking input x ( t ) . Given a specific threshold Vth , the neuron fires a spike and u ( t ) reset to 0 when the u ( t ) exceeds the threshold . So the firing function and hard reset mechanism can be described as a ( t+ 1 ) = Θ ( u ( t+ 1 ) − Vth ) ( 2 ) u ( t+ 1 ) = u ( t+ 1 ) · ( 1− a ( t+ 1 ) ) , ( 3 ) where Θ denotes the Heaviside step function . The output spike a ( t + 1 ) will become the post synaptic spike and propagate to the next layer . In this study , we set the starting membrane u ( 0 ) to 0 , the threshold Vth to 1 , and the leaky factor τ to 0.5 for all experiments . The last layer ’ s spike frequency is typically used as the final classification index . However , adopting the LIF model on the last layer will lose information on the membrane potential and damage the performance , especially on complex tasks ( Kim et al. , 2019 ) . Instead , we integrate the pre-synaptic inputs I ( t ) with no decay or firing ( Rathi & Roy , 2020 ; Fang et al. , 2021 ) . Finally , we set the average membrane potential as the classification index and calculate the cross-entropy loss for training . 3.2 SURROGATE GRADIENT . Following the concept of direct training , we regard the SNN as RNN and calculate the gradients through spatial-temporal backpropagation ( STBP ) ( Wu et al. , 2018 ) : ∂L ∂W = ∑ t ∂L ∂a ( t ) ∂a ( t ) ∂u ( t ) ∂u ( t ) ∂I ( t ) ∂I ( t ) ∂W , ( 4 ) where the term ∂a ( t ) ∂u ( t ) is the gradient of the non-differentiability step function involving the derivative of Dirac ’ s δ-function that is typically replaced by surrogate gradients with a derivable curve . So far , there are various shapes of surrogate gradients , such as rectangular ( Wu et al. , 2018 ; 2019 ) , triangle ( Esser et al. , 2016 ; Rathi & Roy , 2020 ) , and exponential ( Shrestha & Orchard , 2018 ) curve . In this work , we choose the surrogate gradients shaped like triangles . Mathematically , it can describe as ∂a ( t ) ∂u ( t ) = 1 γ2 max ( 0 , γ − |u ( t ) − Vth| ) , ( 5 ) where the γ denotes the constraint factor that determines the sample range to activate the gradient . 3.3 BATCH NORMALIZATION FOR SNN . Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) is beneficial to accelerate training and increase performance since it can smooth the loss landscape during training ( Santurkar et al. , 2018 ) . Zheng et al . ( 2021 ) modified the forward time loop form and proposed threshold-dependent Batch Normalization ( tdBN ) to normalize the pre-synaptic inputs I in both spatial and temporal paradigms so that the BN can support spatial-temporal input . We adopt this setup with the extension of the time dimension to batch dimension 1 . In the inference process , the BN layer will be merged into the pre-convolutional layer , thus the inference rule of SNN remain the same but with modified weight : Ŵ←W γ α , b̂← β + ( b− µ ) γ α , ( 6 ) where µ , α are the running mean and standard deviation on both spatial and temporal paradigm , γ , β are the affine transformation parameters , and W , b are the parameters of the pre-convolutional layer . 4 METHODOLOGY . 4.1 FORMULA OF TRAINING SNN WITH SURROGATE GRADIENTS . Standard Direct Training . We use O ( t ) to represent pre-synaptic input I ( t ) of the output layer and calculate the cross-entropy loss . The loss function of standard direct training LSDT is : LSDT = LCE ( 1 T T∑ t=1 O ( t ) , y ) , ( 7 ) where T is the total simulation time , LCE denotes the cross-entropy loss , and y represents the target label . Following the chain rule , we obtain the gradient of W with softmax S ( · ) inference function : ∂LSDT ∂W = 1 T T∑ t=1 [ S ( Omean ) − ŷ ] ∂O ( t ) ∂W , ( 8 ) where Omean denotes the average of the output O ( t ) over time , and ŷ is the one-hot coding of y. Temporal Efficient Training . In this section , we come up with a new kind of loss function LTET to realize temporal efficient training ( TET ) . It constrains the output ( pre-synaptic inputs ) at each moment to be close to the target distribution . It is described as : LTET = 1 T · T∑ t=1 LCE [ O ( t ) , y ] . ( 9 ) Recalculate the gradient of weights under the loss function LTET , and we have : ∂LTET ∂W = 1 T T∑ t=1 [ S ( O ( t ) ) − ŷ ] · ∂O ( t ) ∂W . ( 10 ) | The authors propose the temporal efficient training (TET) method that features loss evaluation at every timestep. As such, the main difference between TET and SDT lies in the fact that TET evaluates loss at every timestep with the correct label vector whereas SDT evaluates loss at the last timestep. But unfortunately, this could not be done because of the use of $L_{TOTAL}=(1-\lambda)L_{TET}+\lambda L_{MSE}$, where $L_{MSE}$ is evaluated at the last moment. The proposed method is simple but its efficacy outperforms the SOTA results for various networks on various datasets. | SP:c5410665da3422fabd2f18575729293037c9fa3a |
Sparse Communication via Mixed Distributions | 1 INTRODUCTION . Historically , discrete and continuous domains have been considered separately in machine learning , information theory , and engineering applications : random variables ( r.v . ) and information sources are chosen to be either discrete or continuous , but not both ( Shannon , 1948 ) . In signal processing , one needs to opt between discrete ( digital ) and continuous ( analog ) communication , whereas analog signals can be converted into digital ones by means of sampling and quantization . Discrete latent variable models are appealing to facilitate learning with less supervision , to leverage prior knowledge , and to build more compact and interpretable models . However , training such models is challenging due to the need to evaluate a large or combinatorial expectation . Existing strategies include the score function estimator ( Williams , 1992 ; Mnih & Gregor , 2014 ) , pathwise gradients ( Kingma & Welling , 2014 ) combined with a continuous relaxation of the latent variables ( such as the Concrete distribution , Maddison et al . ( 2017 ) ; Jang et al . ( 2017 ) ) , and sparse parametrizations ( Correia et al. , 2020 ) . Pathwise gradients , in particular , require continuous approximations of quantities that are inherently discrete , sometimes requiring proxy gradients ( Jang et al. , 2017 ; Maddison et al. , 2017 ) , sometimes giving the r.v . different treatment in different terms of the same objective ( Jang et al. , 2017 ) , sometimes creating a discrete-continuous hybrid ( Louizos et al. , 2018 ) . Since discrete variables and their continuous relaxations are so prevalent , they deserve a rigorous mathematical study . Throughout , we will use the name mixed variable to denote a hybrid variable that takes on both discrete and continuous outcomes . This work takes a first step into a rigorous study of mixed variables and their properties . We will call communication through mixed variables sparse communication : its goal is to retain the advantages of differentiable computation but still be able to represent and approximate discrete symbols . Our main contributions are : • We provide a direct sum measure as an alternative to the Lebesgue and counting measures used for continuous and discrete variables , respectively ( Halmos , 2013 ) . The direct sum measure hinges on a face lattice stratification of polytopes , including the probability simplex , avoiding the need for Dirac densities when expressing densities with point masses in the boundary of the simplex ( §3 ) . • We use the direct sum measure to formally defineK th-dimensional mixed random variables . We provide extrinsic ( “ sample-and-project ” ) and intrinsic ( based on face stratification ) characterizations of these variables , leading to several new distributions : the K-D Hard Concrete , the GaussianSparsemax , and the Mixed Dirichlet ( summarized in Table 1 ) . See Figure 1 for an illustration . • We propose a new direct sum entropy and Kullback-Leibler divergence , which decompose as a sum of discrete and continuous ( differential ) entropies/divergences . We provide an interpretation in terms of optimal code length , and we derive an expression for the maximum entropy ( §4 ) . • We illustrate the usefulness of our framework by learning mixed latent variable models in an emergent communication task and with VAEs to model Fashion-MNIST and MNIST data ( §5 ) . 2 BACKGROUND . We assume throughout an alphabet with K ≥ 2 symbols , denoted [ K ] = { 1 , . . . , K } . Symbols can be encoded as one-hot vectors ek . RK denotes the K-dimensional Euclidean space , RK > 0 its strictly positive orthant , and4K−1 ⊆ RK the probability simplex,4K−1 : = { y ∈ RK | y ≥ 0 , 1 > y = 1 } , with vertices { e1 , . . . , eK } . Each y ∈ 4K−1 can be seen as a vector of probabilities for the K symbols , parametrizing a categorical distribution over [ K ] . The support of y ∈ 4K−1 is the set of nonzero-probability symbols supp ( y ) : = { k ∈ [ K ] | yk > 0 } . The set of full-support categoricals corresponds to the relative interior of the simplex , ri ( 4K−1 ) : = { y ∈ 4K−1 | supp ( y ) = [ K ] } . 2.1 TRANSFORMATIONS FROM RK TO 4K−1 . In many situations , there is a need to convert a vector of real numbers z ∈ RK ( scores for the several symbols , often called logits ) into a probability vector y ∈ 4K−1 . The most common choice is the softmax transformation ( Bridle , 1990 ) : y = softmax ( z ) ∝ exp ( z ) . Since the exponential function is strictly positive , softmax reaches only the relative interior ri ( 4K−1 ) , that is , it never returns a sparse probability vector . To encourage more peaked distributions ( but never sparse ) it is common to use a temperature parameter β > 0 , by defining softmaxβ ( z ) : = softmax ( β−1z ) . The limit case β → 0+ corresponds to the indicator vector for the argmax , which returns a one-hot distribution indicating the symbol with the largest score . While the softmax transformation is differentiable ( hence permitting end-to-end training with the gradient backpropagation algorithm ) , the argmax function has zero gradients almost everywhere . With small temperatures , numerical issues are common . A direct sparse probability mapping is sparsemax ( Martins & Astudillo , 2016 ) , the Euclidean projection onto the simplex : sparsemax ( z ) : = arg miny∈4K−1 ‖y−z‖ . Unlike softmax , sparsemax reaches the full simplex4K−1 , including the boundary , often returning a sparse vector y , without sacrificing differentiability almost everywhere . With K = 2 and parametrizing z = ( z , 1 − z ) , sparsemax becomes a “ hard sigmoid , ” [ sparsemax ( ( z , 1 − z ) ) ] 1 = max { 0 , min { 1 , z } } . We will come back to this point in §3.3 . Other sparse transformations include α-entmax ( Peters et al. , 2019 ; Blondel et al. , 2020 ) , top-k softmax ( Fan et al. , 2018 ; Radford et al. , 2019 ) , and others ( Laha et al. , 2018 ; Sensoy et al. , 2018 ; Kong et al. , 2020 ; Itkina et al. , 2020 ) . 2.2 DENSITIES OVER THE SIMPLEX . Let us now switch from deterministic to stochastic maps . Denote by Y a r.v . taking on values in the simplex4K−1 with probability density function pY ( y ) . The density of a Dirichlet r.v . Y ∼ Dir ( α ) , with α ∈ RK > 0 is pY ( y ; α ) ∝ ∏K k=1 y αk−1 k . Sampling from a Dirichlet produces a point in ri ( 4K−1 ) , and , although a Dirichlet can assign high density to y close to the boundary of the simplex when α < 1 , a Dirichlet sample can never be sparse . A Logistic-Normal r.v . ( Atchison & Shen , 1980 ) , also known as Gaussian-Softmax by analogy to other distributions to be presented , is given by the softmax-projection of a multivariate Gaussian r.v . with mean z and covariance Σ : Y = softmax ( z + Σ 1 2N ) with Nk ∼ N ( 0 , 1 ) . Since the softmax is strictly positive , the Logistic-Normal places no probability mass to points in the boundary of4K−1 . A Concrete ( Maddison et al. , 2017 ) , or Gumbel-Softmax ( Jang et al. , 2017 ) , r.v . is given by the softmax-projection of K independent Gumbel r.vs. , each with mean zk : Y = softmaxβ ( z+G ) with Gk ∼ Gumbel ( 0 , 1 ) . Like in the previous cases , a Concrete draw is a point in ri ( 4K−1 ) . When the temperature β approaches zero , the softmax approaches the indicator for argmax and Y becomes closer to a categorical r.v . ( Luce , 1959 ; Papandreou & Yuille , 2011 ) . Thus , a Concrete r.v . can be seen as a continuous relaxation of a categorical . 2.3 TRUNCATED UNIVARIATE DENSITIES . Binary Hard Concrete . For K = 2 , a point in the simplex can be represented as y = ( y , 1− y ) and the simplex is isomorphic to the unit interval,41 ' [ 0 , 1 ] . For this binary case , Louizos et al . ( 2018 ) proposed a Hard Concrete distribution which stretches the Concrete and applies a hard sigmoid transformation ( which equals the sparsemax with K = 2 , per §2.1 ) as a way of placing point masses at 0 and 1 . These “ stretch-and-rectify ” techniques enable assigning probability mass to the boundary of41 and are similar in spirit to the spike-and-slab feature selection method ( Mitchell & Beauchamp , 1988 ; Ishwaran et al. , 2005 ) and for sparse codes in variational auto-encoders ( Rolfe , 2017 ; Vahdat et al. , 2018 ) . We propose in §3.3 a more general extension to K ≥ 2 . Rectified Gaussian . Rectification can be applied to other continuous distributions . A simple choice is the Gaussian distribution , to which one-sided ( Hinton & Ghahramani , 1997 ) and two-sided rectifications ( Palmer et al. , 2017 ) have been proposed . Two-sided rectification yields a mixed r.v . in [ 0 , 1 ] . Writing y = ( y , 1− y ) and z = ( z , 1− z ) , this distribution has the following density : pY ( y ) = N ( y ; z , σ2 ) + 1− erf ( z/ ( √ 2σ ) ) 2 δ0 ( y ) + 1 + erf ( ( z − 1 ) / ( √ 2σ ) ) 2 δ1 ( y ) , ( 1 ) where δs ( y ) is a Dirac delta density . Extending such distributions to the multivariate case is nontrivial . For K > 2 , a density expression with Diracs would be cumbersome , since it would require a combinatorial number of Diracs of several “ orders , ” depending on whether they are placed at a vertex , edge , face , etc . Another annoyance is that Dirac deltas have −∞ differential entropy , which prevents information-theoretic treatment . The next section shows how we can obtain densities that assign mass to the full simplex while avoiding Diracs , by making use of the face lattice and a new base measure . 3 FACE STRATIFICATION AND MIXED RANDOM VARIABLES . 3.1 THE FACE LATTICE . Let P be a convex polytope whose vertices are bit vectors ( i.e. , elements of { 0 , 1 } K ) . Examples are the probability simplex 4K−1 , the hypercube [ 0 , 1 ] K , and marginal polytopes of structured variables ( Wainwright & Jordan , 2008 ) . The combinatorial structure of a polytope is determined by its face lattice ( Ziegler , 1995 , §2.2 ) , which we now describe . A face of P is any intersection of P with a closed halfspace such that none of the interior points of P lie on the boundary of the halfspace ; we denote by F ( P ) the set of all faces of P and by F̄ ( P ) : = F ( P ) \ { ∅ } the set of proper faces . We denote by dim ( f ) the dimension of a face f ∈ F̄ ( P ) . Thus , the vertices of P are 0-dimensional faces , and P itself is a face of the same dimension as P , called the “ maximal face ” . Any other face of P can be regarded as a lower-dimensional polytope . The set F ( P ) has a partial order induced by set inclusion , that is , it is a partially ordered set ( poset ) , and more specifically a lattice . The full polytope P can be decomposed uniquely as the disjoint union of the relative interior of its faces , which we call face stratification : P = ⊔ f∈F̄ ( P ) ri ( f ) . For example , the simplex 42 is composed of its face ri ( 42 ) ( i.e. , excluding the boundary ) , three edges ( excluding the vertices in the corners ) , and three vertices ( the corners ) . This is represented schematically in Figure 2 . Likewise , the square [ 0 , 1 ] 2 is composed of its maximal face ( 0 , 1 ) 2 , four edges ( excluding the corners ) and four vertices ( the corners ) . The partition above implies that any subset A ⊆ P can be represented as a tuple A = ( Af ) f∈F̄ ( P ) , where Af = A ∩ ri ( f ) ; and the sets Af are all disjoint . | This paper presents multidimensional extensions for mixed random variables originating from discrete-continuous hybrids based on truncation and rectification, which have been proposed for univariate distributions. The proposed extension replaces truncation by sparse projections to the simplex. The authors also propose a direct sum base measure definition on the face lattice of the probability simplex and intrinsic sampling strategies motivated by “manifold stratification”. Based on these introductions, new entropy and Kullback-Leibler divergence functions that subsume the discrete and differential cases and have interpretations in terms of code optimality, are presented. | SP:1666661164a4d5b154c57819e472d3e7abb57841 |
Sparse Communication via Mixed Distributions | 1 INTRODUCTION . Historically , discrete and continuous domains have been considered separately in machine learning , information theory , and engineering applications : random variables ( r.v . ) and information sources are chosen to be either discrete or continuous , but not both ( Shannon , 1948 ) . In signal processing , one needs to opt between discrete ( digital ) and continuous ( analog ) communication , whereas analog signals can be converted into digital ones by means of sampling and quantization . Discrete latent variable models are appealing to facilitate learning with less supervision , to leverage prior knowledge , and to build more compact and interpretable models . However , training such models is challenging due to the need to evaluate a large or combinatorial expectation . Existing strategies include the score function estimator ( Williams , 1992 ; Mnih & Gregor , 2014 ) , pathwise gradients ( Kingma & Welling , 2014 ) combined with a continuous relaxation of the latent variables ( such as the Concrete distribution , Maddison et al . ( 2017 ) ; Jang et al . ( 2017 ) ) , and sparse parametrizations ( Correia et al. , 2020 ) . Pathwise gradients , in particular , require continuous approximations of quantities that are inherently discrete , sometimes requiring proxy gradients ( Jang et al. , 2017 ; Maddison et al. , 2017 ) , sometimes giving the r.v . different treatment in different terms of the same objective ( Jang et al. , 2017 ) , sometimes creating a discrete-continuous hybrid ( Louizos et al. , 2018 ) . Since discrete variables and their continuous relaxations are so prevalent , they deserve a rigorous mathematical study . Throughout , we will use the name mixed variable to denote a hybrid variable that takes on both discrete and continuous outcomes . This work takes a first step into a rigorous study of mixed variables and their properties . We will call communication through mixed variables sparse communication : its goal is to retain the advantages of differentiable computation but still be able to represent and approximate discrete symbols . Our main contributions are : • We provide a direct sum measure as an alternative to the Lebesgue and counting measures used for continuous and discrete variables , respectively ( Halmos , 2013 ) . The direct sum measure hinges on a face lattice stratification of polytopes , including the probability simplex , avoiding the need for Dirac densities when expressing densities with point masses in the boundary of the simplex ( §3 ) . • We use the direct sum measure to formally defineK th-dimensional mixed random variables . We provide extrinsic ( “ sample-and-project ” ) and intrinsic ( based on face stratification ) characterizations of these variables , leading to several new distributions : the K-D Hard Concrete , the GaussianSparsemax , and the Mixed Dirichlet ( summarized in Table 1 ) . See Figure 1 for an illustration . • We propose a new direct sum entropy and Kullback-Leibler divergence , which decompose as a sum of discrete and continuous ( differential ) entropies/divergences . We provide an interpretation in terms of optimal code length , and we derive an expression for the maximum entropy ( §4 ) . • We illustrate the usefulness of our framework by learning mixed latent variable models in an emergent communication task and with VAEs to model Fashion-MNIST and MNIST data ( §5 ) . 2 BACKGROUND . We assume throughout an alphabet with K ≥ 2 symbols , denoted [ K ] = { 1 , . . . , K } . Symbols can be encoded as one-hot vectors ek . RK denotes the K-dimensional Euclidean space , RK > 0 its strictly positive orthant , and4K−1 ⊆ RK the probability simplex,4K−1 : = { y ∈ RK | y ≥ 0 , 1 > y = 1 } , with vertices { e1 , . . . , eK } . Each y ∈ 4K−1 can be seen as a vector of probabilities for the K symbols , parametrizing a categorical distribution over [ K ] . The support of y ∈ 4K−1 is the set of nonzero-probability symbols supp ( y ) : = { k ∈ [ K ] | yk > 0 } . The set of full-support categoricals corresponds to the relative interior of the simplex , ri ( 4K−1 ) : = { y ∈ 4K−1 | supp ( y ) = [ K ] } . 2.1 TRANSFORMATIONS FROM RK TO 4K−1 . In many situations , there is a need to convert a vector of real numbers z ∈ RK ( scores for the several symbols , often called logits ) into a probability vector y ∈ 4K−1 . The most common choice is the softmax transformation ( Bridle , 1990 ) : y = softmax ( z ) ∝ exp ( z ) . Since the exponential function is strictly positive , softmax reaches only the relative interior ri ( 4K−1 ) , that is , it never returns a sparse probability vector . To encourage more peaked distributions ( but never sparse ) it is common to use a temperature parameter β > 0 , by defining softmaxβ ( z ) : = softmax ( β−1z ) . The limit case β → 0+ corresponds to the indicator vector for the argmax , which returns a one-hot distribution indicating the symbol with the largest score . While the softmax transformation is differentiable ( hence permitting end-to-end training with the gradient backpropagation algorithm ) , the argmax function has zero gradients almost everywhere . With small temperatures , numerical issues are common . A direct sparse probability mapping is sparsemax ( Martins & Astudillo , 2016 ) , the Euclidean projection onto the simplex : sparsemax ( z ) : = arg miny∈4K−1 ‖y−z‖ . Unlike softmax , sparsemax reaches the full simplex4K−1 , including the boundary , often returning a sparse vector y , without sacrificing differentiability almost everywhere . With K = 2 and parametrizing z = ( z , 1 − z ) , sparsemax becomes a “ hard sigmoid , ” [ sparsemax ( ( z , 1 − z ) ) ] 1 = max { 0 , min { 1 , z } } . We will come back to this point in §3.3 . Other sparse transformations include α-entmax ( Peters et al. , 2019 ; Blondel et al. , 2020 ) , top-k softmax ( Fan et al. , 2018 ; Radford et al. , 2019 ) , and others ( Laha et al. , 2018 ; Sensoy et al. , 2018 ; Kong et al. , 2020 ; Itkina et al. , 2020 ) . 2.2 DENSITIES OVER THE SIMPLEX . Let us now switch from deterministic to stochastic maps . Denote by Y a r.v . taking on values in the simplex4K−1 with probability density function pY ( y ) . The density of a Dirichlet r.v . Y ∼ Dir ( α ) , with α ∈ RK > 0 is pY ( y ; α ) ∝ ∏K k=1 y αk−1 k . Sampling from a Dirichlet produces a point in ri ( 4K−1 ) , and , although a Dirichlet can assign high density to y close to the boundary of the simplex when α < 1 , a Dirichlet sample can never be sparse . A Logistic-Normal r.v . ( Atchison & Shen , 1980 ) , also known as Gaussian-Softmax by analogy to other distributions to be presented , is given by the softmax-projection of a multivariate Gaussian r.v . with mean z and covariance Σ : Y = softmax ( z + Σ 1 2N ) with Nk ∼ N ( 0 , 1 ) . Since the softmax is strictly positive , the Logistic-Normal places no probability mass to points in the boundary of4K−1 . A Concrete ( Maddison et al. , 2017 ) , or Gumbel-Softmax ( Jang et al. , 2017 ) , r.v . is given by the softmax-projection of K independent Gumbel r.vs. , each with mean zk : Y = softmaxβ ( z+G ) with Gk ∼ Gumbel ( 0 , 1 ) . Like in the previous cases , a Concrete draw is a point in ri ( 4K−1 ) . When the temperature β approaches zero , the softmax approaches the indicator for argmax and Y becomes closer to a categorical r.v . ( Luce , 1959 ; Papandreou & Yuille , 2011 ) . Thus , a Concrete r.v . can be seen as a continuous relaxation of a categorical . 2.3 TRUNCATED UNIVARIATE DENSITIES . Binary Hard Concrete . For K = 2 , a point in the simplex can be represented as y = ( y , 1− y ) and the simplex is isomorphic to the unit interval,41 ' [ 0 , 1 ] . For this binary case , Louizos et al . ( 2018 ) proposed a Hard Concrete distribution which stretches the Concrete and applies a hard sigmoid transformation ( which equals the sparsemax with K = 2 , per §2.1 ) as a way of placing point masses at 0 and 1 . These “ stretch-and-rectify ” techniques enable assigning probability mass to the boundary of41 and are similar in spirit to the spike-and-slab feature selection method ( Mitchell & Beauchamp , 1988 ; Ishwaran et al. , 2005 ) and for sparse codes in variational auto-encoders ( Rolfe , 2017 ; Vahdat et al. , 2018 ) . We propose in §3.3 a more general extension to K ≥ 2 . Rectified Gaussian . Rectification can be applied to other continuous distributions . A simple choice is the Gaussian distribution , to which one-sided ( Hinton & Ghahramani , 1997 ) and two-sided rectifications ( Palmer et al. , 2017 ) have been proposed . Two-sided rectification yields a mixed r.v . in [ 0 , 1 ] . Writing y = ( y , 1− y ) and z = ( z , 1− z ) , this distribution has the following density : pY ( y ) = N ( y ; z , σ2 ) + 1− erf ( z/ ( √ 2σ ) ) 2 δ0 ( y ) + 1 + erf ( ( z − 1 ) / ( √ 2σ ) ) 2 δ1 ( y ) , ( 1 ) where δs ( y ) is a Dirac delta density . Extending such distributions to the multivariate case is nontrivial . For K > 2 , a density expression with Diracs would be cumbersome , since it would require a combinatorial number of Diracs of several “ orders , ” depending on whether they are placed at a vertex , edge , face , etc . Another annoyance is that Dirac deltas have −∞ differential entropy , which prevents information-theoretic treatment . The next section shows how we can obtain densities that assign mass to the full simplex while avoiding Diracs , by making use of the face lattice and a new base measure . 3 FACE STRATIFICATION AND MIXED RANDOM VARIABLES . 3.1 THE FACE LATTICE . Let P be a convex polytope whose vertices are bit vectors ( i.e. , elements of { 0 , 1 } K ) . Examples are the probability simplex 4K−1 , the hypercube [ 0 , 1 ] K , and marginal polytopes of structured variables ( Wainwright & Jordan , 2008 ) . The combinatorial structure of a polytope is determined by its face lattice ( Ziegler , 1995 , §2.2 ) , which we now describe . A face of P is any intersection of P with a closed halfspace such that none of the interior points of P lie on the boundary of the halfspace ; we denote by F ( P ) the set of all faces of P and by F̄ ( P ) : = F ( P ) \ { ∅ } the set of proper faces . We denote by dim ( f ) the dimension of a face f ∈ F̄ ( P ) . Thus , the vertices of P are 0-dimensional faces , and P itself is a face of the same dimension as P , called the “ maximal face ” . Any other face of P can be regarded as a lower-dimensional polytope . The set F ( P ) has a partial order induced by set inclusion , that is , it is a partially ordered set ( poset ) , and more specifically a lattice . The full polytope P can be decomposed uniquely as the disjoint union of the relative interior of its faces , which we call face stratification : P = ⊔ f∈F̄ ( P ) ri ( f ) . For example , the simplex 42 is composed of its face ri ( 42 ) ( i.e. , excluding the boundary ) , three edges ( excluding the vertices in the corners ) , and three vertices ( the corners ) . This is represented schematically in Figure 2 . Likewise , the square [ 0 , 1 ] 2 is composed of its maximal face ( 0 , 1 ) 2 , four edges ( excluding the corners ) and four vertices ( the corners ) . The partition above implies that any subset A ⊆ P can be represented as a tuple A = ( Af ) f∈F̄ ( P ) , where Af = A ∩ ri ( f ) ; and the sets Af are all disjoint . | This paper proposes mixed distributions over convex polytopes such as the probability simplex. The proposed distributions are a discrete mixture over the faces of the polytope of "continuous" distributions on the corresponding face (formally, absolutely continuous wrt the Lebesgue measure on the face). For example, for the 2-simplex there is a distribution over the triangle, over each edge, and over each vertex. The authors formalize the dominating measure of these distributions, which they call the direct sum measure (given by the mixture over the counting measure over faces and Lebesgue measures on the faces); and derive formulas for entropy and KL divergences between such distributions, as well as characterizing maximum-entropy distributions. | SP:1666661164a4d5b154c57819e472d3e7abb57841 |
Sparse Communication via Mixed Distributions | 1 INTRODUCTION . Historically , discrete and continuous domains have been considered separately in machine learning , information theory , and engineering applications : random variables ( r.v . ) and information sources are chosen to be either discrete or continuous , but not both ( Shannon , 1948 ) . In signal processing , one needs to opt between discrete ( digital ) and continuous ( analog ) communication , whereas analog signals can be converted into digital ones by means of sampling and quantization . Discrete latent variable models are appealing to facilitate learning with less supervision , to leverage prior knowledge , and to build more compact and interpretable models . However , training such models is challenging due to the need to evaluate a large or combinatorial expectation . Existing strategies include the score function estimator ( Williams , 1992 ; Mnih & Gregor , 2014 ) , pathwise gradients ( Kingma & Welling , 2014 ) combined with a continuous relaxation of the latent variables ( such as the Concrete distribution , Maddison et al . ( 2017 ) ; Jang et al . ( 2017 ) ) , and sparse parametrizations ( Correia et al. , 2020 ) . Pathwise gradients , in particular , require continuous approximations of quantities that are inherently discrete , sometimes requiring proxy gradients ( Jang et al. , 2017 ; Maddison et al. , 2017 ) , sometimes giving the r.v . different treatment in different terms of the same objective ( Jang et al. , 2017 ) , sometimes creating a discrete-continuous hybrid ( Louizos et al. , 2018 ) . Since discrete variables and their continuous relaxations are so prevalent , they deserve a rigorous mathematical study . Throughout , we will use the name mixed variable to denote a hybrid variable that takes on both discrete and continuous outcomes . This work takes a first step into a rigorous study of mixed variables and their properties . We will call communication through mixed variables sparse communication : its goal is to retain the advantages of differentiable computation but still be able to represent and approximate discrete symbols . Our main contributions are : • We provide a direct sum measure as an alternative to the Lebesgue and counting measures used for continuous and discrete variables , respectively ( Halmos , 2013 ) . The direct sum measure hinges on a face lattice stratification of polytopes , including the probability simplex , avoiding the need for Dirac densities when expressing densities with point masses in the boundary of the simplex ( §3 ) . • We use the direct sum measure to formally defineK th-dimensional mixed random variables . We provide extrinsic ( “ sample-and-project ” ) and intrinsic ( based on face stratification ) characterizations of these variables , leading to several new distributions : the K-D Hard Concrete , the GaussianSparsemax , and the Mixed Dirichlet ( summarized in Table 1 ) . See Figure 1 for an illustration . • We propose a new direct sum entropy and Kullback-Leibler divergence , which decompose as a sum of discrete and continuous ( differential ) entropies/divergences . We provide an interpretation in terms of optimal code length , and we derive an expression for the maximum entropy ( §4 ) . • We illustrate the usefulness of our framework by learning mixed latent variable models in an emergent communication task and with VAEs to model Fashion-MNIST and MNIST data ( §5 ) . 2 BACKGROUND . We assume throughout an alphabet with K ≥ 2 symbols , denoted [ K ] = { 1 , . . . , K } . Symbols can be encoded as one-hot vectors ek . RK denotes the K-dimensional Euclidean space , RK > 0 its strictly positive orthant , and4K−1 ⊆ RK the probability simplex,4K−1 : = { y ∈ RK | y ≥ 0 , 1 > y = 1 } , with vertices { e1 , . . . , eK } . Each y ∈ 4K−1 can be seen as a vector of probabilities for the K symbols , parametrizing a categorical distribution over [ K ] . The support of y ∈ 4K−1 is the set of nonzero-probability symbols supp ( y ) : = { k ∈ [ K ] | yk > 0 } . The set of full-support categoricals corresponds to the relative interior of the simplex , ri ( 4K−1 ) : = { y ∈ 4K−1 | supp ( y ) = [ K ] } . 2.1 TRANSFORMATIONS FROM RK TO 4K−1 . In many situations , there is a need to convert a vector of real numbers z ∈ RK ( scores for the several symbols , often called logits ) into a probability vector y ∈ 4K−1 . The most common choice is the softmax transformation ( Bridle , 1990 ) : y = softmax ( z ) ∝ exp ( z ) . Since the exponential function is strictly positive , softmax reaches only the relative interior ri ( 4K−1 ) , that is , it never returns a sparse probability vector . To encourage more peaked distributions ( but never sparse ) it is common to use a temperature parameter β > 0 , by defining softmaxβ ( z ) : = softmax ( β−1z ) . The limit case β → 0+ corresponds to the indicator vector for the argmax , which returns a one-hot distribution indicating the symbol with the largest score . While the softmax transformation is differentiable ( hence permitting end-to-end training with the gradient backpropagation algorithm ) , the argmax function has zero gradients almost everywhere . With small temperatures , numerical issues are common . A direct sparse probability mapping is sparsemax ( Martins & Astudillo , 2016 ) , the Euclidean projection onto the simplex : sparsemax ( z ) : = arg miny∈4K−1 ‖y−z‖ . Unlike softmax , sparsemax reaches the full simplex4K−1 , including the boundary , often returning a sparse vector y , without sacrificing differentiability almost everywhere . With K = 2 and parametrizing z = ( z , 1 − z ) , sparsemax becomes a “ hard sigmoid , ” [ sparsemax ( ( z , 1 − z ) ) ] 1 = max { 0 , min { 1 , z } } . We will come back to this point in §3.3 . Other sparse transformations include α-entmax ( Peters et al. , 2019 ; Blondel et al. , 2020 ) , top-k softmax ( Fan et al. , 2018 ; Radford et al. , 2019 ) , and others ( Laha et al. , 2018 ; Sensoy et al. , 2018 ; Kong et al. , 2020 ; Itkina et al. , 2020 ) . 2.2 DENSITIES OVER THE SIMPLEX . Let us now switch from deterministic to stochastic maps . Denote by Y a r.v . taking on values in the simplex4K−1 with probability density function pY ( y ) . The density of a Dirichlet r.v . Y ∼ Dir ( α ) , with α ∈ RK > 0 is pY ( y ; α ) ∝ ∏K k=1 y αk−1 k . Sampling from a Dirichlet produces a point in ri ( 4K−1 ) , and , although a Dirichlet can assign high density to y close to the boundary of the simplex when α < 1 , a Dirichlet sample can never be sparse . A Logistic-Normal r.v . ( Atchison & Shen , 1980 ) , also known as Gaussian-Softmax by analogy to other distributions to be presented , is given by the softmax-projection of a multivariate Gaussian r.v . with mean z and covariance Σ : Y = softmax ( z + Σ 1 2N ) with Nk ∼ N ( 0 , 1 ) . Since the softmax is strictly positive , the Logistic-Normal places no probability mass to points in the boundary of4K−1 . A Concrete ( Maddison et al. , 2017 ) , or Gumbel-Softmax ( Jang et al. , 2017 ) , r.v . is given by the softmax-projection of K independent Gumbel r.vs. , each with mean zk : Y = softmaxβ ( z+G ) with Gk ∼ Gumbel ( 0 , 1 ) . Like in the previous cases , a Concrete draw is a point in ri ( 4K−1 ) . When the temperature β approaches zero , the softmax approaches the indicator for argmax and Y becomes closer to a categorical r.v . ( Luce , 1959 ; Papandreou & Yuille , 2011 ) . Thus , a Concrete r.v . can be seen as a continuous relaxation of a categorical . 2.3 TRUNCATED UNIVARIATE DENSITIES . Binary Hard Concrete . For K = 2 , a point in the simplex can be represented as y = ( y , 1− y ) and the simplex is isomorphic to the unit interval,41 ' [ 0 , 1 ] . For this binary case , Louizos et al . ( 2018 ) proposed a Hard Concrete distribution which stretches the Concrete and applies a hard sigmoid transformation ( which equals the sparsemax with K = 2 , per §2.1 ) as a way of placing point masses at 0 and 1 . These “ stretch-and-rectify ” techniques enable assigning probability mass to the boundary of41 and are similar in spirit to the spike-and-slab feature selection method ( Mitchell & Beauchamp , 1988 ; Ishwaran et al. , 2005 ) and for sparse codes in variational auto-encoders ( Rolfe , 2017 ; Vahdat et al. , 2018 ) . We propose in §3.3 a more general extension to K ≥ 2 . Rectified Gaussian . Rectification can be applied to other continuous distributions . A simple choice is the Gaussian distribution , to which one-sided ( Hinton & Ghahramani , 1997 ) and two-sided rectifications ( Palmer et al. , 2017 ) have been proposed . Two-sided rectification yields a mixed r.v . in [ 0 , 1 ] . Writing y = ( y , 1− y ) and z = ( z , 1− z ) , this distribution has the following density : pY ( y ) = N ( y ; z , σ2 ) + 1− erf ( z/ ( √ 2σ ) ) 2 δ0 ( y ) + 1 + erf ( ( z − 1 ) / ( √ 2σ ) ) 2 δ1 ( y ) , ( 1 ) where δs ( y ) is a Dirac delta density . Extending such distributions to the multivariate case is nontrivial . For K > 2 , a density expression with Diracs would be cumbersome , since it would require a combinatorial number of Diracs of several “ orders , ” depending on whether they are placed at a vertex , edge , face , etc . Another annoyance is that Dirac deltas have −∞ differential entropy , which prevents information-theoretic treatment . The next section shows how we can obtain densities that assign mass to the full simplex while avoiding Diracs , by making use of the face lattice and a new base measure . 3 FACE STRATIFICATION AND MIXED RANDOM VARIABLES . 3.1 THE FACE LATTICE . Let P be a convex polytope whose vertices are bit vectors ( i.e. , elements of { 0 , 1 } K ) . Examples are the probability simplex 4K−1 , the hypercube [ 0 , 1 ] K , and marginal polytopes of structured variables ( Wainwright & Jordan , 2008 ) . The combinatorial structure of a polytope is determined by its face lattice ( Ziegler , 1995 , §2.2 ) , which we now describe . A face of P is any intersection of P with a closed halfspace such that none of the interior points of P lie on the boundary of the halfspace ; we denote by F ( P ) the set of all faces of P and by F̄ ( P ) : = F ( P ) \ { ∅ } the set of proper faces . We denote by dim ( f ) the dimension of a face f ∈ F̄ ( P ) . Thus , the vertices of P are 0-dimensional faces , and P itself is a face of the same dimension as P , called the “ maximal face ” . Any other face of P can be regarded as a lower-dimensional polytope . The set F ( P ) has a partial order induced by set inclusion , that is , it is a partially ordered set ( poset ) , and more specifically a lattice . The full polytope P can be decomposed uniquely as the disjoint union of the relative interior of its faces , which we call face stratification : P = ⊔ f∈F̄ ( P ) ri ( f ) . For example , the simplex 42 is composed of its face ri ( 42 ) ( i.e. , excluding the boundary ) , three edges ( excluding the vertices in the corners ) , and three vertices ( the corners ) . This is represented schematically in Figure 2 . Likewise , the square [ 0 , 1 ] 2 is composed of its maximal face ( 0 , 1 ) 2 , four edges ( excluding the corners ) and four vertices ( the corners ) . The partition above implies that any subset A ⊆ P can be represented as a tuple A = ( Af ) f∈F̄ ( P ) , where Af = A ∩ ri ( f ) ; and the sets Af are all disjoint . | In this paper, the authors build rigorous theoretical foundations for mixed random variables. They first define a natural measure for mixed random variables, which looks like a direct sum. Then they define the entropy and KL divergence based on the proposed measure. They also give two strategies for representing and sampling mixed random variables. At last, they conduct some experiments to illustrate the usefulness of their framework. | SP:1666661164a4d5b154c57819e472d3e7abb57841 |
Counterbalancing Teacher: Regularizing Batch Normalized Models for Robustness | Batch normalization ( BN ) is a ubiquitous technique for training deep neural networks that accelerates their convergence to reach higher accuracy . However , we demonstrate that BN comes with a fundamental drawback : it incentivizes the model to rely on frequent low-variance features that are highly specific to the training ( in-domain ) data , and thus fails to generalize to out-of-domain examples . In this work , we investigate this phenomenon by first showing that removing BN layers across a wide range of architectures leads to lower out-of-domain and corruption errors at the cost of higher in-domain error . We then propose the Counterbalancing Teacher ( CT ) method , which leverages a frozen copy of the same model without BN as a teacher to enforce the student network ’ s learning of robust representations by substantially adapting its weights through a consistency loss function . This regularization signal helps CT perform well in unforeseen data shifts , even without information from the target domain as in prior works . We theoretically show in an overparameterized linear regression setting why normalization leads a model ’ s reliance on such in-domain features , and empirically demonstrate the efficacy of CT by outperforming several methods on standard robustness benchmark datasets such as CIFAR-10-C , CIFAR-100-C , and VLCS . 1 INTRODUCTION . Batch normalization ( BN ) , a neural network layer that normalizes input features by aggregating batch statistics during training , is a key component for accelerating convergence in the modern deep learning toolbox ( Ioffe and Szegedy , 2015 ; Santurkar et al. , 2018 ; Bjorck et al. , 2018 ) . It plays a critical role in stabilizing training dynamics for large models optimized with stochastic gradient descent , and has since spurred a flurry of research in related modifications ( Ba et al. , 2016 ; Kingma and Ba , 2014 ) and its understanding ( Gitman and Ginsburg , 2017 ; Santurkar et al. , 2018 ; Luo et al. , 2018 ; Kohler et al. , 2018 ) . Despite its advantages , BN has recently been shown to be a source of vulnerability to adversarial perturbations ( Galloway et al. , 2019 ; Benz et al. , 2021 ) . In our work , we take this observation one step further and demonstrate that BN also compromises a model ’ s out-of-domain ( OOD ) generalization capabilities . Specifically , we demonstrate that normalization incentivizes the model to exploit highly predictive , low-variance features ( Geirhos et al. , 2018 ; 2020 ) , that lead to poor classification accuracy when the test environment differs from that of training . Given the widespread use and benefits of normalization , we desire a way to mitigate such drawbacks in models trained with BN . To better understand this phenomenon , we investigate the effect of normalization in over-parametrized regimes , where there exist multiple solutions and inductive bias ( e.g. , minimizing the norm of the weights ) significantly impacts the estimated parameters . Similar to recent work in the theory of deep learning ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ; Hastie et al. , 2019 ; Liang et al. , 2020 ) , we study the min-norm solution in over-parametrized linear regression . Without normalization , the inductive bias selects a model that fits training data and minimizes a fixed norm independent of data ; with normalization , the same inductive bias selects a model that minimizes a data-dependent norm , leading the model to rely more on low-variance features . While such highly predictive features yield better performance in-domain where the features do not vary significantly , they cause performance to plummet in OOD settings ( e.g . data corruptions or missing features ) . This is in direct contrast to models trained without BN that assign equal weight to all input features , which help to reduce their overfitting on the training set . Drawing inspiration from our observation and the knowledge distillation literature ( Hinton et al. , 2015 ; Romero et al. , 2014 ) , we propose a simple teacher-student model to combine the best of both worlds : we leverage features derived both from a network without BN ( teacher ) and its clone with BN ( student ) to learn representations that achieve high standard and robust accuracies . We incorporate a regularization term in the loss function which encourages the features learned from the student encoder to have similar statistics and structure to those learned from the teacher ; we name this model the Counterbalancing Teacher ( CT ) and show that it helps in achieving both higher robust and clean accuracy compared to a ( batch ) normalized model . In particular , CT retains good performance in OOD settings even without knowledge of statistics of the new domain . Our results mark a significant improvement over prior works , which have tackled similar problems by either : ( a ) modifying the statistics of a trained model ( Schneider et al. , 2020 ; Benz et al. , 2021 ) using privileged information from the target domain ; or ( b ) augmenting the training data using a set of predefined corruption functions ( Hendrycks et al. , 2019b ) . As recent studies ( Vasiljevic et al. , 2016 ; Geirhos et al. , 2018 ; Taghanaki et al. , 2020 ) show that such approaches often fail to generalize due to the tendency of neural networks to memorize data-specific properties , this motivates a shift towards developing models that are inherently robust , independent of data augmentation or input transformation . Empirically , we demonstrate that CT outperforms most existing data augmentation-based techniques and covariate shift adaption-based methods ( which require information from the test set ) on mean corruption error on CIFAR10-C and CIFAR100-C ( Hendrycks and Dietterich , 2019 ) , and achieves state-of-the-art performance in domain generalization on the VLCS dataset ( Torralba and Efros , 2011 ) . We further test CT on corrupted 3D point-cloud data ( Taghanaki et al. , 2020 ) and show it outperforms existing methods in terms of mean classification accuracy over multiple test sets . To the best of our knowledge , this is the first work to explore both theoretically and empirically why BN leads to a model ’ s over-reliance on frequent , low-variance features , which can adversely affect its performance on the downstream classification task . This is also the first work to present a robust representation learning framework for common input distortions without additional data augmentation strategies or information derived from the target domain . In summary , our contribution is threefold : 1 . We provide theoretical justifications for why normalization encourages a model to exploit low-variance features , and empirically evaluate how this behavior can adversely affect downstream classification accuracy . 2 . We propose CT , a representation learning approach demonstrating that regularizing representations of a batch-normalized network ( i.e. , student ) using those from an unnormalized copy ( i.e. , teacher ) can significantly improve a model ’ s robustness . 3 . We experimentally verify the robustness of the representations learned by CT to input distortions and domain shift on a variety of tasks and models . 2 PROBLEM STATEMENT AND ANALYSIS . We assume a supervised classification setting : given an input variable x ∈ X ⊆ Rd , and a set of corresponding labels y ∈ Y = { 1 , ... , k } , we aim to learn a classifier fζ : X −→ Y by minimizing the empirical risk : ζ = argmin ζ Ex , y∼pd ( x , y ) [ ` ( x , y ; ζ ) ] ≈ argmin ζ n∑ i=1 ` ( fζ ( xi ) , yi ) ( 1 ) Here pd ( x , y ) is the underlying joint distribution where the dataset D = { ( xi , yi ) } ni=1 is sampled from . In the following sections , we first discuss the effect of ( batch ) normalization on the solutions found in underspecified regimes , then elaborate on our approach to optimize the aforementioned empirical risk . In this context , we refer to a problem as underspecified or overparameterized when degrees of freedom of a model is larger than the number of training samples . 2.1 THE EFFECT OF NORMALIZATION IN OVERPARAMETRIZED REGIMES . Modern deep learning frameworks usually incorporate many parameters ( often larger than the number of training data points ) , which lead to underspecified regimes . In other words , many distinct solutions solve the problem equally i.e. , have the same training or even held-out loss ( D ’ Amour et al. , 2020 ) . In the underspecified regime , the inductive bias of the estimation procedure , such as choosing parameters with the minimum norm , significantly impacts the estimated parameters . In such regimes , we show that normalizing data incentivizes the model to rely on features with lower variance . We analyze the effect of normalization on the min-norm solution in overparametrized noiseless linear regression . This setup has been studied in many recent works for understanding some phenomena in deep networks ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ) . Let X ∈ Rn×d denote training examples and Y ∈ Rn denote their target . Considering that we are in an over parametrized regime ( d > n ) , there should be an equivalence class of solutions . We assume that the inductive bias of the model is to choose the min-norm solution ( the parameter with the minimum ` 2 norm ) . This is in line with the recent speculation that the inductive bias in deep networks tends to find a solution with minimum norm ( Gunasekar et al. , 2018 ) . One can show that the convergence point of gradient descent run on the least-squares loss is the min-norm solution . Without normalization , the model chooses the min-norm solution which fits the training data : ζ̂ = arg min ζ ‖ζ‖22 s.t . Xζ = Y . ( 2 ) Now we observe how normalization changes the estimated parameters . Let U be a diagonal matrix where Uii denotes the standard deviation of the ith feature . By normalization , we transform X to XU−1 ( for simplicity , we assume the mean of each feature is 0 , we can show that transforming points do not change the estimated parameter , see Appendix C.1 for details ) . In this case the model estimates β̂ as follows : β̂ = arg min β ‖β‖22 s.t . XU−1β = Y , ( 3 ) and since we normalize data points at the test time as well , the estimated parameter used for prediction at the test time is θ̂ = U−1β̂ . Substituting θ instead of U−1β ( thus Uθ = β ) , we can write the equal formulation of 3 as : θ̂ = arg min θ ‖Uθ‖22 s.t . Xθ = Y . ( 4 ) For the same equivalence class of solutions a model with normalization ( 4 ) chooses different parameters in comparison to a model without normalization ( 2 ) . In particular , 2 chooses an interpolant with a minimum data independent norm . On the other hand , 4 , chooses an interpolant with a minimum data-dependent norm , which incentives the model to assign higher weights to low variance features . Note that projection of θ̂ and ζ̂ is the same in column space of training points . Formally if Π = X > ( XX > ) −1X denote the column space of training points then Πθ̂ = Πζ̂ . However , their projections to the null space of training points ( I − Π ) are different . As a result as we have more data ( smaller null space ) , θ̂ and ζ̂ become closer , and converge when n > d. Our analysis hold for classification with max-margin , we only need to substitute Xθ = Y by Y Xθ ≥ 1 ( see Appendix C.2 for details ) . We conjecture that minimizing the data-dependent norm in each layer leads to reliance on low variance ( frequent ) features , which can result in a better in-domain generalization as these feature do not exhibit high variations . Nonetheless , in a new domain where some ( or all ) of the training-domain features are missing or altered ( e.g. , when there is some data-agnostic corruption such as Gaussian noise ) , 2 performs better as its inductive bias is data independent . How should we change the regularization such that it selects for a model that performs well both in- and out-of-domain ? Inspired by this analysis , we introduce a simple , yet powerful two-step approach that combines the normalized and unnormalized copies of the same network for robust representation learning . | The authors study the effects of BatchNorm layers on model robustness. They demonstrate that models trained with BatchNorm are likely to rely on low-variance features which are performant in-domain, but are not helpful for out of domain data. Leveraging this observation, they propose a student-teacher method (Counterbalancing Teacher) that creates a copy of the same model with all BatchNorm layers removed. The demonstrate that this leads to very competitive performance with other techniques for reducing the performance hit of out domain evaluation: self-supervised methods and data augmentation methods. | SP:abcfe9a58fa9d6b6ec47060ddf6fd5a5fff00338 |
Counterbalancing Teacher: Regularizing Batch Normalized Models for Robustness | Batch normalization ( BN ) is a ubiquitous technique for training deep neural networks that accelerates their convergence to reach higher accuracy . However , we demonstrate that BN comes with a fundamental drawback : it incentivizes the model to rely on frequent low-variance features that are highly specific to the training ( in-domain ) data , and thus fails to generalize to out-of-domain examples . In this work , we investigate this phenomenon by first showing that removing BN layers across a wide range of architectures leads to lower out-of-domain and corruption errors at the cost of higher in-domain error . We then propose the Counterbalancing Teacher ( CT ) method , which leverages a frozen copy of the same model without BN as a teacher to enforce the student network ’ s learning of robust representations by substantially adapting its weights through a consistency loss function . This regularization signal helps CT perform well in unforeseen data shifts , even without information from the target domain as in prior works . We theoretically show in an overparameterized linear regression setting why normalization leads a model ’ s reliance on such in-domain features , and empirically demonstrate the efficacy of CT by outperforming several methods on standard robustness benchmark datasets such as CIFAR-10-C , CIFAR-100-C , and VLCS . 1 INTRODUCTION . Batch normalization ( BN ) , a neural network layer that normalizes input features by aggregating batch statistics during training , is a key component for accelerating convergence in the modern deep learning toolbox ( Ioffe and Szegedy , 2015 ; Santurkar et al. , 2018 ; Bjorck et al. , 2018 ) . It plays a critical role in stabilizing training dynamics for large models optimized with stochastic gradient descent , and has since spurred a flurry of research in related modifications ( Ba et al. , 2016 ; Kingma and Ba , 2014 ) and its understanding ( Gitman and Ginsburg , 2017 ; Santurkar et al. , 2018 ; Luo et al. , 2018 ; Kohler et al. , 2018 ) . Despite its advantages , BN has recently been shown to be a source of vulnerability to adversarial perturbations ( Galloway et al. , 2019 ; Benz et al. , 2021 ) . In our work , we take this observation one step further and demonstrate that BN also compromises a model ’ s out-of-domain ( OOD ) generalization capabilities . Specifically , we demonstrate that normalization incentivizes the model to exploit highly predictive , low-variance features ( Geirhos et al. , 2018 ; 2020 ) , that lead to poor classification accuracy when the test environment differs from that of training . Given the widespread use and benefits of normalization , we desire a way to mitigate such drawbacks in models trained with BN . To better understand this phenomenon , we investigate the effect of normalization in over-parametrized regimes , where there exist multiple solutions and inductive bias ( e.g. , minimizing the norm of the weights ) significantly impacts the estimated parameters . Similar to recent work in the theory of deep learning ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ; Hastie et al. , 2019 ; Liang et al. , 2020 ) , we study the min-norm solution in over-parametrized linear regression . Without normalization , the inductive bias selects a model that fits training data and minimizes a fixed norm independent of data ; with normalization , the same inductive bias selects a model that minimizes a data-dependent norm , leading the model to rely more on low-variance features . While such highly predictive features yield better performance in-domain where the features do not vary significantly , they cause performance to plummet in OOD settings ( e.g . data corruptions or missing features ) . This is in direct contrast to models trained without BN that assign equal weight to all input features , which help to reduce their overfitting on the training set . Drawing inspiration from our observation and the knowledge distillation literature ( Hinton et al. , 2015 ; Romero et al. , 2014 ) , we propose a simple teacher-student model to combine the best of both worlds : we leverage features derived both from a network without BN ( teacher ) and its clone with BN ( student ) to learn representations that achieve high standard and robust accuracies . We incorporate a regularization term in the loss function which encourages the features learned from the student encoder to have similar statistics and structure to those learned from the teacher ; we name this model the Counterbalancing Teacher ( CT ) and show that it helps in achieving both higher robust and clean accuracy compared to a ( batch ) normalized model . In particular , CT retains good performance in OOD settings even without knowledge of statistics of the new domain . Our results mark a significant improvement over prior works , which have tackled similar problems by either : ( a ) modifying the statistics of a trained model ( Schneider et al. , 2020 ; Benz et al. , 2021 ) using privileged information from the target domain ; or ( b ) augmenting the training data using a set of predefined corruption functions ( Hendrycks et al. , 2019b ) . As recent studies ( Vasiljevic et al. , 2016 ; Geirhos et al. , 2018 ; Taghanaki et al. , 2020 ) show that such approaches often fail to generalize due to the tendency of neural networks to memorize data-specific properties , this motivates a shift towards developing models that are inherently robust , independent of data augmentation or input transformation . Empirically , we demonstrate that CT outperforms most existing data augmentation-based techniques and covariate shift adaption-based methods ( which require information from the test set ) on mean corruption error on CIFAR10-C and CIFAR100-C ( Hendrycks and Dietterich , 2019 ) , and achieves state-of-the-art performance in domain generalization on the VLCS dataset ( Torralba and Efros , 2011 ) . We further test CT on corrupted 3D point-cloud data ( Taghanaki et al. , 2020 ) and show it outperforms existing methods in terms of mean classification accuracy over multiple test sets . To the best of our knowledge , this is the first work to explore both theoretically and empirically why BN leads to a model ’ s over-reliance on frequent , low-variance features , which can adversely affect its performance on the downstream classification task . This is also the first work to present a robust representation learning framework for common input distortions without additional data augmentation strategies or information derived from the target domain . In summary , our contribution is threefold : 1 . We provide theoretical justifications for why normalization encourages a model to exploit low-variance features , and empirically evaluate how this behavior can adversely affect downstream classification accuracy . 2 . We propose CT , a representation learning approach demonstrating that regularizing representations of a batch-normalized network ( i.e. , student ) using those from an unnormalized copy ( i.e. , teacher ) can significantly improve a model ’ s robustness . 3 . We experimentally verify the robustness of the representations learned by CT to input distortions and domain shift on a variety of tasks and models . 2 PROBLEM STATEMENT AND ANALYSIS . We assume a supervised classification setting : given an input variable x ∈ X ⊆ Rd , and a set of corresponding labels y ∈ Y = { 1 , ... , k } , we aim to learn a classifier fζ : X −→ Y by minimizing the empirical risk : ζ = argmin ζ Ex , y∼pd ( x , y ) [ ` ( x , y ; ζ ) ] ≈ argmin ζ n∑ i=1 ` ( fζ ( xi ) , yi ) ( 1 ) Here pd ( x , y ) is the underlying joint distribution where the dataset D = { ( xi , yi ) } ni=1 is sampled from . In the following sections , we first discuss the effect of ( batch ) normalization on the solutions found in underspecified regimes , then elaborate on our approach to optimize the aforementioned empirical risk . In this context , we refer to a problem as underspecified or overparameterized when degrees of freedom of a model is larger than the number of training samples . 2.1 THE EFFECT OF NORMALIZATION IN OVERPARAMETRIZED REGIMES . Modern deep learning frameworks usually incorporate many parameters ( often larger than the number of training data points ) , which lead to underspecified regimes . In other words , many distinct solutions solve the problem equally i.e. , have the same training or even held-out loss ( D ’ Amour et al. , 2020 ) . In the underspecified regime , the inductive bias of the estimation procedure , such as choosing parameters with the minimum norm , significantly impacts the estimated parameters . In such regimes , we show that normalizing data incentivizes the model to rely on features with lower variance . We analyze the effect of normalization on the min-norm solution in overparametrized noiseless linear regression . This setup has been studied in many recent works for understanding some phenomena in deep networks ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ) . Let X ∈ Rn×d denote training examples and Y ∈ Rn denote their target . Considering that we are in an over parametrized regime ( d > n ) , there should be an equivalence class of solutions . We assume that the inductive bias of the model is to choose the min-norm solution ( the parameter with the minimum ` 2 norm ) . This is in line with the recent speculation that the inductive bias in deep networks tends to find a solution with minimum norm ( Gunasekar et al. , 2018 ) . One can show that the convergence point of gradient descent run on the least-squares loss is the min-norm solution . Without normalization , the model chooses the min-norm solution which fits the training data : ζ̂ = arg min ζ ‖ζ‖22 s.t . Xζ = Y . ( 2 ) Now we observe how normalization changes the estimated parameters . Let U be a diagonal matrix where Uii denotes the standard deviation of the ith feature . By normalization , we transform X to XU−1 ( for simplicity , we assume the mean of each feature is 0 , we can show that transforming points do not change the estimated parameter , see Appendix C.1 for details ) . In this case the model estimates β̂ as follows : β̂ = arg min β ‖β‖22 s.t . XU−1β = Y , ( 3 ) and since we normalize data points at the test time as well , the estimated parameter used for prediction at the test time is θ̂ = U−1β̂ . Substituting θ instead of U−1β ( thus Uθ = β ) , we can write the equal formulation of 3 as : θ̂ = arg min θ ‖Uθ‖22 s.t . Xθ = Y . ( 4 ) For the same equivalence class of solutions a model with normalization ( 4 ) chooses different parameters in comparison to a model without normalization ( 2 ) . In particular , 2 chooses an interpolant with a minimum data independent norm . On the other hand , 4 , chooses an interpolant with a minimum data-dependent norm , which incentives the model to assign higher weights to low variance features . Note that projection of θ̂ and ζ̂ is the same in column space of training points . Formally if Π = X > ( XX > ) −1X denote the column space of training points then Πθ̂ = Πζ̂ . However , their projections to the null space of training points ( I − Π ) are different . As a result as we have more data ( smaller null space ) , θ̂ and ζ̂ become closer , and converge when n > d. Our analysis hold for classification with max-margin , we only need to substitute Xθ = Y by Y Xθ ≥ 1 ( see Appendix C.2 for details ) . We conjecture that minimizing the data-dependent norm in each layer leads to reliance on low variance ( frequent ) features , which can result in a better in-domain generalization as these feature do not exhibit high variations . Nonetheless , in a new domain where some ( or all ) of the training-domain features are missing or altered ( e.g. , when there is some data-agnostic corruption such as Gaussian noise ) , 2 performs better as its inductive bias is data independent . How should we change the regularization such that it selects for a model that performs well both in- and out-of-domain ? Inspired by this analysis , we introduce a simple , yet powerful two-step approach that combines the normalized and unnormalized copies of the same network for robust representation learning . | The authors propose a new consistency loss for improving model robustness to common image corruptions. They use a student-teacher training setup where only the student network uses batch normalization at training time. Improvements are shown on small scale corruption datasets (CIFAR-C), a single domain generalization dataset (VLCS), and RobustPointSet. | SP:abcfe9a58fa9d6b6ec47060ddf6fd5a5fff00338 |
Counterbalancing Teacher: Regularizing Batch Normalized Models for Robustness | Batch normalization ( BN ) is a ubiquitous technique for training deep neural networks that accelerates their convergence to reach higher accuracy . However , we demonstrate that BN comes with a fundamental drawback : it incentivizes the model to rely on frequent low-variance features that are highly specific to the training ( in-domain ) data , and thus fails to generalize to out-of-domain examples . In this work , we investigate this phenomenon by first showing that removing BN layers across a wide range of architectures leads to lower out-of-domain and corruption errors at the cost of higher in-domain error . We then propose the Counterbalancing Teacher ( CT ) method , which leverages a frozen copy of the same model without BN as a teacher to enforce the student network ’ s learning of robust representations by substantially adapting its weights through a consistency loss function . This regularization signal helps CT perform well in unforeseen data shifts , even without information from the target domain as in prior works . We theoretically show in an overparameterized linear regression setting why normalization leads a model ’ s reliance on such in-domain features , and empirically demonstrate the efficacy of CT by outperforming several methods on standard robustness benchmark datasets such as CIFAR-10-C , CIFAR-100-C , and VLCS . 1 INTRODUCTION . Batch normalization ( BN ) , a neural network layer that normalizes input features by aggregating batch statistics during training , is a key component for accelerating convergence in the modern deep learning toolbox ( Ioffe and Szegedy , 2015 ; Santurkar et al. , 2018 ; Bjorck et al. , 2018 ) . It plays a critical role in stabilizing training dynamics for large models optimized with stochastic gradient descent , and has since spurred a flurry of research in related modifications ( Ba et al. , 2016 ; Kingma and Ba , 2014 ) and its understanding ( Gitman and Ginsburg , 2017 ; Santurkar et al. , 2018 ; Luo et al. , 2018 ; Kohler et al. , 2018 ) . Despite its advantages , BN has recently been shown to be a source of vulnerability to adversarial perturbations ( Galloway et al. , 2019 ; Benz et al. , 2021 ) . In our work , we take this observation one step further and demonstrate that BN also compromises a model ’ s out-of-domain ( OOD ) generalization capabilities . Specifically , we demonstrate that normalization incentivizes the model to exploit highly predictive , low-variance features ( Geirhos et al. , 2018 ; 2020 ) , that lead to poor classification accuracy when the test environment differs from that of training . Given the widespread use and benefits of normalization , we desire a way to mitigate such drawbacks in models trained with BN . To better understand this phenomenon , we investigate the effect of normalization in over-parametrized regimes , where there exist multiple solutions and inductive bias ( e.g. , minimizing the norm of the weights ) significantly impacts the estimated parameters . Similar to recent work in the theory of deep learning ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ; Hastie et al. , 2019 ; Liang et al. , 2020 ) , we study the min-norm solution in over-parametrized linear regression . Without normalization , the inductive bias selects a model that fits training data and minimizes a fixed norm independent of data ; with normalization , the same inductive bias selects a model that minimizes a data-dependent norm , leading the model to rely more on low-variance features . While such highly predictive features yield better performance in-domain where the features do not vary significantly , they cause performance to plummet in OOD settings ( e.g . data corruptions or missing features ) . This is in direct contrast to models trained without BN that assign equal weight to all input features , which help to reduce their overfitting on the training set . Drawing inspiration from our observation and the knowledge distillation literature ( Hinton et al. , 2015 ; Romero et al. , 2014 ) , we propose a simple teacher-student model to combine the best of both worlds : we leverage features derived both from a network without BN ( teacher ) and its clone with BN ( student ) to learn representations that achieve high standard and robust accuracies . We incorporate a regularization term in the loss function which encourages the features learned from the student encoder to have similar statistics and structure to those learned from the teacher ; we name this model the Counterbalancing Teacher ( CT ) and show that it helps in achieving both higher robust and clean accuracy compared to a ( batch ) normalized model . In particular , CT retains good performance in OOD settings even without knowledge of statistics of the new domain . Our results mark a significant improvement over prior works , which have tackled similar problems by either : ( a ) modifying the statistics of a trained model ( Schneider et al. , 2020 ; Benz et al. , 2021 ) using privileged information from the target domain ; or ( b ) augmenting the training data using a set of predefined corruption functions ( Hendrycks et al. , 2019b ) . As recent studies ( Vasiljevic et al. , 2016 ; Geirhos et al. , 2018 ; Taghanaki et al. , 2020 ) show that such approaches often fail to generalize due to the tendency of neural networks to memorize data-specific properties , this motivates a shift towards developing models that are inherently robust , independent of data augmentation or input transformation . Empirically , we demonstrate that CT outperforms most existing data augmentation-based techniques and covariate shift adaption-based methods ( which require information from the test set ) on mean corruption error on CIFAR10-C and CIFAR100-C ( Hendrycks and Dietterich , 2019 ) , and achieves state-of-the-art performance in domain generalization on the VLCS dataset ( Torralba and Efros , 2011 ) . We further test CT on corrupted 3D point-cloud data ( Taghanaki et al. , 2020 ) and show it outperforms existing methods in terms of mean classification accuracy over multiple test sets . To the best of our knowledge , this is the first work to explore both theoretically and empirically why BN leads to a model ’ s over-reliance on frequent , low-variance features , which can adversely affect its performance on the downstream classification task . This is also the first work to present a robust representation learning framework for common input distortions without additional data augmentation strategies or information derived from the target domain . In summary , our contribution is threefold : 1 . We provide theoretical justifications for why normalization encourages a model to exploit low-variance features , and empirically evaluate how this behavior can adversely affect downstream classification accuracy . 2 . We propose CT , a representation learning approach demonstrating that regularizing representations of a batch-normalized network ( i.e. , student ) using those from an unnormalized copy ( i.e. , teacher ) can significantly improve a model ’ s robustness . 3 . We experimentally verify the robustness of the representations learned by CT to input distortions and domain shift on a variety of tasks and models . 2 PROBLEM STATEMENT AND ANALYSIS . We assume a supervised classification setting : given an input variable x ∈ X ⊆ Rd , and a set of corresponding labels y ∈ Y = { 1 , ... , k } , we aim to learn a classifier fζ : X −→ Y by minimizing the empirical risk : ζ = argmin ζ Ex , y∼pd ( x , y ) [ ` ( x , y ; ζ ) ] ≈ argmin ζ n∑ i=1 ` ( fζ ( xi ) , yi ) ( 1 ) Here pd ( x , y ) is the underlying joint distribution where the dataset D = { ( xi , yi ) } ni=1 is sampled from . In the following sections , we first discuss the effect of ( batch ) normalization on the solutions found in underspecified regimes , then elaborate on our approach to optimize the aforementioned empirical risk . In this context , we refer to a problem as underspecified or overparameterized when degrees of freedom of a model is larger than the number of training samples . 2.1 THE EFFECT OF NORMALIZATION IN OVERPARAMETRIZED REGIMES . Modern deep learning frameworks usually incorporate many parameters ( often larger than the number of training data points ) , which lead to underspecified regimes . In other words , many distinct solutions solve the problem equally i.e. , have the same training or even held-out loss ( D ’ Amour et al. , 2020 ) . In the underspecified regime , the inductive bias of the estimation procedure , such as choosing parameters with the minimum norm , significantly impacts the estimated parameters . In such regimes , we show that normalizing data incentivizes the model to rely on features with lower variance . We analyze the effect of normalization on the min-norm solution in overparametrized noiseless linear regression . This setup has been studied in many recent works for understanding some phenomena in deep networks ( Khani and Liang , 2021 ; Raghunathan et al. , 2020 ; Nakkiran , 2019 ) . Let X ∈ Rn×d denote training examples and Y ∈ Rn denote their target . Considering that we are in an over parametrized regime ( d > n ) , there should be an equivalence class of solutions . We assume that the inductive bias of the model is to choose the min-norm solution ( the parameter with the minimum ` 2 norm ) . This is in line with the recent speculation that the inductive bias in deep networks tends to find a solution with minimum norm ( Gunasekar et al. , 2018 ) . One can show that the convergence point of gradient descent run on the least-squares loss is the min-norm solution . Without normalization , the model chooses the min-norm solution which fits the training data : ζ̂ = arg min ζ ‖ζ‖22 s.t . Xζ = Y . ( 2 ) Now we observe how normalization changes the estimated parameters . Let U be a diagonal matrix where Uii denotes the standard deviation of the ith feature . By normalization , we transform X to XU−1 ( for simplicity , we assume the mean of each feature is 0 , we can show that transforming points do not change the estimated parameter , see Appendix C.1 for details ) . In this case the model estimates β̂ as follows : β̂ = arg min β ‖β‖22 s.t . XU−1β = Y , ( 3 ) and since we normalize data points at the test time as well , the estimated parameter used for prediction at the test time is θ̂ = U−1β̂ . Substituting θ instead of U−1β ( thus Uθ = β ) , we can write the equal formulation of 3 as : θ̂ = arg min θ ‖Uθ‖22 s.t . Xθ = Y . ( 4 ) For the same equivalence class of solutions a model with normalization ( 4 ) chooses different parameters in comparison to a model without normalization ( 2 ) . In particular , 2 chooses an interpolant with a minimum data independent norm . On the other hand , 4 , chooses an interpolant with a minimum data-dependent norm , which incentives the model to assign higher weights to low variance features . Note that projection of θ̂ and ζ̂ is the same in column space of training points . Formally if Π = X > ( XX > ) −1X denote the column space of training points then Πθ̂ = Πζ̂ . However , their projections to the null space of training points ( I − Π ) are different . As a result as we have more data ( smaller null space ) , θ̂ and ζ̂ become closer , and converge when n > d. Our analysis hold for classification with max-margin , we only need to substitute Xθ = Y by Y Xθ ≥ 1 ( see Appendix C.2 for details ) . We conjecture that minimizing the data-dependent norm in each layer leads to reliance on low variance ( frequent ) features , which can result in a better in-domain generalization as these feature do not exhibit high variations . Nonetheless , in a new domain where some ( or all ) of the training-domain features are missing or altered ( e.g. , when there is some data-agnostic corruption such as Gaussian noise ) , 2 performs better as its inductive bias is data independent . How should we change the regularization such that it selects for a model that performs well both in- and out-of-domain ? Inspired by this analysis , we introduce a simple , yet powerful two-step approach that combines the normalized and unnormalized copies of the same network for robust representation learning . | The paper aims to address the problem of out-of-domain generalization with batch normalization layers. It first identifies the reliance on low-variance features in batch normalization, and proposes a counterbalancing teacher approach to distill from a BN-model to a non-BN model. Experiments verify the hypothesis of the paper and show that the proposed approach outperforms the various baselines on robustness to data corruption and domain generalization. The proposed approach is also evaluated on a 3D point cloud dataset. | SP:abcfe9a58fa9d6b6ec47060ddf6fd5a5fff00338 |
OntoProtein: Protein Pretraining With Gene Ontology Embedding | 1 INTRODUCTION . Protein science , the fundamental macromolecules governing biology and life itself , has led to remarkable advances in understanding the disease therapies and human health ( Vig et al . ( 2021 ) ) . As a sequence of amino acids , protein can be viewed precisely as a language , indicating that they may be modeled using neural networks that have been developed for natural language processing ( NLP ) . Recent self-supervised pre-trained protein language models ( PLMs ) such as ESM ( Rao et al . ( 2021b ) ) , ProteinBERT ( Brandes et al . ( 2021 ) ) , ProtTrans ( Elnaggar et al . ( 2020 ) ) which can learn powerful protein representations , have achieved promising results in understanding the structure and functionality of the protein . Yet existing PLMs for protein representation learning generally can not sufficiently capture the biology factual knowledge , which is crucial for many protein tasks but is usually sparse and has diverse and complex forms in sequence . By contrast , knowledge graphs ( KGs ) from gene ontology2 contain extensive biology structural facts , and knowledge embedding ( KE ) approaches ( Bordes et al . ( 2013 ) , Zheng et al . ( 2021 ) ) can efficiently embed them into continuous vectors of entities and relations . For example , as shown in Figure 1 , without knowing PEX5 has specific biological processes and cellular components , it ∗Equal contribution and shared co-first authorship . †Corresponding author . 1Code and datasets are available in https : //github.com/zjunlp/OntoProtein . 2http : //geneontology.org/ is challenging to recognize its interaction with other proteins . Furthermore , since protein ’ s shape determines its function , it is more convenient for models to identify protein ’ s functions with the prior knowledge of protein functions having similar shapes . Hence , considering rich knowledge can lead to better protein representation and benefits various biology applications , e.g. , protein contact prediction , protein function prediction , and protein-protein interaction prediction . However , different from knowledge-enhanced approaches in NLP ( Zhang et al . ( 2019b ) , Wang et al . ( 2021b ) , Wang et al . ( 2021a ) ) , protein sequence and gene ontology are two different types of data . Note that protein sequence is composed of amino acids while gene ontology is a knowledge graph with text description ; thus , severe issues of structured knowledge encoding and heterogeneous information fusion remain . In this paper , we take the first to propose protein pre-training with gene ontology embedding ( OntoProtein ) , which is the first general framework to integrate external knowledge graphs into protein pre-training . We propose a hybrid encoder to represent language text and protein sequence and introduce contrastive learning with knowledge-aware negative sampling to jointly optimize the knowledge graph and the protein sequence embedding during pre-training . For the KE objective , we encode the node descriptions ( go annotations ) as their corresponding entity embeddings and then optimize them following vanilla KE approaches ( Bordes et al . ( 2013 ) ) . We further leverage gene ontology of molecular function , cellular component , and biological process and introduce a knowledge-aware negative sampling method for the KE objective . For the MLM ( Mask Language Modeling ) objective , we follow the approach of existing protein pre-training approaches ( Rao et al . ( 2021b ) ) . OntoProtein has the following strengths : ( 1 ) OntoProtein inherits the strong ability of protein understanding from PLMs with the MLM object . ( 2 ) OntoProtein can integrate biology knowledge into protein representation with the supervision from KG by the KE object . ( 3 ) OntoProtein constitutes a model-agnostic method and is readily pluggable into a wide range of protein tasks without additional inference overhead since we do not modify model architecture but add new training objectives . For pre-training and evaluating OntoProtein , we need a knowledge graph with large-scale biology knowledge facts aligned with protein sequences . Therefore , we construct ProteinKG25 , which contains about 612,483 entities , 4,990,097 triples , and aligned node descriptions from GO annotations . To the best of our knowledge , it is the first large-scale KG dataset to facilitate protein pre-training . We deliver data splits for both the inductive and the transductive settings to promote future research . To summarize , our contribution is three-fold : ( 1 ) We propose OntoProtein , the first knowledgeenhanced protein pre-training approach that brings promising improvements to a wide range of protein tasks . ( 2 ) By contrastive learning with knowledge-aware sampling to jointly optimize knowledge and protein embedding , OntoProtein shows its effectiveness in widespread downstream tasks , including protein function prediction , protein-protein interaction prediction , contact prediction , and so on . ( 3 ) We construct and release the ProteinKG25 , a novel large-scale KG dataset , promoting the research on protein language pre-training . ( 4 ) We conduct extensive experiments in widespread protein tasks , including TAPE benchmark , protein-protein interaction prediction , and protein function prediction , which demonstrate the effectiveness of our proposed approach . 2 METHODOLOGIES . We begin to introduce our approach of protein pre-training with ontology embedding ( OntoProtein ) , as shown in Figure 2 . OntoProtein incorporates external knowledge from Gene Ontology ( Go ) into language representations by jointly optimizing two objectives . We will first introduce the hybrid encoder , masked protein modeling , and knowledge encoder , and then we will present the details of contrastive learning with knowledge-aware negative sampling . Finally , we will illustrate the overall pre-training objects . 2.1 HYBRID ENCODER . We first introduce the hybrid encoder to represent protein and GO knowledge . For the protein encoder , we use the pre-trained ProtBert from Elnaggar et al . ( 2020 ) . ProtBert is pre-trained using the BERT architecture with UniRef100 datasets . Compared to BERT Devlin et al . ( 2019 ) , ProtBert encodes amino acid sequences into token level or sentence level representations , which can be used for downstream protein tasks such as contacts prediction tasks . The encoder takes a protein sequence ofN tokens ( x1 , ... , xN ) as inputs , and computes contextualized amnio acid representationHiProtein and sequence representationHProtein via mean pooling . To bridge the gap between text and protein , we utilize affine transformation ( an extra linear layer ) to project those representation to the same space . We will discuss details of learning protein representation in Section Mask Protein Modeling . For the Go encoder , we leverage BERT ( Devlin et al . ( 2019 ) ) , a Transformer ( Vaswani et al . ( 2017 ) ) based text encoder for biological descriptions in Gene Ontology entities . The encoder takes a sequence of N tokens ( x1 , ... , xN ) as inputs , and computes contextualized representations HiGO ∈ RN×d through L layers of Transformer encoders . Finally , we obtain contextualized representations HGO for each sequence by pooling output using [ CLS ] token representation . Since the relations in Gene Ontology are important for representing the knowledge of biology features , thus , we utilize a relation encoder with the random initialization , and those embeddings of relations will be optimized and updated during pre-training . 2.2 KNOWLEDGE EMBEDDING . We leverage the knowledge embedding ( KE ) objective to obtain representations in the pre-training process since Gene Ontology is actually a factual knowledge graph . Similar to Bordes et al . ( 2013 ) , we use distributed representations to encode entities and relations . The knowledge graph here consists of lots of triples to describe relational facts . We define a triplet as ( h , r , t ) , where h and t are head and tail entities , r is the relation whose type usually is pre-defined in the schema3 . Note that there are two different types of nodes eGO and eprotein in our knowledge graph . eGO is denoted as nodes that exist in the gene ontology , such as molecular function or cellular component nodes , and eGO can be described by annotation texts . eprotein is the protein node that links to the gene ontology , and we also represent eprotein with amnio acids sequences . Concretely , the triplets in this knowledge graph can be divided into two groups , tripleGO2GO and tripleProtein2GO . To integrate multi-modal descriptions into the same semantic space and address the heterogeneous information fusion issue , we utilize hybrid encoders introduced in the previous Section . Note that protein encoder and GO encoder represent protein sequence and GO annotations separately . 2.3 MASKED PROTEIN MODELING . We use masked protein modeling to optimize protein representations . The masked protein modeling is similar to masked language modeling ( MLM ) . During model pre-training , we use a 15 % probability to mask each token ( amino acid ) and leverage a cross-entropy loss ` MLM to estimate these masked tokens . We initialize our model with the pre-trained model of ProtBert and regard ` MLM as one of the overall objectives of OntoProtein by jointly training KE ( knowledge embedding ) and MLM . Our approach is model-agnostic , and other pre-trained models can also be leveraged . 2.4 CONTRASTIVE LEARNING WITH KNOWLEDGE-AWARE NEGATIVE SAMPLING . Knowledge embedding ( KE ) is to learn low-dimensional representations for entities and relations , and contrastive estimation represents a scalable and effective method for inferring connectivity patterns . Note that a crucial aspect of contrastive learning approaches is the choice of corruption distribution that generates hard negative samples , which force the embedding model to learn discriminative representations and find critical characteristics of observed data . However , previous approaches either employ too simple corruption distributions , i.e. , uniform , yielding easy uninformative negatives , or sophisticated adversarial distributions with challenging optimization schemes . Thus , in this paper , we propose contrastive learning with knowledge-aware negative sampling , an inexpensive negative sampling strategy that utilizes the rich GO knowledge to sample negative samples . Formally , the KE objective can be defined as : ` KE = − log σ ( γ − d ( h , t ) ) − n∑ i=1 1 n log σ ( d ( h′i , t ′ i ) − γ ) ( 1 ) ( h′i , t ′ i ) is the negative sample , in which head or tail entities are random sampled to construct the corrupt triples . n is the number of negative samples , σ is the sigmoid function , and γ means the margin . d is the scoring function , and we use TransE ( Bordes et al . ( 2013 ) ) for simplicity , where dr ( h , t ) = ‖h+ r − t‖ ( 2 ) Specifically , we define triple sets and entity sets as T and E , all triplets are divided into two groups . If the head entity is protein node and the tail entity is GO node , we denote the triple as Tprotein−GO . Similarly , if head and tail entities are both GO nodes , we denote them as TGO−GO . As Gene Ontology describes the knowledge of the biological domain concerning three aspects , all entities in Gene Ontology belong to MFO ( Molecular Function ) , CCO ( Cellular Component ) , or BPO ( Biological Process ) . To avoid plain negative samples , for those TGO−GO triples , we sample triples by replacing entities with the same aspect ( MFO , CCO , BPO ) 4 . Finally , we define the negative triple sets T ′ and positive 3The schema of the knowledge graph can be found in Appendix A.1 4For Tprotein−GO triples , it is also intuitive to replace the proteins with their homologous proteins to gen- erate hard negative triples , and we leave this for future works . triple as ( h , r , t ) , the negative sampling process can be described as follows : T ′ GO−GO ( h , r , t ) = { ( h ′ , r , t ) | h′ ∈ E′ , h ∈ E′ } ∪ { ( h , r , t′ ) | t′ ∈ E′ , t ∈ E′ } T ′ Protein−GO ( h , r , t ) = { ( h , r , t ′ ) | t′ ∈ E′ } ( 3 ) where E′ ∈ { EMFO , ECCO , EBPO } , and we only replace the tail entities for TProtein−GO triples . | This paper introduces a method to enrich the representations that are learnt by protein language models with knowledge encapsulated in gene ontologies. To do so, it curates a knowledge graph (ProteinKG25) and applies existing methods in multi-relational data embedding (Bordes et al.) to jointly train knowledge embeddings and protein embeddings, with the objective to enhance the latter and subsequently improve the performance on various downstream tasks (namely TAPE benchmark, protein-protein interaction and protein function prediction). | SP:77778e484a96d96365964309d99007b6738a1503 |
OntoProtein: Protein Pretraining With Gene Ontology Embedding | 1 INTRODUCTION . Protein science , the fundamental macromolecules governing biology and life itself , has led to remarkable advances in understanding the disease therapies and human health ( Vig et al . ( 2021 ) ) . As a sequence of amino acids , protein can be viewed precisely as a language , indicating that they may be modeled using neural networks that have been developed for natural language processing ( NLP ) . Recent self-supervised pre-trained protein language models ( PLMs ) such as ESM ( Rao et al . ( 2021b ) ) , ProteinBERT ( Brandes et al . ( 2021 ) ) , ProtTrans ( Elnaggar et al . ( 2020 ) ) which can learn powerful protein representations , have achieved promising results in understanding the structure and functionality of the protein . Yet existing PLMs for protein representation learning generally can not sufficiently capture the biology factual knowledge , which is crucial for many protein tasks but is usually sparse and has diverse and complex forms in sequence . By contrast , knowledge graphs ( KGs ) from gene ontology2 contain extensive biology structural facts , and knowledge embedding ( KE ) approaches ( Bordes et al . ( 2013 ) , Zheng et al . ( 2021 ) ) can efficiently embed them into continuous vectors of entities and relations . For example , as shown in Figure 1 , without knowing PEX5 has specific biological processes and cellular components , it ∗Equal contribution and shared co-first authorship . †Corresponding author . 1Code and datasets are available in https : //github.com/zjunlp/OntoProtein . 2http : //geneontology.org/ is challenging to recognize its interaction with other proteins . Furthermore , since protein ’ s shape determines its function , it is more convenient for models to identify protein ’ s functions with the prior knowledge of protein functions having similar shapes . Hence , considering rich knowledge can lead to better protein representation and benefits various biology applications , e.g. , protein contact prediction , protein function prediction , and protein-protein interaction prediction . However , different from knowledge-enhanced approaches in NLP ( Zhang et al . ( 2019b ) , Wang et al . ( 2021b ) , Wang et al . ( 2021a ) ) , protein sequence and gene ontology are two different types of data . Note that protein sequence is composed of amino acids while gene ontology is a knowledge graph with text description ; thus , severe issues of structured knowledge encoding and heterogeneous information fusion remain . In this paper , we take the first to propose protein pre-training with gene ontology embedding ( OntoProtein ) , which is the first general framework to integrate external knowledge graphs into protein pre-training . We propose a hybrid encoder to represent language text and protein sequence and introduce contrastive learning with knowledge-aware negative sampling to jointly optimize the knowledge graph and the protein sequence embedding during pre-training . For the KE objective , we encode the node descriptions ( go annotations ) as their corresponding entity embeddings and then optimize them following vanilla KE approaches ( Bordes et al . ( 2013 ) ) . We further leverage gene ontology of molecular function , cellular component , and biological process and introduce a knowledge-aware negative sampling method for the KE objective . For the MLM ( Mask Language Modeling ) objective , we follow the approach of existing protein pre-training approaches ( Rao et al . ( 2021b ) ) . OntoProtein has the following strengths : ( 1 ) OntoProtein inherits the strong ability of protein understanding from PLMs with the MLM object . ( 2 ) OntoProtein can integrate biology knowledge into protein representation with the supervision from KG by the KE object . ( 3 ) OntoProtein constitutes a model-agnostic method and is readily pluggable into a wide range of protein tasks without additional inference overhead since we do not modify model architecture but add new training objectives . For pre-training and evaluating OntoProtein , we need a knowledge graph with large-scale biology knowledge facts aligned with protein sequences . Therefore , we construct ProteinKG25 , which contains about 612,483 entities , 4,990,097 triples , and aligned node descriptions from GO annotations . To the best of our knowledge , it is the first large-scale KG dataset to facilitate protein pre-training . We deliver data splits for both the inductive and the transductive settings to promote future research . To summarize , our contribution is three-fold : ( 1 ) We propose OntoProtein , the first knowledgeenhanced protein pre-training approach that brings promising improvements to a wide range of protein tasks . ( 2 ) By contrastive learning with knowledge-aware sampling to jointly optimize knowledge and protein embedding , OntoProtein shows its effectiveness in widespread downstream tasks , including protein function prediction , protein-protein interaction prediction , contact prediction , and so on . ( 3 ) We construct and release the ProteinKG25 , a novel large-scale KG dataset , promoting the research on protein language pre-training . ( 4 ) We conduct extensive experiments in widespread protein tasks , including TAPE benchmark , protein-protein interaction prediction , and protein function prediction , which demonstrate the effectiveness of our proposed approach . 2 METHODOLOGIES . We begin to introduce our approach of protein pre-training with ontology embedding ( OntoProtein ) , as shown in Figure 2 . OntoProtein incorporates external knowledge from Gene Ontology ( Go ) into language representations by jointly optimizing two objectives . We will first introduce the hybrid encoder , masked protein modeling , and knowledge encoder , and then we will present the details of contrastive learning with knowledge-aware negative sampling . Finally , we will illustrate the overall pre-training objects . 2.1 HYBRID ENCODER . We first introduce the hybrid encoder to represent protein and GO knowledge . For the protein encoder , we use the pre-trained ProtBert from Elnaggar et al . ( 2020 ) . ProtBert is pre-trained using the BERT architecture with UniRef100 datasets . Compared to BERT Devlin et al . ( 2019 ) , ProtBert encodes amino acid sequences into token level or sentence level representations , which can be used for downstream protein tasks such as contacts prediction tasks . The encoder takes a protein sequence ofN tokens ( x1 , ... , xN ) as inputs , and computes contextualized amnio acid representationHiProtein and sequence representationHProtein via mean pooling . To bridge the gap between text and protein , we utilize affine transformation ( an extra linear layer ) to project those representation to the same space . We will discuss details of learning protein representation in Section Mask Protein Modeling . For the Go encoder , we leverage BERT ( Devlin et al . ( 2019 ) ) , a Transformer ( Vaswani et al . ( 2017 ) ) based text encoder for biological descriptions in Gene Ontology entities . The encoder takes a sequence of N tokens ( x1 , ... , xN ) as inputs , and computes contextualized representations HiGO ∈ RN×d through L layers of Transformer encoders . Finally , we obtain contextualized representations HGO for each sequence by pooling output using [ CLS ] token representation . Since the relations in Gene Ontology are important for representing the knowledge of biology features , thus , we utilize a relation encoder with the random initialization , and those embeddings of relations will be optimized and updated during pre-training . 2.2 KNOWLEDGE EMBEDDING . We leverage the knowledge embedding ( KE ) objective to obtain representations in the pre-training process since Gene Ontology is actually a factual knowledge graph . Similar to Bordes et al . ( 2013 ) , we use distributed representations to encode entities and relations . The knowledge graph here consists of lots of triples to describe relational facts . We define a triplet as ( h , r , t ) , where h and t are head and tail entities , r is the relation whose type usually is pre-defined in the schema3 . Note that there are two different types of nodes eGO and eprotein in our knowledge graph . eGO is denoted as nodes that exist in the gene ontology , such as molecular function or cellular component nodes , and eGO can be described by annotation texts . eprotein is the protein node that links to the gene ontology , and we also represent eprotein with amnio acids sequences . Concretely , the triplets in this knowledge graph can be divided into two groups , tripleGO2GO and tripleProtein2GO . To integrate multi-modal descriptions into the same semantic space and address the heterogeneous information fusion issue , we utilize hybrid encoders introduced in the previous Section . Note that protein encoder and GO encoder represent protein sequence and GO annotations separately . 2.3 MASKED PROTEIN MODELING . We use masked protein modeling to optimize protein representations . The masked protein modeling is similar to masked language modeling ( MLM ) . During model pre-training , we use a 15 % probability to mask each token ( amino acid ) and leverage a cross-entropy loss ` MLM to estimate these masked tokens . We initialize our model with the pre-trained model of ProtBert and regard ` MLM as one of the overall objectives of OntoProtein by jointly training KE ( knowledge embedding ) and MLM . Our approach is model-agnostic , and other pre-trained models can also be leveraged . 2.4 CONTRASTIVE LEARNING WITH KNOWLEDGE-AWARE NEGATIVE SAMPLING . Knowledge embedding ( KE ) is to learn low-dimensional representations for entities and relations , and contrastive estimation represents a scalable and effective method for inferring connectivity patterns . Note that a crucial aspect of contrastive learning approaches is the choice of corruption distribution that generates hard negative samples , which force the embedding model to learn discriminative representations and find critical characteristics of observed data . However , previous approaches either employ too simple corruption distributions , i.e. , uniform , yielding easy uninformative negatives , or sophisticated adversarial distributions with challenging optimization schemes . Thus , in this paper , we propose contrastive learning with knowledge-aware negative sampling , an inexpensive negative sampling strategy that utilizes the rich GO knowledge to sample negative samples . Formally , the KE objective can be defined as : ` KE = − log σ ( γ − d ( h , t ) ) − n∑ i=1 1 n log σ ( d ( h′i , t ′ i ) − γ ) ( 1 ) ( h′i , t ′ i ) is the negative sample , in which head or tail entities are random sampled to construct the corrupt triples . n is the number of negative samples , σ is the sigmoid function , and γ means the margin . d is the scoring function , and we use TransE ( Bordes et al . ( 2013 ) ) for simplicity , where dr ( h , t ) = ‖h+ r − t‖ ( 2 ) Specifically , we define triple sets and entity sets as T and E , all triplets are divided into two groups . If the head entity is protein node and the tail entity is GO node , we denote the triple as Tprotein−GO . Similarly , if head and tail entities are both GO nodes , we denote them as TGO−GO . As Gene Ontology describes the knowledge of the biological domain concerning three aspects , all entities in Gene Ontology belong to MFO ( Molecular Function ) , CCO ( Cellular Component ) , or BPO ( Biological Process ) . To avoid plain negative samples , for those TGO−GO triples , we sample triples by replacing entities with the same aspect ( MFO , CCO , BPO ) 4 . Finally , we define the negative triple sets T ′ and positive 3The schema of the knowledge graph can be found in Appendix A.1 4For Tprotein−GO triples , it is also intuitive to replace the proteins with their homologous proteins to gen- erate hard negative triples , and we leave this for future works . triple as ( h , r , t ) , the negative sampling process can be described as follows : T ′ GO−GO ( h , r , t ) = { ( h ′ , r , t ) | h′ ∈ E′ , h ∈ E′ } ∪ { ( h , r , t′ ) | t′ ∈ E′ , t ∈ E′ } T ′ Protein−GO ( h , r , t ) = { ( h , r , t ′ ) | t′ ∈ E′ } ( 3 ) where E′ ∈ { EMFO , ECCO , EBPO } , and we only replace the tail entities for TProtein−GO triples . | This paper introduces OntoProtein a comprehensive pre-training framework for protein embedding with the knowledge of gene ontology (GO). More specifically, OntoProtein jointly optimizes on both masked Protein Model and Knowledge Graph Embedding model which results in knowledge-aware protein embedding for downstream applications including protein-protein interactions and protein GO association prediction. The authors also create a new benchmark of proteins with aligned annotations to facilitate the OntoProtein training. | SP:77778e484a96d96365964309d99007b6738a1503 |
OntoProtein: Protein Pretraining With Gene Ontology Embedding | 1 INTRODUCTION . Protein science , the fundamental macromolecules governing biology and life itself , has led to remarkable advances in understanding the disease therapies and human health ( Vig et al . ( 2021 ) ) . As a sequence of amino acids , protein can be viewed precisely as a language , indicating that they may be modeled using neural networks that have been developed for natural language processing ( NLP ) . Recent self-supervised pre-trained protein language models ( PLMs ) such as ESM ( Rao et al . ( 2021b ) ) , ProteinBERT ( Brandes et al . ( 2021 ) ) , ProtTrans ( Elnaggar et al . ( 2020 ) ) which can learn powerful protein representations , have achieved promising results in understanding the structure and functionality of the protein . Yet existing PLMs for protein representation learning generally can not sufficiently capture the biology factual knowledge , which is crucial for many protein tasks but is usually sparse and has diverse and complex forms in sequence . By contrast , knowledge graphs ( KGs ) from gene ontology2 contain extensive biology structural facts , and knowledge embedding ( KE ) approaches ( Bordes et al . ( 2013 ) , Zheng et al . ( 2021 ) ) can efficiently embed them into continuous vectors of entities and relations . For example , as shown in Figure 1 , without knowing PEX5 has specific biological processes and cellular components , it ∗Equal contribution and shared co-first authorship . †Corresponding author . 1Code and datasets are available in https : //github.com/zjunlp/OntoProtein . 2http : //geneontology.org/ is challenging to recognize its interaction with other proteins . Furthermore , since protein ’ s shape determines its function , it is more convenient for models to identify protein ’ s functions with the prior knowledge of protein functions having similar shapes . Hence , considering rich knowledge can lead to better protein representation and benefits various biology applications , e.g. , protein contact prediction , protein function prediction , and protein-protein interaction prediction . However , different from knowledge-enhanced approaches in NLP ( Zhang et al . ( 2019b ) , Wang et al . ( 2021b ) , Wang et al . ( 2021a ) ) , protein sequence and gene ontology are two different types of data . Note that protein sequence is composed of amino acids while gene ontology is a knowledge graph with text description ; thus , severe issues of structured knowledge encoding and heterogeneous information fusion remain . In this paper , we take the first to propose protein pre-training with gene ontology embedding ( OntoProtein ) , which is the first general framework to integrate external knowledge graphs into protein pre-training . We propose a hybrid encoder to represent language text and protein sequence and introduce contrastive learning with knowledge-aware negative sampling to jointly optimize the knowledge graph and the protein sequence embedding during pre-training . For the KE objective , we encode the node descriptions ( go annotations ) as their corresponding entity embeddings and then optimize them following vanilla KE approaches ( Bordes et al . ( 2013 ) ) . We further leverage gene ontology of molecular function , cellular component , and biological process and introduce a knowledge-aware negative sampling method for the KE objective . For the MLM ( Mask Language Modeling ) objective , we follow the approach of existing protein pre-training approaches ( Rao et al . ( 2021b ) ) . OntoProtein has the following strengths : ( 1 ) OntoProtein inherits the strong ability of protein understanding from PLMs with the MLM object . ( 2 ) OntoProtein can integrate biology knowledge into protein representation with the supervision from KG by the KE object . ( 3 ) OntoProtein constitutes a model-agnostic method and is readily pluggable into a wide range of protein tasks without additional inference overhead since we do not modify model architecture but add new training objectives . For pre-training and evaluating OntoProtein , we need a knowledge graph with large-scale biology knowledge facts aligned with protein sequences . Therefore , we construct ProteinKG25 , which contains about 612,483 entities , 4,990,097 triples , and aligned node descriptions from GO annotations . To the best of our knowledge , it is the first large-scale KG dataset to facilitate protein pre-training . We deliver data splits for both the inductive and the transductive settings to promote future research . To summarize , our contribution is three-fold : ( 1 ) We propose OntoProtein , the first knowledgeenhanced protein pre-training approach that brings promising improvements to a wide range of protein tasks . ( 2 ) By contrastive learning with knowledge-aware sampling to jointly optimize knowledge and protein embedding , OntoProtein shows its effectiveness in widespread downstream tasks , including protein function prediction , protein-protein interaction prediction , contact prediction , and so on . ( 3 ) We construct and release the ProteinKG25 , a novel large-scale KG dataset , promoting the research on protein language pre-training . ( 4 ) We conduct extensive experiments in widespread protein tasks , including TAPE benchmark , protein-protein interaction prediction , and protein function prediction , which demonstrate the effectiveness of our proposed approach . 2 METHODOLOGIES . We begin to introduce our approach of protein pre-training with ontology embedding ( OntoProtein ) , as shown in Figure 2 . OntoProtein incorporates external knowledge from Gene Ontology ( Go ) into language representations by jointly optimizing two objectives . We will first introduce the hybrid encoder , masked protein modeling , and knowledge encoder , and then we will present the details of contrastive learning with knowledge-aware negative sampling . Finally , we will illustrate the overall pre-training objects . 2.1 HYBRID ENCODER . We first introduce the hybrid encoder to represent protein and GO knowledge . For the protein encoder , we use the pre-trained ProtBert from Elnaggar et al . ( 2020 ) . ProtBert is pre-trained using the BERT architecture with UniRef100 datasets . Compared to BERT Devlin et al . ( 2019 ) , ProtBert encodes amino acid sequences into token level or sentence level representations , which can be used for downstream protein tasks such as contacts prediction tasks . The encoder takes a protein sequence ofN tokens ( x1 , ... , xN ) as inputs , and computes contextualized amnio acid representationHiProtein and sequence representationHProtein via mean pooling . To bridge the gap between text and protein , we utilize affine transformation ( an extra linear layer ) to project those representation to the same space . We will discuss details of learning protein representation in Section Mask Protein Modeling . For the Go encoder , we leverage BERT ( Devlin et al . ( 2019 ) ) , a Transformer ( Vaswani et al . ( 2017 ) ) based text encoder for biological descriptions in Gene Ontology entities . The encoder takes a sequence of N tokens ( x1 , ... , xN ) as inputs , and computes contextualized representations HiGO ∈ RN×d through L layers of Transformer encoders . Finally , we obtain contextualized representations HGO for each sequence by pooling output using [ CLS ] token representation . Since the relations in Gene Ontology are important for representing the knowledge of biology features , thus , we utilize a relation encoder with the random initialization , and those embeddings of relations will be optimized and updated during pre-training . 2.2 KNOWLEDGE EMBEDDING . We leverage the knowledge embedding ( KE ) objective to obtain representations in the pre-training process since Gene Ontology is actually a factual knowledge graph . Similar to Bordes et al . ( 2013 ) , we use distributed representations to encode entities and relations . The knowledge graph here consists of lots of triples to describe relational facts . We define a triplet as ( h , r , t ) , where h and t are head and tail entities , r is the relation whose type usually is pre-defined in the schema3 . Note that there are two different types of nodes eGO and eprotein in our knowledge graph . eGO is denoted as nodes that exist in the gene ontology , such as molecular function or cellular component nodes , and eGO can be described by annotation texts . eprotein is the protein node that links to the gene ontology , and we also represent eprotein with amnio acids sequences . Concretely , the triplets in this knowledge graph can be divided into two groups , tripleGO2GO and tripleProtein2GO . To integrate multi-modal descriptions into the same semantic space and address the heterogeneous information fusion issue , we utilize hybrid encoders introduced in the previous Section . Note that protein encoder and GO encoder represent protein sequence and GO annotations separately . 2.3 MASKED PROTEIN MODELING . We use masked protein modeling to optimize protein representations . The masked protein modeling is similar to masked language modeling ( MLM ) . During model pre-training , we use a 15 % probability to mask each token ( amino acid ) and leverage a cross-entropy loss ` MLM to estimate these masked tokens . We initialize our model with the pre-trained model of ProtBert and regard ` MLM as one of the overall objectives of OntoProtein by jointly training KE ( knowledge embedding ) and MLM . Our approach is model-agnostic , and other pre-trained models can also be leveraged . 2.4 CONTRASTIVE LEARNING WITH KNOWLEDGE-AWARE NEGATIVE SAMPLING . Knowledge embedding ( KE ) is to learn low-dimensional representations for entities and relations , and contrastive estimation represents a scalable and effective method for inferring connectivity patterns . Note that a crucial aspect of contrastive learning approaches is the choice of corruption distribution that generates hard negative samples , which force the embedding model to learn discriminative representations and find critical characteristics of observed data . However , previous approaches either employ too simple corruption distributions , i.e. , uniform , yielding easy uninformative negatives , or sophisticated adversarial distributions with challenging optimization schemes . Thus , in this paper , we propose contrastive learning with knowledge-aware negative sampling , an inexpensive negative sampling strategy that utilizes the rich GO knowledge to sample negative samples . Formally , the KE objective can be defined as : ` KE = − log σ ( γ − d ( h , t ) ) − n∑ i=1 1 n log σ ( d ( h′i , t ′ i ) − γ ) ( 1 ) ( h′i , t ′ i ) is the negative sample , in which head or tail entities are random sampled to construct the corrupt triples . n is the number of negative samples , σ is the sigmoid function , and γ means the margin . d is the scoring function , and we use TransE ( Bordes et al . ( 2013 ) ) for simplicity , where dr ( h , t ) = ‖h+ r − t‖ ( 2 ) Specifically , we define triple sets and entity sets as T and E , all triplets are divided into two groups . If the head entity is protein node and the tail entity is GO node , we denote the triple as Tprotein−GO . Similarly , if head and tail entities are both GO nodes , we denote them as TGO−GO . As Gene Ontology describes the knowledge of the biological domain concerning three aspects , all entities in Gene Ontology belong to MFO ( Molecular Function ) , CCO ( Cellular Component ) , or BPO ( Biological Process ) . To avoid plain negative samples , for those TGO−GO triples , we sample triples by replacing entities with the same aspect ( MFO , CCO , BPO ) 4 . Finally , we define the negative triple sets T ′ and positive 3The schema of the knowledge graph can be found in Appendix A.1 4For Tprotein−GO triples , it is also intuitive to replace the proteins with their homologous proteins to gen- erate hard negative triples , and we leave this for future works . triple as ( h , r , t ) , the negative sampling process can be described as follows : T ′ GO−GO ( h , r , t ) = { ( h ′ , r , t ) | h′ ∈ E′ , h ∈ E′ } ∪ { ( h , r , t′ ) | t′ ∈ E′ , t ∈ E′ } T ′ Protein−GO ( h , r , t ) = { ( h , r , t ′ ) | t′ ∈ E′ } ( 3 ) where E′ ∈ { EMFO , ECCO , EBPO } , and we only replace the tail entities for TProtein−GO triples . | This paper argues that informative biology knowledge in KGs can enhance protein representation with external knowledge. To show this, the author proposes a computational framework named OntoProtein that makes use of structure in Gene Ontology into protein pre-training models. This paper conducts various experiments to show the superiority of the proposed method and the benefits of the information of Gene Ontology. | SP:77778e484a96d96365964309d99007b6738a1503 |
Squeezing SGD Parallelization Performance in Distributed Training Using Delayed Averaging | √ K ) , the same as SGD . The performance evaluation demonstrates it en- ables a linear performance scale-up with the cluster size . 1 INTRODUCTION . Training deep learning models using data parallelism on a large-scale distributed cluster has become an effective method for deep learning model training . The enormous training data set allows a huge batch of training tasks on different data samples running in parallel . The pinnacle of this method reduces the training time of the benchmark ResNet-50 from days to a couple of minutes ( Goyal et al. , 2017 ; You et al. , 2017b ; Akiba et al. , 2017 ; You et al. , 2017a ; Ying et al. , 2018 ; Goodfellow et al. , 2016 ) . During Mini-batch stochastic gradient descent ( SGD ) , these workers have to halt , wait for the computed gradients aggregated from all of the workers and receive a weight update before starting the next batch . The wait time tends to worsen when the number of workers increases . As the workloads are spread over a larger cluster , the computation time is greatly shortened and the communication overheads take a larger portion of the overall cost . System designers address this concern by improving inter-chip connects with higher throughput and lower latency and refining network topology ( Li et al. , 2019 ) , such as NVIDIA DGX-1 ( NVI , 2017 ) and NVIDIA DGX-2 ( NVS , 2018 ) . Additional care has been given to reduce the intermediate steps that would increase communication latency . These methods effectively reduce the wait time during Mini-batch SGD on a large-scale distributed system ( Gau , 2019 ) . Communication efficient SGD algorithms ( Lin et al. , 2017 ; Wangni et al. , 2018 ; Alistarh et al. , 2018 ; Dean et al. , 2012 ; Recht et al. , 2011 ; Zhang et al. , 2015 ; Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) are proposed to reduce the communication requirements . A successfully modified SGD algorithm shows their convergence rates comparable to Mini-batch SGD through both theoretical analysis and experimental results . Another challenge is to demonstrate good performance evaluation results based on the common large distributed training system setups . A modern data center design prefers cost-efficient hardware blocks and a balanced configuration for the typical workloads ( Barroso et al. , 2018 ) . Under these workloads , hardware resources are utilized in a balanced fashion . A distributed training system works in the opposite manner . During forward/back propagations , the computing resources are fully used while the system inter-connects are completely idle . During SGD , the computing resources are mostly idle while the system interconnects are throttled at the peak throughputs . The performance of distributed training systems may be improved in addition to better hardware . That is , training workloads may be re-structured for balanced utilization of the hardware resources . Inspired by the modern system design practices , we propose DaSGD , a new SGD method , enabling SGD running parallelly with forward/back propagation and balanced utilization of the hardware resources . It replaces a Mini-batch SGD with Local SGD iterations . In a Local SGD ( Lin et al. , 2018 ; Wang & Joshi , 2018 ) , each worker evolves a local model by performing sequential SGD updates , before synchronizing by averaging models among the workers . DaSGD uses Local SGD to add weight synchronization points and allows weights to be updated between Local SGD iterations . Based on the network throughput and the model size , it schedules delayed model averaging for a defined number of Local SGD iterations , which allows workers to compute the next batch while the weights are transferred over a large distributed cluster . The theoretical analysis shows its convergence rate is O ( 1/ √ K ) , where K is the iteration step , same as Mini-batch SGD . The main contributions of this paper are the following . • We present DaSGD as an algorithm-system co-design method for a large-scale distributed training system . It enables designing a more balanced and better-utilized system , more than a new variant of the SGD algorithm . The discussions and analyses in this paper are organized around its equivalency to the traditional SGD and its benefit from the system design perspective . • We provide the theoretical analysis of its convergence rate . It shows the convergence rate at O ( 1/ √ K ) , the same as Mini-batch SGD . • Our experiments focus on the training progresses ( in terms of loss and accuracy ) at the epoch level . It shows DaSGD allows the training converges at the same rate of SGD epoch by epoch , which is a good indicator of statistical efficiency and the eventual time-toconvergence . The experiments also explore the proper ranges of these parameters . • A performance evaluation of real-life systems measures many performance issues in a system , such as the reduction algorithm , GPU interconnect topology and throughputs , network throughputs , which are out of the scope of our discussion . Instead , we abstract an analytical model from the key performance parameters of the system configuration and the training setup . The analytical model demonstrates DaSGD introduces a linear performance scale-up with the cluster size . 2 BACKGROUND . 2.1 STOCHASTIC GRADIENT DESCENT . Stochastic Gradient Descent ( SGD ) is the backbone of numerous deep learning algorithms ( Ghadimi & Lan , 2013 ) . Supervised deep learning demands massive training datasets . Training a deep learning model needs many epochs for training to converge . A variant of classic SGD , synchronous minibatch SGD ( Bottou , 2010 ) , has become the mainstream due to a faster convergence rate. , supported by prevalent machine learning frameworks , such as Tensorflow ( Abadi et al. , 2016 ) , Pytorch ( Paszke et al. , 2019 ) , MxNet ( Chen et al. , 2015 ) . Mini-batch SGD as a weight update process is shown in Eq . 1. xk+1 = xk − η B B∑ j=1 ∇F ( xk , s ( j ) k ) ( 1 ) where x ∈ Rd is the weight of a model , η is the learning rate , B is the batch size , S is the training dataset , s ( j ) k ⊂ S is a random sample , ∇F ( xk , s ( j ) k ) is the stochastic gradient given the sample s ( j ) k . From a system perspective , a distributed training system may compute a batch of gradients on several workers . At the end of a batch , a reduction operation is performed on the gradients on a worker first and a worker sends out only a copy of local averaged gradients . Further reductions are performed on gradients from different workers until a final copy of the averaging gradients is obtained . The above equation may be rewritten as xk+1 = xk − η M B∑ j=1 g ( xk , s ( j ) k ) ( 2 ) where M is the number of workers , g ( xk , s ( j ) k ) is the stochastic gradient that worker j aggregates locally for that batch . g ( xk , s ( j ) k ) = M B B M∑ i=1 ∇ ( xk , s ( i ) k ) ( 3 ) 2.2 COMMUNICATION EFFICIENT SGD ALGORITHMS . 2.2.1 ASYNCHRONOUS SGD . There are a few asynchronous training methods , such as Downpour SGD ( Dean et al. , 2012 ) , Hogwild ( Recht et al. , 2011 ) , Elastic Averaging SGD ( Zhang et al. , 2015 ) . In these models , every worker has its own copy of weights . A worker performs forward propagation and back propagation on its partition of samples , and then sends the calculated gradients asynchronously to a pool of parameter servers that manage a central copy of weights . The parameter servers update the central copy and then send the new weights asynchronously to each worker . While each worker communicates gradients at a different time and avoids congestions at worker inter-connects , the parameter servers might be a performance bottleneck . For non-convex problems , ASGD requires that the staleness of gradients is bounded ( Lian et al. , 2015 ) to match the convergence rate O ( 1/ √ K ) of synchronous SGD , where K denotes the total Iteration steps . 2.2.2 LOCAL SGD . Another set of methods targets at reducing the frequency of inter-worker communication and is called periodic averaging or Local SGD ( Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) . A worker performs SGD on its local copy of weights for τ times , where τ denotes the local iteration steps . After τ local updates , local copies are synchronously averaged across all workers globally . Several works suggested that Local SGD incurs the same convergence rate O ( 1/ √ K ) as SGD . The total number of steps to train a model remains similar but the total amount of inter-worker communication is reduced by τ times . This has a similar effect as training with a large batch size , where the number of synchronizations decreases with an increase of batch size . With Local SGD , SGD and forward/back propagations are still blocking while system resources are unbalanced . 3 DASGD . In this paper , we propose a new algorithm , called Local SGD with Delayed Averaging , DaSGD for short . It aggregates gradients and updates weights in a relaxed manner , which helps parallelize the computation of forward/backward propagation with two other execution components : the execution of global weight averaging and inter-worker data communication . Our algorithm was initially inspired by the Local SGD algorithm ( discussed in Section 2 ) . Although Local SGD was designed to reduce communication and synchronization overhead , it still involves a significant amount of communication overhead . To further decrease communication overhead , even to zero , the proposed algorithm exploits a delayed averaging approach that makes two novel improvements based on Local SGD . First , in order to merge remote weights by other workers with local in a deterministic way , DaSGD serializes forward propagations and back propagations for different samples . Second , workers start with local computations for the next local batch while waiting for the aggregation and synchronization of global weights . In this way , the global communication and synchronization overhead are hidden or overlapped by local computations at the cost of a delayed update of local weights . However , theoretically we will prove that the convergence rate is the same as Mini-batch SGD . Furthermore , DaSGD parameterizes the overlapping degree so that when a large training cluster requires a longer time to synchronize , a worker may perform more iterations of local computations . Fig . 1 illustrates the proposed algorithm by showing a wall-clock time diagram of 6 training iterations . There are 2 workers , dividing a batch into 2 local batches . Each worker computes 6 local batches . Each local batch contains Bl samples . Each worker maintains a local copy of model . According to Local SGD , for a local batch , each worker operates Bl forward/backward propagations and then updates the weights of its local model . After 3 local updates , a worker synchronizes local weights with the other workers , resulting in an AllReduce operation being generated to average the model weights . In Fig . 1 , all workers wait for , at local iteration 3 , the global synchronization to be finished and then start to operate on the next local batch each , in the scenario of Local SGD . DaSGD implements a key feature by imposing delay update on Local SGD . As shown in Fig . 1 , a worker , at local step 3 , broadcasts its local weights to the wild and then immediately starts to compute on the next local batch , without waiting for the global synchronization to be finished . Later , at local iteration 4 , the worker receives all the other workers ’ weights and then updates its local weights . This design very efficiently overlaps the communication of weights and forward/backward propagations of the next local batch . In DaSGD , we use τ to denote the number of local batches between two consecutive global synchronizations . Therefore , τ is a controlling parameter that quantifies the number of propagations between weight averaging globally . During the delay update , both local computation and the global communication of weights are executed in parallel . As long as communication time is no more than the computation time of d local iterations , the communication time can be hidden in the overall model training time . Careful tuning of d and τ can realize full parallelism of global averaging and local computations . Unlike Local SGD , τ does not have to be large , as it is not only used to reduce inter-worker communication overhead ( Lin et al. , 2017 ) . In the following part of this section , in order to compare the proposed algorithm and traditional SGDs , we start with the update framework of each algorithm , and then qualitatively analyze execution time . Finally , we discussed the updated rules and the convergence rate in detail . | This paper proposed DaSGD, an algorithm for large-scale large-batch training of deep neural networks. The algorithm combines Local SGD with delayed averaging steps to hide the communication overhead. However, workers still synchronize their forward/backward passes in each iteration. A convergence rate of O(1/sqrt(K)) to a stationary is provided for smooth non-convex objectives, with respect to the average parameter set across workers. Numerical experiments provided on CIFAR10 and some brief results on ImageNet-1k with a ResNet18 and a batch-size of 256. | SP:a877e201ec58163752f87c4447acfcf4e3061130 |
Squeezing SGD Parallelization Performance in Distributed Training Using Delayed Averaging | √ K ) , the same as SGD . The performance evaluation demonstrates it en- ables a linear performance scale-up with the cluster size . 1 INTRODUCTION . Training deep learning models using data parallelism on a large-scale distributed cluster has become an effective method for deep learning model training . The enormous training data set allows a huge batch of training tasks on different data samples running in parallel . The pinnacle of this method reduces the training time of the benchmark ResNet-50 from days to a couple of minutes ( Goyal et al. , 2017 ; You et al. , 2017b ; Akiba et al. , 2017 ; You et al. , 2017a ; Ying et al. , 2018 ; Goodfellow et al. , 2016 ) . During Mini-batch stochastic gradient descent ( SGD ) , these workers have to halt , wait for the computed gradients aggregated from all of the workers and receive a weight update before starting the next batch . The wait time tends to worsen when the number of workers increases . As the workloads are spread over a larger cluster , the computation time is greatly shortened and the communication overheads take a larger portion of the overall cost . System designers address this concern by improving inter-chip connects with higher throughput and lower latency and refining network topology ( Li et al. , 2019 ) , such as NVIDIA DGX-1 ( NVI , 2017 ) and NVIDIA DGX-2 ( NVS , 2018 ) . Additional care has been given to reduce the intermediate steps that would increase communication latency . These methods effectively reduce the wait time during Mini-batch SGD on a large-scale distributed system ( Gau , 2019 ) . Communication efficient SGD algorithms ( Lin et al. , 2017 ; Wangni et al. , 2018 ; Alistarh et al. , 2018 ; Dean et al. , 2012 ; Recht et al. , 2011 ; Zhang et al. , 2015 ; Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) are proposed to reduce the communication requirements . A successfully modified SGD algorithm shows their convergence rates comparable to Mini-batch SGD through both theoretical analysis and experimental results . Another challenge is to demonstrate good performance evaluation results based on the common large distributed training system setups . A modern data center design prefers cost-efficient hardware blocks and a balanced configuration for the typical workloads ( Barroso et al. , 2018 ) . Under these workloads , hardware resources are utilized in a balanced fashion . A distributed training system works in the opposite manner . During forward/back propagations , the computing resources are fully used while the system inter-connects are completely idle . During SGD , the computing resources are mostly idle while the system interconnects are throttled at the peak throughputs . The performance of distributed training systems may be improved in addition to better hardware . That is , training workloads may be re-structured for balanced utilization of the hardware resources . Inspired by the modern system design practices , we propose DaSGD , a new SGD method , enabling SGD running parallelly with forward/back propagation and balanced utilization of the hardware resources . It replaces a Mini-batch SGD with Local SGD iterations . In a Local SGD ( Lin et al. , 2018 ; Wang & Joshi , 2018 ) , each worker evolves a local model by performing sequential SGD updates , before synchronizing by averaging models among the workers . DaSGD uses Local SGD to add weight synchronization points and allows weights to be updated between Local SGD iterations . Based on the network throughput and the model size , it schedules delayed model averaging for a defined number of Local SGD iterations , which allows workers to compute the next batch while the weights are transferred over a large distributed cluster . The theoretical analysis shows its convergence rate is O ( 1/ √ K ) , where K is the iteration step , same as Mini-batch SGD . The main contributions of this paper are the following . • We present DaSGD as an algorithm-system co-design method for a large-scale distributed training system . It enables designing a more balanced and better-utilized system , more than a new variant of the SGD algorithm . The discussions and analyses in this paper are organized around its equivalency to the traditional SGD and its benefit from the system design perspective . • We provide the theoretical analysis of its convergence rate . It shows the convergence rate at O ( 1/ √ K ) , the same as Mini-batch SGD . • Our experiments focus on the training progresses ( in terms of loss and accuracy ) at the epoch level . It shows DaSGD allows the training converges at the same rate of SGD epoch by epoch , which is a good indicator of statistical efficiency and the eventual time-toconvergence . The experiments also explore the proper ranges of these parameters . • A performance evaluation of real-life systems measures many performance issues in a system , such as the reduction algorithm , GPU interconnect topology and throughputs , network throughputs , which are out of the scope of our discussion . Instead , we abstract an analytical model from the key performance parameters of the system configuration and the training setup . The analytical model demonstrates DaSGD introduces a linear performance scale-up with the cluster size . 2 BACKGROUND . 2.1 STOCHASTIC GRADIENT DESCENT . Stochastic Gradient Descent ( SGD ) is the backbone of numerous deep learning algorithms ( Ghadimi & Lan , 2013 ) . Supervised deep learning demands massive training datasets . Training a deep learning model needs many epochs for training to converge . A variant of classic SGD , synchronous minibatch SGD ( Bottou , 2010 ) , has become the mainstream due to a faster convergence rate. , supported by prevalent machine learning frameworks , such as Tensorflow ( Abadi et al. , 2016 ) , Pytorch ( Paszke et al. , 2019 ) , MxNet ( Chen et al. , 2015 ) . Mini-batch SGD as a weight update process is shown in Eq . 1. xk+1 = xk − η B B∑ j=1 ∇F ( xk , s ( j ) k ) ( 1 ) where x ∈ Rd is the weight of a model , η is the learning rate , B is the batch size , S is the training dataset , s ( j ) k ⊂ S is a random sample , ∇F ( xk , s ( j ) k ) is the stochastic gradient given the sample s ( j ) k . From a system perspective , a distributed training system may compute a batch of gradients on several workers . At the end of a batch , a reduction operation is performed on the gradients on a worker first and a worker sends out only a copy of local averaged gradients . Further reductions are performed on gradients from different workers until a final copy of the averaging gradients is obtained . The above equation may be rewritten as xk+1 = xk − η M B∑ j=1 g ( xk , s ( j ) k ) ( 2 ) where M is the number of workers , g ( xk , s ( j ) k ) is the stochastic gradient that worker j aggregates locally for that batch . g ( xk , s ( j ) k ) = M B B M∑ i=1 ∇ ( xk , s ( i ) k ) ( 3 ) 2.2 COMMUNICATION EFFICIENT SGD ALGORITHMS . 2.2.1 ASYNCHRONOUS SGD . There are a few asynchronous training methods , such as Downpour SGD ( Dean et al. , 2012 ) , Hogwild ( Recht et al. , 2011 ) , Elastic Averaging SGD ( Zhang et al. , 2015 ) . In these models , every worker has its own copy of weights . A worker performs forward propagation and back propagation on its partition of samples , and then sends the calculated gradients asynchronously to a pool of parameter servers that manage a central copy of weights . The parameter servers update the central copy and then send the new weights asynchronously to each worker . While each worker communicates gradients at a different time and avoids congestions at worker inter-connects , the parameter servers might be a performance bottleneck . For non-convex problems , ASGD requires that the staleness of gradients is bounded ( Lian et al. , 2015 ) to match the convergence rate O ( 1/ √ K ) of synchronous SGD , where K denotes the total Iteration steps . 2.2.2 LOCAL SGD . Another set of methods targets at reducing the frequency of inter-worker communication and is called periodic averaging or Local SGD ( Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) . A worker performs SGD on its local copy of weights for τ times , where τ denotes the local iteration steps . After τ local updates , local copies are synchronously averaged across all workers globally . Several works suggested that Local SGD incurs the same convergence rate O ( 1/ √ K ) as SGD . The total number of steps to train a model remains similar but the total amount of inter-worker communication is reduced by τ times . This has a similar effect as training with a large batch size , where the number of synchronizations decreases with an increase of batch size . With Local SGD , SGD and forward/back propagations are still blocking while system resources are unbalanced . 3 DASGD . In this paper , we propose a new algorithm , called Local SGD with Delayed Averaging , DaSGD for short . It aggregates gradients and updates weights in a relaxed manner , which helps parallelize the computation of forward/backward propagation with two other execution components : the execution of global weight averaging and inter-worker data communication . Our algorithm was initially inspired by the Local SGD algorithm ( discussed in Section 2 ) . Although Local SGD was designed to reduce communication and synchronization overhead , it still involves a significant amount of communication overhead . To further decrease communication overhead , even to zero , the proposed algorithm exploits a delayed averaging approach that makes two novel improvements based on Local SGD . First , in order to merge remote weights by other workers with local in a deterministic way , DaSGD serializes forward propagations and back propagations for different samples . Second , workers start with local computations for the next local batch while waiting for the aggregation and synchronization of global weights . In this way , the global communication and synchronization overhead are hidden or overlapped by local computations at the cost of a delayed update of local weights . However , theoretically we will prove that the convergence rate is the same as Mini-batch SGD . Furthermore , DaSGD parameterizes the overlapping degree so that when a large training cluster requires a longer time to synchronize , a worker may perform more iterations of local computations . Fig . 1 illustrates the proposed algorithm by showing a wall-clock time diagram of 6 training iterations . There are 2 workers , dividing a batch into 2 local batches . Each worker computes 6 local batches . Each local batch contains Bl samples . Each worker maintains a local copy of model . According to Local SGD , for a local batch , each worker operates Bl forward/backward propagations and then updates the weights of its local model . After 3 local updates , a worker synchronizes local weights with the other workers , resulting in an AllReduce operation being generated to average the model weights . In Fig . 1 , all workers wait for , at local iteration 3 , the global synchronization to be finished and then start to operate on the next local batch each , in the scenario of Local SGD . DaSGD implements a key feature by imposing delay update on Local SGD . As shown in Fig . 1 , a worker , at local step 3 , broadcasts its local weights to the wild and then immediately starts to compute on the next local batch , without waiting for the global synchronization to be finished . Later , at local iteration 4 , the worker receives all the other workers ’ weights and then updates its local weights . This design very efficiently overlaps the communication of weights and forward/backward propagations of the next local batch . In DaSGD , we use τ to denote the number of local batches between two consecutive global synchronizations . Therefore , τ is a controlling parameter that quantifies the number of propagations between weight averaging globally . During the delay update , both local computation and the global communication of weights are executed in parallel . As long as communication time is no more than the computation time of d local iterations , the communication time can be hidden in the overall model training time . Careful tuning of d and τ can realize full parallelism of global averaging and local computations . Unlike Local SGD , τ does not have to be large , as it is not only used to reduce inter-worker communication overhead ( Lin et al. , 2017 ) . In the following part of this section , in order to compare the proposed algorithm and traditional SGDs , we start with the update framework of each algorithm , and then qualitatively analyze execution time . Finally , we discussed the updated rules and the convergence rate in detail . | In this paper, the authors present DaSGD, which overlaps the computation and communication of distributed training. In a nutshell, the idea is to combine PipeSGD and local SGD, which totally makes sense. The experiment results show good performance. | SP:a877e201ec58163752f87c4447acfcf4e3061130 |
Squeezing SGD Parallelization Performance in Distributed Training Using Delayed Averaging | √ K ) , the same as SGD . The performance evaluation demonstrates it en- ables a linear performance scale-up with the cluster size . 1 INTRODUCTION . Training deep learning models using data parallelism on a large-scale distributed cluster has become an effective method for deep learning model training . The enormous training data set allows a huge batch of training tasks on different data samples running in parallel . The pinnacle of this method reduces the training time of the benchmark ResNet-50 from days to a couple of minutes ( Goyal et al. , 2017 ; You et al. , 2017b ; Akiba et al. , 2017 ; You et al. , 2017a ; Ying et al. , 2018 ; Goodfellow et al. , 2016 ) . During Mini-batch stochastic gradient descent ( SGD ) , these workers have to halt , wait for the computed gradients aggregated from all of the workers and receive a weight update before starting the next batch . The wait time tends to worsen when the number of workers increases . As the workloads are spread over a larger cluster , the computation time is greatly shortened and the communication overheads take a larger portion of the overall cost . System designers address this concern by improving inter-chip connects with higher throughput and lower latency and refining network topology ( Li et al. , 2019 ) , such as NVIDIA DGX-1 ( NVI , 2017 ) and NVIDIA DGX-2 ( NVS , 2018 ) . Additional care has been given to reduce the intermediate steps that would increase communication latency . These methods effectively reduce the wait time during Mini-batch SGD on a large-scale distributed system ( Gau , 2019 ) . Communication efficient SGD algorithms ( Lin et al. , 2017 ; Wangni et al. , 2018 ; Alistarh et al. , 2018 ; Dean et al. , 2012 ; Recht et al. , 2011 ; Zhang et al. , 2015 ; Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) are proposed to reduce the communication requirements . A successfully modified SGD algorithm shows their convergence rates comparable to Mini-batch SGD through both theoretical analysis and experimental results . Another challenge is to demonstrate good performance evaluation results based on the common large distributed training system setups . A modern data center design prefers cost-efficient hardware blocks and a balanced configuration for the typical workloads ( Barroso et al. , 2018 ) . Under these workloads , hardware resources are utilized in a balanced fashion . A distributed training system works in the opposite manner . During forward/back propagations , the computing resources are fully used while the system inter-connects are completely idle . During SGD , the computing resources are mostly idle while the system interconnects are throttled at the peak throughputs . The performance of distributed training systems may be improved in addition to better hardware . That is , training workloads may be re-structured for balanced utilization of the hardware resources . Inspired by the modern system design practices , we propose DaSGD , a new SGD method , enabling SGD running parallelly with forward/back propagation and balanced utilization of the hardware resources . It replaces a Mini-batch SGD with Local SGD iterations . In a Local SGD ( Lin et al. , 2018 ; Wang & Joshi , 2018 ) , each worker evolves a local model by performing sequential SGD updates , before synchronizing by averaging models among the workers . DaSGD uses Local SGD to add weight synchronization points and allows weights to be updated between Local SGD iterations . Based on the network throughput and the model size , it schedules delayed model averaging for a defined number of Local SGD iterations , which allows workers to compute the next batch while the weights are transferred over a large distributed cluster . The theoretical analysis shows its convergence rate is O ( 1/ √ K ) , where K is the iteration step , same as Mini-batch SGD . The main contributions of this paper are the following . • We present DaSGD as an algorithm-system co-design method for a large-scale distributed training system . It enables designing a more balanced and better-utilized system , more than a new variant of the SGD algorithm . The discussions and analyses in this paper are organized around its equivalency to the traditional SGD and its benefit from the system design perspective . • We provide the theoretical analysis of its convergence rate . It shows the convergence rate at O ( 1/ √ K ) , the same as Mini-batch SGD . • Our experiments focus on the training progresses ( in terms of loss and accuracy ) at the epoch level . It shows DaSGD allows the training converges at the same rate of SGD epoch by epoch , which is a good indicator of statistical efficiency and the eventual time-toconvergence . The experiments also explore the proper ranges of these parameters . • A performance evaluation of real-life systems measures many performance issues in a system , such as the reduction algorithm , GPU interconnect topology and throughputs , network throughputs , which are out of the scope of our discussion . Instead , we abstract an analytical model from the key performance parameters of the system configuration and the training setup . The analytical model demonstrates DaSGD introduces a linear performance scale-up with the cluster size . 2 BACKGROUND . 2.1 STOCHASTIC GRADIENT DESCENT . Stochastic Gradient Descent ( SGD ) is the backbone of numerous deep learning algorithms ( Ghadimi & Lan , 2013 ) . Supervised deep learning demands massive training datasets . Training a deep learning model needs many epochs for training to converge . A variant of classic SGD , synchronous minibatch SGD ( Bottou , 2010 ) , has become the mainstream due to a faster convergence rate. , supported by prevalent machine learning frameworks , such as Tensorflow ( Abadi et al. , 2016 ) , Pytorch ( Paszke et al. , 2019 ) , MxNet ( Chen et al. , 2015 ) . Mini-batch SGD as a weight update process is shown in Eq . 1. xk+1 = xk − η B B∑ j=1 ∇F ( xk , s ( j ) k ) ( 1 ) where x ∈ Rd is the weight of a model , η is the learning rate , B is the batch size , S is the training dataset , s ( j ) k ⊂ S is a random sample , ∇F ( xk , s ( j ) k ) is the stochastic gradient given the sample s ( j ) k . From a system perspective , a distributed training system may compute a batch of gradients on several workers . At the end of a batch , a reduction operation is performed on the gradients on a worker first and a worker sends out only a copy of local averaged gradients . Further reductions are performed on gradients from different workers until a final copy of the averaging gradients is obtained . The above equation may be rewritten as xk+1 = xk − η M B∑ j=1 g ( xk , s ( j ) k ) ( 2 ) where M is the number of workers , g ( xk , s ( j ) k ) is the stochastic gradient that worker j aggregates locally for that batch . g ( xk , s ( j ) k ) = M B B M∑ i=1 ∇ ( xk , s ( i ) k ) ( 3 ) 2.2 COMMUNICATION EFFICIENT SGD ALGORITHMS . 2.2.1 ASYNCHRONOUS SGD . There are a few asynchronous training methods , such as Downpour SGD ( Dean et al. , 2012 ) , Hogwild ( Recht et al. , 2011 ) , Elastic Averaging SGD ( Zhang et al. , 2015 ) . In these models , every worker has its own copy of weights . A worker performs forward propagation and back propagation on its partition of samples , and then sends the calculated gradients asynchronously to a pool of parameter servers that manage a central copy of weights . The parameter servers update the central copy and then send the new weights asynchronously to each worker . While each worker communicates gradients at a different time and avoids congestions at worker inter-connects , the parameter servers might be a performance bottleneck . For non-convex problems , ASGD requires that the staleness of gradients is bounded ( Lian et al. , 2015 ) to match the convergence rate O ( 1/ √ K ) of synchronous SGD , where K denotes the total Iteration steps . 2.2.2 LOCAL SGD . Another set of methods targets at reducing the frequency of inter-worker communication and is called periodic averaging or Local SGD ( Wang & Joshi , 2018 ; Wang & Joshi , 2018 ; Lin et al. , 2018 ) . A worker performs SGD on its local copy of weights for τ times , where τ denotes the local iteration steps . After τ local updates , local copies are synchronously averaged across all workers globally . Several works suggested that Local SGD incurs the same convergence rate O ( 1/ √ K ) as SGD . The total number of steps to train a model remains similar but the total amount of inter-worker communication is reduced by τ times . This has a similar effect as training with a large batch size , where the number of synchronizations decreases with an increase of batch size . With Local SGD , SGD and forward/back propagations are still blocking while system resources are unbalanced . 3 DASGD . In this paper , we propose a new algorithm , called Local SGD with Delayed Averaging , DaSGD for short . It aggregates gradients and updates weights in a relaxed manner , which helps parallelize the computation of forward/backward propagation with two other execution components : the execution of global weight averaging and inter-worker data communication . Our algorithm was initially inspired by the Local SGD algorithm ( discussed in Section 2 ) . Although Local SGD was designed to reduce communication and synchronization overhead , it still involves a significant amount of communication overhead . To further decrease communication overhead , even to zero , the proposed algorithm exploits a delayed averaging approach that makes two novel improvements based on Local SGD . First , in order to merge remote weights by other workers with local in a deterministic way , DaSGD serializes forward propagations and back propagations for different samples . Second , workers start with local computations for the next local batch while waiting for the aggregation and synchronization of global weights . In this way , the global communication and synchronization overhead are hidden or overlapped by local computations at the cost of a delayed update of local weights . However , theoretically we will prove that the convergence rate is the same as Mini-batch SGD . Furthermore , DaSGD parameterizes the overlapping degree so that when a large training cluster requires a longer time to synchronize , a worker may perform more iterations of local computations . Fig . 1 illustrates the proposed algorithm by showing a wall-clock time diagram of 6 training iterations . There are 2 workers , dividing a batch into 2 local batches . Each worker computes 6 local batches . Each local batch contains Bl samples . Each worker maintains a local copy of model . According to Local SGD , for a local batch , each worker operates Bl forward/backward propagations and then updates the weights of its local model . After 3 local updates , a worker synchronizes local weights with the other workers , resulting in an AllReduce operation being generated to average the model weights . In Fig . 1 , all workers wait for , at local iteration 3 , the global synchronization to be finished and then start to operate on the next local batch each , in the scenario of Local SGD . DaSGD implements a key feature by imposing delay update on Local SGD . As shown in Fig . 1 , a worker , at local step 3 , broadcasts its local weights to the wild and then immediately starts to compute on the next local batch , without waiting for the global synchronization to be finished . Later , at local iteration 4 , the worker receives all the other workers ’ weights and then updates its local weights . This design very efficiently overlaps the communication of weights and forward/backward propagations of the next local batch . In DaSGD , we use τ to denote the number of local batches between two consecutive global synchronizations . Therefore , τ is a controlling parameter that quantifies the number of propagations between weight averaging globally . During the delay update , both local computation and the global communication of weights are executed in parallel . As long as communication time is no more than the computation time of d local iterations , the communication time can be hidden in the overall model training time . Careful tuning of d and τ can realize full parallelism of global averaging and local computations . Unlike Local SGD , τ does not have to be large , as it is not only used to reduce inter-worker communication overhead ( Lin et al. , 2017 ) . In the following part of this section , in order to compare the proposed algorithm and traditional SGDs , we start with the update framework of each algorithm , and then qualitatively analyze execution time . Finally , we discussed the updated rules and the convergence rate in detail . | The paper proposes to combine local sgd with overlapped communication. A convergence analysis is given. The experiments validates the model performance. | SP:a877e201ec58163752f87c4447acfcf4e3061130 |
SOSP: Efficiently Capturing Global Correlations by Second-Order Structured Pruning | 1 INTRODUCTION . Deep neural networks have consistently grown in size over the last years with increasing performance . However , this increase in size leads to slower inference , higher computational requirements and higher cost . To reduce the size of the networks without affecting their performance , a large number of pruning algorithms have been proposed ( e.g. , LeCun et al. , 1990 ; Hassibi et al. , 1993 ; Reed , 1993 ; Han et al. , 2015 ; Blalock et al. , 2020 ) . Pruning can either be unstructured , i.e . removing individual weights , or structured , i.e . removing entire substructures like nodes or channels . Single-shot pruning methods , as investigated in this work , usually consist of three steps : 1 ) training , 2 ) pruning , 3 ) another training step often referred to as fine-tuning . Unstructured pruning can significantly reduce the number of parameters of a neural network with only little loss in the accuracy , but the resulting networks often show only a marginal improvement in training and inference time , unless specialized hardware is used ( He et al. , 2017 ) . In contrast , structured pruning can directly reduce inference time and even training time when applied at initialization ( Lee et al. , 2018 ) . To exploit these advantages , in this work , we focus on structured pruning . Global pruning removes structure by structure from all available structures of a network until a predefined percentage of pruned structures is reached . Recent examples for global structured pruning methods are NN Slimming ( Liu et al. , 2017 ) , C-OBD and EigenDamage ( Wang et al. , 2019a ) . Local pruning , on the other hand , first subdivides all global structures into subsets ( e.g . layers ) and removes a percentage of structures of each subset . Recent examples for local pruning methods are HRank ( Lin et al. , 2019 ) , CCP ( Peng et al. , 2019 ) , FPGM ( He et al. , 2019 ) and Variational Pruning ( Zhao et al. , 2019 ) . Most local pruning schemes use a predefined layer-wise pruning ratio , which fixes the percentage of structures removed per layer . While this prevents the layers from collapsing , it also reduces some of the degrees of freedom , since some layers may be less important than others . Other local pruning methods like AMC ( He et al. , 2018 ) learn the layer-wise pruning ratios in a first step . A key challenge for global saliency-based pruning is to find an objective which can be efficiently calculated to make the approach scalable to large-scale , modern neural networks . While second-order pruning methods are usually more accurate than first-order methods ( Molchanov et al. , 2019 ) , calculating the full second-order saliency objective is intractable for modern neural networks . Therefore , most saliency-based pruning methods such as OBD ( e.g. , LeCun et al. , 1990 ) or C-OBD ( Wang et al. , 2019a ) evaluate the effect of removing a single weight or structure on the loss of the neural network in isolation . However , this neglects possible correlations between different structures , which are captured by the off-diagonal second-order terms , and hence , can significantly harm the estimation of the sensitivities . Finding a global second-order method that both considers off-diagonal terms and scales to modern neural networks is still an unsolved research question . Our main goal in this work is to devise a simple and efficient second-order pruning method that considers all global correlations for structured sensitivity pruning . In addition , we want to highlight the benefits that such methods may have over other structured global and local pruning schemes . Our contributions are as follows : • We develop two novel saliency-based pruning methods for second-order structured pruning ( SOSP ) and analyze them theoretically . We show that both of our methods drastically improve on the complexity of a naive second-order approach , which is usually intractable for modern neural networks . Further , we show that our SOSP-H method , which is based on fast Hessian-vector products , has the same low complexity as first-order methods , while taking the full Hessian into account . • We compare the performance and the scaling of SOSP-H to that of SOSP-I , which is based on the well-known Gauss-Newton approximation . While both methods perform on par , SOSP-H shows better scaling . We then benchmark our SOSP methods against a variety of state-of-the-art pruning methods and show that they achieve comparable or better results at lower computational costs for pruning . • We exploit the structure of the pruning masks found by our SOSP methods to widen architectural bottlenecks , which further improves the performance of the pruned networks . We diagnose layers with disproportionally low pruning ratios as architectural bottlenecks . PyTorch code implementing our method will be published upon acceptance of this manuscript . Related work is discussed in the light of our results in the Discussion section ( Sec . 4 ) . 2 SOSP : SECOND-ORDER STRUCTURED PRUNING . A neural network ( NN ) maps an input x ∈ Rd to an output fθ ( x ) ∈ RD , where θ ∈ RP are its P parameters . NN training proceeds , after random initialization θ = θ0 of the weights , by minibatch stochastic gradient descent on the empirical loss L ( θ ) : = 1N ∑N n=1 ` ( fθ ( xn ) , yn ) , given the training dataset { ( x1 , y1 ) , . . . , ( xN , yN ) } . In the classification case , y ∈ { 1 , . . . , D } is a discrete ground-truth label and ` ( fθ ( x ) , y ) : = − log σ ( fθ ( x ) ) y the cross-entropy loss , with σ : RD → RD the softmax-function . For regression , y ∈ RD and ` ( fθ ( x ) , y ) = 12 ‖fθ ( x ) − y‖ 2 is the squared loss . Structured pruning aims to remove weights or rather entire structures from a NN fθ with parameters θ . A structure can be a filter ( channel ) in a convolutional layer , a neuron in a fully-connected layer , or an entire layer in a parallel architecture . We assume the NN in question has been segmented into S structures s = 1 , . . . , S , which can potentially be pruned . We define the notation θs ∈ RP as the vector whose only nonzero components are those weights from θ that belong to structure s.1 Then , a pruning mask is a set M = { s1 , . . . , sm } of structures , and applying a mask M to a NN fθ means to consider the NN with parameter vector θ\M : = θ − ∑ s∈M θs . We now develop our pruning methods that incorporate global correlations into their saliency assessment by efficiently including the second-order loss terms . Our method SOSP-I allows a direct interpretation in terms of individual loss sensitivities , while our main method SOSP-H remains very efficient for large-scale networks due to its Hessian-vector product approximation . 1We require that each weight is assigned to at most one structure . In practice , we associate with each structure those weights that go into the structure , rather than those that leave it . The basic idea behind both our pruning methods is to select the pruning mask M so as to ( approximately ) minimize the joint effect on the network loss λ ( M ) : = ∣∣L ( θ ) − L ( θ\M ) ∣∣ of removing all structures in M , subject to a constraint on the overall pruning ratio . To circumvent this exponentially large search space , we approximate the loss up to second order , so that λ2 ( M ) = ∣∣∣∣∣∣ ∑ s∈M θTs dL ( θ ) dθ − 1 2 ∑ s , s′∈M θTs d2L ( θ ) dθ dθT θs′ ∣∣∣∣∣∣ ( 1 ) collapses to single-structure contributions plus pairwise correlations . The first-order terms λ1 ( s ) : = θs ·dL ( θ ) /dθ in ( 1 ) are efficient to evaluate by computing the gradient dL ( θ ) /dθ ∈ RP once and then a ( sparse ) dot product for every s. In contrast , the network Hessian H ( θ ) : = d2L ( θ ) /dθ2 ∈ RP×P in ( 1 ) is prohibitively expensive to compute or store in full . We therefore propose two different schemes to efficiently overcome this obstacle . We name the full methods SOSP-I ( individual sensitivities ) and SOSP-H ( Hessian-vector product ) . 2.1 SOSP-I : SALIENCY FROM INDIVIDUAL SENSITIVITIES . SOSP-I approximates each individual term θTs H ( θ ) θs′ in ( 1 ) efficiently , as we will show in Eq . ( 5 ) . We will therefore consider an upper bound to Eq . ( 1 ) which measures all sensitivities individually : λI2 ( M ) = ∑ s∈M ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣+ 12 ∑ s , s′∈M ∣∣θTs H ( θ ) θs′ ∣∣ . ( 2 ) The absolute values are to prevent cancellations among the individual sensitivities of the network loss to the removal of structures , i.e . the derivatives λ1 ( s ) , and individual correlations θTs H ( θ ) θs′ . While objectives other than λI2 are equally possible in the method , including λ2 and variants with the absolute values not pulled in all the way , we found λI2 to empirically perform best overall . Then , SOSP-I iteratively selects the structures to prune , based on the objective ( 2 ) : Starting from an empty pruning mask M = { } , we iteratively add to M the structure s /∈ M that minimizes the overall sensitivity λI2 ( M ∪ { s } ) . In practice , the algorithm pre-computes the matrix Q ∈ RS×S , Qs , s′ : = 1 2 ∣∣θTs H ( θ ) θs′ ∣∣+ ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣ · δs=s′ , ( 3 ) and selects at each iteration a structure s /∈M to prune by argmin s/∈M λI2 ( M ∪ { s } ) − λI2 ( M ) = argmin s/∈M ( Qs , s + 2 ∑ s′∈M Qs , s′ ) , ( 4 ) terminating at the desired pruning ratio . To computeQ efficiently , we show in App . B that the Hessian terms can be approximated as θTs H ( θ ) θs′ ≈ 1 N ′ N ′∑ n=1 ( φ ( xn ) θs ) T Rn ( φ ( xn ) θs′ ) . ( 5 ) Herein , the NN gradient φ ( x ) : = ∇θfθ ( x ) ∈ RD×P forms the basis of the well-established GaussNewton approximation ( see App . B for more details ) used for the Hessian , and the matrices Rn ∈ RD×D are diagonal plus a rank-1 contribution ( App . B ) . For further efficiency gains , the sum runs over a random subsample of size N ′ < N . In practice , one pre-computes all ( sparse ) products φ ( xn ) θs ∈ RD starting from the efficiently computable gradient φ ( xn ) , before aggregating a batch onto the terms θTs H ( θ ) θs′ . Eq . ( 5 ) also has an interpretation as output correlations between certain network modifications , without derivatives ( App . C ) . | This paper proposes a method to prune deep neural networks. The aim is to reduce the computational cost and inference time while maximally maintaining the classification performance. The motivation of this work is to consider second-order structured pruning (SOSP), which considers the correlation information among the structures and layers when conducting network pruning. The key part of this work is the development of a method called SOSP-H that can have better scalability while considering the second-order correlation information for pruning. Experimental study is conducted to compare the proposed SOSP-H with its variant and other existing related methods, demonstrating its effectiveness. | SP:190e69f0d6538fa7e87d77df6cdf93c7a1d83f90 |
SOSP: Efficiently Capturing Global Correlations by Second-Order Structured Pruning | 1 INTRODUCTION . Deep neural networks have consistently grown in size over the last years with increasing performance . However , this increase in size leads to slower inference , higher computational requirements and higher cost . To reduce the size of the networks without affecting their performance , a large number of pruning algorithms have been proposed ( e.g. , LeCun et al. , 1990 ; Hassibi et al. , 1993 ; Reed , 1993 ; Han et al. , 2015 ; Blalock et al. , 2020 ) . Pruning can either be unstructured , i.e . removing individual weights , or structured , i.e . removing entire substructures like nodes or channels . Single-shot pruning methods , as investigated in this work , usually consist of three steps : 1 ) training , 2 ) pruning , 3 ) another training step often referred to as fine-tuning . Unstructured pruning can significantly reduce the number of parameters of a neural network with only little loss in the accuracy , but the resulting networks often show only a marginal improvement in training and inference time , unless specialized hardware is used ( He et al. , 2017 ) . In contrast , structured pruning can directly reduce inference time and even training time when applied at initialization ( Lee et al. , 2018 ) . To exploit these advantages , in this work , we focus on structured pruning . Global pruning removes structure by structure from all available structures of a network until a predefined percentage of pruned structures is reached . Recent examples for global structured pruning methods are NN Slimming ( Liu et al. , 2017 ) , C-OBD and EigenDamage ( Wang et al. , 2019a ) . Local pruning , on the other hand , first subdivides all global structures into subsets ( e.g . layers ) and removes a percentage of structures of each subset . Recent examples for local pruning methods are HRank ( Lin et al. , 2019 ) , CCP ( Peng et al. , 2019 ) , FPGM ( He et al. , 2019 ) and Variational Pruning ( Zhao et al. , 2019 ) . Most local pruning schemes use a predefined layer-wise pruning ratio , which fixes the percentage of structures removed per layer . While this prevents the layers from collapsing , it also reduces some of the degrees of freedom , since some layers may be less important than others . Other local pruning methods like AMC ( He et al. , 2018 ) learn the layer-wise pruning ratios in a first step . A key challenge for global saliency-based pruning is to find an objective which can be efficiently calculated to make the approach scalable to large-scale , modern neural networks . While second-order pruning methods are usually more accurate than first-order methods ( Molchanov et al. , 2019 ) , calculating the full second-order saliency objective is intractable for modern neural networks . Therefore , most saliency-based pruning methods such as OBD ( e.g. , LeCun et al. , 1990 ) or C-OBD ( Wang et al. , 2019a ) evaluate the effect of removing a single weight or structure on the loss of the neural network in isolation . However , this neglects possible correlations between different structures , which are captured by the off-diagonal second-order terms , and hence , can significantly harm the estimation of the sensitivities . Finding a global second-order method that both considers off-diagonal terms and scales to modern neural networks is still an unsolved research question . Our main goal in this work is to devise a simple and efficient second-order pruning method that considers all global correlations for structured sensitivity pruning . In addition , we want to highlight the benefits that such methods may have over other structured global and local pruning schemes . Our contributions are as follows : • We develop two novel saliency-based pruning methods for second-order structured pruning ( SOSP ) and analyze them theoretically . We show that both of our methods drastically improve on the complexity of a naive second-order approach , which is usually intractable for modern neural networks . Further , we show that our SOSP-H method , which is based on fast Hessian-vector products , has the same low complexity as first-order methods , while taking the full Hessian into account . • We compare the performance and the scaling of SOSP-H to that of SOSP-I , which is based on the well-known Gauss-Newton approximation . While both methods perform on par , SOSP-H shows better scaling . We then benchmark our SOSP methods against a variety of state-of-the-art pruning methods and show that they achieve comparable or better results at lower computational costs for pruning . • We exploit the structure of the pruning masks found by our SOSP methods to widen architectural bottlenecks , which further improves the performance of the pruned networks . We diagnose layers with disproportionally low pruning ratios as architectural bottlenecks . PyTorch code implementing our method will be published upon acceptance of this manuscript . Related work is discussed in the light of our results in the Discussion section ( Sec . 4 ) . 2 SOSP : SECOND-ORDER STRUCTURED PRUNING . A neural network ( NN ) maps an input x ∈ Rd to an output fθ ( x ) ∈ RD , where θ ∈ RP are its P parameters . NN training proceeds , after random initialization θ = θ0 of the weights , by minibatch stochastic gradient descent on the empirical loss L ( θ ) : = 1N ∑N n=1 ` ( fθ ( xn ) , yn ) , given the training dataset { ( x1 , y1 ) , . . . , ( xN , yN ) } . In the classification case , y ∈ { 1 , . . . , D } is a discrete ground-truth label and ` ( fθ ( x ) , y ) : = − log σ ( fθ ( x ) ) y the cross-entropy loss , with σ : RD → RD the softmax-function . For regression , y ∈ RD and ` ( fθ ( x ) , y ) = 12 ‖fθ ( x ) − y‖ 2 is the squared loss . Structured pruning aims to remove weights or rather entire structures from a NN fθ with parameters θ . A structure can be a filter ( channel ) in a convolutional layer , a neuron in a fully-connected layer , or an entire layer in a parallel architecture . We assume the NN in question has been segmented into S structures s = 1 , . . . , S , which can potentially be pruned . We define the notation θs ∈ RP as the vector whose only nonzero components are those weights from θ that belong to structure s.1 Then , a pruning mask is a set M = { s1 , . . . , sm } of structures , and applying a mask M to a NN fθ means to consider the NN with parameter vector θ\M : = θ − ∑ s∈M θs . We now develop our pruning methods that incorporate global correlations into their saliency assessment by efficiently including the second-order loss terms . Our method SOSP-I allows a direct interpretation in terms of individual loss sensitivities , while our main method SOSP-H remains very efficient for large-scale networks due to its Hessian-vector product approximation . 1We require that each weight is assigned to at most one structure . In practice , we associate with each structure those weights that go into the structure , rather than those that leave it . The basic idea behind both our pruning methods is to select the pruning mask M so as to ( approximately ) minimize the joint effect on the network loss λ ( M ) : = ∣∣L ( θ ) − L ( θ\M ) ∣∣ of removing all structures in M , subject to a constraint on the overall pruning ratio . To circumvent this exponentially large search space , we approximate the loss up to second order , so that λ2 ( M ) = ∣∣∣∣∣∣ ∑ s∈M θTs dL ( θ ) dθ − 1 2 ∑ s , s′∈M θTs d2L ( θ ) dθ dθT θs′ ∣∣∣∣∣∣ ( 1 ) collapses to single-structure contributions plus pairwise correlations . The first-order terms λ1 ( s ) : = θs ·dL ( θ ) /dθ in ( 1 ) are efficient to evaluate by computing the gradient dL ( θ ) /dθ ∈ RP once and then a ( sparse ) dot product for every s. In contrast , the network Hessian H ( θ ) : = d2L ( θ ) /dθ2 ∈ RP×P in ( 1 ) is prohibitively expensive to compute or store in full . We therefore propose two different schemes to efficiently overcome this obstacle . We name the full methods SOSP-I ( individual sensitivities ) and SOSP-H ( Hessian-vector product ) . 2.1 SOSP-I : SALIENCY FROM INDIVIDUAL SENSITIVITIES . SOSP-I approximates each individual term θTs H ( θ ) θs′ in ( 1 ) efficiently , as we will show in Eq . ( 5 ) . We will therefore consider an upper bound to Eq . ( 1 ) which measures all sensitivities individually : λI2 ( M ) = ∑ s∈M ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣+ 12 ∑ s , s′∈M ∣∣θTs H ( θ ) θs′ ∣∣ . ( 2 ) The absolute values are to prevent cancellations among the individual sensitivities of the network loss to the removal of structures , i.e . the derivatives λ1 ( s ) , and individual correlations θTs H ( θ ) θs′ . While objectives other than λI2 are equally possible in the method , including λ2 and variants with the absolute values not pulled in all the way , we found λI2 to empirically perform best overall . Then , SOSP-I iteratively selects the structures to prune , based on the objective ( 2 ) : Starting from an empty pruning mask M = { } , we iteratively add to M the structure s /∈ M that minimizes the overall sensitivity λI2 ( M ∪ { s } ) . In practice , the algorithm pre-computes the matrix Q ∈ RS×S , Qs , s′ : = 1 2 ∣∣θTs H ( θ ) θs′ ∣∣+ ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣ · δs=s′ , ( 3 ) and selects at each iteration a structure s /∈M to prune by argmin s/∈M λI2 ( M ∪ { s } ) − λI2 ( M ) = argmin s/∈M ( Qs , s + 2 ∑ s′∈M Qs , s′ ) , ( 4 ) terminating at the desired pruning ratio . To computeQ efficiently , we show in App . B that the Hessian terms can be approximated as θTs H ( θ ) θs′ ≈ 1 N ′ N ′∑ n=1 ( φ ( xn ) θs ) T Rn ( φ ( xn ) θs′ ) . ( 5 ) Herein , the NN gradient φ ( x ) : = ∇θfθ ( x ) ∈ RD×P forms the basis of the well-established GaussNewton approximation ( see App . B for more details ) used for the Hessian , and the matrices Rn ∈ RD×D are diagonal plus a rank-1 contribution ( App . B ) . For further efficiency gains , the sum runs over a random subsample of size N ′ < N . In practice , one pre-computes all ( sparse ) products φ ( xn ) θs ∈ RD starting from the efficiently computable gradient φ ( xn ) , before aggregating a batch onto the terms θTs H ( θ ) θs′ . Eq . ( 5 ) also has an interpretation as output correlations between certain network modifications , without derivatives ( App . C ) . | This paper presents saliency-based second-order structured pruning methods, namely SOSP-I and SOSP-H. The proposed methods are designed to capture the correlations among all structures and layers, known as second-order structure (Hessian). In particular, SOSP-I employs Hessian approximation while SOSP-H employs exact Hessian. Overall, the idea of this paper is very clear, and I kinda like the discussion part of it. The expand-pruning is also interesting. | SP:190e69f0d6538fa7e87d77df6cdf93c7a1d83f90 |
SOSP: Efficiently Capturing Global Correlations by Second-Order Structured Pruning | 1 INTRODUCTION . Deep neural networks have consistently grown in size over the last years with increasing performance . However , this increase in size leads to slower inference , higher computational requirements and higher cost . To reduce the size of the networks without affecting their performance , a large number of pruning algorithms have been proposed ( e.g. , LeCun et al. , 1990 ; Hassibi et al. , 1993 ; Reed , 1993 ; Han et al. , 2015 ; Blalock et al. , 2020 ) . Pruning can either be unstructured , i.e . removing individual weights , or structured , i.e . removing entire substructures like nodes or channels . Single-shot pruning methods , as investigated in this work , usually consist of three steps : 1 ) training , 2 ) pruning , 3 ) another training step often referred to as fine-tuning . Unstructured pruning can significantly reduce the number of parameters of a neural network with only little loss in the accuracy , but the resulting networks often show only a marginal improvement in training and inference time , unless specialized hardware is used ( He et al. , 2017 ) . In contrast , structured pruning can directly reduce inference time and even training time when applied at initialization ( Lee et al. , 2018 ) . To exploit these advantages , in this work , we focus on structured pruning . Global pruning removes structure by structure from all available structures of a network until a predefined percentage of pruned structures is reached . Recent examples for global structured pruning methods are NN Slimming ( Liu et al. , 2017 ) , C-OBD and EigenDamage ( Wang et al. , 2019a ) . Local pruning , on the other hand , first subdivides all global structures into subsets ( e.g . layers ) and removes a percentage of structures of each subset . Recent examples for local pruning methods are HRank ( Lin et al. , 2019 ) , CCP ( Peng et al. , 2019 ) , FPGM ( He et al. , 2019 ) and Variational Pruning ( Zhao et al. , 2019 ) . Most local pruning schemes use a predefined layer-wise pruning ratio , which fixes the percentage of structures removed per layer . While this prevents the layers from collapsing , it also reduces some of the degrees of freedom , since some layers may be less important than others . Other local pruning methods like AMC ( He et al. , 2018 ) learn the layer-wise pruning ratios in a first step . A key challenge for global saliency-based pruning is to find an objective which can be efficiently calculated to make the approach scalable to large-scale , modern neural networks . While second-order pruning methods are usually more accurate than first-order methods ( Molchanov et al. , 2019 ) , calculating the full second-order saliency objective is intractable for modern neural networks . Therefore , most saliency-based pruning methods such as OBD ( e.g. , LeCun et al. , 1990 ) or C-OBD ( Wang et al. , 2019a ) evaluate the effect of removing a single weight or structure on the loss of the neural network in isolation . However , this neglects possible correlations between different structures , which are captured by the off-diagonal second-order terms , and hence , can significantly harm the estimation of the sensitivities . Finding a global second-order method that both considers off-diagonal terms and scales to modern neural networks is still an unsolved research question . Our main goal in this work is to devise a simple and efficient second-order pruning method that considers all global correlations for structured sensitivity pruning . In addition , we want to highlight the benefits that such methods may have over other structured global and local pruning schemes . Our contributions are as follows : • We develop two novel saliency-based pruning methods for second-order structured pruning ( SOSP ) and analyze them theoretically . We show that both of our methods drastically improve on the complexity of a naive second-order approach , which is usually intractable for modern neural networks . Further , we show that our SOSP-H method , which is based on fast Hessian-vector products , has the same low complexity as first-order methods , while taking the full Hessian into account . • We compare the performance and the scaling of SOSP-H to that of SOSP-I , which is based on the well-known Gauss-Newton approximation . While both methods perform on par , SOSP-H shows better scaling . We then benchmark our SOSP methods against a variety of state-of-the-art pruning methods and show that they achieve comparable or better results at lower computational costs for pruning . • We exploit the structure of the pruning masks found by our SOSP methods to widen architectural bottlenecks , which further improves the performance of the pruned networks . We diagnose layers with disproportionally low pruning ratios as architectural bottlenecks . PyTorch code implementing our method will be published upon acceptance of this manuscript . Related work is discussed in the light of our results in the Discussion section ( Sec . 4 ) . 2 SOSP : SECOND-ORDER STRUCTURED PRUNING . A neural network ( NN ) maps an input x ∈ Rd to an output fθ ( x ) ∈ RD , where θ ∈ RP are its P parameters . NN training proceeds , after random initialization θ = θ0 of the weights , by minibatch stochastic gradient descent on the empirical loss L ( θ ) : = 1N ∑N n=1 ` ( fθ ( xn ) , yn ) , given the training dataset { ( x1 , y1 ) , . . . , ( xN , yN ) } . In the classification case , y ∈ { 1 , . . . , D } is a discrete ground-truth label and ` ( fθ ( x ) , y ) : = − log σ ( fθ ( x ) ) y the cross-entropy loss , with σ : RD → RD the softmax-function . For regression , y ∈ RD and ` ( fθ ( x ) , y ) = 12 ‖fθ ( x ) − y‖ 2 is the squared loss . Structured pruning aims to remove weights or rather entire structures from a NN fθ with parameters θ . A structure can be a filter ( channel ) in a convolutional layer , a neuron in a fully-connected layer , or an entire layer in a parallel architecture . We assume the NN in question has been segmented into S structures s = 1 , . . . , S , which can potentially be pruned . We define the notation θs ∈ RP as the vector whose only nonzero components are those weights from θ that belong to structure s.1 Then , a pruning mask is a set M = { s1 , . . . , sm } of structures , and applying a mask M to a NN fθ means to consider the NN with parameter vector θ\M : = θ − ∑ s∈M θs . We now develop our pruning methods that incorporate global correlations into their saliency assessment by efficiently including the second-order loss terms . Our method SOSP-I allows a direct interpretation in terms of individual loss sensitivities , while our main method SOSP-H remains very efficient for large-scale networks due to its Hessian-vector product approximation . 1We require that each weight is assigned to at most one structure . In practice , we associate with each structure those weights that go into the structure , rather than those that leave it . The basic idea behind both our pruning methods is to select the pruning mask M so as to ( approximately ) minimize the joint effect on the network loss λ ( M ) : = ∣∣L ( θ ) − L ( θ\M ) ∣∣ of removing all structures in M , subject to a constraint on the overall pruning ratio . To circumvent this exponentially large search space , we approximate the loss up to second order , so that λ2 ( M ) = ∣∣∣∣∣∣ ∑ s∈M θTs dL ( θ ) dθ − 1 2 ∑ s , s′∈M θTs d2L ( θ ) dθ dθT θs′ ∣∣∣∣∣∣ ( 1 ) collapses to single-structure contributions plus pairwise correlations . The first-order terms λ1 ( s ) : = θs ·dL ( θ ) /dθ in ( 1 ) are efficient to evaluate by computing the gradient dL ( θ ) /dθ ∈ RP once and then a ( sparse ) dot product for every s. In contrast , the network Hessian H ( θ ) : = d2L ( θ ) /dθ2 ∈ RP×P in ( 1 ) is prohibitively expensive to compute or store in full . We therefore propose two different schemes to efficiently overcome this obstacle . We name the full methods SOSP-I ( individual sensitivities ) and SOSP-H ( Hessian-vector product ) . 2.1 SOSP-I : SALIENCY FROM INDIVIDUAL SENSITIVITIES . SOSP-I approximates each individual term θTs H ( θ ) θs′ in ( 1 ) efficiently , as we will show in Eq . ( 5 ) . We will therefore consider an upper bound to Eq . ( 1 ) which measures all sensitivities individually : λI2 ( M ) = ∑ s∈M ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣+ 12 ∑ s , s′∈M ∣∣θTs H ( θ ) θs′ ∣∣ . ( 2 ) The absolute values are to prevent cancellations among the individual sensitivities of the network loss to the removal of structures , i.e . the derivatives λ1 ( s ) , and individual correlations θTs H ( θ ) θs′ . While objectives other than λI2 are equally possible in the method , including λ2 and variants with the absolute values not pulled in all the way , we found λI2 to empirically perform best overall . Then , SOSP-I iteratively selects the structures to prune , based on the objective ( 2 ) : Starting from an empty pruning mask M = { } , we iteratively add to M the structure s /∈ M that minimizes the overall sensitivity λI2 ( M ∪ { s } ) . In practice , the algorithm pre-computes the matrix Q ∈ RS×S , Qs , s′ : = 1 2 ∣∣θTs H ( θ ) θs′ ∣∣+ ∣∣∣∣θTs dL ( θ ) dθ ∣∣∣∣ · δs=s′ , ( 3 ) and selects at each iteration a structure s /∈M to prune by argmin s/∈M λI2 ( M ∪ { s } ) − λI2 ( M ) = argmin s/∈M ( Qs , s + 2 ∑ s′∈M Qs , s′ ) , ( 4 ) terminating at the desired pruning ratio . To computeQ efficiently , we show in App . B that the Hessian terms can be approximated as θTs H ( θ ) θs′ ≈ 1 N ′ N ′∑ n=1 ( φ ( xn ) θs ) T Rn ( φ ( xn ) θs′ ) . ( 5 ) Herein , the NN gradient φ ( x ) : = ∇θfθ ( x ) ∈ RD×P forms the basis of the well-established GaussNewton approximation ( see App . B for more details ) used for the Hessian , and the matrices Rn ∈ RD×D are diagonal plus a rank-1 contribution ( App . B ) . For further efficiency gains , the sum runs over a random subsample of size N ′ < N . In practice , one pre-computes all ( sparse ) products φ ( xn ) θs ∈ RD starting from the efficiently computable gradient φ ( xn ) , before aggregating a batch onto the terms θTs H ( θ ) θs′ . Eq . ( 5 ) also has an interpretation as output correlations between certain network modifications , without derivatives ( App . C ) . | This paper address the problem of neural network single-shot structured-based model pruning. Deep convolutional neural networks grow to achieve higher performance, which also means slower inference and higher computational cost. Model pruning can help with that. Model pruning can be unstructured, which means to remove individual weights, or structured, which means to remove entire substructures, e.g., nodes or channels. This paper focuses on structured pruning. A key challenge for global saliency-based structured model pruning is to find a good objective that can be efficiently calculated to make the approach scalable to various modern convolutional neural networks. Existing saliency-based pruning methods such as OBD, C-OBD evaluate the effect of removing a single weight or structure on the loss of the neural network in isolation. This work is to devise a 2nd order pruning method that considers all global correlations for structured sensitivity pruning. The basic idea in this work is to search for the pruning mask M to minimize the joint effect on the network loss approximately. The mathematical approximation focuses on the second-order approximation to the loss. The key contributions of this work are the proposed 2nd-order structured pruning (SOSP). There are two variants of that. The first one is based on fast hessian-vector products, and it has the same complexity as that with first-order methods. A second one is based on the Gaussian-newton approximation. The first one with fast hessian-vector products do better in terms of scale. Experiments on VGG, ResNets, PlainNet, DenseNet are shown promising results across various image classification datasets, including Cifar10/100 and ImageNet. | SP:190e69f0d6538fa7e87d77df6cdf93c7a1d83f90 |
Pareto Navigation Gradient Descent: a First Order Algorithm for Optimization in Pareto Set | Many modern machine learning applications , such as multi-task learning , require finding1 optimal model parameters to trade-off multiple objective functions that may conflict with2 each other . The notion of the Pareto set allows us to focus on the set of ( often infinite number3 of ) models that can not be strictly improved . But it does not provide an actionable procedure4 for picking one or a few special models to return to practical users . In this paper , we5 consider optimization in Pareto set ( OPT-in-Pareto ) , the problem of finding Pareto models6 that optimize an extra reference criterion function within the Pareto set . This function can7 either encode a specific preference from the users , or represent a generic diversity measure8 for obtaining a set of diversified Pareto models that are representative of the whole Pareto9 set . Unfortunately , despite being a highly useful framework , efficient algorithms for OPT-10 in-Pareto have been largely missing , especially for large-scale , non-convex , and non-linear11 objectives in deep learning . A naive approach is to apply Riemannian manifold gradient12 descent on the Pareto set , which yields a high computational cost due to the need for eigen-13 calculation of Hessian matrices . We propose a first-order algorithm that approximately14 solves OPT-in-Pareto using only gradient information , with both high practical efficiency15 and theoretically guaranteed convergence property . Empirically , we demonstrate that our16 method works efficiently for a variety of challenging multi-task-related problems.17 1 INTRODUCTION18 Although machine learning tasks are traditionally framed as optimizing a single objective . Many modern19 applications , especially in areas like multitask learning , require finding optimal model parameters to minimize20 multiple objectives ( or tasks ) simultaneously . As the different objective functions may inevitably conflict21 with each other , the notion of optimality in multi-objective optimization ( MOO ) needs to be characterized by22 the Pareto set : the set of model parameters whose performance of all tasks can not be jointly improved.23 Focusing on the Pareto set allows us to filter out models that can be strictly improved . However , the Pareto24 set typically contains an infinite number of parameters that represent different trade-offs of the objectives.25 For m objectives ` 1 , . . . , ` m , the Pareto set is often an ( m− 1 ) dimensional manifold . It is both intractable26 and unnecessary to give practical users the whole exact Pareto set . A more practical demand is to find some27 user-specified special parameters in the Pareto set , which can be framed into the following optimization in28 Pareto set ( OPT-in-Pareto ) problem:29 Finding one or a set of parameters inside the Pareto set of ` 1 , . . . , ` m that minimize a reference criterion F .30 Here the criterion function F can be used to encode an informative user-specific preference on the objectives31 ` 1 , . . . , ` m , which allows us to provide the best models customized for different users . F can also be an32 non-informative measure that encourages , for example , the diversity of a set of model parameters . In this33 case , optimizing F in Pareto set gives a set of diversified Pareto models that are representative of the whole34 Pareto set , from which different users can pick their favorite models during the testing time.35 OPT-in-Pareto provides a highly generic and actionable framework for multi-objective learning and opti-36 mization . However , efficient algorithms for solving OPT-in-Pareto have been largely lagging behind in deep37 learning where the objective functions are non-convex and non-linear . Although has not been formally studied,38 a straightforward approach is to apply manifold gradient descent on F in the Riemannian manifold formed by39 the Pareto set ( Hillermeier , 2001 ; Bonnabel , 2013 ) . However , this casts prohibitive computational cost due40 to the need for eigen-computation of Hessian matrices of { ` i } . In the optimization and operation research41 literature , there has been a body of work on OPT-in-Pareto viewing it as a special bi-level optimization42 problem ( Dempe , 2018 ) . However , these works often heavily rely on the linearity and convexity assumptions43 and are not applicable to the non-linear and non-convex problems in deep learning ; see for examples in Ecker44 & Song ( 1994 ) ; Jorge ( 2005 ) ; Thach & Thang ( 2014 ) ; Liu & Ehrgott ( 2018 ) ; Sadeghi & Mohebi ( 2021 ) ( just45 to name a few ) . In comparison , the OPT-in-Pareto problem seems to be much less known and under-explored46 in the deep learning literature.47 In this work , we provide a practically efficient first-order algorithm for OPT-in-Pareto , using only gradient48 information of the criterion F and objectives { ` i } . Our method , named Pareto navigation gradient descent49 ( PNG ) , iteratively updates the parameters following a direction that carefully balances the descent on F and50 { ` i } , such that it guarantees to move towards the Pareto set of { ` i } when it is far away , and optimize F in a51 neighborhood of the Pareto set . Our method is simple , practically efficient and has theoretical guarantees.52 In empirical studies , we demonstrate that our method works efficiently for both optimizing user-specific53 criteria and diversity measures . In particular , for finding representative Pareto solutions , we propose an54 energy distance criterion whose minimizers distribute uniformly on the Pareto set asymptotically ( Hardin55 & Saff , 2004 ) , yielding a principled and efficient Pareto set approximation method that compares favorably56 with recent works such as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) . We also apply PNG to improve the57 performance of JiGen ( Carlucci et al. , 2019b ) , a multi-task learning approach for domain generalization , by58 using the adversarial feature discrepancy as the criterion objective.59 Related Work There has been a rising interest in MOO in deep learning , mostly in the context of multi-task60 learning . But most existing methods can not be applied to the general OPT-in-Pareto problem . A large body61 of recent works focus on improving non-convex optimization for finding some model in the Pareto set , but62 can not search for a special model satisfying a specific criterion ( Chen et al. , 2018 ; Kendall et al. , 2018 ; Sener63 & Koltun , 2018 ; Yu et al. , 2020 ; Chen et al. , 2020 ; Wu et al. , 2020 ; Fifty et al. , 2020 ; Javaloy & Valera , 2021 ) .64 One exception is Mahapatra & Rajan ( 2020 ) ; Kamani et al . ( 2021 ) , which searches for models in the Pareto65 set that satisfy a constraint on the ratio between the different objectives . The problem they study can be66 viewed as a special instance of OPT-in-Pareto . However , their approaches are tied with special properties of67 the ratio constraint and do not apply to the general OPT-in-Pareto problem.68 There has also been increasing interest in finding a compact approximation of the Pareto set . Navon et al.69 ( 2020 ) ; Lin et al . ( 2020 ) use hypernetworks to approximate the map from linear scalarization weights to70 the corresponding Pareto solutions ; these methods could not fully profile non-convex Pareto fronts due71 to the limitation of linear scalarization ( Boyd et al. , 2004 ) , and the use of hypernetwork introduces extra72 optimization difficulty . Another line of works ( Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ) approximate73 the Pareto set by training models with different user preference vectors that rank the relative importance74 of different tasks ; these methods need a good heuristic design of preference vectors , which requires prior75 knowledge of the Pareto front . Ma et al . ( 2020 ) leverages manifold gradient to conduct a local random walk76 on the Pareto set but suffers from the high computational cost . Deist et al . ( 2021 ) approximates the Pareto set77 by maximizing hypervolume , which requires prior knowledge for choosing a good reference vector.78 Multi-task learning can also be applied to improve the learning in many other domains including domain79 generalization ( Dou et al. , 2019 ; Carlucci et al. , 2019a ; Albuquerque et al. , 2020 ) , domain adaption ( Sun80 et al. , 2019 ; Luo et al. , 2021 ) , model uncertainty ( Hendrycks et al. , 2019 ; Zhang et al. , 2020 ; Xie et al. , 2021 ) ,81 adversarial robustness ( Yang & Vondrick , 2020 ) and semi-supervised learning ( Sohn et al. , 2020 ) . All of82 those applications utilize a linear scalarization to combine the multiple objectives and it is thus interesting to83 apply the proposed OPT-in-Pareto framework , which we leave for future work.84 2 BACKGROUND ON MULTI-OBJECTIVE OPTIMIZATION85 We introduce the background on multi-objective optimization ( MOO ) and Pareto optimality . For notation,86 we denote by [ m ] the integer set { 1 , 2 , .... , m } , and R+ the set of non-negative real numbers . Let Cm =87 { ω ∈ Rm+ , ∑m i=1 ωi = 1 } be the probability simplex . We denote by ‖·‖ the Euclidean norm.88 Let θ ∈ Rn be a parameter of interest ( e.g. , the weights in a deep neural network ) . Let ` ( θ ) =89 [ ` 1 ( θ ) , . . . , ` m ( θ ) ] be a set of objective functions that we want to minimize . For two parameters θ , θ′ ∈ Rn,90 we write ` ( θ ) ` ( θ′ ) if ` i ( θ ) ≥ ` i ( θ′ ) for all i ∈ [ m ] ; and write ` ( θ ) ` ( θ′ ) if ` ( θ ) ` ( θ′ ) and91 ` ( θ ) 6= ` ( θ′ ) . We say that θ is Pareto dominated ( or Pareto improved ) by θ′ if ` ( θ ) ` ( θ′ ) . We say that θ is92 Pareto optimal on a set Θ ⊆ Rn , denoted as θ ∈ Pareto ( Θ ) , if there exists no θ′ ∈ Θ such that ` ( θ ) ` ( θ′ ) .93 The Pareto global optimal set P∗∗ : = Pareto ( Rn ) is the set of points ( i.e. , θ ) which are Pareto optimal on94 the whole domain Rn . The Pareto local optimal set of ` , denoted by P∗ , is the set of points which are Pareto95 optimal on a neighborhood of itself:96 P∗ : = { θ ∈ Rn : there exists a neighborhood Nθ of θ , such that θ ∈ Pareto ( Nθ ) } . The ( local or global ) Pareto front is the set of objective vectors achieved by the Pareto optimal points , e.g.,97 the local Pareto front is F∗ = { ` ( θ ) : θ ∈ P∗ } . Because finding global Pareto optimum is intractable for98 non-convex objectives in deep learning , we focus on Pareto local optimal sets in this work ; in the rest of the99 paper , terms like “ Pareto set ” and “ Pareto optimum ” refer to Pareto local optimum by default.100 Pareto Stationary Points Similar to the case of single-objective optimization , Pareto local optimum implies a notion of Pareto stationarity defined as follows . Assume ` is differentiable on Rn . A point θ is called Pareto stationary if there must exists a set of non-negative weights ω1 , . . . , ωm with ∑m i=1 ωi = 1 , such that θ is a stationary point of the ω-weighted linear combination of the objectives : ` ω ( θ ) : = ∑m i=1 ωi ` i ( θ ) . Therefore , the set of Pareto stationary points , denoted by P , can be characterized by P : = { θ ∈ Θ : g ( θ ) = 0 } , g ( θ ) : = min ω∈Cm || m∑ i=1 ωi∇ ` i ( θ ) ||2 , ( 1 ) where g ( θ ) is the minimum squared gradient norm of ` ω among all ω in the probability simplex Cm on [ m ] .101 Because g ( θ ) can be calculated in practice , it provides an essential way to access Pareto local optimality.102 Finding Pareto Optimal Points A main focus of the MOO literature is to find a ( set of ) Pareto optimal103 points . The simplest approach is linear scalarization , which minimizes ` ω for some weight ω ( decided , e.g.,104 by the users ) in Cm . However , linear scalarization can only find Pareto points that lie on the convex envelop105 of the Pareto front ( see e.g. , Boyd et al. , 2004 ) , and hence does not give a complete profiling of the Pareto106 front when the objective functions ( and hence their Pareto front ) are non-convex.107 Multiple gradient descent ( MGD ) ( Désidéri , 2012 ) is an gradient-based algorithm that can converge to a Pareto local optimum that lies on either the convex or non-convex parts of the Pareto front , depending on the initialization . MGD starts from some initialization θ0 and updates θ at the t-th iteration by θt+1 ← θt − ξvt , vt : = arg max v∈Rn { min i∈ [ m ] ∇ ` i ( θt ) > v − 1 2 ‖v‖2 } , ( 2 ) where ξ is the step size and vt is an update direction that maximizes the worst descent rate among all108 objectives , since ∇ ` i ( θt ) > v ≈ ( ` i ( θt ) − ` i ( θt − ξv ) ) /ξ approximates the descent rate of objective ` i when109 following direction v. When using a sufficiently small step size ξ , MGD ensures to yield a Pareto improvement110 ( i.e , decreasing all the objectives ) on θt unless θt is Pareto ( local ) optimal ; this is because the optimization in111 Equation ( 2 ) always yields mini∈ [ m ] ∇ ` i ( θt ) > vt ≤ 0 ( otherwise we can simply flip the sign of vt ) .112 Using Lagrange strong duality , the solution of Equation ( 2 ) can be framed into vt = m∑ i=1 ωi , t∇ ` i ( θt ) , where { ωi , t } mi=1 = arg min ω∈Cm ‖∇θ ` ω ( θt ) ‖ . ( 3 ) It is easy to see from Equation ( 3 ) that the set of fixed points of MDG ( which satisfy vt = 0 ) coincides with113 the Pareto stationary set P∗.114 A key disadvantage of MGD , however , is that the Pareto point that it converges to depends on the initialization115 and other algorithm configurations in a rather implicated and complicated way . It is difficult to explicitly116 control MGD to make it converge to points with specific properties.117 3 OPTIMIZATION IN PARETO SET118 The Pareto set typically contains an infinite number of points . In the optimization in Pareto set ( OPT-in-119 Pareto ) problem , we are given an extra criterion function F ( θ ) in addition to the objectives ` , and we want to120 minimize F in the Pareto set of ` , that is,121 min θ∈P∗ F ( θ ) . ( 4 ) For example , one can find the Pareto point whose loss vector ` ( θ ) is the closest to a given reference point122 r ∈ Rm by choosing F ( θ ) = ‖ ` ( θ ) − r‖2 . We can also design F to encourages ` ( θ ) to be proportional to r,123 i.e. , ` ( θ ) ∝ r ; a constraint variant of this problem was considered in Mahapatra & Rajan ( 2020 ) .124 We can further generalize OPT-in-Pareto to allow the criterion F to depend on an ensemble of Pareto points125 { θ1 , ... , θN } jointly , that is,126 min θ1 , ... , θN∈P∗ F ( θ1 , ... , θN ) . ( 5 ) For example , if F ( θ1 , . . . , θN ) measures the diversity among { θi } Ni=1 , then optimizing it provides a set of diversified points inside the Pareto set P∗ . An example of diversity measure is F ( θ1 , . . . , θN ) = E ( ` ( θ1 ) , . . . , ` ( θN ) ) , with E ( ` 1 , . . . , ` N ) = ∑ i 6=j ‖ ` i − ` j‖−2 , ( 6 ) where E is known as an energy distance in computational geometry , whose minimizer can be shown to give127 an uniform distribution asymptotically when N →∞ ( Hardin & Saff , 2004 ) . This formulation is particularly128 useful when the users ’ preference is unknown during the training time , and we want to return an ensemble of129 models that well cover the different areas of the Pareto set to allow the users to pick up a model that fits their130 needs regardless of their preference . The problem of profiling Pareto set has attracted a line of recent works131 ( e.g. , Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ; Ma et al. , 2020 ; Deist et al. , 2021 ) , but they rely on specific132 criterion or heuristics and do not address the general optimization of form Equation ( 5 ) .133 Manifold Gradient Descent One straightforward approach to OPT-in-Pareto is to deploy manifold gradient134 descent ( Hillermeier , 2001 ; Bonnabel , 2013 ) , which conducts steepest descent of F ( θ ) in the Riemannian135 manifold formed by the Pareto set P∗ . Initialized at θ0 ∈ P∗ , manifold gradient descent updates θt at the t-th136 iteration along the direction of the projection of∇F ( θt ) on the tangent space T ( θt ) at θt in P∗,137 θt+1 = θt − ξProjT ( θt ) ( ∇F ( θt ) ) . By using the stationarity characterization in Equation ( 1 ) , under proper regularity conditions , one can138 show that the tangent space T ( θt ) equals the null space of the Hessian matrix ∇2θ ` ωt ( θt ) , where ωt =139 arg minω∈Cm ‖∇θ ` ω ( θt ) ‖ . However , the key issue of manifold gradient descent is the high cost for calculating140 this null space of Hessian matrix . Although numerical techniques such as Krylov subspace iteration ( Ma141 et al. , 2020 ) or conjugate gradient descent ( Koh & Liang , 2017 ) can be applied , the high computational cost142 ( and the complicated implementation ) still impedes its application in large scale deep learning problems . See143 Section 1 for discussions on other related works.144 4 PARETO NAVIGATION GRADIENT DESCENT FOR OPT-IN-PARETO145 We now introduce our main algorithm , Pareto Navigating Gradient Descent ( PNG ) , which provides a practical146 approach to OPT-in-Pareto . For convenience , we focus on the single point problem in Equation ( 4 ) in the147 presentation . The generalization to the multi-point problem in Equation ( 5 ) is straightforward . We first148 introduce the main idea and then present theoretical analysis in Section 4.1.149 Main Idea We consider the general incremental updating rule of form θt+1 ← θt − ξvt , where ξ is the step size and vt is an update direction that we shall choose to achieve the following desiderata150 in balancing the decent of { ` i } and F :151 i ) When θt is far away from the Pareto set , we want to choose vt to give Pareto improvement to θt , moving it152 towards the Pareto set . The amount of Pareto improvement might depend on how far θt is to the Pareto set.153 ii ) If the directions that yield Pareto improvement are not unique , we want to choose the Pareto improvement154 direction that decreases F ( θ ) most.155 iii ) When θt is very close to the Pareto set , e.g. , having a small g ( θ ) , we want to fully optimize F ( θ ) .156 We achieve the desiderata above by using the vt that solves the following optimization : vt = arg min v∈Rn { 1 2 ‖∇F ( θt ) − v‖2 s.t . ∇θ ` i ( θt ) > v ≥ φt , ∀i ∈ [ m ] } , ( 7 ) where we want vt to be as close to ∇F ( θt ) as possible ( hence decrease F most ) , conditional on that the157 decreasing rate ∇θ ` i ( θt ) > vt of all losses ` i are lower bounded by a control parameter φt . A positive φt158 enforces that ∇θt ` i ( θ ) > vt is positive for all ` i , hence ensuring a Pareto improvement when the step size is159 sufficiently small . The magnitude of φt controls how much Pareto improvement we want to enforce , so we160 may want to gradually decrease φt when we move closer to the Pareto set . In fact , varying φt provides an161 intermediate updating direction between the vanilla gradient descent on F and MGD on { ` i } :162 i ) If φt = −∞ , we have vt = ∇F ( θt ) and it conducts a pure gradient descent on F without considering { ` i } .163 ii ) If φt → +∞ , then vt approaches to the MGD direction of { ` i } in Equation ( 2 ) without considering F .164 In this work , we propose to choose φt based on the minimum gradient norm g ( θt ) in Equation ( 1 ) as a surrogate indication of Pareto local optimality . In particular , we consider the following simple design : φt = { −∞ if g ( θt ) ≤ e , αtg ( θt ) if g ( θt ) > e , ( 8 ) where e is a small tolerance parameter and αt is a positive hyper-parameter . When g ( θt ) > e , we set φt to be165 proportional to g ( θt ) , to ensure Pareto improvement based on how far θt is to Pareto set . When g ( θt ) ≤ e,166 we set φt = −∞ which “ turns off ” the control and hence fully optimizes F ( θ ) .167 In practice , the optimization in Equation ( 7 ) can be solved efficiently by its dual form as follows.168 Theorem 1 . The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ t=1 λi , t∇ ` i ( θt ) , ( 9 ) with { λi , t } mt=1 the solution of the following dual problem max λ∈Rm+ −1 2 ||∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ||2 + m∑ i=1 λiφt . ( 10 ) The optimization in Equation ( 10 ) can be solved efficiently for a small m ( e .. g , m ≤ 10 ) , which is the case169 for typical applications . We include the details of the practical implementation in Appendix B.170 4.1 THEORETICAL PROPERTIES171 We provide a theoretical quantification on how PNG guarantees to i ) move the solution towards the Pareto172 set ( Theorem 2 ) ; and ii ) optimize F in a neighborhood of Pareto set ( Theorem 3 ) . To simplify the result and173 highlight the intuition , we focus on the continuous time limit of PNG , which yields a differentiation equation174 dθt = −vtdt with vt defined in Equation ( 7 ) , where t ∈ R+ is a continuous integration time.175 Assumption 1 . Let { θt : t ∈ R+ } be a solution of dθt = −vtdt with vt in Equation ( 7 ) ; φk in Equation ( 8 ) ; 176 e > 0 ; and αt ≥ 0 , ∀t ∈ R+ . Assume F and ` are continuously differentiable on Rn , and lower bounded177 with F ∗ : = infθ∈Rn F ( θ ) > −∞ and ` ∗i : = infθ∈Rn ` i ( θ ) > −∞ . Assume supθ∈Rn ‖∇F ( θ ) ‖ ≤ c.178 Technically , dθt = −vtdt is a piecewise smooth dynamical system whose solution should be taken in the179 Filippov sense using the notion of differential inclusion ( Bernardo et al. , 2008 ) . The solution always exists180 under mild regularity conditions although it may not be unique . Our results below apply to all solutions.181 Pareto Optimization on ` We now show that the algorithm converges to the vicinity of Pareto set quantified by a notion of Pareto closure . For ≥ 0 , let P be the set of Pareto -stationary points : P = { θ ∈ Rn : g ( θ ) ≤ } . The Pareto closure of a set P , denoted by P is the set of points that perform no worse than at least one point in P , that is , P : = ∪θ∈P { θ } , { θ } = { θ′ ∈ Rn : ` ( θ′ ) ` ( θ ) } . Therefore , P is better than or at least as good as P in terms of Pareto efficiency.182 Theorem 2 ( Pareto Improvement on ` ) . Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θs ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.183 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters184 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .185 Here we guarantee that θt must enter P for some time ( in fact infinitely often ) , but it is not confined in P .186 On the other hand , θt does not leave P after it first enters P thanks to the Pareto improvement property.187 Optimization on F We now show that PNG finds a local optimum of F inside the Pareto closure P in an188 approximate sense . We first show that a fixed point θ of the algorithm that is locally convex on F and ` must189 be a local optimum of F in the Pareto closure of { θ } , and then quantify the convergence of the algorithm.190 Lemma 1 . Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,191 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } , that is,192 there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and ` ( θ′ ) ` ( θt ) .193 On the other hand , if θt ∈ Pe , we have vt = ∇F ( θt ) , and hence a fixed point with dθtdt = −vt = 0 is an194 unconstrained local minimum of F when F is locally convex on θt.195 Theorem 3 . Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .196 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .197 Combining the results in Theorem 2 and 3 , we can see that the choice of sequence { αt : t ∈ R+ } controls how198 fast we want to decrease ` vs. F . Large αt yields faster descent on ` , but slower descent on F . Theoretically,199 using a sequence that satisfies ∫ αtdt = +∞ and ∫ αγt dt < +∞ for some γ > 1 allows us to ensure that200 both mins∈ [ 0 , t ] g ( θs ) and mins∈ [ 0 , t ] ‖dθ/ds‖ 2 converge to zero . If we use a constant sequence αt = α , it201 introduces an O ( α√g ) term that does not vanish as t→ +∞ . However , we can expect that g is small when202 is small for well-behaved functions . In practice , we find that constant αt works sufficiently well.203 5 EMPIRICAL RESULTS204 We introduce three applications of OPT-in-Pareto with PNG : Singleton Preference , Pareto approximation and205 improving multi-task based domain generalization method . We also conduct additional study on how the206 learning dynamics of PNG changes with different initialization and hyper-parameters ( αt and e ) , which are207 included in Appendix C.3 . Other additional results that are related to the experiments in Section 5.1 and 5.2208 and are included in the Appendix will be introduced later in their corresponding sections.209 5.1 FINDING PREFERRED PARETO MODELS210 We consider the synthetic example used in Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) , which consists of211 two losses : ` 1 ( θ ) = 1− exp ( −‖θ − η‖2 ) and ` 2 ( θ ) = 1− exp ( −‖θ + η‖2 ) , where η = n−1/2 and n = 10212 is dimension of the parameter θ.213 Ratio-based Criterion We first show that PNG can solve the search problem under the ratio constraint of214 objectives in Mahapatra & Rajan ( 2020 ) , i.e. , finding a point θ ∈ P∗ ∩Ω with Ω = { θ : r1 ` 1 ( θ ) = r2 ` 2 ( θ ) =215 ... = rm ` m ( θ ) } , given some preference vector r = [ r1 , ... , rm ] . We apply PNG with the non-uniformity216 score defined in Mahapatra & Rajan ( 2020 ) as the criterion , and compare with their algorithm called exact217 Pareto optimization ( EPO ) . We show in Figure 1 ( a ) - ( b ) the trajectory of PNG and EPO for searching models218 with different preference vector r , starting from the same randomly initialized point . Both PNG and EPO219 converge to the correct solutions but with different trajectories . This suggests that PNG is able to achieve220 the same functionality of finding ratio-constraint Pareto models as Mahapatra & Rajan ( 2020 ) ; Kamani et al.221 ( 2021 ) do but being versatile to handle general criteria . We refer readers to Appendix C.1.1 for more results222 with different choices of hyper-parameters and the experiment details.223 Other Criteria We demonstrate that PNG is able to find solutions for general choices of F . We consider224 the following designs of F : 1 ) weighted ` 2 distance w.r.t . a reference vector r ∈ Rm+ , that is , Fwd ( θ ) =225 i=1 ( ` i ( θ ) − ri ) 2/ri ; and 2 ) complex cosine : in which F is a complicated function related to the cosine226 of task objectives , i.e. , Fcs = − cos ( π ( ` 1 ( θ ) − r1 ) /2 ) + ( cos ( π ( ` ( θ2 ) − r2 ) ) + 1 ) 2 . Here the weighted ` 2227 distance can be viewed as finding a Pareto model that has the losses close to some target value r , which can be228 viewed as an alternative approach to partition the Pareto set . The design of complex cosine aims to test whether229 PNG is able to handle a very non-linear criterion function . In both cases , we take r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] and230 r2 = 1− r1 . We show in Fig 1 ( c ) - ( d ) the trajectory of PNG . As we can see , PNG is able to correctly find the231 optimal solutions of OPT-in-Pareto . We also test PNG on a more challenging ZDT2-variant used in Ma et al.232 ( 2020 ) and a larger scale MTL problem ( Liu et al. , 2019 ) . We refer readers to Appendix C.1.2 and C.1.3 for233 the setting and results.234 5.2 FINDING DIVERSE PARETO MODELS235 Setup We consider the problem of finding diversified points from the Pareto set by minimizing the energy236 distance criterion in Equation ( 6 ) . We use the same setting as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) .237 We consider three benchmark datasets : ( 1 ) MultiMNIST , ( 2 ) MultiFashion , and ( 3 ) MultiFashion+MNIST.238 For each dataset , there are two tasks ( classifying the top-left and bottom-right images ) . We consider LeNet239 with multihead and train N = 5 models to approximate the Pareto set . For baselines , we compare with linear240 scalarization , MGD ( Sener & Koltun , 2018 ) , and EPO ( Mahapatra & Rajan , 2020 ) . For the MGD baseline,241 we find that naively running it leads to poor performance as the learned models are not diversified and thus we242 initialize the MGD with 60-epoch runs of linear scalarization with equally distributed preference weights and243 runs MGD for the later 40 epoch . We refer the reader to Appendix C.2.1 for more details of the experiments.244 Metric and Result We measure the quality of how well the found models { θ1 , . . . , θN } approximate the245 Pareto set using two standard metrics : Inverted Generational Distance Plus ( IGD+ ) ( Ishibuchi et al. , 2015 ) 246 and hypervolume ( HV ) ( Zitzler & Thiele , 1999 ) ; see Appendix C.2.2 for their definitions . We run all the247 methods with 5 independent trials and report the averaged value and its standard deviation in Table 1 . We248 report the scores calculated based on loss ( cross-entropy ) and accuracy on the test set . The bolded values249 indicate the best result with p-value less than 0.05 ( using matched pair t-test ) . In most cases , PNG improves250 the baselines by a large margin . We include ablation studies in Appendix C.2.3 and additional comparisons251 with the second-order approach proposed by Ma et al . ( 2020 ) in Appendix C.2.4.252 5.3 APPLICATION TO MULTI-TASK BASED DOMAIN GENERALIZATION ALGORITHM253 JiGen ( Carlucci et al. , 2019b ) learns a domain generalizable model by learning two tasks based on linear254 scalarization , which essentially searches for a model in the Pareto set and requires choosing the weight of255 linear scalarization carefully . It is thus natural to study whether there is a better mechanism that dynamically256 adjusts the weights of the two losses so that we eventually learn a better model . Motivated by the adversarial257 feature learning ( Ganin et al. , 2016 ) , we propose to improve JiGen such that the latent feature representations258 of the two tasks are well aligned . This can be framed into an OPT-in-Pareto problem where the criterion is259 the discrepancy of the latent representations ( implemented using an adversarial discrepancy module in the260 network ) of the two tasks . PNG is applied to solve the optimization . We evaluate the methods on PACS ( Li261 et al. , 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon , and Sketches ) .262 The model is trained on three domains and tested on the rest of them . Our approach is denoted as JiGen+PNG263 and we also include JiGen + adv , which simply adds the adversarial loss as regularization and two other264 baseline methods ( D-SAM ( D ’ Innocente & Caputo , 2018 ) and DeepAll ( Carlucci et al. , 2019b ) ) . For the three265 JiGen based approaches , we run 3 independent trials and for the other two baselines , we report the results in266 their original papers . Table 2 shows the result using ResNet-18 , which demonstrates the improvement by the267 application of the OPT-in-Pareto framework . We also include the results using AlexNet in the Appendix . We268 refer readers to Appendix C.4 for the additional results and more experiment details.269 6 CONCLUSION270 This paper studies the OPT-in-Pareto , a problem that has been studied in operation research with restrictive271 linear or convexity assumption but largely under-explored in deep learning literature , in which the objectives272 are non-linear and non-convex . Applying algorithms such as manifold gradient descent requires eigen-273 computation of the Hessian matrix at each iteration and thus can be expensive . We propose a first-order274 approximation algorithm called Pareto Navigation Gradient Descent ( PNG ) with theoretically guaranteed275 descent and convergence property to solve OPT-in-Pareto.276 REFERENCES277 Isabela Albuquerque , Nikhil Naik , Junnan Li , Nitish Keskar , and Richard Socher . Improving out-of-278 distribution generalization via multi-task self-supervised pretraining . arXiv preprint arXiv:2003.13525,279 2020.280 Mario Bernardo , Chris Budd , Alan Richard Champneys , and Piotr Kowalczyk . Piecewise-smooth dynamical281 systems : theory and applications , volume 163 . Springer Science & Business Media , 2008.282 Silvere Bonnabel . Stochastic gradient descent on riemannian manifolds . IEEE Transactions on Automatic283 Control , 58 ( 9 ) :2217–2229 , 2013.284 Stephen Boyd , Stephen P Boyd , and Lieven Vandenberghe . Convex optimization . Cambridge university press,285 2004.286 Fabio M. Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain287 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision288 and Pattern Recognition ( CVPR ) , June 2019a.289 Fabio M Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain290 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision291 and Pattern Recognition , pp . 2229–2238 , 2019b.292 Zhao Chen , Vijay Badrinarayanan , Chen-Yu Lee , and Andrew Rabinovich . Gradnorm : Gradient normalization293 for adaptive loss balancing in deep multitask networks . In International Conference on Machine Learning,294 pp . 794–803 . PMLR , 2018.295 Zhao Chen , Jiquan Ngiam , Yanping Huang , Thang Luong , Henrik Kretzschmar , Yuning Chai , and Dragomir296 Anguelov . Just pick a sign : Optimizing deep multitask models with gradient sign dropout . In H. Larochelle,297 M. Ranzato , R. Hadsell , M. F. Balcan , and H. Lin ( eds . ) , Advances in Neural Information Processing298 Systems , volume 33 , pp . 2039–2050 . Curran Associates , Inc. , 2020 . URL https : //proceedings.299 neurips.cc/paper/2020/file/16002f7a455a94aa4e91cc34ebdb9f2d-Paper.pdf.300 Timo M Deist , Monika Grewal , Frank JWM Dankers , Tanja Alderliesten , and Peter AN Bosman.301 Multi-objective learning to predict pareto fronts using hypervolume maximization . arXiv preprint302 arXiv:2102.04523 , 2021.303 Stephan Dempe . Bilevel optimization : theory , algorithms and applications . TU Bergakademie Freiberg,304 Fakultät für Mathematik und Informatik , 2018.305 Jean-Antoine Désidéri . Multiple-gradient descent algorithm ( mgda ) for multiobjective optimization . Comptes306 Rendus Mathematique , 350 ( 5-6 ) :313–318 , 2012.307 Qi Dou , Daniel C Castro , Konstantinos Kamnitsas , and Ben Glocker . Domain generalization via model-308 agnostic learning of semantic features . arXiv preprint arXiv:1910.13580 , 2019.309 Antonio D ’ Innocente and Barbara Caputo . Domain generalization with domain-specific aggregation modules.310 In German Conference on Pattern Recognition , pp . 187–198 . Springer , 2018.311 Joseph G Ecker and Jung Hwan Song . Optimizing a linear function over an efficient set . Journal of312 Optimization Theory and Applications , 83 ( 3 ) :541–563 , 1994.313 Christopher Fifty , Ehsan Amid , Zhe Zhao , Tianhe Yu , Rohan Anil , and Chelsea Finn . Measuring and314 harnessing transference in multi-task learning . arXiv preprint arXiv:2010.15413 , 2020.315 Yaroslav Ganin and Victor Lempitsky . Unsupervised domain adaptation by backpropagation . In International316 conference on machine learning , pp . 1180–1189 . PMLR , 2015.317 Yaroslav Ganin , Evgeniya Ustinova , Hana Ajakan , Pascal Germain , Hugo Larochelle , François Laviolette,318 Mario March , and Victor Lempitsky . Domain-adversarial training of neural networks . Journal of Machine319 Learning Research , 17 ( 59 ) :1–35 , 2016 . URL http : //jmlr.org/papers/v17/15-239.html.320 DP Hardin and EB Saff . Discretizing manifolds via minimum energy points . Notices of the AMS , 51 ( 10 ) :321 1186–1194 , 2004.322 Dan Hendrycks , Mantas Mazeika , Saurav Kadavath , and Dawn Song . Using self-supervised learning can323 improve model robustness and uncertainty . In H. Wallach , H. Larochelle , A. Beygelzimer , F. d'Alché-Buc,324 E. Fox , and R. Garnett ( eds . ) , Advances in Neural Information Processing Systems , volume 32 . Cur-325 ran Associates , Inc. , 2019 . URL https : //proceedings.neurips.cc/paper/2019/file/326 a2b15837edac15df90721968986f7f8e-Paper.pdf.327 Claus Hillermeier . Generalized homotopy approach to multiobjective optimization . Journal of Optimization328 Theory and Applications , 110 ( 3 ) :557–583 , 2001.329 Hisao Ishibuchi , Hiroyuki Masuda , Yuki Tanigaki , and Yusuke Nojima . Modified distance calculation in330 generational distance and inverted generational distance . In International conference on evolutionary331 multi-criterion optimization , pp . 110–125 . Springer , 2015.332 Adrián Javaloy and Isabel Valera . Rotograd : Dynamic gradient homogenization for multi-task learning . arXiv333 preprint arXiv:2103.02631 , 2021.334 Jesús M Jorge . A bilinear algorithm for optimizing a linear function over the efficient set of a multiple335 objective linear programming problem . Journal of Global Optimization , 31 ( 1 ) :1–16 , 2005.336 Mohammad Mahdi Kamani , Rana Forsati , James Z Wang , and Mehrdad Mahdavi . Pareto efficient fairness in337 supervised learning : From extraction to tracing . arXiv preprint arXiv:2104.01634 , 2021.338 Alex Kendall , Yarin Gal , and Roberto Cipolla . Multi-task learning using uncertainty to weigh losses for339 scene geometry and semantics . In Proceedings of the IEEE conference on computer vision and pattern340 recognition , pp . 7482–7491 , 2018.341 Pang Wei Koh and Percy Liang . Understanding black-box predictions via influence functions . In International342 Conference on Machine Learning , pp . 1885–1894 . PMLR , 2017.343 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy M. Hospedales . Deeper , broader and artier domain344 generalization . In Proceedings of the IEEE International Conference on Computer Vision ( ICCV ) , Oct345 2017.346 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy Hospedales . Learning to generalize : Meta-learning for347 domain generalization . In Proceedings of the AAAI Conference on Artificial Intelligence , volume 32,348 2018a.349 Ya Li , Xinmei Tian , Mingming Gong , Yajing Liu , Tongliang Liu , Kun Zhang , and Dacheng Tao . Deep350 domain generalization via conditional invariant adversarial networks . In Proceedings of the European351 Conference on Computer Vision ( ECCV ) , pp . 624–639 , 2018b.352 Xi Lin , Hui-Ling Zhen , Zhenhua Li , Qingfu Zhang , and Sam Kwong . Pareto multi-task learning . arXiv353 preprint arXiv:1912.12854 , 2019.354 Xi Lin , Zhiyuan Yang , Qingfu Zhang , and Sam Kwong . Controllable pareto multi-task learning . arXiv355 preprint arXiv:2010.06313 , 2020.356 Shikun Liu , Edward Johns , and Andrew J Davison . End-to-end multi-task learning with attention . In357 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pp . 1871–1880,358 2019.359 Zhengliang Liu and Matthias Ehrgott . Primal and dual algorithms for optimization over the efficient set.360 Optimization , 67 ( 10 ) :1661–1686 , 2018.361 Xiaoyuan Luo , Shaolei Liu , Kexue Fu , Manning Wang , and Zhijian Song . A learnable self-supervised task362 for unsupervised domain adaptation on point clouds . arXiv preprint arXiv:2104.05164 , 2021.363 Pingchuan Ma , Tao Du , and Wojciech Matusik . Efficient continuous pareto exploration in multi-task learning.364 In International Conference on Machine Learning , pp . 6522–6531 . PMLR , 2020.365 Debabrata Mahapatra and Vaibhav Rajan . Multi-task learning with user preferences : Gradient descent with366 controlled ascent in pareto optimization . In International Conference on Machine Learning , pp . 6597–6607.367 PMLR , 2020.368 Aviv Navon , Aviv Shamsian , Gal Chechik , and Ethan Fetaya . Learning the pareto front with hypernetworks.369 arXiv preprint arXiv:2010.04104 , 2020.370 Javad Sadeghi and Hossein Mohebi . Solving optimization problems over the weakly efficient set . Numerical371 Functional Analysis and Optimization , pp . 1–33 , 2021.372 Ozan Sener and Vladlen Koltun . Multi-task learning as multi-objective optimization . In S. Bengio , H. Wallach,373 H. Larochelle , K. Grauman , N. Cesa-Bianchi , and R. Garnett ( eds . ) , Advances in Neural Information Pro-374 cessing Systems , volume 31 . Curran Associates , Inc. , 2018 . URL https : //proceedings.neurips.375 cc/paper/2018/file/432aca3a1e345e339f35a30c8f65edce-Paper.pdf.376 Nathan Silberman , Derek Hoiem , Pushmeet Kohli , and Rob Fergus . Indoor segmentation and support377 inference from rgbd images . In European conference on computer vision , pp . 746–760 . Springer , 2012.378 Kihyuk Sohn , David Berthelot , Nicholas Carlini , Zizhao Zhang , Han Zhang , Colin A Raffel , Ekin Do-379 gus Cubuk , Alexey Kurakin , and Chun-Liang Li . Fixmatch : Simplifying semi-supervised learning380 with consistency and confidence . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and381 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 596–608 . Cur-382 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/383 06964dce9addb1c5cb5d6e3d9838f733-Paper.pdf.384 Yu Sun , Eric Tzeng , Trevor Darrell , and Alexei A Efros . Unsupervised domain adaptation through self-385 supervision . arXiv preprint arXiv:1909.11825 , 2019.386 Phan Thien Thach and TV Thang . Problems with resource allocation constraints and optimization over the387 efficient set . Journal of Global Optimization , 58 ( 3 ) :481–495 , 2014.388 Sen Wu , Hongyang R. Zhang , and Christopher Ré . Understanding and improving information transfer389 in multi-task learning . In International Conference on Learning Representations , 2020 . URL https:390 //openreview.net/forum ? id=SylzhkBtDB.391 Sang Michael Xie , Ananya Kumar , Robbie Jones , Fereshte Khani , Tengyu Ma , and Percy Liang . In-n-out : Pre-392 training and self-training using auxiliary information for out-of-distribution robustness . In International393 Conference on Learning Representations , 2021 . URL https : //openreview.net/forum ? id=394 jznizqvr15J.395 Junfeng Yang and Carl Vondrick . Multitask learning strengthens adversarial robustness . 2020.396 Tianhe Yu , Saurabh Kumar , Abhishek Gupta , Sergey Levine , Karol Hausman , and Chelsea Finn . Gra-397 dient surgery for multi-task learning . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and398 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 5824–5836 . Cur-399 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/400 3fe78a8acf5fda99de95303940a2420c-Paper.pdf.401 Linfeng Zhang , Muzhou Yu , Tong Chen , Zuoqiang Shi , Chenglong Bao , and Kaisheng Ma . Auxiliary training:402 Towards accurate and robust models . In Proceedings of the IEEE/CVF Conference on Computer Vision403 and Pattern Recognition , pp . 372–381 , 2020.404 Eckart Zitzler and Lothar Thiele . Multiobjective evolutionary algorithms : a comparative case study and the405 strength pareto approach . IEEE transactions on Evolutionary Computation , 3 ( 4 ) :257–271 , 1999.406 A THEORETICAL ANALYSIS407 Theorem 1 [ Dual of Equation ( 7 ) ] The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , with { λi , t } mi=1 the solution of the following dual problem max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt , where Rm+ is the set of nonnegative m-dimensional vectors , that is , Rm+ = { λ ∈ Rm : λi ≥ 0 , ∀i ∈ [ m ] } .408 Proof . By introducing Lagrange multipliers , the optimization in Equation ( 7 ) is equivalent to the following409 minimax problem:410 min v∈Rn max λ∈Rm+ 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) . With strong duality of convex quadratic programming ( assuming the primal problem is feasible ) , we can exchange the order of min and max , yielding max λ∈Rm+ { Φ ( λ ) : = min v∈Rn 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) } . It is easy to see that the minimization w.r.t . v is achieved when v = ∇F ( θt ) + ∑m i=1 λi∇ ` i ( θt ) . Correspond-411 ingly , the Φ ( λ ) has the following dual form:412 max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λi∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt . This concludes the proof.413 Theorem 2 [ Pareto Improvement on ` ] Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θt ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.414 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters415 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .416 Proof . i ) When t < te , we have g ( θt ) > e and hence d dt ` i ( θt ) = −∇ ` i ( θt ) > vt ≤ −φt = −αtg ( θt ) , ( 11 ) where we used the constraint of∇ ` i ( θt ) > vt ≥ φt in Equation ( 7 ) . Therefore , we yield strict decent on all the417 losses { ` i } when αtg ( θt ) > 0.418 ii ) Integrating both sides of Equation ( 11 ) : min s∈ [ 0 , t ] g ( θs ) ≤ ∫ t 0 αsg ( θs ) ds∫ t 0 αsds ≤ ` i ( θ0 ) − ` i ( θt ) ∫ t 0 αsds ≤ ` i ( θ0 ) − ` ∗∫ t 0 αsds . This yields the result since it holds for every i ∈ [ m ] .419 If ∫∞ 0 αtdt = +∞ , then we have mins∈ [ 0 , t ] g ( θs ) → 0 when t → +∞ . Assume there exists an > e,420 such that θt never enters P at finite t. Then we have g ( θt ) ≥ for t ∈ R+ , which contradicts with421 mins∈ [ 0 , t ] g ( θs ) → 0.422 iii ) Assume there exists a finite time t′ ∈ ( t , +∞ ) such that θt′ 6∈ P . Because > e and g is continuous , Pe423 is in the interior of P ⊆ P . Therefore , the trajectory leading to θt′ 6∈ P must pass through P \Pe at some424 point , that is , there exists a point t′′ ∈ [ t , t′ ) , such that { θt : t ∈ [ t′′ , t′ ] } 6∈ Pe . But because the algorithm can425 not increase any objective ` i outside of Pe , we must have ` ( θt′ ) ` ( θt′′ ) , yielding that θt′ ∈ { θt′′ } ⊆ P ,426 where { θt′′ } is the Pareto closure of { θt′′ } ; this contradicts with the assumption.427 Lemma 1 Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,428 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } ,429 that is , there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and430 ` ( θ′ ) ` ( θt ) .431 Proof . Note that minimizing F in { θt } can be framed into a constrained optimization problem : min θ F ( θ ) s.t . ` i ( θ ) ≤ ` i ( θt ) , ∀i ∈ [ m ] . In addition , by assumption , θ = θt satisfies vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) = 0 , which is the KKT432 stationarity condition of the constrained optimization . It is also obvious to check that θ = θt satisfies the433 feasibility and slack condition trivially . Combining this with the local convexity assumption yields the434 result.435 Theorem 3 [ Optimization of F ] Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .436 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .437 Proof . i ) The slack condition of the constrained optimization in Equation ( 7 ) says that λi , t ( ∇ ` i ( θt ) > vt − φt ) = 0 , ∀i ∈ [ m ] . ( 12 ) This gives that ‖vt‖2 = ( ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) ) > vt = ∇F ( θt ) > vt + m∑ i=1 λi , tφt //plugging Equation ( 12 ) . ( 13 ) If θt 6∈ Pe , we have φt = αtg ( θt ) and this gives d dt F ( θt ) = −∇F ( θt ) > vt = −‖vt‖2 + m∑ i=1 λi , tφt = − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) If θt is in the interior of Pe , then we run typical gradient descent of F and hence has d dt F ( θt ) = −‖vt‖2 = − ∥∥∥∥dθtdt ∥∥∥∥2 . If θt is on the boundary of Pe , then by the definition of differential inclusion , dθ/dt belongs to the convex hull of the velocities that it receives from either side of the boundary , yielding that d dt F ( θt ) = − ∥∥∥∥dθtdt ∥∥∥∥2 + β m∑ i=1 λi , tαtg ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) , where β ∈ [ 0 , 1 ] . Combining all the cases gives d dt F ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) . Integrating this yields min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ 1t ∫ t 0 ∥∥∥∥dθsds ∥∥∥∥2 ds ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 m∑ i=1 λi , sαsg ( θs ) ds ≤ F ( θ0 ) − F ∗ t + 1 t ∫ t 0 αs ( αsg + c √ g ) ds , where the last step used Lemma 2 with φt = αtg ( θt ) : m∑ i=1 λi , tαtg ( θt ) ≤ α2t g ( θt ) + cαt √ g ( θt ) ≤ α2t g + cαt √ g , and here we used g ( θt ) ≤ g because the trajectory is contained in P following Theorem 2.438 The remaining results follow Lemma 4.439 A.0.1 TECHNICAL LEMMAS440 Lemma 2 . Assume Assumption 1 holds . Define g ( θ ) = minω∈Cm ‖ ∑m i=1 ωi∇ ` i ( θ ) ‖ 2 , where Cm is the probability simplex on [ m ] . Then for the vt and λi , t defined in Equation ( 7 ) and Equation ( 10 ) , we have m∑ i=1 λi , tg ( θt ) ≤ max ( φt + c √ g ( θt ) , 0 ) . Proof . The slack condition of the constrained optimization in Equation ( 7 ) says that441 λi , t ( ∇ ` i ( θ ) > vt − φt ) = 0 , ∀i ∈ [ m ] . Sum the equation over i ∈ [ m ] and note that vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) . We get∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 + ( m∑ i=1 λi , t∇ ` i ( θt ) ) > ∇F ( θ ) − m∑ i=1 λi , tφt = 0 . ( 14 ) Define xt = ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 , λ̄t = m∑ i=1 λi , t , gt = g ( θt ) = min ω∈Cm ∥∥∥∥∥ m∑ i=1 ωi∇ ` i ( θt ) ∥∥∥∥∥ 2 . Then it is easy to see that xt ≥ λ̄2t gt . Using Cauchy-Schwarz inequality , ∣∣∣∣∣∣ ( m∑ i=1 λi , t∇ ` i ( θ ) ) > ∇F ( θt ) ∣∣∣∣∣∣ ≤ ‖∇F ( θt ) ‖ ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θ ) ∥∥∥∥∥ ≤ c√xt , where we used ‖∇F ( θt ) ‖ ≤ c by Assumption 1 . Combining this with Equation ( 14 ) , we have∣∣xt − λ̄tφt∣∣ ≤ c√xt . Applying Lemma 3 yields the result.442 Lemma 3 . Assume φ ∈ R , and x , λ , c , g ∈ R+ are non-negative real numbers and they satisfy |x− λφ| ≤ c √ x , x ≥ λ2g . Then we have λg ≤ max ( 0 , φ+ c√g ) .443 Proof . Square the first equation , we get f ( x ) : = ( x− λφ ) 2 − c2x ≤ 0 , where f is a quadratic function . To ensure that f ( x ) ≤ 0 has a solution that satisfies x ≥ λ2g , we need to have f ( λ2g ) ≤ 0 , that is , f ( λ2g ) = ( λ2g − λφ ) 2 − c2λ2g ≤ 0 . This can hold under two cases:444 Case 1 : λ = 0 ; 445 Case 2 : |λg − φ| ≤ c√g , and hence φ− c√g ≤ λg ≤ φ+ c√g.446 Under both case , we have λg ≤ max ( 0 , φ+ c√g ) . 447 Lemma 4 . Let { αt : t ∈ R+ } ⊆ R+ be a non-negative sequence with A : = ( ∫∞ 0 αγt dt ) 1/γ < ∞ , where γ ≥ 1 , and B = supt αt < ∞ . Then we have 1 t ∫ t 0 ( α2s + αs ) ds ≤ ( B + 1 ) At−1/γ . Proof . Let η = γγ−1 , so that 1/η + 1/γ = 1 . We have by Holder ’ s inequality , ∫ t 0 αsds ≤ ( ∫ t 0 αγsds ) 1/γ ( ∫ t 0 1ηds ) 1/η ≤ At1/η = At1−1/γ . and hence 1 t ∫ t 0 ( α2s + αs ) ds ≤ B + 1 t ∫ t 0 αsds ≤ ( B + 1 ) At−1/γ . 448 Algorithm 1 Pareto Navigating Gradient Descent 1 : Initialize θ0 ; decide the step size ξ , and the control function φ in Equation ( 8 ) ( including the threshold e > 0 and the descending rate { αt } ) . 2 : for iteration t do θt+1 ← θt − ξvt , vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , ( 15 ) where λi , t = 0 , ∀i ∈ [ m ] if g ( θt ) ≤ e , and { λi , t } mt=1 is the solution of Equation ( 10 ) with φ ( θt ) = αtg ( θt ) when g ( θt ) > e. 3 : end for B PRACTICAL IMPLEMENTATION449 Hyper-parameters Our algorithm introduces two hyperparameters { αt } and e over vanilla gradient descent.450 We use constant sequence αt = α and we take α = 0.5 unless otherwise specified . We choose e by451 e = γe0 , where e0 is an exponentially discounted average of 1m ∑m i=1 ‖∇ ` i ( θt ) ‖ 2 over the trajectory so that452 it automatically scales with the magnitude of the gradients of the problem at hand . In the experiments of this453 paper , we simply fix γ = 0.1 unless specified.454 Solving the Dual Problem Our method requires to calculate { λi , t } mt=1 with the dual optimization problem455 in Equation ( 10 ) , which can be solved with any off-the-shelf convex quadratic programming tool . In this456 work , we use a very simple projected gradient descent to approximately solve Equation ( 10 ) . We initialize457 { λi , t } mt=1 with a zero vector and terminate when the difference between the last two iterations is smaller than458 a threshold or the algorithm reaches the maximum number of iterations ( we use 100 in all experiments ) .459 The whole algorithm procedure is summarized in Algorithm 1.460 C EXPERIMENTS461 C.1 FINDING PREFERRED PARETO MODELS462 C.1.1 RATIO-BASED CRITERION463 The non-uniformity score from ( Mahapatra & Rajan , 2020 ) that we use in Figure 1 is defined as FNU ( θ ) = m∑ t=1 ˆ̀ t ( θ ) log ( ˆ̀ t ( θ ) 1/m ) , ˆ̀t ( θ ) = rt ` t ( θ ) ∑ s∈ [ m ] rs ` s ( θ ) . ( 16 ) We fix the other experiment settings the same as Mahapatra & Rajan ( 2020 ) and use γ = 0.01 and α = 0.25464 for this experiment reported in the main text . We defer the ablation studies on the hyper-parameter α and γ to465 Section C.3.466 C.1.2 ZDT2-VARIANT467 We consider the ZDT2-Variant example used in Ma et al . ( 2020 ) with the same experiment setting , in468 which the Pareto set is a cylindrical surface , making the problem more challenging . We consider the469 same criteria , e.g . weighted distance and complex cosine used in the main context with different choices470 of r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] . We use the default hyper-parameter set up , choosing α = 0.5 and r = 0.1.471 For complex cosine , we use MGD updating for the first 150 iterations . Figure 2 shows the trajectories,472 demonstrating that PNG works pretty well for the more challenging ZDT2-Variant tasks.473 C.1.3 GENERAL CRITERIA : THREE-TASK LEARNING ON THE NYUV2 DATASET474 We show that PNG is able to handle large-scale multitask learning problems by deploying it on a three-475 task learning problem ( segmentation , depth estimation , and surface normal prediction ) on NYUv2 dataset476 ( Silberman et al. , 2012 ) . The main goal of this experiment is to show that : 1 . PNG is able to handle477 OPT-in-Pareto in a large-scale neural network ; 2 . With a proper design of criteria , PNG enables to do478 targeted fine-tuning that pushes the model to move towards a certain direction . We consider the same479 training protocol as Liu et al . ( 2019 ) and use the MTAN network architecture . Start with a model trained480 with equally weighted linear scalarization and our goal is to further improve the model ’ s performance481 on segmentation and surface normal estimation while allowing some sacrifice on depth estimation . This482 can be achieved by many different choices of criterion and in this experiment , we consider the following483 design : F ( θ ) = ( ` seg ( θ ) × ` surface ( θ ) ) / ( 0.001 + ` depth ( θ ) ) . Here ` seg , ` surface and ` depth are the loss functions484 for segmentation , surface normal prediction and depth estimation , respectively . The constant 0.001 in the485 denominator is for numeric stability . We point out that our design of criterion is a simple heuristic and might486 not be an optimal choice and the key question we study here is to verify the functionality of the proposed487 PNG . As suggested by the open-source repository of Liu et al . ( 2019 ) , we reproduce the result based on the488 provided configuration . To show that PNG is able to move the model along the Pareto front , we show the489 evolution of the criterion function and the norm of the MGD gradient during the training in Figure 3 . As we490 can see , PNG effectively decreases the value of criterion function while the norm of MGD gradient remains491 the same . This demonstrates that PNG is able to minimize the criterion by searching the model in the Pareto492 set . Table 3 compares the performances on the three tasks using standard training and PNG , showing that493 PNG is able to improve the model ’ s performance on segmentation and surface normal prediction tasks while494 satisfying a bit of the performance in depth estimation based on the criterion.495 C.2 FINDING DIVERSE PARETO MODELS496 C.2.1 EXPERIMENT DETAILS497 We train the model for 100 epochs using Adam op-498 timizer with batch size 256 and 0.001 learning rate.499 To encourage diversity of the models , following the500 setting in Mahapatra & Rajan ( 2020 ) , we use equally501 distributed preference vectors for linear scalarization502 and EPO . Note that the stochasticity of using mini-503 batches is able to improve the performance of Pareto504 approximation for free by also using the intermedi-505 ate checkpoints to approximate P . To fully exploit506 this advantage , for all the methods , we collect check-507 points every epoch to approximate P , starting from508 epoch 60.509 C.2.2 EVALUATION METRIC DETAILS510 We introduce the definition of the used metric for511 evaluation . Given a set P̂ = { θ1 , . . . , θN } that we512 use to approximate P , its IGD+ score is defined as:513 IGD+ ( P̂ ) = ∫ P∗ q ( θ , P̂ ) dµ ( θ ) , q ( θ , P̂ ) = min θ̂∈P̂ ∥∥∥∥ ( ` ( θ̂ ) − ` ( θ ) ) + ∥∥∥∥ , where µ is some base measure that measures the importance of θ ∈ P and ( t ) + : = max ( t , 0 ) , applied on514 each element of a vector . Intuitively , for each θ , we find a nearest θ̂ ∈ P̂ that approximates θ best . Here515 the ( · ) + is applied as we only care the tasks that θ̂ is worse than θ . In practice , a common choice of µ can516 be a uniform counting measure with uniformly sampled ( or selected ) models from P . In our experiments,517 since we can not sample models from P , we approximate P by combining P̂ from all the methods , i.e.,518 P ≈ ∪m∈ { Linear , MGD , EPO , PNG } P̂m , where P̂m is the approximation set produced by algorithm m.519 This approximation might not be accurate but is sufficient to compare the different methods,520 The Hypervolume score of P̂ , w.r.t . a reference point ` r ∈ Rm+ , is defined as521 HV ( P̂ ) = µ ( { ` = [ ` 1 , ... , ` m ] ∈ Rm | ∃θ ∈ P̂ , s.t . ` t ( θ ) ≤ ` t ≤ ` rt ∀t ∈ [ m ] } ) , where µ is again some measure . We use ` r = [ 0.6 , 0.6 ] for calculating the Hypervolume based on loss and522 set µ to be the common Lebesgue measure . Here we choose 0.6 as we observe that the losses of the two tasks523 are higher than 0.6 and 0.6 is roughly the worst case . When calculating Hypervolume based on accuracy , we524 simply flip the sign.525 C.2.3 ABLATION STUDY526 We conduct ablation study to understand the effect of α and γ using the Pareto approximation task on527 Multi-Mnist . We compare PNG with α = 0.25 , 0.5 , 0.75 and γ = 0.01 , 0.1 , 0.25 . Figure 4 summarizes the528 result . Overall , we observe that PNG is not sensitive to the choice of hyper-parameter.529 C.2.4 COMPARING WITH THE SECOND ORDER APPROACH530 We give a discussion on comparing our approach with the second order approaches proposed by Ma et al.531 ( 2020 ) . In terms of algorithm , Ma et al . ( 2020 ) is a local expansion approach . To apply Ma et al . ( 2020 ) ,532 in the first stage , we need to start with several well distributed models ( i.e. , the ones obtained by linear533 scalarization with different preference weights ) and Ma et al . ( 2020 ) is only applied in the second stage to534 find the neighborhood of each model . The performance gain comes from the local neighbor search of each535 model ( i.e . the second stage ) .536 In comparison , PNG with energy distance is a global search approach . It improves the well-distributedness537 of models in the first stage ( i.e . it ’ s a better approach than simply using linear scalarization with different538 weights ) . And thus the performance gain comes from the first stage . Notice that we can also apply Ma et al.539 ( 2020 ) to PNG with energy distance to add extra local search to further improve the approximation.540 In terms of run time comparison . We compare the wall clock run time of each step of updating the 5 models541 using PNG and the second order approach in Ma et al . ( 2020 ) . We calculate the run time based on the542 multi-MNIST dataset using the average of 100 steps . PNG uses 0.3s for each step while Ma et al . 2020 uses543 16.8s . PNG is 56x faster than the second order approach . And we further argue that , based on time complexity544 theory , the gap will be even larger when the size of the network increases.545 C.3 UNDERSTANDING PNG DYNAMICS546 We draw more analysis to understand the training dynamics of PNG.547 Different Staring Points We give analysis on PNG with different initializations showing that PNG is548 more robust to the initialization than other approaches such as Lin et al . ( 2019 ) . We consider the Pareto set549 approximation tasks and reuse synthetic example introduced in Section 5.1 . We consider learning 5 models to550 approximate the Pareto front staring from two different bad starting points . Specifically , in the upper row of551 Figure 4 , we consider initializing the models using linear scalarization . Due to the concavity of the Pareto552 front , linear scalarization can only learns models at the two extreme end of the Pareto front . The second row553 uses MGD for initialization and the models is scattered at an small region of the Pareto front . Different from554 the algorithm proposed by Lin et al . ( 2019 ) which relies on a good initialization , using the proposed energy555 distance function , PNG pushes the models to be equally distributed on the Pareto Front without the need of556 any prior information of the Pareto front even with extremely bad starting point.557 Trajectory Visualization with Different Hyper-parameters We also give more visualization on the PNG558 trajectory when using different hyper-parameters . We reuse synthetic example introduced in Section 5.1559 for studying the hyper-parameters α and γ . We fix α = 0.25 and vary γ = 0.1 , 0.05 , 0.01 , 0.1 ; and fix560 γ = 0.01 and vary α = 0.1 , 0.25 , 0.5 , 0.75 . Figure 5 plots the trajectories . As we can see , when γ is properly561 chosen , with different α , PNG finds the correct models with different trajectories . Different α determines the562 algorithm ’ s behavior of balancing the descent of task losses or criterion objectives . On the other hand , with563 too large γ , the algorithm fails to find a model that is close to P∗ , which is expected.564 C.4 IMPROVING MULTITASK BASED DOMAIN GENERALIZATION565 We argue that many other deep learning problems also have the structure of multitask learning when multiple566 losses presents and thus optimization techniques in multitask learning can also be applied to those domains.567 In this paper we consider the JiGen ( Carlucci et al. , 2019b ) . JiGen learns a model that can be generalized to568 unseen domain by minimizing a standard cross-entropy loss ` class for classification and an unsupervised loss569 ` jig based on Jigsaw Puzzles:570 ` ( θ ) = ( 1− ω ) ` class ( θ ) + ω ` jig ( θ ) . The ratio between two losses , i.e . ω , is important to the final performance of the model and requires a571 careful grid search . Notice that JiGen is essentially searching for a model on the Pareto front using the linear572 scalarization . Instead of using a fixed linear scalarization to learn a model , one natural questions is that573 whether it is possible to design a mechanism that dynamically adjusts the ratio of the losses so that we can574 achieve to learn a better model.575 We give a case study here . Motivated by the adversarial feature learning ( Ganin et al. , 2016 ) , we propose576 to improve JiGen such that the latent feature representations of the two tasks are well aligned . Specifically,577 suppose that Φclass ( θ ) = { φclass ( xi , θ ) } ni=1 and Φjig ( θ ) = { φjig ( xi , θ ) } ni=1 is the distribution of latent feature578 representation of the two tasks , where xi is the i-th training data . We consider FPD as some probability metric579 that measures the distance between two distributions , we consider the following problem:580 min θ∈P∗ FPD [ Φclass ( θ ) , Φjig ( θ ) ] . With PD as the criterion function , our algorithm automatically reweights the ratio of the two tasks such that581 their latent space is well aligned.582 Setup We fix all the experiment setting the same as Carlucci et al . ( 2019b ) . We use the Alexnet and Resnet-18583 with multihead pretrained on ImageNet as the multitask network . We evaluate the methods on PACS ( Li et al.,584 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon and Sketches ) . Same to585 Carlucci et al . ( 2019b ) , we trained our model considering three domains as source datasets and the remaining586 one as target . We implement FPD that measures the discrepancy of the feature space of the two tasks using587 the idea of Domain Adversarial Neural Networks ( Ganin & Lempitsky , 2015 ) by adding an extra prediction588 head on the shared feature space to predict the whether the input is for the classification task or Jigsaw task.589 Specifically , we add an extra linear layer on the shared latent feature representations that is trained to predict590 the task that the latent space belongs to , i.e.,591 FPD ( Φclass ( θ ) , Φjig ( θ ) ) = min w , b 1 n n∑ i=1 log ( σ ( w > φclass ( xi , θ ) ) ) + log ( 1− σ ( w > φclass ( xi , θ ) ) ) . Notice that the optimal weight and bias for the linear layer depends on the model parameter θ , during the592 training , both w , b and θ are jointly updated using stochastic gradient descent . We follow the default training593 protocol provided by the source code of Carlucci et al . ( 2019b ) .594 Baselines Our main baselines are JiGen ( Carlucci et al. , 2019b ) ; JiGen + adv , which adds an extra domain595 adversarial loss on JiGen ; and our PNG with domain adversarial loss as criterion function . In order to run596 statistical test for comparing the methods , we run all the main baselines using 3 random trials . We use the597 released source code by Carlucci et al . ( 2019b ) to obtained the performance of JiGen . For JiGen+adv , we use598 an extra run to tune the weight for the domain adversarial loss . Besides the main baselines , we also includes599 TF ( Li et al. , 2017 ) , CIDDG ( Li et al. , 2018b ) , MLDG ( Li et al. , 2018a ) , D-SAM ( D ’ Innocente & Caputo,600 2018 ) and DeepAll ( Carlucci et al. , 2019b ) as baselines with the author reported performance for reference.601 Result The result is summarized in Table 5 with bolded value indicating the statistical significant best methods602 with p-value based on matched-pair t-test less than 0.1 . Combining Jigen and PNG to dynamically reweight603 the task weights is able to implicitly regularizes the latent space without adding an actual regularizer which604 might hurt the performance on the tasks and thus improves the overall result.605 | This paper deals with multi-objective optimization. In particular, given loss functions $\ell_1,\dots,\ell_m$ and $F$, the goal is to minimize $F$ in the Pareto set of $\ell_1,\dots,\ell_m$, i.e. $\min_{\theta} F(\theta)$ under the constraint that for all $\theta'$ there exists $j$ with $\ell_j(\theta') \geq \ell_j(\theta)$. This is useful for multi-task learning, where we are interested in training a model with robust performance under a variety of tasks. The main contribution is an algorithm that attempts to approximate this optimization problem. The main idea is to take steps in some direction $v$ that correlates as much as possible with $-\nabla F(\theta)$, while making sure that $\langle v, -\nabla \ell_j(\theta)\rangle \geq \alpha$ for all $j$, and some scalar $\alpha$. The theoretical results show that the above continuous process will converge to a solution $\theta$ that, if $F$ and $\ell_j$'s are locally convex at $\theta$, cannot be locally improved in the sense that any direction that decreases $F$ gives a solution that is Pareto-dominated by $\theta$. The experimental results show how the algorithm performs when $F$ is designed to 1) balance the ratios between the losses $\ell_j$ based on some pre-specified numbers and 2) maximize diversity of a bunch of solutions $\theta_1,\dots,\theta_k$ and 3) domain generalization. | SP:ff2436a7f3e442bf9b1f847a151bc547a91f43e6 |
Pareto Navigation Gradient Descent: a First Order Algorithm for Optimization in Pareto Set | Many modern machine learning applications , such as multi-task learning , require finding1 optimal model parameters to trade-off multiple objective functions that may conflict with2 each other . The notion of the Pareto set allows us to focus on the set of ( often infinite number3 of ) models that can not be strictly improved . But it does not provide an actionable procedure4 for picking one or a few special models to return to practical users . In this paper , we5 consider optimization in Pareto set ( OPT-in-Pareto ) , the problem of finding Pareto models6 that optimize an extra reference criterion function within the Pareto set . This function can7 either encode a specific preference from the users , or represent a generic diversity measure8 for obtaining a set of diversified Pareto models that are representative of the whole Pareto9 set . Unfortunately , despite being a highly useful framework , efficient algorithms for OPT-10 in-Pareto have been largely missing , especially for large-scale , non-convex , and non-linear11 objectives in deep learning . A naive approach is to apply Riemannian manifold gradient12 descent on the Pareto set , which yields a high computational cost due to the need for eigen-13 calculation of Hessian matrices . We propose a first-order algorithm that approximately14 solves OPT-in-Pareto using only gradient information , with both high practical efficiency15 and theoretically guaranteed convergence property . Empirically , we demonstrate that our16 method works efficiently for a variety of challenging multi-task-related problems.17 1 INTRODUCTION18 Although machine learning tasks are traditionally framed as optimizing a single objective . Many modern19 applications , especially in areas like multitask learning , require finding optimal model parameters to minimize20 multiple objectives ( or tasks ) simultaneously . As the different objective functions may inevitably conflict21 with each other , the notion of optimality in multi-objective optimization ( MOO ) needs to be characterized by22 the Pareto set : the set of model parameters whose performance of all tasks can not be jointly improved.23 Focusing on the Pareto set allows us to filter out models that can be strictly improved . However , the Pareto24 set typically contains an infinite number of parameters that represent different trade-offs of the objectives.25 For m objectives ` 1 , . . . , ` m , the Pareto set is often an ( m− 1 ) dimensional manifold . It is both intractable26 and unnecessary to give practical users the whole exact Pareto set . A more practical demand is to find some27 user-specified special parameters in the Pareto set , which can be framed into the following optimization in28 Pareto set ( OPT-in-Pareto ) problem:29 Finding one or a set of parameters inside the Pareto set of ` 1 , . . . , ` m that minimize a reference criterion F .30 Here the criterion function F can be used to encode an informative user-specific preference on the objectives31 ` 1 , . . . , ` m , which allows us to provide the best models customized for different users . F can also be an32 non-informative measure that encourages , for example , the diversity of a set of model parameters . In this33 case , optimizing F in Pareto set gives a set of diversified Pareto models that are representative of the whole34 Pareto set , from which different users can pick their favorite models during the testing time.35 OPT-in-Pareto provides a highly generic and actionable framework for multi-objective learning and opti-36 mization . However , efficient algorithms for solving OPT-in-Pareto have been largely lagging behind in deep37 learning where the objective functions are non-convex and non-linear . Although has not been formally studied,38 a straightforward approach is to apply manifold gradient descent on F in the Riemannian manifold formed by39 the Pareto set ( Hillermeier , 2001 ; Bonnabel , 2013 ) . However , this casts prohibitive computational cost due40 to the need for eigen-computation of Hessian matrices of { ` i } . In the optimization and operation research41 literature , there has been a body of work on OPT-in-Pareto viewing it as a special bi-level optimization42 problem ( Dempe , 2018 ) . However , these works often heavily rely on the linearity and convexity assumptions43 and are not applicable to the non-linear and non-convex problems in deep learning ; see for examples in Ecker44 & Song ( 1994 ) ; Jorge ( 2005 ) ; Thach & Thang ( 2014 ) ; Liu & Ehrgott ( 2018 ) ; Sadeghi & Mohebi ( 2021 ) ( just45 to name a few ) . In comparison , the OPT-in-Pareto problem seems to be much less known and under-explored46 in the deep learning literature.47 In this work , we provide a practically efficient first-order algorithm for OPT-in-Pareto , using only gradient48 information of the criterion F and objectives { ` i } . Our method , named Pareto navigation gradient descent49 ( PNG ) , iteratively updates the parameters following a direction that carefully balances the descent on F and50 { ` i } , such that it guarantees to move towards the Pareto set of { ` i } when it is far away , and optimize F in a51 neighborhood of the Pareto set . Our method is simple , practically efficient and has theoretical guarantees.52 In empirical studies , we demonstrate that our method works efficiently for both optimizing user-specific53 criteria and diversity measures . In particular , for finding representative Pareto solutions , we propose an54 energy distance criterion whose minimizers distribute uniformly on the Pareto set asymptotically ( Hardin55 & Saff , 2004 ) , yielding a principled and efficient Pareto set approximation method that compares favorably56 with recent works such as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) . We also apply PNG to improve the57 performance of JiGen ( Carlucci et al. , 2019b ) , a multi-task learning approach for domain generalization , by58 using the adversarial feature discrepancy as the criterion objective.59 Related Work There has been a rising interest in MOO in deep learning , mostly in the context of multi-task60 learning . But most existing methods can not be applied to the general OPT-in-Pareto problem . A large body61 of recent works focus on improving non-convex optimization for finding some model in the Pareto set , but62 can not search for a special model satisfying a specific criterion ( Chen et al. , 2018 ; Kendall et al. , 2018 ; Sener63 & Koltun , 2018 ; Yu et al. , 2020 ; Chen et al. , 2020 ; Wu et al. , 2020 ; Fifty et al. , 2020 ; Javaloy & Valera , 2021 ) .64 One exception is Mahapatra & Rajan ( 2020 ) ; Kamani et al . ( 2021 ) , which searches for models in the Pareto65 set that satisfy a constraint on the ratio between the different objectives . The problem they study can be66 viewed as a special instance of OPT-in-Pareto . However , their approaches are tied with special properties of67 the ratio constraint and do not apply to the general OPT-in-Pareto problem.68 There has also been increasing interest in finding a compact approximation of the Pareto set . Navon et al.69 ( 2020 ) ; Lin et al . ( 2020 ) use hypernetworks to approximate the map from linear scalarization weights to70 the corresponding Pareto solutions ; these methods could not fully profile non-convex Pareto fronts due71 to the limitation of linear scalarization ( Boyd et al. , 2004 ) , and the use of hypernetwork introduces extra72 optimization difficulty . Another line of works ( Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ) approximate73 the Pareto set by training models with different user preference vectors that rank the relative importance74 of different tasks ; these methods need a good heuristic design of preference vectors , which requires prior75 knowledge of the Pareto front . Ma et al . ( 2020 ) leverages manifold gradient to conduct a local random walk76 on the Pareto set but suffers from the high computational cost . Deist et al . ( 2021 ) approximates the Pareto set77 by maximizing hypervolume , which requires prior knowledge for choosing a good reference vector.78 Multi-task learning can also be applied to improve the learning in many other domains including domain79 generalization ( Dou et al. , 2019 ; Carlucci et al. , 2019a ; Albuquerque et al. , 2020 ) , domain adaption ( Sun80 et al. , 2019 ; Luo et al. , 2021 ) , model uncertainty ( Hendrycks et al. , 2019 ; Zhang et al. , 2020 ; Xie et al. , 2021 ) ,81 adversarial robustness ( Yang & Vondrick , 2020 ) and semi-supervised learning ( Sohn et al. , 2020 ) . All of82 those applications utilize a linear scalarization to combine the multiple objectives and it is thus interesting to83 apply the proposed OPT-in-Pareto framework , which we leave for future work.84 2 BACKGROUND ON MULTI-OBJECTIVE OPTIMIZATION85 We introduce the background on multi-objective optimization ( MOO ) and Pareto optimality . For notation,86 we denote by [ m ] the integer set { 1 , 2 , .... , m } , and R+ the set of non-negative real numbers . Let Cm =87 { ω ∈ Rm+ , ∑m i=1 ωi = 1 } be the probability simplex . We denote by ‖·‖ the Euclidean norm.88 Let θ ∈ Rn be a parameter of interest ( e.g. , the weights in a deep neural network ) . Let ` ( θ ) =89 [ ` 1 ( θ ) , . . . , ` m ( θ ) ] be a set of objective functions that we want to minimize . For two parameters θ , θ′ ∈ Rn,90 we write ` ( θ ) ` ( θ′ ) if ` i ( θ ) ≥ ` i ( θ′ ) for all i ∈ [ m ] ; and write ` ( θ ) ` ( θ′ ) if ` ( θ ) ` ( θ′ ) and91 ` ( θ ) 6= ` ( θ′ ) . We say that θ is Pareto dominated ( or Pareto improved ) by θ′ if ` ( θ ) ` ( θ′ ) . We say that θ is92 Pareto optimal on a set Θ ⊆ Rn , denoted as θ ∈ Pareto ( Θ ) , if there exists no θ′ ∈ Θ such that ` ( θ ) ` ( θ′ ) .93 The Pareto global optimal set P∗∗ : = Pareto ( Rn ) is the set of points ( i.e. , θ ) which are Pareto optimal on94 the whole domain Rn . The Pareto local optimal set of ` , denoted by P∗ , is the set of points which are Pareto95 optimal on a neighborhood of itself:96 P∗ : = { θ ∈ Rn : there exists a neighborhood Nθ of θ , such that θ ∈ Pareto ( Nθ ) } . The ( local or global ) Pareto front is the set of objective vectors achieved by the Pareto optimal points , e.g.,97 the local Pareto front is F∗ = { ` ( θ ) : θ ∈ P∗ } . Because finding global Pareto optimum is intractable for98 non-convex objectives in deep learning , we focus on Pareto local optimal sets in this work ; in the rest of the99 paper , terms like “ Pareto set ” and “ Pareto optimum ” refer to Pareto local optimum by default.100 Pareto Stationary Points Similar to the case of single-objective optimization , Pareto local optimum implies a notion of Pareto stationarity defined as follows . Assume ` is differentiable on Rn . A point θ is called Pareto stationary if there must exists a set of non-negative weights ω1 , . . . , ωm with ∑m i=1 ωi = 1 , such that θ is a stationary point of the ω-weighted linear combination of the objectives : ` ω ( θ ) : = ∑m i=1 ωi ` i ( θ ) . Therefore , the set of Pareto stationary points , denoted by P , can be characterized by P : = { θ ∈ Θ : g ( θ ) = 0 } , g ( θ ) : = min ω∈Cm || m∑ i=1 ωi∇ ` i ( θ ) ||2 , ( 1 ) where g ( θ ) is the minimum squared gradient norm of ` ω among all ω in the probability simplex Cm on [ m ] .101 Because g ( θ ) can be calculated in practice , it provides an essential way to access Pareto local optimality.102 Finding Pareto Optimal Points A main focus of the MOO literature is to find a ( set of ) Pareto optimal103 points . The simplest approach is linear scalarization , which minimizes ` ω for some weight ω ( decided , e.g.,104 by the users ) in Cm . However , linear scalarization can only find Pareto points that lie on the convex envelop105 of the Pareto front ( see e.g. , Boyd et al. , 2004 ) , and hence does not give a complete profiling of the Pareto106 front when the objective functions ( and hence their Pareto front ) are non-convex.107 Multiple gradient descent ( MGD ) ( Désidéri , 2012 ) is an gradient-based algorithm that can converge to a Pareto local optimum that lies on either the convex or non-convex parts of the Pareto front , depending on the initialization . MGD starts from some initialization θ0 and updates θ at the t-th iteration by θt+1 ← θt − ξvt , vt : = arg max v∈Rn { min i∈ [ m ] ∇ ` i ( θt ) > v − 1 2 ‖v‖2 } , ( 2 ) where ξ is the step size and vt is an update direction that maximizes the worst descent rate among all108 objectives , since ∇ ` i ( θt ) > v ≈ ( ` i ( θt ) − ` i ( θt − ξv ) ) /ξ approximates the descent rate of objective ` i when109 following direction v. When using a sufficiently small step size ξ , MGD ensures to yield a Pareto improvement110 ( i.e , decreasing all the objectives ) on θt unless θt is Pareto ( local ) optimal ; this is because the optimization in111 Equation ( 2 ) always yields mini∈ [ m ] ∇ ` i ( θt ) > vt ≤ 0 ( otherwise we can simply flip the sign of vt ) .112 Using Lagrange strong duality , the solution of Equation ( 2 ) can be framed into vt = m∑ i=1 ωi , t∇ ` i ( θt ) , where { ωi , t } mi=1 = arg min ω∈Cm ‖∇θ ` ω ( θt ) ‖ . ( 3 ) It is easy to see from Equation ( 3 ) that the set of fixed points of MDG ( which satisfy vt = 0 ) coincides with113 the Pareto stationary set P∗.114 A key disadvantage of MGD , however , is that the Pareto point that it converges to depends on the initialization115 and other algorithm configurations in a rather implicated and complicated way . It is difficult to explicitly116 control MGD to make it converge to points with specific properties.117 3 OPTIMIZATION IN PARETO SET118 The Pareto set typically contains an infinite number of points . In the optimization in Pareto set ( OPT-in-119 Pareto ) problem , we are given an extra criterion function F ( θ ) in addition to the objectives ` , and we want to120 minimize F in the Pareto set of ` , that is,121 min θ∈P∗ F ( θ ) . ( 4 ) For example , one can find the Pareto point whose loss vector ` ( θ ) is the closest to a given reference point122 r ∈ Rm by choosing F ( θ ) = ‖ ` ( θ ) − r‖2 . We can also design F to encourages ` ( θ ) to be proportional to r,123 i.e. , ` ( θ ) ∝ r ; a constraint variant of this problem was considered in Mahapatra & Rajan ( 2020 ) .124 We can further generalize OPT-in-Pareto to allow the criterion F to depend on an ensemble of Pareto points125 { θ1 , ... , θN } jointly , that is,126 min θ1 , ... , θN∈P∗ F ( θ1 , ... , θN ) . ( 5 ) For example , if F ( θ1 , . . . , θN ) measures the diversity among { θi } Ni=1 , then optimizing it provides a set of diversified points inside the Pareto set P∗ . An example of diversity measure is F ( θ1 , . . . , θN ) = E ( ` ( θ1 ) , . . . , ` ( θN ) ) , with E ( ` 1 , . . . , ` N ) = ∑ i 6=j ‖ ` i − ` j‖−2 , ( 6 ) where E is known as an energy distance in computational geometry , whose minimizer can be shown to give127 an uniform distribution asymptotically when N →∞ ( Hardin & Saff , 2004 ) . This formulation is particularly128 useful when the users ’ preference is unknown during the training time , and we want to return an ensemble of129 models that well cover the different areas of the Pareto set to allow the users to pick up a model that fits their130 needs regardless of their preference . The problem of profiling Pareto set has attracted a line of recent works131 ( e.g. , Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ; Ma et al. , 2020 ; Deist et al. , 2021 ) , but they rely on specific132 criterion or heuristics and do not address the general optimization of form Equation ( 5 ) .133 Manifold Gradient Descent One straightforward approach to OPT-in-Pareto is to deploy manifold gradient134 descent ( Hillermeier , 2001 ; Bonnabel , 2013 ) , which conducts steepest descent of F ( θ ) in the Riemannian135 manifold formed by the Pareto set P∗ . Initialized at θ0 ∈ P∗ , manifold gradient descent updates θt at the t-th136 iteration along the direction of the projection of∇F ( θt ) on the tangent space T ( θt ) at θt in P∗,137 θt+1 = θt − ξProjT ( θt ) ( ∇F ( θt ) ) . By using the stationarity characterization in Equation ( 1 ) , under proper regularity conditions , one can138 show that the tangent space T ( θt ) equals the null space of the Hessian matrix ∇2θ ` ωt ( θt ) , where ωt =139 arg minω∈Cm ‖∇θ ` ω ( θt ) ‖ . However , the key issue of manifold gradient descent is the high cost for calculating140 this null space of Hessian matrix . Although numerical techniques such as Krylov subspace iteration ( Ma141 et al. , 2020 ) or conjugate gradient descent ( Koh & Liang , 2017 ) can be applied , the high computational cost142 ( and the complicated implementation ) still impedes its application in large scale deep learning problems . See143 Section 1 for discussions on other related works.144 4 PARETO NAVIGATION GRADIENT DESCENT FOR OPT-IN-PARETO145 We now introduce our main algorithm , Pareto Navigating Gradient Descent ( PNG ) , which provides a practical146 approach to OPT-in-Pareto . For convenience , we focus on the single point problem in Equation ( 4 ) in the147 presentation . The generalization to the multi-point problem in Equation ( 5 ) is straightforward . We first148 introduce the main idea and then present theoretical analysis in Section 4.1.149 Main Idea We consider the general incremental updating rule of form θt+1 ← θt − ξvt , where ξ is the step size and vt is an update direction that we shall choose to achieve the following desiderata150 in balancing the decent of { ` i } and F :151 i ) When θt is far away from the Pareto set , we want to choose vt to give Pareto improvement to θt , moving it152 towards the Pareto set . The amount of Pareto improvement might depend on how far θt is to the Pareto set.153 ii ) If the directions that yield Pareto improvement are not unique , we want to choose the Pareto improvement154 direction that decreases F ( θ ) most.155 iii ) When θt is very close to the Pareto set , e.g. , having a small g ( θ ) , we want to fully optimize F ( θ ) .156 We achieve the desiderata above by using the vt that solves the following optimization : vt = arg min v∈Rn { 1 2 ‖∇F ( θt ) − v‖2 s.t . ∇θ ` i ( θt ) > v ≥ φt , ∀i ∈ [ m ] } , ( 7 ) where we want vt to be as close to ∇F ( θt ) as possible ( hence decrease F most ) , conditional on that the157 decreasing rate ∇θ ` i ( θt ) > vt of all losses ` i are lower bounded by a control parameter φt . A positive φt158 enforces that ∇θt ` i ( θ ) > vt is positive for all ` i , hence ensuring a Pareto improvement when the step size is159 sufficiently small . The magnitude of φt controls how much Pareto improvement we want to enforce , so we160 may want to gradually decrease φt when we move closer to the Pareto set . In fact , varying φt provides an161 intermediate updating direction between the vanilla gradient descent on F and MGD on { ` i } :162 i ) If φt = −∞ , we have vt = ∇F ( θt ) and it conducts a pure gradient descent on F without considering { ` i } .163 ii ) If φt → +∞ , then vt approaches to the MGD direction of { ` i } in Equation ( 2 ) without considering F .164 In this work , we propose to choose φt based on the minimum gradient norm g ( θt ) in Equation ( 1 ) as a surrogate indication of Pareto local optimality . In particular , we consider the following simple design : φt = { −∞ if g ( θt ) ≤ e , αtg ( θt ) if g ( θt ) > e , ( 8 ) where e is a small tolerance parameter and αt is a positive hyper-parameter . When g ( θt ) > e , we set φt to be165 proportional to g ( θt ) , to ensure Pareto improvement based on how far θt is to Pareto set . When g ( θt ) ≤ e,166 we set φt = −∞ which “ turns off ” the control and hence fully optimizes F ( θ ) .167 In practice , the optimization in Equation ( 7 ) can be solved efficiently by its dual form as follows.168 Theorem 1 . The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ t=1 λi , t∇ ` i ( θt ) , ( 9 ) with { λi , t } mt=1 the solution of the following dual problem max λ∈Rm+ −1 2 ||∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ||2 + m∑ i=1 λiφt . ( 10 ) The optimization in Equation ( 10 ) can be solved efficiently for a small m ( e .. g , m ≤ 10 ) , which is the case169 for typical applications . We include the details of the practical implementation in Appendix B.170 4.1 THEORETICAL PROPERTIES171 We provide a theoretical quantification on how PNG guarantees to i ) move the solution towards the Pareto172 set ( Theorem 2 ) ; and ii ) optimize F in a neighborhood of Pareto set ( Theorem 3 ) . To simplify the result and173 highlight the intuition , we focus on the continuous time limit of PNG , which yields a differentiation equation174 dθt = −vtdt with vt defined in Equation ( 7 ) , where t ∈ R+ is a continuous integration time.175 Assumption 1 . Let { θt : t ∈ R+ } be a solution of dθt = −vtdt with vt in Equation ( 7 ) ; φk in Equation ( 8 ) ; 176 e > 0 ; and αt ≥ 0 , ∀t ∈ R+ . Assume F and ` are continuously differentiable on Rn , and lower bounded177 with F ∗ : = infθ∈Rn F ( θ ) > −∞ and ` ∗i : = infθ∈Rn ` i ( θ ) > −∞ . Assume supθ∈Rn ‖∇F ( θ ) ‖ ≤ c.178 Technically , dθt = −vtdt is a piecewise smooth dynamical system whose solution should be taken in the179 Filippov sense using the notion of differential inclusion ( Bernardo et al. , 2008 ) . The solution always exists180 under mild regularity conditions although it may not be unique . Our results below apply to all solutions.181 Pareto Optimization on ` We now show that the algorithm converges to the vicinity of Pareto set quantified by a notion of Pareto closure . For ≥ 0 , let P be the set of Pareto -stationary points : P = { θ ∈ Rn : g ( θ ) ≤ } . The Pareto closure of a set P , denoted by P is the set of points that perform no worse than at least one point in P , that is , P : = ∪θ∈P { θ } , { θ } = { θ′ ∈ Rn : ` ( θ′ ) ` ( θ ) } . Therefore , P is better than or at least as good as P in terms of Pareto efficiency.182 Theorem 2 ( Pareto Improvement on ` ) . Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θs ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.183 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters184 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .185 Here we guarantee that θt must enter P for some time ( in fact infinitely often ) , but it is not confined in P .186 On the other hand , θt does not leave P after it first enters P thanks to the Pareto improvement property.187 Optimization on F We now show that PNG finds a local optimum of F inside the Pareto closure P in an188 approximate sense . We first show that a fixed point θ of the algorithm that is locally convex on F and ` must189 be a local optimum of F in the Pareto closure of { θ } , and then quantify the convergence of the algorithm.190 Lemma 1 . Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,191 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } , that is,192 there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and ` ( θ′ ) ` ( θt ) .193 On the other hand , if θt ∈ Pe , we have vt = ∇F ( θt ) , and hence a fixed point with dθtdt = −vt = 0 is an194 unconstrained local minimum of F when F is locally convex on θt.195 Theorem 3 . Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .196 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .197 Combining the results in Theorem 2 and 3 , we can see that the choice of sequence { αt : t ∈ R+ } controls how198 fast we want to decrease ` vs. F . Large αt yields faster descent on ` , but slower descent on F . Theoretically,199 using a sequence that satisfies ∫ αtdt = +∞ and ∫ αγt dt < +∞ for some γ > 1 allows us to ensure that200 both mins∈ [ 0 , t ] g ( θs ) and mins∈ [ 0 , t ] ‖dθ/ds‖ 2 converge to zero . If we use a constant sequence αt = α , it201 introduces an O ( α√g ) term that does not vanish as t→ +∞ . However , we can expect that g is small when202 is small for well-behaved functions . In practice , we find that constant αt works sufficiently well.203 5 EMPIRICAL RESULTS204 We introduce three applications of OPT-in-Pareto with PNG : Singleton Preference , Pareto approximation and205 improving multi-task based domain generalization method . We also conduct additional study on how the206 learning dynamics of PNG changes with different initialization and hyper-parameters ( αt and e ) , which are207 included in Appendix C.3 . Other additional results that are related to the experiments in Section 5.1 and 5.2208 and are included in the Appendix will be introduced later in their corresponding sections.209 5.1 FINDING PREFERRED PARETO MODELS210 We consider the synthetic example used in Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) , which consists of211 two losses : ` 1 ( θ ) = 1− exp ( −‖θ − η‖2 ) and ` 2 ( θ ) = 1− exp ( −‖θ + η‖2 ) , where η = n−1/2 and n = 10212 is dimension of the parameter θ.213 Ratio-based Criterion We first show that PNG can solve the search problem under the ratio constraint of214 objectives in Mahapatra & Rajan ( 2020 ) , i.e. , finding a point θ ∈ P∗ ∩Ω with Ω = { θ : r1 ` 1 ( θ ) = r2 ` 2 ( θ ) =215 ... = rm ` m ( θ ) } , given some preference vector r = [ r1 , ... , rm ] . We apply PNG with the non-uniformity216 score defined in Mahapatra & Rajan ( 2020 ) as the criterion , and compare with their algorithm called exact217 Pareto optimization ( EPO ) . We show in Figure 1 ( a ) - ( b ) the trajectory of PNG and EPO for searching models218 with different preference vector r , starting from the same randomly initialized point . Both PNG and EPO219 converge to the correct solutions but with different trajectories . This suggests that PNG is able to achieve220 the same functionality of finding ratio-constraint Pareto models as Mahapatra & Rajan ( 2020 ) ; Kamani et al.221 ( 2021 ) do but being versatile to handle general criteria . We refer readers to Appendix C.1.1 for more results222 with different choices of hyper-parameters and the experiment details.223 Other Criteria We demonstrate that PNG is able to find solutions for general choices of F . We consider224 the following designs of F : 1 ) weighted ` 2 distance w.r.t . a reference vector r ∈ Rm+ , that is , Fwd ( θ ) =225 i=1 ( ` i ( θ ) − ri ) 2/ri ; and 2 ) complex cosine : in which F is a complicated function related to the cosine226 of task objectives , i.e. , Fcs = − cos ( π ( ` 1 ( θ ) − r1 ) /2 ) + ( cos ( π ( ` ( θ2 ) − r2 ) ) + 1 ) 2 . Here the weighted ` 2227 distance can be viewed as finding a Pareto model that has the losses close to some target value r , which can be228 viewed as an alternative approach to partition the Pareto set . The design of complex cosine aims to test whether229 PNG is able to handle a very non-linear criterion function . In both cases , we take r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] and230 r2 = 1− r1 . We show in Fig 1 ( c ) - ( d ) the trajectory of PNG . As we can see , PNG is able to correctly find the231 optimal solutions of OPT-in-Pareto . We also test PNG on a more challenging ZDT2-variant used in Ma et al.232 ( 2020 ) and a larger scale MTL problem ( Liu et al. , 2019 ) . We refer readers to Appendix C.1.2 and C.1.3 for233 the setting and results.234 5.2 FINDING DIVERSE PARETO MODELS235 Setup We consider the problem of finding diversified points from the Pareto set by minimizing the energy236 distance criterion in Equation ( 6 ) . We use the same setting as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) .237 We consider three benchmark datasets : ( 1 ) MultiMNIST , ( 2 ) MultiFashion , and ( 3 ) MultiFashion+MNIST.238 For each dataset , there are two tasks ( classifying the top-left and bottom-right images ) . We consider LeNet239 with multihead and train N = 5 models to approximate the Pareto set . For baselines , we compare with linear240 scalarization , MGD ( Sener & Koltun , 2018 ) , and EPO ( Mahapatra & Rajan , 2020 ) . For the MGD baseline,241 we find that naively running it leads to poor performance as the learned models are not diversified and thus we242 initialize the MGD with 60-epoch runs of linear scalarization with equally distributed preference weights and243 runs MGD for the later 40 epoch . We refer the reader to Appendix C.2.1 for more details of the experiments.244 Metric and Result We measure the quality of how well the found models { θ1 , . . . , θN } approximate the245 Pareto set using two standard metrics : Inverted Generational Distance Plus ( IGD+ ) ( Ishibuchi et al. , 2015 ) 246 and hypervolume ( HV ) ( Zitzler & Thiele , 1999 ) ; see Appendix C.2.2 for their definitions . We run all the247 methods with 5 independent trials and report the averaged value and its standard deviation in Table 1 . We248 report the scores calculated based on loss ( cross-entropy ) and accuracy on the test set . The bolded values249 indicate the best result with p-value less than 0.05 ( using matched pair t-test ) . In most cases , PNG improves250 the baselines by a large margin . We include ablation studies in Appendix C.2.3 and additional comparisons251 with the second-order approach proposed by Ma et al . ( 2020 ) in Appendix C.2.4.252 5.3 APPLICATION TO MULTI-TASK BASED DOMAIN GENERALIZATION ALGORITHM253 JiGen ( Carlucci et al. , 2019b ) learns a domain generalizable model by learning two tasks based on linear254 scalarization , which essentially searches for a model in the Pareto set and requires choosing the weight of255 linear scalarization carefully . It is thus natural to study whether there is a better mechanism that dynamically256 adjusts the weights of the two losses so that we eventually learn a better model . Motivated by the adversarial257 feature learning ( Ganin et al. , 2016 ) , we propose to improve JiGen such that the latent feature representations258 of the two tasks are well aligned . This can be framed into an OPT-in-Pareto problem where the criterion is259 the discrepancy of the latent representations ( implemented using an adversarial discrepancy module in the260 network ) of the two tasks . PNG is applied to solve the optimization . We evaluate the methods on PACS ( Li261 et al. , 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon , and Sketches ) .262 The model is trained on three domains and tested on the rest of them . Our approach is denoted as JiGen+PNG263 and we also include JiGen + adv , which simply adds the adversarial loss as regularization and two other264 baseline methods ( D-SAM ( D ’ Innocente & Caputo , 2018 ) and DeepAll ( Carlucci et al. , 2019b ) ) . For the three265 JiGen based approaches , we run 3 independent trials and for the other two baselines , we report the results in266 their original papers . Table 2 shows the result using ResNet-18 , which demonstrates the improvement by the267 application of the OPT-in-Pareto framework . We also include the results using AlexNet in the Appendix . We268 refer readers to Appendix C.4 for the additional results and more experiment details.269 6 CONCLUSION270 This paper studies the OPT-in-Pareto , a problem that has been studied in operation research with restrictive271 linear or convexity assumption but largely under-explored in deep learning literature , in which the objectives272 are non-linear and non-convex . Applying algorithms such as manifold gradient descent requires eigen-273 computation of the Hessian matrix at each iteration and thus can be expensive . We propose a first-order274 approximation algorithm called Pareto Navigation Gradient Descent ( PNG ) with theoretically guaranteed275 descent and convergence property to solve OPT-in-Pareto.276 REFERENCES277 Isabela Albuquerque , Nikhil Naik , Junnan Li , Nitish Keskar , and Richard Socher . Improving out-of-278 distribution generalization via multi-task self-supervised pretraining . arXiv preprint arXiv:2003.13525,279 2020.280 Mario Bernardo , Chris Budd , Alan Richard Champneys , and Piotr Kowalczyk . Piecewise-smooth dynamical281 systems : theory and applications , volume 163 . Springer Science & Business Media , 2008.282 Silvere Bonnabel . Stochastic gradient descent on riemannian manifolds . IEEE Transactions on Automatic283 Control , 58 ( 9 ) :2217–2229 , 2013.284 Stephen Boyd , Stephen P Boyd , and Lieven Vandenberghe . Convex optimization . Cambridge university press,285 2004.286 Fabio M. Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain287 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision288 and Pattern Recognition ( CVPR ) , June 2019a.289 Fabio M Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain290 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision291 and Pattern Recognition , pp . 2229–2238 , 2019b.292 Zhao Chen , Vijay Badrinarayanan , Chen-Yu Lee , and Andrew Rabinovich . Gradnorm : Gradient normalization293 for adaptive loss balancing in deep multitask networks . In International Conference on Machine Learning,294 pp . 794–803 . PMLR , 2018.295 Zhao Chen , Jiquan Ngiam , Yanping Huang , Thang Luong , Henrik Kretzschmar , Yuning Chai , and Dragomir296 Anguelov . Just pick a sign : Optimizing deep multitask models with gradient sign dropout . In H. Larochelle,297 M. Ranzato , R. Hadsell , M. F. Balcan , and H. Lin ( eds . ) , Advances in Neural Information Processing298 Systems , volume 33 , pp . 2039–2050 . Curran Associates , Inc. , 2020 . URL https : //proceedings.299 neurips.cc/paper/2020/file/16002f7a455a94aa4e91cc34ebdb9f2d-Paper.pdf.300 Timo M Deist , Monika Grewal , Frank JWM Dankers , Tanja Alderliesten , and Peter AN Bosman.301 Multi-objective learning to predict pareto fronts using hypervolume maximization . arXiv preprint302 arXiv:2102.04523 , 2021.303 Stephan Dempe . Bilevel optimization : theory , algorithms and applications . TU Bergakademie Freiberg,304 Fakultät für Mathematik und Informatik , 2018.305 Jean-Antoine Désidéri . Multiple-gradient descent algorithm ( mgda ) for multiobjective optimization . Comptes306 Rendus Mathematique , 350 ( 5-6 ) :313–318 , 2012.307 Qi Dou , Daniel C Castro , Konstantinos Kamnitsas , and Ben Glocker . Domain generalization via model-308 agnostic learning of semantic features . arXiv preprint arXiv:1910.13580 , 2019.309 Antonio D ’ Innocente and Barbara Caputo . Domain generalization with domain-specific aggregation modules.310 In German Conference on Pattern Recognition , pp . 187–198 . Springer , 2018.311 Joseph G Ecker and Jung Hwan Song . Optimizing a linear function over an efficient set . Journal of312 Optimization Theory and Applications , 83 ( 3 ) :541–563 , 1994.313 Christopher Fifty , Ehsan Amid , Zhe Zhao , Tianhe Yu , Rohan Anil , and Chelsea Finn . Measuring and314 harnessing transference in multi-task learning . arXiv preprint arXiv:2010.15413 , 2020.315 Yaroslav Ganin and Victor Lempitsky . Unsupervised domain adaptation by backpropagation . In International316 conference on machine learning , pp . 1180–1189 . PMLR , 2015.317 Yaroslav Ganin , Evgeniya Ustinova , Hana Ajakan , Pascal Germain , Hugo Larochelle , François Laviolette,318 Mario March , and Victor Lempitsky . Domain-adversarial training of neural networks . Journal of Machine319 Learning Research , 17 ( 59 ) :1–35 , 2016 . URL http : //jmlr.org/papers/v17/15-239.html.320 DP Hardin and EB Saff . Discretizing manifolds via minimum energy points . Notices of the AMS , 51 ( 10 ) :321 1186–1194 , 2004.322 Dan Hendrycks , Mantas Mazeika , Saurav Kadavath , and Dawn Song . Using self-supervised learning can323 improve model robustness and uncertainty . In H. Wallach , H. Larochelle , A. Beygelzimer , F. d'Alché-Buc,324 E. Fox , and R. Garnett ( eds . ) , Advances in Neural Information Processing Systems , volume 32 . Cur-325 ran Associates , Inc. , 2019 . URL https : //proceedings.neurips.cc/paper/2019/file/326 a2b15837edac15df90721968986f7f8e-Paper.pdf.327 Claus Hillermeier . Generalized homotopy approach to multiobjective optimization . Journal of Optimization328 Theory and Applications , 110 ( 3 ) :557–583 , 2001.329 Hisao Ishibuchi , Hiroyuki Masuda , Yuki Tanigaki , and Yusuke Nojima . Modified distance calculation in330 generational distance and inverted generational distance . In International conference on evolutionary331 multi-criterion optimization , pp . 110–125 . Springer , 2015.332 Adrián Javaloy and Isabel Valera . Rotograd : Dynamic gradient homogenization for multi-task learning . arXiv333 preprint arXiv:2103.02631 , 2021.334 Jesús M Jorge . A bilinear algorithm for optimizing a linear function over the efficient set of a multiple335 objective linear programming problem . Journal of Global Optimization , 31 ( 1 ) :1–16 , 2005.336 Mohammad Mahdi Kamani , Rana Forsati , James Z Wang , and Mehrdad Mahdavi . Pareto efficient fairness in337 supervised learning : From extraction to tracing . arXiv preprint arXiv:2104.01634 , 2021.338 Alex Kendall , Yarin Gal , and Roberto Cipolla . Multi-task learning using uncertainty to weigh losses for339 scene geometry and semantics . In Proceedings of the IEEE conference on computer vision and pattern340 recognition , pp . 7482–7491 , 2018.341 Pang Wei Koh and Percy Liang . Understanding black-box predictions via influence functions . In International342 Conference on Machine Learning , pp . 1885–1894 . PMLR , 2017.343 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy M. Hospedales . Deeper , broader and artier domain344 generalization . In Proceedings of the IEEE International Conference on Computer Vision ( ICCV ) , Oct345 2017.346 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy Hospedales . Learning to generalize : Meta-learning for347 domain generalization . In Proceedings of the AAAI Conference on Artificial Intelligence , volume 32,348 2018a.349 Ya Li , Xinmei Tian , Mingming Gong , Yajing Liu , Tongliang Liu , Kun Zhang , and Dacheng Tao . Deep350 domain generalization via conditional invariant adversarial networks . In Proceedings of the European351 Conference on Computer Vision ( ECCV ) , pp . 624–639 , 2018b.352 Xi Lin , Hui-Ling Zhen , Zhenhua Li , Qingfu Zhang , and Sam Kwong . Pareto multi-task learning . arXiv353 preprint arXiv:1912.12854 , 2019.354 Xi Lin , Zhiyuan Yang , Qingfu Zhang , and Sam Kwong . Controllable pareto multi-task learning . arXiv355 preprint arXiv:2010.06313 , 2020.356 Shikun Liu , Edward Johns , and Andrew J Davison . End-to-end multi-task learning with attention . In357 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pp . 1871–1880,358 2019.359 Zhengliang Liu and Matthias Ehrgott . Primal and dual algorithms for optimization over the efficient set.360 Optimization , 67 ( 10 ) :1661–1686 , 2018.361 Xiaoyuan Luo , Shaolei Liu , Kexue Fu , Manning Wang , and Zhijian Song . A learnable self-supervised task362 for unsupervised domain adaptation on point clouds . arXiv preprint arXiv:2104.05164 , 2021.363 Pingchuan Ma , Tao Du , and Wojciech Matusik . Efficient continuous pareto exploration in multi-task learning.364 In International Conference on Machine Learning , pp . 6522–6531 . PMLR , 2020.365 Debabrata Mahapatra and Vaibhav Rajan . Multi-task learning with user preferences : Gradient descent with366 controlled ascent in pareto optimization . In International Conference on Machine Learning , pp . 6597–6607.367 PMLR , 2020.368 Aviv Navon , Aviv Shamsian , Gal Chechik , and Ethan Fetaya . Learning the pareto front with hypernetworks.369 arXiv preprint arXiv:2010.04104 , 2020.370 Javad Sadeghi and Hossein Mohebi . Solving optimization problems over the weakly efficient set . Numerical371 Functional Analysis and Optimization , pp . 1–33 , 2021.372 Ozan Sener and Vladlen Koltun . Multi-task learning as multi-objective optimization . In S. Bengio , H. Wallach,373 H. Larochelle , K. Grauman , N. Cesa-Bianchi , and R. Garnett ( eds . ) , Advances in Neural Information Pro-374 cessing Systems , volume 31 . Curran Associates , Inc. , 2018 . URL https : //proceedings.neurips.375 cc/paper/2018/file/432aca3a1e345e339f35a30c8f65edce-Paper.pdf.376 Nathan Silberman , Derek Hoiem , Pushmeet Kohli , and Rob Fergus . Indoor segmentation and support377 inference from rgbd images . In European conference on computer vision , pp . 746–760 . Springer , 2012.378 Kihyuk Sohn , David Berthelot , Nicholas Carlini , Zizhao Zhang , Han Zhang , Colin A Raffel , Ekin Do-379 gus Cubuk , Alexey Kurakin , and Chun-Liang Li . Fixmatch : Simplifying semi-supervised learning380 with consistency and confidence . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and381 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 596–608 . Cur-382 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/383 06964dce9addb1c5cb5d6e3d9838f733-Paper.pdf.384 Yu Sun , Eric Tzeng , Trevor Darrell , and Alexei A Efros . Unsupervised domain adaptation through self-385 supervision . arXiv preprint arXiv:1909.11825 , 2019.386 Phan Thien Thach and TV Thang . Problems with resource allocation constraints and optimization over the387 efficient set . Journal of Global Optimization , 58 ( 3 ) :481–495 , 2014.388 Sen Wu , Hongyang R. Zhang , and Christopher Ré . Understanding and improving information transfer389 in multi-task learning . In International Conference on Learning Representations , 2020 . URL https:390 //openreview.net/forum ? id=SylzhkBtDB.391 Sang Michael Xie , Ananya Kumar , Robbie Jones , Fereshte Khani , Tengyu Ma , and Percy Liang . In-n-out : Pre-392 training and self-training using auxiliary information for out-of-distribution robustness . In International393 Conference on Learning Representations , 2021 . URL https : //openreview.net/forum ? id=394 jznizqvr15J.395 Junfeng Yang and Carl Vondrick . Multitask learning strengthens adversarial robustness . 2020.396 Tianhe Yu , Saurabh Kumar , Abhishek Gupta , Sergey Levine , Karol Hausman , and Chelsea Finn . Gra-397 dient surgery for multi-task learning . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and398 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 5824–5836 . Cur-399 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/400 3fe78a8acf5fda99de95303940a2420c-Paper.pdf.401 Linfeng Zhang , Muzhou Yu , Tong Chen , Zuoqiang Shi , Chenglong Bao , and Kaisheng Ma . Auxiliary training:402 Towards accurate and robust models . In Proceedings of the IEEE/CVF Conference on Computer Vision403 and Pattern Recognition , pp . 372–381 , 2020.404 Eckart Zitzler and Lothar Thiele . Multiobjective evolutionary algorithms : a comparative case study and the405 strength pareto approach . IEEE transactions on Evolutionary Computation , 3 ( 4 ) :257–271 , 1999.406 A THEORETICAL ANALYSIS407 Theorem 1 [ Dual of Equation ( 7 ) ] The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , with { λi , t } mi=1 the solution of the following dual problem max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt , where Rm+ is the set of nonnegative m-dimensional vectors , that is , Rm+ = { λ ∈ Rm : λi ≥ 0 , ∀i ∈ [ m ] } .408 Proof . By introducing Lagrange multipliers , the optimization in Equation ( 7 ) is equivalent to the following409 minimax problem:410 min v∈Rn max λ∈Rm+ 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) . With strong duality of convex quadratic programming ( assuming the primal problem is feasible ) , we can exchange the order of min and max , yielding max λ∈Rm+ { Φ ( λ ) : = min v∈Rn 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) } . It is easy to see that the minimization w.r.t . v is achieved when v = ∇F ( θt ) + ∑m i=1 λi∇ ` i ( θt ) . Correspond-411 ingly , the Φ ( λ ) has the following dual form:412 max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λi∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt . This concludes the proof.413 Theorem 2 [ Pareto Improvement on ` ] Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θt ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.414 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters415 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .416 Proof . i ) When t < te , we have g ( θt ) > e and hence d dt ` i ( θt ) = −∇ ` i ( θt ) > vt ≤ −φt = −αtg ( θt ) , ( 11 ) where we used the constraint of∇ ` i ( θt ) > vt ≥ φt in Equation ( 7 ) . Therefore , we yield strict decent on all the417 losses { ` i } when αtg ( θt ) > 0.418 ii ) Integrating both sides of Equation ( 11 ) : min s∈ [ 0 , t ] g ( θs ) ≤ ∫ t 0 αsg ( θs ) ds∫ t 0 αsds ≤ ` i ( θ0 ) − ` i ( θt ) ∫ t 0 αsds ≤ ` i ( θ0 ) − ` ∗∫ t 0 αsds . This yields the result since it holds for every i ∈ [ m ] .419 If ∫∞ 0 αtdt = +∞ , then we have mins∈ [ 0 , t ] g ( θs ) → 0 when t → +∞ . Assume there exists an > e,420 such that θt never enters P at finite t. Then we have g ( θt ) ≥ for t ∈ R+ , which contradicts with421 mins∈ [ 0 , t ] g ( θs ) → 0.422 iii ) Assume there exists a finite time t′ ∈ ( t , +∞ ) such that θt′ 6∈ P . Because > e and g is continuous , Pe423 is in the interior of P ⊆ P . Therefore , the trajectory leading to θt′ 6∈ P must pass through P \Pe at some424 point , that is , there exists a point t′′ ∈ [ t , t′ ) , such that { θt : t ∈ [ t′′ , t′ ] } 6∈ Pe . But because the algorithm can425 not increase any objective ` i outside of Pe , we must have ` ( θt′ ) ` ( θt′′ ) , yielding that θt′ ∈ { θt′′ } ⊆ P ,426 where { θt′′ } is the Pareto closure of { θt′′ } ; this contradicts with the assumption.427 Lemma 1 Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,428 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } ,429 that is , there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and430 ` ( θ′ ) ` ( θt ) .431 Proof . Note that minimizing F in { θt } can be framed into a constrained optimization problem : min θ F ( θ ) s.t . ` i ( θ ) ≤ ` i ( θt ) , ∀i ∈ [ m ] . In addition , by assumption , θ = θt satisfies vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) = 0 , which is the KKT432 stationarity condition of the constrained optimization . It is also obvious to check that θ = θt satisfies the433 feasibility and slack condition trivially . Combining this with the local convexity assumption yields the434 result.435 Theorem 3 [ Optimization of F ] Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .436 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .437 Proof . i ) The slack condition of the constrained optimization in Equation ( 7 ) says that λi , t ( ∇ ` i ( θt ) > vt − φt ) = 0 , ∀i ∈ [ m ] . ( 12 ) This gives that ‖vt‖2 = ( ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) ) > vt = ∇F ( θt ) > vt + m∑ i=1 λi , tφt //plugging Equation ( 12 ) . ( 13 ) If θt 6∈ Pe , we have φt = αtg ( θt ) and this gives d dt F ( θt ) = −∇F ( θt ) > vt = −‖vt‖2 + m∑ i=1 λi , tφt = − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) If θt is in the interior of Pe , then we run typical gradient descent of F and hence has d dt F ( θt ) = −‖vt‖2 = − ∥∥∥∥dθtdt ∥∥∥∥2 . If θt is on the boundary of Pe , then by the definition of differential inclusion , dθ/dt belongs to the convex hull of the velocities that it receives from either side of the boundary , yielding that d dt F ( θt ) = − ∥∥∥∥dθtdt ∥∥∥∥2 + β m∑ i=1 λi , tαtg ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) , where β ∈ [ 0 , 1 ] . Combining all the cases gives d dt F ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) . Integrating this yields min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ 1t ∫ t 0 ∥∥∥∥dθsds ∥∥∥∥2 ds ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 m∑ i=1 λi , sαsg ( θs ) ds ≤ F ( θ0 ) − F ∗ t + 1 t ∫ t 0 αs ( αsg + c √ g ) ds , where the last step used Lemma 2 with φt = αtg ( θt ) : m∑ i=1 λi , tαtg ( θt ) ≤ α2t g ( θt ) + cαt √ g ( θt ) ≤ α2t g + cαt √ g , and here we used g ( θt ) ≤ g because the trajectory is contained in P following Theorem 2.438 The remaining results follow Lemma 4.439 A.0.1 TECHNICAL LEMMAS440 Lemma 2 . Assume Assumption 1 holds . Define g ( θ ) = minω∈Cm ‖ ∑m i=1 ωi∇ ` i ( θ ) ‖ 2 , where Cm is the probability simplex on [ m ] . Then for the vt and λi , t defined in Equation ( 7 ) and Equation ( 10 ) , we have m∑ i=1 λi , tg ( θt ) ≤ max ( φt + c √ g ( θt ) , 0 ) . Proof . The slack condition of the constrained optimization in Equation ( 7 ) says that441 λi , t ( ∇ ` i ( θ ) > vt − φt ) = 0 , ∀i ∈ [ m ] . Sum the equation over i ∈ [ m ] and note that vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) . We get∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 + ( m∑ i=1 λi , t∇ ` i ( θt ) ) > ∇F ( θ ) − m∑ i=1 λi , tφt = 0 . ( 14 ) Define xt = ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 , λ̄t = m∑ i=1 λi , t , gt = g ( θt ) = min ω∈Cm ∥∥∥∥∥ m∑ i=1 ωi∇ ` i ( θt ) ∥∥∥∥∥ 2 . Then it is easy to see that xt ≥ λ̄2t gt . Using Cauchy-Schwarz inequality , ∣∣∣∣∣∣ ( m∑ i=1 λi , t∇ ` i ( θ ) ) > ∇F ( θt ) ∣∣∣∣∣∣ ≤ ‖∇F ( θt ) ‖ ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θ ) ∥∥∥∥∥ ≤ c√xt , where we used ‖∇F ( θt ) ‖ ≤ c by Assumption 1 . Combining this with Equation ( 14 ) , we have∣∣xt − λ̄tφt∣∣ ≤ c√xt . Applying Lemma 3 yields the result.442 Lemma 3 . Assume φ ∈ R , and x , λ , c , g ∈ R+ are non-negative real numbers and they satisfy |x− λφ| ≤ c √ x , x ≥ λ2g . Then we have λg ≤ max ( 0 , φ+ c√g ) .443 Proof . Square the first equation , we get f ( x ) : = ( x− λφ ) 2 − c2x ≤ 0 , where f is a quadratic function . To ensure that f ( x ) ≤ 0 has a solution that satisfies x ≥ λ2g , we need to have f ( λ2g ) ≤ 0 , that is , f ( λ2g ) = ( λ2g − λφ ) 2 − c2λ2g ≤ 0 . This can hold under two cases:444 Case 1 : λ = 0 ; 445 Case 2 : |λg − φ| ≤ c√g , and hence φ− c√g ≤ λg ≤ φ+ c√g.446 Under both case , we have λg ≤ max ( 0 , φ+ c√g ) . 447 Lemma 4 . Let { αt : t ∈ R+ } ⊆ R+ be a non-negative sequence with A : = ( ∫∞ 0 αγt dt ) 1/γ < ∞ , where γ ≥ 1 , and B = supt αt < ∞ . Then we have 1 t ∫ t 0 ( α2s + αs ) ds ≤ ( B + 1 ) At−1/γ . Proof . Let η = γγ−1 , so that 1/η + 1/γ = 1 . We have by Holder ’ s inequality , ∫ t 0 αsds ≤ ( ∫ t 0 αγsds ) 1/γ ( ∫ t 0 1ηds ) 1/η ≤ At1/η = At1−1/γ . and hence 1 t ∫ t 0 ( α2s + αs ) ds ≤ B + 1 t ∫ t 0 αsds ≤ ( B + 1 ) At−1/γ . 448 Algorithm 1 Pareto Navigating Gradient Descent 1 : Initialize θ0 ; decide the step size ξ , and the control function φ in Equation ( 8 ) ( including the threshold e > 0 and the descending rate { αt } ) . 2 : for iteration t do θt+1 ← θt − ξvt , vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , ( 15 ) where λi , t = 0 , ∀i ∈ [ m ] if g ( θt ) ≤ e , and { λi , t } mt=1 is the solution of Equation ( 10 ) with φ ( θt ) = αtg ( θt ) when g ( θt ) > e. 3 : end for B PRACTICAL IMPLEMENTATION449 Hyper-parameters Our algorithm introduces two hyperparameters { αt } and e over vanilla gradient descent.450 We use constant sequence αt = α and we take α = 0.5 unless otherwise specified . We choose e by451 e = γe0 , where e0 is an exponentially discounted average of 1m ∑m i=1 ‖∇ ` i ( θt ) ‖ 2 over the trajectory so that452 it automatically scales with the magnitude of the gradients of the problem at hand . In the experiments of this453 paper , we simply fix γ = 0.1 unless specified.454 Solving the Dual Problem Our method requires to calculate { λi , t } mt=1 with the dual optimization problem455 in Equation ( 10 ) , which can be solved with any off-the-shelf convex quadratic programming tool . In this456 work , we use a very simple projected gradient descent to approximately solve Equation ( 10 ) . We initialize457 { λi , t } mt=1 with a zero vector and terminate when the difference between the last two iterations is smaller than458 a threshold or the algorithm reaches the maximum number of iterations ( we use 100 in all experiments ) .459 The whole algorithm procedure is summarized in Algorithm 1.460 C EXPERIMENTS461 C.1 FINDING PREFERRED PARETO MODELS462 C.1.1 RATIO-BASED CRITERION463 The non-uniformity score from ( Mahapatra & Rajan , 2020 ) that we use in Figure 1 is defined as FNU ( θ ) = m∑ t=1 ˆ̀ t ( θ ) log ( ˆ̀ t ( θ ) 1/m ) , ˆ̀t ( θ ) = rt ` t ( θ ) ∑ s∈ [ m ] rs ` s ( θ ) . ( 16 ) We fix the other experiment settings the same as Mahapatra & Rajan ( 2020 ) and use γ = 0.01 and α = 0.25464 for this experiment reported in the main text . We defer the ablation studies on the hyper-parameter α and γ to465 Section C.3.466 C.1.2 ZDT2-VARIANT467 We consider the ZDT2-Variant example used in Ma et al . ( 2020 ) with the same experiment setting , in468 which the Pareto set is a cylindrical surface , making the problem more challenging . We consider the469 same criteria , e.g . weighted distance and complex cosine used in the main context with different choices470 of r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] . We use the default hyper-parameter set up , choosing α = 0.5 and r = 0.1.471 For complex cosine , we use MGD updating for the first 150 iterations . Figure 2 shows the trajectories,472 demonstrating that PNG works pretty well for the more challenging ZDT2-Variant tasks.473 C.1.3 GENERAL CRITERIA : THREE-TASK LEARNING ON THE NYUV2 DATASET474 We show that PNG is able to handle large-scale multitask learning problems by deploying it on a three-475 task learning problem ( segmentation , depth estimation , and surface normal prediction ) on NYUv2 dataset476 ( Silberman et al. , 2012 ) . The main goal of this experiment is to show that : 1 . PNG is able to handle477 OPT-in-Pareto in a large-scale neural network ; 2 . With a proper design of criteria , PNG enables to do478 targeted fine-tuning that pushes the model to move towards a certain direction . We consider the same479 training protocol as Liu et al . ( 2019 ) and use the MTAN network architecture . Start with a model trained480 with equally weighted linear scalarization and our goal is to further improve the model ’ s performance481 on segmentation and surface normal estimation while allowing some sacrifice on depth estimation . This482 can be achieved by many different choices of criterion and in this experiment , we consider the following483 design : F ( θ ) = ( ` seg ( θ ) × ` surface ( θ ) ) / ( 0.001 + ` depth ( θ ) ) . Here ` seg , ` surface and ` depth are the loss functions484 for segmentation , surface normal prediction and depth estimation , respectively . The constant 0.001 in the485 denominator is for numeric stability . We point out that our design of criterion is a simple heuristic and might486 not be an optimal choice and the key question we study here is to verify the functionality of the proposed487 PNG . As suggested by the open-source repository of Liu et al . ( 2019 ) , we reproduce the result based on the488 provided configuration . To show that PNG is able to move the model along the Pareto front , we show the489 evolution of the criterion function and the norm of the MGD gradient during the training in Figure 3 . As we490 can see , PNG effectively decreases the value of criterion function while the norm of MGD gradient remains491 the same . This demonstrates that PNG is able to minimize the criterion by searching the model in the Pareto492 set . Table 3 compares the performances on the three tasks using standard training and PNG , showing that493 PNG is able to improve the model ’ s performance on segmentation and surface normal prediction tasks while494 satisfying a bit of the performance in depth estimation based on the criterion.495 C.2 FINDING DIVERSE PARETO MODELS496 C.2.1 EXPERIMENT DETAILS497 We train the model for 100 epochs using Adam op-498 timizer with batch size 256 and 0.001 learning rate.499 To encourage diversity of the models , following the500 setting in Mahapatra & Rajan ( 2020 ) , we use equally501 distributed preference vectors for linear scalarization502 and EPO . Note that the stochasticity of using mini-503 batches is able to improve the performance of Pareto504 approximation for free by also using the intermedi-505 ate checkpoints to approximate P . To fully exploit506 this advantage , for all the methods , we collect check-507 points every epoch to approximate P , starting from508 epoch 60.509 C.2.2 EVALUATION METRIC DETAILS510 We introduce the definition of the used metric for511 evaluation . Given a set P̂ = { θ1 , . . . , θN } that we512 use to approximate P , its IGD+ score is defined as:513 IGD+ ( P̂ ) = ∫ P∗ q ( θ , P̂ ) dµ ( θ ) , q ( θ , P̂ ) = min θ̂∈P̂ ∥∥∥∥ ( ` ( θ̂ ) − ` ( θ ) ) + ∥∥∥∥ , where µ is some base measure that measures the importance of θ ∈ P and ( t ) + : = max ( t , 0 ) , applied on514 each element of a vector . Intuitively , for each θ , we find a nearest θ̂ ∈ P̂ that approximates θ best . Here515 the ( · ) + is applied as we only care the tasks that θ̂ is worse than θ . In practice , a common choice of µ can516 be a uniform counting measure with uniformly sampled ( or selected ) models from P . In our experiments,517 since we can not sample models from P , we approximate P by combining P̂ from all the methods , i.e.,518 P ≈ ∪m∈ { Linear , MGD , EPO , PNG } P̂m , where P̂m is the approximation set produced by algorithm m.519 This approximation might not be accurate but is sufficient to compare the different methods,520 The Hypervolume score of P̂ , w.r.t . a reference point ` r ∈ Rm+ , is defined as521 HV ( P̂ ) = µ ( { ` = [ ` 1 , ... , ` m ] ∈ Rm | ∃θ ∈ P̂ , s.t . ` t ( θ ) ≤ ` t ≤ ` rt ∀t ∈ [ m ] } ) , where µ is again some measure . We use ` r = [ 0.6 , 0.6 ] for calculating the Hypervolume based on loss and522 set µ to be the common Lebesgue measure . Here we choose 0.6 as we observe that the losses of the two tasks523 are higher than 0.6 and 0.6 is roughly the worst case . When calculating Hypervolume based on accuracy , we524 simply flip the sign.525 C.2.3 ABLATION STUDY526 We conduct ablation study to understand the effect of α and γ using the Pareto approximation task on527 Multi-Mnist . We compare PNG with α = 0.25 , 0.5 , 0.75 and γ = 0.01 , 0.1 , 0.25 . Figure 4 summarizes the528 result . Overall , we observe that PNG is not sensitive to the choice of hyper-parameter.529 C.2.4 COMPARING WITH THE SECOND ORDER APPROACH530 We give a discussion on comparing our approach with the second order approaches proposed by Ma et al.531 ( 2020 ) . In terms of algorithm , Ma et al . ( 2020 ) is a local expansion approach . To apply Ma et al . ( 2020 ) ,532 in the first stage , we need to start with several well distributed models ( i.e. , the ones obtained by linear533 scalarization with different preference weights ) and Ma et al . ( 2020 ) is only applied in the second stage to534 find the neighborhood of each model . The performance gain comes from the local neighbor search of each535 model ( i.e . the second stage ) .536 In comparison , PNG with energy distance is a global search approach . It improves the well-distributedness537 of models in the first stage ( i.e . it ’ s a better approach than simply using linear scalarization with different538 weights ) . And thus the performance gain comes from the first stage . Notice that we can also apply Ma et al.539 ( 2020 ) to PNG with energy distance to add extra local search to further improve the approximation.540 In terms of run time comparison . We compare the wall clock run time of each step of updating the 5 models541 using PNG and the second order approach in Ma et al . ( 2020 ) . We calculate the run time based on the542 multi-MNIST dataset using the average of 100 steps . PNG uses 0.3s for each step while Ma et al . 2020 uses543 16.8s . PNG is 56x faster than the second order approach . And we further argue that , based on time complexity544 theory , the gap will be even larger when the size of the network increases.545 C.3 UNDERSTANDING PNG DYNAMICS546 We draw more analysis to understand the training dynamics of PNG.547 Different Staring Points We give analysis on PNG with different initializations showing that PNG is548 more robust to the initialization than other approaches such as Lin et al . ( 2019 ) . We consider the Pareto set549 approximation tasks and reuse synthetic example introduced in Section 5.1 . We consider learning 5 models to550 approximate the Pareto front staring from two different bad starting points . Specifically , in the upper row of551 Figure 4 , we consider initializing the models using linear scalarization . Due to the concavity of the Pareto552 front , linear scalarization can only learns models at the two extreme end of the Pareto front . The second row553 uses MGD for initialization and the models is scattered at an small region of the Pareto front . Different from554 the algorithm proposed by Lin et al . ( 2019 ) which relies on a good initialization , using the proposed energy555 distance function , PNG pushes the models to be equally distributed on the Pareto Front without the need of556 any prior information of the Pareto front even with extremely bad starting point.557 Trajectory Visualization with Different Hyper-parameters We also give more visualization on the PNG558 trajectory when using different hyper-parameters . We reuse synthetic example introduced in Section 5.1559 for studying the hyper-parameters α and γ . We fix α = 0.25 and vary γ = 0.1 , 0.05 , 0.01 , 0.1 ; and fix560 γ = 0.01 and vary α = 0.1 , 0.25 , 0.5 , 0.75 . Figure 5 plots the trajectories . As we can see , when γ is properly561 chosen , with different α , PNG finds the correct models with different trajectories . Different α determines the562 algorithm ’ s behavior of balancing the descent of task losses or criterion objectives . On the other hand , with563 too large γ , the algorithm fails to find a model that is close to P∗ , which is expected.564 C.4 IMPROVING MULTITASK BASED DOMAIN GENERALIZATION565 We argue that many other deep learning problems also have the structure of multitask learning when multiple566 losses presents and thus optimization techniques in multitask learning can also be applied to those domains.567 In this paper we consider the JiGen ( Carlucci et al. , 2019b ) . JiGen learns a model that can be generalized to568 unseen domain by minimizing a standard cross-entropy loss ` class for classification and an unsupervised loss569 ` jig based on Jigsaw Puzzles:570 ` ( θ ) = ( 1− ω ) ` class ( θ ) + ω ` jig ( θ ) . The ratio between two losses , i.e . ω , is important to the final performance of the model and requires a571 careful grid search . Notice that JiGen is essentially searching for a model on the Pareto front using the linear572 scalarization . Instead of using a fixed linear scalarization to learn a model , one natural questions is that573 whether it is possible to design a mechanism that dynamically adjusts the ratio of the losses so that we can574 achieve to learn a better model.575 We give a case study here . Motivated by the adversarial feature learning ( Ganin et al. , 2016 ) , we propose576 to improve JiGen such that the latent feature representations of the two tasks are well aligned . Specifically,577 suppose that Φclass ( θ ) = { φclass ( xi , θ ) } ni=1 and Φjig ( θ ) = { φjig ( xi , θ ) } ni=1 is the distribution of latent feature578 representation of the two tasks , where xi is the i-th training data . We consider FPD as some probability metric579 that measures the distance between two distributions , we consider the following problem:580 min θ∈P∗ FPD [ Φclass ( θ ) , Φjig ( θ ) ] . With PD as the criterion function , our algorithm automatically reweights the ratio of the two tasks such that581 their latent space is well aligned.582 Setup We fix all the experiment setting the same as Carlucci et al . ( 2019b ) . We use the Alexnet and Resnet-18583 with multihead pretrained on ImageNet as the multitask network . We evaluate the methods on PACS ( Li et al.,584 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon and Sketches ) . Same to585 Carlucci et al . ( 2019b ) , we trained our model considering three domains as source datasets and the remaining586 one as target . We implement FPD that measures the discrepancy of the feature space of the two tasks using587 the idea of Domain Adversarial Neural Networks ( Ganin & Lempitsky , 2015 ) by adding an extra prediction588 head on the shared feature space to predict the whether the input is for the classification task or Jigsaw task.589 Specifically , we add an extra linear layer on the shared latent feature representations that is trained to predict590 the task that the latent space belongs to , i.e.,591 FPD ( Φclass ( θ ) , Φjig ( θ ) ) = min w , b 1 n n∑ i=1 log ( σ ( w > φclass ( xi , θ ) ) ) + log ( 1− σ ( w > φclass ( xi , θ ) ) ) . Notice that the optimal weight and bias for the linear layer depends on the model parameter θ , during the592 training , both w , b and θ are jointly updated using stochastic gradient descent . We follow the default training593 protocol provided by the source code of Carlucci et al . ( 2019b ) .594 Baselines Our main baselines are JiGen ( Carlucci et al. , 2019b ) ; JiGen + adv , which adds an extra domain595 adversarial loss on JiGen ; and our PNG with domain adversarial loss as criterion function . In order to run596 statistical test for comparing the methods , we run all the main baselines using 3 random trials . We use the597 released source code by Carlucci et al . ( 2019b ) to obtained the performance of JiGen . For JiGen+adv , we use598 an extra run to tune the weight for the domain adversarial loss . Besides the main baselines , we also includes599 TF ( Li et al. , 2017 ) , CIDDG ( Li et al. , 2018b ) , MLDG ( Li et al. , 2018a ) , D-SAM ( D ’ Innocente & Caputo,600 2018 ) and DeepAll ( Carlucci et al. , 2019b ) as baselines with the author reported performance for reference.601 Result The result is summarized in Table 5 with bolded value indicating the statistical significant best methods602 with p-value based on matched-pair t-test less than 0.1 . Combining Jigen and PNG to dynamically reweight603 the task weights is able to implicitly regularizes the latent space without adding an actual regularizer which604 might hurt the performance on the tasks and thus improves the overall result.605 | This paper proposes an algorithm to optimize in a Pareto set in order to reach a solution or solutions that can minimize an extra criterion. The proposed algorithm is highly relevant in the context of multitask learning. The proposed algorithm takes both 1) optimizing the extra criterion w/o considering the original objectives and 2) multiple gradient descent (MGD) as its special cases. It has the flexibility to switch between two cases depending on the magnitude of the gradients w.r.t. the original tasks. The authors provide strong theoretical analysis for the proposed algorithm along with some empirical results to show its effectiveness. | SP:ff2436a7f3e442bf9b1f847a151bc547a91f43e6 |
Pareto Navigation Gradient Descent: a First Order Algorithm for Optimization in Pareto Set | Many modern machine learning applications , such as multi-task learning , require finding1 optimal model parameters to trade-off multiple objective functions that may conflict with2 each other . The notion of the Pareto set allows us to focus on the set of ( often infinite number3 of ) models that can not be strictly improved . But it does not provide an actionable procedure4 for picking one or a few special models to return to practical users . In this paper , we5 consider optimization in Pareto set ( OPT-in-Pareto ) , the problem of finding Pareto models6 that optimize an extra reference criterion function within the Pareto set . This function can7 either encode a specific preference from the users , or represent a generic diversity measure8 for obtaining a set of diversified Pareto models that are representative of the whole Pareto9 set . Unfortunately , despite being a highly useful framework , efficient algorithms for OPT-10 in-Pareto have been largely missing , especially for large-scale , non-convex , and non-linear11 objectives in deep learning . A naive approach is to apply Riemannian manifold gradient12 descent on the Pareto set , which yields a high computational cost due to the need for eigen-13 calculation of Hessian matrices . We propose a first-order algorithm that approximately14 solves OPT-in-Pareto using only gradient information , with both high practical efficiency15 and theoretically guaranteed convergence property . Empirically , we demonstrate that our16 method works efficiently for a variety of challenging multi-task-related problems.17 1 INTRODUCTION18 Although machine learning tasks are traditionally framed as optimizing a single objective . Many modern19 applications , especially in areas like multitask learning , require finding optimal model parameters to minimize20 multiple objectives ( or tasks ) simultaneously . As the different objective functions may inevitably conflict21 with each other , the notion of optimality in multi-objective optimization ( MOO ) needs to be characterized by22 the Pareto set : the set of model parameters whose performance of all tasks can not be jointly improved.23 Focusing on the Pareto set allows us to filter out models that can be strictly improved . However , the Pareto24 set typically contains an infinite number of parameters that represent different trade-offs of the objectives.25 For m objectives ` 1 , . . . , ` m , the Pareto set is often an ( m− 1 ) dimensional manifold . It is both intractable26 and unnecessary to give practical users the whole exact Pareto set . A more practical demand is to find some27 user-specified special parameters in the Pareto set , which can be framed into the following optimization in28 Pareto set ( OPT-in-Pareto ) problem:29 Finding one or a set of parameters inside the Pareto set of ` 1 , . . . , ` m that minimize a reference criterion F .30 Here the criterion function F can be used to encode an informative user-specific preference on the objectives31 ` 1 , . . . , ` m , which allows us to provide the best models customized for different users . F can also be an32 non-informative measure that encourages , for example , the diversity of a set of model parameters . In this33 case , optimizing F in Pareto set gives a set of diversified Pareto models that are representative of the whole34 Pareto set , from which different users can pick their favorite models during the testing time.35 OPT-in-Pareto provides a highly generic and actionable framework for multi-objective learning and opti-36 mization . However , efficient algorithms for solving OPT-in-Pareto have been largely lagging behind in deep37 learning where the objective functions are non-convex and non-linear . Although has not been formally studied,38 a straightforward approach is to apply manifold gradient descent on F in the Riemannian manifold formed by39 the Pareto set ( Hillermeier , 2001 ; Bonnabel , 2013 ) . However , this casts prohibitive computational cost due40 to the need for eigen-computation of Hessian matrices of { ` i } . In the optimization and operation research41 literature , there has been a body of work on OPT-in-Pareto viewing it as a special bi-level optimization42 problem ( Dempe , 2018 ) . However , these works often heavily rely on the linearity and convexity assumptions43 and are not applicable to the non-linear and non-convex problems in deep learning ; see for examples in Ecker44 & Song ( 1994 ) ; Jorge ( 2005 ) ; Thach & Thang ( 2014 ) ; Liu & Ehrgott ( 2018 ) ; Sadeghi & Mohebi ( 2021 ) ( just45 to name a few ) . In comparison , the OPT-in-Pareto problem seems to be much less known and under-explored46 in the deep learning literature.47 In this work , we provide a practically efficient first-order algorithm for OPT-in-Pareto , using only gradient48 information of the criterion F and objectives { ` i } . Our method , named Pareto navigation gradient descent49 ( PNG ) , iteratively updates the parameters following a direction that carefully balances the descent on F and50 { ` i } , such that it guarantees to move towards the Pareto set of { ` i } when it is far away , and optimize F in a51 neighborhood of the Pareto set . Our method is simple , practically efficient and has theoretical guarantees.52 In empirical studies , we demonstrate that our method works efficiently for both optimizing user-specific53 criteria and diversity measures . In particular , for finding representative Pareto solutions , we propose an54 energy distance criterion whose minimizers distribute uniformly on the Pareto set asymptotically ( Hardin55 & Saff , 2004 ) , yielding a principled and efficient Pareto set approximation method that compares favorably56 with recent works such as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) . We also apply PNG to improve the57 performance of JiGen ( Carlucci et al. , 2019b ) , a multi-task learning approach for domain generalization , by58 using the adversarial feature discrepancy as the criterion objective.59 Related Work There has been a rising interest in MOO in deep learning , mostly in the context of multi-task60 learning . But most existing methods can not be applied to the general OPT-in-Pareto problem . A large body61 of recent works focus on improving non-convex optimization for finding some model in the Pareto set , but62 can not search for a special model satisfying a specific criterion ( Chen et al. , 2018 ; Kendall et al. , 2018 ; Sener63 & Koltun , 2018 ; Yu et al. , 2020 ; Chen et al. , 2020 ; Wu et al. , 2020 ; Fifty et al. , 2020 ; Javaloy & Valera , 2021 ) .64 One exception is Mahapatra & Rajan ( 2020 ) ; Kamani et al . ( 2021 ) , which searches for models in the Pareto65 set that satisfy a constraint on the ratio between the different objectives . The problem they study can be66 viewed as a special instance of OPT-in-Pareto . However , their approaches are tied with special properties of67 the ratio constraint and do not apply to the general OPT-in-Pareto problem.68 There has also been increasing interest in finding a compact approximation of the Pareto set . Navon et al.69 ( 2020 ) ; Lin et al . ( 2020 ) use hypernetworks to approximate the map from linear scalarization weights to70 the corresponding Pareto solutions ; these methods could not fully profile non-convex Pareto fronts due71 to the limitation of linear scalarization ( Boyd et al. , 2004 ) , and the use of hypernetwork introduces extra72 optimization difficulty . Another line of works ( Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ) approximate73 the Pareto set by training models with different user preference vectors that rank the relative importance74 of different tasks ; these methods need a good heuristic design of preference vectors , which requires prior75 knowledge of the Pareto front . Ma et al . ( 2020 ) leverages manifold gradient to conduct a local random walk76 on the Pareto set but suffers from the high computational cost . Deist et al . ( 2021 ) approximates the Pareto set77 by maximizing hypervolume , which requires prior knowledge for choosing a good reference vector.78 Multi-task learning can also be applied to improve the learning in many other domains including domain79 generalization ( Dou et al. , 2019 ; Carlucci et al. , 2019a ; Albuquerque et al. , 2020 ) , domain adaption ( Sun80 et al. , 2019 ; Luo et al. , 2021 ) , model uncertainty ( Hendrycks et al. , 2019 ; Zhang et al. , 2020 ; Xie et al. , 2021 ) ,81 adversarial robustness ( Yang & Vondrick , 2020 ) and semi-supervised learning ( Sohn et al. , 2020 ) . All of82 those applications utilize a linear scalarization to combine the multiple objectives and it is thus interesting to83 apply the proposed OPT-in-Pareto framework , which we leave for future work.84 2 BACKGROUND ON MULTI-OBJECTIVE OPTIMIZATION85 We introduce the background on multi-objective optimization ( MOO ) and Pareto optimality . For notation,86 we denote by [ m ] the integer set { 1 , 2 , .... , m } , and R+ the set of non-negative real numbers . Let Cm =87 { ω ∈ Rm+ , ∑m i=1 ωi = 1 } be the probability simplex . We denote by ‖·‖ the Euclidean norm.88 Let θ ∈ Rn be a parameter of interest ( e.g. , the weights in a deep neural network ) . Let ` ( θ ) =89 [ ` 1 ( θ ) , . . . , ` m ( θ ) ] be a set of objective functions that we want to minimize . For two parameters θ , θ′ ∈ Rn,90 we write ` ( θ ) ` ( θ′ ) if ` i ( θ ) ≥ ` i ( θ′ ) for all i ∈ [ m ] ; and write ` ( θ ) ` ( θ′ ) if ` ( θ ) ` ( θ′ ) and91 ` ( θ ) 6= ` ( θ′ ) . We say that θ is Pareto dominated ( or Pareto improved ) by θ′ if ` ( θ ) ` ( θ′ ) . We say that θ is92 Pareto optimal on a set Θ ⊆ Rn , denoted as θ ∈ Pareto ( Θ ) , if there exists no θ′ ∈ Θ such that ` ( θ ) ` ( θ′ ) .93 The Pareto global optimal set P∗∗ : = Pareto ( Rn ) is the set of points ( i.e. , θ ) which are Pareto optimal on94 the whole domain Rn . The Pareto local optimal set of ` , denoted by P∗ , is the set of points which are Pareto95 optimal on a neighborhood of itself:96 P∗ : = { θ ∈ Rn : there exists a neighborhood Nθ of θ , such that θ ∈ Pareto ( Nθ ) } . The ( local or global ) Pareto front is the set of objective vectors achieved by the Pareto optimal points , e.g.,97 the local Pareto front is F∗ = { ` ( θ ) : θ ∈ P∗ } . Because finding global Pareto optimum is intractable for98 non-convex objectives in deep learning , we focus on Pareto local optimal sets in this work ; in the rest of the99 paper , terms like “ Pareto set ” and “ Pareto optimum ” refer to Pareto local optimum by default.100 Pareto Stationary Points Similar to the case of single-objective optimization , Pareto local optimum implies a notion of Pareto stationarity defined as follows . Assume ` is differentiable on Rn . A point θ is called Pareto stationary if there must exists a set of non-negative weights ω1 , . . . , ωm with ∑m i=1 ωi = 1 , such that θ is a stationary point of the ω-weighted linear combination of the objectives : ` ω ( θ ) : = ∑m i=1 ωi ` i ( θ ) . Therefore , the set of Pareto stationary points , denoted by P , can be characterized by P : = { θ ∈ Θ : g ( θ ) = 0 } , g ( θ ) : = min ω∈Cm || m∑ i=1 ωi∇ ` i ( θ ) ||2 , ( 1 ) where g ( θ ) is the minimum squared gradient norm of ` ω among all ω in the probability simplex Cm on [ m ] .101 Because g ( θ ) can be calculated in practice , it provides an essential way to access Pareto local optimality.102 Finding Pareto Optimal Points A main focus of the MOO literature is to find a ( set of ) Pareto optimal103 points . The simplest approach is linear scalarization , which minimizes ` ω for some weight ω ( decided , e.g.,104 by the users ) in Cm . However , linear scalarization can only find Pareto points that lie on the convex envelop105 of the Pareto front ( see e.g. , Boyd et al. , 2004 ) , and hence does not give a complete profiling of the Pareto106 front when the objective functions ( and hence their Pareto front ) are non-convex.107 Multiple gradient descent ( MGD ) ( Désidéri , 2012 ) is an gradient-based algorithm that can converge to a Pareto local optimum that lies on either the convex or non-convex parts of the Pareto front , depending on the initialization . MGD starts from some initialization θ0 and updates θ at the t-th iteration by θt+1 ← θt − ξvt , vt : = arg max v∈Rn { min i∈ [ m ] ∇ ` i ( θt ) > v − 1 2 ‖v‖2 } , ( 2 ) where ξ is the step size and vt is an update direction that maximizes the worst descent rate among all108 objectives , since ∇ ` i ( θt ) > v ≈ ( ` i ( θt ) − ` i ( θt − ξv ) ) /ξ approximates the descent rate of objective ` i when109 following direction v. When using a sufficiently small step size ξ , MGD ensures to yield a Pareto improvement110 ( i.e , decreasing all the objectives ) on θt unless θt is Pareto ( local ) optimal ; this is because the optimization in111 Equation ( 2 ) always yields mini∈ [ m ] ∇ ` i ( θt ) > vt ≤ 0 ( otherwise we can simply flip the sign of vt ) .112 Using Lagrange strong duality , the solution of Equation ( 2 ) can be framed into vt = m∑ i=1 ωi , t∇ ` i ( θt ) , where { ωi , t } mi=1 = arg min ω∈Cm ‖∇θ ` ω ( θt ) ‖ . ( 3 ) It is easy to see from Equation ( 3 ) that the set of fixed points of MDG ( which satisfy vt = 0 ) coincides with113 the Pareto stationary set P∗.114 A key disadvantage of MGD , however , is that the Pareto point that it converges to depends on the initialization115 and other algorithm configurations in a rather implicated and complicated way . It is difficult to explicitly116 control MGD to make it converge to points with specific properties.117 3 OPTIMIZATION IN PARETO SET118 The Pareto set typically contains an infinite number of points . In the optimization in Pareto set ( OPT-in-119 Pareto ) problem , we are given an extra criterion function F ( θ ) in addition to the objectives ` , and we want to120 minimize F in the Pareto set of ` , that is,121 min θ∈P∗ F ( θ ) . ( 4 ) For example , one can find the Pareto point whose loss vector ` ( θ ) is the closest to a given reference point122 r ∈ Rm by choosing F ( θ ) = ‖ ` ( θ ) − r‖2 . We can also design F to encourages ` ( θ ) to be proportional to r,123 i.e. , ` ( θ ) ∝ r ; a constraint variant of this problem was considered in Mahapatra & Rajan ( 2020 ) .124 We can further generalize OPT-in-Pareto to allow the criterion F to depend on an ensemble of Pareto points125 { θ1 , ... , θN } jointly , that is,126 min θ1 , ... , θN∈P∗ F ( θ1 , ... , θN ) . ( 5 ) For example , if F ( θ1 , . . . , θN ) measures the diversity among { θi } Ni=1 , then optimizing it provides a set of diversified points inside the Pareto set P∗ . An example of diversity measure is F ( θ1 , . . . , θN ) = E ( ` ( θ1 ) , . . . , ` ( θN ) ) , with E ( ` 1 , . . . , ` N ) = ∑ i 6=j ‖ ` i − ` j‖−2 , ( 6 ) where E is known as an energy distance in computational geometry , whose minimizer can be shown to give127 an uniform distribution asymptotically when N →∞ ( Hardin & Saff , 2004 ) . This formulation is particularly128 useful when the users ’ preference is unknown during the training time , and we want to return an ensemble of129 models that well cover the different areas of the Pareto set to allow the users to pick up a model that fits their130 needs regardless of their preference . The problem of profiling Pareto set has attracted a line of recent works131 ( e.g. , Lin et al. , 2019 ; Mahapatra & Rajan , 2020 ; Ma et al. , 2020 ; Deist et al. , 2021 ) , but they rely on specific132 criterion or heuristics and do not address the general optimization of form Equation ( 5 ) .133 Manifold Gradient Descent One straightforward approach to OPT-in-Pareto is to deploy manifold gradient134 descent ( Hillermeier , 2001 ; Bonnabel , 2013 ) , which conducts steepest descent of F ( θ ) in the Riemannian135 manifold formed by the Pareto set P∗ . Initialized at θ0 ∈ P∗ , manifold gradient descent updates θt at the t-th136 iteration along the direction of the projection of∇F ( θt ) on the tangent space T ( θt ) at θt in P∗,137 θt+1 = θt − ξProjT ( θt ) ( ∇F ( θt ) ) . By using the stationarity characterization in Equation ( 1 ) , under proper regularity conditions , one can138 show that the tangent space T ( θt ) equals the null space of the Hessian matrix ∇2θ ` ωt ( θt ) , where ωt =139 arg minω∈Cm ‖∇θ ` ω ( θt ) ‖ . However , the key issue of manifold gradient descent is the high cost for calculating140 this null space of Hessian matrix . Although numerical techniques such as Krylov subspace iteration ( Ma141 et al. , 2020 ) or conjugate gradient descent ( Koh & Liang , 2017 ) can be applied , the high computational cost142 ( and the complicated implementation ) still impedes its application in large scale deep learning problems . See143 Section 1 for discussions on other related works.144 4 PARETO NAVIGATION GRADIENT DESCENT FOR OPT-IN-PARETO145 We now introduce our main algorithm , Pareto Navigating Gradient Descent ( PNG ) , which provides a practical146 approach to OPT-in-Pareto . For convenience , we focus on the single point problem in Equation ( 4 ) in the147 presentation . The generalization to the multi-point problem in Equation ( 5 ) is straightforward . We first148 introduce the main idea and then present theoretical analysis in Section 4.1.149 Main Idea We consider the general incremental updating rule of form θt+1 ← θt − ξvt , where ξ is the step size and vt is an update direction that we shall choose to achieve the following desiderata150 in balancing the decent of { ` i } and F :151 i ) When θt is far away from the Pareto set , we want to choose vt to give Pareto improvement to θt , moving it152 towards the Pareto set . The amount of Pareto improvement might depend on how far θt is to the Pareto set.153 ii ) If the directions that yield Pareto improvement are not unique , we want to choose the Pareto improvement154 direction that decreases F ( θ ) most.155 iii ) When θt is very close to the Pareto set , e.g. , having a small g ( θ ) , we want to fully optimize F ( θ ) .156 We achieve the desiderata above by using the vt that solves the following optimization : vt = arg min v∈Rn { 1 2 ‖∇F ( θt ) − v‖2 s.t . ∇θ ` i ( θt ) > v ≥ φt , ∀i ∈ [ m ] } , ( 7 ) where we want vt to be as close to ∇F ( θt ) as possible ( hence decrease F most ) , conditional on that the157 decreasing rate ∇θ ` i ( θt ) > vt of all losses ` i are lower bounded by a control parameter φt . A positive φt158 enforces that ∇θt ` i ( θ ) > vt is positive for all ` i , hence ensuring a Pareto improvement when the step size is159 sufficiently small . The magnitude of φt controls how much Pareto improvement we want to enforce , so we160 may want to gradually decrease φt when we move closer to the Pareto set . In fact , varying φt provides an161 intermediate updating direction between the vanilla gradient descent on F and MGD on { ` i } :162 i ) If φt = −∞ , we have vt = ∇F ( θt ) and it conducts a pure gradient descent on F without considering { ` i } .163 ii ) If φt → +∞ , then vt approaches to the MGD direction of { ` i } in Equation ( 2 ) without considering F .164 In this work , we propose to choose φt based on the minimum gradient norm g ( θt ) in Equation ( 1 ) as a surrogate indication of Pareto local optimality . In particular , we consider the following simple design : φt = { −∞ if g ( θt ) ≤ e , αtg ( θt ) if g ( θt ) > e , ( 8 ) where e is a small tolerance parameter and αt is a positive hyper-parameter . When g ( θt ) > e , we set φt to be165 proportional to g ( θt ) , to ensure Pareto improvement based on how far θt is to Pareto set . When g ( θt ) ≤ e,166 we set φt = −∞ which “ turns off ” the control and hence fully optimizes F ( θ ) .167 In practice , the optimization in Equation ( 7 ) can be solved efficiently by its dual form as follows.168 Theorem 1 . The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ t=1 λi , t∇ ` i ( θt ) , ( 9 ) with { λi , t } mt=1 the solution of the following dual problem max λ∈Rm+ −1 2 ||∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ||2 + m∑ i=1 λiφt . ( 10 ) The optimization in Equation ( 10 ) can be solved efficiently for a small m ( e .. g , m ≤ 10 ) , which is the case169 for typical applications . We include the details of the practical implementation in Appendix B.170 4.1 THEORETICAL PROPERTIES171 We provide a theoretical quantification on how PNG guarantees to i ) move the solution towards the Pareto172 set ( Theorem 2 ) ; and ii ) optimize F in a neighborhood of Pareto set ( Theorem 3 ) . To simplify the result and173 highlight the intuition , we focus on the continuous time limit of PNG , which yields a differentiation equation174 dθt = −vtdt with vt defined in Equation ( 7 ) , where t ∈ R+ is a continuous integration time.175 Assumption 1 . Let { θt : t ∈ R+ } be a solution of dθt = −vtdt with vt in Equation ( 7 ) ; φk in Equation ( 8 ) ; 176 e > 0 ; and αt ≥ 0 , ∀t ∈ R+ . Assume F and ` are continuously differentiable on Rn , and lower bounded177 with F ∗ : = infθ∈Rn F ( θ ) > −∞ and ` ∗i : = infθ∈Rn ` i ( θ ) > −∞ . Assume supθ∈Rn ‖∇F ( θ ) ‖ ≤ c.178 Technically , dθt = −vtdt is a piecewise smooth dynamical system whose solution should be taken in the179 Filippov sense using the notion of differential inclusion ( Bernardo et al. , 2008 ) . The solution always exists180 under mild regularity conditions although it may not be unique . Our results below apply to all solutions.181 Pareto Optimization on ` We now show that the algorithm converges to the vicinity of Pareto set quantified by a notion of Pareto closure . For ≥ 0 , let P be the set of Pareto -stationary points : P = { θ ∈ Rn : g ( θ ) ≤ } . The Pareto closure of a set P , denoted by P is the set of points that perform no worse than at least one point in P , that is , P : = ∪θ∈P { θ } , { θ } = { θ′ ∈ Rn : ` ( θ′ ) ` ( θ ) } . Therefore , P is better than or at least as good as P in terms of Pareto efficiency.182 Theorem 2 ( Pareto Improvement on ` ) . Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θs ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.183 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters184 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .185 Here we guarantee that θt must enter P for some time ( in fact infinitely often ) , but it is not confined in P .186 On the other hand , θt does not leave P after it first enters P thanks to the Pareto improvement property.187 Optimization on F We now show that PNG finds a local optimum of F inside the Pareto closure P in an188 approximate sense . We first show that a fixed point θ of the algorithm that is locally convex on F and ` must189 be a local optimum of F in the Pareto closure of { θ } , and then quantify the convergence of the algorithm.190 Lemma 1 . Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,191 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } , that is,192 there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and ` ( θ′ ) ` ( θt ) .193 On the other hand , if θt ∈ Pe , we have vt = ∇F ( θt ) , and hence a fixed point with dθtdt = −vt = 0 is an194 unconstrained local minimum of F when F is locally convex on θt.195 Theorem 3 . Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .196 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .197 Combining the results in Theorem 2 and 3 , we can see that the choice of sequence { αt : t ∈ R+ } controls how198 fast we want to decrease ` vs. F . Large αt yields faster descent on ` , but slower descent on F . Theoretically,199 using a sequence that satisfies ∫ αtdt = +∞ and ∫ αγt dt < +∞ for some γ > 1 allows us to ensure that200 both mins∈ [ 0 , t ] g ( θs ) and mins∈ [ 0 , t ] ‖dθ/ds‖ 2 converge to zero . If we use a constant sequence αt = α , it201 introduces an O ( α√g ) term that does not vanish as t→ +∞ . However , we can expect that g is small when202 is small for well-behaved functions . In practice , we find that constant αt works sufficiently well.203 5 EMPIRICAL RESULTS204 We introduce three applications of OPT-in-Pareto with PNG : Singleton Preference , Pareto approximation and205 improving multi-task based domain generalization method . We also conduct additional study on how the206 learning dynamics of PNG changes with different initialization and hyper-parameters ( αt and e ) , which are207 included in Appendix C.3 . Other additional results that are related to the experiments in Section 5.1 and 5.2208 and are included in the Appendix will be introduced later in their corresponding sections.209 5.1 FINDING PREFERRED PARETO MODELS210 We consider the synthetic example used in Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) , which consists of211 two losses : ` 1 ( θ ) = 1− exp ( −‖θ − η‖2 ) and ` 2 ( θ ) = 1− exp ( −‖θ + η‖2 ) , where η = n−1/2 and n = 10212 is dimension of the parameter θ.213 Ratio-based Criterion We first show that PNG can solve the search problem under the ratio constraint of214 objectives in Mahapatra & Rajan ( 2020 ) , i.e. , finding a point θ ∈ P∗ ∩Ω with Ω = { θ : r1 ` 1 ( θ ) = r2 ` 2 ( θ ) =215 ... = rm ` m ( θ ) } , given some preference vector r = [ r1 , ... , rm ] . We apply PNG with the non-uniformity216 score defined in Mahapatra & Rajan ( 2020 ) as the criterion , and compare with their algorithm called exact217 Pareto optimization ( EPO ) . We show in Figure 1 ( a ) - ( b ) the trajectory of PNG and EPO for searching models218 with different preference vector r , starting from the same randomly initialized point . Both PNG and EPO219 converge to the correct solutions but with different trajectories . This suggests that PNG is able to achieve220 the same functionality of finding ratio-constraint Pareto models as Mahapatra & Rajan ( 2020 ) ; Kamani et al.221 ( 2021 ) do but being versatile to handle general criteria . We refer readers to Appendix C.1.1 for more results222 with different choices of hyper-parameters and the experiment details.223 Other Criteria We demonstrate that PNG is able to find solutions for general choices of F . We consider224 the following designs of F : 1 ) weighted ` 2 distance w.r.t . a reference vector r ∈ Rm+ , that is , Fwd ( θ ) =225 i=1 ( ` i ( θ ) − ri ) 2/ri ; and 2 ) complex cosine : in which F is a complicated function related to the cosine226 of task objectives , i.e. , Fcs = − cos ( π ( ` 1 ( θ ) − r1 ) /2 ) + ( cos ( π ( ` ( θ2 ) − r2 ) ) + 1 ) 2 . Here the weighted ` 2227 distance can be viewed as finding a Pareto model that has the losses close to some target value r , which can be228 viewed as an alternative approach to partition the Pareto set . The design of complex cosine aims to test whether229 PNG is able to handle a very non-linear criterion function . In both cases , we take r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] and230 r2 = 1− r1 . We show in Fig 1 ( c ) - ( d ) the trajectory of PNG . As we can see , PNG is able to correctly find the231 optimal solutions of OPT-in-Pareto . We also test PNG on a more challenging ZDT2-variant used in Ma et al.232 ( 2020 ) and a larger scale MTL problem ( Liu et al. , 2019 ) . We refer readers to Appendix C.1.2 and C.1.3 for233 the setting and results.234 5.2 FINDING DIVERSE PARETO MODELS235 Setup We consider the problem of finding diversified points from the Pareto set by minimizing the energy236 distance criterion in Equation ( 6 ) . We use the same setting as Lin et al . ( 2019 ) ; Mahapatra & Rajan ( 2020 ) .237 We consider three benchmark datasets : ( 1 ) MultiMNIST , ( 2 ) MultiFashion , and ( 3 ) MultiFashion+MNIST.238 For each dataset , there are two tasks ( classifying the top-left and bottom-right images ) . We consider LeNet239 with multihead and train N = 5 models to approximate the Pareto set . For baselines , we compare with linear240 scalarization , MGD ( Sener & Koltun , 2018 ) , and EPO ( Mahapatra & Rajan , 2020 ) . For the MGD baseline,241 we find that naively running it leads to poor performance as the learned models are not diversified and thus we242 initialize the MGD with 60-epoch runs of linear scalarization with equally distributed preference weights and243 runs MGD for the later 40 epoch . We refer the reader to Appendix C.2.1 for more details of the experiments.244 Metric and Result We measure the quality of how well the found models { θ1 , . . . , θN } approximate the245 Pareto set using two standard metrics : Inverted Generational Distance Plus ( IGD+ ) ( Ishibuchi et al. , 2015 ) 246 and hypervolume ( HV ) ( Zitzler & Thiele , 1999 ) ; see Appendix C.2.2 for their definitions . We run all the247 methods with 5 independent trials and report the averaged value and its standard deviation in Table 1 . We248 report the scores calculated based on loss ( cross-entropy ) and accuracy on the test set . The bolded values249 indicate the best result with p-value less than 0.05 ( using matched pair t-test ) . In most cases , PNG improves250 the baselines by a large margin . We include ablation studies in Appendix C.2.3 and additional comparisons251 with the second-order approach proposed by Ma et al . ( 2020 ) in Appendix C.2.4.252 5.3 APPLICATION TO MULTI-TASK BASED DOMAIN GENERALIZATION ALGORITHM253 JiGen ( Carlucci et al. , 2019b ) learns a domain generalizable model by learning two tasks based on linear254 scalarization , which essentially searches for a model in the Pareto set and requires choosing the weight of255 linear scalarization carefully . It is thus natural to study whether there is a better mechanism that dynamically256 adjusts the weights of the two losses so that we eventually learn a better model . Motivated by the adversarial257 feature learning ( Ganin et al. , 2016 ) , we propose to improve JiGen such that the latent feature representations258 of the two tasks are well aligned . This can be framed into an OPT-in-Pareto problem where the criterion is259 the discrepancy of the latent representations ( implemented using an adversarial discrepancy module in the260 network ) of the two tasks . PNG is applied to solve the optimization . We evaluate the methods on PACS ( Li261 et al. , 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon , and Sketches ) .262 The model is trained on three domains and tested on the rest of them . Our approach is denoted as JiGen+PNG263 and we also include JiGen + adv , which simply adds the adversarial loss as regularization and two other264 baseline methods ( D-SAM ( D ’ Innocente & Caputo , 2018 ) and DeepAll ( Carlucci et al. , 2019b ) ) . For the three265 JiGen based approaches , we run 3 independent trials and for the other two baselines , we report the results in266 their original papers . Table 2 shows the result using ResNet-18 , which demonstrates the improvement by the267 application of the OPT-in-Pareto framework . We also include the results using AlexNet in the Appendix . We268 refer readers to Appendix C.4 for the additional results and more experiment details.269 6 CONCLUSION270 This paper studies the OPT-in-Pareto , a problem that has been studied in operation research with restrictive271 linear or convexity assumption but largely under-explored in deep learning literature , in which the objectives272 are non-linear and non-convex . Applying algorithms such as manifold gradient descent requires eigen-273 computation of the Hessian matrix at each iteration and thus can be expensive . We propose a first-order274 approximation algorithm called Pareto Navigation Gradient Descent ( PNG ) with theoretically guaranteed275 descent and convergence property to solve OPT-in-Pareto.276 REFERENCES277 Isabela Albuquerque , Nikhil Naik , Junnan Li , Nitish Keskar , and Richard Socher . Improving out-of-278 distribution generalization via multi-task self-supervised pretraining . arXiv preprint arXiv:2003.13525,279 2020.280 Mario Bernardo , Chris Budd , Alan Richard Champneys , and Piotr Kowalczyk . Piecewise-smooth dynamical281 systems : theory and applications , volume 163 . Springer Science & Business Media , 2008.282 Silvere Bonnabel . Stochastic gradient descent on riemannian manifolds . IEEE Transactions on Automatic283 Control , 58 ( 9 ) :2217–2229 , 2013.284 Stephen Boyd , Stephen P Boyd , and Lieven Vandenberghe . Convex optimization . Cambridge university press,285 2004.286 Fabio M. Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain287 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision288 and Pattern Recognition ( CVPR ) , June 2019a.289 Fabio M Carlucci , Antonio D ’ Innocente , Silvia Bucci , Barbara Caputo , and Tatiana Tommasi . Domain290 generalization by solving jigsaw puzzles . In Proceedings of the IEEE/CVF Conference on Computer Vision291 and Pattern Recognition , pp . 2229–2238 , 2019b.292 Zhao Chen , Vijay Badrinarayanan , Chen-Yu Lee , and Andrew Rabinovich . Gradnorm : Gradient normalization293 for adaptive loss balancing in deep multitask networks . In International Conference on Machine Learning,294 pp . 794–803 . PMLR , 2018.295 Zhao Chen , Jiquan Ngiam , Yanping Huang , Thang Luong , Henrik Kretzschmar , Yuning Chai , and Dragomir296 Anguelov . Just pick a sign : Optimizing deep multitask models with gradient sign dropout . In H. Larochelle,297 M. Ranzato , R. Hadsell , M. F. Balcan , and H. Lin ( eds . ) , Advances in Neural Information Processing298 Systems , volume 33 , pp . 2039–2050 . Curran Associates , Inc. , 2020 . URL https : //proceedings.299 neurips.cc/paper/2020/file/16002f7a455a94aa4e91cc34ebdb9f2d-Paper.pdf.300 Timo M Deist , Monika Grewal , Frank JWM Dankers , Tanja Alderliesten , and Peter AN Bosman.301 Multi-objective learning to predict pareto fronts using hypervolume maximization . arXiv preprint302 arXiv:2102.04523 , 2021.303 Stephan Dempe . Bilevel optimization : theory , algorithms and applications . TU Bergakademie Freiberg,304 Fakultät für Mathematik und Informatik , 2018.305 Jean-Antoine Désidéri . Multiple-gradient descent algorithm ( mgda ) for multiobjective optimization . Comptes306 Rendus Mathematique , 350 ( 5-6 ) :313–318 , 2012.307 Qi Dou , Daniel C Castro , Konstantinos Kamnitsas , and Ben Glocker . Domain generalization via model-308 agnostic learning of semantic features . arXiv preprint arXiv:1910.13580 , 2019.309 Antonio D ’ Innocente and Barbara Caputo . Domain generalization with domain-specific aggregation modules.310 In German Conference on Pattern Recognition , pp . 187–198 . Springer , 2018.311 Joseph G Ecker and Jung Hwan Song . Optimizing a linear function over an efficient set . Journal of312 Optimization Theory and Applications , 83 ( 3 ) :541–563 , 1994.313 Christopher Fifty , Ehsan Amid , Zhe Zhao , Tianhe Yu , Rohan Anil , and Chelsea Finn . Measuring and314 harnessing transference in multi-task learning . arXiv preprint arXiv:2010.15413 , 2020.315 Yaroslav Ganin and Victor Lempitsky . Unsupervised domain adaptation by backpropagation . In International316 conference on machine learning , pp . 1180–1189 . PMLR , 2015.317 Yaroslav Ganin , Evgeniya Ustinova , Hana Ajakan , Pascal Germain , Hugo Larochelle , François Laviolette,318 Mario March , and Victor Lempitsky . Domain-adversarial training of neural networks . Journal of Machine319 Learning Research , 17 ( 59 ) :1–35 , 2016 . URL http : //jmlr.org/papers/v17/15-239.html.320 DP Hardin and EB Saff . Discretizing manifolds via minimum energy points . Notices of the AMS , 51 ( 10 ) :321 1186–1194 , 2004.322 Dan Hendrycks , Mantas Mazeika , Saurav Kadavath , and Dawn Song . Using self-supervised learning can323 improve model robustness and uncertainty . In H. Wallach , H. Larochelle , A. Beygelzimer , F. d'Alché-Buc,324 E. Fox , and R. Garnett ( eds . ) , Advances in Neural Information Processing Systems , volume 32 . Cur-325 ran Associates , Inc. , 2019 . URL https : //proceedings.neurips.cc/paper/2019/file/326 a2b15837edac15df90721968986f7f8e-Paper.pdf.327 Claus Hillermeier . Generalized homotopy approach to multiobjective optimization . Journal of Optimization328 Theory and Applications , 110 ( 3 ) :557–583 , 2001.329 Hisao Ishibuchi , Hiroyuki Masuda , Yuki Tanigaki , and Yusuke Nojima . Modified distance calculation in330 generational distance and inverted generational distance . In International conference on evolutionary331 multi-criterion optimization , pp . 110–125 . Springer , 2015.332 Adrián Javaloy and Isabel Valera . Rotograd : Dynamic gradient homogenization for multi-task learning . arXiv333 preprint arXiv:2103.02631 , 2021.334 Jesús M Jorge . A bilinear algorithm for optimizing a linear function over the efficient set of a multiple335 objective linear programming problem . Journal of Global Optimization , 31 ( 1 ) :1–16 , 2005.336 Mohammad Mahdi Kamani , Rana Forsati , James Z Wang , and Mehrdad Mahdavi . Pareto efficient fairness in337 supervised learning : From extraction to tracing . arXiv preprint arXiv:2104.01634 , 2021.338 Alex Kendall , Yarin Gal , and Roberto Cipolla . Multi-task learning using uncertainty to weigh losses for339 scene geometry and semantics . In Proceedings of the IEEE conference on computer vision and pattern340 recognition , pp . 7482–7491 , 2018.341 Pang Wei Koh and Percy Liang . Understanding black-box predictions via influence functions . In International342 Conference on Machine Learning , pp . 1885–1894 . PMLR , 2017.343 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy M. Hospedales . Deeper , broader and artier domain344 generalization . In Proceedings of the IEEE International Conference on Computer Vision ( ICCV ) , Oct345 2017.346 Da Li , Yongxin Yang , Yi-Zhe Song , and Timothy Hospedales . Learning to generalize : Meta-learning for347 domain generalization . In Proceedings of the AAAI Conference on Artificial Intelligence , volume 32,348 2018a.349 Ya Li , Xinmei Tian , Mingming Gong , Yajing Liu , Tongliang Liu , Kun Zhang , and Dacheng Tao . Deep350 domain generalization via conditional invariant adversarial networks . In Proceedings of the European351 Conference on Computer Vision ( ECCV ) , pp . 624–639 , 2018b.352 Xi Lin , Hui-Ling Zhen , Zhenhua Li , Qingfu Zhang , and Sam Kwong . Pareto multi-task learning . arXiv353 preprint arXiv:1912.12854 , 2019.354 Xi Lin , Zhiyuan Yang , Qingfu Zhang , and Sam Kwong . Controllable pareto multi-task learning . arXiv355 preprint arXiv:2010.06313 , 2020.356 Shikun Liu , Edward Johns , and Andrew J Davison . End-to-end multi-task learning with attention . In357 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pp . 1871–1880,358 2019.359 Zhengliang Liu and Matthias Ehrgott . Primal and dual algorithms for optimization over the efficient set.360 Optimization , 67 ( 10 ) :1661–1686 , 2018.361 Xiaoyuan Luo , Shaolei Liu , Kexue Fu , Manning Wang , and Zhijian Song . A learnable self-supervised task362 for unsupervised domain adaptation on point clouds . arXiv preprint arXiv:2104.05164 , 2021.363 Pingchuan Ma , Tao Du , and Wojciech Matusik . Efficient continuous pareto exploration in multi-task learning.364 In International Conference on Machine Learning , pp . 6522–6531 . PMLR , 2020.365 Debabrata Mahapatra and Vaibhav Rajan . Multi-task learning with user preferences : Gradient descent with366 controlled ascent in pareto optimization . In International Conference on Machine Learning , pp . 6597–6607.367 PMLR , 2020.368 Aviv Navon , Aviv Shamsian , Gal Chechik , and Ethan Fetaya . Learning the pareto front with hypernetworks.369 arXiv preprint arXiv:2010.04104 , 2020.370 Javad Sadeghi and Hossein Mohebi . Solving optimization problems over the weakly efficient set . Numerical371 Functional Analysis and Optimization , pp . 1–33 , 2021.372 Ozan Sener and Vladlen Koltun . Multi-task learning as multi-objective optimization . In S. Bengio , H. Wallach,373 H. Larochelle , K. Grauman , N. Cesa-Bianchi , and R. Garnett ( eds . ) , Advances in Neural Information Pro-374 cessing Systems , volume 31 . Curran Associates , Inc. , 2018 . URL https : //proceedings.neurips.375 cc/paper/2018/file/432aca3a1e345e339f35a30c8f65edce-Paper.pdf.376 Nathan Silberman , Derek Hoiem , Pushmeet Kohli , and Rob Fergus . Indoor segmentation and support377 inference from rgbd images . In European conference on computer vision , pp . 746–760 . Springer , 2012.378 Kihyuk Sohn , David Berthelot , Nicholas Carlini , Zizhao Zhang , Han Zhang , Colin A Raffel , Ekin Do-379 gus Cubuk , Alexey Kurakin , and Chun-Liang Li . Fixmatch : Simplifying semi-supervised learning380 with consistency and confidence . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and381 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 596–608 . Cur-382 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/383 06964dce9addb1c5cb5d6e3d9838f733-Paper.pdf.384 Yu Sun , Eric Tzeng , Trevor Darrell , and Alexei A Efros . Unsupervised domain adaptation through self-385 supervision . arXiv preprint arXiv:1909.11825 , 2019.386 Phan Thien Thach and TV Thang . Problems with resource allocation constraints and optimization over the387 efficient set . Journal of Global Optimization , 58 ( 3 ) :481–495 , 2014.388 Sen Wu , Hongyang R. Zhang , and Christopher Ré . Understanding and improving information transfer389 in multi-task learning . In International Conference on Learning Representations , 2020 . URL https:390 //openreview.net/forum ? id=SylzhkBtDB.391 Sang Michael Xie , Ananya Kumar , Robbie Jones , Fereshte Khani , Tengyu Ma , and Percy Liang . In-n-out : Pre-392 training and self-training using auxiliary information for out-of-distribution robustness . In International393 Conference on Learning Representations , 2021 . URL https : //openreview.net/forum ? id=394 jznizqvr15J.395 Junfeng Yang and Carl Vondrick . Multitask learning strengthens adversarial robustness . 2020.396 Tianhe Yu , Saurabh Kumar , Abhishek Gupta , Sergey Levine , Karol Hausman , and Chelsea Finn . Gra-397 dient surgery for multi-task learning . In H. Larochelle , M. Ranzato , R. Hadsell , M. F. Balcan , and398 H. Lin ( eds . ) , Advances in Neural Information Processing Systems , volume 33 , pp . 5824–5836 . Cur-399 ran Associates , Inc. , 2020 . URL https : //proceedings.neurips.cc/paper/2020/file/400 3fe78a8acf5fda99de95303940a2420c-Paper.pdf.401 Linfeng Zhang , Muzhou Yu , Tong Chen , Zuoqiang Shi , Chenglong Bao , and Kaisheng Ma . Auxiliary training:402 Towards accurate and robust models . In Proceedings of the IEEE/CVF Conference on Computer Vision403 and Pattern Recognition , pp . 372–381 , 2020.404 Eckart Zitzler and Lothar Thiele . Multiobjective evolutionary algorithms : a comparative case study and the405 strength pareto approach . IEEE transactions on Evolutionary Computation , 3 ( 4 ) :257–271 , 1999.406 A THEORETICAL ANALYSIS407 Theorem 1 [ Dual of Equation ( 7 ) ] The solution vt of Equation ( 7 ) , if it exists , has a form of vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , with { λi , t } mi=1 the solution of the following dual problem max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λt∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt , where Rm+ is the set of nonnegative m-dimensional vectors , that is , Rm+ = { λ ∈ Rm : λi ≥ 0 , ∀i ∈ [ m ] } .408 Proof . By introducing Lagrange multipliers , the optimization in Equation ( 7 ) is equivalent to the following409 minimax problem:410 min v∈Rn max λ∈Rm+ 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) . With strong duality of convex quadratic programming ( assuming the primal problem is feasible ) , we can exchange the order of min and max , yielding max λ∈Rm+ { Φ ( λ ) : = min v∈Rn 1 2 ‖∇F ( θt ) − v‖2 + m∑ i=1 λi ( φt −∇ ` i ( θt ) > v ) } . It is easy to see that the minimization w.r.t . v is achieved when v = ∇F ( θt ) + ∑m i=1 λi∇ ` i ( θt ) . Correspond-411 ingly , the Φ ( λ ) has the following dual form:412 max λ∈Rm+ −1 2 ∥∥∥∥∥∇F ( θt ) + m∑ i=1 λi∇ ` i ( θt ) ∥∥∥∥∥ 2 + m∑ i=1 λiφt . This concludes the proof.413 Theorem 2 [ Pareto Improvement on ` ] Under Assumption 1 , assume θ0 6∈ Pe , and te is the first time when θte ∈ Pe , then for any time t < te , d dt ` i ( θt ) ≤ −αtg ( θt ) , min s∈ [ 0 , t ] g ( θt ) ≤ mini∈ [ m ] ( ` i ( θ0 ) − ` ∗i ) ∫ t 0 αsds . Therefore , the update yields Pareto improvement on ` when θt 6∈ Pe and αtg ( θt ) > 0.414 Further , if ∫ t 0 αsds = +∞ , then for any > e , there exists a finite time t ∈ R+ on which the solution enters415 P and stays within P afterwards , that is , we have θt ∈ P and θt ∈ P for any t ≥ t .416 Proof . i ) When t < te , we have g ( θt ) > e and hence d dt ` i ( θt ) = −∇ ` i ( θt ) > vt ≤ −φt = −αtg ( θt ) , ( 11 ) where we used the constraint of∇ ` i ( θt ) > vt ≥ φt in Equation ( 7 ) . Therefore , we yield strict decent on all the417 losses { ` i } when αtg ( θt ) > 0.418 ii ) Integrating both sides of Equation ( 11 ) : min s∈ [ 0 , t ] g ( θs ) ≤ ∫ t 0 αsg ( θs ) ds∫ t 0 αsds ≤ ` i ( θ0 ) − ` i ( θt ) ∫ t 0 αsds ≤ ` i ( θ0 ) − ` ∗∫ t 0 αsds . This yields the result since it holds for every i ∈ [ m ] .419 If ∫∞ 0 αtdt = +∞ , then we have mins∈ [ 0 , t ] g ( θs ) → 0 when t → +∞ . Assume there exists an > e,420 such that θt never enters P at finite t. Then we have g ( θt ) ≥ for t ∈ R+ , which contradicts with421 mins∈ [ 0 , t ] g ( θs ) → 0.422 iii ) Assume there exists a finite time t′ ∈ ( t , +∞ ) such that θt′ 6∈ P . Because > e and g is continuous , Pe423 is in the interior of P ⊆ P . Therefore , the trajectory leading to θt′ 6∈ P must pass through P \Pe at some424 point , that is , there exists a point t′′ ∈ [ t , t′ ) , such that { θt : t ∈ [ t′′ , t′ ] } 6∈ Pe . But because the algorithm can425 not increase any objective ` i outside of Pe , we must have ` ( θt′ ) ` ( θt′′ ) , yielding that θt′ ∈ { θt′′ } ⊆ P ,426 where { θt′′ } is the Pareto closure of { θt′′ } ; this contradicts with the assumption.427 Lemma 1 Under Assumption 1 , assume θt 6∈ Pe is a fixed point of the algorithm , that is , dθtdt = −vt = 0,428 and F , ` are convex in a neighborhood θt , then θt is a local minimum of F in the Pareto closure { θt } ,429 that is , there exists a neighborhood of θt in which there exists no point θ′ such that F ( θ′ ) < F ( θt ) and430 ` ( θ′ ) ` ( θt ) .431 Proof . Note that minimizing F in { θt } can be framed into a constrained optimization problem : min θ F ( θ ) s.t . ` i ( θ ) ≤ ` i ( θt ) , ∀i ∈ [ m ] . In addition , by assumption , θ = θt satisfies vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) = 0 , which is the KKT432 stationarity condition of the constrained optimization . It is also obvious to check that θ = θt satisfies the433 feasibility and slack condition trivially . Combining this with the local convexity assumption yields the434 result.435 Theorem 3 [ Optimization of F ] Let > e and assume g : = supθ { g ( θ ) : θ ∈ P } < +∞ and supt≥0 αt < ∞ . Under Assumption 1 , when we initialize from θ0 ∈ P , we have min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 αs ( αsg + c √ g ) ds . In particular , if we have αt = α = const , then mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+ α √ g ) .436 If ∫∞ 0 αγt dt < +∞ for some γ ≥ 1 , we have mins∈ [ 0 , t ] ‖dθs/ds‖ 2 = O ( 1/t+√g /t1/γ ) .437 Proof . i ) The slack condition of the constrained optimization in Equation ( 7 ) says that λi , t ( ∇ ` i ( θt ) > vt − φt ) = 0 , ∀i ∈ [ m ] . ( 12 ) This gives that ‖vt‖2 = ( ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) ) > vt = ∇F ( θt ) > vt + m∑ i=1 λi , tφt //plugging Equation ( 12 ) . ( 13 ) If θt 6∈ Pe , we have φt = αtg ( θt ) and this gives d dt F ( θt ) = −∇F ( θt ) > vt = −‖vt‖2 + m∑ i=1 λi , tφt = − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) If θt is in the interior of Pe , then we run typical gradient descent of F and hence has d dt F ( θt ) = −‖vt‖2 = − ∥∥∥∥dθtdt ∥∥∥∥2 . If θt is on the boundary of Pe , then by the definition of differential inclusion , dθ/dt belongs to the convex hull of the velocities that it receives from either side of the boundary , yielding that d dt F ( θt ) = − ∥∥∥∥dθtdt ∥∥∥∥2 + β m∑ i=1 λi , tαtg ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) , where β ∈ [ 0 , 1 ] . Combining all the cases gives d dt F ( θt ) ≤ − ∥∥∥∥dθtdt ∥∥∥∥2 + m∑ i=1 λi , tαtg ( θt ) . Integrating this yields min s∈ [ 0 , t ] ∥∥∥∥dθsds ∥∥∥∥2 ≤ 1t ∫ t 0 ∥∥∥∥dθsds ∥∥∥∥2 ds ≤ F ( θ0 ) − F ∗t + 1t ∫ t 0 m∑ i=1 λi , sαsg ( θs ) ds ≤ F ( θ0 ) − F ∗ t + 1 t ∫ t 0 αs ( αsg + c √ g ) ds , where the last step used Lemma 2 with φt = αtg ( θt ) : m∑ i=1 λi , tαtg ( θt ) ≤ α2t g ( θt ) + cαt √ g ( θt ) ≤ α2t g + cαt √ g , and here we used g ( θt ) ≤ g because the trajectory is contained in P following Theorem 2.438 The remaining results follow Lemma 4.439 A.0.1 TECHNICAL LEMMAS440 Lemma 2 . Assume Assumption 1 holds . Define g ( θ ) = minω∈Cm ‖ ∑m i=1 ωi∇ ` i ( θ ) ‖ 2 , where Cm is the probability simplex on [ m ] . Then for the vt and λi , t defined in Equation ( 7 ) and Equation ( 10 ) , we have m∑ i=1 λi , tg ( θt ) ≤ max ( φt + c √ g ( θt ) , 0 ) . Proof . The slack condition of the constrained optimization in Equation ( 7 ) says that441 λi , t ( ∇ ` i ( θ ) > vt − φt ) = 0 , ∀i ∈ [ m ] . Sum the equation over i ∈ [ m ] and note that vt = ∇F ( θt ) + ∑m i=1 λi , t∇ ` i ( θt ) . We get∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 + ( m∑ i=1 λi , t∇ ` i ( θt ) ) > ∇F ( θ ) − m∑ i=1 λi , tφt = 0 . ( 14 ) Define xt = ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θt ) ∥∥∥∥∥ 2 , λ̄t = m∑ i=1 λi , t , gt = g ( θt ) = min ω∈Cm ∥∥∥∥∥ m∑ i=1 ωi∇ ` i ( θt ) ∥∥∥∥∥ 2 . Then it is easy to see that xt ≥ λ̄2t gt . Using Cauchy-Schwarz inequality , ∣∣∣∣∣∣ ( m∑ i=1 λi , t∇ ` i ( θ ) ) > ∇F ( θt ) ∣∣∣∣∣∣ ≤ ‖∇F ( θt ) ‖ ∥∥∥∥∥ m∑ i=1 λi , t∇ ` i ( θ ) ∥∥∥∥∥ ≤ c√xt , where we used ‖∇F ( θt ) ‖ ≤ c by Assumption 1 . Combining this with Equation ( 14 ) , we have∣∣xt − λ̄tφt∣∣ ≤ c√xt . Applying Lemma 3 yields the result.442 Lemma 3 . Assume φ ∈ R , and x , λ , c , g ∈ R+ are non-negative real numbers and they satisfy |x− λφ| ≤ c √ x , x ≥ λ2g . Then we have λg ≤ max ( 0 , φ+ c√g ) .443 Proof . Square the first equation , we get f ( x ) : = ( x− λφ ) 2 − c2x ≤ 0 , where f is a quadratic function . To ensure that f ( x ) ≤ 0 has a solution that satisfies x ≥ λ2g , we need to have f ( λ2g ) ≤ 0 , that is , f ( λ2g ) = ( λ2g − λφ ) 2 − c2λ2g ≤ 0 . This can hold under two cases:444 Case 1 : λ = 0 ; 445 Case 2 : |λg − φ| ≤ c√g , and hence φ− c√g ≤ λg ≤ φ+ c√g.446 Under both case , we have λg ≤ max ( 0 , φ+ c√g ) . 447 Lemma 4 . Let { αt : t ∈ R+ } ⊆ R+ be a non-negative sequence with A : = ( ∫∞ 0 αγt dt ) 1/γ < ∞ , where γ ≥ 1 , and B = supt αt < ∞ . Then we have 1 t ∫ t 0 ( α2s + αs ) ds ≤ ( B + 1 ) At−1/γ . Proof . Let η = γγ−1 , so that 1/η + 1/γ = 1 . We have by Holder ’ s inequality , ∫ t 0 αsds ≤ ( ∫ t 0 αγsds ) 1/γ ( ∫ t 0 1ηds ) 1/η ≤ At1/η = At1−1/γ . and hence 1 t ∫ t 0 ( α2s + αs ) ds ≤ B + 1 t ∫ t 0 αsds ≤ ( B + 1 ) At−1/γ . 448 Algorithm 1 Pareto Navigating Gradient Descent 1 : Initialize θ0 ; decide the step size ξ , and the control function φ in Equation ( 8 ) ( including the threshold e > 0 and the descending rate { αt } ) . 2 : for iteration t do θt+1 ← θt − ξvt , vt = ∇F ( θt ) + m∑ i=1 λi , t∇ ` i ( θt ) , ( 15 ) where λi , t = 0 , ∀i ∈ [ m ] if g ( θt ) ≤ e , and { λi , t } mt=1 is the solution of Equation ( 10 ) with φ ( θt ) = αtg ( θt ) when g ( θt ) > e. 3 : end for B PRACTICAL IMPLEMENTATION449 Hyper-parameters Our algorithm introduces two hyperparameters { αt } and e over vanilla gradient descent.450 We use constant sequence αt = α and we take α = 0.5 unless otherwise specified . We choose e by451 e = γe0 , where e0 is an exponentially discounted average of 1m ∑m i=1 ‖∇ ` i ( θt ) ‖ 2 over the trajectory so that452 it automatically scales with the magnitude of the gradients of the problem at hand . In the experiments of this453 paper , we simply fix γ = 0.1 unless specified.454 Solving the Dual Problem Our method requires to calculate { λi , t } mt=1 with the dual optimization problem455 in Equation ( 10 ) , which can be solved with any off-the-shelf convex quadratic programming tool . In this456 work , we use a very simple projected gradient descent to approximately solve Equation ( 10 ) . We initialize457 { λi , t } mt=1 with a zero vector and terminate when the difference between the last two iterations is smaller than458 a threshold or the algorithm reaches the maximum number of iterations ( we use 100 in all experiments ) .459 The whole algorithm procedure is summarized in Algorithm 1.460 C EXPERIMENTS461 C.1 FINDING PREFERRED PARETO MODELS462 C.1.1 RATIO-BASED CRITERION463 The non-uniformity score from ( Mahapatra & Rajan , 2020 ) that we use in Figure 1 is defined as FNU ( θ ) = m∑ t=1 ˆ̀ t ( θ ) log ( ˆ̀ t ( θ ) 1/m ) , ˆ̀t ( θ ) = rt ` t ( θ ) ∑ s∈ [ m ] rs ` s ( θ ) . ( 16 ) We fix the other experiment settings the same as Mahapatra & Rajan ( 2020 ) and use γ = 0.01 and α = 0.25464 for this experiment reported in the main text . We defer the ablation studies on the hyper-parameter α and γ to465 Section C.3.466 C.1.2 ZDT2-VARIANT467 We consider the ZDT2-Variant example used in Ma et al . ( 2020 ) with the same experiment setting , in468 which the Pareto set is a cylindrical surface , making the problem more challenging . We consider the469 same criteria , e.g . weighted distance and complex cosine used in the main context with different choices470 of r1 = [ 0.2 , 0.4 , 0.6 , 0.8 ] . We use the default hyper-parameter set up , choosing α = 0.5 and r = 0.1.471 For complex cosine , we use MGD updating for the first 150 iterations . Figure 2 shows the trajectories,472 demonstrating that PNG works pretty well for the more challenging ZDT2-Variant tasks.473 C.1.3 GENERAL CRITERIA : THREE-TASK LEARNING ON THE NYUV2 DATASET474 We show that PNG is able to handle large-scale multitask learning problems by deploying it on a three-475 task learning problem ( segmentation , depth estimation , and surface normal prediction ) on NYUv2 dataset476 ( Silberman et al. , 2012 ) . The main goal of this experiment is to show that : 1 . PNG is able to handle477 OPT-in-Pareto in a large-scale neural network ; 2 . With a proper design of criteria , PNG enables to do478 targeted fine-tuning that pushes the model to move towards a certain direction . We consider the same479 training protocol as Liu et al . ( 2019 ) and use the MTAN network architecture . Start with a model trained480 with equally weighted linear scalarization and our goal is to further improve the model ’ s performance481 on segmentation and surface normal estimation while allowing some sacrifice on depth estimation . This482 can be achieved by many different choices of criterion and in this experiment , we consider the following483 design : F ( θ ) = ( ` seg ( θ ) × ` surface ( θ ) ) / ( 0.001 + ` depth ( θ ) ) . Here ` seg , ` surface and ` depth are the loss functions484 for segmentation , surface normal prediction and depth estimation , respectively . The constant 0.001 in the485 denominator is for numeric stability . We point out that our design of criterion is a simple heuristic and might486 not be an optimal choice and the key question we study here is to verify the functionality of the proposed487 PNG . As suggested by the open-source repository of Liu et al . ( 2019 ) , we reproduce the result based on the488 provided configuration . To show that PNG is able to move the model along the Pareto front , we show the489 evolution of the criterion function and the norm of the MGD gradient during the training in Figure 3 . As we490 can see , PNG effectively decreases the value of criterion function while the norm of MGD gradient remains491 the same . This demonstrates that PNG is able to minimize the criterion by searching the model in the Pareto492 set . Table 3 compares the performances on the three tasks using standard training and PNG , showing that493 PNG is able to improve the model ’ s performance on segmentation and surface normal prediction tasks while494 satisfying a bit of the performance in depth estimation based on the criterion.495 C.2 FINDING DIVERSE PARETO MODELS496 C.2.1 EXPERIMENT DETAILS497 We train the model for 100 epochs using Adam op-498 timizer with batch size 256 and 0.001 learning rate.499 To encourage diversity of the models , following the500 setting in Mahapatra & Rajan ( 2020 ) , we use equally501 distributed preference vectors for linear scalarization502 and EPO . Note that the stochasticity of using mini-503 batches is able to improve the performance of Pareto504 approximation for free by also using the intermedi-505 ate checkpoints to approximate P . To fully exploit506 this advantage , for all the methods , we collect check-507 points every epoch to approximate P , starting from508 epoch 60.509 C.2.2 EVALUATION METRIC DETAILS510 We introduce the definition of the used metric for511 evaluation . Given a set P̂ = { θ1 , . . . , θN } that we512 use to approximate P , its IGD+ score is defined as:513 IGD+ ( P̂ ) = ∫ P∗ q ( θ , P̂ ) dµ ( θ ) , q ( θ , P̂ ) = min θ̂∈P̂ ∥∥∥∥ ( ` ( θ̂ ) − ` ( θ ) ) + ∥∥∥∥ , where µ is some base measure that measures the importance of θ ∈ P and ( t ) + : = max ( t , 0 ) , applied on514 each element of a vector . Intuitively , for each θ , we find a nearest θ̂ ∈ P̂ that approximates θ best . Here515 the ( · ) + is applied as we only care the tasks that θ̂ is worse than θ . In practice , a common choice of µ can516 be a uniform counting measure with uniformly sampled ( or selected ) models from P . In our experiments,517 since we can not sample models from P , we approximate P by combining P̂ from all the methods , i.e.,518 P ≈ ∪m∈ { Linear , MGD , EPO , PNG } P̂m , where P̂m is the approximation set produced by algorithm m.519 This approximation might not be accurate but is sufficient to compare the different methods,520 The Hypervolume score of P̂ , w.r.t . a reference point ` r ∈ Rm+ , is defined as521 HV ( P̂ ) = µ ( { ` = [ ` 1 , ... , ` m ] ∈ Rm | ∃θ ∈ P̂ , s.t . ` t ( θ ) ≤ ` t ≤ ` rt ∀t ∈ [ m ] } ) , where µ is again some measure . We use ` r = [ 0.6 , 0.6 ] for calculating the Hypervolume based on loss and522 set µ to be the common Lebesgue measure . Here we choose 0.6 as we observe that the losses of the two tasks523 are higher than 0.6 and 0.6 is roughly the worst case . When calculating Hypervolume based on accuracy , we524 simply flip the sign.525 C.2.3 ABLATION STUDY526 We conduct ablation study to understand the effect of α and γ using the Pareto approximation task on527 Multi-Mnist . We compare PNG with α = 0.25 , 0.5 , 0.75 and γ = 0.01 , 0.1 , 0.25 . Figure 4 summarizes the528 result . Overall , we observe that PNG is not sensitive to the choice of hyper-parameter.529 C.2.4 COMPARING WITH THE SECOND ORDER APPROACH530 We give a discussion on comparing our approach with the second order approaches proposed by Ma et al.531 ( 2020 ) . In terms of algorithm , Ma et al . ( 2020 ) is a local expansion approach . To apply Ma et al . ( 2020 ) ,532 in the first stage , we need to start with several well distributed models ( i.e. , the ones obtained by linear533 scalarization with different preference weights ) and Ma et al . ( 2020 ) is only applied in the second stage to534 find the neighborhood of each model . The performance gain comes from the local neighbor search of each535 model ( i.e . the second stage ) .536 In comparison , PNG with energy distance is a global search approach . It improves the well-distributedness537 of models in the first stage ( i.e . it ’ s a better approach than simply using linear scalarization with different538 weights ) . And thus the performance gain comes from the first stage . Notice that we can also apply Ma et al.539 ( 2020 ) to PNG with energy distance to add extra local search to further improve the approximation.540 In terms of run time comparison . We compare the wall clock run time of each step of updating the 5 models541 using PNG and the second order approach in Ma et al . ( 2020 ) . We calculate the run time based on the542 multi-MNIST dataset using the average of 100 steps . PNG uses 0.3s for each step while Ma et al . 2020 uses543 16.8s . PNG is 56x faster than the second order approach . And we further argue that , based on time complexity544 theory , the gap will be even larger when the size of the network increases.545 C.3 UNDERSTANDING PNG DYNAMICS546 We draw more analysis to understand the training dynamics of PNG.547 Different Staring Points We give analysis on PNG with different initializations showing that PNG is548 more robust to the initialization than other approaches such as Lin et al . ( 2019 ) . We consider the Pareto set549 approximation tasks and reuse synthetic example introduced in Section 5.1 . We consider learning 5 models to550 approximate the Pareto front staring from two different bad starting points . Specifically , in the upper row of551 Figure 4 , we consider initializing the models using linear scalarization . Due to the concavity of the Pareto552 front , linear scalarization can only learns models at the two extreme end of the Pareto front . The second row553 uses MGD for initialization and the models is scattered at an small region of the Pareto front . Different from554 the algorithm proposed by Lin et al . ( 2019 ) which relies on a good initialization , using the proposed energy555 distance function , PNG pushes the models to be equally distributed on the Pareto Front without the need of556 any prior information of the Pareto front even with extremely bad starting point.557 Trajectory Visualization with Different Hyper-parameters We also give more visualization on the PNG558 trajectory when using different hyper-parameters . We reuse synthetic example introduced in Section 5.1559 for studying the hyper-parameters α and γ . We fix α = 0.25 and vary γ = 0.1 , 0.05 , 0.01 , 0.1 ; and fix560 γ = 0.01 and vary α = 0.1 , 0.25 , 0.5 , 0.75 . Figure 5 plots the trajectories . As we can see , when γ is properly561 chosen , with different α , PNG finds the correct models with different trajectories . Different α determines the562 algorithm ’ s behavior of balancing the descent of task losses or criterion objectives . On the other hand , with563 too large γ , the algorithm fails to find a model that is close to P∗ , which is expected.564 C.4 IMPROVING MULTITASK BASED DOMAIN GENERALIZATION565 We argue that many other deep learning problems also have the structure of multitask learning when multiple566 losses presents and thus optimization techniques in multitask learning can also be applied to those domains.567 In this paper we consider the JiGen ( Carlucci et al. , 2019b ) . JiGen learns a model that can be generalized to568 unseen domain by minimizing a standard cross-entropy loss ` class for classification and an unsupervised loss569 ` jig based on Jigsaw Puzzles:570 ` ( θ ) = ( 1− ω ) ` class ( θ ) + ω ` jig ( θ ) . The ratio between two losses , i.e . ω , is important to the final performance of the model and requires a571 careful grid search . Notice that JiGen is essentially searching for a model on the Pareto front using the linear572 scalarization . Instead of using a fixed linear scalarization to learn a model , one natural questions is that573 whether it is possible to design a mechanism that dynamically adjusts the ratio of the losses so that we can574 achieve to learn a better model.575 We give a case study here . Motivated by the adversarial feature learning ( Ganin et al. , 2016 ) , we propose576 to improve JiGen such that the latent feature representations of the two tasks are well aligned . Specifically,577 suppose that Φclass ( θ ) = { φclass ( xi , θ ) } ni=1 and Φjig ( θ ) = { φjig ( xi , θ ) } ni=1 is the distribution of latent feature578 representation of the two tasks , where xi is the i-th training data . We consider FPD as some probability metric579 that measures the distance between two distributions , we consider the following problem:580 min θ∈P∗ FPD [ Φclass ( θ ) , Φjig ( θ ) ] . With PD as the criterion function , our algorithm automatically reweights the ratio of the two tasks such that581 their latent space is well aligned.582 Setup We fix all the experiment setting the same as Carlucci et al . ( 2019b ) . We use the Alexnet and Resnet-18583 with multihead pretrained on ImageNet as the multitask network . We evaluate the methods on PACS ( Li et al.,584 2017 ) , which covers 7 object categories and 4 domains ( Photo , Art Paintings , Cartoon and Sketches ) . Same to585 Carlucci et al . ( 2019b ) , we trained our model considering three domains as source datasets and the remaining586 one as target . We implement FPD that measures the discrepancy of the feature space of the two tasks using587 the idea of Domain Adversarial Neural Networks ( Ganin & Lempitsky , 2015 ) by adding an extra prediction588 head on the shared feature space to predict the whether the input is for the classification task or Jigsaw task.589 Specifically , we add an extra linear layer on the shared latent feature representations that is trained to predict590 the task that the latent space belongs to , i.e.,591 FPD ( Φclass ( θ ) , Φjig ( θ ) ) = min w , b 1 n n∑ i=1 log ( σ ( w > φclass ( xi , θ ) ) ) + log ( 1− σ ( w > φclass ( xi , θ ) ) ) . Notice that the optimal weight and bias for the linear layer depends on the model parameter θ , during the592 training , both w , b and θ are jointly updated using stochastic gradient descent . We follow the default training593 protocol provided by the source code of Carlucci et al . ( 2019b ) .594 Baselines Our main baselines are JiGen ( Carlucci et al. , 2019b ) ; JiGen + adv , which adds an extra domain595 adversarial loss on JiGen ; and our PNG with domain adversarial loss as criterion function . In order to run596 statistical test for comparing the methods , we run all the main baselines using 3 random trials . We use the597 released source code by Carlucci et al . ( 2019b ) to obtained the performance of JiGen . For JiGen+adv , we use598 an extra run to tune the weight for the domain adversarial loss . Besides the main baselines , we also includes599 TF ( Li et al. , 2017 ) , CIDDG ( Li et al. , 2018b ) , MLDG ( Li et al. , 2018a ) , D-SAM ( D ’ Innocente & Caputo,600 2018 ) and DeepAll ( Carlucci et al. , 2019b ) as baselines with the author reported performance for reference.601 Result The result is summarized in Table 5 with bolded value indicating the statistical significant best methods602 with p-value based on matched-pair t-test less than 0.1 . Combining Jigen and PNG to dynamically reweight603 the task weights is able to implicitly regularizes the latent space without adding an actual regularizer which604 might hurt the performance on the tasks and thus improves the overall result.605 | This paper intends to introduce an algorithm for finding points on the Pareto frontier with some conditions defined by the user. In this proposal, the condition defined by the user is added to the main objectives and solves a new multiobjective optimization problem. They provide empirical comparisons to show the effectiveness of their approach. | SP:ff2436a7f3e442bf9b1f847a151bc547a91f43e6 |
Understanding Sharpness-Aware Minimization | 1 INTRODUCTION . Understanding generalization of overparametrized deep neural networks is a central topic of the current machine learning research . Their training objective has many global optima where the training data are perfectly fitted ( Zhang et al. , 2016 ) , but different global optima lead to dramatically different generalization performance ( Liu et al. , 2019 ) . However , it has been observed that stochastic gradient descent ( SGD ) tends to converge to well-generalizing solutions , even without any explicit regularization methods ( Zhang et al. , 2016 ) . This suggests that the leading role is played by the implicit bias of the optimization algorithms used ( Neyshabur et al. , 2014 ) : when the training objective is minimized using a particular algorithm and initialization method , it converges to a specific solution with favorable generalization properties . However , even though SGD has a very beneficial implicit bias , significant overfitting can still occur , particularly in the presence of label noise ( Nakkiran et al. , 2019 ) and adversarial perturbations ( Rice et al. , 2020 ) . Recently it has been observed that the sharpness of the training loss , i.e. , how quickly it changes in some neighborhood around the parameters of the model , correlates well with the generalization error ( Keskar et al. , 2016 ; Jiang et al. , 2019 ) , and generalization bounds related to the sharpness have been derived ( Dziugaite & Roy , 2018 ) . The idea of minimizing the sharpness to improve generalization has motivated recent works of Foret et al . ( 2021 ) and Wu et al . ( 2020 ) which propose to use worst-case perturbations of the weights on every iteration of training in order to improve generalization . We refer to this method as Sharpness-Aware Minimization ( SAM ) and focus mainly on the version proposed in Foret et al . ( 2021 ) that performs only one step of gradient ascent to approximately solve the weight perturbation problem before updating the weights . Despite the fact that SAM significantly improves generalization in various settings , the existing justifications based on the generalization bounds provided by Foret et al . ( 2021 ) and Wu et al . ( 2020 ) do not seem conclusive . The main reason is that their generalization bounds do not distinguish the worst-case robustness to worst-case weight perturbation from average-case robustness to Gaussian noise . However the latter does not sufficiently improve generalization as both Foret et al . ( 2021 ) and Wu et al . ( 2020 ) report . Moreover , their analysis does not distinguish whether the weight perturbation is applied based on some or on all training examples which , as we will discuss , has an important impact on generalization . We aim at further investigating the reasons for SAM ’ s success and make the following contributions : • We first discuss that the SAM formulation can lead to two different objectives . We show that the gradient flows on these objectives over diagonal linear networks are implicitly biased towards solutions which enjoy better generalization properties compared to the standard gradient flow . • We provide convergence results for the SAM algorithm used with stochastic gradients for non-convex objectives and discuss the convergence and generalization behavior of SAM for deep networks . • We discuss why SAM can prevent overfitting in the noisy label setting by interpreting SAM as a gradient reweighting scheme and showing the further benefits of combining it with a robust loss . • Finally , we draw parallels between overfitting in learning with noisy labels and in adversarial training where SAM also improves generalization . This connection suggests that techniques from the noisy label literature can be more generally useful to improve robust generalization . 2 RELATED WORK . Here we discuss relevant works on robustness in the weight space and cover the main references on overfitting in the noisy label setting and in adversarial training , two settings where weight-space robustness also improves generalization . Weight-space robustness . Works on weight-space robustness of neural networks date back at least to 1990s ( Murray & Edwards , 1993 ; Hochreiter & Schmidhuber , 1995 ) . Random perturbations of the weights are used extensively in deep learning ( Jim et al. , 1996 ; Graves et al. , 2013 ) , and most prominently in approaches such as dropout ( Srivastava et al. , 2014 ) . Many practitioners have observed that using SGD with larger batches for training leads to worse generalization ( LeCun et al. , 2012 ) , and Keskar et al . ( 2016 ) have shown that this degradation of performance is correlated with the sharpness of the found parameters . This observation has motivated many further works which focus on closing the generalization gap between small-batch and large-batch SGD ( Wen et al. , 2018 ; Haruki et al. , 2019 ; Lin et al. , 2020 ) . More recently , Jiang et al . ( 2019 ) have shown a strong correlation between the sharpness and the generalization error on a large set of models under a variety of different settings hyperparameters , beyond the batch size . This has motivated the idea of minimizing the sharpness during training to improve standard generalization , leading to Sharpness-Aware Minimization ( SAM ) ( Foret et al. , 2021 ) . SAM modifies SGD such that on every iteration of training , the gradient is taken not at the current iterate but rather at a worst-case point in its vicinity . Zheng et al . ( 2021 ) concurrently propose a very similar weight perturbation method which also successfully improves standard generalization on multiple deep learning benchmarks . Wu et al . ( 2020 ) have also proposed a similar algorithm with the same motivation , although Wu et al . ( 2020 ) focuses on improving robust generalization of adversarial training . Overfitting in learning with noisy labels . Arpit et al . ( 2017 ) have observed that deep networks noticeably overfit in the presence of mislabeled samples but early stopping can mitigate the problem . There are multiple other approaches that can mitigate this overfitting behavior : removing ( Song et al. , 2020 ) or downweighting noisy points ( Jiang et al. , 2018 ; Huang et al. , 2020 ) , using robust losses ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Menon et al. , 2019 ) . Most of these approaches explicitly or implicitly leverage the early-learning phenomenon ( Liu et al. , 2020 ) where the network tends to fit first correctly labeled points and noisy points later in training . In the context of adversarial robustness , Sanyal et al . ( 2020 ) have discussed that fitting label noise can aggravate adversarial vulnerability , although removing label noise is not sufficient to achieve adversarial robustness . Overfitting in adversarial training . Adversarial training in deep learning has been formulated as a robust optimization problem by Madry et al . ( 2018 ) where the worst-case perturbations are typically found via projected gradient descent . Rice et al . ( 2020 ) have described the robust overfitting phenomenon in adversarial training suggesting that early stopping is highly beneficial and provides a competitive baseline . However , they do not provide explanations about the reasons behind the overfitting phenomenon . The state-of-the-art approaches propose different ways to improve robust generalization and mitigate robust overfitting such as using additional training data ( Carmon et al. , 2019 ) , weight averaging ( Gowal et al. , 2020 ; Chen et al. , 2021 ) , or advanced data augmentations ( Rebuffi et al. , 2021 ) . Additionally , Wu et al . ( 2020 ) have shown that combining adversarial training with a method similar to sharpness-aware minimization also improves robust generalization . 3 IMPLICIT BIAS AND CONVERGENCE OF SAM . In this section , we discuss different objectives related to Sharpness-Aware Minimization ( SAM ) and their generalization properties , then derive convergence results for the stochastic SAM algorithm , and further discuss the convergence and generalization of SAM for deep networks . 3.1 IMPLICIT BIAS OF SAM . SAM objectives . Let { xi , yi } ni=1 be the training data points and ` i ( w ) be the loss of a classifier parametrized by weights w ∈ R|w| and evaluated at point ( xi , yi ) . Foret et al . ( 2021 ) theoretically base their approach on the following objective which we denote as MaxSum SAM : MaxSum SAM : min w∈R|w| max ‖δ‖2≤ρ 1 n n∑ i=1 ` i ( w + δ ) . ( 1 ) They justify this objective via a PAC-Bayesian generalization bound , although they show empirically ( see Fig . 3 therein ) that the following objective , denoted as SumMax SAM , leads to better generalization : SumMax SAM : min w∈R|w| 1 n n∑ i=1 max ‖δ‖2≤ρ ` i ( w + δ ) . ( 2 ) The update rule of SAM for these objectives amounts then to a variation of gradient descent with step size γt where the gradients are taken at intermediate points wit+1/2 , i.e. , wt+1 = wt − γtn ∑n i=1∇ ` i ( wit+1/2 ) . The two objectives , however , differ in how the points w i t+1/2 are computed since they approximately maximize different losses with inner step sizes ρt : MaxSum : wit+1/2 = wt + ρt n n∑ j=1 ∇ ` j ( wt ) vs. SumMax : wit+1/2 = wt + ρt∇ ` i ( wt ) . ( 3 ) We next show formally that SumMax SAM has a better implicit bias than ERM and MaxSum SAM . Implicit bias of SumMax and MaxSum SAM . The implicit bias of gradient methods is well understood for linear models where all gradient-based algorithms enjoy the same implicit bias . For diagonal linear neural networks , first-order algorithms have a richer implicit bias . We consider here a sparse regression problem and a predictor parametrized as fu , v = u u−v v. Before understanding how SAM induces a preferable bias , we first recall the seminal result of Woodworth et al . ( 2020 ) : assuming global convergence , the solution selected by the gradient flow initialised at α ∈ Rd and denoted βα∞ solves the constrained optimisation problem : βα∞ = arg min β∈Rd s.t . Xβ=y φα ( β ) . ( 4 ) The potential φα whose precise expression is given Eq . ( 12 ) in App . A interpolates nicely between the ` 1 and the ` 2 norms according to the initialization scale α : Small initialisations lead to low ` 1-type solutions which are known to induce good generalisation properties . Large initialisations lead to low ` 2-type solutions . Our main result is that both MaxSum and SumMax dynamics bias the flow towards solutions which still minimise the potential φα . However it does so with effective parameter αMaxSum and αSumMax which are strictly smaller than α for suitable inner step size ρ . Thus the chosen solution has better sparsity-inducing properties than the solution of the gradient flow . Proposition 1 ( Informal ) . Assuming global convergence , the solutions selected by the MaxSum and the SumMax algorithms defined Eq . ( 3 ) , taken in the infinitesimally-small-γt limit and initialised at α , solve the optimisation problem ( 4 ) with effective parameters αSumMax and αSumMax which satisfy : αSumMax = αe −ρ∆SumMax+O ( ρ2 ) and αMaxSum = αe−ρ∆MaxSum+O ( ρ 2 ) , where ∆SumMax and ∆MaxSum are two entrywise positive vectors for which typically : ‖∆SumMax‖1 ≈ d ∫ ∞ 0 L ( w ( s ) ) ds and ‖∆MaxSum‖1 ≈ d n ∫ ∞ 0 L ( w ( s ) ) ds . The results are formally stated in Proposition 4 and 5 in App . A . The SumMax implementations has better bias properties since its effective scale of α is considerably smaller than the one of MaxSum . It is worth noting that the vectors ∆SumMax and ∆MaxSum are linked with the integral of the loss function along the flow . Thereby , the speed of convergence of the training loss impacts the magnitude of the biasing effect : the slower the convergence , the better the bias , similarly to what observed for SGD by Pesme et al . ( 2021 ) . Empirical evidence for the implicit bias . We compare the performance of different methods ( ERM , MaxSum and SumMax SAM ) on the training and test losses in Fig . 1 . As predicted , the methods enjoy various generalization abilities : ERM and MaxSum SAM enjoy the same performance whereas SumMax benefits from a better implicit bias . We also note that the training loss of all the variants is converging to zero but as alluded before the convergence of SumMax SAM is slower . We show a similar experiments in App . A with stochastic variants of the algorithms . As expected , their performances are better than their deterministic counterparts ( Keskar et al. , 2016 ; Pesme et al. , 2021 ) . The results on the implicit bias presented above require that the algorithm converges to zero training error . Therefore we analyze next the convergence of the SAM algorithm for general nonconvex functions in the practically relevant stochastic case . Note that we can not expect rates as fast as the one observed for the previous simple model . They were due to its special structure for which fast convergence rates have been proven ( Yun et al. , 2021 ) . | The aim of the paper is to provide theoretical explanations for the recent successes of adversarial weight perturbation and sharpness-aware minimization (SAM) methods. In particular, these methods have been shown to significantly help robust generalization in deep learning and theoretical explanations for their success are missing so far. The paper aims to fill this gap by getting a better understanding of SAM. It contributes a collection of miscellaneous results: * A proof that SAM provides better generalization for linear neural networks than SGD * The convergence of SAM is analyzed and generalization behavior is discussed * A new interpretation of SAM is presented in terms of gradient reweighing * Finally, a connection of SAM to the noisy label literature is made | SP:29b849109b734c16c3ca14975e8ad32d8ef5bc2b |
Understanding Sharpness-Aware Minimization | 1 INTRODUCTION . Understanding generalization of overparametrized deep neural networks is a central topic of the current machine learning research . Their training objective has many global optima where the training data are perfectly fitted ( Zhang et al. , 2016 ) , but different global optima lead to dramatically different generalization performance ( Liu et al. , 2019 ) . However , it has been observed that stochastic gradient descent ( SGD ) tends to converge to well-generalizing solutions , even without any explicit regularization methods ( Zhang et al. , 2016 ) . This suggests that the leading role is played by the implicit bias of the optimization algorithms used ( Neyshabur et al. , 2014 ) : when the training objective is minimized using a particular algorithm and initialization method , it converges to a specific solution with favorable generalization properties . However , even though SGD has a very beneficial implicit bias , significant overfitting can still occur , particularly in the presence of label noise ( Nakkiran et al. , 2019 ) and adversarial perturbations ( Rice et al. , 2020 ) . Recently it has been observed that the sharpness of the training loss , i.e. , how quickly it changes in some neighborhood around the parameters of the model , correlates well with the generalization error ( Keskar et al. , 2016 ; Jiang et al. , 2019 ) , and generalization bounds related to the sharpness have been derived ( Dziugaite & Roy , 2018 ) . The idea of minimizing the sharpness to improve generalization has motivated recent works of Foret et al . ( 2021 ) and Wu et al . ( 2020 ) which propose to use worst-case perturbations of the weights on every iteration of training in order to improve generalization . We refer to this method as Sharpness-Aware Minimization ( SAM ) and focus mainly on the version proposed in Foret et al . ( 2021 ) that performs only one step of gradient ascent to approximately solve the weight perturbation problem before updating the weights . Despite the fact that SAM significantly improves generalization in various settings , the existing justifications based on the generalization bounds provided by Foret et al . ( 2021 ) and Wu et al . ( 2020 ) do not seem conclusive . The main reason is that their generalization bounds do not distinguish the worst-case robustness to worst-case weight perturbation from average-case robustness to Gaussian noise . However the latter does not sufficiently improve generalization as both Foret et al . ( 2021 ) and Wu et al . ( 2020 ) report . Moreover , their analysis does not distinguish whether the weight perturbation is applied based on some or on all training examples which , as we will discuss , has an important impact on generalization . We aim at further investigating the reasons for SAM ’ s success and make the following contributions : • We first discuss that the SAM formulation can lead to two different objectives . We show that the gradient flows on these objectives over diagonal linear networks are implicitly biased towards solutions which enjoy better generalization properties compared to the standard gradient flow . • We provide convergence results for the SAM algorithm used with stochastic gradients for non-convex objectives and discuss the convergence and generalization behavior of SAM for deep networks . • We discuss why SAM can prevent overfitting in the noisy label setting by interpreting SAM as a gradient reweighting scheme and showing the further benefits of combining it with a robust loss . • Finally , we draw parallels between overfitting in learning with noisy labels and in adversarial training where SAM also improves generalization . This connection suggests that techniques from the noisy label literature can be more generally useful to improve robust generalization . 2 RELATED WORK . Here we discuss relevant works on robustness in the weight space and cover the main references on overfitting in the noisy label setting and in adversarial training , two settings where weight-space robustness also improves generalization . Weight-space robustness . Works on weight-space robustness of neural networks date back at least to 1990s ( Murray & Edwards , 1993 ; Hochreiter & Schmidhuber , 1995 ) . Random perturbations of the weights are used extensively in deep learning ( Jim et al. , 1996 ; Graves et al. , 2013 ) , and most prominently in approaches such as dropout ( Srivastava et al. , 2014 ) . Many practitioners have observed that using SGD with larger batches for training leads to worse generalization ( LeCun et al. , 2012 ) , and Keskar et al . ( 2016 ) have shown that this degradation of performance is correlated with the sharpness of the found parameters . This observation has motivated many further works which focus on closing the generalization gap between small-batch and large-batch SGD ( Wen et al. , 2018 ; Haruki et al. , 2019 ; Lin et al. , 2020 ) . More recently , Jiang et al . ( 2019 ) have shown a strong correlation between the sharpness and the generalization error on a large set of models under a variety of different settings hyperparameters , beyond the batch size . This has motivated the idea of minimizing the sharpness during training to improve standard generalization , leading to Sharpness-Aware Minimization ( SAM ) ( Foret et al. , 2021 ) . SAM modifies SGD such that on every iteration of training , the gradient is taken not at the current iterate but rather at a worst-case point in its vicinity . Zheng et al . ( 2021 ) concurrently propose a very similar weight perturbation method which also successfully improves standard generalization on multiple deep learning benchmarks . Wu et al . ( 2020 ) have also proposed a similar algorithm with the same motivation , although Wu et al . ( 2020 ) focuses on improving robust generalization of adversarial training . Overfitting in learning with noisy labels . Arpit et al . ( 2017 ) have observed that deep networks noticeably overfit in the presence of mislabeled samples but early stopping can mitigate the problem . There are multiple other approaches that can mitigate this overfitting behavior : removing ( Song et al. , 2020 ) or downweighting noisy points ( Jiang et al. , 2018 ; Huang et al. , 2020 ) , using robust losses ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Menon et al. , 2019 ) . Most of these approaches explicitly or implicitly leverage the early-learning phenomenon ( Liu et al. , 2020 ) where the network tends to fit first correctly labeled points and noisy points later in training . In the context of adversarial robustness , Sanyal et al . ( 2020 ) have discussed that fitting label noise can aggravate adversarial vulnerability , although removing label noise is not sufficient to achieve adversarial robustness . Overfitting in adversarial training . Adversarial training in deep learning has been formulated as a robust optimization problem by Madry et al . ( 2018 ) where the worst-case perturbations are typically found via projected gradient descent . Rice et al . ( 2020 ) have described the robust overfitting phenomenon in adversarial training suggesting that early stopping is highly beneficial and provides a competitive baseline . However , they do not provide explanations about the reasons behind the overfitting phenomenon . The state-of-the-art approaches propose different ways to improve robust generalization and mitigate robust overfitting such as using additional training data ( Carmon et al. , 2019 ) , weight averaging ( Gowal et al. , 2020 ; Chen et al. , 2021 ) , or advanced data augmentations ( Rebuffi et al. , 2021 ) . Additionally , Wu et al . ( 2020 ) have shown that combining adversarial training with a method similar to sharpness-aware minimization also improves robust generalization . 3 IMPLICIT BIAS AND CONVERGENCE OF SAM . In this section , we discuss different objectives related to Sharpness-Aware Minimization ( SAM ) and their generalization properties , then derive convergence results for the stochastic SAM algorithm , and further discuss the convergence and generalization of SAM for deep networks . 3.1 IMPLICIT BIAS OF SAM . SAM objectives . Let { xi , yi } ni=1 be the training data points and ` i ( w ) be the loss of a classifier parametrized by weights w ∈ R|w| and evaluated at point ( xi , yi ) . Foret et al . ( 2021 ) theoretically base their approach on the following objective which we denote as MaxSum SAM : MaxSum SAM : min w∈R|w| max ‖δ‖2≤ρ 1 n n∑ i=1 ` i ( w + δ ) . ( 1 ) They justify this objective via a PAC-Bayesian generalization bound , although they show empirically ( see Fig . 3 therein ) that the following objective , denoted as SumMax SAM , leads to better generalization : SumMax SAM : min w∈R|w| 1 n n∑ i=1 max ‖δ‖2≤ρ ` i ( w + δ ) . ( 2 ) The update rule of SAM for these objectives amounts then to a variation of gradient descent with step size γt where the gradients are taken at intermediate points wit+1/2 , i.e. , wt+1 = wt − γtn ∑n i=1∇ ` i ( wit+1/2 ) . The two objectives , however , differ in how the points w i t+1/2 are computed since they approximately maximize different losses with inner step sizes ρt : MaxSum : wit+1/2 = wt + ρt n n∑ j=1 ∇ ` j ( wt ) vs. SumMax : wit+1/2 = wt + ρt∇ ` i ( wt ) . ( 3 ) We next show formally that SumMax SAM has a better implicit bias than ERM and MaxSum SAM . Implicit bias of SumMax and MaxSum SAM . The implicit bias of gradient methods is well understood for linear models where all gradient-based algorithms enjoy the same implicit bias . For diagonal linear neural networks , first-order algorithms have a richer implicit bias . We consider here a sparse regression problem and a predictor parametrized as fu , v = u u−v v. Before understanding how SAM induces a preferable bias , we first recall the seminal result of Woodworth et al . ( 2020 ) : assuming global convergence , the solution selected by the gradient flow initialised at α ∈ Rd and denoted βα∞ solves the constrained optimisation problem : βα∞ = arg min β∈Rd s.t . Xβ=y φα ( β ) . ( 4 ) The potential φα whose precise expression is given Eq . ( 12 ) in App . A interpolates nicely between the ` 1 and the ` 2 norms according to the initialization scale α : Small initialisations lead to low ` 1-type solutions which are known to induce good generalisation properties . Large initialisations lead to low ` 2-type solutions . Our main result is that both MaxSum and SumMax dynamics bias the flow towards solutions which still minimise the potential φα . However it does so with effective parameter αMaxSum and αSumMax which are strictly smaller than α for suitable inner step size ρ . Thus the chosen solution has better sparsity-inducing properties than the solution of the gradient flow . Proposition 1 ( Informal ) . Assuming global convergence , the solutions selected by the MaxSum and the SumMax algorithms defined Eq . ( 3 ) , taken in the infinitesimally-small-γt limit and initialised at α , solve the optimisation problem ( 4 ) with effective parameters αSumMax and αSumMax which satisfy : αSumMax = αe −ρ∆SumMax+O ( ρ2 ) and αMaxSum = αe−ρ∆MaxSum+O ( ρ 2 ) , where ∆SumMax and ∆MaxSum are two entrywise positive vectors for which typically : ‖∆SumMax‖1 ≈ d ∫ ∞ 0 L ( w ( s ) ) ds and ‖∆MaxSum‖1 ≈ d n ∫ ∞ 0 L ( w ( s ) ) ds . The results are formally stated in Proposition 4 and 5 in App . A . The SumMax implementations has better bias properties since its effective scale of α is considerably smaller than the one of MaxSum . It is worth noting that the vectors ∆SumMax and ∆MaxSum are linked with the integral of the loss function along the flow . Thereby , the speed of convergence of the training loss impacts the magnitude of the biasing effect : the slower the convergence , the better the bias , similarly to what observed for SGD by Pesme et al . ( 2021 ) . Empirical evidence for the implicit bias . We compare the performance of different methods ( ERM , MaxSum and SumMax SAM ) on the training and test losses in Fig . 1 . As predicted , the methods enjoy various generalization abilities : ERM and MaxSum SAM enjoy the same performance whereas SumMax benefits from a better implicit bias . We also note that the training loss of all the variants is converging to zero but as alluded before the convergence of SumMax SAM is slower . We show a similar experiments in App . A with stochastic variants of the algorithms . As expected , their performances are better than their deterministic counterparts ( Keskar et al. , 2016 ; Pesme et al. , 2021 ) . The results on the implicit bias presented above require that the algorithm converges to zero training error . Therefore we analyze next the convergence of the SAM algorithm for general nonconvex functions in the practically relevant stochastic case . Note that we can not expect rates as fast as the one observed for the previous simple model . They were due to its special structure for which fast convergence rates have been proven ( Yun et al. , 2021 ) . | In this paper, the authors mainly analyzed a SAM-like algorithm with a square loss. For diagonal linear networks, this paper proves that the NNs trained by the algorithm has better generalizations than the ones trained by normal SGD. For deep NNs satisfies PL condition and other assumptions mentioned in section3, the authors can prove the algorithm will converge. The authors use a linear model to give the intuition why the SAM algorithm can generalize better on a dataset with label noise. | SP:29b849109b734c16c3ca14975e8ad32d8ef5bc2b |
Understanding Sharpness-Aware Minimization | 1 INTRODUCTION . Understanding generalization of overparametrized deep neural networks is a central topic of the current machine learning research . Their training objective has many global optima where the training data are perfectly fitted ( Zhang et al. , 2016 ) , but different global optima lead to dramatically different generalization performance ( Liu et al. , 2019 ) . However , it has been observed that stochastic gradient descent ( SGD ) tends to converge to well-generalizing solutions , even without any explicit regularization methods ( Zhang et al. , 2016 ) . This suggests that the leading role is played by the implicit bias of the optimization algorithms used ( Neyshabur et al. , 2014 ) : when the training objective is minimized using a particular algorithm and initialization method , it converges to a specific solution with favorable generalization properties . However , even though SGD has a very beneficial implicit bias , significant overfitting can still occur , particularly in the presence of label noise ( Nakkiran et al. , 2019 ) and adversarial perturbations ( Rice et al. , 2020 ) . Recently it has been observed that the sharpness of the training loss , i.e. , how quickly it changes in some neighborhood around the parameters of the model , correlates well with the generalization error ( Keskar et al. , 2016 ; Jiang et al. , 2019 ) , and generalization bounds related to the sharpness have been derived ( Dziugaite & Roy , 2018 ) . The idea of minimizing the sharpness to improve generalization has motivated recent works of Foret et al . ( 2021 ) and Wu et al . ( 2020 ) which propose to use worst-case perturbations of the weights on every iteration of training in order to improve generalization . We refer to this method as Sharpness-Aware Minimization ( SAM ) and focus mainly on the version proposed in Foret et al . ( 2021 ) that performs only one step of gradient ascent to approximately solve the weight perturbation problem before updating the weights . Despite the fact that SAM significantly improves generalization in various settings , the existing justifications based on the generalization bounds provided by Foret et al . ( 2021 ) and Wu et al . ( 2020 ) do not seem conclusive . The main reason is that their generalization bounds do not distinguish the worst-case robustness to worst-case weight perturbation from average-case robustness to Gaussian noise . However the latter does not sufficiently improve generalization as both Foret et al . ( 2021 ) and Wu et al . ( 2020 ) report . Moreover , their analysis does not distinguish whether the weight perturbation is applied based on some or on all training examples which , as we will discuss , has an important impact on generalization . We aim at further investigating the reasons for SAM ’ s success and make the following contributions : • We first discuss that the SAM formulation can lead to two different objectives . We show that the gradient flows on these objectives over diagonal linear networks are implicitly biased towards solutions which enjoy better generalization properties compared to the standard gradient flow . • We provide convergence results for the SAM algorithm used with stochastic gradients for non-convex objectives and discuss the convergence and generalization behavior of SAM for deep networks . • We discuss why SAM can prevent overfitting in the noisy label setting by interpreting SAM as a gradient reweighting scheme and showing the further benefits of combining it with a robust loss . • Finally , we draw parallels between overfitting in learning with noisy labels and in adversarial training where SAM also improves generalization . This connection suggests that techniques from the noisy label literature can be more generally useful to improve robust generalization . 2 RELATED WORK . Here we discuss relevant works on robustness in the weight space and cover the main references on overfitting in the noisy label setting and in adversarial training , two settings where weight-space robustness also improves generalization . Weight-space robustness . Works on weight-space robustness of neural networks date back at least to 1990s ( Murray & Edwards , 1993 ; Hochreiter & Schmidhuber , 1995 ) . Random perturbations of the weights are used extensively in deep learning ( Jim et al. , 1996 ; Graves et al. , 2013 ) , and most prominently in approaches such as dropout ( Srivastava et al. , 2014 ) . Many practitioners have observed that using SGD with larger batches for training leads to worse generalization ( LeCun et al. , 2012 ) , and Keskar et al . ( 2016 ) have shown that this degradation of performance is correlated with the sharpness of the found parameters . This observation has motivated many further works which focus on closing the generalization gap between small-batch and large-batch SGD ( Wen et al. , 2018 ; Haruki et al. , 2019 ; Lin et al. , 2020 ) . More recently , Jiang et al . ( 2019 ) have shown a strong correlation between the sharpness and the generalization error on a large set of models under a variety of different settings hyperparameters , beyond the batch size . This has motivated the idea of minimizing the sharpness during training to improve standard generalization , leading to Sharpness-Aware Minimization ( SAM ) ( Foret et al. , 2021 ) . SAM modifies SGD such that on every iteration of training , the gradient is taken not at the current iterate but rather at a worst-case point in its vicinity . Zheng et al . ( 2021 ) concurrently propose a very similar weight perturbation method which also successfully improves standard generalization on multiple deep learning benchmarks . Wu et al . ( 2020 ) have also proposed a similar algorithm with the same motivation , although Wu et al . ( 2020 ) focuses on improving robust generalization of adversarial training . Overfitting in learning with noisy labels . Arpit et al . ( 2017 ) have observed that deep networks noticeably overfit in the presence of mislabeled samples but early stopping can mitigate the problem . There are multiple other approaches that can mitigate this overfitting behavior : removing ( Song et al. , 2020 ) or downweighting noisy points ( Jiang et al. , 2018 ; Huang et al. , 2020 ) , using robust losses ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Menon et al. , 2019 ) . Most of these approaches explicitly or implicitly leverage the early-learning phenomenon ( Liu et al. , 2020 ) where the network tends to fit first correctly labeled points and noisy points later in training . In the context of adversarial robustness , Sanyal et al . ( 2020 ) have discussed that fitting label noise can aggravate adversarial vulnerability , although removing label noise is not sufficient to achieve adversarial robustness . Overfitting in adversarial training . Adversarial training in deep learning has been formulated as a robust optimization problem by Madry et al . ( 2018 ) where the worst-case perturbations are typically found via projected gradient descent . Rice et al . ( 2020 ) have described the robust overfitting phenomenon in adversarial training suggesting that early stopping is highly beneficial and provides a competitive baseline . However , they do not provide explanations about the reasons behind the overfitting phenomenon . The state-of-the-art approaches propose different ways to improve robust generalization and mitigate robust overfitting such as using additional training data ( Carmon et al. , 2019 ) , weight averaging ( Gowal et al. , 2020 ; Chen et al. , 2021 ) , or advanced data augmentations ( Rebuffi et al. , 2021 ) . Additionally , Wu et al . ( 2020 ) have shown that combining adversarial training with a method similar to sharpness-aware minimization also improves robust generalization . 3 IMPLICIT BIAS AND CONVERGENCE OF SAM . In this section , we discuss different objectives related to Sharpness-Aware Minimization ( SAM ) and their generalization properties , then derive convergence results for the stochastic SAM algorithm , and further discuss the convergence and generalization of SAM for deep networks . 3.1 IMPLICIT BIAS OF SAM . SAM objectives . Let { xi , yi } ni=1 be the training data points and ` i ( w ) be the loss of a classifier parametrized by weights w ∈ R|w| and evaluated at point ( xi , yi ) . Foret et al . ( 2021 ) theoretically base their approach on the following objective which we denote as MaxSum SAM : MaxSum SAM : min w∈R|w| max ‖δ‖2≤ρ 1 n n∑ i=1 ` i ( w + δ ) . ( 1 ) They justify this objective via a PAC-Bayesian generalization bound , although they show empirically ( see Fig . 3 therein ) that the following objective , denoted as SumMax SAM , leads to better generalization : SumMax SAM : min w∈R|w| 1 n n∑ i=1 max ‖δ‖2≤ρ ` i ( w + δ ) . ( 2 ) The update rule of SAM for these objectives amounts then to a variation of gradient descent with step size γt where the gradients are taken at intermediate points wit+1/2 , i.e. , wt+1 = wt − γtn ∑n i=1∇ ` i ( wit+1/2 ) . The two objectives , however , differ in how the points w i t+1/2 are computed since they approximately maximize different losses with inner step sizes ρt : MaxSum : wit+1/2 = wt + ρt n n∑ j=1 ∇ ` j ( wt ) vs. SumMax : wit+1/2 = wt + ρt∇ ` i ( wt ) . ( 3 ) We next show formally that SumMax SAM has a better implicit bias than ERM and MaxSum SAM . Implicit bias of SumMax and MaxSum SAM . The implicit bias of gradient methods is well understood for linear models where all gradient-based algorithms enjoy the same implicit bias . For diagonal linear neural networks , first-order algorithms have a richer implicit bias . We consider here a sparse regression problem and a predictor parametrized as fu , v = u u−v v. Before understanding how SAM induces a preferable bias , we first recall the seminal result of Woodworth et al . ( 2020 ) : assuming global convergence , the solution selected by the gradient flow initialised at α ∈ Rd and denoted βα∞ solves the constrained optimisation problem : βα∞ = arg min β∈Rd s.t . Xβ=y φα ( β ) . ( 4 ) The potential φα whose precise expression is given Eq . ( 12 ) in App . A interpolates nicely between the ` 1 and the ` 2 norms according to the initialization scale α : Small initialisations lead to low ` 1-type solutions which are known to induce good generalisation properties . Large initialisations lead to low ` 2-type solutions . Our main result is that both MaxSum and SumMax dynamics bias the flow towards solutions which still minimise the potential φα . However it does so with effective parameter αMaxSum and αSumMax which are strictly smaller than α for suitable inner step size ρ . Thus the chosen solution has better sparsity-inducing properties than the solution of the gradient flow . Proposition 1 ( Informal ) . Assuming global convergence , the solutions selected by the MaxSum and the SumMax algorithms defined Eq . ( 3 ) , taken in the infinitesimally-small-γt limit and initialised at α , solve the optimisation problem ( 4 ) with effective parameters αSumMax and αSumMax which satisfy : αSumMax = αe −ρ∆SumMax+O ( ρ2 ) and αMaxSum = αe−ρ∆MaxSum+O ( ρ 2 ) , where ∆SumMax and ∆MaxSum are two entrywise positive vectors for which typically : ‖∆SumMax‖1 ≈ d ∫ ∞ 0 L ( w ( s ) ) ds and ‖∆MaxSum‖1 ≈ d n ∫ ∞ 0 L ( w ( s ) ) ds . The results are formally stated in Proposition 4 and 5 in App . A . The SumMax implementations has better bias properties since its effective scale of α is considerably smaller than the one of MaxSum . It is worth noting that the vectors ∆SumMax and ∆MaxSum are linked with the integral of the loss function along the flow . Thereby , the speed of convergence of the training loss impacts the magnitude of the biasing effect : the slower the convergence , the better the bias , similarly to what observed for SGD by Pesme et al . ( 2021 ) . Empirical evidence for the implicit bias . We compare the performance of different methods ( ERM , MaxSum and SumMax SAM ) on the training and test losses in Fig . 1 . As predicted , the methods enjoy various generalization abilities : ERM and MaxSum SAM enjoy the same performance whereas SumMax benefits from a better implicit bias . We also note that the training loss of all the variants is converging to zero but as alluded before the convergence of SumMax SAM is slower . We show a similar experiments in App . A with stochastic variants of the algorithms . As expected , their performances are better than their deterministic counterparts ( Keskar et al. , 2016 ; Pesme et al. , 2021 ) . The results on the implicit bias presented above require that the algorithm converges to zero training error . Therefore we analyze next the convergence of the SAM algorithm for general nonconvex functions in the practically relevant stochastic case . Note that we can not expect rates as fast as the one observed for the previous simple model . They were due to its special structure for which fast convergence rates have been proven ( Yun et al. , 2021 ) . | This is an ambitious paper that seeks to explain why SAM works the way it does. First, the authors try to justify the better generalization of SAM over SGD on deep networks. Next, the authors discuss why SAM is robust to noisy labels, and argue why SAM can improve generalization even for linear classifiers. Finally, the authors discuss how to further improve SAM by leveraging a gradient reweighting interpretation and combining with a robust loss. | SP:29b849109b734c16c3ca14975e8ad32d8ef5bc2b |
Auto-Transfer: Learning to Route Transferable Representations | 1 INTRODUCTION . Deep learning models have become increasingly good at learning from large amounts of labeled data . However , it is often difficult and expensive to collect sufficient a amount of labeled data for training a deep neural network ( DNN ) . In such scenarios , transfer learning ( Pan & Yang , 2009 ) has emerged as one of the promising learning paradigms that have demonstrated impressive gains in several domains such as vision , natural language , speech , etc. , and tasks such as image classification ( Sun et al. , 2017 ; Mahajan et al. , 2018 ) , object detection ( Girshick , 2015 ; Ren et al. , 2015 ) , segmentation ( Long et al. , 2015 ; He et al. , 2017 ) , question answering ( Min et al. , 2017 ; Chung et al. , 2017 ) , and machine translation ( Zoph et al. , 2016 ; Wang et al. , 2018 ) . Transfer learning utilizes the knowledge from information-rich source tasks to learn a specific ( often information-poor ) target task . There are several ways to transfer knowledge from source task to target task ( Pan & Yang , 2009 ) , but the most widely used approach is fine-tuning ( Sharif Razavian et al. , 2014 ) where the target DNN being trained is initialized with the weights/representations of a source ( often large ) DNN ( e.g . ResNet ( He et al. , 2016 ) ) that has been pre-trained on a large dataset ( e.g . ImageNet ( Deng et al. , 2009 ) ) . In spite of its popularity , fine-tuning may not be ideal when the source and target tasks/networks are heterogeneous i.e . differing feature spaces or distributions ( Ryu et al. , 2020 ; Tsai et al. , 2020 ) . Additionally , the pretrained source network can get overwritten/forgotten which prevents its usage for multiple target tasks simultaneously . Among the myriad of other transfer techniques , the most popular approach involves matching the features of the output ( or gradient of the output ) of the target model to that of the source model ( Jang et al. , 2019 ; Li et al. , 2018 ; Zagoruyko & Komodakis , 2016 ) . In addition to the output features , a few methods attempt to match the features of intermediate states between the source and target models . Here , in this paper , we focus on the latter by guiding the target model with the intermediate source knowledge representations . Besides differing on what features to match , these methods also vary on how to match features , typically based on a regularization approach . While common approaches allow knowledge transfer between heterogeneous tasks/networks , it is also important to recognize that constraining the target DNN representations to be close to certain source DNN representations may be sub-optimal . For example , a source model , trained to classify cats vs dogs may be accessed at different levels to provide internal representations of tiger or wolf images to guide the target task in classifying tigers vs wolves . Since the source model is trained with a large number of parameters and labeled examples of cats and dogs , it will have learned several patterns that distinguish cat images from dog images . It is postulated that concepts or representations such as the shape of the tail , eyes , mouth , whiskers , fur , etc . are useful to differentiate them ( Neyshabur et al. , 2020 ) , and it is further possible to reuse these learned patterns to generalize to new ( related ) tasks by accessing representations at the appropriate level . This example raises three important questions related to knowledge transfer between the source-target models : 1 ) What knowledge to transfer ? 2 ) Where to transfer ? 3 ) How to transfer the source knowledge ? While the what and where have been considered in prior literature ( Jang et al. , 2019 ) , our work takes a novel and principled approach to the questions of what , where and how to transfer knowledge in the transfer learning paradigm . Specifically , and perhaps most importantly , we address the question of how to transfer knowledge , going beyond the standard matching techniques , and take the perspective that it might be best to let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Figure 1 illustrates our approach to knowledge transfer where the question of what and where is addressed by an adversarial multiarmed bandit ( routing function ) and the how is addressed by an aggregation operation detailed later . In building towards these goals , we make the following contributions : • We propose a transfer learning method that takes a novel and principled approach to automatically decide which source layers ( if any ) to receive knowledge from . To achieve this , we propose an adversarial multi-armed bandit ( AMAB ) to learn the parameters of our routing function . • We propose to meaningfully combine feature representations received from the source network with the target network-generated feature representations . Among various aggregation operations that are considered , AMAB also plays a role in selecting the best one . This is in contrast with existing methods that force the target representation to be similar to source representation . • Benefits of the proposed method are demonstrated on multiple datasets . Significant improvements are observed over seven existing benchmark transfer learning methods , particularly when the target dataset is small . For example , in our experiment on ImageNet-based transfer learning on the target Stanford 40 Actions dataset , our auto-transfer learning method achieved more than 15 % improvement in accuracy over the best competitor . 2 RELATED WORK . Transfer learning from a pretrained source model is a well-known approach to handle target tasks with a limited label setup . A key aspect of our work is that we seek to transfer knowledge between heterogeneous DNNs and tasks . Recent work focused on feature and network weight matching to address this problem where the target network is constrained to be near the source network weights and/or feature maps . Network matching based onL2−SP regularization penalizes the ` 2 distance of the pretrained source network weights and weights of the target networks to restrict the search space of the target model and thereby hinder the generalization ( Xuhong et al. , 2018 ) . Recent work ( Li et al. , 2018 ) has shown that it is better to regularize feature maps of the outer layers than the network weights and reweighting the important feature via attention . Furthermore , attention-based feature distillation and selection ( AFDS ) matches the features of the output of the convolutional layers between the source-target models and prunes the unimportant features for computational efficiency . Similar matching can also be applied to match the Jacobians ( change in output with respect to input rather than matching the output ) between source and target networks ( Srinivas & Fleuret , 2018 ) . Previous works ( Dhurandhar et al. , 2018 ; 2020 ) also suggested that rather than matching the output of a complex model , it could also be used to weight training examples of a smaller model . Learning without forgetting ( LwF ) ( Li & Hoiem , 2017 ) leverages the concept of distillation ( Hinton et al. , 2015 ) and takes it further by introducing the concept of stacking additional layers to the source network , retraining the new layers on the target task , and thus adapting to different source and target tasks . SpotTune ( Guo et al. , 2019 ) introduced an adaptive fine-tuning mechanism , where a policy network decides which parts of a network to freeze vs fine-tune . FitNet ( Romero et al. , 2014 ) introduced an alternative to fine-tuning , where the internal feature representations of teacher networks were used as a guide to training the student network by using ` 2 matching loss between the two feature maps . Attention Transfer ( AT ) ( Zagoruyko & Komodakis , 2016 ) used a similar approach to FitNet , except the matching loss was based on attention maps . The most relevant comparison to our work is that of Learning to Transfer ( L2T-ww ) ( Jang et al. , 2019 ) , which matches source and target feature maps but uses a meta-learning based approach to learn weights for useful pairs of source-target layers for feature transfer . Unlike L2T-ww , our method uses a very different principled approach to combine the feature maps in a meaningful way ( instead of feature matching ) and let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Finally , Ji et al . ( 2021 ) uses knowledge distillation based approach to transfer knowledge between source and target networks . 3 AUTO-TRANSFER METHOD . In this section , we describe our main algorithm for Auto-Transfer learning and explain in detail the adversarial bandit approach that dynamically chooses the best way to combine source and target representations in an online manner when the training of the target proceeds . What is the best way to train a target network such that it leverages pre-trained source representations speeding up training on the target task in terms of sample and time efficiency ? We propose a routing framework to answer this : At every target layer , we propose to route one of the source representations from different layers and combine it with a trainable operation ( e.g . a weighted addition ) such that the composite function can be trained together . We propose to use a bandit algorithm to make the routing/combination choices in an online manner , i.e . which source layer ’ s representation to route to a given target layer and how to combine , while the training of the target network proceeds . The bandit algorithm intervenes once every epoch of training to make choices using rewards from evaluation of the combined network on a hold out set , while the latest choice made by the bandit is used by the training algorithm to update the target network parameters on the target task . We empirically show the benefit of this approach with other baselines on standard benchmarks . We now describe this framework of source-target representation transfer along with the online algorithm . 3.1 ROUTING REPRESENTATIONS . For a given image x , let { f1S ( x ) , f2S ( x ) , · · · , fNS ( x ) } and { f1T ( x ) , f2T ( x ) , · · · , fMT ( x ) } be the intermediate feature representations for image x from the source and the target networks , respectively . Let us assume the networks have trainable parameters WS ∈ Rds and WT ∈ Rdt where ds and dt are the total number of trainable parameters of the networks . Clearly , the representations are a function of the trainable parameters of the respective networks . We assume that the source network is pre-trained . These representations could be the output of the convolutional or residual blocks of the source and target networks . Our Key Technique : For the i-th target representation f iT , our proposed method a ) maps i to one of the N intermediate source representations , f jS , or NULL ( zero valued ) representation ; b ) uses Tj , a trainable transformation of the representation f j S , to get f̃ j S , i.e . f̃ j S ( x ) = Tj ( f j S ( x ) ) ; and c ) combines transformed source f̃ jS and the target representations f i T using another trainable operation⊕ chosen from a set of operationsM . LetW ⊕ i , j be the set of trainable parameters associated with the operator chosen . We describe the various possible operations below . The target network uses the combined representation in place of the original i-th target representation : f̃ iT ( x ) = Tj ( f j S ( x ) ) ⊕ f iT ( x ) ( 1 ) In the above equation , the trainable parameters of the operator depend on the i and j ( that dependence is hidden for convenience in notation ) . The set of choices are discrete , that is , P = { [ N ] ∪NULL } ×M where [ N ] denotes set ofN source representations . Each choice has a set of trainable parameters Tj , W ⊕ i , j in addition to the trainable parametersWT of the target network . | This work addresses the challenge of automatic knowledge transfer between different networks. The authors propose to use an adversarial multi-armed bandit to decide where, what and how to combine outputs from different layers of the two networks, improving on the recent line of work that achieves transfer by enforcing closeness between the representations obtained by the two networks. For each layer, the proposed method introduces some additional parameters in the form of intermediate representations and parametrized ways to combine such intermediate representations with the source network's output. The multi-armed bandit is trained to choose which intermediate representation and which aggregating function to use. The reward is determined based on a hold out set. The authors compare the proposed approach with some previous work, showing improvements, and perform a qualitative analysis of the results. | SP:2ccf3e89d319058d5c2bb210ba7fd98beb9e6cfe |
Auto-Transfer: Learning to Route Transferable Representations | 1 INTRODUCTION . Deep learning models have become increasingly good at learning from large amounts of labeled data . However , it is often difficult and expensive to collect sufficient a amount of labeled data for training a deep neural network ( DNN ) . In such scenarios , transfer learning ( Pan & Yang , 2009 ) has emerged as one of the promising learning paradigms that have demonstrated impressive gains in several domains such as vision , natural language , speech , etc. , and tasks such as image classification ( Sun et al. , 2017 ; Mahajan et al. , 2018 ) , object detection ( Girshick , 2015 ; Ren et al. , 2015 ) , segmentation ( Long et al. , 2015 ; He et al. , 2017 ) , question answering ( Min et al. , 2017 ; Chung et al. , 2017 ) , and machine translation ( Zoph et al. , 2016 ; Wang et al. , 2018 ) . Transfer learning utilizes the knowledge from information-rich source tasks to learn a specific ( often information-poor ) target task . There are several ways to transfer knowledge from source task to target task ( Pan & Yang , 2009 ) , but the most widely used approach is fine-tuning ( Sharif Razavian et al. , 2014 ) where the target DNN being trained is initialized with the weights/representations of a source ( often large ) DNN ( e.g . ResNet ( He et al. , 2016 ) ) that has been pre-trained on a large dataset ( e.g . ImageNet ( Deng et al. , 2009 ) ) . In spite of its popularity , fine-tuning may not be ideal when the source and target tasks/networks are heterogeneous i.e . differing feature spaces or distributions ( Ryu et al. , 2020 ; Tsai et al. , 2020 ) . Additionally , the pretrained source network can get overwritten/forgotten which prevents its usage for multiple target tasks simultaneously . Among the myriad of other transfer techniques , the most popular approach involves matching the features of the output ( or gradient of the output ) of the target model to that of the source model ( Jang et al. , 2019 ; Li et al. , 2018 ; Zagoruyko & Komodakis , 2016 ) . In addition to the output features , a few methods attempt to match the features of intermediate states between the source and target models . Here , in this paper , we focus on the latter by guiding the target model with the intermediate source knowledge representations . Besides differing on what features to match , these methods also vary on how to match features , typically based on a regularization approach . While common approaches allow knowledge transfer between heterogeneous tasks/networks , it is also important to recognize that constraining the target DNN representations to be close to certain source DNN representations may be sub-optimal . For example , a source model , trained to classify cats vs dogs may be accessed at different levels to provide internal representations of tiger or wolf images to guide the target task in classifying tigers vs wolves . Since the source model is trained with a large number of parameters and labeled examples of cats and dogs , it will have learned several patterns that distinguish cat images from dog images . It is postulated that concepts or representations such as the shape of the tail , eyes , mouth , whiskers , fur , etc . are useful to differentiate them ( Neyshabur et al. , 2020 ) , and it is further possible to reuse these learned patterns to generalize to new ( related ) tasks by accessing representations at the appropriate level . This example raises three important questions related to knowledge transfer between the source-target models : 1 ) What knowledge to transfer ? 2 ) Where to transfer ? 3 ) How to transfer the source knowledge ? While the what and where have been considered in prior literature ( Jang et al. , 2019 ) , our work takes a novel and principled approach to the questions of what , where and how to transfer knowledge in the transfer learning paradigm . Specifically , and perhaps most importantly , we address the question of how to transfer knowledge , going beyond the standard matching techniques , and take the perspective that it might be best to let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Figure 1 illustrates our approach to knowledge transfer where the question of what and where is addressed by an adversarial multiarmed bandit ( routing function ) and the how is addressed by an aggregation operation detailed later . In building towards these goals , we make the following contributions : • We propose a transfer learning method that takes a novel and principled approach to automatically decide which source layers ( if any ) to receive knowledge from . To achieve this , we propose an adversarial multi-armed bandit ( AMAB ) to learn the parameters of our routing function . • We propose to meaningfully combine feature representations received from the source network with the target network-generated feature representations . Among various aggregation operations that are considered , AMAB also plays a role in selecting the best one . This is in contrast with existing methods that force the target representation to be similar to source representation . • Benefits of the proposed method are demonstrated on multiple datasets . Significant improvements are observed over seven existing benchmark transfer learning methods , particularly when the target dataset is small . For example , in our experiment on ImageNet-based transfer learning on the target Stanford 40 Actions dataset , our auto-transfer learning method achieved more than 15 % improvement in accuracy over the best competitor . 2 RELATED WORK . Transfer learning from a pretrained source model is a well-known approach to handle target tasks with a limited label setup . A key aspect of our work is that we seek to transfer knowledge between heterogeneous DNNs and tasks . Recent work focused on feature and network weight matching to address this problem where the target network is constrained to be near the source network weights and/or feature maps . Network matching based onL2−SP regularization penalizes the ` 2 distance of the pretrained source network weights and weights of the target networks to restrict the search space of the target model and thereby hinder the generalization ( Xuhong et al. , 2018 ) . Recent work ( Li et al. , 2018 ) has shown that it is better to regularize feature maps of the outer layers than the network weights and reweighting the important feature via attention . Furthermore , attention-based feature distillation and selection ( AFDS ) matches the features of the output of the convolutional layers between the source-target models and prunes the unimportant features for computational efficiency . Similar matching can also be applied to match the Jacobians ( change in output with respect to input rather than matching the output ) between source and target networks ( Srinivas & Fleuret , 2018 ) . Previous works ( Dhurandhar et al. , 2018 ; 2020 ) also suggested that rather than matching the output of a complex model , it could also be used to weight training examples of a smaller model . Learning without forgetting ( LwF ) ( Li & Hoiem , 2017 ) leverages the concept of distillation ( Hinton et al. , 2015 ) and takes it further by introducing the concept of stacking additional layers to the source network , retraining the new layers on the target task , and thus adapting to different source and target tasks . SpotTune ( Guo et al. , 2019 ) introduced an adaptive fine-tuning mechanism , where a policy network decides which parts of a network to freeze vs fine-tune . FitNet ( Romero et al. , 2014 ) introduced an alternative to fine-tuning , where the internal feature representations of teacher networks were used as a guide to training the student network by using ` 2 matching loss between the two feature maps . Attention Transfer ( AT ) ( Zagoruyko & Komodakis , 2016 ) used a similar approach to FitNet , except the matching loss was based on attention maps . The most relevant comparison to our work is that of Learning to Transfer ( L2T-ww ) ( Jang et al. , 2019 ) , which matches source and target feature maps but uses a meta-learning based approach to learn weights for useful pairs of source-target layers for feature transfer . Unlike L2T-ww , our method uses a very different principled approach to combine the feature maps in a meaningful way ( instead of feature matching ) and let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Finally , Ji et al . ( 2021 ) uses knowledge distillation based approach to transfer knowledge between source and target networks . 3 AUTO-TRANSFER METHOD . In this section , we describe our main algorithm for Auto-Transfer learning and explain in detail the adversarial bandit approach that dynamically chooses the best way to combine source and target representations in an online manner when the training of the target proceeds . What is the best way to train a target network such that it leverages pre-trained source representations speeding up training on the target task in terms of sample and time efficiency ? We propose a routing framework to answer this : At every target layer , we propose to route one of the source representations from different layers and combine it with a trainable operation ( e.g . a weighted addition ) such that the composite function can be trained together . We propose to use a bandit algorithm to make the routing/combination choices in an online manner , i.e . which source layer ’ s representation to route to a given target layer and how to combine , while the training of the target network proceeds . The bandit algorithm intervenes once every epoch of training to make choices using rewards from evaluation of the combined network on a hold out set , while the latest choice made by the bandit is used by the training algorithm to update the target network parameters on the target task . We empirically show the benefit of this approach with other baselines on standard benchmarks . We now describe this framework of source-target representation transfer along with the online algorithm . 3.1 ROUTING REPRESENTATIONS . For a given image x , let { f1S ( x ) , f2S ( x ) , · · · , fNS ( x ) } and { f1T ( x ) , f2T ( x ) , · · · , fMT ( x ) } be the intermediate feature representations for image x from the source and the target networks , respectively . Let us assume the networks have trainable parameters WS ∈ Rds and WT ∈ Rdt where ds and dt are the total number of trainable parameters of the networks . Clearly , the representations are a function of the trainable parameters of the respective networks . We assume that the source network is pre-trained . These representations could be the output of the convolutional or residual blocks of the source and target networks . Our Key Technique : For the i-th target representation f iT , our proposed method a ) maps i to one of the N intermediate source representations , f jS , or NULL ( zero valued ) representation ; b ) uses Tj , a trainable transformation of the representation f j S , to get f̃ j S , i.e . f̃ j S ( x ) = Tj ( f j S ( x ) ) ; and c ) combines transformed source f̃ jS and the target representations f i T using another trainable operation⊕ chosen from a set of operationsM . LetW ⊕ i , j be the set of trainable parameters associated with the operator chosen . We describe the various possible operations below . The target network uses the combined representation in place of the original i-th target representation : f̃ iT ( x ) = Tj ( f j S ( x ) ) ⊕ f iT ( x ) ( 1 ) In the above equation , the trainable parameters of the operator depend on the i and j ( that dependence is hidden for convenience in notation ) . The set of choices are discrete , that is , P = { [ N ] ∪NULL } ×M where [ N ] denotes set ofN source representations . Each choice has a set of trainable parameters Tj , W ⊕ i , j in addition to the trainable parametersWT of the target network . | The paper proposes an algorithm to transfer a "source" pre-trained deep model into a new one for a given target task. The idea is to wire in a certain way the intermediate representations of the source model into those of the "target" one. The algorithm considers a (small) discrete space of potential such ways to connect both models (location, source processing, and type of merging), and applies a bandit algorithm to sequentially spend training budget under one of the configurations. Experiments are provided that show big gains with respect to standard approaches (like finetuning the source model). | SP:2ccf3e89d319058d5c2bb210ba7fd98beb9e6cfe |
Auto-Transfer: Learning to Route Transferable Representations | 1 INTRODUCTION . Deep learning models have become increasingly good at learning from large amounts of labeled data . However , it is often difficult and expensive to collect sufficient a amount of labeled data for training a deep neural network ( DNN ) . In such scenarios , transfer learning ( Pan & Yang , 2009 ) has emerged as one of the promising learning paradigms that have demonstrated impressive gains in several domains such as vision , natural language , speech , etc. , and tasks such as image classification ( Sun et al. , 2017 ; Mahajan et al. , 2018 ) , object detection ( Girshick , 2015 ; Ren et al. , 2015 ) , segmentation ( Long et al. , 2015 ; He et al. , 2017 ) , question answering ( Min et al. , 2017 ; Chung et al. , 2017 ) , and machine translation ( Zoph et al. , 2016 ; Wang et al. , 2018 ) . Transfer learning utilizes the knowledge from information-rich source tasks to learn a specific ( often information-poor ) target task . There are several ways to transfer knowledge from source task to target task ( Pan & Yang , 2009 ) , but the most widely used approach is fine-tuning ( Sharif Razavian et al. , 2014 ) where the target DNN being trained is initialized with the weights/representations of a source ( often large ) DNN ( e.g . ResNet ( He et al. , 2016 ) ) that has been pre-trained on a large dataset ( e.g . ImageNet ( Deng et al. , 2009 ) ) . In spite of its popularity , fine-tuning may not be ideal when the source and target tasks/networks are heterogeneous i.e . differing feature spaces or distributions ( Ryu et al. , 2020 ; Tsai et al. , 2020 ) . Additionally , the pretrained source network can get overwritten/forgotten which prevents its usage for multiple target tasks simultaneously . Among the myriad of other transfer techniques , the most popular approach involves matching the features of the output ( or gradient of the output ) of the target model to that of the source model ( Jang et al. , 2019 ; Li et al. , 2018 ; Zagoruyko & Komodakis , 2016 ) . In addition to the output features , a few methods attempt to match the features of intermediate states between the source and target models . Here , in this paper , we focus on the latter by guiding the target model with the intermediate source knowledge representations . Besides differing on what features to match , these methods also vary on how to match features , typically based on a regularization approach . While common approaches allow knowledge transfer between heterogeneous tasks/networks , it is also important to recognize that constraining the target DNN representations to be close to certain source DNN representations may be sub-optimal . For example , a source model , trained to classify cats vs dogs may be accessed at different levels to provide internal representations of tiger or wolf images to guide the target task in classifying tigers vs wolves . Since the source model is trained with a large number of parameters and labeled examples of cats and dogs , it will have learned several patterns that distinguish cat images from dog images . It is postulated that concepts or representations such as the shape of the tail , eyes , mouth , whiskers , fur , etc . are useful to differentiate them ( Neyshabur et al. , 2020 ) , and it is further possible to reuse these learned patterns to generalize to new ( related ) tasks by accessing representations at the appropriate level . This example raises three important questions related to knowledge transfer between the source-target models : 1 ) What knowledge to transfer ? 2 ) Where to transfer ? 3 ) How to transfer the source knowledge ? While the what and where have been considered in prior literature ( Jang et al. , 2019 ) , our work takes a novel and principled approach to the questions of what , where and how to transfer knowledge in the transfer learning paradigm . Specifically , and perhaps most importantly , we address the question of how to transfer knowledge , going beyond the standard matching techniques , and take the perspective that it might be best to let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Figure 1 illustrates our approach to knowledge transfer where the question of what and where is addressed by an adversarial multiarmed bandit ( routing function ) and the how is addressed by an aggregation operation detailed later . In building towards these goals , we make the following contributions : • We propose a transfer learning method that takes a novel and principled approach to automatically decide which source layers ( if any ) to receive knowledge from . To achieve this , we propose an adversarial multi-armed bandit ( AMAB ) to learn the parameters of our routing function . • We propose to meaningfully combine feature representations received from the source network with the target network-generated feature representations . Among various aggregation operations that are considered , AMAB also plays a role in selecting the best one . This is in contrast with existing methods that force the target representation to be similar to source representation . • Benefits of the proposed method are demonstrated on multiple datasets . Significant improvements are observed over seven existing benchmark transfer learning methods , particularly when the target dataset is small . For example , in our experiment on ImageNet-based transfer learning on the target Stanford 40 Actions dataset , our auto-transfer learning method achieved more than 15 % improvement in accuracy over the best competitor . 2 RELATED WORK . Transfer learning from a pretrained source model is a well-known approach to handle target tasks with a limited label setup . A key aspect of our work is that we seek to transfer knowledge between heterogeneous DNNs and tasks . Recent work focused on feature and network weight matching to address this problem where the target network is constrained to be near the source network weights and/or feature maps . Network matching based onL2−SP regularization penalizes the ` 2 distance of the pretrained source network weights and weights of the target networks to restrict the search space of the target model and thereby hinder the generalization ( Xuhong et al. , 2018 ) . Recent work ( Li et al. , 2018 ) has shown that it is better to regularize feature maps of the outer layers than the network weights and reweighting the important feature via attention . Furthermore , attention-based feature distillation and selection ( AFDS ) matches the features of the output of the convolutional layers between the source-target models and prunes the unimportant features for computational efficiency . Similar matching can also be applied to match the Jacobians ( change in output with respect to input rather than matching the output ) between source and target networks ( Srinivas & Fleuret , 2018 ) . Previous works ( Dhurandhar et al. , 2018 ; 2020 ) also suggested that rather than matching the output of a complex model , it could also be used to weight training examples of a smaller model . Learning without forgetting ( LwF ) ( Li & Hoiem , 2017 ) leverages the concept of distillation ( Hinton et al. , 2015 ) and takes it further by introducing the concept of stacking additional layers to the source network , retraining the new layers on the target task , and thus adapting to different source and target tasks . SpotTune ( Guo et al. , 2019 ) introduced an adaptive fine-tuning mechanism , where a policy network decides which parts of a network to freeze vs fine-tune . FitNet ( Romero et al. , 2014 ) introduced an alternative to fine-tuning , where the internal feature representations of teacher networks were used as a guide to training the student network by using ` 2 matching loss between the two feature maps . Attention Transfer ( AT ) ( Zagoruyko & Komodakis , 2016 ) used a similar approach to FitNet , except the matching loss was based on attention maps . The most relevant comparison to our work is that of Learning to Transfer ( L2T-ww ) ( Jang et al. , 2019 ) , which matches source and target feature maps but uses a meta-learning based approach to learn weights for useful pairs of source-target layers for feature transfer . Unlike L2T-ww , our method uses a very different principled approach to combine the feature maps in a meaningful way ( instead of feature matching ) and let the target network decide what source knowledge is useful rather than overwriting one ’ s knowledge to match the source representations . Finally , Ji et al . ( 2021 ) uses knowledge distillation based approach to transfer knowledge between source and target networks . 3 AUTO-TRANSFER METHOD . In this section , we describe our main algorithm for Auto-Transfer learning and explain in detail the adversarial bandit approach that dynamically chooses the best way to combine source and target representations in an online manner when the training of the target proceeds . What is the best way to train a target network such that it leverages pre-trained source representations speeding up training on the target task in terms of sample and time efficiency ? We propose a routing framework to answer this : At every target layer , we propose to route one of the source representations from different layers and combine it with a trainable operation ( e.g . a weighted addition ) such that the composite function can be trained together . We propose to use a bandit algorithm to make the routing/combination choices in an online manner , i.e . which source layer ’ s representation to route to a given target layer and how to combine , while the training of the target network proceeds . The bandit algorithm intervenes once every epoch of training to make choices using rewards from evaluation of the combined network on a hold out set , while the latest choice made by the bandit is used by the training algorithm to update the target network parameters on the target task . We empirically show the benefit of this approach with other baselines on standard benchmarks . We now describe this framework of source-target representation transfer along with the online algorithm . 3.1 ROUTING REPRESENTATIONS . For a given image x , let { f1S ( x ) , f2S ( x ) , · · · , fNS ( x ) } and { f1T ( x ) , f2T ( x ) , · · · , fMT ( x ) } be the intermediate feature representations for image x from the source and the target networks , respectively . Let us assume the networks have trainable parameters WS ∈ Rds and WT ∈ Rdt where ds and dt are the total number of trainable parameters of the networks . Clearly , the representations are a function of the trainable parameters of the respective networks . We assume that the source network is pre-trained . These representations could be the output of the convolutional or residual blocks of the source and target networks . Our Key Technique : For the i-th target representation f iT , our proposed method a ) maps i to one of the N intermediate source representations , f jS , or NULL ( zero valued ) representation ; b ) uses Tj , a trainable transformation of the representation f j S , to get f̃ j S , i.e . f̃ j S ( x ) = Tj ( f j S ( x ) ) ; and c ) combines transformed source f̃ jS and the target representations f i T using another trainable operation⊕ chosen from a set of operationsM . LetW ⊕ i , j be the set of trainable parameters associated with the operator chosen . We describe the various possible operations below . The target network uses the combined representation in place of the original i-th target representation : f̃ iT ( x ) = Tj ( f j S ( x ) ) ⊕ f iT ( x ) ( 1 ) In the above equation , the trainable parameters of the operator depend on the i and j ( that dependence is hidden for convenience in notation ) . The set of choices are discrete , that is , P = { [ N ] ∪NULL } ×M where [ N ] denotes set ofN source representations . Each choice has a set of trainable parameters Tj , W ⊕ i , j in addition to the trainable parametersWT of the target network . | To transfer knowledge between heterogeneous source and target networks and tasks, this paper proposes a novel adversarial multi-armed bandit approach (AMAB) which automatically learns to route source representations to appropriate target representations. It combines feature representations received from the source network with the target network-generated feature representations via various aggregation operations. The work is interesting and makes sense to some extent. | SP:2ccf3e89d319058d5c2bb210ba7fd98beb9e6cfe |
T-WaveNet: A Tree-Structured Wavelet Neural Network for Time Series Signal Analysis | 1 INTRODUCTION . Time-varying signal analysis plays a crucial role in various applications . For example , smartwatches utilize inertial signals for human activity logging ( Khan et al. , 2019 ) ; brain-computer interfaces employ electroencephalography ( EEG ) signals to identify user intentions ( Zhang et al. , 2020 ; Autthasan et al. , 2021 ) ; clinical diagnosis systems use surface electromyography signals ( sEMG ) for neuromuscular pathological analysis ( Duan et al. , 2015 ) , and develop muscle-computer interfaces to control external devices ( Pancholi et al. , 2021 ) . The signals mentioned above are all typical time series data , i.e. , a set of observations collected and ordered chronologically , and expressing information at specific frequency ranges . Generally speaking , time series signal analysis consists of three steps : ( i ) data segmentation , wherein the continuous signals are partitioned into segments using fixed- or variable-sized windows ; ( ii ) feature extraction , wherein various techniques are applied on each segment to extract distinguishing features ; and ( iii ) downstream tasks , which generate the desired outputs for certain tasks ( e.g. , classification and anomaly detection ) with the extracted features . Among the three steps , feature extraction is usually the most critical one . Traditional feature extraction approaches for time series signals can be broadly categorized as statistical and structural methods ( Lara et al. , 2012 ) . The former utilizes statistical measurements in time- or frequencydomain to figure out discriminative features , where exemplar time-domain measurements are mean and variance ( Kao et al. , 2009 ; Vepakomma et al. , 2015 ) , and typical frequency-domain measurements include short-time Fourier transform ( STFT ) and discrete Wavelet transform ( DWT ) ( Jiang & Yin , 2015 ; Duan et al. , 2015 ) ) . On the other hand , structural methods aim at describing the morphological interrelationship among the data via polynomial and/or exponential analysis ( Olszewski , 2001 ) . While the above hand-crafted features are efficient for some simple signal analysis tasks , their limited representation capability makes them incapable of dealing with complicated signals contaminated by noise or artifacts , and hence less competitive in real-world tasks ( Chen et al. , 2021 ) . Recently , deep neural networks ( DNNs ) have become the mainstream approaches for feature extraction in time series signal analysis . Various DNN models , including CNN-based solutions ( Xi et al. , 2018 ; Lawhern et al. , 2018 ; Lin et al. , 2020 ; Amin et al. , 2019 ) , CNN-LSTM combined models ( Wang et al. , 2020 ; Xu et al. , 2019 ; Yuki et al. , 2018 ) , and Transformer-based techniques ( Song et al. , 2021 ; Li et al. , 2021 ) , are proposed in the literature , achieving promising performance in many tasks . Despite of the remarkable success of these deep models , most of them place heavy demands on a large amount of labeled data . However , in many real-world applications , it is difficult and/or expensive to acquire sufficient labeled data to train these models . In addition , noise and artifacts that commonly exist in the time series signals make it even harder to obtain discriminative and robust representations . To the end , it may not fully reveal the superiority of deep models when solely relying on the network to directly extract information from raw signals . To solve this problem , some works attempt to use prior knowledge or hand-crafted features to guide the training of the deep learning models , aiming at extracting more effective features with a limited amount of training data ( Ito et al. , 2018 ; Wei et al. , 2019 ; Laput & Harrison , 2019 ) . However , these methods either simply leverage prior knowledge as gates to select features or intuitively add some statistical measurements as regularization terms to the losses , which fail to bring significant improvement . Moreover , designing tailored feature sets for different kinds of signals is tedious and time-consuming , which severely limits the generalization capability of such methods . In this regard , a promising way to acquire more discriminative features is to explore approaches to deeply integrating the inherent properties of the signals into the training process of the deep learning models . An inherent property termed as the dominant frequency range has been evidenced in many time series signals , which is a small subset of the frequency components that carries the primary information of the signal ( Telgarsky , 2013 ) . For instance , more than 95 % of human body motion energy exists in the frequency components below 15 Hz ( Karantonis et al. , 2006 ) ; the informative frequency ranges in brain signals ( EEG ) have been discovered and named as δ ( 0.1-3 Hz ) , θ ( 4-7 Hz ) , α ( 8–13Hz ) , β ( 14-30 Hz ) and γ ( 31-100Hz ) ( CR & MP , 2011 ) . However , most existing deep learning models are unaware of this essential property , and do not fully consider the different roles of various frequency components , leading to sub-optimal solutions . Motivated by the above , we propose a novel tree-structured wavelet neural network , namely T-WaveNet , to extract more effective features from time-series signals by seamlessly and effectively integrating this property into a deep model . Different from previous models , the proposed T-WaveNet adaptively represents the dominant energy range of the input signal with more discriminative features , which can be naturally and easily generalized and applied to different kinds of time series signals . The main contributions of this work are threefold : • We perform frequency spectrum energy analysis for signal decomposition in T-WaveNet , wherein the frequency ranges with more energies are divided into finer-grained subbands and are thus represented with more dimensions compared with other low-energy frequency ranges in the feature vector , which facilitates effective learning of informative and discriminative features with a limited number of potentially noisy training samples . • To extract the features effectively , we propose a novel invertible neural network ( INN ) based wavelet transform as the tree node in the T-WaveNet . Compared to fixed-basis wavelet Haar or lifting scheme-based wavelet , INN-based wavelet provides better representation capacity owing to its entirely data-driven characteristic . To the best of our knowledge , this is the first attempt to model wavelet transform using INN . • Finally , inspired by the self-attention mechanism in Transformer , we propose an instrumental feature fusion module which considers the feature dependencies across different frequency components , thus effectively enhances the robustness of the model by mitigating the impact of the heterogeneity exists in sensor signals recorded from different subjects . Extensive experiments on four popular sensor signal datasets , namely UCI-HAR for activity recognition , OPPORTUNITY for gesture recognition , BCICIV2a for intention recognition , and NinaPro DB1 for muscular movement recognition , show that our T-WaveNet consistently outperforms state-ofthe-art solutions . 2 RELATED WORK . In this section , we review related work on feature extractions for time series analysis and wavelet transform modeling using deep learning techniques . 2.1 FEATURE EXTRACTION FOR SIGNAL ANALYSIS . Existing feature extraction methods for time-varying signal analysis can be broadly classified into hand-crafted and deep learning-based methods , and the former can be further divided into statistical and structural approaches . Hand-crafted statistical and structural approaches are widely used in early studies . For instance , Kao et al . ( 2009 ) applies statistical features such as the mean and the mean absolute deviation ( MAD ) for online activity detection from a portable device . Duan et al . ( 2015 ) performs discrete wavelet transform on surface-Electromyography ( sEMG ) signal for hand motion classification . While relatively easy to calculate , these hand-crafted features are not effective for complicated tasks . In recent years , DNNs have become the mainstream approaches for signal feature extraction . CNNbased models are widely used to extract local temporal correlations of time series data . For example , Lee et al . ( 2017 ) combines multiple CNN layers with different kernel sizes to obtain the temporal dependencies at various time scales . Lawhern et al . ( 2018 ) , Lin et al . ( 2020 ) , and Amin et al . ( 2019 ) utilize CNNs in BCI applications to establish end-to-end EEG decoding models and achieve promising performance . As CNN-based models are often insufficient for extracting long-term temporal features , Ordóñez & Roggen ( 2016 ) , Yuki et al . ( 2018 ) , and Chambers & Yoder ( 2020 ) propose to combine CNNs with LSTMs to extract both short- and long-term temporal features . Xu et al . ( 2019 ) bring out the Inception CNN structures to extract local temporal features at various time scales and utilize gated recurrent units ( GRUs ) to obtain global temporal representations . Recently , Transformer-based methods utilize the self-attention mechanism to model the global temporal dependencies and shows superior performance in various tasks . For example , Song et al . ( 2021 ) construct a simple yet effective Transformer-based model to obtain discriminative representations for EEG signal classification . Li et al . ( 2021 ) design a two-stream convolution-augmented transformer to extract features for human activity recognition , which considers both time-over-channel and channel-over-time dependencies . The above deep learning based solutions try to extract features directly from the raw signal , which ignore the unique characteristics of each type of signals ( e.g. , the frequency spectrum information ) and usually become less effective when training on scarce signal data . Notably , some works try to alleviate this issue by guiding the DNNs with the traditional time-frequency features such that more effective deep representations can be learned . For instance , Ito et al . ( 2018 ) feed the spectrogram images constructed from the temporal features of the inertial signals into CNN models to learn inter-modality features . Laput & Harrison ( 2019 ) train a CNN on the time-frequency-spectral features of the input sensor signal to obtain a fine-grained hand activity sensing system . Furthermore , S et al . ( 2019 ) integrates the Short-Time Fourier Transform into the DNNs to directly learn frequency-domain features . However , the above solutions often need to design tailored features for different kinds of signals , which is tedious and time-consuming , and severely limits the application scenarios . 2.2 WAVELET TRANSFORM MODELING . Frequency-domain feature extraction methods such as Fourier or Wavelet transform are more preferable to time-domain ones , since it is usually easier to extract discriminative features in the frequency domain than directly from the raw input signal . Compared with Fourier transform , which decomposes a signal into fixed frequency components , Wavelet transform is shown to have excellent properties for transient signal analysis , thanks to its capability to analyze signals at different frequencies with various time resolutions . In this section , we focus on Wavelet transform . Recently , integrating wavelet transform with deep learning techniques is shown to be effective in signal and image processing . Early attempts directly replace certain layers in the DNNs with traditional wavelet transform to reduce the number of parameters as well as improve the interpretability . For instance , Williams & Li ( 2018 ) replace the max-pooling layer with a wavelet pooling algorithm to address the overfitting problem . Fujieda et al . ( 2017 ) propose to replace the pooling and convolution layers with wavelet transform . The above methods typically utilize a fixed wavelet basis ( such as Haar ( Haar , 1910 ) ) , which tend to be sub-optimal as it is less flexible and expressive for complex data . Recently , Rodriguez et al . ( 2020 ) propose to replace the fixed wavelet basis in the lifting scheme with deep learnable modules to realize an adaptive wavelet transform unit for image classification , aiming at learning more discriminative frequency features from images . In this work , to better handle the complex spatial-temporal time series data , we build a novel deep wavelet transform unit with powerful representation capability , named frequency bisection operator . It decomposes the input signal into frequency subbands of various sizes and models the wavelet basis with an INN ( Dinh et al. , 2014 ) . To the best of our knowledge , this is the first attempt to model the wavelet transform using INN . We detail the proposed solution in Section 3.2 . | This paper introduces a novel technique for the analysis of biomedical signals. The technique is inspired from Wavelet transform and consists in analyzing the original signal in different frequency subband. The technique differs from wavelet transform by the fact that instead of using a fixe wavelet function, a dedicated invertible neural network is learnt for each frequency subband. Finally, features from each subbands are fused using a Transformer like model. The proposed techniques has been thoroughly tested on separate datasets and separate tasks, and compared to various state-of-the-art techniques, and the proposed technique has consistently outperformed other techniques on these various tasks. Finally, an ablation study has been performed in order to demonstrate the benefits of the different choices of the model architecture. | SP:cb4dc0f2d6d5bab2401e755e388700984cd1f6a2 |
T-WaveNet: A Tree-Structured Wavelet Neural Network for Time Series Signal Analysis | 1 INTRODUCTION . Time-varying signal analysis plays a crucial role in various applications . For example , smartwatches utilize inertial signals for human activity logging ( Khan et al. , 2019 ) ; brain-computer interfaces employ electroencephalography ( EEG ) signals to identify user intentions ( Zhang et al. , 2020 ; Autthasan et al. , 2021 ) ; clinical diagnosis systems use surface electromyography signals ( sEMG ) for neuromuscular pathological analysis ( Duan et al. , 2015 ) , and develop muscle-computer interfaces to control external devices ( Pancholi et al. , 2021 ) . The signals mentioned above are all typical time series data , i.e. , a set of observations collected and ordered chronologically , and expressing information at specific frequency ranges . Generally speaking , time series signal analysis consists of three steps : ( i ) data segmentation , wherein the continuous signals are partitioned into segments using fixed- or variable-sized windows ; ( ii ) feature extraction , wherein various techniques are applied on each segment to extract distinguishing features ; and ( iii ) downstream tasks , which generate the desired outputs for certain tasks ( e.g. , classification and anomaly detection ) with the extracted features . Among the three steps , feature extraction is usually the most critical one . Traditional feature extraction approaches for time series signals can be broadly categorized as statistical and structural methods ( Lara et al. , 2012 ) . The former utilizes statistical measurements in time- or frequencydomain to figure out discriminative features , where exemplar time-domain measurements are mean and variance ( Kao et al. , 2009 ; Vepakomma et al. , 2015 ) , and typical frequency-domain measurements include short-time Fourier transform ( STFT ) and discrete Wavelet transform ( DWT ) ( Jiang & Yin , 2015 ; Duan et al. , 2015 ) ) . On the other hand , structural methods aim at describing the morphological interrelationship among the data via polynomial and/or exponential analysis ( Olszewski , 2001 ) . While the above hand-crafted features are efficient for some simple signal analysis tasks , their limited representation capability makes them incapable of dealing with complicated signals contaminated by noise or artifacts , and hence less competitive in real-world tasks ( Chen et al. , 2021 ) . Recently , deep neural networks ( DNNs ) have become the mainstream approaches for feature extraction in time series signal analysis . Various DNN models , including CNN-based solutions ( Xi et al. , 2018 ; Lawhern et al. , 2018 ; Lin et al. , 2020 ; Amin et al. , 2019 ) , CNN-LSTM combined models ( Wang et al. , 2020 ; Xu et al. , 2019 ; Yuki et al. , 2018 ) , and Transformer-based techniques ( Song et al. , 2021 ; Li et al. , 2021 ) , are proposed in the literature , achieving promising performance in many tasks . Despite of the remarkable success of these deep models , most of them place heavy demands on a large amount of labeled data . However , in many real-world applications , it is difficult and/or expensive to acquire sufficient labeled data to train these models . In addition , noise and artifacts that commonly exist in the time series signals make it even harder to obtain discriminative and robust representations . To the end , it may not fully reveal the superiority of deep models when solely relying on the network to directly extract information from raw signals . To solve this problem , some works attempt to use prior knowledge or hand-crafted features to guide the training of the deep learning models , aiming at extracting more effective features with a limited amount of training data ( Ito et al. , 2018 ; Wei et al. , 2019 ; Laput & Harrison , 2019 ) . However , these methods either simply leverage prior knowledge as gates to select features or intuitively add some statistical measurements as regularization terms to the losses , which fail to bring significant improvement . Moreover , designing tailored feature sets for different kinds of signals is tedious and time-consuming , which severely limits the generalization capability of such methods . In this regard , a promising way to acquire more discriminative features is to explore approaches to deeply integrating the inherent properties of the signals into the training process of the deep learning models . An inherent property termed as the dominant frequency range has been evidenced in many time series signals , which is a small subset of the frequency components that carries the primary information of the signal ( Telgarsky , 2013 ) . For instance , more than 95 % of human body motion energy exists in the frequency components below 15 Hz ( Karantonis et al. , 2006 ) ; the informative frequency ranges in brain signals ( EEG ) have been discovered and named as δ ( 0.1-3 Hz ) , θ ( 4-7 Hz ) , α ( 8–13Hz ) , β ( 14-30 Hz ) and γ ( 31-100Hz ) ( CR & MP , 2011 ) . However , most existing deep learning models are unaware of this essential property , and do not fully consider the different roles of various frequency components , leading to sub-optimal solutions . Motivated by the above , we propose a novel tree-structured wavelet neural network , namely T-WaveNet , to extract more effective features from time-series signals by seamlessly and effectively integrating this property into a deep model . Different from previous models , the proposed T-WaveNet adaptively represents the dominant energy range of the input signal with more discriminative features , which can be naturally and easily generalized and applied to different kinds of time series signals . The main contributions of this work are threefold : • We perform frequency spectrum energy analysis for signal decomposition in T-WaveNet , wherein the frequency ranges with more energies are divided into finer-grained subbands and are thus represented with more dimensions compared with other low-energy frequency ranges in the feature vector , which facilitates effective learning of informative and discriminative features with a limited number of potentially noisy training samples . • To extract the features effectively , we propose a novel invertible neural network ( INN ) based wavelet transform as the tree node in the T-WaveNet . Compared to fixed-basis wavelet Haar or lifting scheme-based wavelet , INN-based wavelet provides better representation capacity owing to its entirely data-driven characteristic . To the best of our knowledge , this is the first attempt to model wavelet transform using INN . • Finally , inspired by the self-attention mechanism in Transformer , we propose an instrumental feature fusion module which considers the feature dependencies across different frequency components , thus effectively enhances the robustness of the model by mitigating the impact of the heterogeneity exists in sensor signals recorded from different subjects . Extensive experiments on four popular sensor signal datasets , namely UCI-HAR for activity recognition , OPPORTUNITY for gesture recognition , BCICIV2a for intention recognition , and NinaPro DB1 for muscular movement recognition , show that our T-WaveNet consistently outperforms state-ofthe-art solutions . 2 RELATED WORK . In this section , we review related work on feature extractions for time series analysis and wavelet transform modeling using deep learning techniques . 2.1 FEATURE EXTRACTION FOR SIGNAL ANALYSIS . Existing feature extraction methods for time-varying signal analysis can be broadly classified into hand-crafted and deep learning-based methods , and the former can be further divided into statistical and structural approaches . Hand-crafted statistical and structural approaches are widely used in early studies . For instance , Kao et al . ( 2009 ) applies statistical features such as the mean and the mean absolute deviation ( MAD ) for online activity detection from a portable device . Duan et al . ( 2015 ) performs discrete wavelet transform on surface-Electromyography ( sEMG ) signal for hand motion classification . While relatively easy to calculate , these hand-crafted features are not effective for complicated tasks . In recent years , DNNs have become the mainstream approaches for signal feature extraction . CNNbased models are widely used to extract local temporal correlations of time series data . For example , Lee et al . ( 2017 ) combines multiple CNN layers with different kernel sizes to obtain the temporal dependencies at various time scales . Lawhern et al . ( 2018 ) , Lin et al . ( 2020 ) , and Amin et al . ( 2019 ) utilize CNNs in BCI applications to establish end-to-end EEG decoding models and achieve promising performance . As CNN-based models are often insufficient for extracting long-term temporal features , Ordóñez & Roggen ( 2016 ) , Yuki et al . ( 2018 ) , and Chambers & Yoder ( 2020 ) propose to combine CNNs with LSTMs to extract both short- and long-term temporal features . Xu et al . ( 2019 ) bring out the Inception CNN structures to extract local temporal features at various time scales and utilize gated recurrent units ( GRUs ) to obtain global temporal representations . Recently , Transformer-based methods utilize the self-attention mechanism to model the global temporal dependencies and shows superior performance in various tasks . For example , Song et al . ( 2021 ) construct a simple yet effective Transformer-based model to obtain discriminative representations for EEG signal classification . Li et al . ( 2021 ) design a two-stream convolution-augmented transformer to extract features for human activity recognition , which considers both time-over-channel and channel-over-time dependencies . The above deep learning based solutions try to extract features directly from the raw signal , which ignore the unique characteristics of each type of signals ( e.g. , the frequency spectrum information ) and usually become less effective when training on scarce signal data . Notably , some works try to alleviate this issue by guiding the DNNs with the traditional time-frequency features such that more effective deep representations can be learned . For instance , Ito et al . ( 2018 ) feed the spectrogram images constructed from the temporal features of the inertial signals into CNN models to learn inter-modality features . Laput & Harrison ( 2019 ) train a CNN on the time-frequency-spectral features of the input sensor signal to obtain a fine-grained hand activity sensing system . Furthermore , S et al . ( 2019 ) integrates the Short-Time Fourier Transform into the DNNs to directly learn frequency-domain features . However , the above solutions often need to design tailored features for different kinds of signals , which is tedious and time-consuming , and severely limits the application scenarios . 2.2 WAVELET TRANSFORM MODELING . Frequency-domain feature extraction methods such as Fourier or Wavelet transform are more preferable to time-domain ones , since it is usually easier to extract discriminative features in the frequency domain than directly from the raw input signal . Compared with Fourier transform , which decomposes a signal into fixed frequency components , Wavelet transform is shown to have excellent properties for transient signal analysis , thanks to its capability to analyze signals at different frequencies with various time resolutions . In this section , we focus on Wavelet transform . Recently , integrating wavelet transform with deep learning techniques is shown to be effective in signal and image processing . Early attempts directly replace certain layers in the DNNs with traditional wavelet transform to reduce the number of parameters as well as improve the interpretability . For instance , Williams & Li ( 2018 ) replace the max-pooling layer with a wavelet pooling algorithm to address the overfitting problem . Fujieda et al . ( 2017 ) propose to replace the pooling and convolution layers with wavelet transform . The above methods typically utilize a fixed wavelet basis ( such as Haar ( Haar , 1910 ) ) , which tend to be sub-optimal as it is less flexible and expressive for complex data . Recently , Rodriguez et al . ( 2020 ) propose to replace the fixed wavelet basis in the lifting scheme with deep learnable modules to realize an adaptive wavelet transform unit for image classification , aiming at learning more discriminative frequency features from images . In this work , to better handle the complex spatial-temporal time series data , we build a novel deep wavelet transform unit with powerful representation capability , named frequency bisection operator . It decomposes the input signal into frequency subbands of various sizes and models the wavelet basis with an INN ( Dinh et al. , 2014 ) . To the best of our knowledge , this is the first attempt to model the wavelet transform using INN . We detail the proposed solution in Section 3.2 . | The authors introduce a deep learning approach to classify time series. In particular, a wavelet-based algorithm is carried out using invertible neural networks and a formant-based strategy. Besides, self-attention mechanisms are utilized to code short and long time-series correlations. Finally, different databases are tested, showing an interesting performance for non-stationary pattern coding. | SP:cb4dc0f2d6d5bab2401e755e388700984cd1f6a2 |
T-WaveNet: A Tree-Structured Wavelet Neural Network for Time Series Signal Analysis | 1 INTRODUCTION . Time-varying signal analysis plays a crucial role in various applications . For example , smartwatches utilize inertial signals for human activity logging ( Khan et al. , 2019 ) ; brain-computer interfaces employ electroencephalography ( EEG ) signals to identify user intentions ( Zhang et al. , 2020 ; Autthasan et al. , 2021 ) ; clinical diagnosis systems use surface electromyography signals ( sEMG ) for neuromuscular pathological analysis ( Duan et al. , 2015 ) , and develop muscle-computer interfaces to control external devices ( Pancholi et al. , 2021 ) . The signals mentioned above are all typical time series data , i.e. , a set of observations collected and ordered chronologically , and expressing information at specific frequency ranges . Generally speaking , time series signal analysis consists of three steps : ( i ) data segmentation , wherein the continuous signals are partitioned into segments using fixed- or variable-sized windows ; ( ii ) feature extraction , wherein various techniques are applied on each segment to extract distinguishing features ; and ( iii ) downstream tasks , which generate the desired outputs for certain tasks ( e.g. , classification and anomaly detection ) with the extracted features . Among the three steps , feature extraction is usually the most critical one . Traditional feature extraction approaches for time series signals can be broadly categorized as statistical and structural methods ( Lara et al. , 2012 ) . The former utilizes statistical measurements in time- or frequencydomain to figure out discriminative features , where exemplar time-domain measurements are mean and variance ( Kao et al. , 2009 ; Vepakomma et al. , 2015 ) , and typical frequency-domain measurements include short-time Fourier transform ( STFT ) and discrete Wavelet transform ( DWT ) ( Jiang & Yin , 2015 ; Duan et al. , 2015 ) ) . On the other hand , structural methods aim at describing the morphological interrelationship among the data via polynomial and/or exponential analysis ( Olszewski , 2001 ) . While the above hand-crafted features are efficient for some simple signal analysis tasks , their limited representation capability makes them incapable of dealing with complicated signals contaminated by noise or artifacts , and hence less competitive in real-world tasks ( Chen et al. , 2021 ) . Recently , deep neural networks ( DNNs ) have become the mainstream approaches for feature extraction in time series signal analysis . Various DNN models , including CNN-based solutions ( Xi et al. , 2018 ; Lawhern et al. , 2018 ; Lin et al. , 2020 ; Amin et al. , 2019 ) , CNN-LSTM combined models ( Wang et al. , 2020 ; Xu et al. , 2019 ; Yuki et al. , 2018 ) , and Transformer-based techniques ( Song et al. , 2021 ; Li et al. , 2021 ) , are proposed in the literature , achieving promising performance in many tasks . Despite of the remarkable success of these deep models , most of them place heavy demands on a large amount of labeled data . However , in many real-world applications , it is difficult and/or expensive to acquire sufficient labeled data to train these models . In addition , noise and artifacts that commonly exist in the time series signals make it even harder to obtain discriminative and robust representations . To the end , it may not fully reveal the superiority of deep models when solely relying on the network to directly extract information from raw signals . To solve this problem , some works attempt to use prior knowledge or hand-crafted features to guide the training of the deep learning models , aiming at extracting more effective features with a limited amount of training data ( Ito et al. , 2018 ; Wei et al. , 2019 ; Laput & Harrison , 2019 ) . However , these methods either simply leverage prior knowledge as gates to select features or intuitively add some statistical measurements as regularization terms to the losses , which fail to bring significant improvement . Moreover , designing tailored feature sets for different kinds of signals is tedious and time-consuming , which severely limits the generalization capability of such methods . In this regard , a promising way to acquire more discriminative features is to explore approaches to deeply integrating the inherent properties of the signals into the training process of the deep learning models . An inherent property termed as the dominant frequency range has been evidenced in many time series signals , which is a small subset of the frequency components that carries the primary information of the signal ( Telgarsky , 2013 ) . For instance , more than 95 % of human body motion energy exists in the frequency components below 15 Hz ( Karantonis et al. , 2006 ) ; the informative frequency ranges in brain signals ( EEG ) have been discovered and named as δ ( 0.1-3 Hz ) , θ ( 4-7 Hz ) , α ( 8–13Hz ) , β ( 14-30 Hz ) and γ ( 31-100Hz ) ( CR & MP , 2011 ) . However , most existing deep learning models are unaware of this essential property , and do not fully consider the different roles of various frequency components , leading to sub-optimal solutions . Motivated by the above , we propose a novel tree-structured wavelet neural network , namely T-WaveNet , to extract more effective features from time-series signals by seamlessly and effectively integrating this property into a deep model . Different from previous models , the proposed T-WaveNet adaptively represents the dominant energy range of the input signal with more discriminative features , which can be naturally and easily generalized and applied to different kinds of time series signals . The main contributions of this work are threefold : • We perform frequency spectrum energy analysis for signal decomposition in T-WaveNet , wherein the frequency ranges with more energies are divided into finer-grained subbands and are thus represented with more dimensions compared with other low-energy frequency ranges in the feature vector , which facilitates effective learning of informative and discriminative features with a limited number of potentially noisy training samples . • To extract the features effectively , we propose a novel invertible neural network ( INN ) based wavelet transform as the tree node in the T-WaveNet . Compared to fixed-basis wavelet Haar or lifting scheme-based wavelet , INN-based wavelet provides better representation capacity owing to its entirely data-driven characteristic . To the best of our knowledge , this is the first attempt to model wavelet transform using INN . • Finally , inspired by the self-attention mechanism in Transformer , we propose an instrumental feature fusion module which considers the feature dependencies across different frequency components , thus effectively enhances the robustness of the model by mitigating the impact of the heterogeneity exists in sensor signals recorded from different subjects . Extensive experiments on four popular sensor signal datasets , namely UCI-HAR for activity recognition , OPPORTUNITY for gesture recognition , BCICIV2a for intention recognition , and NinaPro DB1 for muscular movement recognition , show that our T-WaveNet consistently outperforms state-ofthe-art solutions . 2 RELATED WORK . In this section , we review related work on feature extractions for time series analysis and wavelet transform modeling using deep learning techniques . 2.1 FEATURE EXTRACTION FOR SIGNAL ANALYSIS . Existing feature extraction methods for time-varying signal analysis can be broadly classified into hand-crafted and deep learning-based methods , and the former can be further divided into statistical and structural approaches . Hand-crafted statistical and structural approaches are widely used in early studies . For instance , Kao et al . ( 2009 ) applies statistical features such as the mean and the mean absolute deviation ( MAD ) for online activity detection from a portable device . Duan et al . ( 2015 ) performs discrete wavelet transform on surface-Electromyography ( sEMG ) signal for hand motion classification . While relatively easy to calculate , these hand-crafted features are not effective for complicated tasks . In recent years , DNNs have become the mainstream approaches for signal feature extraction . CNNbased models are widely used to extract local temporal correlations of time series data . For example , Lee et al . ( 2017 ) combines multiple CNN layers with different kernel sizes to obtain the temporal dependencies at various time scales . Lawhern et al . ( 2018 ) , Lin et al . ( 2020 ) , and Amin et al . ( 2019 ) utilize CNNs in BCI applications to establish end-to-end EEG decoding models and achieve promising performance . As CNN-based models are often insufficient for extracting long-term temporal features , Ordóñez & Roggen ( 2016 ) , Yuki et al . ( 2018 ) , and Chambers & Yoder ( 2020 ) propose to combine CNNs with LSTMs to extract both short- and long-term temporal features . Xu et al . ( 2019 ) bring out the Inception CNN structures to extract local temporal features at various time scales and utilize gated recurrent units ( GRUs ) to obtain global temporal representations . Recently , Transformer-based methods utilize the self-attention mechanism to model the global temporal dependencies and shows superior performance in various tasks . For example , Song et al . ( 2021 ) construct a simple yet effective Transformer-based model to obtain discriminative representations for EEG signal classification . Li et al . ( 2021 ) design a two-stream convolution-augmented transformer to extract features for human activity recognition , which considers both time-over-channel and channel-over-time dependencies . The above deep learning based solutions try to extract features directly from the raw signal , which ignore the unique characteristics of each type of signals ( e.g. , the frequency spectrum information ) and usually become less effective when training on scarce signal data . Notably , some works try to alleviate this issue by guiding the DNNs with the traditional time-frequency features such that more effective deep representations can be learned . For instance , Ito et al . ( 2018 ) feed the spectrogram images constructed from the temporal features of the inertial signals into CNN models to learn inter-modality features . Laput & Harrison ( 2019 ) train a CNN on the time-frequency-spectral features of the input sensor signal to obtain a fine-grained hand activity sensing system . Furthermore , S et al . ( 2019 ) integrates the Short-Time Fourier Transform into the DNNs to directly learn frequency-domain features . However , the above solutions often need to design tailored features for different kinds of signals , which is tedious and time-consuming , and severely limits the application scenarios . 2.2 WAVELET TRANSFORM MODELING . Frequency-domain feature extraction methods such as Fourier or Wavelet transform are more preferable to time-domain ones , since it is usually easier to extract discriminative features in the frequency domain than directly from the raw input signal . Compared with Fourier transform , which decomposes a signal into fixed frequency components , Wavelet transform is shown to have excellent properties for transient signal analysis , thanks to its capability to analyze signals at different frequencies with various time resolutions . In this section , we focus on Wavelet transform . Recently , integrating wavelet transform with deep learning techniques is shown to be effective in signal and image processing . Early attempts directly replace certain layers in the DNNs with traditional wavelet transform to reduce the number of parameters as well as improve the interpretability . For instance , Williams & Li ( 2018 ) replace the max-pooling layer with a wavelet pooling algorithm to address the overfitting problem . Fujieda et al . ( 2017 ) propose to replace the pooling and convolution layers with wavelet transform . The above methods typically utilize a fixed wavelet basis ( such as Haar ( Haar , 1910 ) ) , which tend to be sub-optimal as it is less flexible and expressive for complex data . Recently , Rodriguez et al . ( 2020 ) propose to replace the fixed wavelet basis in the lifting scheme with deep learnable modules to realize an adaptive wavelet transform unit for image classification , aiming at learning more discriminative frequency features from images . In this work , to better handle the complex spatial-temporal time series data , we build a novel deep wavelet transform unit with powerful representation capability , named frequency bisection operator . It decomposes the input signal into frequency subbands of various sizes and models the wavelet basis with an INN ( Dinh et al. , 2014 ) . To the best of our knowledge , this is the first attempt to model the wavelet transform using INN . We detail the proposed solution in Section 3.2 . | The authors proposed T-WaveNet, a novel tree-structured wavelet neural network for time series signal analysis. It utilizes the dominant frequency range to extract informative representation from raw signals. The tree-structure network consists of invertible neural networks as a frequency bisection operator, and of a feature fusion module. T-WaveNet was tested against various other methods using 4 different datasets and showed better results consistently. | SP:cb4dc0f2d6d5bab2401e755e388700984cd1f6a2 |
Exploring and Evaluating Personalized Models for Code Generation | 1 INTRODUCTION . It is well-known that even the best models can fail to generalize properly to new domains , and even to new users of said models . For example , a model trained to answer questions in general may not answer StackOverflow questions as well as the questions in the training domain , or a software developer in an Enterprise environment with private code may have libraries and attribute name which differ from public source code used to train a code synthesis model . The current dominant paradigm in Natural Language Processing ( NLP ) modeling is to pre-train a large transformer model ( Vaswani et al. , 2017a ) on a large corpus and then fine-tune it on a particular task of interest . For example , a question-answering ( Q & A ) model is generally first pre-trained on a large corpus of textual data for the specific language ( e.g. , Wikipedia , and news articles in English ) , then fine-tuned on a task-specific dataset of paired questions and corresponding answers . The pre-training process aims at learning semantic vector representation of the language and words , while the fine-tuning process specializes the model for a specific domain . Transformer models are also increasingly the baseline architecture used for code generation tasks , such as writing methods from natural language description ( Clement et al. , 2020 ; Austin et al. , 2021 ; Chen et al. , 2021 ) , or generating test cases from the focal method under test ( Tufano et al. , 2021 ) . Similarly for NLP tasks these models are pre-trained on a large corpus of natural text and publicly available source code and then fine-tuned on a specific code-related task . Further , these models also may not generalize to new domains of interest , and can benefit from task or even user-specific fine-tuning , here called customization or personalization . Customization is particularly relevant for code generation models since it provides several benefits : • allows fine-tuning on source code data that may not be available when training a base model ( e.g. , private repositories or internal codebases ) , enabling improved overall performances on codebases with proprietary dependencies and code styles ; • the opportunity to improve data privacy by considering private or sensitive data only during the customization process on the client side ; • the opportunity to reduce deployment cost as customized models can offer better user performance without increasing model size . Custom models can provide clear benefits to users and model providers . We envision serving tens or hundreds of thousands of custom models , but doing so presents several logistical hurdles , including the costs of training , storing , and loading these models into GPU memory for inference . Worse , memory costs will only be exacerbated when working with ever larger and more powerful models . For these reasons , we investigate several customization approaches , some of which can dramatically reduce the memory footprint and amortized computational cost introduced by custom models . Specifically , we consider three fine-tuning approaches : ( i ) custom fine-tuning , which allows all the model parameters to be tuned ; ( ii ) lightweight fine-tuning , which only optimizes the token embedding representations or the final softmax layer ; ( iii ) prefix tuning , which keeps language model parameters frozen , but optimizes a small project-specific vector prefix . In our extensive empirical evaluation we found that all the customization strategies lead to significant model improvements on a target project in terms of both intrinsic and task-specific metrics . While there is no unambiguous winner among the customization strategies , each approach can provide specific benefits in particular deployment scenarios . This paper provides insights on these customization strategies , their benefits and drawbacks , as well as providing guidelines and suggestions on which one to use based on the training cost , memory and storage , number of users , and deployment scenarios . 2 APPROACH . This section describes the proposed customization approach for code generation models . We begin by formally defining the customization process , then we provide details for each of the fine-tuning strategies . 2.1 CUSTOMIZATION PROCESS . We use the term customization to refer to the process of fine-tuning a model m , previously trained on a generic dataset for a task t , with the goal of improving its performance on a specific dataset p. The performance of a machine learning model m on a dataset p is measured by one or more evaluation functions f ( m , p ) , where f can be either a maximization ( e.g. , BLEU , top-k accuracy ) or minimization ( e.g. , perplexity ) function . The customization process is designed to modify the trainable parameters of the model m , obtaining the model m′ , such that the performance of m′ on p is better than what was attained by m. Specifically , f ( m′ , p ) > f ( m , p ) for maximization functions , or f ( m′ , p ) < f ( m , p ) for minimization functions . In this work , m is an encoder-decoder transformer model , t is a code generation task , and p is a target software project to which we intend to customize m . 2.2 CUSTOM FINE-TUNING . Custom fine-tuning is the most straightforward customization approach . The model to be customized is taken as is and trained on a selected project . All parameters are trainable during this process . Figure 1a shows the model during fine-tuning , where all the parameters from the encoder and decoder blocks , as well as embeddings and output layers can be modified . 2.3 LIGHTWEIGHT FINE-TUNING - EMBEDDINGS AND OUTPUT LAYER ( L-EO ) . Fully fine-tuning a model for every project or user may be prohibitive in terms of storage and memory costs . As a result , we explore ways to mitigate these costs by reducing the number of parameters that vary from one custom model to another . In our lightweight fine-tuning experiments , we achieve this by freezing most parameters in the baseline model , and only keeping a small subset trainable . Figure 1b shows the Lightweight fine-tuning - Embeddings and Output Layer ( L-EO ) design , where most of the model parameters are frozen ( displayed in gray ) , and we allow only the embedding and output layers parameters to be fine-tuned , following the approach in Lu et al . ( 2021 ) . 2.4 LIGHTWEIGHT FINE-TUNING - LAST DECODER BLOCK ( L-LDB ) . In this lightweight fine-tuning strategy , shown in Figure 1c ( L-LDB ) , most of the model ’ s parameters are kept frozen , while only the parameters in the last decoder block are trainable , this includes : self-attention , encoder-decoder attention , layernorm and feedforward layers . This design decision of training only the last decoder block is motivated by experimental results analyzing the model ’ s parameter changes during custom fine-tuning . Figure 2 reports the average absolute changes , during fine-tuning , in the parameters belonging to different Encoder and Decoder blocks for a BART model . We observe that , as we go through the transformer model , the average change in parameter values tends to increase , with the last decoder block showing the highest changes in parameter values . As a result , we hypothesize that it could be sufficient to tune the last decoder block and obtain performance improvements similar to the fully custom fine-tuned model . 2.5 PREFIX TUNING . Prefix tuning was first introduced by Li and Liang ( 2021 ) , with the goal of fine-tuning a general model for different tasks . The technique concatenates a sequence ( prefix ) of virtual tokens ( trainable parameters ) to the front of the input of every encoder and decoder block . In our context , the intuition behind this approach is that the prefix embeds the properties of a specific project , which allows the model to generate customized responses for that repository . Practically , we set the prefix length to 200 tokens , and thus with an embedding size of 1024 , this gives a total of 1024× 200× 24× 2 ≈ 10M trainable parameters . The prefix is initialized to the most frequent words in the repository for which the model is customized . 2.6 TRAINABLE PARAMETERS DURING FINE-TUNING . Table 1 provides an overview of the number of total and trainable parameters involved in each customization process , in the case of a BART Transformer model with 406M parameters . Custom fine-tuning allows to train 100 % of the 406M available parameters in the model . During L-EO finetuining , instead , only 13 % ( 53M ) parameters are trained . The L-LDB fientuning reduces the number of trainable parameters to 4.2 % ( 17M ) . Finally , Prefix tuning has the lowest number of trainable parameters , only 2.4 % ( 10M ) of the total , but these are additional parameters added to the model , which reaches a total of 416M . 3 EXPERIMENTAL DESIGN . The goal of our experimental design is to investigate whether custom models outperform the baseline model , leading to performance improvements in terms of intrinsic metrics ( RQ1 ) , as well as extrinsic task-specific metrics ( RQ2 ) . Next , we analyze and compare the different customization approaches in terms of training and compute costs ( RQ3 ) as well as model size and required storage for deployment . In our case study , we chose Unit Test Case generation as our code generation task t , and AthenaTest by Tufano et al . ( 2021 ) as our baseline model m , which is a BART transformer model pre-trained on source code and English , and fine-tuned on Java unit test generation . The task is modeled as a translation task , where the input is a focal method ( i.e. , method under test ) , and the output is a test case which tests the focal method ’ s correctness . We randomly sample 20 projects from the test set , each of those representing the dataset p on which a custom model is fine-tuned . Specifically , for each project p , we start from the baseline model m and fine-tune four different custom models according to the four proposed fine-tuning strategies . For each project and fine-tuning strategy ( e.g. , L-EO ) , we fine-tune and evaluate the models using 4-fold cross-validation . The models are trained until the best validation loss is reached , independently for every fold , every repository , and every customization approach . In total , we fine-tune and evaluate 20 ( projects ) × 4 ( approaches ) × 4 ( folds ) = 320 models . 3.1 DATASET . Table 2 reports information about the 20 GitHub repositories sampled from the test set , which will be used to customize our models . The table shows ( i ) the Project ID , which will be used in the paper to reference a specific project ; ( ii ) the project name ; ( iii ) the project size in terms of disk usage ; ( iv ) the popularity of the project in terms of number of stars obtained on GitHub ; ( v ) and the dataset size , which corresponds to the number of data points for the unit test generation task ( i.e. , pair of focal method and test case ) . The list of projects represent a diverse set of repositories with different size , domain , and popularity . They span from small personal projects ( e.g. , Tutorials with 6 stars ) , to open source projects developed by large organizations such as Apache and Google . 3.2 RQ1 : INTRINSIC EVALUATION METRICS RQ1 : Do custom models obtain better performances on intrinsic metrics , such as BLEU and perplexity , w.r.t . the baseline ? To begin , we investigate how the different model customization approaches described in Sec . 2 score on intrinsic metrics such as BLEU and perplexity . All approaches entail fine-tuning the baseline model to the dataset of a specific project , with the choice of parameters being tuned depending on the approach taken . The four variants are trained independently until the best validation loss is achieved . We report the BLEU4 score and the mean perplexity per token on the test fold , for all the 20 projects . Next , we perform statistical tests to investigate whether the observed differences between the baseline and custom models are significant , as well as differences among the customization approaches . Specifically , we rely on the Kruskal-Wallis test , a non-parametric statistical test . 3.3 RQ2 : TASK-SPECIFIC PERFORMANCES RQ2 : Do custom models improve on performance metrics specific to unit test generation ? We want to investigate how the different customization approaches compare with respect to the downstream task of generating unit tests . Beyond BLEU score and perplexity , we would like to see if custom models can produce the correct target code , how closely their unit tests mimic the repository style , or even if they can perfectly match the desired output . • Perfect Matches : We compare the model ’ s output string with the target developer-written unit test . If the two strings are identical , this is considered a perfect match . We do not take spacing and indentation into account as we are using a Java dataset ( where indentation is not required ) . We report the proportion of perfect matches among the top 5 model predictions . • Abstracted Code Matches : We pass the model output and target output through the src2abs tool ( Tufano , 2018 ) , to obtain an abstracted version , masking variable names , method names , etc . We also do not distinguish between different objects of the same type . • Coding Style : For each project ’ s custom model , we would like to determine how closely the model learns the developer ’ s personal programming style and preferences . To this end , we extract the collection of all identifiers ( i.e. , variables and functions ’ names ) from the unit tests written by the developer as well as those generated by the models . We then pass these text outputs through a tf-idf vectorizer and compute the cosine similarity between them . This allows us to compare the developer ’ s and the models ’ word usage . We examine the similarity between the developer ’ s unit tests and the baseline and custom models generated tests . This scores the vocabulary similarity of the unit tests with the model generated code . 3.4 RQ3 : TRAINING COST COMPARISON RQ3 : Given the same amount of compute , which custom models achieve the biggest performance improvement ? Since our four training regimes tune a different number of parameters , simply comparing the training time or number of optimization steps to reach the best validation loss may not be appropriate . For a model with N parameters , we approximate the computation cost of a forward pass to be C ≈ 2N floating point operations per training token , with an additional correction for embedding layers . The backward pass takes roughly twice the amount of compute , but it is unnecessary for layers that are frozen . For additional details , we refer to Table 1 in Kaplan et al . ( 2020 ) . We report the resulting compute in petaFLOPS-seconds . | - This work studies customizing models for code towards specific projects/coding standards/preferences for unit test case generation task. It specifically studies this in the context of server-side customization, where one entity would need to maintain multiple customized models, as opposed to client-side customization where each client can store its own customized model. - It is an empirical study of how 4 customization strategies -- a) modify entire model weighs, b,c) modify a chosen subset of model weights, and d) prefix tuning -- affects the performance of the fine-tuned model on the test case generation task. - This work finds no substantial difference in the final fine-tuned performance of any of the customization strategies, but argues that each strategy has its advantages and disadvantages, therefore allowing the user/implementor of this approach to make a more informed choice. | SP:c3f174e428d7f56c217341445d1261e1c60d6108 |
Exploring and Evaluating Personalized Models for Code Generation | 1 INTRODUCTION . It is well-known that even the best models can fail to generalize properly to new domains , and even to new users of said models . For example , a model trained to answer questions in general may not answer StackOverflow questions as well as the questions in the training domain , or a software developer in an Enterprise environment with private code may have libraries and attribute name which differ from public source code used to train a code synthesis model . The current dominant paradigm in Natural Language Processing ( NLP ) modeling is to pre-train a large transformer model ( Vaswani et al. , 2017a ) on a large corpus and then fine-tune it on a particular task of interest . For example , a question-answering ( Q & A ) model is generally first pre-trained on a large corpus of textual data for the specific language ( e.g. , Wikipedia , and news articles in English ) , then fine-tuned on a task-specific dataset of paired questions and corresponding answers . The pre-training process aims at learning semantic vector representation of the language and words , while the fine-tuning process specializes the model for a specific domain . Transformer models are also increasingly the baseline architecture used for code generation tasks , such as writing methods from natural language description ( Clement et al. , 2020 ; Austin et al. , 2021 ; Chen et al. , 2021 ) , or generating test cases from the focal method under test ( Tufano et al. , 2021 ) . Similarly for NLP tasks these models are pre-trained on a large corpus of natural text and publicly available source code and then fine-tuned on a specific code-related task . Further , these models also may not generalize to new domains of interest , and can benefit from task or even user-specific fine-tuning , here called customization or personalization . Customization is particularly relevant for code generation models since it provides several benefits : • allows fine-tuning on source code data that may not be available when training a base model ( e.g. , private repositories or internal codebases ) , enabling improved overall performances on codebases with proprietary dependencies and code styles ; • the opportunity to improve data privacy by considering private or sensitive data only during the customization process on the client side ; • the opportunity to reduce deployment cost as customized models can offer better user performance without increasing model size . Custom models can provide clear benefits to users and model providers . We envision serving tens or hundreds of thousands of custom models , but doing so presents several logistical hurdles , including the costs of training , storing , and loading these models into GPU memory for inference . Worse , memory costs will only be exacerbated when working with ever larger and more powerful models . For these reasons , we investigate several customization approaches , some of which can dramatically reduce the memory footprint and amortized computational cost introduced by custom models . Specifically , we consider three fine-tuning approaches : ( i ) custom fine-tuning , which allows all the model parameters to be tuned ; ( ii ) lightweight fine-tuning , which only optimizes the token embedding representations or the final softmax layer ; ( iii ) prefix tuning , which keeps language model parameters frozen , but optimizes a small project-specific vector prefix . In our extensive empirical evaluation we found that all the customization strategies lead to significant model improvements on a target project in terms of both intrinsic and task-specific metrics . While there is no unambiguous winner among the customization strategies , each approach can provide specific benefits in particular deployment scenarios . This paper provides insights on these customization strategies , their benefits and drawbacks , as well as providing guidelines and suggestions on which one to use based on the training cost , memory and storage , number of users , and deployment scenarios . 2 APPROACH . This section describes the proposed customization approach for code generation models . We begin by formally defining the customization process , then we provide details for each of the fine-tuning strategies . 2.1 CUSTOMIZATION PROCESS . We use the term customization to refer to the process of fine-tuning a model m , previously trained on a generic dataset for a task t , with the goal of improving its performance on a specific dataset p. The performance of a machine learning model m on a dataset p is measured by one or more evaluation functions f ( m , p ) , where f can be either a maximization ( e.g. , BLEU , top-k accuracy ) or minimization ( e.g. , perplexity ) function . The customization process is designed to modify the trainable parameters of the model m , obtaining the model m′ , such that the performance of m′ on p is better than what was attained by m. Specifically , f ( m′ , p ) > f ( m , p ) for maximization functions , or f ( m′ , p ) < f ( m , p ) for minimization functions . In this work , m is an encoder-decoder transformer model , t is a code generation task , and p is a target software project to which we intend to customize m . 2.2 CUSTOM FINE-TUNING . Custom fine-tuning is the most straightforward customization approach . The model to be customized is taken as is and trained on a selected project . All parameters are trainable during this process . Figure 1a shows the model during fine-tuning , where all the parameters from the encoder and decoder blocks , as well as embeddings and output layers can be modified . 2.3 LIGHTWEIGHT FINE-TUNING - EMBEDDINGS AND OUTPUT LAYER ( L-EO ) . Fully fine-tuning a model for every project or user may be prohibitive in terms of storage and memory costs . As a result , we explore ways to mitigate these costs by reducing the number of parameters that vary from one custom model to another . In our lightweight fine-tuning experiments , we achieve this by freezing most parameters in the baseline model , and only keeping a small subset trainable . Figure 1b shows the Lightweight fine-tuning - Embeddings and Output Layer ( L-EO ) design , where most of the model parameters are frozen ( displayed in gray ) , and we allow only the embedding and output layers parameters to be fine-tuned , following the approach in Lu et al . ( 2021 ) . 2.4 LIGHTWEIGHT FINE-TUNING - LAST DECODER BLOCK ( L-LDB ) . In this lightweight fine-tuning strategy , shown in Figure 1c ( L-LDB ) , most of the model ’ s parameters are kept frozen , while only the parameters in the last decoder block are trainable , this includes : self-attention , encoder-decoder attention , layernorm and feedforward layers . This design decision of training only the last decoder block is motivated by experimental results analyzing the model ’ s parameter changes during custom fine-tuning . Figure 2 reports the average absolute changes , during fine-tuning , in the parameters belonging to different Encoder and Decoder blocks for a BART model . We observe that , as we go through the transformer model , the average change in parameter values tends to increase , with the last decoder block showing the highest changes in parameter values . As a result , we hypothesize that it could be sufficient to tune the last decoder block and obtain performance improvements similar to the fully custom fine-tuned model . 2.5 PREFIX TUNING . Prefix tuning was first introduced by Li and Liang ( 2021 ) , with the goal of fine-tuning a general model for different tasks . The technique concatenates a sequence ( prefix ) of virtual tokens ( trainable parameters ) to the front of the input of every encoder and decoder block . In our context , the intuition behind this approach is that the prefix embeds the properties of a specific project , which allows the model to generate customized responses for that repository . Practically , we set the prefix length to 200 tokens , and thus with an embedding size of 1024 , this gives a total of 1024× 200× 24× 2 ≈ 10M trainable parameters . The prefix is initialized to the most frequent words in the repository for which the model is customized . 2.6 TRAINABLE PARAMETERS DURING FINE-TUNING . Table 1 provides an overview of the number of total and trainable parameters involved in each customization process , in the case of a BART Transformer model with 406M parameters . Custom fine-tuning allows to train 100 % of the 406M available parameters in the model . During L-EO finetuining , instead , only 13 % ( 53M ) parameters are trained . The L-LDB fientuning reduces the number of trainable parameters to 4.2 % ( 17M ) . Finally , Prefix tuning has the lowest number of trainable parameters , only 2.4 % ( 10M ) of the total , but these are additional parameters added to the model , which reaches a total of 416M . 3 EXPERIMENTAL DESIGN . The goal of our experimental design is to investigate whether custom models outperform the baseline model , leading to performance improvements in terms of intrinsic metrics ( RQ1 ) , as well as extrinsic task-specific metrics ( RQ2 ) . Next , we analyze and compare the different customization approaches in terms of training and compute costs ( RQ3 ) as well as model size and required storage for deployment . In our case study , we chose Unit Test Case generation as our code generation task t , and AthenaTest by Tufano et al . ( 2021 ) as our baseline model m , which is a BART transformer model pre-trained on source code and English , and fine-tuned on Java unit test generation . The task is modeled as a translation task , where the input is a focal method ( i.e. , method under test ) , and the output is a test case which tests the focal method ’ s correctness . We randomly sample 20 projects from the test set , each of those representing the dataset p on which a custom model is fine-tuned . Specifically , for each project p , we start from the baseline model m and fine-tune four different custom models according to the four proposed fine-tuning strategies . For each project and fine-tuning strategy ( e.g. , L-EO ) , we fine-tune and evaluate the models using 4-fold cross-validation . The models are trained until the best validation loss is reached , independently for every fold , every repository , and every customization approach . In total , we fine-tune and evaluate 20 ( projects ) × 4 ( approaches ) × 4 ( folds ) = 320 models . 3.1 DATASET . Table 2 reports information about the 20 GitHub repositories sampled from the test set , which will be used to customize our models . The table shows ( i ) the Project ID , which will be used in the paper to reference a specific project ; ( ii ) the project name ; ( iii ) the project size in terms of disk usage ; ( iv ) the popularity of the project in terms of number of stars obtained on GitHub ; ( v ) and the dataset size , which corresponds to the number of data points for the unit test generation task ( i.e. , pair of focal method and test case ) . The list of projects represent a diverse set of repositories with different size , domain , and popularity . They span from small personal projects ( e.g. , Tutorials with 6 stars ) , to open source projects developed by large organizations such as Apache and Google . 3.2 RQ1 : INTRINSIC EVALUATION METRICS RQ1 : Do custom models obtain better performances on intrinsic metrics , such as BLEU and perplexity , w.r.t . the baseline ? To begin , we investigate how the different model customization approaches described in Sec . 2 score on intrinsic metrics such as BLEU and perplexity . All approaches entail fine-tuning the baseline model to the dataset of a specific project , with the choice of parameters being tuned depending on the approach taken . The four variants are trained independently until the best validation loss is achieved . We report the BLEU4 score and the mean perplexity per token on the test fold , for all the 20 projects . Next , we perform statistical tests to investigate whether the observed differences between the baseline and custom models are significant , as well as differences among the customization approaches . Specifically , we rely on the Kruskal-Wallis test , a non-parametric statistical test . 3.3 RQ2 : TASK-SPECIFIC PERFORMANCES RQ2 : Do custom models improve on performance metrics specific to unit test generation ? We want to investigate how the different customization approaches compare with respect to the downstream task of generating unit tests . Beyond BLEU score and perplexity , we would like to see if custom models can produce the correct target code , how closely their unit tests mimic the repository style , or even if they can perfectly match the desired output . • Perfect Matches : We compare the model ’ s output string with the target developer-written unit test . If the two strings are identical , this is considered a perfect match . We do not take spacing and indentation into account as we are using a Java dataset ( where indentation is not required ) . We report the proportion of perfect matches among the top 5 model predictions . • Abstracted Code Matches : We pass the model output and target output through the src2abs tool ( Tufano , 2018 ) , to obtain an abstracted version , masking variable names , method names , etc . We also do not distinguish between different objects of the same type . • Coding Style : For each project ’ s custom model , we would like to determine how closely the model learns the developer ’ s personal programming style and preferences . To this end , we extract the collection of all identifiers ( i.e. , variables and functions ’ names ) from the unit tests written by the developer as well as those generated by the models . We then pass these text outputs through a tf-idf vectorizer and compute the cosine similarity between them . This allows us to compare the developer ’ s and the models ’ word usage . We examine the similarity between the developer ’ s unit tests and the baseline and custom models generated tests . This scores the vocabulary similarity of the unit tests with the model generated code . 3.4 RQ3 : TRAINING COST COMPARISON RQ3 : Given the same amount of compute , which custom models achieve the biggest performance improvement ? Since our four training regimes tune a different number of parameters , simply comparing the training time or number of optimization steps to reach the best validation loss may not be appropriate . For a model with N parameters , we approximate the computation cost of a forward pass to be C ≈ 2N floating point operations per training token , with an additional correction for embedding layers . The backward pass takes roughly twice the amount of compute , but it is unnecessary for layers that are frozen . For additional details , we refer to Table 1 in Kaplan et al . ( 2020 ) . We report the resulting compute in petaFLOPS-seconds . | The paper proposes personalization of a baseline model to a project by fine-tuning it on the project-specific labeled examples. It demonstrates that personalization yields performance benefits over the baseline model. The baseline model (Tufano et al. 2021) is obtained from a pre-trained Java BART model after fine-tuning for the task of generating Java unit tests. The paper evaluates four fine-tuning strategies that select different subsets of weights to be fine-tuned. | SP:c3f174e428d7f56c217341445d1261e1c60d6108 |
Exploring and Evaluating Personalized Models for Code Generation | 1 INTRODUCTION . It is well-known that even the best models can fail to generalize properly to new domains , and even to new users of said models . For example , a model trained to answer questions in general may not answer StackOverflow questions as well as the questions in the training domain , or a software developer in an Enterprise environment with private code may have libraries and attribute name which differ from public source code used to train a code synthesis model . The current dominant paradigm in Natural Language Processing ( NLP ) modeling is to pre-train a large transformer model ( Vaswani et al. , 2017a ) on a large corpus and then fine-tune it on a particular task of interest . For example , a question-answering ( Q & A ) model is generally first pre-trained on a large corpus of textual data for the specific language ( e.g. , Wikipedia , and news articles in English ) , then fine-tuned on a task-specific dataset of paired questions and corresponding answers . The pre-training process aims at learning semantic vector representation of the language and words , while the fine-tuning process specializes the model for a specific domain . Transformer models are also increasingly the baseline architecture used for code generation tasks , such as writing methods from natural language description ( Clement et al. , 2020 ; Austin et al. , 2021 ; Chen et al. , 2021 ) , or generating test cases from the focal method under test ( Tufano et al. , 2021 ) . Similarly for NLP tasks these models are pre-trained on a large corpus of natural text and publicly available source code and then fine-tuned on a specific code-related task . Further , these models also may not generalize to new domains of interest , and can benefit from task or even user-specific fine-tuning , here called customization or personalization . Customization is particularly relevant for code generation models since it provides several benefits : • allows fine-tuning on source code data that may not be available when training a base model ( e.g. , private repositories or internal codebases ) , enabling improved overall performances on codebases with proprietary dependencies and code styles ; • the opportunity to improve data privacy by considering private or sensitive data only during the customization process on the client side ; • the opportunity to reduce deployment cost as customized models can offer better user performance without increasing model size . Custom models can provide clear benefits to users and model providers . We envision serving tens or hundreds of thousands of custom models , but doing so presents several logistical hurdles , including the costs of training , storing , and loading these models into GPU memory for inference . Worse , memory costs will only be exacerbated when working with ever larger and more powerful models . For these reasons , we investigate several customization approaches , some of which can dramatically reduce the memory footprint and amortized computational cost introduced by custom models . Specifically , we consider three fine-tuning approaches : ( i ) custom fine-tuning , which allows all the model parameters to be tuned ; ( ii ) lightweight fine-tuning , which only optimizes the token embedding representations or the final softmax layer ; ( iii ) prefix tuning , which keeps language model parameters frozen , but optimizes a small project-specific vector prefix . In our extensive empirical evaluation we found that all the customization strategies lead to significant model improvements on a target project in terms of both intrinsic and task-specific metrics . While there is no unambiguous winner among the customization strategies , each approach can provide specific benefits in particular deployment scenarios . This paper provides insights on these customization strategies , their benefits and drawbacks , as well as providing guidelines and suggestions on which one to use based on the training cost , memory and storage , number of users , and deployment scenarios . 2 APPROACH . This section describes the proposed customization approach for code generation models . We begin by formally defining the customization process , then we provide details for each of the fine-tuning strategies . 2.1 CUSTOMIZATION PROCESS . We use the term customization to refer to the process of fine-tuning a model m , previously trained on a generic dataset for a task t , with the goal of improving its performance on a specific dataset p. The performance of a machine learning model m on a dataset p is measured by one or more evaluation functions f ( m , p ) , where f can be either a maximization ( e.g. , BLEU , top-k accuracy ) or minimization ( e.g. , perplexity ) function . The customization process is designed to modify the trainable parameters of the model m , obtaining the model m′ , such that the performance of m′ on p is better than what was attained by m. Specifically , f ( m′ , p ) > f ( m , p ) for maximization functions , or f ( m′ , p ) < f ( m , p ) for minimization functions . In this work , m is an encoder-decoder transformer model , t is a code generation task , and p is a target software project to which we intend to customize m . 2.2 CUSTOM FINE-TUNING . Custom fine-tuning is the most straightforward customization approach . The model to be customized is taken as is and trained on a selected project . All parameters are trainable during this process . Figure 1a shows the model during fine-tuning , where all the parameters from the encoder and decoder blocks , as well as embeddings and output layers can be modified . 2.3 LIGHTWEIGHT FINE-TUNING - EMBEDDINGS AND OUTPUT LAYER ( L-EO ) . Fully fine-tuning a model for every project or user may be prohibitive in terms of storage and memory costs . As a result , we explore ways to mitigate these costs by reducing the number of parameters that vary from one custom model to another . In our lightweight fine-tuning experiments , we achieve this by freezing most parameters in the baseline model , and only keeping a small subset trainable . Figure 1b shows the Lightweight fine-tuning - Embeddings and Output Layer ( L-EO ) design , where most of the model parameters are frozen ( displayed in gray ) , and we allow only the embedding and output layers parameters to be fine-tuned , following the approach in Lu et al . ( 2021 ) . 2.4 LIGHTWEIGHT FINE-TUNING - LAST DECODER BLOCK ( L-LDB ) . In this lightweight fine-tuning strategy , shown in Figure 1c ( L-LDB ) , most of the model ’ s parameters are kept frozen , while only the parameters in the last decoder block are trainable , this includes : self-attention , encoder-decoder attention , layernorm and feedforward layers . This design decision of training only the last decoder block is motivated by experimental results analyzing the model ’ s parameter changes during custom fine-tuning . Figure 2 reports the average absolute changes , during fine-tuning , in the parameters belonging to different Encoder and Decoder blocks for a BART model . We observe that , as we go through the transformer model , the average change in parameter values tends to increase , with the last decoder block showing the highest changes in parameter values . As a result , we hypothesize that it could be sufficient to tune the last decoder block and obtain performance improvements similar to the fully custom fine-tuned model . 2.5 PREFIX TUNING . Prefix tuning was first introduced by Li and Liang ( 2021 ) , with the goal of fine-tuning a general model for different tasks . The technique concatenates a sequence ( prefix ) of virtual tokens ( trainable parameters ) to the front of the input of every encoder and decoder block . In our context , the intuition behind this approach is that the prefix embeds the properties of a specific project , which allows the model to generate customized responses for that repository . Practically , we set the prefix length to 200 tokens , and thus with an embedding size of 1024 , this gives a total of 1024× 200× 24× 2 ≈ 10M trainable parameters . The prefix is initialized to the most frequent words in the repository for which the model is customized . 2.6 TRAINABLE PARAMETERS DURING FINE-TUNING . Table 1 provides an overview of the number of total and trainable parameters involved in each customization process , in the case of a BART Transformer model with 406M parameters . Custom fine-tuning allows to train 100 % of the 406M available parameters in the model . During L-EO finetuining , instead , only 13 % ( 53M ) parameters are trained . The L-LDB fientuning reduces the number of trainable parameters to 4.2 % ( 17M ) . Finally , Prefix tuning has the lowest number of trainable parameters , only 2.4 % ( 10M ) of the total , but these are additional parameters added to the model , which reaches a total of 416M . 3 EXPERIMENTAL DESIGN . The goal of our experimental design is to investigate whether custom models outperform the baseline model , leading to performance improvements in terms of intrinsic metrics ( RQ1 ) , as well as extrinsic task-specific metrics ( RQ2 ) . Next , we analyze and compare the different customization approaches in terms of training and compute costs ( RQ3 ) as well as model size and required storage for deployment . In our case study , we chose Unit Test Case generation as our code generation task t , and AthenaTest by Tufano et al . ( 2021 ) as our baseline model m , which is a BART transformer model pre-trained on source code and English , and fine-tuned on Java unit test generation . The task is modeled as a translation task , where the input is a focal method ( i.e. , method under test ) , and the output is a test case which tests the focal method ’ s correctness . We randomly sample 20 projects from the test set , each of those representing the dataset p on which a custom model is fine-tuned . Specifically , for each project p , we start from the baseline model m and fine-tune four different custom models according to the four proposed fine-tuning strategies . For each project and fine-tuning strategy ( e.g. , L-EO ) , we fine-tune and evaluate the models using 4-fold cross-validation . The models are trained until the best validation loss is reached , independently for every fold , every repository , and every customization approach . In total , we fine-tune and evaluate 20 ( projects ) × 4 ( approaches ) × 4 ( folds ) = 320 models . 3.1 DATASET . Table 2 reports information about the 20 GitHub repositories sampled from the test set , which will be used to customize our models . The table shows ( i ) the Project ID , which will be used in the paper to reference a specific project ; ( ii ) the project name ; ( iii ) the project size in terms of disk usage ; ( iv ) the popularity of the project in terms of number of stars obtained on GitHub ; ( v ) and the dataset size , which corresponds to the number of data points for the unit test generation task ( i.e. , pair of focal method and test case ) . The list of projects represent a diverse set of repositories with different size , domain , and popularity . They span from small personal projects ( e.g. , Tutorials with 6 stars ) , to open source projects developed by large organizations such as Apache and Google . 3.2 RQ1 : INTRINSIC EVALUATION METRICS RQ1 : Do custom models obtain better performances on intrinsic metrics , such as BLEU and perplexity , w.r.t . the baseline ? To begin , we investigate how the different model customization approaches described in Sec . 2 score on intrinsic metrics such as BLEU and perplexity . All approaches entail fine-tuning the baseline model to the dataset of a specific project , with the choice of parameters being tuned depending on the approach taken . The four variants are trained independently until the best validation loss is achieved . We report the BLEU4 score and the mean perplexity per token on the test fold , for all the 20 projects . Next , we perform statistical tests to investigate whether the observed differences between the baseline and custom models are significant , as well as differences among the customization approaches . Specifically , we rely on the Kruskal-Wallis test , a non-parametric statistical test . 3.3 RQ2 : TASK-SPECIFIC PERFORMANCES RQ2 : Do custom models improve on performance metrics specific to unit test generation ? We want to investigate how the different customization approaches compare with respect to the downstream task of generating unit tests . Beyond BLEU score and perplexity , we would like to see if custom models can produce the correct target code , how closely their unit tests mimic the repository style , or even if they can perfectly match the desired output . • Perfect Matches : We compare the model ’ s output string with the target developer-written unit test . If the two strings are identical , this is considered a perfect match . We do not take spacing and indentation into account as we are using a Java dataset ( where indentation is not required ) . We report the proportion of perfect matches among the top 5 model predictions . • Abstracted Code Matches : We pass the model output and target output through the src2abs tool ( Tufano , 2018 ) , to obtain an abstracted version , masking variable names , method names , etc . We also do not distinguish between different objects of the same type . • Coding Style : For each project ’ s custom model , we would like to determine how closely the model learns the developer ’ s personal programming style and preferences . To this end , we extract the collection of all identifiers ( i.e. , variables and functions ’ names ) from the unit tests written by the developer as well as those generated by the models . We then pass these text outputs through a tf-idf vectorizer and compute the cosine similarity between them . This allows us to compare the developer ’ s and the models ’ word usage . We examine the similarity between the developer ’ s unit tests and the baseline and custom models generated tests . This scores the vocabulary similarity of the unit tests with the model generated code . 3.4 RQ3 : TRAINING COST COMPARISON RQ3 : Given the same amount of compute , which custom models achieve the biggest performance improvement ? Since our four training regimes tune a different number of parameters , simply comparing the training time or number of optimization steps to reach the best validation loss may not be appropriate . For a model with N parameters , we approximate the computation cost of a forward pass to be C ≈ 2N floating point operations per training token , with an additional correction for embedding layers . The backward pass takes roughly twice the amount of compute , but it is unnecessary for layers that are frozen . For additional details , we refer to Table 1 in Kaplan et al . ( 2020 ) . We report the resulting compute in petaFLOPS-seconds . | Software projects tend to differ strongly from one another in terms of coding style, which significantly reduces the efficacy of even large pretrained models in new project contexts. This work explores the practical performance of several fine-tuning strategies of a model trained for a software engineering task (test-case generation) to new project contexts. The results suggest that fine-tuning can substantially improve model performance, but the specific choice of fine-tuning strategy makes very little difference. | SP:c3f174e428d7f56c217341445d1261e1c60d6108 |
SLASH: Embracing Probabilistic Circuits into Neural Answer Set Programming | 1 INTRODUCTION . In recent years , Neuro-Symbolic AI approaches to learning ( Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) , which integrates low-level perception with high-level reasoning by combining data-driven neural modules with logic-based symbolic modules , has gained traction . This combination of sub-symbolic and symbolic systems has been shown to have several advantages for various tasks such as visual question answering and reasoning ( Yi et al. , 2018 ) , concept learning ( Mao et al. , 2019 ) and improved properties for explainable and revisable models ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Rather than designing specifically tailored Neuro-Symbolic architectures , where often the neural and symbolic modules are disjoint and trained independently ( Yi et al. , 2018 ; Mao et al. , 2019 ; Stammer et al. , 2021 ) , deep probabilistic programming languages ( DPPLs ) provide an exciting alternative ( Bingham et al. , 2019 ; Tran et al. , 2017 ; Manhaeve et al. , 2018 ; Yang et al. , 2020 ) . Specifically , DPPLs integrate neural and symbolic modules via a unifying programming framework with probability estimates acting as the “ glue ” between separate modules allowing for reasoning over noisy , uncertain data and , importantly , joint training of the modules . Additionally , prior knowledge and biases in the form of logical rules can easily be added with DPPLs , rather than creating implicit architectural biases , thereby integrating neural networks into downstream logical reasoning tasks . Object-centric deep learning has recently brought forth several exciting avenues of research by introducing inductive biases to neural networks to extract objects from visual scenes in an unsupervised manner ( Zhang et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2020 ; Greff et al. , 2019 ; Lin et al. , 2020 ; Locatello et al. , 2020 ; Jiang & Ahn , 2020 ) . We refer to Greff et al . ( 2020 ) for a detailed overview . A motivation for this specific line of investigation , which notably has been around for a longer period of time ( Fodor & Pylyshyn , 1988 ; Marcus , 2019 ) , is that objects occur as natural building blocks in human perception and possess advantageous properties for many cognitive tasks , such as scene understanding and reasoning . With a DPPL , these advancements can be improved by integrating the previously mentioned components into the DPPL ’ s programming framework and further adding constraints about objects and their properties in form of logical statements e.g . about color singularity , rather than implicitly enforcing this via one hot encodings . We propose SLASH – a novel DPPL that , similar to the punctuation symbol , can be used to efficiently combine several paradigms into one . Specifically , SLASH represents a scalable programming language that seamlessly integrates probabilistic logical programming with neural representations and tractable probabilistic estimations . Fig . 1 shows an example instantiation of SLASH , termed SLASH Attention , for object-centric set prediction . SLASH consists of several key building blocks . Firstly , it makes use of Neural-Probabilistic Predicates ( NPPs ) for probability estimation . NPPs consist of neural and/or probabilistic circuit ( PC ) modules and act as a unifying term , encompassing the neural predicates of DeepProbLog and NeurASP , as well as purely probabilistic predicates . In this work , we introduce a much more powerful “ flavor ” of NPPs that consist jointly of neural and PC modules , taking advantage of the power of neural computations together with true density estimation of PCs . Depending on the underlying task one can thus ask a range of queries to the NPP , e.g . sample an unknown , desired variable , but also query for conditional class probabilities . Example NPPs consisting of a slot attention encoder and several PCs are depicted in Fig . 1 for the task of set prediction . The slot encoder is shared across all NPPs , whereas the PC of each NPP models a separate category of attributes . In this way , each NPP models the joint distribution over slot encodings and object attribute values , such as the color of an object . By querying the NPP , one can obtain task-related probability estimations , such as the conditional attribute probability . The second component of SLASH is the logical program , which consists of a set of facts and logical statements defining the state of the world of the underlying task . For example , one can define the rules for when an object possesses a specific set of attributes ( cf . Fig . 1 ) . Thirdly , an ASP module is used to combine the first two components . Given a logical query about the input data , the logical program and the probability estimates obtained from the NPP ( s ) , the ASP module produces a probability estimate about the truth value of the query , stating , e.g. , how likely it is for a specific object in an image to be a large , dark red triangle . In contrast to query evaluation in Prolog ( Colmerauer & Roussel , 1993 ; Clocksin & Mellish , 1981 ) which may lead to an infinite loop , many modern answer set solvers use Conflict-Driven-Clause-Learning ( CDPL ) which , in principle , always terminates . Training in SLASH is performed efficiently in a batch-wise and end-to-end fashion , by integrating the parameters of all modules , neural and probabilistic , into a single loss term . SLASH thus allows a simple , fast and effective integration of sub-symbolic and symbolic computations . In our experiments , we investigate the advantages of SLASH in comparison to SOTA DPPLs on the benchmark task of MNIST-Addition ( Manhaeve et al. , 2018 ) . We hereby show SLASH ’ s increased scalability regarding computation time , as well as SLASH ’ s ability to handle incomplete data via true probabilistic density modelling . Next , we show that SLASH Attention provides superior results for set prediction in terms of accuracy and generalization abilities compared to a baseline slot attention encoder . With our experiments , we thus show that SLASH is a realization of “ one system – two approaches ” ( Bengio , 2019 ) , that can successfully be used for performing various tasks and on a variety of data types . We make the following contributions : ( 1 ) We introduce neural-probabilistic predicates , efficiently integrating answer set programming with probabilistic inference via our novel DPPL , SLASH . ( 2 ) We successfully train neural , probabilistic and logic modules within SLASH for complex data structures end-to-end via a simple , single loss term . ( 3 ) We show that SLASH provides various advantages across a variety of tasks and data sets compared to state-of-the-art DPPLs and neural models . 2 NEURO-SYMBOLIC LOGIC PROGRAMMING . Neuro-Symbolic AI can be divided into two lines of research , depending on the starting point . Both , however , have the same final goal : to combine low-level perception with logical constraints and reasoning . A key motivation of Neuro-Symbolic AI ( d ’ Avila Garcez et al. , 2009 ; Mao et al. , 2019 ; Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) is to combine the advantages of symbolic and neural representations into a joint system . This is often done in a hybrid approach where a neural network acts as a perception module that interfaces with a symbolic reasoning system , e.g . ( Mao et al. , 2019 ; Yi et al. , 2018 ) . The goal of such an approach is to mitigate the issues of one type of representation by the other , e.g . using the power of symbolic reasoning systems to handle the generalizability issues of neural networks and on the other hand handle the difficulty of noisy data for symbolic systems via neural networks . Recent work has also shown the advantage of Neuro-Symbolic approaches for explaining and revising incorrect decisions ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Many of these previous works , however , train the sub-symbolic and symbolic modules separately . Deep Probabilistic Programming Languages ( DPPLs ) are programming languages that combine deep neural networks with probabilistic models and allow a user to express a probabilistic model via a logical program . Similar to Neuro-Symbolic architectures , DPPLs thereby unite the advantages of different paradigms . DPPLs are related to earlier works such as Markov Logic Networks ( MLNs ) ( Richardson & Domingos , 2006 ) . Thereby , the binding link is the Weighted Model Counting ( WMC ) introduced in LPMLN ( Lee & Wang , 2016 ) . Several DPPLs have been proposed by now , among which are Pyro ( Bingham et al. , 2019 ) , Edward ( Tran et al. , 2017 ) , DeepProbLog ( Manhaeve et al. , 2018 ) , and NeurASP ( Yang et al. , 2020 ) . To resolve the scalability issues of DeepProbLog , which use Sentential Decision Diagrams ( SDDs ) ( Darwiche , 2011 ) as the underlying data structure to evaluate queries , NeurASP ( Yang et al. , 2020 ) , offers a solution by utilizing Answer Set Programming ( ASP ) ( Dimopoulos et al. , 1997 ; Soininen & Niemelä , 1999 ; Marek & Truszczynski , 1999 ; Calimeri et al. , 2020 ) . In this way , NeurASP changes the paradigm from query evaluation to model generation , i.e . instead of constructing an SDD or similar knowledge representation system , NeurASP generates a set of all possible solutions ( one model per solution ) and estimates the probability for the truth value of each of these solutions . Of those DPPLs that handle learning in a relational , probabilistic setting and in an end-to-end fashion , all of these are limited to estimating only conditional class probabilities . 3 THE SLASH FRAMEWORK . In this section , we introduce our novel DPPL , SLASH . Before we dive into the details of this , it is necessary to first introduce Neural-Probabilistic Predicates , for which we require an understanding of Probabilistic Circuits . Finally , we will present the learning paradigm of SLASH . The term probabilistic circuit ( PC ) ( Choi et al. , 2020 ) represents a unifying framework that encompasses all computational graphs which encode probability distributions and guarantee tractable probabilistic modelling . These include Sum-Product Networks ( SPNs ) ( Poon & Domingos , 2011 ) which are deep mixture models represented via a rooted directed acyclic graphs with a recursively defined structure . 3.1 NEURAL-PROBABILISTIC PREDICATES . Previous DPPLs , DeepProbLog ( Manhaeve et al. , 2018 ) and NeurASP ( Yang et al. , 2020 ) , introduced the Neural Predicate as an annotated-disjunction or as a propositional atom , respectively , to acquire conditional class probabilities , P ( C|X ) , via the softmax function at the output of an arbitrary DNN . As mentioned in the introduction , this approach has certain limitations concerning inference capabilities . To resolve this issue , we introduce Neural-Probabilisitic Predicates ( NPPs ) . Formally , we denote with npp ( h ( x ) , [ v1 , . . . , vn ] ) ( 1 ) a Neural-Probabilistic Predicate h. Thereby , ( i ) npp is a reserved word to label an NPP , ( ii ) h a symbolic name of either a PC , NN or a joint of a PC and NN ( cf . Fig . 2a ) , e.g. , color_attr is the name of an NPP of Fig . 2b . Additionally , ( iii ) x denotes a “ term ” and ( iv ) v1 , . . . , vn are placeholders for each of the n possible outcomes of h. For example , the placeholders for color_attr are the color attributes of an object ( Red , Blue , Green , etc. ) . An NPP abbreviates an arithmetic literal of the form c = v with c ∈ { h ( x ) } and v ∈ { v1 , . . . , vn } . Furthermore , we denote with Πnpp a set of NPPs of the form stated in ( Eq . 1 ) and rnpp the set of all rules c = v of one NPP , which denotes the possible outcomes , obtained from an NPP in Πnpp , e.g . rcolor_attr = { c = Red , c = Blue , c = Green , ... } for the example depicted in Fig . 2b . Rules of the form npp ( h ( x ) , [ v1 , . . . , vn ] ) ← Body are used as an abbreviation for application to multiple entities , e.g . multiple slots for the task of set prediction ( cf . Fig . 2b ) . Hereby , Body of the rule is identified by > ( tautology , true ) or ⊥ ( contradiction , false ) during grounding . Rules of the form Head← Body with rnpp appearing in Head are prohibited for Πnpp . In this work , we largely make use of NPPs that contain probabilistic circuits ( specifically SPNs ) which allow for tractable density estimation and modelling of joint probabilities . In this way , it is possible to answer a much richer set of probabilistic queries , i.e . P ( X , C ) , P ( X|C ) and P ( C|X ) . In addition to this , we introduce the arguably more interesting type of NPP that combines a neural module with a PC . Hereby , the neural module learns to map the raw input data into an optimal latent representation , e.g . object-based slot representations . The PC , in turn , learns to model the joint distribution of these latent variables and produces the final probability estimates . This type of NPP nicely combines the representational power of neural networks with the advantages of PCs in probability estimation and query flexibility . For making the different probabilistic queries distinguishable in a SLASH program , we introduce the following notation . We denote a given variable with + and the query variable with − . E.g. , within the running example of set prediction ( cf . Fig . 1 and 2b ) , with the query color_attr ( +X , −C ) one is asking for P ( C|X ) . Similarly , with color_attr ( −X , +C ) one is asking for P ( X|C ) and , finally , with color_attr ( −X , −C ) for P ( X , C ) . To summarize , an NPP can consist of neural and/or probabilistic modules and produces querydependent probability estimates . Due to the flexibility of its definition , the term NPP contains the predicates of previous works ( Manhaeve et al. , 2018 ; Yang et al. , 2020 ) , but also more interesting predicates discussed above . The specific “ flavor ” of an NPP should be chosen depending on what type of probability estimation is required ( cf . Fig 2a ) . Lastly , NPPs have the unified loss function of the negative log-likelihood : LNPP : = − logLH ( x , x̂ ) = n∑ i=1 LH ( xi , x̂i ) = − n∑ i=1 xi · log ( P ( X , C ) ξ ( xi ) ) = − n∑ i=1 log ( P ( X , C ) ξ ) ( 2 ) whereby we are assuming the data to be i.i.d. , ground truth xi to be the all-ones vector , ξ to be the parameters of the NPP and P ( X , C ) ξ are the predictions x̂i obtained from the PC encoded in the NPP . | This paper presents a new deep probabilistic programming language based on ASP. The key feature is the use of a single attention encoder paired with a collection of probabilistic circuits (one for each "category"/model solution of the neuro-symbolic task). ASP is finally used to answer a query given the probabilistic predicates returned by the circuits for the features extracted by the encoder and the logical program modelling the particular task under consideration. SOTA accuracies are achieved with advantages related to the generative nature of the considered approach (e.g., when coping with missing data) and good computation times (due to the parallelisation of the ASP tasks). | SP:303da185234e1d71756541cf35b0ac20cec30453 |
SLASH: Embracing Probabilistic Circuits into Neural Answer Set Programming | 1 INTRODUCTION . In recent years , Neuro-Symbolic AI approaches to learning ( Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) , which integrates low-level perception with high-level reasoning by combining data-driven neural modules with logic-based symbolic modules , has gained traction . This combination of sub-symbolic and symbolic systems has been shown to have several advantages for various tasks such as visual question answering and reasoning ( Yi et al. , 2018 ) , concept learning ( Mao et al. , 2019 ) and improved properties for explainable and revisable models ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Rather than designing specifically tailored Neuro-Symbolic architectures , where often the neural and symbolic modules are disjoint and trained independently ( Yi et al. , 2018 ; Mao et al. , 2019 ; Stammer et al. , 2021 ) , deep probabilistic programming languages ( DPPLs ) provide an exciting alternative ( Bingham et al. , 2019 ; Tran et al. , 2017 ; Manhaeve et al. , 2018 ; Yang et al. , 2020 ) . Specifically , DPPLs integrate neural and symbolic modules via a unifying programming framework with probability estimates acting as the “ glue ” between separate modules allowing for reasoning over noisy , uncertain data and , importantly , joint training of the modules . Additionally , prior knowledge and biases in the form of logical rules can easily be added with DPPLs , rather than creating implicit architectural biases , thereby integrating neural networks into downstream logical reasoning tasks . Object-centric deep learning has recently brought forth several exciting avenues of research by introducing inductive biases to neural networks to extract objects from visual scenes in an unsupervised manner ( Zhang et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2020 ; Greff et al. , 2019 ; Lin et al. , 2020 ; Locatello et al. , 2020 ; Jiang & Ahn , 2020 ) . We refer to Greff et al . ( 2020 ) for a detailed overview . A motivation for this specific line of investigation , which notably has been around for a longer period of time ( Fodor & Pylyshyn , 1988 ; Marcus , 2019 ) , is that objects occur as natural building blocks in human perception and possess advantageous properties for many cognitive tasks , such as scene understanding and reasoning . With a DPPL , these advancements can be improved by integrating the previously mentioned components into the DPPL ’ s programming framework and further adding constraints about objects and their properties in form of logical statements e.g . about color singularity , rather than implicitly enforcing this via one hot encodings . We propose SLASH – a novel DPPL that , similar to the punctuation symbol , can be used to efficiently combine several paradigms into one . Specifically , SLASH represents a scalable programming language that seamlessly integrates probabilistic logical programming with neural representations and tractable probabilistic estimations . Fig . 1 shows an example instantiation of SLASH , termed SLASH Attention , for object-centric set prediction . SLASH consists of several key building blocks . Firstly , it makes use of Neural-Probabilistic Predicates ( NPPs ) for probability estimation . NPPs consist of neural and/or probabilistic circuit ( PC ) modules and act as a unifying term , encompassing the neural predicates of DeepProbLog and NeurASP , as well as purely probabilistic predicates . In this work , we introduce a much more powerful “ flavor ” of NPPs that consist jointly of neural and PC modules , taking advantage of the power of neural computations together with true density estimation of PCs . Depending on the underlying task one can thus ask a range of queries to the NPP , e.g . sample an unknown , desired variable , but also query for conditional class probabilities . Example NPPs consisting of a slot attention encoder and several PCs are depicted in Fig . 1 for the task of set prediction . The slot encoder is shared across all NPPs , whereas the PC of each NPP models a separate category of attributes . In this way , each NPP models the joint distribution over slot encodings and object attribute values , such as the color of an object . By querying the NPP , one can obtain task-related probability estimations , such as the conditional attribute probability . The second component of SLASH is the logical program , which consists of a set of facts and logical statements defining the state of the world of the underlying task . For example , one can define the rules for when an object possesses a specific set of attributes ( cf . Fig . 1 ) . Thirdly , an ASP module is used to combine the first two components . Given a logical query about the input data , the logical program and the probability estimates obtained from the NPP ( s ) , the ASP module produces a probability estimate about the truth value of the query , stating , e.g. , how likely it is for a specific object in an image to be a large , dark red triangle . In contrast to query evaluation in Prolog ( Colmerauer & Roussel , 1993 ; Clocksin & Mellish , 1981 ) which may lead to an infinite loop , many modern answer set solvers use Conflict-Driven-Clause-Learning ( CDPL ) which , in principle , always terminates . Training in SLASH is performed efficiently in a batch-wise and end-to-end fashion , by integrating the parameters of all modules , neural and probabilistic , into a single loss term . SLASH thus allows a simple , fast and effective integration of sub-symbolic and symbolic computations . In our experiments , we investigate the advantages of SLASH in comparison to SOTA DPPLs on the benchmark task of MNIST-Addition ( Manhaeve et al. , 2018 ) . We hereby show SLASH ’ s increased scalability regarding computation time , as well as SLASH ’ s ability to handle incomplete data via true probabilistic density modelling . Next , we show that SLASH Attention provides superior results for set prediction in terms of accuracy and generalization abilities compared to a baseline slot attention encoder . With our experiments , we thus show that SLASH is a realization of “ one system – two approaches ” ( Bengio , 2019 ) , that can successfully be used for performing various tasks and on a variety of data types . We make the following contributions : ( 1 ) We introduce neural-probabilistic predicates , efficiently integrating answer set programming with probabilistic inference via our novel DPPL , SLASH . ( 2 ) We successfully train neural , probabilistic and logic modules within SLASH for complex data structures end-to-end via a simple , single loss term . ( 3 ) We show that SLASH provides various advantages across a variety of tasks and data sets compared to state-of-the-art DPPLs and neural models . 2 NEURO-SYMBOLIC LOGIC PROGRAMMING . Neuro-Symbolic AI can be divided into two lines of research , depending on the starting point . Both , however , have the same final goal : to combine low-level perception with logical constraints and reasoning . A key motivation of Neuro-Symbolic AI ( d ’ Avila Garcez et al. , 2009 ; Mao et al. , 2019 ; Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) is to combine the advantages of symbolic and neural representations into a joint system . This is often done in a hybrid approach where a neural network acts as a perception module that interfaces with a symbolic reasoning system , e.g . ( Mao et al. , 2019 ; Yi et al. , 2018 ) . The goal of such an approach is to mitigate the issues of one type of representation by the other , e.g . using the power of symbolic reasoning systems to handle the generalizability issues of neural networks and on the other hand handle the difficulty of noisy data for symbolic systems via neural networks . Recent work has also shown the advantage of Neuro-Symbolic approaches for explaining and revising incorrect decisions ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Many of these previous works , however , train the sub-symbolic and symbolic modules separately . Deep Probabilistic Programming Languages ( DPPLs ) are programming languages that combine deep neural networks with probabilistic models and allow a user to express a probabilistic model via a logical program . Similar to Neuro-Symbolic architectures , DPPLs thereby unite the advantages of different paradigms . DPPLs are related to earlier works such as Markov Logic Networks ( MLNs ) ( Richardson & Domingos , 2006 ) . Thereby , the binding link is the Weighted Model Counting ( WMC ) introduced in LPMLN ( Lee & Wang , 2016 ) . Several DPPLs have been proposed by now , among which are Pyro ( Bingham et al. , 2019 ) , Edward ( Tran et al. , 2017 ) , DeepProbLog ( Manhaeve et al. , 2018 ) , and NeurASP ( Yang et al. , 2020 ) . To resolve the scalability issues of DeepProbLog , which use Sentential Decision Diagrams ( SDDs ) ( Darwiche , 2011 ) as the underlying data structure to evaluate queries , NeurASP ( Yang et al. , 2020 ) , offers a solution by utilizing Answer Set Programming ( ASP ) ( Dimopoulos et al. , 1997 ; Soininen & Niemelä , 1999 ; Marek & Truszczynski , 1999 ; Calimeri et al. , 2020 ) . In this way , NeurASP changes the paradigm from query evaluation to model generation , i.e . instead of constructing an SDD or similar knowledge representation system , NeurASP generates a set of all possible solutions ( one model per solution ) and estimates the probability for the truth value of each of these solutions . Of those DPPLs that handle learning in a relational , probabilistic setting and in an end-to-end fashion , all of these are limited to estimating only conditional class probabilities . 3 THE SLASH FRAMEWORK . In this section , we introduce our novel DPPL , SLASH . Before we dive into the details of this , it is necessary to first introduce Neural-Probabilistic Predicates , for which we require an understanding of Probabilistic Circuits . Finally , we will present the learning paradigm of SLASH . The term probabilistic circuit ( PC ) ( Choi et al. , 2020 ) represents a unifying framework that encompasses all computational graphs which encode probability distributions and guarantee tractable probabilistic modelling . These include Sum-Product Networks ( SPNs ) ( Poon & Domingos , 2011 ) which are deep mixture models represented via a rooted directed acyclic graphs with a recursively defined structure . 3.1 NEURAL-PROBABILISTIC PREDICATES . Previous DPPLs , DeepProbLog ( Manhaeve et al. , 2018 ) and NeurASP ( Yang et al. , 2020 ) , introduced the Neural Predicate as an annotated-disjunction or as a propositional atom , respectively , to acquire conditional class probabilities , P ( C|X ) , via the softmax function at the output of an arbitrary DNN . As mentioned in the introduction , this approach has certain limitations concerning inference capabilities . To resolve this issue , we introduce Neural-Probabilisitic Predicates ( NPPs ) . Formally , we denote with npp ( h ( x ) , [ v1 , . . . , vn ] ) ( 1 ) a Neural-Probabilistic Predicate h. Thereby , ( i ) npp is a reserved word to label an NPP , ( ii ) h a symbolic name of either a PC , NN or a joint of a PC and NN ( cf . Fig . 2a ) , e.g. , color_attr is the name of an NPP of Fig . 2b . Additionally , ( iii ) x denotes a “ term ” and ( iv ) v1 , . . . , vn are placeholders for each of the n possible outcomes of h. For example , the placeholders for color_attr are the color attributes of an object ( Red , Blue , Green , etc. ) . An NPP abbreviates an arithmetic literal of the form c = v with c ∈ { h ( x ) } and v ∈ { v1 , . . . , vn } . Furthermore , we denote with Πnpp a set of NPPs of the form stated in ( Eq . 1 ) and rnpp the set of all rules c = v of one NPP , which denotes the possible outcomes , obtained from an NPP in Πnpp , e.g . rcolor_attr = { c = Red , c = Blue , c = Green , ... } for the example depicted in Fig . 2b . Rules of the form npp ( h ( x ) , [ v1 , . . . , vn ] ) ← Body are used as an abbreviation for application to multiple entities , e.g . multiple slots for the task of set prediction ( cf . Fig . 2b ) . Hereby , Body of the rule is identified by > ( tautology , true ) or ⊥ ( contradiction , false ) during grounding . Rules of the form Head← Body with rnpp appearing in Head are prohibited for Πnpp . In this work , we largely make use of NPPs that contain probabilistic circuits ( specifically SPNs ) which allow for tractable density estimation and modelling of joint probabilities . In this way , it is possible to answer a much richer set of probabilistic queries , i.e . P ( X , C ) , P ( X|C ) and P ( C|X ) . In addition to this , we introduce the arguably more interesting type of NPP that combines a neural module with a PC . Hereby , the neural module learns to map the raw input data into an optimal latent representation , e.g . object-based slot representations . The PC , in turn , learns to model the joint distribution of these latent variables and produces the final probability estimates . This type of NPP nicely combines the representational power of neural networks with the advantages of PCs in probability estimation and query flexibility . For making the different probabilistic queries distinguishable in a SLASH program , we introduce the following notation . We denote a given variable with + and the query variable with − . E.g. , within the running example of set prediction ( cf . Fig . 1 and 2b ) , with the query color_attr ( +X , −C ) one is asking for P ( C|X ) . Similarly , with color_attr ( −X , +C ) one is asking for P ( X|C ) and , finally , with color_attr ( −X , −C ) for P ( X , C ) . To summarize , an NPP can consist of neural and/or probabilistic modules and produces querydependent probability estimates . Due to the flexibility of its definition , the term NPP contains the predicates of previous works ( Manhaeve et al. , 2018 ; Yang et al. , 2020 ) , but also more interesting predicates discussed above . The specific “ flavor ” of an NPP should be chosen depending on what type of probability estimation is required ( cf . Fig 2a ) . Lastly , NPPs have the unified loss function of the negative log-likelihood : LNPP : = − logLH ( x , x̂ ) = n∑ i=1 LH ( xi , x̂i ) = − n∑ i=1 xi · log ( P ( X , C ) ξ ( xi ) ) = − n∑ i=1 log ( P ( X , C ) ξ ) ( 2 ) whereby we are assuming the data to be i.i.d. , ground truth xi to be the all-ones vector , ξ to be the parameters of the NPP and P ( X , C ) ξ are the predictions x̂i obtained from the PC encoded in the NPP . | This paper proposes a neuro-symbolic model, dubbed SLASH, that extends previous deep probabilistic programming languages with probabilistic circuits (PCs). The advantage of this approach with respect to similar frameworks, such as DeepProbLog or NeurASP, lies in defining predicates using Sum-Product Networks (SPNs), a subclass of PCs that admit tractable marginal/conditional inference over any subset of variables. Additionally, neural networks and SPNs can be unified in the same framework, for instance by defining PCs on the latent representation extracted by an Attention Slot module. Experiments on different tasks show promising results for this approach. | SP:303da185234e1d71756541cf35b0ac20cec30453 |
SLASH: Embracing Probabilistic Circuits into Neural Answer Set Programming | 1 INTRODUCTION . In recent years , Neuro-Symbolic AI approaches to learning ( Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) , which integrates low-level perception with high-level reasoning by combining data-driven neural modules with logic-based symbolic modules , has gained traction . This combination of sub-symbolic and symbolic systems has been shown to have several advantages for various tasks such as visual question answering and reasoning ( Yi et al. , 2018 ) , concept learning ( Mao et al. , 2019 ) and improved properties for explainable and revisable models ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Rather than designing specifically tailored Neuro-Symbolic architectures , where often the neural and symbolic modules are disjoint and trained independently ( Yi et al. , 2018 ; Mao et al. , 2019 ; Stammer et al. , 2021 ) , deep probabilistic programming languages ( DPPLs ) provide an exciting alternative ( Bingham et al. , 2019 ; Tran et al. , 2017 ; Manhaeve et al. , 2018 ; Yang et al. , 2020 ) . Specifically , DPPLs integrate neural and symbolic modules via a unifying programming framework with probability estimates acting as the “ glue ” between separate modules allowing for reasoning over noisy , uncertain data and , importantly , joint training of the modules . Additionally , prior knowledge and biases in the form of logical rules can easily be added with DPPLs , rather than creating implicit architectural biases , thereby integrating neural networks into downstream logical reasoning tasks . Object-centric deep learning has recently brought forth several exciting avenues of research by introducing inductive biases to neural networks to extract objects from visual scenes in an unsupervised manner ( Zhang et al. , 2019 ; Burgess et al. , 2019 ; Engelcke et al. , 2020 ; Greff et al. , 2019 ; Lin et al. , 2020 ; Locatello et al. , 2020 ; Jiang & Ahn , 2020 ) . We refer to Greff et al . ( 2020 ) for a detailed overview . A motivation for this specific line of investigation , which notably has been around for a longer period of time ( Fodor & Pylyshyn , 1988 ; Marcus , 2019 ) , is that objects occur as natural building blocks in human perception and possess advantageous properties for many cognitive tasks , such as scene understanding and reasoning . With a DPPL , these advancements can be improved by integrating the previously mentioned components into the DPPL ’ s programming framework and further adding constraints about objects and their properties in form of logical statements e.g . about color singularity , rather than implicitly enforcing this via one hot encodings . We propose SLASH – a novel DPPL that , similar to the punctuation symbol , can be used to efficiently combine several paradigms into one . Specifically , SLASH represents a scalable programming language that seamlessly integrates probabilistic logical programming with neural representations and tractable probabilistic estimations . Fig . 1 shows an example instantiation of SLASH , termed SLASH Attention , for object-centric set prediction . SLASH consists of several key building blocks . Firstly , it makes use of Neural-Probabilistic Predicates ( NPPs ) for probability estimation . NPPs consist of neural and/or probabilistic circuit ( PC ) modules and act as a unifying term , encompassing the neural predicates of DeepProbLog and NeurASP , as well as purely probabilistic predicates . In this work , we introduce a much more powerful “ flavor ” of NPPs that consist jointly of neural and PC modules , taking advantage of the power of neural computations together with true density estimation of PCs . Depending on the underlying task one can thus ask a range of queries to the NPP , e.g . sample an unknown , desired variable , but also query for conditional class probabilities . Example NPPs consisting of a slot attention encoder and several PCs are depicted in Fig . 1 for the task of set prediction . The slot encoder is shared across all NPPs , whereas the PC of each NPP models a separate category of attributes . In this way , each NPP models the joint distribution over slot encodings and object attribute values , such as the color of an object . By querying the NPP , one can obtain task-related probability estimations , such as the conditional attribute probability . The second component of SLASH is the logical program , which consists of a set of facts and logical statements defining the state of the world of the underlying task . For example , one can define the rules for when an object possesses a specific set of attributes ( cf . Fig . 1 ) . Thirdly , an ASP module is used to combine the first two components . Given a logical query about the input data , the logical program and the probability estimates obtained from the NPP ( s ) , the ASP module produces a probability estimate about the truth value of the query , stating , e.g. , how likely it is for a specific object in an image to be a large , dark red triangle . In contrast to query evaluation in Prolog ( Colmerauer & Roussel , 1993 ; Clocksin & Mellish , 1981 ) which may lead to an infinite loop , many modern answer set solvers use Conflict-Driven-Clause-Learning ( CDPL ) which , in principle , always terminates . Training in SLASH is performed efficiently in a batch-wise and end-to-end fashion , by integrating the parameters of all modules , neural and probabilistic , into a single loss term . SLASH thus allows a simple , fast and effective integration of sub-symbolic and symbolic computations . In our experiments , we investigate the advantages of SLASH in comparison to SOTA DPPLs on the benchmark task of MNIST-Addition ( Manhaeve et al. , 2018 ) . We hereby show SLASH ’ s increased scalability regarding computation time , as well as SLASH ’ s ability to handle incomplete data via true probabilistic density modelling . Next , we show that SLASH Attention provides superior results for set prediction in terms of accuracy and generalization abilities compared to a baseline slot attention encoder . With our experiments , we thus show that SLASH is a realization of “ one system – two approaches ” ( Bengio , 2019 ) , that can successfully be used for performing various tasks and on a variety of data types . We make the following contributions : ( 1 ) We introduce neural-probabilistic predicates , efficiently integrating answer set programming with probabilistic inference via our novel DPPL , SLASH . ( 2 ) We successfully train neural , probabilistic and logic modules within SLASH for complex data structures end-to-end via a simple , single loss term . ( 3 ) We show that SLASH provides various advantages across a variety of tasks and data sets compared to state-of-the-art DPPLs and neural models . 2 NEURO-SYMBOLIC LOGIC PROGRAMMING . Neuro-Symbolic AI can be divided into two lines of research , depending on the starting point . Both , however , have the same final goal : to combine low-level perception with logical constraints and reasoning . A key motivation of Neuro-Symbolic AI ( d ’ Avila Garcez et al. , 2009 ; Mao et al. , 2019 ; Hudson & Manning , 2019 ; d ’ Avila Garcez et al. , 2019 ; Jiang & Ahn , 2020 ; d ’ Avila Garcez & Lamb , 2020 ) is to combine the advantages of symbolic and neural representations into a joint system . This is often done in a hybrid approach where a neural network acts as a perception module that interfaces with a symbolic reasoning system , e.g . ( Mao et al. , 2019 ; Yi et al. , 2018 ) . The goal of such an approach is to mitigate the issues of one type of representation by the other , e.g . using the power of symbolic reasoning systems to handle the generalizability issues of neural networks and on the other hand handle the difficulty of noisy data for symbolic systems via neural networks . Recent work has also shown the advantage of Neuro-Symbolic approaches for explaining and revising incorrect decisions ( Ciravegna et al. , 2020 ; Stammer et al. , 2021 ) . Many of these previous works , however , train the sub-symbolic and symbolic modules separately . Deep Probabilistic Programming Languages ( DPPLs ) are programming languages that combine deep neural networks with probabilistic models and allow a user to express a probabilistic model via a logical program . Similar to Neuro-Symbolic architectures , DPPLs thereby unite the advantages of different paradigms . DPPLs are related to earlier works such as Markov Logic Networks ( MLNs ) ( Richardson & Domingos , 2006 ) . Thereby , the binding link is the Weighted Model Counting ( WMC ) introduced in LPMLN ( Lee & Wang , 2016 ) . Several DPPLs have been proposed by now , among which are Pyro ( Bingham et al. , 2019 ) , Edward ( Tran et al. , 2017 ) , DeepProbLog ( Manhaeve et al. , 2018 ) , and NeurASP ( Yang et al. , 2020 ) . To resolve the scalability issues of DeepProbLog , which use Sentential Decision Diagrams ( SDDs ) ( Darwiche , 2011 ) as the underlying data structure to evaluate queries , NeurASP ( Yang et al. , 2020 ) , offers a solution by utilizing Answer Set Programming ( ASP ) ( Dimopoulos et al. , 1997 ; Soininen & Niemelä , 1999 ; Marek & Truszczynski , 1999 ; Calimeri et al. , 2020 ) . In this way , NeurASP changes the paradigm from query evaluation to model generation , i.e . instead of constructing an SDD or similar knowledge representation system , NeurASP generates a set of all possible solutions ( one model per solution ) and estimates the probability for the truth value of each of these solutions . Of those DPPLs that handle learning in a relational , probabilistic setting and in an end-to-end fashion , all of these are limited to estimating only conditional class probabilities . 3 THE SLASH FRAMEWORK . In this section , we introduce our novel DPPL , SLASH . Before we dive into the details of this , it is necessary to first introduce Neural-Probabilistic Predicates , for which we require an understanding of Probabilistic Circuits . Finally , we will present the learning paradigm of SLASH . The term probabilistic circuit ( PC ) ( Choi et al. , 2020 ) represents a unifying framework that encompasses all computational graphs which encode probability distributions and guarantee tractable probabilistic modelling . These include Sum-Product Networks ( SPNs ) ( Poon & Domingos , 2011 ) which are deep mixture models represented via a rooted directed acyclic graphs with a recursively defined structure . 3.1 NEURAL-PROBABILISTIC PREDICATES . Previous DPPLs , DeepProbLog ( Manhaeve et al. , 2018 ) and NeurASP ( Yang et al. , 2020 ) , introduced the Neural Predicate as an annotated-disjunction or as a propositional atom , respectively , to acquire conditional class probabilities , P ( C|X ) , via the softmax function at the output of an arbitrary DNN . As mentioned in the introduction , this approach has certain limitations concerning inference capabilities . To resolve this issue , we introduce Neural-Probabilisitic Predicates ( NPPs ) . Formally , we denote with npp ( h ( x ) , [ v1 , . . . , vn ] ) ( 1 ) a Neural-Probabilistic Predicate h. Thereby , ( i ) npp is a reserved word to label an NPP , ( ii ) h a symbolic name of either a PC , NN or a joint of a PC and NN ( cf . Fig . 2a ) , e.g. , color_attr is the name of an NPP of Fig . 2b . Additionally , ( iii ) x denotes a “ term ” and ( iv ) v1 , . . . , vn are placeholders for each of the n possible outcomes of h. For example , the placeholders for color_attr are the color attributes of an object ( Red , Blue , Green , etc. ) . An NPP abbreviates an arithmetic literal of the form c = v with c ∈ { h ( x ) } and v ∈ { v1 , . . . , vn } . Furthermore , we denote with Πnpp a set of NPPs of the form stated in ( Eq . 1 ) and rnpp the set of all rules c = v of one NPP , which denotes the possible outcomes , obtained from an NPP in Πnpp , e.g . rcolor_attr = { c = Red , c = Blue , c = Green , ... } for the example depicted in Fig . 2b . Rules of the form npp ( h ( x ) , [ v1 , . . . , vn ] ) ← Body are used as an abbreviation for application to multiple entities , e.g . multiple slots for the task of set prediction ( cf . Fig . 2b ) . Hereby , Body of the rule is identified by > ( tautology , true ) or ⊥ ( contradiction , false ) during grounding . Rules of the form Head← Body with rnpp appearing in Head are prohibited for Πnpp . In this work , we largely make use of NPPs that contain probabilistic circuits ( specifically SPNs ) which allow for tractable density estimation and modelling of joint probabilities . In this way , it is possible to answer a much richer set of probabilistic queries , i.e . P ( X , C ) , P ( X|C ) and P ( C|X ) . In addition to this , we introduce the arguably more interesting type of NPP that combines a neural module with a PC . Hereby , the neural module learns to map the raw input data into an optimal latent representation , e.g . object-based slot representations . The PC , in turn , learns to model the joint distribution of these latent variables and produces the final probability estimates . This type of NPP nicely combines the representational power of neural networks with the advantages of PCs in probability estimation and query flexibility . For making the different probabilistic queries distinguishable in a SLASH program , we introduce the following notation . We denote a given variable with + and the query variable with − . E.g. , within the running example of set prediction ( cf . Fig . 1 and 2b ) , with the query color_attr ( +X , −C ) one is asking for P ( C|X ) . Similarly , with color_attr ( −X , +C ) one is asking for P ( X|C ) and , finally , with color_attr ( −X , −C ) for P ( X , C ) . To summarize , an NPP can consist of neural and/or probabilistic modules and produces querydependent probability estimates . Due to the flexibility of its definition , the term NPP contains the predicates of previous works ( Manhaeve et al. , 2018 ; Yang et al. , 2020 ) , but also more interesting predicates discussed above . The specific “ flavor ” of an NPP should be chosen depending on what type of probability estimation is required ( cf . Fig 2a ) . Lastly , NPPs have the unified loss function of the negative log-likelihood : LNPP : = − logLH ( x , x̂ ) = n∑ i=1 LH ( xi , x̂i ) = − n∑ i=1 xi · log ( P ( X , C ) ξ ( xi ) ) = − n∑ i=1 log ( P ( X , C ) ξ ) ( 2 ) whereby we are assuming the data to be i.i.d. , ground truth xi to be the all-ones vector , ξ to be the parameters of the NPP and P ( X , C ) ξ are the predictions x̂i obtained from the PC encoded in the NPP . | The paper presents an approach for neuro-symbolic integration that differs from NeurASP because NN can be replaced by probabilistic circuits (PC) or by NN+PC. The resulting system, SLASH, is applied to the problems of MNIST-Addition and set prediction on a variant of the ShapeWorld dataset. The results on MNIST-Addition show that SLASH+NN is faster and more accurate than DeepProbLog and NeurASP. Moreover, when pixels are missing, SLAHS+PC has much better performance than DeepProbLog. On ShapeWorld, SLASH is compared with Slot Attention (Locatello et al 2020) and found to have better avg precision especially in handling novel combinations of attributes that were not seen during training. | SP:303da185234e1d71756541cf35b0ac20cec30453 |
Mistill: Distilling Distributed Network Protocols from Examples | New applications and use-cases in data center networks require the design of Traffic Engineering ( TE ) algorithms that account for application-specific traffic patterns . TE makes forwarding decisions from the global state of the network . Thus , new TE algorithms require the design and implementation of effective information exchange and efficient algorithms to compute forwarding decisions . This is a challenging and labor and time-intensive process . To automate and simplify this process , we propose Mistill . Mistill distills the forwarding behavior of TE policies from exemplary forwarding decisions into a Neural Network . Mistill learns how to process local state to send it over the network , which network devices must exchange state with each other , and how to map the exchanged state into forwarding decisions . We show the abilities of Mistill by learning three exemplary policies and verify their performance in simulations on synthetic and real world traffic patterns . We show that the learned protocols closely implement the desired policies , and generalize to unseen traffic patterns . 1 INTRODUCTION . Data center workloads are diverse and range from client-server applications , machine learning , and web-traffic to high-performance computing applications ( Benson et al . ( 2010 ) ; Roy et al . ( 2015 ) ; Zhang et al . ( 2017 ) ) . Each workload has different requirements towards Traffic Engineering ( TE ) . For example , optimizing the completion time of individual flows is desirable for client-server applications ( Dukkipati & McKeown ( 2006 ) ) , but leads to decreased performance in machine learning workloads ( Chowdhury et al . ( 2014 ) ) . To achieve the best performance , each workload needs a TE scheme that is tailored towards its specific requirements . Indeed , new applications regularly trigger the development of new TE schemes in the networking community ( Katta et al . ( 2016 ) ; Chowdhury et al . ( 2014 ) ; Chen et al . ( 2018 ) ; Benson et al . ( 2011 ) ) . Obtaining a deployable distributed protocol from an initial TE design is challenging . A design includes the specification of update messages , the processing of update messages , and the algorithm to compute the forwarding decisions that result in the desired policy ( Katta et al . ( 2016 ) ) . The design of each component is challenging since the final protocol must meet line-rate , exchange information at ( sub ) millisecond granularity , and cope with limited computational requirements . All steps must be efficient , and the design holistic , requiring the exploitation of patterns in the network and the traffic . For instance , CONGA integrates a substantial part of the calculation for the forwarding decision into the exchange of update messages ( Hsu et al . ( 2020 ) ) . The complexity makes customizing TE schemes hardly feasible for smaller enterprises , potentially resulting in competitive disadvantages . To automate and simplify the translation of a TE policy to a distributed protocol , we propose Mistill . Mistill distills the forwarding behavior of a TE policy from exemplary forwarding decisions into a Neural Network ( NN ) . Mistill learns the encoding of the switch local state in update messages , the exchange of update messages , and the computation of forwarding decisions from update messages with Machine Learning ( ML ) . Mistill removes the need to manually design update messages , information exchange , and the calculation of forwarding decisions . ML allows Mistill to automatically detect helpful patterns in traffic and network and exploit the patterns to learn a protocol . Further , our NN design makes the learned patterns accessible to humans and can thus aid the manual design process . Our main contributions in this work are : 1 ) The design of an ML model that can learn forwarding behavior , makes learned patterns accessible to humans , and has the potential to be deployed on real hardware . 2 ) We show in simulations that Mistill can learn the forwarding behavior of three TE policies and generalizes to previously unseen traffic patterns . 3 ) We analyze the learned messages and their exchange . We find that Mistill can learn distributed protocols that closely implement the desired policy and are robust towards distributional shift in the input . We analyze the learned messages ’ content , and show that the NN learns an information exchange resembling an edge-cover , which can be used to optimize the information exchange of other TE schemes . The document is organized as follows . Sec . 2 describes the application scenarios and the requirements towards ML models . Sec . 3 describes the neural architecture and justifies design choices . Sec . 4 describes experiments and presents results and visualizations of the learned protocols . Sec . 5 discusses related work , and Sec . 6 concludes the paper . 2 APPLICATION SCENARIO . Mistill learns a distributed protocol from examples . Fig . 1 illustrates the process and expected outcome . The first component is a centralized implementation of a TE policy . For example , a packet or flow level simulation using an Integer Linear Program or heuristic algorithm to compute forwarding decisions based on the entire network state . The forwarding decisions specify how a switch forwards traffic to its neighbors , given the current state of the network . Usually , new TE schemes are evaluated in such a setting first to establish their performance and correctness . Here , Mistill hooks in and uses the forwarding decisions to train an ML model , i.e. , a NN . Mistill trains the model offline , i.e. , not on the network devices . The NN learns three aspects : 1 ) how to encode local state in update messages , 2 ) how to exchange the update messages , 3 ) how to map the exchanged state into forwarding decisions . After training , Mistill deploys the NN to switches , e.g. , with P4 ( Siracusano & Bifulco ( 2018 ) ) . All switches in the network have the same NN and use it in inference mode , i.e. , do forward passes only . The NN distinguishes switches through an identifier . During training , the NN learns how to condition the forwarding decisions on the identifiers , thus learning the correct behavior for each switch . To compute forwarding decisions , switches do not need to know the network topology . This work does not try to outperform existing TE strategies in their specific application scenarios . Instead , this work aims to facilitate the automatic generation of novel TE policies , taking direct advantage of switch architectures like Taurus ( Swamy et al . ( 2020 ) ) without asking network operators to take the time or acquire the expertise to design highly optimized protocols and implement them , e.g. , in P4 ( Bosshart et al . ( 2014 ) ) . 2.1 DATA CENTER NETWORK REQUIREMENTS . The goal of Mistill is to distill network protocols for data-center networks from exemplary data . We focus on Clos topologies due to their popularity and simple structure ( Zhang et al . ( 2019 ) ) . See Appendix B for details . TE protocols in data-centers exchange update messages at ( sub- ) millisecond scale ( Katta et al . ( 2016 ) ) . Thus , the updates must be small to keep the resulting overhead low . To effectively utilize the frequent updates , switches must make forwarding decisions frequently , e.g. , for each new flow . Thus , the decision logic should reside in the data-plane ( Alizadeh et al . ( 2014 ) ) . This limits the computational demand the decision logic can express towards the switch . The learned decision logic must thus be computationally efficient to meet the limited computational capacities . 2.2 WHY NEURAL NETWORKS ? . Mistill uses a NN to learn a distributed protocol , which is a good choice for three reasons . 1 ) NNs are general function approximators ( Glorot et al . ( 2011 ) ) . This is important because forwarding decisions can depend on the network state in a non-linear way . For example , minimizing the maximum link utilization results in forwarding decisions that do not depend linearly on the network state . A small change in the utilization can lead to a sudden change in the forwarding decision . 2 ) NNs can be executed with the limited computational resources in the data-plane ( Sanvito et al . ( 2018 ) ; Swamy et al . ( 2020 ) ) . Here , the choice of activation function is important . The ReLU activation requires only a check for negativity ( Glorot et al . ( 2011 ) ) . A NN with ReLU activations uses addition , multiplication and a check for negative values . Further , NNs can be quantized to integer or binary computations ( Gholami et al . ( 2021 ) ) . 3 ) The execution of NNs is easy to parallelize and accelerators for NN inference already exist for network equipment ( Luinaud et al . ( 2020 ) ; Swamy et al . ( 2020 ) ) . In addition , research efforts show that NNs can be executed in the data-plane at line rate already on today ’ s ASICs ( Siracusano & Bifulco ( 2018 ) ) , and on end-hosts with SmartNICs ( Sanvito et al . ( 2018 ) ) . We thus believe that switches will be increasingly capable of executing NNs at line rate . 3 NEURAL ARCHITECTURE . The NN architecture consists of four modules : the Localization Module ( LOCMOD ) , the HNSA Module ( HNSAMOD ) , the Network State Module ( NSMOD ) , and the Forwarding Module ( FWD MOD ) . Fig . 2 shows how the modules interact and represents inputs and outputs with hashes . See Appendix C for sketches of technical realizations of Mistill . Output . The NN has three outputs : the out-port , Hidden Node State Advertisements ( HNSAs ) 1 , i.e. , update messages that inform other network devices about the local state of the sending device , and State Interest ( SI ) , signaling which devices need to exchange information with each other . Input . The NN has four inputs : LinkState , AllNodes , Destination and Location . LinkState is the switch local state , e.g. , the availability and utilization of incident links . The NN transforms the LinkState into HNSAs . Location is the identifier of a switch , Destination the destination of a flow , and AllNodes the identifiers of all switches . The NN uses Location , Destination , and AllNodes to learn how to condition forwarding decisions on a specific switch and destination and which switches ’ HNSAs are needed to make a forwarding decision . Training . The NN is trained end-to-end . Training end-to-end tailors HNSAs and SI to a forwarding policy . The loss function depends on the forwarding objective . We interpret objectives as multi-label classification or as learning of a multinomial distribution . We use : Lmn = − ∑N i=1 p ( xi ) log p ( yi ) as loss function for the multinomial distribution , and Lml = − ∑N i=1 ( p ( xi ) log p ( yi ) + ( 1− p ( xi ) ) log ( 1− p ( yi ) ) ) as loss function for the multi-label classification . N corresponds to the number of outputs , p ( xi ) is the ground truth and p ( yi ) is the prediction of the NN . The loss Lmn can learn distributional targets to split traffic over adjacent nodes . Lml can learn policies that have one or multiple equally good paths . Changes in the network that lead to changes in the forwarding policy require a re-training of the model . For example , new networking hardware , or changes to the physical network topology . As we will show , re-training is short compared to the deployment process of new hardware , and can be integrated into the roll-out process . Inference . After training finishes , the NN is deployed to the switches . The switches use the NN for three tasks : 1 ) to compute HNSAs from their local state , 2 ) to select the HNSAs necessary to calculate the out-port , and 3 ) to calculate the out-port . The switches do not change the weights of the NN . The switch also never execute the full NN . To compute HNSAs , the switch executes the HNSAMOD . To compute the out-port , the switch executes the LOCMOD , NSMOD and FWD MOD , but not the HNSAMOD . The switch uses the HNSAs it received from other nodes instead . | The paper studies the use of ML to design protocols for a data-center application. In particular, a single-server data center, a Fat-Tree topology, and a single policy are assumed. A neural network is training to learn forwarding policies from examples. A modular structure is proposed to minimize complexity. The NN is trained to be adaptive, but the model itself is fixed at the end of training. | SP:bdacf8dd1b45ca65100b9e5b7f97b71e3894029b |
Mistill: Distilling Distributed Network Protocols from Examples | New applications and use-cases in data center networks require the design of Traffic Engineering ( TE ) algorithms that account for application-specific traffic patterns . TE makes forwarding decisions from the global state of the network . Thus , new TE algorithms require the design and implementation of effective information exchange and efficient algorithms to compute forwarding decisions . This is a challenging and labor and time-intensive process . To automate and simplify this process , we propose Mistill . Mistill distills the forwarding behavior of TE policies from exemplary forwarding decisions into a Neural Network . Mistill learns how to process local state to send it over the network , which network devices must exchange state with each other , and how to map the exchanged state into forwarding decisions . We show the abilities of Mistill by learning three exemplary policies and verify their performance in simulations on synthetic and real world traffic patterns . We show that the learned protocols closely implement the desired policies , and generalize to unseen traffic patterns . 1 INTRODUCTION . Data center workloads are diverse and range from client-server applications , machine learning , and web-traffic to high-performance computing applications ( Benson et al . ( 2010 ) ; Roy et al . ( 2015 ) ; Zhang et al . ( 2017 ) ) . Each workload has different requirements towards Traffic Engineering ( TE ) . For example , optimizing the completion time of individual flows is desirable for client-server applications ( Dukkipati & McKeown ( 2006 ) ) , but leads to decreased performance in machine learning workloads ( Chowdhury et al . ( 2014 ) ) . To achieve the best performance , each workload needs a TE scheme that is tailored towards its specific requirements . Indeed , new applications regularly trigger the development of new TE schemes in the networking community ( Katta et al . ( 2016 ) ; Chowdhury et al . ( 2014 ) ; Chen et al . ( 2018 ) ; Benson et al . ( 2011 ) ) . Obtaining a deployable distributed protocol from an initial TE design is challenging . A design includes the specification of update messages , the processing of update messages , and the algorithm to compute the forwarding decisions that result in the desired policy ( Katta et al . ( 2016 ) ) . The design of each component is challenging since the final protocol must meet line-rate , exchange information at ( sub ) millisecond granularity , and cope with limited computational requirements . All steps must be efficient , and the design holistic , requiring the exploitation of patterns in the network and the traffic . For instance , CONGA integrates a substantial part of the calculation for the forwarding decision into the exchange of update messages ( Hsu et al . ( 2020 ) ) . The complexity makes customizing TE schemes hardly feasible for smaller enterprises , potentially resulting in competitive disadvantages . To automate and simplify the translation of a TE policy to a distributed protocol , we propose Mistill . Mistill distills the forwarding behavior of a TE policy from exemplary forwarding decisions into a Neural Network ( NN ) . Mistill learns the encoding of the switch local state in update messages , the exchange of update messages , and the computation of forwarding decisions from update messages with Machine Learning ( ML ) . Mistill removes the need to manually design update messages , information exchange , and the calculation of forwarding decisions . ML allows Mistill to automatically detect helpful patterns in traffic and network and exploit the patterns to learn a protocol . Further , our NN design makes the learned patterns accessible to humans and can thus aid the manual design process . Our main contributions in this work are : 1 ) The design of an ML model that can learn forwarding behavior , makes learned patterns accessible to humans , and has the potential to be deployed on real hardware . 2 ) We show in simulations that Mistill can learn the forwarding behavior of three TE policies and generalizes to previously unseen traffic patterns . 3 ) We analyze the learned messages and their exchange . We find that Mistill can learn distributed protocols that closely implement the desired policy and are robust towards distributional shift in the input . We analyze the learned messages ’ content , and show that the NN learns an information exchange resembling an edge-cover , which can be used to optimize the information exchange of other TE schemes . The document is organized as follows . Sec . 2 describes the application scenarios and the requirements towards ML models . Sec . 3 describes the neural architecture and justifies design choices . Sec . 4 describes experiments and presents results and visualizations of the learned protocols . Sec . 5 discusses related work , and Sec . 6 concludes the paper . 2 APPLICATION SCENARIO . Mistill learns a distributed protocol from examples . Fig . 1 illustrates the process and expected outcome . The first component is a centralized implementation of a TE policy . For example , a packet or flow level simulation using an Integer Linear Program or heuristic algorithm to compute forwarding decisions based on the entire network state . The forwarding decisions specify how a switch forwards traffic to its neighbors , given the current state of the network . Usually , new TE schemes are evaluated in such a setting first to establish their performance and correctness . Here , Mistill hooks in and uses the forwarding decisions to train an ML model , i.e. , a NN . Mistill trains the model offline , i.e. , not on the network devices . The NN learns three aspects : 1 ) how to encode local state in update messages , 2 ) how to exchange the update messages , 3 ) how to map the exchanged state into forwarding decisions . After training , Mistill deploys the NN to switches , e.g. , with P4 ( Siracusano & Bifulco ( 2018 ) ) . All switches in the network have the same NN and use it in inference mode , i.e. , do forward passes only . The NN distinguishes switches through an identifier . During training , the NN learns how to condition the forwarding decisions on the identifiers , thus learning the correct behavior for each switch . To compute forwarding decisions , switches do not need to know the network topology . This work does not try to outperform existing TE strategies in their specific application scenarios . Instead , this work aims to facilitate the automatic generation of novel TE policies , taking direct advantage of switch architectures like Taurus ( Swamy et al . ( 2020 ) ) without asking network operators to take the time or acquire the expertise to design highly optimized protocols and implement them , e.g. , in P4 ( Bosshart et al . ( 2014 ) ) . 2.1 DATA CENTER NETWORK REQUIREMENTS . The goal of Mistill is to distill network protocols for data-center networks from exemplary data . We focus on Clos topologies due to their popularity and simple structure ( Zhang et al . ( 2019 ) ) . See Appendix B for details . TE protocols in data-centers exchange update messages at ( sub- ) millisecond scale ( Katta et al . ( 2016 ) ) . Thus , the updates must be small to keep the resulting overhead low . To effectively utilize the frequent updates , switches must make forwarding decisions frequently , e.g. , for each new flow . Thus , the decision logic should reside in the data-plane ( Alizadeh et al . ( 2014 ) ) . This limits the computational demand the decision logic can express towards the switch . The learned decision logic must thus be computationally efficient to meet the limited computational capacities . 2.2 WHY NEURAL NETWORKS ? . Mistill uses a NN to learn a distributed protocol , which is a good choice for three reasons . 1 ) NNs are general function approximators ( Glorot et al . ( 2011 ) ) . This is important because forwarding decisions can depend on the network state in a non-linear way . For example , minimizing the maximum link utilization results in forwarding decisions that do not depend linearly on the network state . A small change in the utilization can lead to a sudden change in the forwarding decision . 2 ) NNs can be executed with the limited computational resources in the data-plane ( Sanvito et al . ( 2018 ) ; Swamy et al . ( 2020 ) ) . Here , the choice of activation function is important . The ReLU activation requires only a check for negativity ( Glorot et al . ( 2011 ) ) . A NN with ReLU activations uses addition , multiplication and a check for negative values . Further , NNs can be quantized to integer or binary computations ( Gholami et al . ( 2021 ) ) . 3 ) The execution of NNs is easy to parallelize and accelerators for NN inference already exist for network equipment ( Luinaud et al . ( 2020 ) ; Swamy et al . ( 2020 ) ) . In addition , research efforts show that NNs can be executed in the data-plane at line rate already on today ’ s ASICs ( Siracusano & Bifulco ( 2018 ) ) , and on end-hosts with SmartNICs ( Sanvito et al . ( 2018 ) ) . We thus believe that switches will be increasingly capable of executing NNs at line rate . 3 NEURAL ARCHITECTURE . The NN architecture consists of four modules : the Localization Module ( LOCMOD ) , the HNSA Module ( HNSAMOD ) , the Network State Module ( NSMOD ) , and the Forwarding Module ( FWD MOD ) . Fig . 2 shows how the modules interact and represents inputs and outputs with hashes . See Appendix C for sketches of technical realizations of Mistill . Output . The NN has three outputs : the out-port , Hidden Node State Advertisements ( HNSAs ) 1 , i.e. , update messages that inform other network devices about the local state of the sending device , and State Interest ( SI ) , signaling which devices need to exchange information with each other . Input . The NN has four inputs : LinkState , AllNodes , Destination and Location . LinkState is the switch local state , e.g. , the availability and utilization of incident links . The NN transforms the LinkState into HNSAs . Location is the identifier of a switch , Destination the destination of a flow , and AllNodes the identifiers of all switches . The NN uses Location , Destination , and AllNodes to learn how to condition forwarding decisions on a specific switch and destination and which switches ’ HNSAs are needed to make a forwarding decision . Training . The NN is trained end-to-end . Training end-to-end tailors HNSAs and SI to a forwarding policy . The loss function depends on the forwarding objective . We interpret objectives as multi-label classification or as learning of a multinomial distribution . We use : Lmn = − ∑N i=1 p ( xi ) log p ( yi ) as loss function for the multinomial distribution , and Lml = − ∑N i=1 ( p ( xi ) log p ( yi ) + ( 1− p ( xi ) ) log ( 1− p ( yi ) ) ) as loss function for the multi-label classification . N corresponds to the number of outputs , p ( xi ) is the ground truth and p ( yi ) is the prediction of the NN . The loss Lmn can learn distributional targets to split traffic over adjacent nodes . Lml can learn policies that have one or multiple equally good paths . Changes in the network that lead to changes in the forwarding policy require a re-training of the model . For example , new networking hardware , or changes to the physical network topology . As we will show , re-training is short compared to the deployment process of new hardware , and can be integrated into the roll-out process . Inference . After training finishes , the NN is deployed to the switches . The switches use the NN for three tasks : 1 ) to compute HNSAs from their local state , 2 ) to select the HNSAs necessary to calculate the out-port , and 3 ) to calculate the out-port . The switches do not change the weights of the NN . The switch also never execute the full NN . To compute HNSAs , the switch executes the HNSAMOD . To compute the out-port , the switch executes the LOCMOD , NSMOD and FWD MOD , but not the HNSAMOD . The switch uses the HNSAs it received from other nodes instead . | The paper proposes an ML-based approach Mistill to help automatically deploy distributed protocol from a given TE policy. The approach learns forwarding decisions together with intermediate results such as exchange information and LinkState encoding from exemplary policies. The resulting network can later be deployed in switches to encode link-state and compute forwarding decisions. The technical contributions are the following. First, they leverage a reparameterization trick to handle categorical distributions when encoding link states into a binary vector. Second, they use the scaled dot-product attention method to help switches learn to exploit the encodings mentioned above and make the forwarding decision. In the evaluation part, the paper compares with three custom baselines, i.e., LCP, MinMax, WCMP, and exceeds all of them in terms of corresponding metrics. | SP:bdacf8dd1b45ca65100b9e5b7f97b71e3894029b |
Mistill: Distilling Distributed Network Protocols from Examples | New applications and use-cases in data center networks require the design of Traffic Engineering ( TE ) algorithms that account for application-specific traffic patterns . TE makes forwarding decisions from the global state of the network . Thus , new TE algorithms require the design and implementation of effective information exchange and efficient algorithms to compute forwarding decisions . This is a challenging and labor and time-intensive process . To automate and simplify this process , we propose Mistill . Mistill distills the forwarding behavior of TE policies from exemplary forwarding decisions into a Neural Network . Mistill learns how to process local state to send it over the network , which network devices must exchange state with each other , and how to map the exchanged state into forwarding decisions . We show the abilities of Mistill by learning three exemplary policies and verify their performance in simulations on synthetic and real world traffic patterns . We show that the learned protocols closely implement the desired policies , and generalize to unseen traffic patterns . 1 INTRODUCTION . Data center workloads are diverse and range from client-server applications , machine learning , and web-traffic to high-performance computing applications ( Benson et al . ( 2010 ) ; Roy et al . ( 2015 ) ; Zhang et al . ( 2017 ) ) . Each workload has different requirements towards Traffic Engineering ( TE ) . For example , optimizing the completion time of individual flows is desirable for client-server applications ( Dukkipati & McKeown ( 2006 ) ) , but leads to decreased performance in machine learning workloads ( Chowdhury et al . ( 2014 ) ) . To achieve the best performance , each workload needs a TE scheme that is tailored towards its specific requirements . Indeed , new applications regularly trigger the development of new TE schemes in the networking community ( Katta et al . ( 2016 ) ; Chowdhury et al . ( 2014 ) ; Chen et al . ( 2018 ) ; Benson et al . ( 2011 ) ) . Obtaining a deployable distributed protocol from an initial TE design is challenging . A design includes the specification of update messages , the processing of update messages , and the algorithm to compute the forwarding decisions that result in the desired policy ( Katta et al . ( 2016 ) ) . The design of each component is challenging since the final protocol must meet line-rate , exchange information at ( sub ) millisecond granularity , and cope with limited computational requirements . All steps must be efficient , and the design holistic , requiring the exploitation of patterns in the network and the traffic . For instance , CONGA integrates a substantial part of the calculation for the forwarding decision into the exchange of update messages ( Hsu et al . ( 2020 ) ) . The complexity makes customizing TE schemes hardly feasible for smaller enterprises , potentially resulting in competitive disadvantages . To automate and simplify the translation of a TE policy to a distributed protocol , we propose Mistill . Mistill distills the forwarding behavior of a TE policy from exemplary forwarding decisions into a Neural Network ( NN ) . Mistill learns the encoding of the switch local state in update messages , the exchange of update messages , and the computation of forwarding decisions from update messages with Machine Learning ( ML ) . Mistill removes the need to manually design update messages , information exchange , and the calculation of forwarding decisions . ML allows Mistill to automatically detect helpful patterns in traffic and network and exploit the patterns to learn a protocol . Further , our NN design makes the learned patterns accessible to humans and can thus aid the manual design process . Our main contributions in this work are : 1 ) The design of an ML model that can learn forwarding behavior , makes learned patterns accessible to humans , and has the potential to be deployed on real hardware . 2 ) We show in simulations that Mistill can learn the forwarding behavior of three TE policies and generalizes to previously unseen traffic patterns . 3 ) We analyze the learned messages and their exchange . We find that Mistill can learn distributed protocols that closely implement the desired policy and are robust towards distributional shift in the input . We analyze the learned messages ’ content , and show that the NN learns an information exchange resembling an edge-cover , which can be used to optimize the information exchange of other TE schemes . The document is organized as follows . Sec . 2 describes the application scenarios and the requirements towards ML models . Sec . 3 describes the neural architecture and justifies design choices . Sec . 4 describes experiments and presents results and visualizations of the learned protocols . Sec . 5 discusses related work , and Sec . 6 concludes the paper . 2 APPLICATION SCENARIO . Mistill learns a distributed protocol from examples . Fig . 1 illustrates the process and expected outcome . The first component is a centralized implementation of a TE policy . For example , a packet or flow level simulation using an Integer Linear Program or heuristic algorithm to compute forwarding decisions based on the entire network state . The forwarding decisions specify how a switch forwards traffic to its neighbors , given the current state of the network . Usually , new TE schemes are evaluated in such a setting first to establish their performance and correctness . Here , Mistill hooks in and uses the forwarding decisions to train an ML model , i.e. , a NN . Mistill trains the model offline , i.e. , not on the network devices . The NN learns three aspects : 1 ) how to encode local state in update messages , 2 ) how to exchange the update messages , 3 ) how to map the exchanged state into forwarding decisions . After training , Mistill deploys the NN to switches , e.g. , with P4 ( Siracusano & Bifulco ( 2018 ) ) . All switches in the network have the same NN and use it in inference mode , i.e. , do forward passes only . The NN distinguishes switches through an identifier . During training , the NN learns how to condition the forwarding decisions on the identifiers , thus learning the correct behavior for each switch . To compute forwarding decisions , switches do not need to know the network topology . This work does not try to outperform existing TE strategies in their specific application scenarios . Instead , this work aims to facilitate the automatic generation of novel TE policies , taking direct advantage of switch architectures like Taurus ( Swamy et al . ( 2020 ) ) without asking network operators to take the time or acquire the expertise to design highly optimized protocols and implement them , e.g. , in P4 ( Bosshart et al . ( 2014 ) ) . 2.1 DATA CENTER NETWORK REQUIREMENTS . The goal of Mistill is to distill network protocols for data-center networks from exemplary data . We focus on Clos topologies due to their popularity and simple structure ( Zhang et al . ( 2019 ) ) . See Appendix B for details . TE protocols in data-centers exchange update messages at ( sub- ) millisecond scale ( Katta et al . ( 2016 ) ) . Thus , the updates must be small to keep the resulting overhead low . To effectively utilize the frequent updates , switches must make forwarding decisions frequently , e.g. , for each new flow . Thus , the decision logic should reside in the data-plane ( Alizadeh et al . ( 2014 ) ) . This limits the computational demand the decision logic can express towards the switch . The learned decision logic must thus be computationally efficient to meet the limited computational capacities . 2.2 WHY NEURAL NETWORKS ? . Mistill uses a NN to learn a distributed protocol , which is a good choice for three reasons . 1 ) NNs are general function approximators ( Glorot et al . ( 2011 ) ) . This is important because forwarding decisions can depend on the network state in a non-linear way . For example , minimizing the maximum link utilization results in forwarding decisions that do not depend linearly on the network state . A small change in the utilization can lead to a sudden change in the forwarding decision . 2 ) NNs can be executed with the limited computational resources in the data-plane ( Sanvito et al . ( 2018 ) ; Swamy et al . ( 2020 ) ) . Here , the choice of activation function is important . The ReLU activation requires only a check for negativity ( Glorot et al . ( 2011 ) ) . A NN with ReLU activations uses addition , multiplication and a check for negative values . Further , NNs can be quantized to integer or binary computations ( Gholami et al . ( 2021 ) ) . 3 ) The execution of NNs is easy to parallelize and accelerators for NN inference already exist for network equipment ( Luinaud et al . ( 2020 ) ; Swamy et al . ( 2020 ) ) . In addition , research efforts show that NNs can be executed in the data-plane at line rate already on today ’ s ASICs ( Siracusano & Bifulco ( 2018 ) ) , and on end-hosts with SmartNICs ( Sanvito et al . ( 2018 ) ) . We thus believe that switches will be increasingly capable of executing NNs at line rate . 3 NEURAL ARCHITECTURE . The NN architecture consists of four modules : the Localization Module ( LOCMOD ) , the HNSA Module ( HNSAMOD ) , the Network State Module ( NSMOD ) , and the Forwarding Module ( FWD MOD ) . Fig . 2 shows how the modules interact and represents inputs and outputs with hashes . See Appendix C for sketches of technical realizations of Mistill . Output . The NN has three outputs : the out-port , Hidden Node State Advertisements ( HNSAs ) 1 , i.e. , update messages that inform other network devices about the local state of the sending device , and State Interest ( SI ) , signaling which devices need to exchange information with each other . Input . The NN has four inputs : LinkState , AllNodes , Destination and Location . LinkState is the switch local state , e.g. , the availability and utilization of incident links . The NN transforms the LinkState into HNSAs . Location is the identifier of a switch , Destination the destination of a flow , and AllNodes the identifiers of all switches . The NN uses Location , Destination , and AllNodes to learn how to condition forwarding decisions on a specific switch and destination and which switches ’ HNSAs are needed to make a forwarding decision . Training . The NN is trained end-to-end . Training end-to-end tailors HNSAs and SI to a forwarding policy . The loss function depends on the forwarding objective . We interpret objectives as multi-label classification or as learning of a multinomial distribution . We use : Lmn = − ∑N i=1 p ( xi ) log p ( yi ) as loss function for the multinomial distribution , and Lml = − ∑N i=1 ( p ( xi ) log p ( yi ) + ( 1− p ( xi ) ) log ( 1− p ( yi ) ) ) as loss function for the multi-label classification . N corresponds to the number of outputs , p ( xi ) is the ground truth and p ( yi ) is the prediction of the NN . The loss Lmn can learn distributional targets to split traffic over adjacent nodes . Lml can learn policies that have one or multiple equally good paths . Changes in the network that lead to changes in the forwarding policy require a re-training of the model . For example , new networking hardware , or changes to the physical network topology . As we will show , re-training is short compared to the deployment process of new hardware , and can be integrated into the roll-out process . Inference . After training finishes , the NN is deployed to the switches . The switches use the NN for three tasks : 1 ) to compute HNSAs from their local state , 2 ) to select the HNSAs necessary to calculate the out-port , and 3 ) to calculate the out-port . The switches do not change the weights of the NN . The switch also never execute the full NN . To compute HNSAs , the switch executes the HNSAMOD . To compute the out-port , the switch executes the LOCMOD , NSMOD and FWD MOD , but not the HNSAMOD . The switch uses the HNSAs it received from other nodes instead . | This work is targeting the problem of traffic engineering in computer networks. It proposes a learning method called Mistill for making packet forwarding decisions in distributed network switches using data generated by a centralized policy. The paper assumes that a forwarding policy can be obtained in a centralized fashion with global information, and the goal is to train a neural network model that can make the correct forwarding decision in each switch without global states. The network switch can communicate its local state to other switches to improve the overall performance. | SP:bdacf8dd1b45ca65100b9e5b7f97b71e3894029b |
Amortized Tree Generation for Bottom-up Synthesis Planning and Synthesizable Molecular Design | 1 INTRODUCTION . Designing new functional materials , such as energy storage materials ( Hachmann et al. , 2011 ; Janet et al. , 2020 ) , therapeutic molecules ( Zhavoronkov et al. , 2019 ; Lyu et al. , 2019 ) , and environmentally friendly materials ( Zimmerman et al. , 2020 ; Yao et al. , 2021 ) , is key to many societal and technological challenges and is a central task of chemical science and engineering . However , traditional molecular design processes are not only expensive and time-consuming , but also rely heavily on chance and brute-force trial and error ( Sanchez-Lengeling & Aspuru-Guzik , 2018 ) . Thus , a systematic approach to molecular design that can leverage data and minimize the number of costly experiments is of great interest to the field and is a prerequisite for autonomous molecular discovery ( Coley et al. , 2020a ; b ) . The core of computer-aided molecular discovery is molecular design . The objective of the task is to identify novel molecules with desirable properties through de novo generation or to identify known molecules through virtual screening . There has been a growing interest in applying machine learning methods to tackle this task in recent years ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ; You et al. , 2018 ; Bradshaw et al. , 2019 ; 2020 ; Jin et al. , 2020 ; Fu et al. , 2021 ) , which has been the subject of many reviews ( Elton et al. , 2019 ; Schwalbe-Koda & Gómez-Bombarelli , 2020 ; Vanhaelen et al. , 2020 ) . Despite the large number of models developed , there are few examples that have proceeded to experimental validation or been used in a realistic discovery scenario ( Zhavoronkov et al. , 2019 ; Schneider & Clark , 2019 ) . One major barrier to the deployment of these algorithms is that they lack considerations of synthesizability ( Gao & Coley , 2020 ; Huang et al. , 2021 ) ; Gao & Coley ( 2020 ) have demonstrated that when applied to goal-directed optimization tasks , de novo molecular design algorithms can propose a high proportion of molecules for which no synthetic plan can be found algorithmically . Planning and executing a practical synthetic route for a hypothetical molecular structure is a bottleneck that hinders the experimental validation of molecular design algorithms . The goal of computerassisted synthesis planning ( CASP ) is to identify a series of chemically plausible reaction steps beginning from available starting materials to synthesize a target chemical compound . Machine learning methods have been applied to improve CASP model performance ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , and experimental execution has validated significant advances in recent years ( Klucznik et al. , 2018 ; Coley et al. , 2019c ) . However , most current algorithms require tens of seconds or minutes to plan a synthetic route for one target compound due to the combinatorial complexity of the tree search . This cost makes a post hoc filtering strategy impractical in molecular design workflows that decouple de novo design and synthesis planning ( Gao & Coley , 2020 ) . However , synthesizability-constrained generation has emerged as a promising alternative to this two-step pipeline ( Section 2.1 ) . In this paper , we report a strategy to generate synthetic pathways as trees conditioned on a target molecular embedding as a means of simultaneously addressing the problems of design and synthesis . Proposed pathways are guaranteed to make use of purchasable starting materials and are required to follow the “ rules of chemistry ” as codified by expert-curated reaction templates , which can be made more or less conservative depending on the application . When applied to synthesis planning , we ask the model to generate synthetic trees conditioned on the target molecule . When applied to synthesizable molecular design , we optimize the fixed-length embedding vector using a numerical optimization algorithm ; then , we decode the optimized embedding to obtain the corresponding synthetic tree whose root molecule is the output . The idea builds on the work of Bradshaw et al . ( 2019 ) and Bradshaw et al . ( 2020 ) ; however , these methods failed to recover multi-step synthetic paths for any target molecules and were thus only applied to the task of synthesizable analog recommendation . In contrast , the method presented here can successfully recover multi-step retrosynthetic pathways in an amortized manner , in addition to being used for synthesizable analog recommendation . The main contributions of this paper can be summarized as : • We formulate a Markov decision process to model the generation of synthetic trees , allowing the generation of multi-step and convergent ( i.e. , nonlinear ) synthetic pathways . • We propose a model that is capable of ( 1 ) rapid bottom-up synthesis planning and ( 2 ) constrained molecular optimization that can explore a chemical space defined by a discrete action space of reaction templates and purchasable starting materials . • We show the first successful attempt to amortized multi-step synthesis planning of complex organic molecules , achieving relatively high reconstruction accuracy on test molecules . • We demonstrate encouraging results on de novo molecular optimization with multiple objective functions relevant to bioactive molecule design and drug discovery . 2 RELATED WORK . 2.1 SYNTHESIZABLE MOLECULAR DESIGN . While most molecular generative models focus on the generation of valid molecules with desired properties , there is growing interest in the generation of synthesizable molecules , as not all chemically valid molecules are synthetically accessible . MoleculeChef ( Bradshaw et al. , 2019 ) was one of the first neural models to cast the problem of molecular generation as the generation of one-step synthetic pathways , thus ensuring synthesizability , by selecting a bag of purchasable reactants and using a data-driven reaction predictor to enumerate possible product molecules . ChemBO ( Korovina et al. , 2020 ) extends constrained generation to the multi-step case , but is a stochastic algorithm that generates synthetic pathways iteratively using random selections of reactants as input to another data-driven reaction predictor . While MoleculeChef and ChemBO use neural models for reaction outcome prediction as the ground truth for chemical reactivity ( Coley et al. , 2019b ; Schwaller et al. , 2019 ) , reaction templates provide an alternate means of defining allowable chemical steps , algorithmically ( Coley et al. , 2019a ) or by hand-encoding domain expertise ( Molga et al. , 2019 ) . PGFS ( Gottipati et al. , 2020 ) and REACTOR ( Horwood & Noutahi , 2020 ) both use discrete reaction templates and formulate the generation of multi-step synthetic pathways as a Markov decision process and optimize molecules with reinforcement learning . Both are limited to linear synthetic pathways , where intermediates can only react with purchasable compounds and no reaction can occur between two intermediates . Their inability to design convergent syntheses limits the chemical space accessible to the model . It is worth noting that there also exist previously reported methods for non-neural synthesizability-constrained molecular design , such as SYNOPSIS ( Vinkers et al. , 2003 ) and DOGS ( Hartenfeller et al. , 2012 ) , which pre-date deep molecular generation . Most recently , Bradshaw et al . ( 2020 ) introduced the DoG-AE/DoG-Gen model , which treats synthetic pathways as directed acyclic graphs ( DAGs ) . DoG-Gen serializes the construction of the DAGs and uses a recurrent neural network for autoregressive generation . Dai Nguyen & Tsuda ( 2021 ) also employ an autoencoder ( AE ) framework , jointly trained with a junction tree variational autoencoder ( JT-VAE ) ( Jin et al. , 2018 ) . However , none of the previous methods for synthesizable molecular generation have succeeded in achieving high reconstruction accuracy . 2.2 SYNTHESIS PLANNING . Algorithms and models for synthesis planning have been in development since the 1960s when retrosynthesis was first formalized ( Corey & Wipke , 1969 ) . Various data-driven approaches have been introduced in recent years ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , although expert methods with human-encoded “ rules of chemistry ” have arguably achieved greater success in practice ( Klucznik et al. , 2018 ; Mikulak-Klucznik et al. , 2020 ) . The primary distinction between these methods is how allowable single-step chemical transformations are defined to mimic physical reality as closely as possible ; they can all make use of similar tree search algorithms . While these tools can be used to plan routes to target molecules and filter compounds from de novo generation for which no pathway is found , none of them can be directly used for molecular generation . Moreover , they all approach synthesis planning retrosynthetically , working recursively from the target molecule towards purchasable starting materials ( i.e . in a top-down manner ) , whereas we propose a bottom-up approach that has the potential to be more computationally efficient by mitigating the need for a tree search . 2.3 COMBINING SYNTHESIZABLE DESIGN AND SYNTHESIS PLANNING . Our method can be used for synthesizable molecular design and synthesis planning . While our approach is most similar to Bradshaw et al . ( 2020 ) ’ s RetroDoG model , their model was only applied to structural analog generation , and could not demonstrate the successful recovery of target molecules . Bradshaw et al . ( 2019 ) showed some examples of successful recovery , but their formulation restricts the search to single-step synthetic pathways , which severely limits its practical utility for both tasks . In contrast , our model can successfully handle multi-step reactions . 3 METHOD . 3.1 PROBLEM DEFINITION . We model synthetic pathways as tree structures called synthetic trees ( Figure 6A in Appendix A ) . A valid synthetic tree has one root node ( the final product molecule ) linked to purchasable building blocks via feasible reactions according to a list of discrete reaction templates . A reaction template is a pattern defining a structural transformation on molecules that is intended to represent a valid chemical reaction , usually encoded as a SMARTS string ( Figure 6B & C ) . We use a list of reaction templates to define feasible chemical reactions instead of a data-driven reaction predictor so that the practical utility of the model can be improved by refining or expanding this set without changing its architecture . Given a list of reaction templates , R , and a list of purchasable compounds , C , our goal is to generate a valid synthetic tree , T , that produces a root molecule with a desired structure or function . The product molecule and intermediate molecules in the tree are not themselves generated by the model , but are implicitly defined by the application of reaction templates to reactant molecules . Compared to the generation of molecular graphs , the generation of synthetic trees is more difficult because of the additional constraints of enforcing chemical reaction rules and the commercial availability of starting materials . Synthesis Planning This task is to infer the synthetic pathway to a given target molecule . We formulate this problem as generating a synthetic tree , T , such that the product molecule it produces ( molecule at the root node ) , Mproduct , matches the desired target molecule , Mtarget . Synthesizable Molecular Design This task is to optimize a molecular structure with respect to an oracle function , while ensuring the synthetic accessibility of the molecules . We formulate this problem as optimizing the structure of a synthetic tree , T , with respect to the desired properties of the product molecule it produces , Mproduct . | This paper proposes a bottom-up approach to molecular synthesis planning and synthesizable molecular design. The authors cast the synthesis planning problem as a Markov Decision Process with trainable networks for selecting next actions. The output of the approach is a binary tree that documents reaction and the combination of building blocks or previously synthesized reagents that would mix to create a new intermediate or a final molecule. When the approach fails to produce the correct target molecules it typically generates a similar molecule---the authors take advantage of this feature of their approach and optimize their algorithm to design synthesizable molecules with desirable properties. | SP:eb80ac4143cdfa1e935f238dc11c64486d8b4e18 |
Amortized Tree Generation for Bottom-up Synthesis Planning and Synthesizable Molecular Design | 1 INTRODUCTION . Designing new functional materials , such as energy storage materials ( Hachmann et al. , 2011 ; Janet et al. , 2020 ) , therapeutic molecules ( Zhavoronkov et al. , 2019 ; Lyu et al. , 2019 ) , and environmentally friendly materials ( Zimmerman et al. , 2020 ; Yao et al. , 2021 ) , is key to many societal and technological challenges and is a central task of chemical science and engineering . However , traditional molecular design processes are not only expensive and time-consuming , but also rely heavily on chance and brute-force trial and error ( Sanchez-Lengeling & Aspuru-Guzik , 2018 ) . Thus , a systematic approach to molecular design that can leverage data and minimize the number of costly experiments is of great interest to the field and is a prerequisite for autonomous molecular discovery ( Coley et al. , 2020a ; b ) . The core of computer-aided molecular discovery is molecular design . The objective of the task is to identify novel molecules with desirable properties through de novo generation or to identify known molecules through virtual screening . There has been a growing interest in applying machine learning methods to tackle this task in recent years ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ; You et al. , 2018 ; Bradshaw et al. , 2019 ; 2020 ; Jin et al. , 2020 ; Fu et al. , 2021 ) , which has been the subject of many reviews ( Elton et al. , 2019 ; Schwalbe-Koda & Gómez-Bombarelli , 2020 ; Vanhaelen et al. , 2020 ) . Despite the large number of models developed , there are few examples that have proceeded to experimental validation or been used in a realistic discovery scenario ( Zhavoronkov et al. , 2019 ; Schneider & Clark , 2019 ) . One major barrier to the deployment of these algorithms is that they lack considerations of synthesizability ( Gao & Coley , 2020 ; Huang et al. , 2021 ) ; Gao & Coley ( 2020 ) have demonstrated that when applied to goal-directed optimization tasks , de novo molecular design algorithms can propose a high proportion of molecules for which no synthetic plan can be found algorithmically . Planning and executing a practical synthetic route for a hypothetical molecular structure is a bottleneck that hinders the experimental validation of molecular design algorithms . The goal of computerassisted synthesis planning ( CASP ) is to identify a series of chemically plausible reaction steps beginning from available starting materials to synthesize a target chemical compound . Machine learning methods have been applied to improve CASP model performance ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , and experimental execution has validated significant advances in recent years ( Klucznik et al. , 2018 ; Coley et al. , 2019c ) . However , most current algorithms require tens of seconds or minutes to plan a synthetic route for one target compound due to the combinatorial complexity of the tree search . This cost makes a post hoc filtering strategy impractical in molecular design workflows that decouple de novo design and synthesis planning ( Gao & Coley , 2020 ) . However , synthesizability-constrained generation has emerged as a promising alternative to this two-step pipeline ( Section 2.1 ) . In this paper , we report a strategy to generate synthetic pathways as trees conditioned on a target molecular embedding as a means of simultaneously addressing the problems of design and synthesis . Proposed pathways are guaranteed to make use of purchasable starting materials and are required to follow the “ rules of chemistry ” as codified by expert-curated reaction templates , which can be made more or less conservative depending on the application . When applied to synthesis planning , we ask the model to generate synthetic trees conditioned on the target molecule . When applied to synthesizable molecular design , we optimize the fixed-length embedding vector using a numerical optimization algorithm ; then , we decode the optimized embedding to obtain the corresponding synthetic tree whose root molecule is the output . The idea builds on the work of Bradshaw et al . ( 2019 ) and Bradshaw et al . ( 2020 ) ; however , these methods failed to recover multi-step synthetic paths for any target molecules and were thus only applied to the task of synthesizable analog recommendation . In contrast , the method presented here can successfully recover multi-step retrosynthetic pathways in an amortized manner , in addition to being used for synthesizable analog recommendation . The main contributions of this paper can be summarized as : • We formulate a Markov decision process to model the generation of synthetic trees , allowing the generation of multi-step and convergent ( i.e. , nonlinear ) synthetic pathways . • We propose a model that is capable of ( 1 ) rapid bottom-up synthesis planning and ( 2 ) constrained molecular optimization that can explore a chemical space defined by a discrete action space of reaction templates and purchasable starting materials . • We show the first successful attempt to amortized multi-step synthesis planning of complex organic molecules , achieving relatively high reconstruction accuracy on test molecules . • We demonstrate encouraging results on de novo molecular optimization with multiple objective functions relevant to bioactive molecule design and drug discovery . 2 RELATED WORK . 2.1 SYNTHESIZABLE MOLECULAR DESIGN . While most molecular generative models focus on the generation of valid molecules with desired properties , there is growing interest in the generation of synthesizable molecules , as not all chemically valid molecules are synthetically accessible . MoleculeChef ( Bradshaw et al. , 2019 ) was one of the first neural models to cast the problem of molecular generation as the generation of one-step synthetic pathways , thus ensuring synthesizability , by selecting a bag of purchasable reactants and using a data-driven reaction predictor to enumerate possible product molecules . ChemBO ( Korovina et al. , 2020 ) extends constrained generation to the multi-step case , but is a stochastic algorithm that generates synthetic pathways iteratively using random selections of reactants as input to another data-driven reaction predictor . While MoleculeChef and ChemBO use neural models for reaction outcome prediction as the ground truth for chemical reactivity ( Coley et al. , 2019b ; Schwaller et al. , 2019 ) , reaction templates provide an alternate means of defining allowable chemical steps , algorithmically ( Coley et al. , 2019a ) or by hand-encoding domain expertise ( Molga et al. , 2019 ) . PGFS ( Gottipati et al. , 2020 ) and REACTOR ( Horwood & Noutahi , 2020 ) both use discrete reaction templates and formulate the generation of multi-step synthetic pathways as a Markov decision process and optimize molecules with reinforcement learning . Both are limited to linear synthetic pathways , where intermediates can only react with purchasable compounds and no reaction can occur between two intermediates . Their inability to design convergent syntheses limits the chemical space accessible to the model . It is worth noting that there also exist previously reported methods for non-neural synthesizability-constrained molecular design , such as SYNOPSIS ( Vinkers et al. , 2003 ) and DOGS ( Hartenfeller et al. , 2012 ) , which pre-date deep molecular generation . Most recently , Bradshaw et al . ( 2020 ) introduced the DoG-AE/DoG-Gen model , which treats synthetic pathways as directed acyclic graphs ( DAGs ) . DoG-Gen serializes the construction of the DAGs and uses a recurrent neural network for autoregressive generation . Dai Nguyen & Tsuda ( 2021 ) also employ an autoencoder ( AE ) framework , jointly trained with a junction tree variational autoencoder ( JT-VAE ) ( Jin et al. , 2018 ) . However , none of the previous methods for synthesizable molecular generation have succeeded in achieving high reconstruction accuracy . 2.2 SYNTHESIS PLANNING . Algorithms and models for synthesis planning have been in development since the 1960s when retrosynthesis was first formalized ( Corey & Wipke , 1969 ) . Various data-driven approaches have been introduced in recent years ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , although expert methods with human-encoded “ rules of chemistry ” have arguably achieved greater success in practice ( Klucznik et al. , 2018 ; Mikulak-Klucznik et al. , 2020 ) . The primary distinction between these methods is how allowable single-step chemical transformations are defined to mimic physical reality as closely as possible ; they can all make use of similar tree search algorithms . While these tools can be used to plan routes to target molecules and filter compounds from de novo generation for which no pathway is found , none of them can be directly used for molecular generation . Moreover , they all approach synthesis planning retrosynthetically , working recursively from the target molecule towards purchasable starting materials ( i.e . in a top-down manner ) , whereas we propose a bottom-up approach that has the potential to be more computationally efficient by mitigating the need for a tree search . 2.3 COMBINING SYNTHESIZABLE DESIGN AND SYNTHESIS PLANNING . Our method can be used for synthesizable molecular design and synthesis planning . While our approach is most similar to Bradshaw et al . ( 2020 ) ’ s RetroDoG model , their model was only applied to structural analog generation , and could not demonstrate the successful recovery of target molecules . Bradshaw et al . ( 2019 ) showed some examples of successful recovery , but their formulation restricts the search to single-step synthetic pathways , which severely limits its practical utility for both tasks . In contrast , our model can successfully handle multi-step reactions . 3 METHOD . 3.1 PROBLEM DEFINITION . We model synthetic pathways as tree structures called synthetic trees ( Figure 6A in Appendix A ) . A valid synthetic tree has one root node ( the final product molecule ) linked to purchasable building blocks via feasible reactions according to a list of discrete reaction templates . A reaction template is a pattern defining a structural transformation on molecules that is intended to represent a valid chemical reaction , usually encoded as a SMARTS string ( Figure 6B & C ) . We use a list of reaction templates to define feasible chemical reactions instead of a data-driven reaction predictor so that the practical utility of the model can be improved by refining or expanding this set without changing its architecture . Given a list of reaction templates , R , and a list of purchasable compounds , C , our goal is to generate a valid synthetic tree , T , that produces a root molecule with a desired structure or function . The product molecule and intermediate molecules in the tree are not themselves generated by the model , but are implicitly defined by the application of reaction templates to reactant molecules . Compared to the generation of molecular graphs , the generation of synthetic trees is more difficult because of the additional constraints of enforcing chemical reaction rules and the commercial availability of starting materials . Synthesis Planning This task is to infer the synthetic pathway to a given target molecule . We formulate this problem as generating a synthetic tree , T , such that the product molecule it produces ( molecule at the root node ) , Mproduct , matches the desired target molecule , Mtarget . Synthesizable Molecular Design This task is to optimize a molecular structure with respect to an oracle function , while ensuring the synthetic accessibility of the molecules . We formulate this problem as optimizing the structure of a synthetic tree , T , with respect to the desired properties of the product molecule it produces , Mproduct . | This paper aims to construct a synthetic tree in a bottom-up manner to solve both problems of molecular design and synthesis planning simultaneously. The root node represents the final generated molecule, and the leaf nodes represent the reactants that can be purchased. Starting from the bottom leaf nodes, the authors utilize reaction templates to generate the parent node until the root node is reached. To design molecules with desired properties, the authors utilize the genetic algorithm to guide the tree generation. | SP:eb80ac4143cdfa1e935f238dc11c64486d8b4e18 |
Amortized Tree Generation for Bottom-up Synthesis Planning and Synthesizable Molecular Design | 1 INTRODUCTION . Designing new functional materials , such as energy storage materials ( Hachmann et al. , 2011 ; Janet et al. , 2020 ) , therapeutic molecules ( Zhavoronkov et al. , 2019 ; Lyu et al. , 2019 ) , and environmentally friendly materials ( Zimmerman et al. , 2020 ; Yao et al. , 2021 ) , is key to many societal and technological challenges and is a central task of chemical science and engineering . However , traditional molecular design processes are not only expensive and time-consuming , but also rely heavily on chance and brute-force trial and error ( Sanchez-Lengeling & Aspuru-Guzik , 2018 ) . Thus , a systematic approach to molecular design that can leverage data and minimize the number of costly experiments is of great interest to the field and is a prerequisite for autonomous molecular discovery ( Coley et al. , 2020a ; b ) . The core of computer-aided molecular discovery is molecular design . The objective of the task is to identify novel molecules with desirable properties through de novo generation or to identify known molecules through virtual screening . There has been a growing interest in applying machine learning methods to tackle this task in recent years ( Gómez-Bombarelli et al. , 2018 ; Jin et al. , 2018 ; You et al. , 2018 ; Bradshaw et al. , 2019 ; 2020 ; Jin et al. , 2020 ; Fu et al. , 2021 ) , which has been the subject of many reviews ( Elton et al. , 2019 ; Schwalbe-Koda & Gómez-Bombarelli , 2020 ; Vanhaelen et al. , 2020 ) . Despite the large number of models developed , there are few examples that have proceeded to experimental validation or been used in a realistic discovery scenario ( Zhavoronkov et al. , 2019 ; Schneider & Clark , 2019 ) . One major barrier to the deployment of these algorithms is that they lack considerations of synthesizability ( Gao & Coley , 2020 ; Huang et al. , 2021 ) ; Gao & Coley ( 2020 ) have demonstrated that when applied to goal-directed optimization tasks , de novo molecular design algorithms can propose a high proportion of molecules for which no synthetic plan can be found algorithmically . Planning and executing a practical synthetic route for a hypothetical molecular structure is a bottleneck that hinders the experimental validation of molecular design algorithms . The goal of computerassisted synthesis planning ( CASP ) is to identify a series of chemically plausible reaction steps beginning from available starting materials to synthesize a target chemical compound . Machine learning methods have been applied to improve CASP model performance ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , and experimental execution has validated significant advances in recent years ( Klucznik et al. , 2018 ; Coley et al. , 2019c ) . However , most current algorithms require tens of seconds or minutes to plan a synthetic route for one target compound due to the combinatorial complexity of the tree search . This cost makes a post hoc filtering strategy impractical in molecular design workflows that decouple de novo design and synthesis planning ( Gao & Coley , 2020 ) . However , synthesizability-constrained generation has emerged as a promising alternative to this two-step pipeline ( Section 2.1 ) . In this paper , we report a strategy to generate synthetic pathways as trees conditioned on a target molecular embedding as a means of simultaneously addressing the problems of design and synthesis . Proposed pathways are guaranteed to make use of purchasable starting materials and are required to follow the “ rules of chemistry ” as codified by expert-curated reaction templates , which can be made more or less conservative depending on the application . When applied to synthesis planning , we ask the model to generate synthetic trees conditioned on the target molecule . When applied to synthesizable molecular design , we optimize the fixed-length embedding vector using a numerical optimization algorithm ; then , we decode the optimized embedding to obtain the corresponding synthetic tree whose root molecule is the output . The idea builds on the work of Bradshaw et al . ( 2019 ) and Bradshaw et al . ( 2020 ) ; however , these methods failed to recover multi-step synthetic paths for any target molecules and were thus only applied to the task of synthesizable analog recommendation . In contrast , the method presented here can successfully recover multi-step retrosynthetic pathways in an amortized manner , in addition to being used for synthesizable analog recommendation . The main contributions of this paper can be summarized as : • We formulate a Markov decision process to model the generation of synthetic trees , allowing the generation of multi-step and convergent ( i.e. , nonlinear ) synthetic pathways . • We propose a model that is capable of ( 1 ) rapid bottom-up synthesis planning and ( 2 ) constrained molecular optimization that can explore a chemical space defined by a discrete action space of reaction templates and purchasable starting materials . • We show the first successful attempt to amortized multi-step synthesis planning of complex organic molecules , achieving relatively high reconstruction accuracy on test molecules . • We demonstrate encouraging results on de novo molecular optimization with multiple objective functions relevant to bioactive molecule design and drug discovery . 2 RELATED WORK . 2.1 SYNTHESIZABLE MOLECULAR DESIGN . While most molecular generative models focus on the generation of valid molecules with desired properties , there is growing interest in the generation of synthesizable molecules , as not all chemically valid molecules are synthetically accessible . MoleculeChef ( Bradshaw et al. , 2019 ) was one of the first neural models to cast the problem of molecular generation as the generation of one-step synthetic pathways , thus ensuring synthesizability , by selecting a bag of purchasable reactants and using a data-driven reaction predictor to enumerate possible product molecules . ChemBO ( Korovina et al. , 2020 ) extends constrained generation to the multi-step case , but is a stochastic algorithm that generates synthetic pathways iteratively using random selections of reactants as input to another data-driven reaction predictor . While MoleculeChef and ChemBO use neural models for reaction outcome prediction as the ground truth for chemical reactivity ( Coley et al. , 2019b ; Schwaller et al. , 2019 ) , reaction templates provide an alternate means of defining allowable chemical steps , algorithmically ( Coley et al. , 2019a ) or by hand-encoding domain expertise ( Molga et al. , 2019 ) . PGFS ( Gottipati et al. , 2020 ) and REACTOR ( Horwood & Noutahi , 2020 ) both use discrete reaction templates and formulate the generation of multi-step synthetic pathways as a Markov decision process and optimize molecules with reinforcement learning . Both are limited to linear synthetic pathways , where intermediates can only react with purchasable compounds and no reaction can occur between two intermediates . Their inability to design convergent syntheses limits the chemical space accessible to the model . It is worth noting that there also exist previously reported methods for non-neural synthesizability-constrained molecular design , such as SYNOPSIS ( Vinkers et al. , 2003 ) and DOGS ( Hartenfeller et al. , 2012 ) , which pre-date deep molecular generation . Most recently , Bradshaw et al . ( 2020 ) introduced the DoG-AE/DoG-Gen model , which treats synthetic pathways as directed acyclic graphs ( DAGs ) . DoG-Gen serializes the construction of the DAGs and uses a recurrent neural network for autoregressive generation . Dai Nguyen & Tsuda ( 2021 ) also employ an autoencoder ( AE ) framework , jointly trained with a junction tree variational autoencoder ( JT-VAE ) ( Jin et al. , 2018 ) . However , none of the previous methods for synthesizable molecular generation have succeeded in achieving high reconstruction accuracy . 2.2 SYNTHESIS PLANNING . Algorithms and models for synthesis planning have been in development since the 1960s when retrosynthesis was first formalized ( Corey & Wipke , 1969 ) . Various data-driven approaches have been introduced in recent years ( Segler et al. , 2018 ; Coley et al. , 2018 ; 2019b ; Schwaller et al. , 2020 ; Genheden et al. , 2020 ) , although expert methods with human-encoded “ rules of chemistry ” have arguably achieved greater success in practice ( Klucznik et al. , 2018 ; Mikulak-Klucznik et al. , 2020 ) . The primary distinction between these methods is how allowable single-step chemical transformations are defined to mimic physical reality as closely as possible ; they can all make use of similar tree search algorithms . While these tools can be used to plan routes to target molecules and filter compounds from de novo generation for which no pathway is found , none of them can be directly used for molecular generation . Moreover , they all approach synthesis planning retrosynthetically , working recursively from the target molecule towards purchasable starting materials ( i.e . in a top-down manner ) , whereas we propose a bottom-up approach that has the potential to be more computationally efficient by mitigating the need for a tree search . 2.3 COMBINING SYNTHESIZABLE DESIGN AND SYNTHESIS PLANNING . Our method can be used for synthesizable molecular design and synthesis planning . While our approach is most similar to Bradshaw et al . ( 2020 ) ’ s RetroDoG model , their model was only applied to structural analog generation , and could not demonstrate the successful recovery of target molecules . Bradshaw et al . ( 2019 ) showed some examples of successful recovery , but their formulation restricts the search to single-step synthetic pathways , which severely limits its practical utility for both tasks . In contrast , our model can successfully handle multi-step reactions . 3 METHOD . 3.1 PROBLEM DEFINITION . We model synthetic pathways as tree structures called synthetic trees ( Figure 6A in Appendix A ) . A valid synthetic tree has one root node ( the final product molecule ) linked to purchasable building blocks via feasible reactions according to a list of discrete reaction templates . A reaction template is a pattern defining a structural transformation on molecules that is intended to represent a valid chemical reaction , usually encoded as a SMARTS string ( Figure 6B & C ) . We use a list of reaction templates to define feasible chemical reactions instead of a data-driven reaction predictor so that the practical utility of the model can be improved by refining or expanding this set without changing its architecture . Given a list of reaction templates , R , and a list of purchasable compounds , C , our goal is to generate a valid synthetic tree , T , that produces a root molecule with a desired structure or function . The product molecule and intermediate molecules in the tree are not themselves generated by the model , but are implicitly defined by the application of reaction templates to reactant molecules . Compared to the generation of molecular graphs , the generation of synthetic trees is more difficult because of the additional constraints of enforcing chemical reaction rules and the commercial availability of starting materials . Synthesis Planning This task is to infer the synthetic pathway to a given target molecule . We formulate this problem as generating a synthetic tree , T , such that the product molecule it produces ( molecule at the root node ) , Mproduct , matches the desired target molecule , Mtarget . Synthesizable Molecular Design This task is to optimize a molecular structure with respect to an oracle function , while ensuring the synthetic accessibility of the molecules . We formulate this problem as optimizing the structure of a synthetic tree , T , with respect to the desired properties of the product molecule it produces , Mproduct . | The present paper is concerned about a forward-synthesis approach to molecular optimization. The proposed method defines one action to halt the procedure and three actions to develop a synthetic pathway, each of which corresponds to using zero/one/two of the intermediate molecules for chemical reaction to yield the next intermediate molecule. This generation model is controlled by an agent that chooses a series of actions to transit to the next state, given an embedding vector. If applied to synthesis planning, the embedding of the target molecule is used as the embedding vector, while if applied to molecular optimization, the embedding vector is optimized by a genetic algorithm. The effectiveness of the proposed method is demonstrated by two experiments. The first one examines the ability of synthesis planning using reachable and unreachable data sets. The second one examines the ability of molecular optimization. For both of the experiments, both quantitative and qualitative analyses are provided. | SP:eb80ac4143cdfa1e935f238dc11c64486d8b4e18 |
Understanding the Generalization of Adam in Learning Neural Networks with Proper Regularization | 1 INTRODUCTION . Adaptive gradient methods ( Duchi et al. , 2011 ; Hinton et al. , 2012 ; Kingma & Ba , 2015 ; Reddi et al. , 2018 ) such as Adam are very popular optimizers for training deep neural networks . By adjusting the learning ratethis coordinate-wisely based on historical gradient information , they are known to be able to automatically choose appropriate learning rates to achieve fast convergence in training . Because of this advantage , Adam and its variants are widely used in deep learning . Despite their fast convergence , adaptive gradient methods have been observed to achieve worse generalization performance compared with gradient descent and stochastic gradient descent ( SGD ) ( Wilson et al. , 2017 ; Luo et al. , 2019 ; Chen et al. , 2020 ; Zhou et al. , 2020 ) in many deep learning tasks such as image classification ( we have done some simple deep learning experiments to justify this , the results are reported in Table 1 ) . Even with proper regularization , achieving good test error with adaptive gradient methods seems to be challenging . Several recent works provided theoretical explanations of this generalization gap between Adam and GD . Wilson et al . ( 2017 ) ; Agarwal et al . ( 2019 ) considered a setting of linear regression , and showed that Adam can fail when learning an overparameterized linear model on certain specifically designed data , while SGD can learn the linear model to achieve zero test error . This ex- ample in linear regression offers valuable insights into the difference between SGD and Adam . However , it is under a convex optimization setting , and as we will show in this paper ( Theorem 4.2 ) , the performance difference between Adam and GD can be easily avoided by adding an arbitrarily small regularization term , because the regularized training loss function is strongly convex and all algorithms will converge to the same unique global optimum . For this reason , we argue that the example in the convex setting can not capture the fundamental differences between GD and Adam . More recently , Zhou et al . ( 2020 ) studied the expected escaping time of Adam and SGD from a local basin , and utilized this to explain the difference between SGD and Adam . However , their results do not take NN architecture into consideration , and do not provide an analysis of test errors either . In this paper , we aim at answering the following question Why is there a generalization gap between Adam and gradient descent in learning neural networks , even with proper regularization ? Specifically , we study Adam and GD for training neural networks with weight decay regularization on an image-like data model , and demonstrate the difference between Adam and GD from a feature learning perspective . We consider a model where the data are generated as a combination of feature and noise patches under certain sparsity conditions , and analyze the convergence and generalization of Adam and GD for training a two-layer convolutional neural network ( CNN ) . The contributions of this paper are summarized as follows . • We establish global convergence guarantees for Adam and GD with proper weight decay regularization . We show that , starting at the same random initialization , Adam and GD can both train a two-layer convolutional neural network to achieve zero training error after polynomially many iterations , despite the nonconvex optimization landscape . • We further show that GD and Adam in fact converge to different global solutions with different generalization performance : GD can achieve nearly zero test error , while the generalization performance of the model found by Adam is no better than a random guess . In particular , we show that the reason for this gap is due to the different training behaviors of Adam and GD : Adam is more likely to fit noises in the data and output a model that is largely contributed by the noise patches of the training data ; GD prefers to fit training data based on their feature patch and finds a solution that is mainly composed by the true features . We also illustrate such different training processes in Figure 1 , where it can be seen that the model trained by Adam is clearly more “ noisy ” than that trained by SGD . • We also show that for convex settings with weight decay regularization , both Adam and gradient descent converge to the exact same solution and therefore have no test error difference . This suggests that the difference between Adam and GD can not be fully explained by linear models or neural networks trained in the “ almost convex ” neural tangent kernel ( NTK ) regime Jacot et al . ( 2018 ) ; Allen-Zhu et al . ( 2019b ) ; Du et al . ( 2019a ) ; Zou et al . ( 2019 ) ; Allen-Zhu et al . ( 2019a ) ; Arora et al . ( 2019a ; b ) ; Cao & Gu ( 2019 ) ; Ji & Telgarsky ( 2020 ) ; Chen et al . ( 2021 ) . It also demonstrates that the inferior generalization performance of Adam is fundamentally tied to the nonconvex landscape of deep learning optimization , and can not be solved by adding regularization . Notation . For a scalar x , we use [ x ] + to denote max { x , 0 } . For a vector v = ( v1 , . . . , vd ) > , we denote by ‖v‖2 : = ( ∑d j=1 v 2 j ) 1/2 its ` 2-norm , and use supp ( v ) : = { j : vj 6= 0 } to denote its support . 2 RELATED WORK . In this section , we discuss the works that are mostly related to our paper . Generalization gap between Adam and ( stochastic ) gradient descent . The worse generalization of Adam compared with SGD has also been observed by some recent works and has motivated new variants of neural network training algorithms . Keskar & Socher ( 2017 ) proposed to switch between Adam and SGD to achieve better generalization . Merity et al . ( 2018 ) proposed a variant of the averaged stochastic gradient method to achieve good generalization performance for LSTM language models . Luo et al . ( 2019 ) proposed to use dynamic bounds on learning rates to achieve a smooth transition from adaptive methods to SGD to improve generalization . Our theoretical results for GD and Adam can also provide theoretical insights into the effectiveness of these empirical studies . Optimization and generalization guarantees in deep learning . Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks . A series of results have shown the convergence ( Jacot et al. , 2018 ; Li & Liang , 2018 ; Du et al. , 2019b ; Allen-Zhu et al. , 2019b ; Du et al. , 2019a ; Zou et al. , 2019 ) and generalization ( Allen-Zhu et al. , 2019c ; a ; Arora et al. , 2019a ; b ; Cao & Gu , 2019 ; Ji & Telgarsky , 2020 ; Chen et al. , 2021 ) guarantees in the so-called “ neural tangent kernel ” ( NTK ) regime , where the neural network function is approximately linear in its parameters . Allen-Zhu & Li ( 2019 ) ; Bai & Lee ( 2019 ) ; Allen-Zhu & Li ( 2020a ) ; Li et al . ( 2020 ) studied the learning of neural networks beyond the NTK regime . Our analysis in this paper is also beyond NTK , and gives a detailed comparison between GD and Adam . Feature learning by neural networks . This paper is also closely related to several recent works that studied how neural networks can learn features . Allen-Zhu & Li ( 2020b ) showed that adversarial training purifies the learned features by removing certain “ dense mixtures ” in the hidden layer weights of the network . Allen-Zhu & Li ( 2020c ) studied how ensemble and knowledge distillation work in deep learning when the data have “ multi-view ” features . This paper studies a different aspect of feature learning by Adam and GD , and shows that GD can learn the features while Adam may fail even with proper regularization . 3 PROBLEM SETUP AND PRELIMINARIES . We consider learning a CNN with Adam and GD based on n independent training examples { ( xi , yi ) } ni=1 generated from a data model D. In the following . we first introduce our data model D , and then explain our neural network model and the details of the training algorithms . Data model . We consider a data model where the data inputs consist of feature and noise patches . Such a data model is motivated by image classification problems where the label of an image usually only depends on part of an image , and the other parts of the image showing random objects , or features that belong to other classes , can be considered as noises . When using CNN to fit the data , the convolution operation is applied to each patch of the data input separately . We claim that our data model is more practical than those considered in Wilson et al . ( 2017 ) ; Reddi et al . ( 2018 ) , which are handcrafted for showing the failure of Adam in term of either convergence or generalization . For simplicity , we only consider the case where the data consists of one feature patch and one noise patch . However , our result can be easily extended to cover the setting where there are multiple feature/noise patches . The detailed definition of our data model is given in Definition 3.1 as follows . Definition 3.1 . Let d = Ω ( n4 ) , each data ( x , y ) with x ∈ R2d and y ∈ { −1 , 1 } is generated as follows , x = [ x > 1 , x > 2 ] > , where one of x1 and x2 denotes the feature patch that consists of a feature vector y · v , which is assumed to be 1-sparse , and the other one denotes the noise patch and consists of a noise vector ξ . Without loss of generality , we assume v = [ 1 , 0 , . . . , 0 ] > . The noise vector ξ is generated according to the following process : 1 . Randomly select s coordinates from [ d ] \ { 1 } with equal probabilities , which is denoted as a vector s ∈ { 0 , 1 } d. 2 . Generate ξ from distributionN ( 0 , σ2pI ) , and then mask off the first coordinate and other d− s− 1 coordinates , i.e. , ξ = ξ s. 3 . Add feature noise to ξ , i.e. , ξ = ξ − αyv , where 0 < α < 1 is the strength of the feature noise . In particular , throughout this paper we set s = Θ ( d1/2 n2 ) , σ2p = Θ ( 1 s·polylog ( n ) ) and α = Θ ( σp · polylog ( n ) ) . The most natural way to think of our data model is to treat x as the output of some intermediate layer of a CNN . In literature , Papyan et al . ( 2017 ) pointed out that the outputs of an intermediate layer of a CNN are usually sparse . Yang ( 2019 ) also discussed the setting where the hidden nodes in such an intermediate layer are sampled independently . This motivates us to study sparse features and entry-wisely independent noises in our model . In this paper , we focus on the case where the feature vector v is 1-sparse and the noise vector is s-sparse for simplicity . However , these sparsity assumptions can be generalized to the settings where the feature and the noises are denser . Moreover , we would like to clarify that the data distribution considered in our paper is an extreme case where we assume there is only one feature vector and all data has a feature noise , since we believe this is the simplest model that captures the fundamental difference between Adam and SGD . With this data model , we aim to show why Adam and SGD perform differently . Our theoretical results and analysis techniques can also be extended to more practical settings where there are multiple feature vectors and multiple patches , each data can either contain a single feature or multiple features , together with pure random noise or feature noise . Two-layer CNN model . We consider a two-layer CNN model F using truncated polynomial activation function σ ( z ) = ( max { 0 , z } ) q and fixed the weights of second layer to be all 1 ’ s , where q ≥ 3 . Mathematically , given the data ( x , y ) , the j-th output of the CNN can be formulated as Fj ( W , x ) = m∑ r=1 [ σ ( 〈wj , r , x1〉 ) + σ ( 〈wj , r , x2〉 ) ] = m∑ r=1 [ σ ( 〈wj , r , y · v〉 ) + σ ( 〈wj , r , ξ〉 ) ] , ( 3.1 ) where m is the width of the network , wj , r ∈ Rd denotes the weight at the r-th neuron , and W is the collection of model weights . Here the use of the polynomial ReLU activation function is for simplifying our analysis . It can be replaced by a smoothed ReLU activation function ( e.g. , the activation function used in Allen-Zhu & Li ( 2020c ) ) . If we assume the input data distribution is Gaussian , we can also deal with ReLU activation function ( Li et al. , 2020 ) . Moreover , we would like to emphasize that x1 and x2 denote two data patches , which are randomly assigned with feature vector or noise vector independently for each data point . The leaner has no knowledge about which one is the feature patch ( or noise patch ) . In this paper we assume the width of the network is polylogarithmic in the training sample size , i.e. , m = polylog ( n ) . We assume j ∈ { −1 , 1 } in order to make the logit index be consistent with the data label . Moreover , we assume that the each weight is initialized from a random draw of Gaussian random variable ∼ N ( 0 , σ20 ) with σ0 = Θ ( d−1/4 ) . Training objective . Given the training data { ( xi , yi ) } i=1 , ... , n , we consider to learn the model parameter W by optimizing the empirical loss function with weight decay regularization L ( W ) = 1 n n∑ i=1 Li ( W ) + λ 2 ‖W‖2F , ( 3.2 ) where Li ( W ) = − log e Fyi ( W , xi ) ∑ j∈ { −1,1 } e Fj ( W , xi ) denotes the individual loss for the data ( xi , yi ) and λ ≥ 0 is the regularization parameter . In particular , the regularization parameter can be arbitrary as long as it satisfies λ ∈ ( 0 , λ0 ) with λ0 = Θ ( 1 d ( q−1 ) /4n·polylog ( n ) ) . We claim that the λ0 is the largest feasible regularization parameter that the training process will not stuck at the origin point ( recall that L ( W ) admits zero gradient at W = 0 . ) Training algorithms . In this paper , we consider gradient descent and Adam with full gradient . In particular , starting from initialization W ( 0 ) = { w ( 0 ) j , r , j = { ±1 } , r ∈ [ m ] } , the gradient descent update rule is w ( t+1 ) j , r = w ( t ) j , r − η · ∇wj , rL ( W ( t ) ) , where η is the learning rate . Meanwhile , Adam store historical gradient information in the momentum m ( t ) and a vector v ( t ) as follows m ( t+1 ) j , r = β1m ( t ) j , r + ( 1− β1 ) · ∇wj , rL ( W ( t ) ) , ( 3.3 ) v ( t+1 ) j , r = β2v ( t ) j , r + ( 1− β2 ) · [ ∇wj , rL ( W ( t ) ) ] 2 , ( 3.4 ) and entry-wisely adjusts the learning rate : w ( t+1 ) j , r = w ( t ) j , r − η ·m ( t ) j , r/ √ v ( t ) j , r , ( 3.5 ) where β1 , β2 are the hyperparameters of Adam ( a popular choice in practice is β1 = 0.9 , and β2 = 0.99 ) , and in ( 3.4 ) and ( 3.5 ) , the square ( · ) 2 , square root √ · , and division ·/· all denote entrywise calculations . We do not consider the initialization bias correction in the original Adam paper ( Kingma & Ba , 2015 ) for the ease of analysis . | This paper propose a non convex optimization problem where the batch version of Adam has worse generalization than GD. Both methods achieve 0 training loss asymptotically but GD has a zero loss on the test set, while Adam has a large loss. The paper studies a simplified CNN model with only two patches. The two layers are multiplied with the same weight matrix, fed into the activation function and then summed. A cross entropy loss is used for the classification. The activation function must be of the form $\max(0, x^q)$ for $q \geq 3$. Note that the second layer weights are not learnable and fixed to 1. The dataset is built as follow: the label is y in {-1, 1}. One of the patch is just $x_1 = [y, 0, 0, ...]$. The second patch is $x_2 = [-\alpha y, \text{sparse gaussian noise}]$ ($0 <\alpha < 1$). The sparsity level is so high that no two examples have the same features. The idea is that Adam will use a much larger effective learning rate for the sparse noise features than SGD, and grow the coordinates quickly. At some point the dot product with the noise in $x_2$ will be larger than the dot product with $x_1$. Because the activation function is of the form $x^q$ with $q \geq3$, this means the gradient from $x_2$ will overtake the one from $x_1$ and the weight for the first dimension will be negative (while a positive weight is the best thing to classify from $x_1$). So Adam will focus on the weaker signal from $x_2$ (remember $\alpha < 1$). To summarize further, one patch has the right answer, the second path has the right answer (but with opposite sign) + noise. Adam will focus on the second patch which has lower signal, while GD will focus on the first patch and ignore the noise. The authors provide experimental verification of this fact. | SP:167245edd1f27c86e6f8f9fa6edeaebdedb9307a |
Understanding the Generalization of Adam in Learning Neural Networks with Proper Regularization | 1 INTRODUCTION . Adaptive gradient methods ( Duchi et al. , 2011 ; Hinton et al. , 2012 ; Kingma & Ba , 2015 ; Reddi et al. , 2018 ) such as Adam are very popular optimizers for training deep neural networks . By adjusting the learning ratethis coordinate-wisely based on historical gradient information , they are known to be able to automatically choose appropriate learning rates to achieve fast convergence in training . Because of this advantage , Adam and its variants are widely used in deep learning . Despite their fast convergence , adaptive gradient methods have been observed to achieve worse generalization performance compared with gradient descent and stochastic gradient descent ( SGD ) ( Wilson et al. , 2017 ; Luo et al. , 2019 ; Chen et al. , 2020 ; Zhou et al. , 2020 ) in many deep learning tasks such as image classification ( we have done some simple deep learning experiments to justify this , the results are reported in Table 1 ) . Even with proper regularization , achieving good test error with adaptive gradient methods seems to be challenging . Several recent works provided theoretical explanations of this generalization gap between Adam and GD . Wilson et al . ( 2017 ) ; Agarwal et al . ( 2019 ) considered a setting of linear regression , and showed that Adam can fail when learning an overparameterized linear model on certain specifically designed data , while SGD can learn the linear model to achieve zero test error . This ex- ample in linear regression offers valuable insights into the difference between SGD and Adam . However , it is under a convex optimization setting , and as we will show in this paper ( Theorem 4.2 ) , the performance difference between Adam and GD can be easily avoided by adding an arbitrarily small regularization term , because the regularized training loss function is strongly convex and all algorithms will converge to the same unique global optimum . For this reason , we argue that the example in the convex setting can not capture the fundamental differences between GD and Adam . More recently , Zhou et al . ( 2020 ) studied the expected escaping time of Adam and SGD from a local basin , and utilized this to explain the difference between SGD and Adam . However , their results do not take NN architecture into consideration , and do not provide an analysis of test errors either . In this paper , we aim at answering the following question Why is there a generalization gap between Adam and gradient descent in learning neural networks , even with proper regularization ? Specifically , we study Adam and GD for training neural networks with weight decay regularization on an image-like data model , and demonstrate the difference between Adam and GD from a feature learning perspective . We consider a model where the data are generated as a combination of feature and noise patches under certain sparsity conditions , and analyze the convergence and generalization of Adam and GD for training a two-layer convolutional neural network ( CNN ) . The contributions of this paper are summarized as follows . • We establish global convergence guarantees for Adam and GD with proper weight decay regularization . We show that , starting at the same random initialization , Adam and GD can both train a two-layer convolutional neural network to achieve zero training error after polynomially many iterations , despite the nonconvex optimization landscape . • We further show that GD and Adam in fact converge to different global solutions with different generalization performance : GD can achieve nearly zero test error , while the generalization performance of the model found by Adam is no better than a random guess . In particular , we show that the reason for this gap is due to the different training behaviors of Adam and GD : Adam is more likely to fit noises in the data and output a model that is largely contributed by the noise patches of the training data ; GD prefers to fit training data based on their feature patch and finds a solution that is mainly composed by the true features . We also illustrate such different training processes in Figure 1 , where it can be seen that the model trained by Adam is clearly more “ noisy ” than that trained by SGD . • We also show that for convex settings with weight decay regularization , both Adam and gradient descent converge to the exact same solution and therefore have no test error difference . This suggests that the difference between Adam and GD can not be fully explained by linear models or neural networks trained in the “ almost convex ” neural tangent kernel ( NTK ) regime Jacot et al . ( 2018 ) ; Allen-Zhu et al . ( 2019b ) ; Du et al . ( 2019a ) ; Zou et al . ( 2019 ) ; Allen-Zhu et al . ( 2019a ) ; Arora et al . ( 2019a ; b ) ; Cao & Gu ( 2019 ) ; Ji & Telgarsky ( 2020 ) ; Chen et al . ( 2021 ) . It also demonstrates that the inferior generalization performance of Adam is fundamentally tied to the nonconvex landscape of deep learning optimization , and can not be solved by adding regularization . Notation . For a scalar x , we use [ x ] + to denote max { x , 0 } . For a vector v = ( v1 , . . . , vd ) > , we denote by ‖v‖2 : = ( ∑d j=1 v 2 j ) 1/2 its ` 2-norm , and use supp ( v ) : = { j : vj 6= 0 } to denote its support . 2 RELATED WORK . In this section , we discuss the works that are mostly related to our paper . Generalization gap between Adam and ( stochastic ) gradient descent . The worse generalization of Adam compared with SGD has also been observed by some recent works and has motivated new variants of neural network training algorithms . Keskar & Socher ( 2017 ) proposed to switch between Adam and SGD to achieve better generalization . Merity et al . ( 2018 ) proposed a variant of the averaged stochastic gradient method to achieve good generalization performance for LSTM language models . Luo et al . ( 2019 ) proposed to use dynamic bounds on learning rates to achieve a smooth transition from adaptive methods to SGD to improve generalization . Our theoretical results for GD and Adam can also provide theoretical insights into the effectiveness of these empirical studies . Optimization and generalization guarantees in deep learning . Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks . A series of results have shown the convergence ( Jacot et al. , 2018 ; Li & Liang , 2018 ; Du et al. , 2019b ; Allen-Zhu et al. , 2019b ; Du et al. , 2019a ; Zou et al. , 2019 ) and generalization ( Allen-Zhu et al. , 2019c ; a ; Arora et al. , 2019a ; b ; Cao & Gu , 2019 ; Ji & Telgarsky , 2020 ; Chen et al. , 2021 ) guarantees in the so-called “ neural tangent kernel ” ( NTK ) regime , where the neural network function is approximately linear in its parameters . Allen-Zhu & Li ( 2019 ) ; Bai & Lee ( 2019 ) ; Allen-Zhu & Li ( 2020a ) ; Li et al . ( 2020 ) studied the learning of neural networks beyond the NTK regime . Our analysis in this paper is also beyond NTK , and gives a detailed comparison between GD and Adam . Feature learning by neural networks . This paper is also closely related to several recent works that studied how neural networks can learn features . Allen-Zhu & Li ( 2020b ) showed that adversarial training purifies the learned features by removing certain “ dense mixtures ” in the hidden layer weights of the network . Allen-Zhu & Li ( 2020c ) studied how ensemble and knowledge distillation work in deep learning when the data have “ multi-view ” features . This paper studies a different aspect of feature learning by Adam and GD , and shows that GD can learn the features while Adam may fail even with proper regularization . 3 PROBLEM SETUP AND PRELIMINARIES . We consider learning a CNN with Adam and GD based on n independent training examples { ( xi , yi ) } ni=1 generated from a data model D. In the following . we first introduce our data model D , and then explain our neural network model and the details of the training algorithms . Data model . We consider a data model where the data inputs consist of feature and noise patches . Such a data model is motivated by image classification problems where the label of an image usually only depends on part of an image , and the other parts of the image showing random objects , or features that belong to other classes , can be considered as noises . When using CNN to fit the data , the convolution operation is applied to each patch of the data input separately . We claim that our data model is more practical than those considered in Wilson et al . ( 2017 ) ; Reddi et al . ( 2018 ) , which are handcrafted for showing the failure of Adam in term of either convergence or generalization . For simplicity , we only consider the case where the data consists of one feature patch and one noise patch . However , our result can be easily extended to cover the setting where there are multiple feature/noise patches . The detailed definition of our data model is given in Definition 3.1 as follows . Definition 3.1 . Let d = Ω ( n4 ) , each data ( x , y ) with x ∈ R2d and y ∈ { −1 , 1 } is generated as follows , x = [ x > 1 , x > 2 ] > , where one of x1 and x2 denotes the feature patch that consists of a feature vector y · v , which is assumed to be 1-sparse , and the other one denotes the noise patch and consists of a noise vector ξ . Without loss of generality , we assume v = [ 1 , 0 , . . . , 0 ] > . The noise vector ξ is generated according to the following process : 1 . Randomly select s coordinates from [ d ] \ { 1 } with equal probabilities , which is denoted as a vector s ∈ { 0 , 1 } d. 2 . Generate ξ from distributionN ( 0 , σ2pI ) , and then mask off the first coordinate and other d− s− 1 coordinates , i.e. , ξ = ξ s. 3 . Add feature noise to ξ , i.e. , ξ = ξ − αyv , where 0 < α < 1 is the strength of the feature noise . In particular , throughout this paper we set s = Θ ( d1/2 n2 ) , σ2p = Θ ( 1 s·polylog ( n ) ) and α = Θ ( σp · polylog ( n ) ) . The most natural way to think of our data model is to treat x as the output of some intermediate layer of a CNN . In literature , Papyan et al . ( 2017 ) pointed out that the outputs of an intermediate layer of a CNN are usually sparse . Yang ( 2019 ) also discussed the setting where the hidden nodes in such an intermediate layer are sampled independently . This motivates us to study sparse features and entry-wisely independent noises in our model . In this paper , we focus on the case where the feature vector v is 1-sparse and the noise vector is s-sparse for simplicity . However , these sparsity assumptions can be generalized to the settings where the feature and the noises are denser . Moreover , we would like to clarify that the data distribution considered in our paper is an extreme case where we assume there is only one feature vector and all data has a feature noise , since we believe this is the simplest model that captures the fundamental difference between Adam and SGD . With this data model , we aim to show why Adam and SGD perform differently . Our theoretical results and analysis techniques can also be extended to more practical settings where there are multiple feature vectors and multiple patches , each data can either contain a single feature or multiple features , together with pure random noise or feature noise . Two-layer CNN model . We consider a two-layer CNN model F using truncated polynomial activation function σ ( z ) = ( max { 0 , z } ) q and fixed the weights of second layer to be all 1 ’ s , where q ≥ 3 . Mathematically , given the data ( x , y ) , the j-th output of the CNN can be formulated as Fj ( W , x ) = m∑ r=1 [ σ ( 〈wj , r , x1〉 ) + σ ( 〈wj , r , x2〉 ) ] = m∑ r=1 [ σ ( 〈wj , r , y · v〉 ) + σ ( 〈wj , r , ξ〉 ) ] , ( 3.1 ) where m is the width of the network , wj , r ∈ Rd denotes the weight at the r-th neuron , and W is the collection of model weights . Here the use of the polynomial ReLU activation function is for simplifying our analysis . It can be replaced by a smoothed ReLU activation function ( e.g. , the activation function used in Allen-Zhu & Li ( 2020c ) ) . If we assume the input data distribution is Gaussian , we can also deal with ReLU activation function ( Li et al. , 2020 ) . Moreover , we would like to emphasize that x1 and x2 denote two data patches , which are randomly assigned with feature vector or noise vector independently for each data point . The leaner has no knowledge about which one is the feature patch ( or noise patch ) . In this paper we assume the width of the network is polylogarithmic in the training sample size , i.e. , m = polylog ( n ) . We assume j ∈ { −1 , 1 } in order to make the logit index be consistent with the data label . Moreover , we assume that the each weight is initialized from a random draw of Gaussian random variable ∼ N ( 0 , σ20 ) with σ0 = Θ ( d−1/4 ) . Training objective . Given the training data { ( xi , yi ) } i=1 , ... , n , we consider to learn the model parameter W by optimizing the empirical loss function with weight decay regularization L ( W ) = 1 n n∑ i=1 Li ( W ) + λ 2 ‖W‖2F , ( 3.2 ) where Li ( W ) = − log e Fyi ( W , xi ) ∑ j∈ { −1,1 } e Fj ( W , xi ) denotes the individual loss for the data ( xi , yi ) and λ ≥ 0 is the regularization parameter . In particular , the regularization parameter can be arbitrary as long as it satisfies λ ∈ ( 0 , λ0 ) with λ0 = Θ ( 1 d ( q−1 ) /4n·polylog ( n ) ) . We claim that the λ0 is the largest feasible regularization parameter that the training process will not stuck at the origin point ( recall that L ( W ) admits zero gradient at W = 0 . ) Training algorithms . In this paper , we consider gradient descent and Adam with full gradient . In particular , starting from initialization W ( 0 ) = { w ( 0 ) j , r , j = { ±1 } , r ∈ [ m ] } , the gradient descent update rule is w ( t+1 ) j , r = w ( t ) j , r − η · ∇wj , rL ( W ( t ) ) , where η is the learning rate . Meanwhile , Adam store historical gradient information in the momentum m ( t ) and a vector v ( t ) as follows m ( t+1 ) j , r = β1m ( t ) j , r + ( 1− β1 ) · ∇wj , rL ( W ( t ) ) , ( 3.3 ) v ( t+1 ) j , r = β2v ( t ) j , r + ( 1− β2 ) · [ ∇wj , rL ( W ( t ) ) ] 2 , ( 3.4 ) and entry-wisely adjusts the learning rate : w ( t+1 ) j , r = w ( t ) j , r − η ·m ( t ) j , r/ √ v ( t ) j , r , ( 3.5 ) where β1 , β2 are the hyperparameters of Adam ( a popular choice in practice is β1 = 0.9 , and β2 = 0.99 ) , and in ( 3.4 ) and ( 3.5 ) , the square ( · ) 2 , square root √ · , and division ·/· all denote entrywise calculations . We do not consider the initialization bias correction in the original Adam paper ( Kingma & Ba , 2015 ) for the ease of analysis . | This paper proposes a new perspective to explain the difference in generalization ability between Adam and SGD. The main contribution of this paper is that it analyzes the behavior of Adam and SGD training on a two-layer network and a very special dataset, and the authors claim that Adam generalizes poorly while SGD generalizes well. The authors also provide analysis for convex functions and some experimental results to validate their claims. | SP:167245edd1f27c86e6f8f9fa6edeaebdedb9307a |
Understanding the Generalization of Adam in Learning Neural Networks with Proper Regularization | 1 INTRODUCTION . Adaptive gradient methods ( Duchi et al. , 2011 ; Hinton et al. , 2012 ; Kingma & Ba , 2015 ; Reddi et al. , 2018 ) such as Adam are very popular optimizers for training deep neural networks . By adjusting the learning ratethis coordinate-wisely based on historical gradient information , they are known to be able to automatically choose appropriate learning rates to achieve fast convergence in training . Because of this advantage , Adam and its variants are widely used in deep learning . Despite their fast convergence , adaptive gradient methods have been observed to achieve worse generalization performance compared with gradient descent and stochastic gradient descent ( SGD ) ( Wilson et al. , 2017 ; Luo et al. , 2019 ; Chen et al. , 2020 ; Zhou et al. , 2020 ) in many deep learning tasks such as image classification ( we have done some simple deep learning experiments to justify this , the results are reported in Table 1 ) . Even with proper regularization , achieving good test error with adaptive gradient methods seems to be challenging . Several recent works provided theoretical explanations of this generalization gap between Adam and GD . Wilson et al . ( 2017 ) ; Agarwal et al . ( 2019 ) considered a setting of linear regression , and showed that Adam can fail when learning an overparameterized linear model on certain specifically designed data , while SGD can learn the linear model to achieve zero test error . This ex- ample in linear regression offers valuable insights into the difference between SGD and Adam . However , it is under a convex optimization setting , and as we will show in this paper ( Theorem 4.2 ) , the performance difference between Adam and GD can be easily avoided by adding an arbitrarily small regularization term , because the regularized training loss function is strongly convex and all algorithms will converge to the same unique global optimum . For this reason , we argue that the example in the convex setting can not capture the fundamental differences between GD and Adam . More recently , Zhou et al . ( 2020 ) studied the expected escaping time of Adam and SGD from a local basin , and utilized this to explain the difference between SGD and Adam . However , their results do not take NN architecture into consideration , and do not provide an analysis of test errors either . In this paper , we aim at answering the following question Why is there a generalization gap between Adam and gradient descent in learning neural networks , even with proper regularization ? Specifically , we study Adam and GD for training neural networks with weight decay regularization on an image-like data model , and demonstrate the difference between Adam and GD from a feature learning perspective . We consider a model where the data are generated as a combination of feature and noise patches under certain sparsity conditions , and analyze the convergence and generalization of Adam and GD for training a two-layer convolutional neural network ( CNN ) . The contributions of this paper are summarized as follows . • We establish global convergence guarantees for Adam and GD with proper weight decay regularization . We show that , starting at the same random initialization , Adam and GD can both train a two-layer convolutional neural network to achieve zero training error after polynomially many iterations , despite the nonconvex optimization landscape . • We further show that GD and Adam in fact converge to different global solutions with different generalization performance : GD can achieve nearly zero test error , while the generalization performance of the model found by Adam is no better than a random guess . In particular , we show that the reason for this gap is due to the different training behaviors of Adam and GD : Adam is more likely to fit noises in the data and output a model that is largely contributed by the noise patches of the training data ; GD prefers to fit training data based on their feature patch and finds a solution that is mainly composed by the true features . We also illustrate such different training processes in Figure 1 , where it can be seen that the model trained by Adam is clearly more “ noisy ” than that trained by SGD . • We also show that for convex settings with weight decay regularization , both Adam and gradient descent converge to the exact same solution and therefore have no test error difference . This suggests that the difference between Adam and GD can not be fully explained by linear models or neural networks trained in the “ almost convex ” neural tangent kernel ( NTK ) regime Jacot et al . ( 2018 ) ; Allen-Zhu et al . ( 2019b ) ; Du et al . ( 2019a ) ; Zou et al . ( 2019 ) ; Allen-Zhu et al . ( 2019a ) ; Arora et al . ( 2019a ; b ) ; Cao & Gu ( 2019 ) ; Ji & Telgarsky ( 2020 ) ; Chen et al . ( 2021 ) . It also demonstrates that the inferior generalization performance of Adam is fundamentally tied to the nonconvex landscape of deep learning optimization , and can not be solved by adding regularization . Notation . For a scalar x , we use [ x ] + to denote max { x , 0 } . For a vector v = ( v1 , . . . , vd ) > , we denote by ‖v‖2 : = ( ∑d j=1 v 2 j ) 1/2 its ` 2-norm , and use supp ( v ) : = { j : vj 6= 0 } to denote its support . 2 RELATED WORK . In this section , we discuss the works that are mostly related to our paper . Generalization gap between Adam and ( stochastic ) gradient descent . The worse generalization of Adam compared with SGD has also been observed by some recent works and has motivated new variants of neural network training algorithms . Keskar & Socher ( 2017 ) proposed to switch between Adam and SGD to achieve better generalization . Merity et al . ( 2018 ) proposed a variant of the averaged stochastic gradient method to achieve good generalization performance for LSTM language models . Luo et al . ( 2019 ) proposed to use dynamic bounds on learning rates to achieve a smooth transition from adaptive methods to SGD to improve generalization . Our theoretical results for GD and Adam can also provide theoretical insights into the effectiveness of these empirical studies . Optimization and generalization guarantees in deep learning . Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks . A series of results have shown the convergence ( Jacot et al. , 2018 ; Li & Liang , 2018 ; Du et al. , 2019b ; Allen-Zhu et al. , 2019b ; Du et al. , 2019a ; Zou et al. , 2019 ) and generalization ( Allen-Zhu et al. , 2019c ; a ; Arora et al. , 2019a ; b ; Cao & Gu , 2019 ; Ji & Telgarsky , 2020 ; Chen et al. , 2021 ) guarantees in the so-called “ neural tangent kernel ” ( NTK ) regime , where the neural network function is approximately linear in its parameters . Allen-Zhu & Li ( 2019 ) ; Bai & Lee ( 2019 ) ; Allen-Zhu & Li ( 2020a ) ; Li et al . ( 2020 ) studied the learning of neural networks beyond the NTK regime . Our analysis in this paper is also beyond NTK , and gives a detailed comparison between GD and Adam . Feature learning by neural networks . This paper is also closely related to several recent works that studied how neural networks can learn features . Allen-Zhu & Li ( 2020b ) showed that adversarial training purifies the learned features by removing certain “ dense mixtures ” in the hidden layer weights of the network . Allen-Zhu & Li ( 2020c ) studied how ensemble and knowledge distillation work in deep learning when the data have “ multi-view ” features . This paper studies a different aspect of feature learning by Adam and GD , and shows that GD can learn the features while Adam may fail even with proper regularization . 3 PROBLEM SETUP AND PRELIMINARIES . We consider learning a CNN with Adam and GD based on n independent training examples { ( xi , yi ) } ni=1 generated from a data model D. In the following . we first introduce our data model D , and then explain our neural network model and the details of the training algorithms . Data model . We consider a data model where the data inputs consist of feature and noise patches . Such a data model is motivated by image classification problems where the label of an image usually only depends on part of an image , and the other parts of the image showing random objects , or features that belong to other classes , can be considered as noises . When using CNN to fit the data , the convolution operation is applied to each patch of the data input separately . We claim that our data model is more practical than those considered in Wilson et al . ( 2017 ) ; Reddi et al . ( 2018 ) , which are handcrafted for showing the failure of Adam in term of either convergence or generalization . For simplicity , we only consider the case where the data consists of one feature patch and one noise patch . However , our result can be easily extended to cover the setting where there are multiple feature/noise patches . The detailed definition of our data model is given in Definition 3.1 as follows . Definition 3.1 . Let d = Ω ( n4 ) , each data ( x , y ) with x ∈ R2d and y ∈ { −1 , 1 } is generated as follows , x = [ x > 1 , x > 2 ] > , where one of x1 and x2 denotes the feature patch that consists of a feature vector y · v , which is assumed to be 1-sparse , and the other one denotes the noise patch and consists of a noise vector ξ . Without loss of generality , we assume v = [ 1 , 0 , . . . , 0 ] > . The noise vector ξ is generated according to the following process : 1 . Randomly select s coordinates from [ d ] \ { 1 } with equal probabilities , which is denoted as a vector s ∈ { 0 , 1 } d. 2 . Generate ξ from distributionN ( 0 , σ2pI ) , and then mask off the first coordinate and other d− s− 1 coordinates , i.e. , ξ = ξ s. 3 . Add feature noise to ξ , i.e. , ξ = ξ − αyv , where 0 < α < 1 is the strength of the feature noise . In particular , throughout this paper we set s = Θ ( d1/2 n2 ) , σ2p = Θ ( 1 s·polylog ( n ) ) and α = Θ ( σp · polylog ( n ) ) . The most natural way to think of our data model is to treat x as the output of some intermediate layer of a CNN . In literature , Papyan et al . ( 2017 ) pointed out that the outputs of an intermediate layer of a CNN are usually sparse . Yang ( 2019 ) also discussed the setting where the hidden nodes in such an intermediate layer are sampled independently . This motivates us to study sparse features and entry-wisely independent noises in our model . In this paper , we focus on the case where the feature vector v is 1-sparse and the noise vector is s-sparse for simplicity . However , these sparsity assumptions can be generalized to the settings where the feature and the noises are denser . Moreover , we would like to clarify that the data distribution considered in our paper is an extreme case where we assume there is only one feature vector and all data has a feature noise , since we believe this is the simplest model that captures the fundamental difference between Adam and SGD . With this data model , we aim to show why Adam and SGD perform differently . Our theoretical results and analysis techniques can also be extended to more practical settings where there are multiple feature vectors and multiple patches , each data can either contain a single feature or multiple features , together with pure random noise or feature noise . Two-layer CNN model . We consider a two-layer CNN model F using truncated polynomial activation function σ ( z ) = ( max { 0 , z } ) q and fixed the weights of second layer to be all 1 ’ s , where q ≥ 3 . Mathematically , given the data ( x , y ) , the j-th output of the CNN can be formulated as Fj ( W , x ) = m∑ r=1 [ σ ( 〈wj , r , x1〉 ) + σ ( 〈wj , r , x2〉 ) ] = m∑ r=1 [ σ ( 〈wj , r , y · v〉 ) + σ ( 〈wj , r , ξ〉 ) ] , ( 3.1 ) where m is the width of the network , wj , r ∈ Rd denotes the weight at the r-th neuron , and W is the collection of model weights . Here the use of the polynomial ReLU activation function is for simplifying our analysis . It can be replaced by a smoothed ReLU activation function ( e.g. , the activation function used in Allen-Zhu & Li ( 2020c ) ) . If we assume the input data distribution is Gaussian , we can also deal with ReLU activation function ( Li et al. , 2020 ) . Moreover , we would like to emphasize that x1 and x2 denote two data patches , which are randomly assigned with feature vector or noise vector independently for each data point . The leaner has no knowledge about which one is the feature patch ( or noise patch ) . In this paper we assume the width of the network is polylogarithmic in the training sample size , i.e. , m = polylog ( n ) . We assume j ∈ { −1 , 1 } in order to make the logit index be consistent with the data label . Moreover , we assume that the each weight is initialized from a random draw of Gaussian random variable ∼ N ( 0 , σ20 ) with σ0 = Θ ( d−1/4 ) . Training objective . Given the training data { ( xi , yi ) } i=1 , ... , n , we consider to learn the model parameter W by optimizing the empirical loss function with weight decay regularization L ( W ) = 1 n n∑ i=1 Li ( W ) + λ 2 ‖W‖2F , ( 3.2 ) where Li ( W ) = − log e Fyi ( W , xi ) ∑ j∈ { −1,1 } e Fj ( W , xi ) denotes the individual loss for the data ( xi , yi ) and λ ≥ 0 is the regularization parameter . In particular , the regularization parameter can be arbitrary as long as it satisfies λ ∈ ( 0 , λ0 ) with λ0 = Θ ( 1 d ( q−1 ) /4n·polylog ( n ) ) . We claim that the λ0 is the largest feasible regularization parameter that the training process will not stuck at the origin point ( recall that L ( W ) admits zero gradient at W = 0 . ) Training algorithms . In this paper , we consider gradient descent and Adam with full gradient . In particular , starting from initialization W ( 0 ) = { w ( 0 ) j , r , j = { ±1 } , r ∈ [ m ] } , the gradient descent update rule is w ( t+1 ) j , r = w ( t ) j , r − η · ∇wj , rL ( W ( t ) ) , where η is the learning rate . Meanwhile , Adam store historical gradient information in the momentum m ( t ) and a vector v ( t ) as follows m ( t+1 ) j , r = β1m ( t ) j , r + ( 1− β1 ) · ∇wj , rL ( W ( t ) ) , ( 3.3 ) v ( t+1 ) j , r = β2v ( t ) j , r + ( 1− β2 ) · [ ∇wj , rL ( W ( t ) ) ] 2 , ( 3.4 ) and entry-wisely adjusts the learning rate : w ( t+1 ) j , r = w ( t ) j , r − η ·m ( t ) j , r/ √ v ( t ) j , r , ( 3.5 ) where β1 , β2 are the hyperparameters of Adam ( a popular choice in practice is β1 = 0.9 , and β2 = 0.99 ) , and in ( 3.4 ) and ( 3.5 ) , the square ( · ) 2 , square root √ · , and division ·/· all denote entrywise calculations . We do not consider the initialization bias correction in the original Adam paper ( Kingma & Ba , 2015 ) for the ease of analysis . | This paper aims to explain why there is a generalization gap between Adam and gradient descent in learning neural networks, even with proper regularization. To this end, the authors construct an artificial dataset in attempt to capture the basic properties of real image datasets that can lead to the generalization gap. Based on this dataset, the authors prove that Adam is more likely to fit noise in data, while GD tends to fit real features. The theoretical results are verified by experiments on the proposed dataset. | SP:167245edd1f27c86e6f8f9fa6edeaebdedb9307a |
Wiring Up Vision: Minimizing Supervised Synaptic Updates Needed to Produce a Primate Ventral Stream | 1 INTRODUCTION . Particular artificial neural networks ( ANNs ) are the leading mechanistic models of visual processing in the primate visual ventral stream ( Schrimpf et al. , 2020 ; Kubilius et al. , 2019 ; Dapello et al. , 2020 ) . After training on large-scale datasets such as ImageNet ( Deng et al. , 2009 ) by updating weights based on labeled images , internal representations of these ANNs partly match neural representations in the primate visual system from early visual cortex V1 through V2 and V4 to high-level IT ( Yamins et al. , 2014 ; Khaligh-Razavi & Kriegeskorte , 2014 ; Cadena et al. , 2017 ; Tang et al. , 2018 ; Schrimpf et al. , 2018 ; Kubilius et al. , 2019 ) , and model object recognition behavior can partly account for primate object recognition behavior ( Rajalingham et al. , 2018 ; Schrimpf et al. , 2018 ) . Recently , such models have been criticized due to how their learning departs from brain development because they require many more labeled examples than is reasonable for biological systems ’ limited waking ( visual ) experience ( Seibert , 2018 ; Zador , 2019 ) . For example , all the current top models of the primate ventral stream rely on trillions of supervised synaptic updates , i.e . the training of millions of parameters with millions of labeled examples over dozens of epochs . In biological systems , on the other hand , the at-birth synaptic wiring as encoded by the genome already provides structure that is sufficient for macaques to exhibit adult-like visual representations after a few months ( Movshon & Kiorpes , 1988 ; Kiorpes & Movshon , 2004 ; Seibert , 2018 ) , which restricts the amount of experience dependent learning . Furthermore , different neuronal populations in cortical circuits undergo different plasticity mechanisms : neurons in supragranular and infragranular layers adapt more rapidly than those in layer 4 which receives inputs from lower areas ( Diamond et al. , 1994 ; Schoups et al. , 2001 ) , while current artificial synapses , on the other hand , all change under the same plasticity mechanism . While current models provide a basic understanding of the neural mechanisms of adult ventral stream inference , can we start to build models that provide an understanding of how the ventral stream “ wires itself up ” – models of the initial state at birth and how it develops during postnatal life ? Related Work . Several papers have addressed related questions in machine learning : Distilled student networks can be trained on the outputs of a teacher network ( Hinton et al. , 2015 ; Cho & Hariharan , 2019 ; Tian et al. , 2019 ) , and , in pruning studies , networks with knocked out synapses perform reasonably well ( Cheney et al. , 2017 ; Morcos et al. , 2018 ) , demonstrating that models with many trained parameters can be compressed ( Wu et al. , 2018 ) which is further supported by the convergence of training gradients onto a small subspace ( Gur-Ari et al. , 2018 ) . Tian et al . ( 2020 ) show that a pre-trained encoder ’ s fixed features can be used to train a thin decoder with performance close to full fine-tuning and recent theoretically-driven work has found that training only BatchNorm layers ( Frankle et al. , 2021 ) or determining the right parameters from a large pool of weights ( Frankle et al. , 2019 ; Ramanujan et al. , 2019 ) can already achieve high classification accuracy . Unsupervised approaches are also starting to develop useful representations without requiring many labels by inferring internal labels such as clusters or representational similarity ( Caron et al. , 2018 ; Wu et al. , 2018 ; Zhuang et al. , 2019 ; Hénaff et al. , 2019 ; Konkle & Alvarez , 2020 ; Zhuang et al. , 2020 ) . Many attempts are also being made to make the learning algorithms themselves more biologically plausible ( e.g . Lillicrap et al. , 2016 ; Scellier & Bengio , 2017 ; Pozzi et al. , 2020 ) . Nevertheless , all of these approaches require many synaptic updates in the form of labeled samples or precise machinery to determine the right set of weights . In this work , we take first steps of relating findings in machine learning to neuroscience and using such models to explore hypotheses about the product of evolution ( a model ’ s “ birth state ” ) while simultaneously reducing the number of supervised synaptic updates ( a model ’ s visual experience dependent development ) without sacrificing high brain predictivity . Our contributions follow from a framework in which evolution endows the visual system with a well-chosen , yet still largely random “ birth ” pattern of synaptic connectivity ( architecture + initialization ) , and developmental learning corresponds to training a fraction of the synaptic weights using very few supervised labels . We do not view the proposed changes as fully biological models of post-natal development , only that they more concretely correspond to biology than current models . Solving the entire problem of development all at once is too much for one study , but even partial improvements in this direction will likely be informative to further work . Specifically , 1. we build models with a fraction of supervised updates ( training epochs and labeled images ) that retain high similarity to the primate ventral visual stream ( quantified by a brain predictivity score from benchmarks on Brain-Score ( Schrimpf et al. , 2018 ) ) and find that layers corresponding to higher visual regions such as IT are most dependent on training , 2. we improve the “ at-birth ” synaptic connectivity to show that even low-capacity evolutionarily encoded information might lead to reasonable initial representations with no training at all , 3. we propose a thin , “ critical training ” technique which reduces the number of trained synapses while maintaining high brain predictivity and improves over previous computer vision attempts to minimize trained components , 4. we combine these three techniques to build models with two orders of magnitude fewer supervised synaptic updates but high brain predictivity relative to a fully trained model Code and pre-trained models are available through GitHub : https : //anonymous.4open . science/r/anonymous-3A61/ . 2 MODELING PRIMATE VISION . We evaluate all models on a suite of ventral stream benchmarks in Brain-Score ( Schrimpf et al. , 2018 ; 2020 ) , and we base the new models presented here on the CORnet-S architecture , one of the most accurate models of adult primate visual processing ( Kubilius et al. , 2019 ) . Brain-Score benchmarks . To obtain quantified scores for brain-likeness , we use a thorough set of benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) . To keep scores comparable , we only included those neural benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) with the same predictivity metric . All benchmarks feed the same images to a candidate model that were used for primate experiments while “ recording ” activations or measuring behavioral outputs . Specifically , the V1 and V2 benchmarks present 315 images of naturalistic textures and compare model representations to primate single-unit recordings from Freeman et al . ( 2013 ) ( 102 V1 and 103 V2 neurons ) ; the V4 and IT benchmarks present 2,560 naturalistic images and compare models to primate Utah array recordings from Majaj et al . ( 2015 ) ( 88 V4 and 168 IT electrodes ) . A linear regression is fit from model to primate representations in response to 90 % of the images and its prediction score on the held-out 10 % of images is evaluated with Pearson correlation , cross-validated 10 times . The behavioral benchmark presents 240 images and compares model to primate behavioral responses from Rajalingham et al . ( 2018 ) . A logistic classifier is fit on models ’ penultimate representations on 2,160 separate labeled images . The classifier is then used to estimate probabilities for 240 held-out images . Per-image confusion patterns between model and primate are compared with a Pearson correlation . All benchmark scores are normalized by the respective ceiling . We primarily report the average brain predictivity score as the mean of V1 , V2 , V4 , IT , and behavioral scores . We note that the Brain-Score benchmarks in this study are based on limited data and thus present a possible limitation . Nonetheless , they are the most extensive set of primate ventral stream neuronal and behavioral benchmarks that is currently available and the scores generalize to new experiments ( Kubilius et al. , 2019 ) . Brain-Score provides separate sets of data as public benchmarks which we use to determine the type of distribution in Section 4 , and the layer-to-region commitments of reference models . CORnet-S. One of the current best model architectures on the Brain-Score benchmarks is CORnet-S ( Kubilius et al. , 2019 ) , a shallow recurrent model which anatomically commits to ventral stream regions . CORnet-S has four computational areas , analogous to the ventral visual areas V1 , V2 , V4 , and IT , and a linear decoder that maps from neurons in the model ’ s last visual area to its behavioral choices . The recurrent circuitry ( Figure 3B ) uses up- and down-sampling convolutions to process features and is identical in each of the models visual areas ( except for V1COR ) , but varies by the total number of neurons in each area . We base all models developed here on the CORnet-S architecture and use the same hyper-parameters as proposed in ( Kubilius et al. , 2019 ) . Representations are read out at the end of anatomically corresponding areas . 3 HIGH SCORES IN BRAIN PREDICTIVITY CAN BE ACHIEVED WITH FEW SUPERVISED UPDATES . We evaluated the brain predictivity scores of CORnet-S variants that were trained with a combination of fewer epochs and images . Models were trained with an initial learning rate of 0.1 , divided by 10 when loss did not improve over 3 epochs , and stopping after three decrements . Figure 1 shows model scores on neural and behavioral Brain-Score measures , relative to a model trained for 43 epochs on all 1.28M labeled ImageNet images . In Panel A , we compare the average score over the five brain measures of various models to the number of supervised updates that each model was trained with , defined as the number of labeled images times the number of epochs . While a fully trained model reaches an average score of .42 after 55,040,000 supervised updates ( 43 epochs × 1.28M images ) , a model with only 100,000 updates already achieves 50 % of that score , and 1,000,000 updates increase brain predictivity scores to 76 % . Models are close to convergence score after 10,000,000 supervised updates with performance nearly equal to full training ( 97 % ) . Scores grow logarithmically with an approximate 5 % score increase for every order of magnitude more supervised updates . Figures 1B and C show individual neural and behavioral scores of models trained with fewer training epochs or labeled images independently . Early to mid visual representations ( V1 , V2 , and V4 scores ) are especially closely met with only few supervised updates , reaching 50 % of the final trained model in fractions of the first epoch ( Figure 1B ) . After only one full iteration over the training set , V1 , V2 , and V4 scores are close to their final score ( all > 80 % ) while IT requires two epochs to reach a comparable level . Behavioral scores take slightly longer to converge ( > 80 % after 7 epochs ) . Similarly , when training until convergence with fractions of the 1.28M total images , 50,000 images are sufficient to obtain high neural scores ( 80 % of full training in V1 , V2 , V4 , IT ) . Behavioral scores again require more training : half the standard number of labeled images is needed to surpass 80 % . Concretely relating supervised updates to primate ventral stream development , Seibert ( 2018 ) establishes that no more than∼4 months – or 10 million seconds – of waking visual experience is needed to reach adult-level primate IT cortex ( as assessed by its capability to support adult level object recognition ) . From this estimate , we can compute how many supervised updates per second different models in Figure 1A would require ( assuming those updates are evenly distributed over the 10 million seconds ) . For instance , the fully trained model ’ s 55 million supervised updates translate to 5.5 updates every second , whereas the model with 1 million updates and 76 % relative brain predictivity translates to one labeled image update every 10 seconds which appears more plausible given the upper limit of 2-3 saccades per second in humans ( Yarbus , 1967 ; Gibaldi & Sabatini , 2020 ) . | The paper addresses the question of how many weight updates are needed to train a deep network before it takes on biologically realistic representations. The paper uses CORnet-S (a network that has been proposed to resemble primate ventral stream), and BrainScore (a benchmark of how closely related deep network responses are to visual responses in primate ventral stream). Three ways of reducing the numbers of weight updates are explored, each of which is found to vastly reduce updates while moderately reducing BrainScore. First, the network is simply trained for fewer epochs. Second, weights are initialized with clusters of weights found after training. Third, only a subset of layers is updated. A combination of methods leads to 80% of full brain predictivity with 0.5% of the standard number of weight updates. | SP:45d0d17b384044473db2e2e164c56558044d2542 |
Wiring Up Vision: Minimizing Supervised Synaptic Updates Needed to Produce a Primate Ventral Stream | 1 INTRODUCTION . Particular artificial neural networks ( ANNs ) are the leading mechanistic models of visual processing in the primate visual ventral stream ( Schrimpf et al. , 2020 ; Kubilius et al. , 2019 ; Dapello et al. , 2020 ) . After training on large-scale datasets such as ImageNet ( Deng et al. , 2009 ) by updating weights based on labeled images , internal representations of these ANNs partly match neural representations in the primate visual system from early visual cortex V1 through V2 and V4 to high-level IT ( Yamins et al. , 2014 ; Khaligh-Razavi & Kriegeskorte , 2014 ; Cadena et al. , 2017 ; Tang et al. , 2018 ; Schrimpf et al. , 2018 ; Kubilius et al. , 2019 ) , and model object recognition behavior can partly account for primate object recognition behavior ( Rajalingham et al. , 2018 ; Schrimpf et al. , 2018 ) . Recently , such models have been criticized due to how their learning departs from brain development because they require many more labeled examples than is reasonable for biological systems ’ limited waking ( visual ) experience ( Seibert , 2018 ; Zador , 2019 ) . For example , all the current top models of the primate ventral stream rely on trillions of supervised synaptic updates , i.e . the training of millions of parameters with millions of labeled examples over dozens of epochs . In biological systems , on the other hand , the at-birth synaptic wiring as encoded by the genome already provides structure that is sufficient for macaques to exhibit adult-like visual representations after a few months ( Movshon & Kiorpes , 1988 ; Kiorpes & Movshon , 2004 ; Seibert , 2018 ) , which restricts the amount of experience dependent learning . Furthermore , different neuronal populations in cortical circuits undergo different plasticity mechanisms : neurons in supragranular and infragranular layers adapt more rapidly than those in layer 4 which receives inputs from lower areas ( Diamond et al. , 1994 ; Schoups et al. , 2001 ) , while current artificial synapses , on the other hand , all change under the same plasticity mechanism . While current models provide a basic understanding of the neural mechanisms of adult ventral stream inference , can we start to build models that provide an understanding of how the ventral stream “ wires itself up ” – models of the initial state at birth and how it develops during postnatal life ? Related Work . Several papers have addressed related questions in machine learning : Distilled student networks can be trained on the outputs of a teacher network ( Hinton et al. , 2015 ; Cho & Hariharan , 2019 ; Tian et al. , 2019 ) , and , in pruning studies , networks with knocked out synapses perform reasonably well ( Cheney et al. , 2017 ; Morcos et al. , 2018 ) , demonstrating that models with many trained parameters can be compressed ( Wu et al. , 2018 ) which is further supported by the convergence of training gradients onto a small subspace ( Gur-Ari et al. , 2018 ) . Tian et al . ( 2020 ) show that a pre-trained encoder ’ s fixed features can be used to train a thin decoder with performance close to full fine-tuning and recent theoretically-driven work has found that training only BatchNorm layers ( Frankle et al. , 2021 ) or determining the right parameters from a large pool of weights ( Frankle et al. , 2019 ; Ramanujan et al. , 2019 ) can already achieve high classification accuracy . Unsupervised approaches are also starting to develop useful representations without requiring many labels by inferring internal labels such as clusters or representational similarity ( Caron et al. , 2018 ; Wu et al. , 2018 ; Zhuang et al. , 2019 ; Hénaff et al. , 2019 ; Konkle & Alvarez , 2020 ; Zhuang et al. , 2020 ) . Many attempts are also being made to make the learning algorithms themselves more biologically plausible ( e.g . Lillicrap et al. , 2016 ; Scellier & Bengio , 2017 ; Pozzi et al. , 2020 ) . Nevertheless , all of these approaches require many synaptic updates in the form of labeled samples or precise machinery to determine the right set of weights . In this work , we take first steps of relating findings in machine learning to neuroscience and using such models to explore hypotheses about the product of evolution ( a model ’ s “ birth state ” ) while simultaneously reducing the number of supervised synaptic updates ( a model ’ s visual experience dependent development ) without sacrificing high brain predictivity . Our contributions follow from a framework in which evolution endows the visual system with a well-chosen , yet still largely random “ birth ” pattern of synaptic connectivity ( architecture + initialization ) , and developmental learning corresponds to training a fraction of the synaptic weights using very few supervised labels . We do not view the proposed changes as fully biological models of post-natal development , only that they more concretely correspond to biology than current models . Solving the entire problem of development all at once is too much for one study , but even partial improvements in this direction will likely be informative to further work . Specifically , 1. we build models with a fraction of supervised updates ( training epochs and labeled images ) that retain high similarity to the primate ventral visual stream ( quantified by a brain predictivity score from benchmarks on Brain-Score ( Schrimpf et al. , 2018 ) ) and find that layers corresponding to higher visual regions such as IT are most dependent on training , 2. we improve the “ at-birth ” synaptic connectivity to show that even low-capacity evolutionarily encoded information might lead to reasonable initial representations with no training at all , 3. we propose a thin , “ critical training ” technique which reduces the number of trained synapses while maintaining high brain predictivity and improves over previous computer vision attempts to minimize trained components , 4. we combine these three techniques to build models with two orders of magnitude fewer supervised synaptic updates but high brain predictivity relative to a fully trained model Code and pre-trained models are available through GitHub : https : //anonymous.4open . science/r/anonymous-3A61/ . 2 MODELING PRIMATE VISION . We evaluate all models on a suite of ventral stream benchmarks in Brain-Score ( Schrimpf et al. , 2018 ; 2020 ) , and we base the new models presented here on the CORnet-S architecture , one of the most accurate models of adult primate visual processing ( Kubilius et al. , 2019 ) . Brain-Score benchmarks . To obtain quantified scores for brain-likeness , we use a thorough set of benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) . To keep scores comparable , we only included those neural benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) with the same predictivity metric . All benchmarks feed the same images to a candidate model that were used for primate experiments while “ recording ” activations or measuring behavioral outputs . Specifically , the V1 and V2 benchmarks present 315 images of naturalistic textures and compare model representations to primate single-unit recordings from Freeman et al . ( 2013 ) ( 102 V1 and 103 V2 neurons ) ; the V4 and IT benchmarks present 2,560 naturalistic images and compare models to primate Utah array recordings from Majaj et al . ( 2015 ) ( 88 V4 and 168 IT electrodes ) . A linear regression is fit from model to primate representations in response to 90 % of the images and its prediction score on the held-out 10 % of images is evaluated with Pearson correlation , cross-validated 10 times . The behavioral benchmark presents 240 images and compares model to primate behavioral responses from Rajalingham et al . ( 2018 ) . A logistic classifier is fit on models ’ penultimate representations on 2,160 separate labeled images . The classifier is then used to estimate probabilities for 240 held-out images . Per-image confusion patterns between model and primate are compared with a Pearson correlation . All benchmark scores are normalized by the respective ceiling . We primarily report the average brain predictivity score as the mean of V1 , V2 , V4 , IT , and behavioral scores . We note that the Brain-Score benchmarks in this study are based on limited data and thus present a possible limitation . Nonetheless , they are the most extensive set of primate ventral stream neuronal and behavioral benchmarks that is currently available and the scores generalize to new experiments ( Kubilius et al. , 2019 ) . Brain-Score provides separate sets of data as public benchmarks which we use to determine the type of distribution in Section 4 , and the layer-to-region commitments of reference models . CORnet-S. One of the current best model architectures on the Brain-Score benchmarks is CORnet-S ( Kubilius et al. , 2019 ) , a shallow recurrent model which anatomically commits to ventral stream regions . CORnet-S has four computational areas , analogous to the ventral visual areas V1 , V2 , V4 , and IT , and a linear decoder that maps from neurons in the model ’ s last visual area to its behavioral choices . The recurrent circuitry ( Figure 3B ) uses up- and down-sampling convolutions to process features and is identical in each of the models visual areas ( except for V1COR ) , but varies by the total number of neurons in each area . We base all models developed here on the CORnet-S architecture and use the same hyper-parameters as proposed in ( Kubilius et al. , 2019 ) . Representations are read out at the end of anatomically corresponding areas . 3 HIGH SCORES IN BRAIN PREDICTIVITY CAN BE ACHIEVED WITH FEW SUPERVISED UPDATES . We evaluated the brain predictivity scores of CORnet-S variants that were trained with a combination of fewer epochs and images . Models were trained with an initial learning rate of 0.1 , divided by 10 when loss did not improve over 3 epochs , and stopping after three decrements . Figure 1 shows model scores on neural and behavioral Brain-Score measures , relative to a model trained for 43 epochs on all 1.28M labeled ImageNet images . In Panel A , we compare the average score over the five brain measures of various models to the number of supervised updates that each model was trained with , defined as the number of labeled images times the number of epochs . While a fully trained model reaches an average score of .42 after 55,040,000 supervised updates ( 43 epochs × 1.28M images ) , a model with only 100,000 updates already achieves 50 % of that score , and 1,000,000 updates increase brain predictivity scores to 76 % . Models are close to convergence score after 10,000,000 supervised updates with performance nearly equal to full training ( 97 % ) . Scores grow logarithmically with an approximate 5 % score increase for every order of magnitude more supervised updates . Figures 1B and C show individual neural and behavioral scores of models trained with fewer training epochs or labeled images independently . Early to mid visual representations ( V1 , V2 , and V4 scores ) are especially closely met with only few supervised updates , reaching 50 % of the final trained model in fractions of the first epoch ( Figure 1B ) . After only one full iteration over the training set , V1 , V2 , and V4 scores are close to their final score ( all > 80 % ) while IT requires two epochs to reach a comparable level . Behavioral scores take slightly longer to converge ( > 80 % after 7 epochs ) . Similarly , when training until convergence with fractions of the 1.28M total images , 50,000 images are sufficient to obtain high neural scores ( 80 % of full training in V1 , V2 , V4 , IT ) . Behavioral scores again require more training : half the standard number of labeled images is needed to surpass 80 % . Concretely relating supervised updates to primate ventral stream development , Seibert ( 2018 ) establishes that no more than∼4 months – or 10 million seconds – of waking visual experience is needed to reach adult-level primate IT cortex ( as assessed by its capability to support adult level object recognition ) . From this estimate , we can compute how many supervised updates per second different models in Figure 1A would require ( assuming those updates are evenly distributed over the 10 million seconds ) . For instance , the fully trained model ’ s 55 million supervised updates translate to 5.5 updates every second , whereas the model with 1 million updates and 76 % relative brain predictivity translates to one labeled image update every 10 seconds which appears more plausible given the upper limit of 2-3 saccades per second in humans ( Yarbus , 1967 ; Gibaldi & Sabatini , 2020 ) . | ## Updated the score This paper proposes to address an important research question for connecting biological (BNN) and artificial neural networks (ANN). Although after training, ANN replicates various salient features of BNN, the way they are often trained is biologically implausible and thus, it is hard to argue that ANNs are suitable for modeling BNNs convincingly. In particular, this work focuses on the already existing CORnet who has shown a high Brain-score. The idea of the authors is to show that they can largely reduce the number of updates when using their methods while still retaining a high Brain-score, thus proposing a potential training mechanism for BNNs. | SP:45d0d17b384044473db2e2e164c56558044d2542 |
Wiring Up Vision: Minimizing Supervised Synaptic Updates Needed to Produce a Primate Ventral Stream | 1 INTRODUCTION . Particular artificial neural networks ( ANNs ) are the leading mechanistic models of visual processing in the primate visual ventral stream ( Schrimpf et al. , 2020 ; Kubilius et al. , 2019 ; Dapello et al. , 2020 ) . After training on large-scale datasets such as ImageNet ( Deng et al. , 2009 ) by updating weights based on labeled images , internal representations of these ANNs partly match neural representations in the primate visual system from early visual cortex V1 through V2 and V4 to high-level IT ( Yamins et al. , 2014 ; Khaligh-Razavi & Kriegeskorte , 2014 ; Cadena et al. , 2017 ; Tang et al. , 2018 ; Schrimpf et al. , 2018 ; Kubilius et al. , 2019 ) , and model object recognition behavior can partly account for primate object recognition behavior ( Rajalingham et al. , 2018 ; Schrimpf et al. , 2018 ) . Recently , such models have been criticized due to how their learning departs from brain development because they require many more labeled examples than is reasonable for biological systems ’ limited waking ( visual ) experience ( Seibert , 2018 ; Zador , 2019 ) . For example , all the current top models of the primate ventral stream rely on trillions of supervised synaptic updates , i.e . the training of millions of parameters with millions of labeled examples over dozens of epochs . In biological systems , on the other hand , the at-birth synaptic wiring as encoded by the genome already provides structure that is sufficient for macaques to exhibit adult-like visual representations after a few months ( Movshon & Kiorpes , 1988 ; Kiorpes & Movshon , 2004 ; Seibert , 2018 ) , which restricts the amount of experience dependent learning . Furthermore , different neuronal populations in cortical circuits undergo different plasticity mechanisms : neurons in supragranular and infragranular layers adapt more rapidly than those in layer 4 which receives inputs from lower areas ( Diamond et al. , 1994 ; Schoups et al. , 2001 ) , while current artificial synapses , on the other hand , all change under the same plasticity mechanism . While current models provide a basic understanding of the neural mechanisms of adult ventral stream inference , can we start to build models that provide an understanding of how the ventral stream “ wires itself up ” – models of the initial state at birth and how it develops during postnatal life ? Related Work . Several papers have addressed related questions in machine learning : Distilled student networks can be trained on the outputs of a teacher network ( Hinton et al. , 2015 ; Cho & Hariharan , 2019 ; Tian et al. , 2019 ) , and , in pruning studies , networks with knocked out synapses perform reasonably well ( Cheney et al. , 2017 ; Morcos et al. , 2018 ) , demonstrating that models with many trained parameters can be compressed ( Wu et al. , 2018 ) which is further supported by the convergence of training gradients onto a small subspace ( Gur-Ari et al. , 2018 ) . Tian et al . ( 2020 ) show that a pre-trained encoder ’ s fixed features can be used to train a thin decoder with performance close to full fine-tuning and recent theoretically-driven work has found that training only BatchNorm layers ( Frankle et al. , 2021 ) or determining the right parameters from a large pool of weights ( Frankle et al. , 2019 ; Ramanujan et al. , 2019 ) can already achieve high classification accuracy . Unsupervised approaches are also starting to develop useful representations without requiring many labels by inferring internal labels such as clusters or representational similarity ( Caron et al. , 2018 ; Wu et al. , 2018 ; Zhuang et al. , 2019 ; Hénaff et al. , 2019 ; Konkle & Alvarez , 2020 ; Zhuang et al. , 2020 ) . Many attempts are also being made to make the learning algorithms themselves more biologically plausible ( e.g . Lillicrap et al. , 2016 ; Scellier & Bengio , 2017 ; Pozzi et al. , 2020 ) . Nevertheless , all of these approaches require many synaptic updates in the form of labeled samples or precise machinery to determine the right set of weights . In this work , we take first steps of relating findings in machine learning to neuroscience and using such models to explore hypotheses about the product of evolution ( a model ’ s “ birth state ” ) while simultaneously reducing the number of supervised synaptic updates ( a model ’ s visual experience dependent development ) without sacrificing high brain predictivity . Our contributions follow from a framework in which evolution endows the visual system with a well-chosen , yet still largely random “ birth ” pattern of synaptic connectivity ( architecture + initialization ) , and developmental learning corresponds to training a fraction of the synaptic weights using very few supervised labels . We do not view the proposed changes as fully biological models of post-natal development , only that they more concretely correspond to biology than current models . Solving the entire problem of development all at once is too much for one study , but even partial improvements in this direction will likely be informative to further work . Specifically , 1. we build models with a fraction of supervised updates ( training epochs and labeled images ) that retain high similarity to the primate ventral visual stream ( quantified by a brain predictivity score from benchmarks on Brain-Score ( Schrimpf et al. , 2018 ) ) and find that layers corresponding to higher visual regions such as IT are most dependent on training , 2. we improve the “ at-birth ” synaptic connectivity to show that even low-capacity evolutionarily encoded information might lead to reasonable initial representations with no training at all , 3. we propose a thin , “ critical training ” technique which reduces the number of trained synapses while maintaining high brain predictivity and improves over previous computer vision attempts to minimize trained components , 4. we combine these three techniques to build models with two orders of magnitude fewer supervised synaptic updates but high brain predictivity relative to a fully trained model Code and pre-trained models are available through GitHub : https : //anonymous.4open . science/r/anonymous-3A61/ . 2 MODELING PRIMATE VISION . We evaluate all models on a suite of ventral stream benchmarks in Brain-Score ( Schrimpf et al. , 2018 ; 2020 ) , and we base the new models presented here on the CORnet-S architecture , one of the most accurate models of adult primate visual processing ( Kubilius et al. , 2019 ) . Brain-Score benchmarks . To obtain quantified scores for brain-likeness , we use a thorough set of benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) . To keep scores comparable , we only included those neural benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) with the same predictivity metric . All benchmarks feed the same images to a candidate model that were used for primate experiments while “ recording ” activations or measuring behavioral outputs . Specifically , the V1 and V2 benchmarks present 315 images of naturalistic textures and compare model representations to primate single-unit recordings from Freeman et al . ( 2013 ) ( 102 V1 and 103 V2 neurons ) ; the V4 and IT benchmarks present 2,560 naturalistic images and compare models to primate Utah array recordings from Majaj et al . ( 2015 ) ( 88 V4 and 168 IT electrodes ) . A linear regression is fit from model to primate representations in response to 90 % of the images and its prediction score on the held-out 10 % of images is evaluated with Pearson correlation , cross-validated 10 times . The behavioral benchmark presents 240 images and compares model to primate behavioral responses from Rajalingham et al . ( 2018 ) . A logistic classifier is fit on models ’ penultimate representations on 2,160 separate labeled images . The classifier is then used to estimate probabilities for 240 held-out images . Per-image confusion patterns between model and primate are compared with a Pearson correlation . All benchmark scores are normalized by the respective ceiling . We primarily report the average brain predictivity score as the mean of V1 , V2 , V4 , IT , and behavioral scores . We note that the Brain-Score benchmarks in this study are based on limited data and thus present a possible limitation . Nonetheless , they are the most extensive set of primate ventral stream neuronal and behavioral benchmarks that is currently available and the scores generalize to new experiments ( Kubilius et al. , 2019 ) . Brain-Score provides separate sets of data as public benchmarks which we use to determine the type of distribution in Section 4 , and the layer-to-region commitments of reference models . CORnet-S. One of the current best model architectures on the Brain-Score benchmarks is CORnet-S ( Kubilius et al. , 2019 ) , a shallow recurrent model which anatomically commits to ventral stream regions . CORnet-S has four computational areas , analogous to the ventral visual areas V1 , V2 , V4 , and IT , and a linear decoder that maps from neurons in the model ’ s last visual area to its behavioral choices . The recurrent circuitry ( Figure 3B ) uses up- and down-sampling convolutions to process features and is identical in each of the models visual areas ( except for V1COR ) , but varies by the total number of neurons in each area . We base all models developed here on the CORnet-S architecture and use the same hyper-parameters as proposed in ( Kubilius et al. , 2019 ) . Representations are read out at the end of anatomically corresponding areas . 3 HIGH SCORES IN BRAIN PREDICTIVITY CAN BE ACHIEVED WITH FEW SUPERVISED UPDATES . We evaluated the brain predictivity scores of CORnet-S variants that were trained with a combination of fewer epochs and images . Models were trained with an initial learning rate of 0.1 , divided by 10 when loss did not improve over 3 epochs , and stopping after three decrements . Figure 1 shows model scores on neural and behavioral Brain-Score measures , relative to a model trained for 43 epochs on all 1.28M labeled ImageNet images . In Panel A , we compare the average score over the five brain measures of various models to the number of supervised updates that each model was trained with , defined as the number of labeled images times the number of epochs . While a fully trained model reaches an average score of .42 after 55,040,000 supervised updates ( 43 epochs × 1.28M images ) , a model with only 100,000 updates already achieves 50 % of that score , and 1,000,000 updates increase brain predictivity scores to 76 % . Models are close to convergence score after 10,000,000 supervised updates with performance nearly equal to full training ( 97 % ) . Scores grow logarithmically with an approximate 5 % score increase for every order of magnitude more supervised updates . Figures 1B and C show individual neural and behavioral scores of models trained with fewer training epochs or labeled images independently . Early to mid visual representations ( V1 , V2 , and V4 scores ) are especially closely met with only few supervised updates , reaching 50 % of the final trained model in fractions of the first epoch ( Figure 1B ) . After only one full iteration over the training set , V1 , V2 , and V4 scores are close to their final score ( all > 80 % ) while IT requires two epochs to reach a comparable level . Behavioral scores take slightly longer to converge ( > 80 % after 7 epochs ) . Similarly , when training until convergence with fractions of the 1.28M total images , 50,000 images are sufficient to obtain high neural scores ( 80 % of full training in V1 , V2 , V4 , IT ) . Behavioral scores again require more training : half the standard number of labeled images is needed to surpass 80 % . Concretely relating supervised updates to primate ventral stream development , Seibert ( 2018 ) establishes that no more than∼4 months – or 10 million seconds – of waking visual experience is needed to reach adult-level primate IT cortex ( as assessed by its capability to support adult level object recognition ) . From this estimate , we can compute how many supervised updates per second different models in Figure 1A would require ( assuming those updates are evenly distributed over the 10 million seconds ) . For instance , the fully trained model ’ s 55 million supervised updates translate to 5.5 updates every second , whereas the model with 1 million updates and 76 % relative brain predictivity translates to one labeled image update every 10 seconds which appears more plausible given the upper limit of 2-3 saccades per second in humans ( Yarbus , 1967 ; Gibaldi & Sabatini , 2020 ) . | The paper is concerned with closing the gap between the amount of training in deep networks and in developing brains, as the current deep learning models use an unrealistically large number of synaptic updates. The authors address that with three strategies: less training, weight clustering and training in a subset of layers. All methods are tested individually and in combination with each other on primate ventral stream data. | SP:45d0d17b384044473db2e2e164c56558044d2542 |
On Robust Prefix-Tuning for Text Classification | 1 INTRODUCTION . Large-scale pretrained language models ( LMs ) ( Peters et al. , 2018 ; Devlin et al. , 2019 ; Radford et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ; Raffel et al. , 2020 ; Lewis et al. , 2020 ; Brown et al. , 2020 ; Xue et al. , 2021 ) have proven effective for downstream NLP tasks . While finetuning a pretrained model for a specific task has been the common practice , it comes at the cost of maintaining a full copy of the LM with the parameters entirely modified . The prohibitively huge memory demand poses a severe challenge for the deployment of practical NLP systems , which motivates the development of low-storage adaptation methods ( Houlsby et al. , 2019 ; Li & Liang , 2021 ) . Recently , increasing interest has been focused on prompt-based tuning approaches for pretrained language models ( Wallace et al. , 2019 ; Puri & Catanzaro , 2019 ; Shin et al. , 2020 ; Jiang et al. , 2020b ; Zhong et al. , 2021 ; Gao et al. , 2021 ; Hu et al. , 2021 ; Liu et al. , 2021 ) . By prepending several elaborately-selected tokens to the given input sequences , the LM is triggered to respond with appropriate outputs without updating its parameters . Prefix-tuning ( Li & Liang , 2021 ) introduces the idea of replacing the discrete prompt tokens at the input with the virtual ones at the start of each layer in the LM . By optimizing the layerwise continuous prefix embedding instead of selecting candidates in the vocabulary list , the expressive ability of prompts is further enhanced with a rather small amount of parameters to be updated . As a result , prefix-tuning requires near 1000× fewer task-specific parameters than finetuning the entire pretrained model ( Bommasani et al. , 2021 ) . Despite being lightweight and modular , prefix-tuning is still lacking in robustness . In the NLP community , a variety of techniques for generating adversarial examples have been proposed to attack a text classifier by perturbing inputs ( Zhang et al. , 2020 ) . Conventional attack techniques include character-level ( Eger et al. , 2019 ; He et al. , 2021 ) , word-level ( Alzantot et al. , 2018 ; Ren et al. , 2019 ; Garg & Ramakrishnan , 2020 ) , sentence-level modification ( Iyyer et al. , 2018 ; Ribeiro et al. , 2018 ; Xu et al. , 2021 ) , or a mixture of them ( Ebrahimi et al. , 2018 ; Li et al. , 2019 ) . Instead of perturbing each input sentence separately , recently , universal adversarial triggers ( UAT ) ( Wallace et al. , 2019 ) becomes powerful by prepending the same adversarial tokens to all test inputs . UAT prompts the model to generate malicious outputs , which shares the same spirit with the promptbased tuning approaches . It remains a mystery whether prefix-tuning , a variant of prompt-based tuning techniques , can defend against UAT as well as other different kinds of attacking techniques . In defense of adversarial attacks , different types of defense techniques are developed , including model functional improvement ( Li & Sethy , 2019 ; Jones et al. , 2020 ) , certification ( Jia et al. , 2019 ; Huang et al. , 2019 ; Shi et al. , 2020 ; Xu et al. , 2020 ; Ye et al. , 2020 ) , adversary detection ( Pruthi et al. , 2019 ; Zhou et al. , 2019 ) , and adversarial training ( Miyato et al. , 2017 ; 2019 ; Zhu et al. , 2020 ; Jiang et al. , 2020a ; Liu et al. , 2020 ; Wang et al. , 2021 ; Dong et al. , 2021 ; Zhou et al. , 2021 ) . While these approaches have enhanced model robustness , difficulties emerge when fitted to prefix-tuning . Most of the techniques require modification to the architecture and the parameters of the LM or additional maintenance of adversary detectors . Directly applying such techniques necessitates auxiliary model update and storage , which will inevitably hamper the modularity of prefix-tuning . Moreover , The excessively long time for adversarial training is also a hindrance to the efficient use of prefix-tuning . We ask the following question : Can we improve the robustness of prefix-tuning while preserving its efficiency and modularity , without modifying the pretrained model parameters ? In this work , we propose a robust prefix-tuning framework for text classification . The main idea of our framework is to add an extra batch-level prefix tuned for each batch to the original prefix embedding during test time for robustness enhancement . We first record the layerwise activations in the LM at the position of generating label prediction with correctly classified training data . We project the collected activation matrices of each layer onto low-level canonical manifolds as the charac- terization of “ correct ” model behavior . In this way , the correctness of any layerwise activations at the position of prediction generation can be estimated by projecting to the canonical manifolds and measuring the distance between them . For each test batch during inference , the added extra prefix is tuned on the fly with the original prefix fixed to minimize the calculated distance . Triggered by the summed prefix , the LM is prone to generating correct label predictions . We conduct extensive experiments on three text classification benchmarks and show that the proposed framework substantially improves model robustness against five strong textual attack approaches including input perturbation attack of different levels as well as the UAT attack . To the best of our knowledge , we are the first to propose the defense approach for prefix-tuning while keeping its lightweightness and modularity . Moreover , we provide an interpretation of our robust prefix-tuning framework from the optimal control perspective and pose several directions for future research . 2 PREFIX-TUNING FOR TEXT CLASSIFICATION . Prefix-tuning is a lightweight alternative to finetuning when using large-scale pretrained language models to solve downstream NLP tasks . The intuition of prefix-tuning follows prompt-based methods that a proper context prepended to input sentences triggers the desired response of the LM without changing the large amount of LM parameters . Instead of instantiating the prepended context with discrete tokens , prefix-tuning uses trainable prefix embeddings as a replacement , which is also known as soft prompts . The continuous prefix embeddings enable continuous optimization and are prepended to all Transformer layers to improve expressiveness . Following the notation of Li & Liang ( 2021 ) , the activation at the i-th position of the j-th layer in an L-layer autoregressive Transformer LM is denoted as h ( j ) i . hi = [ h ( 0 ) i ; · · · ; h ( L−1 ) i ] represents the stacked activations : hi = { Pθ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 1 ) where Pidx is the sequence of prefix indices and zi is the i-th token in the input sequence . The activations of the first |Pidx| positions are directly calculated by Pθ . All of the activations at the following positions depend on the prefix as the autoregressive LM follows the left-to-right calculation process . To stabilize the optimization , the prefix embedding matrix Pθ is reparameterized as Pθ [ i , : ] = MLPθ ( P̂θ [ i , : ] ) by a feedforward network MLPθ with a smaller matrix P̂θ . While prefix-tuning is proposed for conditional generation tasks , in this work , we use prefix-tuning for text classification . As shown in Figure 1 , following the protocol of decaNLP ( McCann et al. , 2018 ) , we frame the samples in classification tasks into a SQuAD-like scheme consisting of context , question , and label : the context and the label part refer to the text sequence to be classified and the ground-truth label , while the question part is a prescribed task description sentence fixed for all samples . We denote x = [ context , question , [ ANS ] ] , where [ ANS ] is a special token that separates question and label . We let y = [ label ] and |y| = 1 as the label is one token . At the position that [ ANS ] is inputted , the LM generates the prediction of the next label token , and we denote this position as the output position o . While o can be different for different input x ’ s , in this paper , we omit the relation o = o ( x ) for simplicity . Prefix-tuning aims to steer the LM to maximize the probability of the label . We use all samples in the training setDtr to optimize the prefix Pθ [ i , : ] . The objective is min θ E ( x , y ) ∼DtrL ( y|x ; θ ) = max θ E ( x , y ) ∼Dtr log [ W ( h ( L ) o ) ] y , ( 2 ) where W in the LM transforms the top-layer output h ( L ) o to a probability vector over the vocabulary . With continuous optimization on training samples , prefix-tuning is expected to steer the LM to generate correct label predictions for test data . With the large-scale LM parameters fixed , the obtained task-specific prefix is lightweight and modular . However , prefix-tuning is still vulnerable to text attacks . With the context part perturbed by text attack techniques , the LM can be fooled to generate erroneous label prediction at the output position . Figure 1 shows an example of perturbation : by modifying a single character m in the word remember with k , the prediction of the LM is shifted from positive to negative . Therefore , it remains under exploration how to robustify prefix-tuning without hampering its modularity or introducing additional large model updates and storage . 3 ROBUST PREFIX-TUNING . We propose a robust prefix-tuning framework for text classification . Our intuition follows prefixtuning that proper prefix embeddings prepended to inputs can steer a LM with correct responses . When the inputs are adversarially perturbed , the LM activations at the output position fail to be steered in the correct way by the original prefix Pθ [ i , : ] . Inspired by Khoury & Hadfield-Menell ( 2018 ) that the perturbed data often deviates from the low-dimensional data manifold , our robust prefix-tuning framework uses the layerwise activations by correctly classified training data to construct canonical manifoldsM . When provided with perturbed inputs during inference , we add an extra prefix P ′ψ [ i , : ] tuned for each test batch to Pθ [ i , : ] that aims to rectify the erroneous activations at the output position so that they stay close to the canonical manifolds . In this way , we expect the summed prefix to steer the LM with correct label generation against input perturbations . As shown in Figure 1 , our robust prefix-tuning framework consists of three steps . The first step is collecting correct LM activations at the output position o triggered by Pθ [ i , : ] . We denote SC as the set of correctly classified training examples . For the j-th layer , the collected activation matrix H ( j ) C stacks the j-th layer LM activation at the output position o with the input of all c ∈ SC : H ( j ) C = [ h ( j ) o , c ] ∈ R|SC |×d . ( 3 ) The d represents the dimension of the LM hidden state . In practice , we always have |SC | > > d. The second step is constructing canonical manifolds . We project the collected j-th layer activation matrixH ( j ) C onto a low-level manifoldM ( j ) as the characterization of the correct j-th layer behavior . We use PCA ( Pearson , 1901 ) to get the projectionQ ( j ) onto the canonical manifold of the j-th layer : H̃ ( j ) C = U ( j ) Σ ( j ) V ( j ) T , ( 4 ) Q ( j ) = V ( j ) p T V ( j ) p , ( 5 ) where H̃ ( j ) C = H ( j ) C −11 TH ( j ) C /|SC | normalizes the rows ofH ( j ) C to mitigate the randomness among samples in SC before projection . V ( j ) p consists of the first p singular vectors and Q ( j ) ∈ Rd×d . The third step is tuning P ′ψ [ i , : ] to robustify prefix-tuning during inference . Here the vector P ′ ψ [ i , : ] is not reparameterized by MLP . With the additional prefix P ′ψ [ i , : ] , the token-wise activations become hi = { Pθ [ i , : ] + P ′ ψ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 6 ) For the j-th layer at the output position , the LM activation matrix triggered by Pθ [ i , : ] +P ′ψ [ i , : ] with the potentially perturbed test input batch ST is stacked as H ( j ) T = [ h ( j ) o , t ] ∈ R|ST |×d ( 7 ) for all t ∈ ST . We use the distance from H ( j ) T to the j-th canonical manifoldM ( j ) as the loss for the tuning of P ′ψ [ i , : ] for each batch . Projecting H ( j ) T toM ( j ) yields H ( j ) T Q ( j ) , thus the objective is min ψ N−1∑ j=0 L ( ψ ( j ) , Q ( j ) ) = N−1∑ j=0 ∥∥∥H ( j ) T ( I −Q ( j ) ) ∥∥∥ 2 . ( 8 ) We also replace the H ( j ) T in Eq . ( 8 ) with H ( j ) T − 11 TH ( j ) T /|ST | as normalization before projection to mitigate randomness among test samples when |ST | > 1 . After tuning P ′ψ [ i , : ] , the activated H ( j ) T is closer to M ( j ) . As the manifold characterizes the correct behavior of the j-th layer activation , by regulating the layerwise activations at the output position , the summed prefix Pθ [ i , : ] +P ′ψ [ i , : ] is prone to steering the LM to generate correct label predictions . Our framework is also applicable to other soft prompt-based tuning methods ( Qin & Eisner , 2021 ; Hambardzumyan et al. , 2021 ; Lester et al. , 2021 ; Cho et al. , 2021 ; Tsimpoukelli et al. , 2021 ) by recording the activations of correctly classified training data , constructing canonical manifolds for the soft prompts , and tuning additional soft prompts for robustness during inference . In this work , we conduct experiments on prefix-tuning . Remark . From the optimal control ( OC ) perspective , prefix-tuning can be formalized as seeking the OC of the pretrained LM for downstream tasks , and our robust prefix-tuning can be interpreted as seeking the close-loop control for robust downstream tasks . We attach the details in Appendix G . | This paper focuses on improving the adversarial robustness of prefix tuning (Li et al. 2021), which is a recent parameter-efficient tuning method. Specifically, the paper proposes to add extra batch-level prefixes that are tuned for each test batch on the fly, to minimize the distance between hidden activations of the test samples and the canonical manifold obtained from the hidden activations from correctly classified training samples. The intuition is to optimize the added batch-level prefixes so that the geometry of hidden states from adversarial examples is closer to that of training examples. Experiments on three text classification benchmarks across several different adversarial attacks demonstrate the effectiveness of the method. | SP:d121fbda6f1dd3e0ecc71d70ecf3613b683ed536 |
On Robust Prefix-Tuning for Text Classification | 1 INTRODUCTION . Large-scale pretrained language models ( LMs ) ( Peters et al. , 2018 ; Devlin et al. , 2019 ; Radford et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ; Raffel et al. , 2020 ; Lewis et al. , 2020 ; Brown et al. , 2020 ; Xue et al. , 2021 ) have proven effective for downstream NLP tasks . While finetuning a pretrained model for a specific task has been the common practice , it comes at the cost of maintaining a full copy of the LM with the parameters entirely modified . The prohibitively huge memory demand poses a severe challenge for the deployment of practical NLP systems , which motivates the development of low-storage adaptation methods ( Houlsby et al. , 2019 ; Li & Liang , 2021 ) . Recently , increasing interest has been focused on prompt-based tuning approaches for pretrained language models ( Wallace et al. , 2019 ; Puri & Catanzaro , 2019 ; Shin et al. , 2020 ; Jiang et al. , 2020b ; Zhong et al. , 2021 ; Gao et al. , 2021 ; Hu et al. , 2021 ; Liu et al. , 2021 ) . By prepending several elaborately-selected tokens to the given input sequences , the LM is triggered to respond with appropriate outputs without updating its parameters . Prefix-tuning ( Li & Liang , 2021 ) introduces the idea of replacing the discrete prompt tokens at the input with the virtual ones at the start of each layer in the LM . By optimizing the layerwise continuous prefix embedding instead of selecting candidates in the vocabulary list , the expressive ability of prompts is further enhanced with a rather small amount of parameters to be updated . As a result , prefix-tuning requires near 1000× fewer task-specific parameters than finetuning the entire pretrained model ( Bommasani et al. , 2021 ) . Despite being lightweight and modular , prefix-tuning is still lacking in robustness . In the NLP community , a variety of techniques for generating adversarial examples have been proposed to attack a text classifier by perturbing inputs ( Zhang et al. , 2020 ) . Conventional attack techniques include character-level ( Eger et al. , 2019 ; He et al. , 2021 ) , word-level ( Alzantot et al. , 2018 ; Ren et al. , 2019 ; Garg & Ramakrishnan , 2020 ) , sentence-level modification ( Iyyer et al. , 2018 ; Ribeiro et al. , 2018 ; Xu et al. , 2021 ) , or a mixture of them ( Ebrahimi et al. , 2018 ; Li et al. , 2019 ) . Instead of perturbing each input sentence separately , recently , universal adversarial triggers ( UAT ) ( Wallace et al. , 2019 ) becomes powerful by prepending the same adversarial tokens to all test inputs . UAT prompts the model to generate malicious outputs , which shares the same spirit with the promptbased tuning approaches . It remains a mystery whether prefix-tuning , a variant of prompt-based tuning techniques , can defend against UAT as well as other different kinds of attacking techniques . In defense of adversarial attacks , different types of defense techniques are developed , including model functional improvement ( Li & Sethy , 2019 ; Jones et al. , 2020 ) , certification ( Jia et al. , 2019 ; Huang et al. , 2019 ; Shi et al. , 2020 ; Xu et al. , 2020 ; Ye et al. , 2020 ) , adversary detection ( Pruthi et al. , 2019 ; Zhou et al. , 2019 ) , and adversarial training ( Miyato et al. , 2017 ; 2019 ; Zhu et al. , 2020 ; Jiang et al. , 2020a ; Liu et al. , 2020 ; Wang et al. , 2021 ; Dong et al. , 2021 ; Zhou et al. , 2021 ) . While these approaches have enhanced model robustness , difficulties emerge when fitted to prefix-tuning . Most of the techniques require modification to the architecture and the parameters of the LM or additional maintenance of adversary detectors . Directly applying such techniques necessitates auxiliary model update and storage , which will inevitably hamper the modularity of prefix-tuning . Moreover , The excessively long time for adversarial training is also a hindrance to the efficient use of prefix-tuning . We ask the following question : Can we improve the robustness of prefix-tuning while preserving its efficiency and modularity , without modifying the pretrained model parameters ? In this work , we propose a robust prefix-tuning framework for text classification . The main idea of our framework is to add an extra batch-level prefix tuned for each batch to the original prefix embedding during test time for robustness enhancement . We first record the layerwise activations in the LM at the position of generating label prediction with correctly classified training data . We project the collected activation matrices of each layer onto low-level canonical manifolds as the charac- terization of “ correct ” model behavior . In this way , the correctness of any layerwise activations at the position of prediction generation can be estimated by projecting to the canonical manifolds and measuring the distance between them . For each test batch during inference , the added extra prefix is tuned on the fly with the original prefix fixed to minimize the calculated distance . Triggered by the summed prefix , the LM is prone to generating correct label predictions . We conduct extensive experiments on three text classification benchmarks and show that the proposed framework substantially improves model robustness against five strong textual attack approaches including input perturbation attack of different levels as well as the UAT attack . To the best of our knowledge , we are the first to propose the defense approach for prefix-tuning while keeping its lightweightness and modularity . Moreover , we provide an interpretation of our robust prefix-tuning framework from the optimal control perspective and pose several directions for future research . 2 PREFIX-TUNING FOR TEXT CLASSIFICATION . Prefix-tuning is a lightweight alternative to finetuning when using large-scale pretrained language models to solve downstream NLP tasks . The intuition of prefix-tuning follows prompt-based methods that a proper context prepended to input sentences triggers the desired response of the LM without changing the large amount of LM parameters . Instead of instantiating the prepended context with discrete tokens , prefix-tuning uses trainable prefix embeddings as a replacement , which is also known as soft prompts . The continuous prefix embeddings enable continuous optimization and are prepended to all Transformer layers to improve expressiveness . Following the notation of Li & Liang ( 2021 ) , the activation at the i-th position of the j-th layer in an L-layer autoregressive Transformer LM is denoted as h ( j ) i . hi = [ h ( 0 ) i ; · · · ; h ( L−1 ) i ] represents the stacked activations : hi = { Pθ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 1 ) where Pidx is the sequence of prefix indices and zi is the i-th token in the input sequence . The activations of the first |Pidx| positions are directly calculated by Pθ . All of the activations at the following positions depend on the prefix as the autoregressive LM follows the left-to-right calculation process . To stabilize the optimization , the prefix embedding matrix Pθ is reparameterized as Pθ [ i , : ] = MLPθ ( P̂θ [ i , : ] ) by a feedforward network MLPθ with a smaller matrix P̂θ . While prefix-tuning is proposed for conditional generation tasks , in this work , we use prefix-tuning for text classification . As shown in Figure 1 , following the protocol of decaNLP ( McCann et al. , 2018 ) , we frame the samples in classification tasks into a SQuAD-like scheme consisting of context , question , and label : the context and the label part refer to the text sequence to be classified and the ground-truth label , while the question part is a prescribed task description sentence fixed for all samples . We denote x = [ context , question , [ ANS ] ] , where [ ANS ] is a special token that separates question and label . We let y = [ label ] and |y| = 1 as the label is one token . At the position that [ ANS ] is inputted , the LM generates the prediction of the next label token , and we denote this position as the output position o . While o can be different for different input x ’ s , in this paper , we omit the relation o = o ( x ) for simplicity . Prefix-tuning aims to steer the LM to maximize the probability of the label . We use all samples in the training setDtr to optimize the prefix Pθ [ i , : ] . The objective is min θ E ( x , y ) ∼DtrL ( y|x ; θ ) = max θ E ( x , y ) ∼Dtr log [ W ( h ( L ) o ) ] y , ( 2 ) where W in the LM transforms the top-layer output h ( L ) o to a probability vector over the vocabulary . With continuous optimization on training samples , prefix-tuning is expected to steer the LM to generate correct label predictions for test data . With the large-scale LM parameters fixed , the obtained task-specific prefix is lightweight and modular . However , prefix-tuning is still vulnerable to text attacks . With the context part perturbed by text attack techniques , the LM can be fooled to generate erroneous label prediction at the output position . Figure 1 shows an example of perturbation : by modifying a single character m in the word remember with k , the prediction of the LM is shifted from positive to negative . Therefore , it remains under exploration how to robustify prefix-tuning without hampering its modularity or introducing additional large model updates and storage . 3 ROBUST PREFIX-TUNING . We propose a robust prefix-tuning framework for text classification . Our intuition follows prefixtuning that proper prefix embeddings prepended to inputs can steer a LM with correct responses . When the inputs are adversarially perturbed , the LM activations at the output position fail to be steered in the correct way by the original prefix Pθ [ i , : ] . Inspired by Khoury & Hadfield-Menell ( 2018 ) that the perturbed data often deviates from the low-dimensional data manifold , our robust prefix-tuning framework uses the layerwise activations by correctly classified training data to construct canonical manifoldsM . When provided with perturbed inputs during inference , we add an extra prefix P ′ψ [ i , : ] tuned for each test batch to Pθ [ i , : ] that aims to rectify the erroneous activations at the output position so that they stay close to the canonical manifolds . In this way , we expect the summed prefix to steer the LM with correct label generation against input perturbations . As shown in Figure 1 , our robust prefix-tuning framework consists of three steps . The first step is collecting correct LM activations at the output position o triggered by Pθ [ i , : ] . We denote SC as the set of correctly classified training examples . For the j-th layer , the collected activation matrix H ( j ) C stacks the j-th layer LM activation at the output position o with the input of all c ∈ SC : H ( j ) C = [ h ( j ) o , c ] ∈ R|SC |×d . ( 3 ) The d represents the dimension of the LM hidden state . In practice , we always have |SC | > > d. The second step is constructing canonical manifolds . We project the collected j-th layer activation matrixH ( j ) C onto a low-level manifoldM ( j ) as the characterization of the correct j-th layer behavior . We use PCA ( Pearson , 1901 ) to get the projectionQ ( j ) onto the canonical manifold of the j-th layer : H̃ ( j ) C = U ( j ) Σ ( j ) V ( j ) T , ( 4 ) Q ( j ) = V ( j ) p T V ( j ) p , ( 5 ) where H̃ ( j ) C = H ( j ) C −11 TH ( j ) C /|SC | normalizes the rows ofH ( j ) C to mitigate the randomness among samples in SC before projection . V ( j ) p consists of the first p singular vectors and Q ( j ) ∈ Rd×d . The third step is tuning P ′ψ [ i , : ] to robustify prefix-tuning during inference . Here the vector P ′ ψ [ i , : ] is not reparameterized by MLP . With the additional prefix P ′ψ [ i , : ] , the token-wise activations become hi = { Pθ [ i , : ] + P ′ ψ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 6 ) For the j-th layer at the output position , the LM activation matrix triggered by Pθ [ i , : ] +P ′ψ [ i , : ] with the potentially perturbed test input batch ST is stacked as H ( j ) T = [ h ( j ) o , t ] ∈ R|ST |×d ( 7 ) for all t ∈ ST . We use the distance from H ( j ) T to the j-th canonical manifoldM ( j ) as the loss for the tuning of P ′ψ [ i , : ] for each batch . Projecting H ( j ) T toM ( j ) yields H ( j ) T Q ( j ) , thus the objective is min ψ N−1∑ j=0 L ( ψ ( j ) , Q ( j ) ) = N−1∑ j=0 ∥∥∥H ( j ) T ( I −Q ( j ) ) ∥∥∥ 2 . ( 8 ) We also replace the H ( j ) T in Eq . ( 8 ) with H ( j ) T − 11 TH ( j ) T /|ST | as normalization before projection to mitigate randomness among test samples when |ST | > 1 . After tuning P ′ψ [ i , : ] , the activated H ( j ) T is closer to M ( j ) . As the manifold characterizes the correct behavior of the j-th layer activation , by regulating the layerwise activations at the output position , the summed prefix Pθ [ i , : ] +P ′ψ [ i , : ] is prone to steering the LM to generate correct label predictions . Our framework is also applicable to other soft prompt-based tuning methods ( Qin & Eisner , 2021 ; Hambardzumyan et al. , 2021 ; Lester et al. , 2021 ; Cho et al. , 2021 ; Tsimpoukelli et al. , 2021 ) by recording the activations of correctly classified training data , constructing canonical manifolds for the soft prompts , and tuning additional soft prompts for robustness during inference . In this work , we conduct experiments on prefix-tuning . Remark . From the optimal control ( OC ) perspective , prefix-tuning can be formalized as seeking the OC of the pretrained LM for downstream tasks , and our robust prefix-tuning can be interpreted as seeking the close-loop control for robust downstream tasks . We attach the details in Appendix G . | This paper introduces a tweak to Prefix-Tuning to make it more resilient to adversarial perturbations of the input. The idea is to add a batch-level prefix at inference to the original one which enhances robustness. Critically, Robust Prefix-Tuning (RPT) does not require auxiliary model updates or storage, in contrast with other robustness methods.Thus, this approach makes prefix-tuning more robust while preserving its modularity and low storage requirements. The authors conduct experiments on 3 text classification tasks, 5 textual attacks and different training regimes (normal training, adversarial training and adversarial data augmentation). In nearly all instances, their method improves robustness (sometimes considerably so) while preserving the accuracy on the original text. The authors also present RPT from an optimal control perspective and conduct a qualitative study that shows how RPT impacts attention weights. | SP:d121fbda6f1dd3e0ecc71d70ecf3613b683ed536 |
On Robust Prefix-Tuning for Text Classification | 1 INTRODUCTION . Large-scale pretrained language models ( LMs ) ( Peters et al. , 2018 ; Devlin et al. , 2019 ; Radford et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ; Raffel et al. , 2020 ; Lewis et al. , 2020 ; Brown et al. , 2020 ; Xue et al. , 2021 ) have proven effective for downstream NLP tasks . While finetuning a pretrained model for a specific task has been the common practice , it comes at the cost of maintaining a full copy of the LM with the parameters entirely modified . The prohibitively huge memory demand poses a severe challenge for the deployment of practical NLP systems , which motivates the development of low-storage adaptation methods ( Houlsby et al. , 2019 ; Li & Liang , 2021 ) . Recently , increasing interest has been focused on prompt-based tuning approaches for pretrained language models ( Wallace et al. , 2019 ; Puri & Catanzaro , 2019 ; Shin et al. , 2020 ; Jiang et al. , 2020b ; Zhong et al. , 2021 ; Gao et al. , 2021 ; Hu et al. , 2021 ; Liu et al. , 2021 ) . By prepending several elaborately-selected tokens to the given input sequences , the LM is triggered to respond with appropriate outputs without updating its parameters . Prefix-tuning ( Li & Liang , 2021 ) introduces the idea of replacing the discrete prompt tokens at the input with the virtual ones at the start of each layer in the LM . By optimizing the layerwise continuous prefix embedding instead of selecting candidates in the vocabulary list , the expressive ability of prompts is further enhanced with a rather small amount of parameters to be updated . As a result , prefix-tuning requires near 1000× fewer task-specific parameters than finetuning the entire pretrained model ( Bommasani et al. , 2021 ) . Despite being lightweight and modular , prefix-tuning is still lacking in robustness . In the NLP community , a variety of techniques for generating adversarial examples have been proposed to attack a text classifier by perturbing inputs ( Zhang et al. , 2020 ) . Conventional attack techniques include character-level ( Eger et al. , 2019 ; He et al. , 2021 ) , word-level ( Alzantot et al. , 2018 ; Ren et al. , 2019 ; Garg & Ramakrishnan , 2020 ) , sentence-level modification ( Iyyer et al. , 2018 ; Ribeiro et al. , 2018 ; Xu et al. , 2021 ) , or a mixture of them ( Ebrahimi et al. , 2018 ; Li et al. , 2019 ) . Instead of perturbing each input sentence separately , recently , universal adversarial triggers ( UAT ) ( Wallace et al. , 2019 ) becomes powerful by prepending the same adversarial tokens to all test inputs . UAT prompts the model to generate malicious outputs , which shares the same spirit with the promptbased tuning approaches . It remains a mystery whether prefix-tuning , a variant of prompt-based tuning techniques , can defend against UAT as well as other different kinds of attacking techniques . In defense of adversarial attacks , different types of defense techniques are developed , including model functional improvement ( Li & Sethy , 2019 ; Jones et al. , 2020 ) , certification ( Jia et al. , 2019 ; Huang et al. , 2019 ; Shi et al. , 2020 ; Xu et al. , 2020 ; Ye et al. , 2020 ) , adversary detection ( Pruthi et al. , 2019 ; Zhou et al. , 2019 ) , and adversarial training ( Miyato et al. , 2017 ; 2019 ; Zhu et al. , 2020 ; Jiang et al. , 2020a ; Liu et al. , 2020 ; Wang et al. , 2021 ; Dong et al. , 2021 ; Zhou et al. , 2021 ) . While these approaches have enhanced model robustness , difficulties emerge when fitted to prefix-tuning . Most of the techniques require modification to the architecture and the parameters of the LM or additional maintenance of adversary detectors . Directly applying such techniques necessitates auxiliary model update and storage , which will inevitably hamper the modularity of prefix-tuning . Moreover , The excessively long time for adversarial training is also a hindrance to the efficient use of prefix-tuning . We ask the following question : Can we improve the robustness of prefix-tuning while preserving its efficiency and modularity , without modifying the pretrained model parameters ? In this work , we propose a robust prefix-tuning framework for text classification . The main idea of our framework is to add an extra batch-level prefix tuned for each batch to the original prefix embedding during test time for robustness enhancement . We first record the layerwise activations in the LM at the position of generating label prediction with correctly classified training data . We project the collected activation matrices of each layer onto low-level canonical manifolds as the charac- terization of “ correct ” model behavior . In this way , the correctness of any layerwise activations at the position of prediction generation can be estimated by projecting to the canonical manifolds and measuring the distance between them . For each test batch during inference , the added extra prefix is tuned on the fly with the original prefix fixed to minimize the calculated distance . Triggered by the summed prefix , the LM is prone to generating correct label predictions . We conduct extensive experiments on three text classification benchmarks and show that the proposed framework substantially improves model robustness against five strong textual attack approaches including input perturbation attack of different levels as well as the UAT attack . To the best of our knowledge , we are the first to propose the defense approach for prefix-tuning while keeping its lightweightness and modularity . Moreover , we provide an interpretation of our robust prefix-tuning framework from the optimal control perspective and pose several directions for future research . 2 PREFIX-TUNING FOR TEXT CLASSIFICATION . Prefix-tuning is a lightweight alternative to finetuning when using large-scale pretrained language models to solve downstream NLP tasks . The intuition of prefix-tuning follows prompt-based methods that a proper context prepended to input sentences triggers the desired response of the LM without changing the large amount of LM parameters . Instead of instantiating the prepended context with discrete tokens , prefix-tuning uses trainable prefix embeddings as a replacement , which is also known as soft prompts . The continuous prefix embeddings enable continuous optimization and are prepended to all Transformer layers to improve expressiveness . Following the notation of Li & Liang ( 2021 ) , the activation at the i-th position of the j-th layer in an L-layer autoregressive Transformer LM is denoted as h ( j ) i . hi = [ h ( 0 ) i ; · · · ; h ( L−1 ) i ] represents the stacked activations : hi = { Pθ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 1 ) where Pidx is the sequence of prefix indices and zi is the i-th token in the input sequence . The activations of the first |Pidx| positions are directly calculated by Pθ . All of the activations at the following positions depend on the prefix as the autoregressive LM follows the left-to-right calculation process . To stabilize the optimization , the prefix embedding matrix Pθ is reparameterized as Pθ [ i , : ] = MLPθ ( P̂θ [ i , : ] ) by a feedforward network MLPθ with a smaller matrix P̂θ . While prefix-tuning is proposed for conditional generation tasks , in this work , we use prefix-tuning for text classification . As shown in Figure 1 , following the protocol of decaNLP ( McCann et al. , 2018 ) , we frame the samples in classification tasks into a SQuAD-like scheme consisting of context , question , and label : the context and the label part refer to the text sequence to be classified and the ground-truth label , while the question part is a prescribed task description sentence fixed for all samples . We denote x = [ context , question , [ ANS ] ] , where [ ANS ] is a special token that separates question and label . We let y = [ label ] and |y| = 1 as the label is one token . At the position that [ ANS ] is inputted , the LM generates the prediction of the next label token , and we denote this position as the output position o . While o can be different for different input x ’ s , in this paper , we omit the relation o = o ( x ) for simplicity . Prefix-tuning aims to steer the LM to maximize the probability of the label . We use all samples in the training setDtr to optimize the prefix Pθ [ i , : ] . The objective is min θ E ( x , y ) ∼DtrL ( y|x ; θ ) = max θ E ( x , y ) ∼Dtr log [ W ( h ( L ) o ) ] y , ( 2 ) where W in the LM transforms the top-layer output h ( L ) o to a probability vector over the vocabulary . With continuous optimization on training samples , prefix-tuning is expected to steer the LM to generate correct label predictions for test data . With the large-scale LM parameters fixed , the obtained task-specific prefix is lightweight and modular . However , prefix-tuning is still vulnerable to text attacks . With the context part perturbed by text attack techniques , the LM can be fooled to generate erroneous label prediction at the output position . Figure 1 shows an example of perturbation : by modifying a single character m in the word remember with k , the prediction of the LM is shifted from positive to negative . Therefore , it remains under exploration how to robustify prefix-tuning without hampering its modularity or introducing additional large model updates and storage . 3 ROBUST PREFIX-TUNING . We propose a robust prefix-tuning framework for text classification . Our intuition follows prefixtuning that proper prefix embeddings prepended to inputs can steer a LM with correct responses . When the inputs are adversarially perturbed , the LM activations at the output position fail to be steered in the correct way by the original prefix Pθ [ i , : ] . Inspired by Khoury & Hadfield-Menell ( 2018 ) that the perturbed data often deviates from the low-dimensional data manifold , our robust prefix-tuning framework uses the layerwise activations by correctly classified training data to construct canonical manifoldsM . When provided with perturbed inputs during inference , we add an extra prefix P ′ψ [ i , : ] tuned for each test batch to Pθ [ i , : ] that aims to rectify the erroneous activations at the output position so that they stay close to the canonical manifolds . In this way , we expect the summed prefix to steer the LM with correct label generation against input perturbations . As shown in Figure 1 , our robust prefix-tuning framework consists of three steps . The first step is collecting correct LM activations at the output position o triggered by Pθ [ i , : ] . We denote SC as the set of correctly classified training examples . For the j-th layer , the collected activation matrix H ( j ) C stacks the j-th layer LM activation at the output position o with the input of all c ∈ SC : H ( j ) C = [ h ( j ) o , c ] ∈ R|SC |×d . ( 3 ) The d represents the dimension of the LM hidden state . In practice , we always have |SC | > > d. The second step is constructing canonical manifolds . We project the collected j-th layer activation matrixH ( j ) C onto a low-level manifoldM ( j ) as the characterization of the correct j-th layer behavior . We use PCA ( Pearson , 1901 ) to get the projectionQ ( j ) onto the canonical manifold of the j-th layer : H̃ ( j ) C = U ( j ) Σ ( j ) V ( j ) T , ( 4 ) Q ( j ) = V ( j ) p T V ( j ) p , ( 5 ) where H̃ ( j ) C = H ( j ) C −11 TH ( j ) C /|SC | normalizes the rows ofH ( j ) C to mitigate the randomness among samples in SC before projection . V ( j ) p consists of the first p singular vectors and Q ( j ) ∈ Rd×d . The third step is tuning P ′ψ [ i , : ] to robustify prefix-tuning during inference . Here the vector P ′ ψ [ i , : ] is not reparameterized by MLP . With the additional prefix P ′ψ [ i , : ] , the token-wise activations become hi = { Pθ [ i , : ] + P ′ ψ [ i , : ] , if i ∈ Pidx , LMϕ ( zi , h < i ) , otherwise . ( 6 ) For the j-th layer at the output position , the LM activation matrix triggered by Pθ [ i , : ] +P ′ψ [ i , : ] with the potentially perturbed test input batch ST is stacked as H ( j ) T = [ h ( j ) o , t ] ∈ R|ST |×d ( 7 ) for all t ∈ ST . We use the distance from H ( j ) T to the j-th canonical manifoldM ( j ) as the loss for the tuning of P ′ψ [ i , : ] for each batch . Projecting H ( j ) T toM ( j ) yields H ( j ) T Q ( j ) , thus the objective is min ψ N−1∑ j=0 L ( ψ ( j ) , Q ( j ) ) = N−1∑ j=0 ∥∥∥H ( j ) T ( I −Q ( j ) ) ∥∥∥ 2 . ( 8 ) We also replace the H ( j ) T in Eq . ( 8 ) with H ( j ) T − 11 TH ( j ) T /|ST | as normalization before projection to mitigate randomness among test samples when |ST | > 1 . After tuning P ′ψ [ i , : ] , the activated H ( j ) T is closer to M ( j ) . As the manifold characterizes the correct behavior of the j-th layer activation , by regulating the layerwise activations at the output position , the summed prefix Pθ [ i , : ] +P ′ψ [ i , : ] is prone to steering the LM to generate correct label predictions . Our framework is also applicable to other soft prompt-based tuning methods ( Qin & Eisner , 2021 ; Hambardzumyan et al. , 2021 ; Lester et al. , 2021 ; Cho et al. , 2021 ; Tsimpoukelli et al. , 2021 ) by recording the activations of correctly classified training data , constructing canonical manifolds for the soft prompts , and tuning additional soft prompts for robustness during inference . In this work , we conduct experiments on prefix-tuning . Remark . From the optimal control ( OC ) perspective , prefix-tuning can be formalized as seeking the OC of the pretrained LM for downstream tasks , and our robust prefix-tuning can be interpreted as seeking the close-loop control for robust downstream tasks . We attach the details in Appendix G . | The paper is a focused contribution at the intersection of defending against text attacks and prompt tuning. The paper requires the reader to understand the context and motivation of several different things before understanding the contribution of the paper. First, adversarial examples can attack a text classifier, such as UAT. Second, various techniques defend against these attacks in different way. However, these techniques requiring modifying the parameters of the LM or other additional computational burdens. These techniques can be used with prompt tuning, but then the benefits of prompt tuning go away. Hence, there ought to be a technique that improves the robustness of prompt tuning without removing its benefits over regular finetuning. The paper proposes such a technique and do experiments for three text classification tasks and various adversarial attacks. | SP:d121fbda6f1dd3e0ecc71d70ecf3613b683ed536 |
Scalable One-Pass Optimisation of High-Dimensional Weight-Update Hyperparameters by Implicit Differentiation | 1 INTRODUCTION . Many machine learning methods are governed by hyperparameters : quantities other than model parameters or weights which nonetheless influence training ( e.g . optimiser settings , dropout probabilities and dataset configurations ) . As suitable hyperparameter selection is crucial to system performance ( e.g . Kohavi & John ( 1995 ) ) , it is a pillar of efforts to automate machine learning ( Hutter et al. , 2018 , Chapter 1 ) , spawning several hyperparameter optimisation ( HPO ) algorithms ( e.g . Bergstra & Bengio ( 2012 ) ; Snoek et al . ( 2012 ; 2015 ) ; Falkner et al . ( 2018 ) ) . However , HPO is computationally intensive and random search is an unexpectedly strong ( but beatable ; Turner et al . ( 2021 ) ) baseline ; beyond random or grid searches , HPO is relatively underused in research ( Bouthillier & Varoquaux , 2020 ) . Recently , Lorraine et al . ( 2020 ) used gradient-based updates to adjust hyperparameters during training , displaying impressive optimisation performance and scalability to high-dimensional hyperparameters . Despite their computational efficiency ( since updates occur before final training performance is known ) , Lorraine et al. ’ s algorithm only applies to hyperparameters on which the loss function depends explicitly ( such as ` 2 regularisation ) , notably excluding optimiser hyperparameters . Our work extends Lorraine et al. ’ s algorithm to support arbitrary continuous inputs to a differentiable weight update formula , including learning rates and momentum factors . We demonstrate our algorithm handles a range of hyperparameter initialisations and datasets , improving test loss after a single training episode ( ‘ one pass ’ ) . Relaxing differentiation-through-optimisation ( Domke , 2012 ) and hypergradient descent ’ s ( Baydin et al. , 2018 ) exactness allows us to improve computational and memory efficiency . Our scalable one-pass method improves performance from arbitrary hyperparameter initialisations , and could be augmented with a further search over those initialisations if desired . 2 WEIGHT-UPDATE HYPERPARAMETER TUNING . In this section , we develop our method . Expanded derivations and a summary of differences from Lorraine et al . ( 2020 ) are given in Appendix C. exact hypergradients from the implicit function theorem ( IFT ) ( ) , with our method ’ s approximate hypergradients ( ) superimposed . We target optimal validation loss ( ) , adjusting weights w based on the training loss . Classical weight updates ( for fixed hyperparameters λ ) converge ( , ) to the best-response line w∗ ( λ ) ( ) ; the IFT gives hyperparameter updates ( ) leading to a minimum of validation loss along w∗ ( λ ) . Our approximate hyperparameter updates ( ) differ in magnitude from these exact updates , but still give useful guidance . 2.1 IMPLICIT FUNCTION THEOREM IN BILEVEL OPTIMISATION . Consider some model with learnable parameters w , training loss LT , optimisation hyperparameters λ and validation loss LV . We use w∗ , λ∗ to represent the optimal values of these quantities , found by solving the following bilevel optimisation problem : ( a ) λ∗ = arg min λ LV ( λ , w∗ ( λ ) ) , such that ( b ) w∗ ( λ ) = arg min w LT ( λ , w ) . ( 1 ) The optimal model parameters w∗ may vary with λ , making LV an implicit function of λ alone . We approach the outer optimisation ( 1a ) similarly to Lorraine et al . ( 2020 ) and Majumder et al . ( 2019 ) , using the hypergradient : the total derivative of LV with respect to the hyperparameters λ . One strategy for solving ( 1 ) is therefore to alternate between updating w for several steps using ∂LT∂w and updating λ using the hypergradient , as shown in Figure 1 ( by and ) . Carefully distinguishing the total differential dλ and the partial differential ∂λ , we have dLV dλ = ∂LV ∂λ + ∂LV ∂w∗ ∂w∗ ∂λ . ( 2 ) While derivatives of LV are easily computed for typical loss functions , the final derivative of the optimal model parameters ( ∂w ∗ ∂λ ) presents some difficulty . Letting square brackets indicate the evaluation of the interior at the subscripted values , we may rewrite ∂w ∗ ∂λ as follows : Theorem 1 ( Cauchy ’ s Implicit Function Theorem ( IFT ) ) Suppose for some λ′ and w′ that [ ∂LT ∂w ] λ′ , w′ = 0 . If ∂LT∂w is a continuously differentiable function with invertible Jacobian , then there exists a function w∗ ( λ ) over an open subset of hyperparameter space , such that λ′ lies in the open subset , [ ∂LT ∂w ] λ , w∗ ( λ ) = 0 and ∂w∗ ∂λ = − ( ∂2LT ∂w∂wT ) −1 ∂2LT ∂w∂λT . ( 3 ) w∗ ( λ ) is called the best response of w to λ ( Figure 1 ) . While ( 3 ) suggests a route to computing ∂w ∗ ∂λ , inverting a potentially high-dimensional Hessian in w is not computationally tractable . 2.2 APPROXIMATE BEST-RESPONSE DERIVATIVE . To develop and justify a computationally tractable approximation to ( 3 ) , we mirror the strategy of Lorraine et al . ( 2020 ) . Consider the broad class of weight optimisers with updates of the form wi ( λ ) = wi−1 ( λ ) − u ( λ , wi−1 ( λ ) ) ( 4 ) for some arbitrary differentiable function u , with i indexing each update iteration . We deviate here from the approach of Lorraine et al . ( 2020 ) by admitting general functions u ( λ , w ) , rather than assuming the particular choice uSGD = η ∂LT∂w ( see Appendix A.4 for more details ) . In particular , this allows λ to include optimiser hyperparameters . Differentiating ( 4 ) and unrolling the recursion gives [ ∂wi ∂λ ] λ′ = − ∑ 0≤j < i ( ∏ 0≤k < j [ I− ∂u ∂w ] λ′ , wi−1−k ) [ ∂u ∂λ ] λ′ , wi−1−j , ( 5 ) where j indexes our steps back through time from wi−1 to w0 , and all w depend on the current hyperparameters λ′ — see Appendix C.2 for the full derivation . Now , we follow Lorraine et al . and assume w0 , . . . , wi−1 to be equal to wi . With this , we simplify the product in ( 5 ) to a jth power by evaluating all derivatives at wi . This result is then used to approximate ∂w ∗ ∂λ by further assuming that wi ≈ w∗ . These two approximations lead to [ ∂wi ∂λ ] λ′ ≈ − ∑ 0≤j < i ( I− ∂u ∂w ) j ∂u ∂λ λ′ , wi ( λ′ ) ≈ [ ∂w∗ ∂λ ] λ′ . ( 6 ) We reinterpret i as a predefined look-back distance , trading off accuracy and computational efficiency . The combination of these approximations implies wi = w∗ for all i , which is initially inaccurate , but which we would expect to become more correct as training proceeds . In mitigation , we perform several weight updates prior to each hyperparameter update . This means derivatives in earlier terms of the series of ( 6 ) ( which are likely the largest , dominant terms ) are evaluated at weights closer to w∗ , therefore making the summation more accurate . In Section 4 , we show that the approximations described here result in an algorithm that is both practical and effective . Our approximate result ( 6 ) combines the general weight update of Majumder et al . ( 2019 ) with the overall approach and constant-weight assumption of Lorraine et al . ( 2020 ) . The latter empirically show that an approximation similar to ( 6 ) leads to a directionally-accurate approximate hypergradient ; we illustrate the approximate updates from our derivations in Figure 1 ( by ) . 2.3 CONVERGENCE TO BEST-RESPONSE DERIVATIVE . To justify the approximations in ( 6 ) , note that the central part of that equation is a truncated Neumann series . Taking the limit i→∞ , when such a limit exists , results in the closed form [ ∂w∗ ∂λ ] λ′ ≈ − [ ( ∂u ∂w ) −1 ∂u ∂λ ] λ′ , w∗ ( λ′ ) . ( 7 ) This is precisely the result of the IFT ( Theorem 1 ) applied to u instead of ∂LT∂w ; that is , substituting the simple SGD update uSGD ( λ , w ) = η ∂LT∂w into ( 7 ) recovers ( 3 ) exactly . Thus , under certain conditions , our approximation ( 6 ) converges to the true best-response Jacobian in the limit of infinitely long look-back windows . 2.4 HYPERPARAMETER UPDATES . Substituting ( 6 ) into ( 2 ) yields a tractable approximation for the hypergradient dLVdλ , with which we can update hyperparameters by gradient descent . Our implementation in Algorithm 1 ( Figure 4 ) closely parallels Lorraine et al. ’ s algorithm , invoking Jacobian-vector products ( Pearlmutter , 1994 ) during gradient computation for memory efficiency via the grad_outputs argument , which also provides the repeated multiplication for the jth power in ( 6 ) . Thus , we retain the O ( |w| + |λ| ) time and memory cost of Lorraine et al . ( 2020 ) , where | · | denotes cardinality . The core loop to compute the summation in ( 6 ) comes from an algorithm of Liao et al . ( 2018 ) . Note that Algorithm 1 approximates dLVdλ retrospectively by considering only the last weight update rather than any future weight updates . Unlike differentiation-through-optimisation ( Domke , 2012 ) , Algorithm 1 crucially estimates hypergradients without reference to old model parameters , thanks to the approximate-hypergradient construction of Lorraine et al . ( 2020 ) and ( 6 ) . We thus do not store network weights at multiple time steps , so gradient-based HPO becomes possible on previously-intractable large-scale problems . In essence , we develop an approximation to online hypergradient descent ( Baydin et al. , 2018 ) . Optimiser hyperparameters generally do not affect the optimal weights , suggesting their hypergradients should be zero . However , in practice , w∗ is better reinterpreted as the approximately optimal weights obtained after a finite training episode . These certainly depend on the optimiser hyperparameters , which govern the convergence of w , thus justifying our use of the bilevel framework . We emphasise training is not reset after each hyperparameter update — we simply continue training from where we left off , using the new hyperparameters . Consequently , Algorithm 1 avoids the time cost of multiple training restarts . While our locally greedy hyperparameter updates threaten a short-horizon bias ( Wu et al. , 2018 ) , we still realise practical improvements in our experiments . 2.5 REINTERPRETATION OF ITERATIVE OPTIMISATION . Originally , we stated the IFT ( 3 ) in terms of minima of LT ( zeros of ∂LT∂w ) , and substituting uSGD = η ∂LT∂w into ( 7 ) recovers this form of ( 3 ) . However , in general , ( 7 ) recovers the Theorem for zeros of u , which are not necessarily minima of the training loss . Despite this , our development can be compared to Lorraine et al . ( 2020 ) by expressing u as the derivative of an augmented ‘ pseudo-loss ’ function . Consider again the simple SGD update uSGD , which provides the weight update rule wi = wi−1 − η ∂LT∂w . By trivially defining a pseudo-loss L = ηLT , we may absorb η into a loss-like derivative , yielding wi = wi−1 − ∂L∂w . More generally , we may write L = ∫ u ( λ , w ) dw . Expressing the update in this form suggests a reinterpretation of the role of optimiser hyperparameters . Conventionally , our visualisation of gradient descent has the learning rate control the size of steps over some undulating landscape . Instead , we propose fixing a unit step size , with the ‘ learning rate ’ scaling the landscape underneath . Similarly , we suppose a ‘ momentum ’ could , at every point , locally squash the loss surface in the negative-gradient direction and stretch it in the positive-gradient direction . In aggregate , these transformations straighten out optimisation trajectories and bring local optima closer to the current point . While more complex hyperparameters lack a clear visualisation in this framework , it nevertheless allows a broader class of hyperparameters to ‘ directly alter the loss function ’ instead of remaining completely independent , circumventing the problem with optimiser hyperparameters noted by Lorraine et al . ( 2020 ) . Figure 2 and Appendix A.3 support this argument . | This paper tackles the hyperparameter optimization problem with a one-pass approach that alternatively optimizes over machine learning model parameters and hyperparameters. To optimize over a bilevel optimization problem, this paper generalizes Lorraine et al. (2019) by replacing the gradient update of parameters with a more general parametric form, thus allowing the hyperparameters to be updated alongside parameters by gradients coming from truncated Neumann series. | SP:2f9d25bc672d6dc9321e7b394ec1c0523deee10e |
Scalable One-Pass Optimisation of High-Dimensional Weight-Update Hyperparameters by Implicit Differentiation | 1 INTRODUCTION . Many machine learning methods are governed by hyperparameters : quantities other than model parameters or weights which nonetheless influence training ( e.g . optimiser settings , dropout probabilities and dataset configurations ) . As suitable hyperparameter selection is crucial to system performance ( e.g . Kohavi & John ( 1995 ) ) , it is a pillar of efforts to automate machine learning ( Hutter et al. , 2018 , Chapter 1 ) , spawning several hyperparameter optimisation ( HPO ) algorithms ( e.g . Bergstra & Bengio ( 2012 ) ; Snoek et al . ( 2012 ; 2015 ) ; Falkner et al . ( 2018 ) ) . However , HPO is computationally intensive and random search is an unexpectedly strong ( but beatable ; Turner et al . ( 2021 ) ) baseline ; beyond random or grid searches , HPO is relatively underused in research ( Bouthillier & Varoquaux , 2020 ) . Recently , Lorraine et al . ( 2020 ) used gradient-based updates to adjust hyperparameters during training , displaying impressive optimisation performance and scalability to high-dimensional hyperparameters . Despite their computational efficiency ( since updates occur before final training performance is known ) , Lorraine et al. ’ s algorithm only applies to hyperparameters on which the loss function depends explicitly ( such as ` 2 regularisation ) , notably excluding optimiser hyperparameters . Our work extends Lorraine et al. ’ s algorithm to support arbitrary continuous inputs to a differentiable weight update formula , including learning rates and momentum factors . We demonstrate our algorithm handles a range of hyperparameter initialisations and datasets , improving test loss after a single training episode ( ‘ one pass ’ ) . Relaxing differentiation-through-optimisation ( Domke , 2012 ) and hypergradient descent ’ s ( Baydin et al. , 2018 ) exactness allows us to improve computational and memory efficiency . Our scalable one-pass method improves performance from arbitrary hyperparameter initialisations , and could be augmented with a further search over those initialisations if desired . 2 WEIGHT-UPDATE HYPERPARAMETER TUNING . In this section , we develop our method . Expanded derivations and a summary of differences from Lorraine et al . ( 2020 ) are given in Appendix C. exact hypergradients from the implicit function theorem ( IFT ) ( ) , with our method ’ s approximate hypergradients ( ) superimposed . We target optimal validation loss ( ) , adjusting weights w based on the training loss . Classical weight updates ( for fixed hyperparameters λ ) converge ( , ) to the best-response line w∗ ( λ ) ( ) ; the IFT gives hyperparameter updates ( ) leading to a minimum of validation loss along w∗ ( λ ) . Our approximate hyperparameter updates ( ) differ in magnitude from these exact updates , but still give useful guidance . 2.1 IMPLICIT FUNCTION THEOREM IN BILEVEL OPTIMISATION . Consider some model with learnable parameters w , training loss LT , optimisation hyperparameters λ and validation loss LV . We use w∗ , λ∗ to represent the optimal values of these quantities , found by solving the following bilevel optimisation problem : ( a ) λ∗ = arg min λ LV ( λ , w∗ ( λ ) ) , such that ( b ) w∗ ( λ ) = arg min w LT ( λ , w ) . ( 1 ) The optimal model parameters w∗ may vary with λ , making LV an implicit function of λ alone . We approach the outer optimisation ( 1a ) similarly to Lorraine et al . ( 2020 ) and Majumder et al . ( 2019 ) , using the hypergradient : the total derivative of LV with respect to the hyperparameters λ . One strategy for solving ( 1 ) is therefore to alternate between updating w for several steps using ∂LT∂w and updating λ using the hypergradient , as shown in Figure 1 ( by and ) . Carefully distinguishing the total differential dλ and the partial differential ∂λ , we have dLV dλ = ∂LV ∂λ + ∂LV ∂w∗ ∂w∗ ∂λ . ( 2 ) While derivatives of LV are easily computed for typical loss functions , the final derivative of the optimal model parameters ( ∂w ∗ ∂λ ) presents some difficulty . Letting square brackets indicate the evaluation of the interior at the subscripted values , we may rewrite ∂w ∗ ∂λ as follows : Theorem 1 ( Cauchy ’ s Implicit Function Theorem ( IFT ) ) Suppose for some λ′ and w′ that [ ∂LT ∂w ] λ′ , w′ = 0 . If ∂LT∂w is a continuously differentiable function with invertible Jacobian , then there exists a function w∗ ( λ ) over an open subset of hyperparameter space , such that λ′ lies in the open subset , [ ∂LT ∂w ] λ , w∗ ( λ ) = 0 and ∂w∗ ∂λ = − ( ∂2LT ∂w∂wT ) −1 ∂2LT ∂w∂λT . ( 3 ) w∗ ( λ ) is called the best response of w to λ ( Figure 1 ) . While ( 3 ) suggests a route to computing ∂w ∗ ∂λ , inverting a potentially high-dimensional Hessian in w is not computationally tractable . 2.2 APPROXIMATE BEST-RESPONSE DERIVATIVE . To develop and justify a computationally tractable approximation to ( 3 ) , we mirror the strategy of Lorraine et al . ( 2020 ) . Consider the broad class of weight optimisers with updates of the form wi ( λ ) = wi−1 ( λ ) − u ( λ , wi−1 ( λ ) ) ( 4 ) for some arbitrary differentiable function u , with i indexing each update iteration . We deviate here from the approach of Lorraine et al . ( 2020 ) by admitting general functions u ( λ , w ) , rather than assuming the particular choice uSGD = η ∂LT∂w ( see Appendix A.4 for more details ) . In particular , this allows λ to include optimiser hyperparameters . Differentiating ( 4 ) and unrolling the recursion gives [ ∂wi ∂λ ] λ′ = − ∑ 0≤j < i ( ∏ 0≤k < j [ I− ∂u ∂w ] λ′ , wi−1−k ) [ ∂u ∂λ ] λ′ , wi−1−j , ( 5 ) where j indexes our steps back through time from wi−1 to w0 , and all w depend on the current hyperparameters λ′ — see Appendix C.2 for the full derivation . Now , we follow Lorraine et al . and assume w0 , . . . , wi−1 to be equal to wi . With this , we simplify the product in ( 5 ) to a jth power by evaluating all derivatives at wi . This result is then used to approximate ∂w ∗ ∂λ by further assuming that wi ≈ w∗ . These two approximations lead to [ ∂wi ∂λ ] λ′ ≈ − ∑ 0≤j < i ( I− ∂u ∂w ) j ∂u ∂λ λ′ , wi ( λ′ ) ≈ [ ∂w∗ ∂λ ] λ′ . ( 6 ) We reinterpret i as a predefined look-back distance , trading off accuracy and computational efficiency . The combination of these approximations implies wi = w∗ for all i , which is initially inaccurate , but which we would expect to become more correct as training proceeds . In mitigation , we perform several weight updates prior to each hyperparameter update . This means derivatives in earlier terms of the series of ( 6 ) ( which are likely the largest , dominant terms ) are evaluated at weights closer to w∗ , therefore making the summation more accurate . In Section 4 , we show that the approximations described here result in an algorithm that is both practical and effective . Our approximate result ( 6 ) combines the general weight update of Majumder et al . ( 2019 ) with the overall approach and constant-weight assumption of Lorraine et al . ( 2020 ) . The latter empirically show that an approximation similar to ( 6 ) leads to a directionally-accurate approximate hypergradient ; we illustrate the approximate updates from our derivations in Figure 1 ( by ) . 2.3 CONVERGENCE TO BEST-RESPONSE DERIVATIVE . To justify the approximations in ( 6 ) , note that the central part of that equation is a truncated Neumann series . Taking the limit i→∞ , when such a limit exists , results in the closed form [ ∂w∗ ∂λ ] λ′ ≈ − [ ( ∂u ∂w ) −1 ∂u ∂λ ] λ′ , w∗ ( λ′ ) . ( 7 ) This is precisely the result of the IFT ( Theorem 1 ) applied to u instead of ∂LT∂w ; that is , substituting the simple SGD update uSGD ( λ , w ) = η ∂LT∂w into ( 7 ) recovers ( 3 ) exactly . Thus , under certain conditions , our approximation ( 6 ) converges to the true best-response Jacobian in the limit of infinitely long look-back windows . 2.4 HYPERPARAMETER UPDATES . Substituting ( 6 ) into ( 2 ) yields a tractable approximation for the hypergradient dLVdλ , with which we can update hyperparameters by gradient descent . Our implementation in Algorithm 1 ( Figure 4 ) closely parallels Lorraine et al. ’ s algorithm , invoking Jacobian-vector products ( Pearlmutter , 1994 ) during gradient computation for memory efficiency via the grad_outputs argument , which also provides the repeated multiplication for the jth power in ( 6 ) . Thus , we retain the O ( |w| + |λ| ) time and memory cost of Lorraine et al . ( 2020 ) , where | · | denotes cardinality . The core loop to compute the summation in ( 6 ) comes from an algorithm of Liao et al . ( 2018 ) . Note that Algorithm 1 approximates dLVdλ retrospectively by considering only the last weight update rather than any future weight updates . Unlike differentiation-through-optimisation ( Domke , 2012 ) , Algorithm 1 crucially estimates hypergradients without reference to old model parameters , thanks to the approximate-hypergradient construction of Lorraine et al . ( 2020 ) and ( 6 ) . We thus do not store network weights at multiple time steps , so gradient-based HPO becomes possible on previously-intractable large-scale problems . In essence , we develop an approximation to online hypergradient descent ( Baydin et al. , 2018 ) . Optimiser hyperparameters generally do not affect the optimal weights , suggesting their hypergradients should be zero . However , in practice , w∗ is better reinterpreted as the approximately optimal weights obtained after a finite training episode . These certainly depend on the optimiser hyperparameters , which govern the convergence of w , thus justifying our use of the bilevel framework . We emphasise training is not reset after each hyperparameter update — we simply continue training from where we left off , using the new hyperparameters . Consequently , Algorithm 1 avoids the time cost of multiple training restarts . While our locally greedy hyperparameter updates threaten a short-horizon bias ( Wu et al. , 2018 ) , we still realise practical improvements in our experiments . 2.5 REINTERPRETATION OF ITERATIVE OPTIMISATION . Originally , we stated the IFT ( 3 ) in terms of minima of LT ( zeros of ∂LT∂w ) , and substituting uSGD = η ∂LT∂w into ( 7 ) recovers this form of ( 3 ) . However , in general , ( 7 ) recovers the Theorem for zeros of u , which are not necessarily minima of the training loss . Despite this , our development can be compared to Lorraine et al . ( 2020 ) by expressing u as the derivative of an augmented ‘ pseudo-loss ’ function . Consider again the simple SGD update uSGD , which provides the weight update rule wi = wi−1 − η ∂LT∂w . By trivially defining a pseudo-loss L = ηLT , we may absorb η into a loss-like derivative , yielding wi = wi−1 − ∂L∂w . More generally , we may write L = ∫ u ( λ , w ) dw . Expressing the update in this form suggests a reinterpretation of the role of optimiser hyperparameters . Conventionally , our visualisation of gradient descent has the learning rate control the size of steps over some undulating landscape . Instead , we propose fixing a unit step size , with the ‘ learning rate ’ scaling the landscape underneath . Similarly , we suppose a ‘ momentum ’ could , at every point , locally squash the loss surface in the negative-gradient direction and stretch it in the positive-gradient direction . In aggregate , these transformations straighten out optimisation trajectories and bring local optima closer to the current point . While more complex hyperparameters lack a clear visualisation in this framework , it nevertheless allows a broader class of hyperparameters to ‘ directly alter the loss function ’ instead of remaining completely independent , circumventing the problem with optimiser hyperparameters noted by Lorraine et al . ( 2020 ) . Figure 2 and Appendix A.3 support this argument . | The paper aims to accelerate HPO optimization by allowing for retraining when new hyperparameters are proposed, while being faster and more flexible that existing hypergradient-based one-pass methods. This results in a novel HPO one-pass technique that works with any continuous hyperparameter within a differentiable model weight update, such as learning rates. In a good range of experiments, the authors show that their proposal is faster than baselines. | SP:2f9d25bc672d6dc9321e7b394ec1c0523deee10e |
Scalable One-Pass Optimisation of High-Dimensional Weight-Update Hyperparameters by Implicit Differentiation | 1 INTRODUCTION . Many machine learning methods are governed by hyperparameters : quantities other than model parameters or weights which nonetheless influence training ( e.g . optimiser settings , dropout probabilities and dataset configurations ) . As suitable hyperparameter selection is crucial to system performance ( e.g . Kohavi & John ( 1995 ) ) , it is a pillar of efforts to automate machine learning ( Hutter et al. , 2018 , Chapter 1 ) , spawning several hyperparameter optimisation ( HPO ) algorithms ( e.g . Bergstra & Bengio ( 2012 ) ; Snoek et al . ( 2012 ; 2015 ) ; Falkner et al . ( 2018 ) ) . However , HPO is computationally intensive and random search is an unexpectedly strong ( but beatable ; Turner et al . ( 2021 ) ) baseline ; beyond random or grid searches , HPO is relatively underused in research ( Bouthillier & Varoquaux , 2020 ) . Recently , Lorraine et al . ( 2020 ) used gradient-based updates to adjust hyperparameters during training , displaying impressive optimisation performance and scalability to high-dimensional hyperparameters . Despite their computational efficiency ( since updates occur before final training performance is known ) , Lorraine et al. ’ s algorithm only applies to hyperparameters on which the loss function depends explicitly ( such as ` 2 regularisation ) , notably excluding optimiser hyperparameters . Our work extends Lorraine et al. ’ s algorithm to support arbitrary continuous inputs to a differentiable weight update formula , including learning rates and momentum factors . We demonstrate our algorithm handles a range of hyperparameter initialisations and datasets , improving test loss after a single training episode ( ‘ one pass ’ ) . Relaxing differentiation-through-optimisation ( Domke , 2012 ) and hypergradient descent ’ s ( Baydin et al. , 2018 ) exactness allows us to improve computational and memory efficiency . Our scalable one-pass method improves performance from arbitrary hyperparameter initialisations , and could be augmented with a further search over those initialisations if desired . 2 WEIGHT-UPDATE HYPERPARAMETER TUNING . In this section , we develop our method . Expanded derivations and a summary of differences from Lorraine et al . ( 2020 ) are given in Appendix C. exact hypergradients from the implicit function theorem ( IFT ) ( ) , with our method ’ s approximate hypergradients ( ) superimposed . We target optimal validation loss ( ) , adjusting weights w based on the training loss . Classical weight updates ( for fixed hyperparameters λ ) converge ( , ) to the best-response line w∗ ( λ ) ( ) ; the IFT gives hyperparameter updates ( ) leading to a minimum of validation loss along w∗ ( λ ) . Our approximate hyperparameter updates ( ) differ in magnitude from these exact updates , but still give useful guidance . 2.1 IMPLICIT FUNCTION THEOREM IN BILEVEL OPTIMISATION . Consider some model with learnable parameters w , training loss LT , optimisation hyperparameters λ and validation loss LV . We use w∗ , λ∗ to represent the optimal values of these quantities , found by solving the following bilevel optimisation problem : ( a ) λ∗ = arg min λ LV ( λ , w∗ ( λ ) ) , such that ( b ) w∗ ( λ ) = arg min w LT ( λ , w ) . ( 1 ) The optimal model parameters w∗ may vary with λ , making LV an implicit function of λ alone . We approach the outer optimisation ( 1a ) similarly to Lorraine et al . ( 2020 ) and Majumder et al . ( 2019 ) , using the hypergradient : the total derivative of LV with respect to the hyperparameters λ . One strategy for solving ( 1 ) is therefore to alternate between updating w for several steps using ∂LT∂w and updating λ using the hypergradient , as shown in Figure 1 ( by and ) . Carefully distinguishing the total differential dλ and the partial differential ∂λ , we have dLV dλ = ∂LV ∂λ + ∂LV ∂w∗ ∂w∗ ∂λ . ( 2 ) While derivatives of LV are easily computed for typical loss functions , the final derivative of the optimal model parameters ( ∂w ∗ ∂λ ) presents some difficulty . Letting square brackets indicate the evaluation of the interior at the subscripted values , we may rewrite ∂w ∗ ∂λ as follows : Theorem 1 ( Cauchy ’ s Implicit Function Theorem ( IFT ) ) Suppose for some λ′ and w′ that [ ∂LT ∂w ] λ′ , w′ = 0 . If ∂LT∂w is a continuously differentiable function with invertible Jacobian , then there exists a function w∗ ( λ ) over an open subset of hyperparameter space , such that λ′ lies in the open subset , [ ∂LT ∂w ] λ , w∗ ( λ ) = 0 and ∂w∗ ∂λ = − ( ∂2LT ∂w∂wT ) −1 ∂2LT ∂w∂λT . ( 3 ) w∗ ( λ ) is called the best response of w to λ ( Figure 1 ) . While ( 3 ) suggests a route to computing ∂w ∗ ∂λ , inverting a potentially high-dimensional Hessian in w is not computationally tractable . 2.2 APPROXIMATE BEST-RESPONSE DERIVATIVE . To develop and justify a computationally tractable approximation to ( 3 ) , we mirror the strategy of Lorraine et al . ( 2020 ) . Consider the broad class of weight optimisers with updates of the form wi ( λ ) = wi−1 ( λ ) − u ( λ , wi−1 ( λ ) ) ( 4 ) for some arbitrary differentiable function u , with i indexing each update iteration . We deviate here from the approach of Lorraine et al . ( 2020 ) by admitting general functions u ( λ , w ) , rather than assuming the particular choice uSGD = η ∂LT∂w ( see Appendix A.4 for more details ) . In particular , this allows λ to include optimiser hyperparameters . Differentiating ( 4 ) and unrolling the recursion gives [ ∂wi ∂λ ] λ′ = − ∑ 0≤j < i ( ∏ 0≤k < j [ I− ∂u ∂w ] λ′ , wi−1−k ) [ ∂u ∂λ ] λ′ , wi−1−j , ( 5 ) where j indexes our steps back through time from wi−1 to w0 , and all w depend on the current hyperparameters λ′ — see Appendix C.2 for the full derivation . Now , we follow Lorraine et al . and assume w0 , . . . , wi−1 to be equal to wi . With this , we simplify the product in ( 5 ) to a jth power by evaluating all derivatives at wi . This result is then used to approximate ∂w ∗ ∂λ by further assuming that wi ≈ w∗ . These two approximations lead to [ ∂wi ∂λ ] λ′ ≈ − ∑ 0≤j < i ( I− ∂u ∂w ) j ∂u ∂λ λ′ , wi ( λ′ ) ≈ [ ∂w∗ ∂λ ] λ′ . ( 6 ) We reinterpret i as a predefined look-back distance , trading off accuracy and computational efficiency . The combination of these approximations implies wi = w∗ for all i , which is initially inaccurate , but which we would expect to become more correct as training proceeds . In mitigation , we perform several weight updates prior to each hyperparameter update . This means derivatives in earlier terms of the series of ( 6 ) ( which are likely the largest , dominant terms ) are evaluated at weights closer to w∗ , therefore making the summation more accurate . In Section 4 , we show that the approximations described here result in an algorithm that is both practical and effective . Our approximate result ( 6 ) combines the general weight update of Majumder et al . ( 2019 ) with the overall approach and constant-weight assumption of Lorraine et al . ( 2020 ) . The latter empirically show that an approximation similar to ( 6 ) leads to a directionally-accurate approximate hypergradient ; we illustrate the approximate updates from our derivations in Figure 1 ( by ) . 2.3 CONVERGENCE TO BEST-RESPONSE DERIVATIVE . To justify the approximations in ( 6 ) , note that the central part of that equation is a truncated Neumann series . Taking the limit i→∞ , when such a limit exists , results in the closed form [ ∂w∗ ∂λ ] λ′ ≈ − [ ( ∂u ∂w ) −1 ∂u ∂λ ] λ′ , w∗ ( λ′ ) . ( 7 ) This is precisely the result of the IFT ( Theorem 1 ) applied to u instead of ∂LT∂w ; that is , substituting the simple SGD update uSGD ( λ , w ) = η ∂LT∂w into ( 7 ) recovers ( 3 ) exactly . Thus , under certain conditions , our approximation ( 6 ) converges to the true best-response Jacobian in the limit of infinitely long look-back windows . 2.4 HYPERPARAMETER UPDATES . Substituting ( 6 ) into ( 2 ) yields a tractable approximation for the hypergradient dLVdλ , with which we can update hyperparameters by gradient descent . Our implementation in Algorithm 1 ( Figure 4 ) closely parallels Lorraine et al. ’ s algorithm , invoking Jacobian-vector products ( Pearlmutter , 1994 ) during gradient computation for memory efficiency via the grad_outputs argument , which also provides the repeated multiplication for the jth power in ( 6 ) . Thus , we retain the O ( |w| + |λ| ) time and memory cost of Lorraine et al . ( 2020 ) , where | · | denotes cardinality . The core loop to compute the summation in ( 6 ) comes from an algorithm of Liao et al . ( 2018 ) . Note that Algorithm 1 approximates dLVdλ retrospectively by considering only the last weight update rather than any future weight updates . Unlike differentiation-through-optimisation ( Domke , 2012 ) , Algorithm 1 crucially estimates hypergradients without reference to old model parameters , thanks to the approximate-hypergradient construction of Lorraine et al . ( 2020 ) and ( 6 ) . We thus do not store network weights at multiple time steps , so gradient-based HPO becomes possible on previously-intractable large-scale problems . In essence , we develop an approximation to online hypergradient descent ( Baydin et al. , 2018 ) . Optimiser hyperparameters generally do not affect the optimal weights , suggesting their hypergradients should be zero . However , in practice , w∗ is better reinterpreted as the approximately optimal weights obtained after a finite training episode . These certainly depend on the optimiser hyperparameters , which govern the convergence of w , thus justifying our use of the bilevel framework . We emphasise training is not reset after each hyperparameter update — we simply continue training from where we left off , using the new hyperparameters . Consequently , Algorithm 1 avoids the time cost of multiple training restarts . While our locally greedy hyperparameter updates threaten a short-horizon bias ( Wu et al. , 2018 ) , we still realise practical improvements in our experiments . 2.5 REINTERPRETATION OF ITERATIVE OPTIMISATION . Originally , we stated the IFT ( 3 ) in terms of minima of LT ( zeros of ∂LT∂w ) , and substituting uSGD = η ∂LT∂w into ( 7 ) recovers this form of ( 3 ) . However , in general , ( 7 ) recovers the Theorem for zeros of u , which are not necessarily minima of the training loss . Despite this , our development can be compared to Lorraine et al . ( 2020 ) by expressing u as the derivative of an augmented ‘ pseudo-loss ’ function . Consider again the simple SGD update uSGD , which provides the weight update rule wi = wi−1 − η ∂LT∂w . By trivially defining a pseudo-loss L = ηLT , we may absorb η into a loss-like derivative , yielding wi = wi−1 − ∂L∂w . More generally , we may write L = ∫ u ( λ , w ) dw . Expressing the update in this form suggests a reinterpretation of the role of optimiser hyperparameters . Conventionally , our visualisation of gradient descent has the learning rate control the size of steps over some undulating landscape . Instead , we propose fixing a unit step size , with the ‘ learning rate ’ scaling the landscape underneath . Similarly , we suppose a ‘ momentum ’ could , at every point , locally squash the loss surface in the negative-gradient direction and stretch it in the positive-gradient direction . In aggregate , these transformations straighten out optimisation trajectories and bring local optima closer to the current point . While more complex hyperparameters lack a clear visualisation in this framework , it nevertheless allows a broader class of hyperparameters to ‘ directly alter the loss function ’ instead of remaining completely independent , circumventing the problem with optimiser hyperparameters noted by Lorraine et al . ( 2020 ) . Figure 2 and Appendix A.3 support this argument . | This paper is concerned with tuning continuous hyperparameters of a neural network setup (model, loss function and optimizer parameters) by way of a cheap approximation to the hypergradient. It is closely related to earlier work (Lorraine, 2019), which however overlooked that the idea can be generalized to optimizer parameters (e.g., learning rate, momentum), which is effectively done here. In a range of well-done experiments, the method is shown to very convincingly outperform (Lorraine, 2019), and in some cases even the "gold standard" approach to differentiate through the whole learning trajectory. Code is provided. | SP:2f9d25bc672d6dc9321e7b394ec1c0523deee10e |
Towards simple time-to-event modeling: optimizing neural networks via rank regression | 1 INTRODUCTION . Time-to-event analysis , also known as survival or failure time analysis , is a major statistical approach in various fields such as biostatistics , medicine , and economics to estimate either risk scores or the distribution of event time , given a set of features of subjects ( Viganò et al. , 2000 ; Cheng et al. , 2016 ; Dirick et al. , 2017 ; Li et al. , 2021 ) . There are benefits of assessing risk or quantifying survival probabilities but , for all that , time-to-event analysis itself is challenging because of the existence of censoring . In real-world studies , a subject ( e.g . a patient in medical research ) can drop out before events of interest ( e.g . death ) happen , so that one can not follow them up ( Leung et al. , 1997 ) . The presence of censoring in survival data can create a serious challenge in applying standard statistical modeling strategies . Usually , the censoring process is assumed to be non-informative in that it is irrelevant of the underlying failure process given features , but should be properly accounted for , otherwise leading to biased results . The most popular and standard approach for modeling time-to-event data is to use Cox ’ s proportional hazards ( CoxPH ) model . CoxPH relates a conditional hazard to given features in a multiplicative form between the baseline hazard function and exponentiated regression component , and consequently learns relative risks . It often works on the assumptions of proportional hazards and time-invariant covariate-effects , which are difficult to follow in the real world ( Aalen , 1994 ) . Statistical testing procedures , such as Schoenfeld ’ s test , are usually conducted to examine these underlying assumptions since many Cox-based analyses are vulnerable to violation of model assumptions . ( Aalen & Gjessing , 2001 ; Kleinbaum & Klein , 2010 ) . The accelerated failure time model ( AFT ) or accelerated life model relates the logarithm of the failure time linearly to the features . As a result of its direct physical interpretation and the connection with linear models , this model provides an attractive alternative to the CoxPH for the regression analysis of censored failure time data . Unlike CoxPH , standard AFT model parametrizes the underlying time-to-event distribution up to a set of finite-dimensional parameters such as Weibull and log-normal ( Lee & Wang , 2003 ) . However , imposing distributional assumption is too strict in real data analysis and can reduce the attractiveness inherent in the AFT model , mostly underperforming Cox-based analysis ( Cox , 2008 ; Kleinbaum & Klein , 2010 ) . Recently , based on statistical theories and the advent of deep learning techniques , various time-to-event models have been explored to circumvent the necessity of assumptions such as linearity , single risk , discrete time , and fixed-time effect ( Katzman et al. , 2018 ; Lee et al. , 2018 ; Ren et al. , 2019 ; Kvamme & Borgan , 2019 ; Avati et al. , 2020 ; Tarkhan et al. , 2021 ; Rahman et al. , 2021 ) . For example , Cox-Time ( Kvamme et al. , 2019 ) and DATE ( Chapfuwa et al. , 2018 ) alleviate the most fundamental but strict assumptions of the CoxPH and parametric AFT models by achieving nonproportional hazards and non-parametric event-time distribution , respectively . Cox-Time exploits the neural network as a relative risk function to model interactions between time and covariates . The authors also show that the proposed loss function is a good approximation for the Cox partial loglikelihood . DATE is a conditional generative adversarial network for implicitly specifying a timeto-event distribution of ATF model . It does not require the pre-specified distribution in parametric form , instead , the generator can learn it from the data with the adversarial loss function . Incidentally , various deep learning-based approaches have been spotlighted to improve performance by resolving issues such as temporal dynamics and calibration ( Lee et al. , 2019 ; Nagpal et al. , 2021 ; Gao & Cui , 2021 ; Kamran & Wiens , 2021 ; Hu et al. , 2021 ) . Therefore , it became important to utilize welldesigned objective functions that fit not only statistical backgrounds but also optimization of neural networks . In this paper , we introduce a Deep AFT Rank-regression for Time-to-event prediction model ( DART ) , a deep learning-based semiparametric AFT model trained with an objective function originated from Gehan ’ s rank statistic . The model does not require specifying event time distribution while keeping the advantage of the standard AFT model that directly predicts event time . With a simple form of the loss function , by constructing comparable rank pairs , the optimization of DART is efficient compared to other deep learning-based time-to-event models . Experimental results show that DART is not only well-calibrated but also competitive in event order prediction performance even compared to hazard-based models . Furthermore , we believe that this work can be widely applied in the community while giving prominence to advantages of the AFT model that is relatively unexplored . 2 RELATED WORKS . We first overview time-to-event modeling focusing on the loss functions of Cox-Time and DATE models to highlight the difference in concepts before introducing our method . The primary interest of time-to-event analysis is to estimate survival quantities like survival function S ( t ) = P ( T ≥ t ) or hazard function h ( t ) = limδ→0 P ( t ≤ T ≤ t + δ|T ≥ t ) /δ , where T ∈ R+ denotes time-to-event random variable . In most cases , due to censored observations , those quantities can not be directly estimated with standard statistical inference procedure . In the presence of right censoring , Kaplan & Meier ( 1958 ) and Aalen ( 1978 ) provided consistent nonparametric survival function estimators , exploiting right-censoring time random variable C ∈ R+ . Researchers then can get stable estimates for survival quantities with data tuples { yi , δi , Xi } Ni=1 , where yi = min ( Ti , Ci ) is the observed event time with censoring , δi = I ( Ti ≤ Ci ) is the censoring indicator , and a vector of features Xi ∈ RP . Here , N and P denote the number of instances and the number of features , respectively . While those nonparametric methods are useful , one can improve predictive power by incorporating feature information in a way of regression modeling . Cox proportional-hazards ( CoxPH ) and acceleratedfailure-time ( AFT ) frameworks are the most common approaches in modeling survival quantities utilizing both censoring and features . 2.1 HAZARD-BASED MODELS . A standard CoxPH regression model ( Cox , 1972 ) formulates the conditional hazard function as : h ( t|Xi ) = h0 ( t ) exp ( βTXi ) , ( i = 1 , . . . , N ) , ( 1 ) where h0 ( · ) is an unknown baseline hazard function which has to be estimated nonparametrically , and β ∈ RP is the regression coefficient vector . It is one of the most celebrated models in statistics in that β can be estimated at full statistical efficiency while achieving nonparametric flexibility on h0 under the proportionality assumption . Note the model is semiparametric due to the unspecified underlying baseline hazard function h0 . Letting Ri be the set of all individuals “ at risk ” , meaning that are not censored and have not experienced the event before Ti , statistically efficient estimator for regression coefficients can be obtained minimizing the loss function with respect to β : LCoxPH ( β ) = ∑ i δi log ∑ j∈Ri exp [ βTXj − βTXi ] , ( 2 ) which is equivalent to the negative partial log-likelihood function of CoxPH model . Based on this loss function , Kvamme et al . ( 2019 ) proposed a deep-learning algorithm for the hazard-based predictive model , namely Cox-Time , replacing βTXj and βTXi with g ( yj , Xj ; θ ) and g ( yi , Xi ; θ ) , respectively . Here , g ( · ) denotes the neural networks parameterized by θ , and Ri would be replaced by R̃i , representing the sampled subset ofRi . With a simple modification of the standard loss function in Eq . ( 2 ) , Cox-Time can alleviate the proportionality for relative risk , showing empirically remarkable performance against other hazard-based models in both event ordering and survival calibration . 2.2 ACCELERATED-FAILURE-TIME MODELS . The conventional AFT model relates the log-transformed survival time to a set of features in a linear form : log Ti = β TXi + i , ( i = 1 , . . . , N ) , ( 3 ) where i is an independent and identically distributed error term with a common distribution function F0 ( · ) that is often assumed to be Weibull , exponential , log-normal , etc . As implied in Eq . ( 3 ) , AFT model takes a form of linear modeling and provides an intuitive and physical interpretation on event time without detouring via the vague concept of hazard function , making it a powerful alternative to hazard-based analysis . However , imposing a parametric distributional assumption for i is a critical drawback of the model , for which model in Eq . ( 3 ) could be a subclass of the hazard-based models . To alleviate linearity and parametric distributional assumptions , several works brought the concept of generative process and approximated the error distribution via neural networks like generative adversarial network ( GAN ) ( Miscouridou et al. , 2018 ; Chapfuwa et al. , 2018 ) . Especially , Chapfuwa et al . ( 2018 ) proposed a deep adversarial time-to-event ( DATE ) model , which specifies the loss function as : LDATE ( θ , φ ) = E ( X , y ) ∼Fnc [ Dφ ( X , y ) ] + EX∼Fnc , ξ∼Fξ [ 1−Dφ ( X , Gθ ( X , ξ ; δ = 1 ) ) ] + λ2E ( X , y ) ∼Fc , ξ∼Fξ [ max ( 0 , y −Gθ ( X , ξ ; δ = 0 ) ) ] ( 4 ) + λ3E ( X , y ) ∼Fnc [ ‖t−Gθ ( X , ξ ; δ = 1 ) ‖1 ] where θ , φ denotes the parameter set associated with a generator Gθ and a discriminator Dφ , respectively , ( λ2 , λ3 ) are hyperparameters to tune censoring trade-off , Fnc ( X , y ) and Fc ( X , y ) are empirical joint distributions for non-censored cases and censored cases , respectively , and Fξ is the simple distribution , such as uniform distribution . The generatorGθ implicitly defines event time distribution . Despite DATE achieves prominent survival calibration via the sample-generating process , the objective function is quite complicated and the GAN framework is inherently prone to mode collapse , i.e. , the generator learns only a few modes of the true distribution while missing other modes ( Srivastava et al. , 2017 ) . Also , when optimizing neural networks with multiple loss functions , it is difficult to balance and there might be conflicts ( i.e . trade-off ) with each term ( Dosovitskiy & Djolonga , 2020 ) . Therefore , their loss function might be difficult to be optimized as intended and requires a burdening training time , and consequently not be suitable for large-scale time-to-event analysis . In the statistical literature , there have been many attempts to directly estimate regression coefficients in the semiparametric AFT model , where the error distribution F0 is left unknown , rather than imposing specific parametric distribution or exploiting generative models . In this work , we bridge non-linear representation learning and an objective function for estimation of semiparametric AFT model , which is originated from Gehan ’ s rank statistic . By extensive quantitative analysis , we have shown the beauty of simplicity and compatibility of rank-based estimation , along with outstanding experimental performance . | The authors suggest a neural network based accelerated failure time (AFT) model, as well as an L1-type rank loss, which they argue results in an easy and fast to train model, which is state of the art in terms of two standard evaluation metrics, concordance and integrated Brier score. Following the semi-parametric AFT literature, the baseline hazard is estimated from the data and the full hazard function is parametrized in a way that the parametric part corresponds to a prediction of the failure time. The main innovation of the paper is the use of a novel loss function based on a ranking loss using Gehan’s rank statistic, which while being used in the statistical literature, has not been used in a machine learning setting. | SP:98a05a13e58c4fca8787b1e47bd48c0ab9c357bc |
Towards simple time-to-event modeling: optimizing neural networks via rank regression | 1 INTRODUCTION . Time-to-event analysis , also known as survival or failure time analysis , is a major statistical approach in various fields such as biostatistics , medicine , and economics to estimate either risk scores or the distribution of event time , given a set of features of subjects ( Viganò et al. , 2000 ; Cheng et al. , 2016 ; Dirick et al. , 2017 ; Li et al. , 2021 ) . There are benefits of assessing risk or quantifying survival probabilities but , for all that , time-to-event analysis itself is challenging because of the existence of censoring . In real-world studies , a subject ( e.g . a patient in medical research ) can drop out before events of interest ( e.g . death ) happen , so that one can not follow them up ( Leung et al. , 1997 ) . The presence of censoring in survival data can create a serious challenge in applying standard statistical modeling strategies . Usually , the censoring process is assumed to be non-informative in that it is irrelevant of the underlying failure process given features , but should be properly accounted for , otherwise leading to biased results . The most popular and standard approach for modeling time-to-event data is to use Cox ’ s proportional hazards ( CoxPH ) model . CoxPH relates a conditional hazard to given features in a multiplicative form between the baseline hazard function and exponentiated regression component , and consequently learns relative risks . It often works on the assumptions of proportional hazards and time-invariant covariate-effects , which are difficult to follow in the real world ( Aalen , 1994 ) . Statistical testing procedures , such as Schoenfeld ’ s test , are usually conducted to examine these underlying assumptions since many Cox-based analyses are vulnerable to violation of model assumptions . ( Aalen & Gjessing , 2001 ; Kleinbaum & Klein , 2010 ) . The accelerated failure time model ( AFT ) or accelerated life model relates the logarithm of the failure time linearly to the features . As a result of its direct physical interpretation and the connection with linear models , this model provides an attractive alternative to the CoxPH for the regression analysis of censored failure time data . Unlike CoxPH , standard AFT model parametrizes the underlying time-to-event distribution up to a set of finite-dimensional parameters such as Weibull and log-normal ( Lee & Wang , 2003 ) . However , imposing distributional assumption is too strict in real data analysis and can reduce the attractiveness inherent in the AFT model , mostly underperforming Cox-based analysis ( Cox , 2008 ; Kleinbaum & Klein , 2010 ) . Recently , based on statistical theories and the advent of deep learning techniques , various time-to-event models have been explored to circumvent the necessity of assumptions such as linearity , single risk , discrete time , and fixed-time effect ( Katzman et al. , 2018 ; Lee et al. , 2018 ; Ren et al. , 2019 ; Kvamme & Borgan , 2019 ; Avati et al. , 2020 ; Tarkhan et al. , 2021 ; Rahman et al. , 2021 ) . For example , Cox-Time ( Kvamme et al. , 2019 ) and DATE ( Chapfuwa et al. , 2018 ) alleviate the most fundamental but strict assumptions of the CoxPH and parametric AFT models by achieving nonproportional hazards and non-parametric event-time distribution , respectively . Cox-Time exploits the neural network as a relative risk function to model interactions between time and covariates . The authors also show that the proposed loss function is a good approximation for the Cox partial loglikelihood . DATE is a conditional generative adversarial network for implicitly specifying a timeto-event distribution of ATF model . It does not require the pre-specified distribution in parametric form , instead , the generator can learn it from the data with the adversarial loss function . Incidentally , various deep learning-based approaches have been spotlighted to improve performance by resolving issues such as temporal dynamics and calibration ( Lee et al. , 2019 ; Nagpal et al. , 2021 ; Gao & Cui , 2021 ; Kamran & Wiens , 2021 ; Hu et al. , 2021 ) . Therefore , it became important to utilize welldesigned objective functions that fit not only statistical backgrounds but also optimization of neural networks . In this paper , we introduce a Deep AFT Rank-regression for Time-to-event prediction model ( DART ) , a deep learning-based semiparametric AFT model trained with an objective function originated from Gehan ’ s rank statistic . The model does not require specifying event time distribution while keeping the advantage of the standard AFT model that directly predicts event time . With a simple form of the loss function , by constructing comparable rank pairs , the optimization of DART is efficient compared to other deep learning-based time-to-event models . Experimental results show that DART is not only well-calibrated but also competitive in event order prediction performance even compared to hazard-based models . Furthermore , we believe that this work can be widely applied in the community while giving prominence to advantages of the AFT model that is relatively unexplored . 2 RELATED WORKS . We first overview time-to-event modeling focusing on the loss functions of Cox-Time and DATE models to highlight the difference in concepts before introducing our method . The primary interest of time-to-event analysis is to estimate survival quantities like survival function S ( t ) = P ( T ≥ t ) or hazard function h ( t ) = limδ→0 P ( t ≤ T ≤ t + δ|T ≥ t ) /δ , where T ∈ R+ denotes time-to-event random variable . In most cases , due to censored observations , those quantities can not be directly estimated with standard statistical inference procedure . In the presence of right censoring , Kaplan & Meier ( 1958 ) and Aalen ( 1978 ) provided consistent nonparametric survival function estimators , exploiting right-censoring time random variable C ∈ R+ . Researchers then can get stable estimates for survival quantities with data tuples { yi , δi , Xi } Ni=1 , where yi = min ( Ti , Ci ) is the observed event time with censoring , δi = I ( Ti ≤ Ci ) is the censoring indicator , and a vector of features Xi ∈ RP . Here , N and P denote the number of instances and the number of features , respectively . While those nonparametric methods are useful , one can improve predictive power by incorporating feature information in a way of regression modeling . Cox proportional-hazards ( CoxPH ) and acceleratedfailure-time ( AFT ) frameworks are the most common approaches in modeling survival quantities utilizing both censoring and features . 2.1 HAZARD-BASED MODELS . A standard CoxPH regression model ( Cox , 1972 ) formulates the conditional hazard function as : h ( t|Xi ) = h0 ( t ) exp ( βTXi ) , ( i = 1 , . . . , N ) , ( 1 ) where h0 ( · ) is an unknown baseline hazard function which has to be estimated nonparametrically , and β ∈ RP is the regression coefficient vector . It is one of the most celebrated models in statistics in that β can be estimated at full statistical efficiency while achieving nonparametric flexibility on h0 under the proportionality assumption . Note the model is semiparametric due to the unspecified underlying baseline hazard function h0 . Letting Ri be the set of all individuals “ at risk ” , meaning that are not censored and have not experienced the event before Ti , statistically efficient estimator for regression coefficients can be obtained minimizing the loss function with respect to β : LCoxPH ( β ) = ∑ i δi log ∑ j∈Ri exp [ βTXj − βTXi ] , ( 2 ) which is equivalent to the negative partial log-likelihood function of CoxPH model . Based on this loss function , Kvamme et al . ( 2019 ) proposed a deep-learning algorithm for the hazard-based predictive model , namely Cox-Time , replacing βTXj and βTXi with g ( yj , Xj ; θ ) and g ( yi , Xi ; θ ) , respectively . Here , g ( · ) denotes the neural networks parameterized by θ , and Ri would be replaced by R̃i , representing the sampled subset ofRi . With a simple modification of the standard loss function in Eq . ( 2 ) , Cox-Time can alleviate the proportionality for relative risk , showing empirically remarkable performance against other hazard-based models in both event ordering and survival calibration . 2.2 ACCELERATED-FAILURE-TIME MODELS . The conventional AFT model relates the log-transformed survival time to a set of features in a linear form : log Ti = β TXi + i , ( i = 1 , . . . , N ) , ( 3 ) where i is an independent and identically distributed error term with a common distribution function F0 ( · ) that is often assumed to be Weibull , exponential , log-normal , etc . As implied in Eq . ( 3 ) , AFT model takes a form of linear modeling and provides an intuitive and physical interpretation on event time without detouring via the vague concept of hazard function , making it a powerful alternative to hazard-based analysis . However , imposing a parametric distributional assumption for i is a critical drawback of the model , for which model in Eq . ( 3 ) could be a subclass of the hazard-based models . To alleviate linearity and parametric distributional assumptions , several works brought the concept of generative process and approximated the error distribution via neural networks like generative adversarial network ( GAN ) ( Miscouridou et al. , 2018 ; Chapfuwa et al. , 2018 ) . Especially , Chapfuwa et al . ( 2018 ) proposed a deep adversarial time-to-event ( DATE ) model , which specifies the loss function as : LDATE ( θ , φ ) = E ( X , y ) ∼Fnc [ Dφ ( X , y ) ] + EX∼Fnc , ξ∼Fξ [ 1−Dφ ( X , Gθ ( X , ξ ; δ = 1 ) ) ] + λ2E ( X , y ) ∼Fc , ξ∼Fξ [ max ( 0 , y −Gθ ( X , ξ ; δ = 0 ) ) ] ( 4 ) + λ3E ( X , y ) ∼Fnc [ ‖t−Gθ ( X , ξ ; δ = 1 ) ‖1 ] where θ , φ denotes the parameter set associated with a generator Gθ and a discriminator Dφ , respectively , ( λ2 , λ3 ) are hyperparameters to tune censoring trade-off , Fnc ( X , y ) and Fc ( X , y ) are empirical joint distributions for non-censored cases and censored cases , respectively , and Fξ is the simple distribution , such as uniform distribution . The generatorGθ implicitly defines event time distribution . Despite DATE achieves prominent survival calibration via the sample-generating process , the objective function is quite complicated and the GAN framework is inherently prone to mode collapse , i.e. , the generator learns only a few modes of the true distribution while missing other modes ( Srivastava et al. , 2017 ) . Also , when optimizing neural networks with multiple loss functions , it is difficult to balance and there might be conflicts ( i.e . trade-off ) with each term ( Dosovitskiy & Djolonga , 2020 ) . Therefore , their loss function might be difficult to be optimized as intended and requires a burdening training time , and consequently not be suitable for large-scale time-to-event analysis . In the statistical literature , there have been many attempts to directly estimate regression coefficients in the semiparametric AFT model , where the error distribution F0 is left unknown , rather than imposing specific parametric distribution or exploiting generative models . In this work , we bridge non-linear representation learning and an objective function for estimation of semiparametric AFT model , which is originated from Gehan ’ s rank statistic . By extensive quantitative analysis , we have shown the beauty of simplicity and compatibility of rank-based estimation , along with outstanding experimental performance . | This paper proposes to combine the idea of Gehan’s rank statistic idea on fitting the AFT model, as well as using the deep learning model as a non-linear method for replacing the linear method in the original AFT model. The authors argue they connect Gehan's non-parametric technique with deep learning models. Experiments on various benchmark datasets show that the proposed model is competitive to state-of-the-art baselines. | SP:98a05a13e58c4fca8787b1e47bd48c0ab9c357bc |
Towards simple time-to-event modeling: optimizing neural networks via rank regression | 1 INTRODUCTION . Time-to-event analysis , also known as survival or failure time analysis , is a major statistical approach in various fields such as biostatistics , medicine , and economics to estimate either risk scores or the distribution of event time , given a set of features of subjects ( Viganò et al. , 2000 ; Cheng et al. , 2016 ; Dirick et al. , 2017 ; Li et al. , 2021 ) . There are benefits of assessing risk or quantifying survival probabilities but , for all that , time-to-event analysis itself is challenging because of the existence of censoring . In real-world studies , a subject ( e.g . a patient in medical research ) can drop out before events of interest ( e.g . death ) happen , so that one can not follow them up ( Leung et al. , 1997 ) . The presence of censoring in survival data can create a serious challenge in applying standard statistical modeling strategies . Usually , the censoring process is assumed to be non-informative in that it is irrelevant of the underlying failure process given features , but should be properly accounted for , otherwise leading to biased results . The most popular and standard approach for modeling time-to-event data is to use Cox ’ s proportional hazards ( CoxPH ) model . CoxPH relates a conditional hazard to given features in a multiplicative form between the baseline hazard function and exponentiated regression component , and consequently learns relative risks . It often works on the assumptions of proportional hazards and time-invariant covariate-effects , which are difficult to follow in the real world ( Aalen , 1994 ) . Statistical testing procedures , such as Schoenfeld ’ s test , are usually conducted to examine these underlying assumptions since many Cox-based analyses are vulnerable to violation of model assumptions . ( Aalen & Gjessing , 2001 ; Kleinbaum & Klein , 2010 ) . The accelerated failure time model ( AFT ) or accelerated life model relates the logarithm of the failure time linearly to the features . As a result of its direct physical interpretation and the connection with linear models , this model provides an attractive alternative to the CoxPH for the regression analysis of censored failure time data . Unlike CoxPH , standard AFT model parametrizes the underlying time-to-event distribution up to a set of finite-dimensional parameters such as Weibull and log-normal ( Lee & Wang , 2003 ) . However , imposing distributional assumption is too strict in real data analysis and can reduce the attractiveness inherent in the AFT model , mostly underperforming Cox-based analysis ( Cox , 2008 ; Kleinbaum & Klein , 2010 ) . Recently , based on statistical theories and the advent of deep learning techniques , various time-to-event models have been explored to circumvent the necessity of assumptions such as linearity , single risk , discrete time , and fixed-time effect ( Katzman et al. , 2018 ; Lee et al. , 2018 ; Ren et al. , 2019 ; Kvamme & Borgan , 2019 ; Avati et al. , 2020 ; Tarkhan et al. , 2021 ; Rahman et al. , 2021 ) . For example , Cox-Time ( Kvamme et al. , 2019 ) and DATE ( Chapfuwa et al. , 2018 ) alleviate the most fundamental but strict assumptions of the CoxPH and parametric AFT models by achieving nonproportional hazards and non-parametric event-time distribution , respectively . Cox-Time exploits the neural network as a relative risk function to model interactions between time and covariates . The authors also show that the proposed loss function is a good approximation for the Cox partial loglikelihood . DATE is a conditional generative adversarial network for implicitly specifying a timeto-event distribution of ATF model . It does not require the pre-specified distribution in parametric form , instead , the generator can learn it from the data with the adversarial loss function . Incidentally , various deep learning-based approaches have been spotlighted to improve performance by resolving issues such as temporal dynamics and calibration ( Lee et al. , 2019 ; Nagpal et al. , 2021 ; Gao & Cui , 2021 ; Kamran & Wiens , 2021 ; Hu et al. , 2021 ) . Therefore , it became important to utilize welldesigned objective functions that fit not only statistical backgrounds but also optimization of neural networks . In this paper , we introduce a Deep AFT Rank-regression for Time-to-event prediction model ( DART ) , a deep learning-based semiparametric AFT model trained with an objective function originated from Gehan ’ s rank statistic . The model does not require specifying event time distribution while keeping the advantage of the standard AFT model that directly predicts event time . With a simple form of the loss function , by constructing comparable rank pairs , the optimization of DART is efficient compared to other deep learning-based time-to-event models . Experimental results show that DART is not only well-calibrated but also competitive in event order prediction performance even compared to hazard-based models . Furthermore , we believe that this work can be widely applied in the community while giving prominence to advantages of the AFT model that is relatively unexplored . 2 RELATED WORKS . We first overview time-to-event modeling focusing on the loss functions of Cox-Time and DATE models to highlight the difference in concepts before introducing our method . The primary interest of time-to-event analysis is to estimate survival quantities like survival function S ( t ) = P ( T ≥ t ) or hazard function h ( t ) = limδ→0 P ( t ≤ T ≤ t + δ|T ≥ t ) /δ , where T ∈ R+ denotes time-to-event random variable . In most cases , due to censored observations , those quantities can not be directly estimated with standard statistical inference procedure . In the presence of right censoring , Kaplan & Meier ( 1958 ) and Aalen ( 1978 ) provided consistent nonparametric survival function estimators , exploiting right-censoring time random variable C ∈ R+ . Researchers then can get stable estimates for survival quantities with data tuples { yi , δi , Xi } Ni=1 , where yi = min ( Ti , Ci ) is the observed event time with censoring , δi = I ( Ti ≤ Ci ) is the censoring indicator , and a vector of features Xi ∈ RP . Here , N and P denote the number of instances and the number of features , respectively . While those nonparametric methods are useful , one can improve predictive power by incorporating feature information in a way of regression modeling . Cox proportional-hazards ( CoxPH ) and acceleratedfailure-time ( AFT ) frameworks are the most common approaches in modeling survival quantities utilizing both censoring and features . 2.1 HAZARD-BASED MODELS . A standard CoxPH regression model ( Cox , 1972 ) formulates the conditional hazard function as : h ( t|Xi ) = h0 ( t ) exp ( βTXi ) , ( i = 1 , . . . , N ) , ( 1 ) where h0 ( · ) is an unknown baseline hazard function which has to be estimated nonparametrically , and β ∈ RP is the regression coefficient vector . It is one of the most celebrated models in statistics in that β can be estimated at full statistical efficiency while achieving nonparametric flexibility on h0 under the proportionality assumption . Note the model is semiparametric due to the unspecified underlying baseline hazard function h0 . Letting Ri be the set of all individuals “ at risk ” , meaning that are not censored and have not experienced the event before Ti , statistically efficient estimator for regression coefficients can be obtained minimizing the loss function with respect to β : LCoxPH ( β ) = ∑ i δi log ∑ j∈Ri exp [ βTXj − βTXi ] , ( 2 ) which is equivalent to the negative partial log-likelihood function of CoxPH model . Based on this loss function , Kvamme et al . ( 2019 ) proposed a deep-learning algorithm for the hazard-based predictive model , namely Cox-Time , replacing βTXj and βTXi with g ( yj , Xj ; θ ) and g ( yi , Xi ; θ ) , respectively . Here , g ( · ) denotes the neural networks parameterized by θ , and Ri would be replaced by R̃i , representing the sampled subset ofRi . With a simple modification of the standard loss function in Eq . ( 2 ) , Cox-Time can alleviate the proportionality for relative risk , showing empirically remarkable performance against other hazard-based models in both event ordering and survival calibration . 2.2 ACCELERATED-FAILURE-TIME MODELS . The conventional AFT model relates the log-transformed survival time to a set of features in a linear form : log Ti = β TXi + i , ( i = 1 , . . . , N ) , ( 3 ) where i is an independent and identically distributed error term with a common distribution function F0 ( · ) that is often assumed to be Weibull , exponential , log-normal , etc . As implied in Eq . ( 3 ) , AFT model takes a form of linear modeling and provides an intuitive and physical interpretation on event time without detouring via the vague concept of hazard function , making it a powerful alternative to hazard-based analysis . However , imposing a parametric distributional assumption for i is a critical drawback of the model , for which model in Eq . ( 3 ) could be a subclass of the hazard-based models . To alleviate linearity and parametric distributional assumptions , several works brought the concept of generative process and approximated the error distribution via neural networks like generative adversarial network ( GAN ) ( Miscouridou et al. , 2018 ; Chapfuwa et al. , 2018 ) . Especially , Chapfuwa et al . ( 2018 ) proposed a deep adversarial time-to-event ( DATE ) model , which specifies the loss function as : LDATE ( θ , φ ) = E ( X , y ) ∼Fnc [ Dφ ( X , y ) ] + EX∼Fnc , ξ∼Fξ [ 1−Dφ ( X , Gθ ( X , ξ ; δ = 1 ) ) ] + λ2E ( X , y ) ∼Fc , ξ∼Fξ [ max ( 0 , y −Gθ ( X , ξ ; δ = 0 ) ) ] ( 4 ) + λ3E ( X , y ) ∼Fnc [ ‖t−Gθ ( X , ξ ; δ = 1 ) ‖1 ] where θ , φ denotes the parameter set associated with a generator Gθ and a discriminator Dφ , respectively , ( λ2 , λ3 ) are hyperparameters to tune censoring trade-off , Fnc ( X , y ) and Fc ( X , y ) are empirical joint distributions for non-censored cases and censored cases , respectively , and Fξ is the simple distribution , such as uniform distribution . The generatorGθ implicitly defines event time distribution . Despite DATE achieves prominent survival calibration via the sample-generating process , the objective function is quite complicated and the GAN framework is inherently prone to mode collapse , i.e. , the generator learns only a few modes of the true distribution while missing other modes ( Srivastava et al. , 2017 ) . Also , when optimizing neural networks with multiple loss functions , it is difficult to balance and there might be conflicts ( i.e . trade-off ) with each term ( Dosovitskiy & Djolonga , 2020 ) . Therefore , their loss function might be difficult to be optimized as intended and requires a burdening training time , and consequently not be suitable for large-scale time-to-event analysis . In the statistical literature , there have been many attempts to directly estimate regression coefficients in the semiparametric AFT model , where the error distribution F0 is left unknown , rather than imposing specific parametric distribution or exploiting generative models . In this work , we bridge non-linear representation learning and an objective function for estimation of semiparametric AFT model , which is originated from Gehan ’ s rank statistic . By extensive quantitative analysis , we have shown the beauty of simplicity and compatibility of rank-based estimation , along with outstanding experimental performance . | The paper extends the previously proposed linear semiparametric AFT model based on Gehan’s rank statistic to a nonlinear setup. The nonlinear model termed Deep AFT Rank-regression for Time-to-event prediction model (DART) is parameterized by a neural network. Experimental results across four datasets show a competitive advantage over baselines per concordance index (C-Index), integrated Brier score (IBS), and training time. | SP:98a05a13e58c4fca8787b1e47bd48c0ab9c357bc |
Learning to Persuade | 1 INTRODUCTION . The Bayesian persuasion model has recently been extensively studied in economics , computer science and operations research ( Kamenica & Gentzkow , 2011 ; Arieli & Babichenko , 2019 ; Dughmi & Xu , 2019 ; Lingenbrink & Iyer , 2019 ) . This model considers the problem of how an informed player ( the sender ) can influence the behavior of an uninformed , self-interested player ( the receiver ) . The model was firstly proposed by Kamenica & Gentzkow ( 2011 ) , and has been successfully applied to various domains such as security games ( Xu et al. , 2015 ; Rabinovich et al. , 2015 ; Shen et al. , 2020 ) , auctions ( Badanidiyuru et al. , 2018 ; Shen et al. , 2019 ) , voting ( Alonso & Câmara , 2016 ; Cheng et al. , 2015 ) and recommendation systems ( Mansour et al. , 2016 ) . In the Bayesian persuasion model , there are two players : a sender ( she ) and a receiver ( he ) . The sender can observe a state of nature that is randomly drawn from a common prior . The receiver does not have access to the state , but can play an action . Before the receiver chooses an action to play , the sender can send a message to the receiver about the observed state . Both the two players ’ utilities depend on the state as well as the receiver ’ s action . The core problem lies on how the sender can design a messaging scheme to maximize her utility by partially revealing the information to the receiver to influence the receiver ’ s behavior . Although the Bayesian persuasion model has nice mathematical structures in theory , it also relies heavily on some assumptions that often do not hold in reality . For example , it is assumed that the sender perfectly knows receiver ’ s utility and that the receiver is completely rational . Another crucial assumption is that the sender has the so-called commitment power and is able to convey her commitment to the receiver before the game begins . However , in many applications , the receiver can not get the accurate commitment due to lack of such communication channels , or simply because the whole commitment is too complicated to understand . The application of the model has been greatly restricted by such strong assumptions . In this paper , we aim to relax these unrealistic assumptions and consider the setting where the sender only knows his own utility but not the receiver ’ s . However , the sender can learn the receiver ’ s utility or behaviors through interacting with the receiver repeatedly . Such a setting captures how the sender could affect the receiver ’ s behavior in many applications ( e.g. , auctions , recommendation systems ) . Instead of game-theoretic analyses , we make use of tools from the AI domain to model the receiver , and apply a data-driven approach to optimize the sender ’ s strategy . In particular , we use two neural networks to model the sender and the receiver . The sender network maps observed states to strategies of sending different messages to the receiver , while the receiver network maps received messages to strategies of playing actions . Note that our receiver model is an end-to-end model and does not involve his utility function . Such a modeling choice is general enough to be applied to cases where the receiver is not fully rational . 1.1 OUR CONTRIBUTIONS . In this paper , we propose a framework for learning the sender ’ s optimal messaging scheme . The framework contains three components : a sender network , a receiver network , and an algorithm for optimizing the sender ’ s expected utility by repeatedly interacting with the receiver . When optimizing the sender ’ s messaging scheme , our algorithm takes into account how changes in sender ’ s scheme affects the receiver ’ s behavior . We analyze theoretic properties of the proposed framework . We show that the receiver model is PAC-learnable , but at the same time may take exponentially many interactions to train the receiver model . We also conduct extensive experiments to demonstrate the effectiveness of our framework . 1.2 ADDITIONAL RELATED WORKS . The Bayesian persuasion model was first studies by researchers from the domain of economics ( Brocas & Carrillo , 2007 ; Kamenica & Gentzkow , 2011 ) . Brocas & Carrillo ( 2007 ) considers the case with only a couple of states , and Kamenica & Gentzkow ( 2011 ) later generalized the model to any finite number of states and actions . Bergemann et al . ( 2015 ) studies the market segmentation problem , and Shen et al . ( 2018 ) showed that the problem is equivalent to a persuasion problem in designing optimal auctions . The persuasion model is also studied in security games to fight illegal poaching and urban crimes ( Xu et al. , 2016 ; 2018 ; Bondi et al. , 2020 ) . There is also a line of works that focuses on learning the persuasion scheme . The most relevant work is by Bhatt & Buro ( 2021 ) , who formulate the problem of learning a messaging scheme as a multiagent communication problem , and propose two algorithms called Info-Q and Info-Policy . However , they focus on fully cooperative settings and only consider deterministic messaging schemes . Zu et al . ( 2021 ) study the learning problem when the prior distribution over the states is unknown . They provide an algorithm with sub-linear regret . Camara et al . ( 2020 ) also study a mechanism design setting without the common prior assumption . They give regret bounds for the mechanism designer compared to the best mechanism in hind sight . Babichenko et al . ( 2021 ) also considers the setting where the receiver ’ s utility is unknown . However , they focus on the case with only two actions and aim to provide a messaging scheme that performs well with all possible receiver utilities . Castiglioni et al . ( 2020 ) study the setting where the receiver has an unknown type that is chosen adversarially . They show that there is no efficient algorithm in this case but can achieve sub-linear regret . 2 PRELIMINARIES . In the standard Bayesian persuasion model , there are two players : a sender and a receiver , denoted by subscripts 1 and 2 , respectively . The receiver needs to make a decision by choosing an action from a set of possible actions A . Assume that both players ’ utility functions depend on a state of nature s ∈ S , which is drawn from a publicly known prior distribution p. In particular , the players ’ utility functions are ui : S × A 7→ R , i ∈ { 1 , 2 } , respectively . We focus on the case where both A and S are finite . We assume that the sender can observe the actual , realized state s , while the receiver has no access to it throughout the game . The sender can send a message m ∈ M to the receiver before he makes the decision to reveal information about the state s. Before the game starts , the sender can commit to a certain messaging scheme π ( m|s ) ∈ [ 0 , 1 ] , which is the probability of sending message m conditioned on that she observes state s. The standard persuasion model also assumes that the sender has commitment power ( the sender acts exactly as the messaging scheme they commit to ) , and that the receiver also knows π ( m|s ) . Therefore , when the receiver gets message m , he will update his belief about the state according to the Bayes ’ rule : p ( s|m ) = π ( m|s ) p ( s ) ∑ s′ π ( m|s′ ) p ( s′ ) . ( 1 ) Based on the posterior belief , the receiver then selects an action to maximize his expected utility : a ∈ arg max a′ ∑ s u2 ( s , a ′ ) p ( s|m ) = arg max a′ ∑ s u2 ( s , a ′ ) π ( m|s ) p ( s ) , . ( 2 ) An example of how the persuasion process works is provided in Appendix A . The core problem is to design an optimal messaging scheme to maximize the sender ’ s expected utility , subject to the constraint that the receiver always chooses the best action to him . Such a problem can be formulated as a linear program , and thus can be efficiently solved . With arguments analogous to the revelation principle ( Gibbard , 1973 ; Myerson , 1981 ) in the mechanism design theory , it is not difficult to show that an optimal messaging scheme needs to use no more than n messages , where n = |A| is the total number of actions available to the receiver . Therefore , it suffices to focus on the case with n messages and each message can actually be interpreted as an action recommendation , i.e. , the sender recommends the receiver to take action ai by sending him message mi . However , in order for the receiver to follow the sender ’ s recommendation , we need to pose a constraint on the sender ’ s messaging scheme : ∑ s∈S π ( mi|s ) u2 ( s , ai ) ≥ ∑ s∈S π ( mi|s ) u2 ( s , ai′ ) , ∀1 ≤ i , i′ ≤ n. ( 3 ) With the above constraints , the receiver has no incentive to choose any action other than the one recommended by the sender . Of course , the messaging scheme π should also satisfy the following feasibility constraints : n∑ i=1 π ( mi|s ) = 1 , ∀s ∈ S and π ( mi|s ) ≥ 0 , ∀1 ≤ i ≤ n , ∀s ∈ S ( 4 ) Therefore , we can formulate the problem as the following linear program : maximize : ∑ s∈S n∑ i=1 p ( s ) π ( mi|s ) u1 ( s , ai ) subject to : Constraint ( 3 ) and ( 4 ) ( 5 ) In our setting , we allow irrational behaviors of the receiver . Let q ( a|m ) be the receiver ’ s probability of choosing action a after receiving message m. If the receiver is rational , q ( a|m ) is simply a pure strategy . Otherwise , q ( a|m ) can be any probability distribution over A . We make the assumption that q ( a|m ) only depends on the messaging scheme π ( m|s ) ( as well as the prior p ( s ) , which is constant ) and thus we sometimes write qπ ( a|m ) to emphasize the dependence on π . The receiver needs to learn π ( m|s ) in order to determine q ( a|m ) , since the receiver can not observe the scheme in advance . We further assume that if the sender ’ s empirical messaging scheme converges to π , then the receiver can correctly learn π and the empirical frequency of the receiver ’ s actions also converges to qπ . Note that this includes the no-regret learning algorithms in the contextual bandit setting . Because when the receiver is rational and applies a no-regret learning algorithm , his strategy would surely converge to the one defined in Equation ( 2 ) , since otherwise , the learning algorithm can not have sub-linear regrets . | The paper studies how to relax certain stringent assumptions made in a Bayesian persuasion framework. In particular, the paper looks to relax assumptions where the sender knows the receiver’s utility function and the receiver’s behavior is completely rational. The authors also claim that the proposed framework works on scenario where the receiver does not know the sender’s messaging scheme in advance and needs to learn to optimize his (receiver’s) own objective. The paper also provides some experiments. | SP:1ff5df4aa57ece76ae9fa5e5d957ac3be595e3e3 |
Learning to Persuade | 1 INTRODUCTION . The Bayesian persuasion model has recently been extensively studied in economics , computer science and operations research ( Kamenica & Gentzkow , 2011 ; Arieli & Babichenko , 2019 ; Dughmi & Xu , 2019 ; Lingenbrink & Iyer , 2019 ) . This model considers the problem of how an informed player ( the sender ) can influence the behavior of an uninformed , self-interested player ( the receiver ) . The model was firstly proposed by Kamenica & Gentzkow ( 2011 ) , and has been successfully applied to various domains such as security games ( Xu et al. , 2015 ; Rabinovich et al. , 2015 ; Shen et al. , 2020 ) , auctions ( Badanidiyuru et al. , 2018 ; Shen et al. , 2019 ) , voting ( Alonso & Câmara , 2016 ; Cheng et al. , 2015 ) and recommendation systems ( Mansour et al. , 2016 ) . In the Bayesian persuasion model , there are two players : a sender ( she ) and a receiver ( he ) . The sender can observe a state of nature that is randomly drawn from a common prior . The receiver does not have access to the state , but can play an action . Before the receiver chooses an action to play , the sender can send a message to the receiver about the observed state . Both the two players ’ utilities depend on the state as well as the receiver ’ s action . The core problem lies on how the sender can design a messaging scheme to maximize her utility by partially revealing the information to the receiver to influence the receiver ’ s behavior . Although the Bayesian persuasion model has nice mathematical structures in theory , it also relies heavily on some assumptions that often do not hold in reality . For example , it is assumed that the sender perfectly knows receiver ’ s utility and that the receiver is completely rational . Another crucial assumption is that the sender has the so-called commitment power and is able to convey her commitment to the receiver before the game begins . However , in many applications , the receiver can not get the accurate commitment due to lack of such communication channels , or simply because the whole commitment is too complicated to understand . The application of the model has been greatly restricted by such strong assumptions . In this paper , we aim to relax these unrealistic assumptions and consider the setting where the sender only knows his own utility but not the receiver ’ s . However , the sender can learn the receiver ’ s utility or behaviors through interacting with the receiver repeatedly . Such a setting captures how the sender could affect the receiver ’ s behavior in many applications ( e.g. , auctions , recommendation systems ) . Instead of game-theoretic analyses , we make use of tools from the AI domain to model the receiver , and apply a data-driven approach to optimize the sender ’ s strategy . In particular , we use two neural networks to model the sender and the receiver . The sender network maps observed states to strategies of sending different messages to the receiver , while the receiver network maps received messages to strategies of playing actions . Note that our receiver model is an end-to-end model and does not involve his utility function . Such a modeling choice is general enough to be applied to cases where the receiver is not fully rational . 1.1 OUR CONTRIBUTIONS . In this paper , we propose a framework for learning the sender ’ s optimal messaging scheme . The framework contains three components : a sender network , a receiver network , and an algorithm for optimizing the sender ’ s expected utility by repeatedly interacting with the receiver . When optimizing the sender ’ s messaging scheme , our algorithm takes into account how changes in sender ’ s scheme affects the receiver ’ s behavior . We analyze theoretic properties of the proposed framework . We show that the receiver model is PAC-learnable , but at the same time may take exponentially many interactions to train the receiver model . We also conduct extensive experiments to demonstrate the effectiveness of our framework . 1.2 ADDITIONAL RELATED WORKS . The Bayesian persuasion model was first studies by researchers from the domain of economics ( Brocas & Carrillo , 2007 ; Kamenica & Gentzkow , 2011 ) . Brocas & Carrillo ( 2007 ) considers the case with only a couple of states , and Kamenica & Gentzkow ( 2011 ) later generalized the model to any finite number of states and actions . Bergemann et al . ( 2015 ) studies the market segmentation problem , and Shen et al . ( 2018 ) showed that the problem is equivalent to a persuasion problem in designing optimal auctions . The persuasion model is also studied in security games to fight illegal poaching and urban crimes ( Xu et al. , 2016 ; 2018 ; Bondi et al. , 2020 ) . There is also a line of works that focuses on learning the persuasion scheme . The most relevant work is by Bhatt & Buro ( 2021 ) , who formulate the problem of learning a messaging scheme as a multiagent communication problem , and propose two algorithms called Info-Q and Info-Policy . However , they focus on fully cooperative settings and only consider deterministic messaging schemes . Zu et al . ( 2021 ) study the learning problem when the prior distribution over the states is unknown . They provide an algorithm with sub-linear regret . Camara et al . ( 2020 ) also study a mechanism design setting without the common prior assumption . They give regret bounds for the mechanism designer compared to the best mechanism in hind sight . Babichenko et al . ( 2021 ) also considers the setting where the receiver ’ s utility is unknown . However , they focus on the case with only two actions and aim to provide a messaging scheme that performs well with all possible receiver utilities . Castiglioni et al . ( 2020 ) study the setting where the receiver has an unknown type that is chosen adversarially . They show that there is no efficient algorithm in this case but can achieve sub-linear regret . 2 PRELIMINARIES . In the standard Bayesian persuasion model , there are two players : a sender and a receiver , denoted by subscripts 1 and 2 , respectively . The receiver needs to make a decision by choosing an action from a set of possible actions A . Assume that both players ’ utility functions depend on a state of nature s ∈ S , which is drawn from a publicly known prior distribution p. In particular , the players ’ utility functions are ui : S × A 7→ R , i ∈ { 1 , 2 } , respectively . We focus on the case where both A and S are finite . We assume that the sender can observe the actual , realized state s , while the receiver has no access to it throughout the game . The sender can send a message m ∈ M to the receiver before he makes the decision to reveal information about the state s. Before the game starts , the sender can commit to a certain messaging scheme π ( m|s ) ∈ [ 0 , 1 ] , which is the probability of sending message m conditioned on that she observes state s. The standard persuasion model also assumes that the sender has commitment power ( the sender acts exactly as the messaging scheme they commit to ) , and that the receiver also knows π ( m|s ) . Therefore , when the receiver gets message m , he will update his belief about the state according to the Bayes ’ rule : p ( s|m ) = π ( m|s ) p ( s ) ∑ s′ π ( m|s′ ) p ( s′ ) . ( 1 ) Based on the posterior belief , the receiver then selects an action to maximize his expected utility : a ∈ arg max a′ ∑ s u2 ( s , a ′ ) p ( s|m ) = arg max a′ ∑ s u2 ( s , a ′ ) π ( m|s ) p ( s ) , . ( 2 ) An example of how the persuasion process works is provided in Appendix A . The core problem is to design an optimal messaging scheme to maximize the sender ’ s expected utility , subject to the constraint that the receiver always chooses the best action to him . Such a problem can be formulated as a linear program , and thus can be efficiently solved . With arguments analogous to the revelation principle ( Gibbard , 1973 ; Myerson , 1981 ) in the mechanism design theory , it is not difficult to show that an optimal messaging scheme needs to use no more than n messages , where n = |A| is the total number of actions available to the receiver . Therefore , it suffices to focus on the case with n messages and each message can actually be interpreted as an action recommendation , i.e. , the sender recommends the receiver to take action ai by sending him message mi . However , in order for the receiver to follow the sender ’ s recommendation , we need to pose a constraint on the sender ’ s messaging scheme : ∑ s∈S π ( mi|s ) u2 ( s , ai ) ≥ ∑ s∈S π ( mi|s ) u2 ( s , ai′ ) , ∀1 ≤ i , i′ ≤ n. ( 3 ) With the above constraints , the receiver has no incentive to choose any action other than the one recommended by the sender . Of course , the messaging scheme π should also satisfy the following feasibility constraints : n∑ i=1 π ( mi|s ) = 1 , ∀s ∈ S and π ( mi|s ) ≥ 0 , ∀1 ≤ i ≤ n , ∀s ∈ S ( 4 ) Therefore , we can formulate the problem as the following linear program : maximize : ∑ s∈S n∑ i=1 p ( s ) π ( mi|s ) u1 ( s , ai ) subject to : Constraint ( 3 ) and ( 4 ) ( 5 ) In our setting , we allow irrational behaviors of the receiver . Let q ( a|m ) be the receiver ’ s probability of choosing action a after receiving message m. If the receiver is rational , q ( a|m ) is simply a pure strategy . Otherwise , q ( a|m ) can be any probability distribution over A . We make the assumption that q ( a|m ) only depends on the messaging scheme π ( m|s ) ( as well as the prior p ( s ) , which is constant ) and thus we sometimes write qπ ( a|m ) to emphasize the dependence on π . The receiver needs to learn π ( m|s ) in order to determine q ( a|m ) , since the receiver can not observe the scheme in advance . We further assume that if the sender ’ s empirical messaging scheme converges to π , then the receiver can correctly learn π and the empirical frequency of the receiver ’ s actions also converges to qπ . Note that this includes the no-regret learning algorithms in the contextual bandit setting . Because when the receiver is rational and applies a no-regret learning algorithm , his strategy would surely converge to the one defined in Equation ( 2 ) , since otherwise , the learning algorithm can not have sub-linear regrets . | The paper suggests using neural networks to solve the nested optimisation problem of designing a disclosure scheme in persuasion schemes. This allows authors to remove the assumption of prior knowledge of receiver utilities by the sender, as well as rationality assumption of the receiver. Authors theoretically show that their approach correctly simulates the necessary optimisation patterns, and the paper concludes with a set of experiments that demonstrate that alternative solutions, that do not solve the optimisation directly, are less effective in achieving same effective persuasion levels. | SP:1ff5df4aa57ece76ae9fa5e5d957ac3be595e3e3 |
Learning to Persuade | 1 INTRODUCTION . The Bayesian persuasion model has recently been extensively studied in economics , computer science and operations research ( Kamenica & Gentzkow , 2011 ; Arieli & Babichenko , 2019 ; Dughmi & Xu , 2019 ; Lingenbrink & Iyer , 2019 ) . This model considers the problem of how an informed player ( the sender ) can influence the behavior of an uninformed , self-interested player ( the receiver ) . The model was firstly proposed by Kamenica & Gentzkow ( 2011 ) , and has been successfully applied to various domains such as security games ( Xu et al. , 2015 ; Rabinovich et al. , 2015 ; Shen et al. , 2020 ) , auctions ( Badanidiyuru et al. , 2018 ; Shen et al. , 2019 ) , voting ( Alonso & Câmara , 2016 ; Cheng et al. , 2015 ) and recommendation systems ( Mansour et al. , 2016 ) . In the Bayesian persuasion model , there are two players : a sender ( she ) and a receiver ( he ) . The sender can observe a state of nature that is randomly drawn from a common prior . The receiver does not have access to the state , but can play an action . Before the receiver chooses an action to play , the sender can send a message to the receiver about the observed state . Both the two players ’ utilities depend on the state as well as the receiver ’ s action . The core problem lies on how the sender can design a messaging scheme to maximize her utility by partially revealing the information to the receiver to influence the receiver ’ s behavior . Although the Bayesian persuasion model has nice mathematical structures in theory , it also relies heavily on some assumptions that often do not hold in reality . For example , it is assumed that the sender perfectly knows receiver ’ s utility and that the receiver is completely rational . Another crucial assumption is that the sender has the so-called commitment power and is able to convey her commitment to the receiver before the game begins . However , in many applications , the receiver can not get the accurate commitment due to lack of such communication channels , or simply because the whole commitment is too complicated to understand . The application of the model has been greatly restricted by such strong assumptions . In this paper , we aim to relax these unrealistic assumptions and consider the setting where the sender only knows his own utility but not the receiver ’ s . However , the sender can learn the receiver ’ s utility or behaviors through interacting with the receiver repeatedly . Such a setting captures how the sender could affect the receiver ’ s behavior in many applications ( e.g. , auctions , recommendation systems ) . Instead of game-theoretic analyses , we make use of tools from the AI domain to model the receiver , and apply a data-driven approach to optimize the sender ’ s strategy . In particular , we use two neural networks to model the sender and the receiver . The sender network maps observed states to strategies of sending different messages to the receiver , while the receiver network maps received messages to strategies of playing actions . Note that our receiver model is an end-to-end model and does not involve his utility function . Such a modeling choice is general enough to be applied to cases where the receiver is not fully rational . 1.1 OUR CONTRIBUTIONS . In this paper , we propose a framework for learning the sender ’ s optimal messaging scheme . The framework contains three components : a sender network , a receiver network , and an algorithm for optimizing the sender ’ s expected utility by repeatedly interacting with the receiver . When optimizing the sender ’ s messaging scheme , our algorithm takes into account how changes in sender ’ s scheme affects the receiver ’ s behavior . We analyze theoretic properties of the proposed framework . We show that the receiver model is PAC-learnable , but at the same time may take exponentially many interactions to train the receiver model . We also conduct extensive experiments to demonstrate the effectiveness of our framework . 1.2 ADDITIONAL RELATED WORKS . The Bayesian persuasion model was first studies by researchers from the domain of economics ( Brocas & Carrillo , 2007 ; Kamenica & Gentzkow , 2011 ) . Brocas & Carrillo ( 2007 ) considers the case with only a couple of states , and Kamenica & Gentzkow ( 2011 ) later generalized the model to any finite number of states and actions . Bergemann et al . ( 2015 ) studies the market segmentation problem , and Shen et al . ( 2018 ) showed that the problem is equivalent to a persuasion problem in designing optimal auctions . The persuasion model is also studied in security games to fight illegal poaching and urban crimes ( Xu et al. , 2016 ; 2018 ; Bondi et al. , 2020 ) . There is also a line of works that focuses on learning the persuasion scheme . The most relevant work is by Bhatt & Buro ( 2021 ) , who formulate the problem of learning a messaging scheme as a multiagent communication problem , and propose two algorithms called Info-Q and Info-Policy . However , they focus on fully cooperative settings and only consider deterministic messaging schemes . Zu et al . ( 2021 ) study the learning problem when the prior distribution over the states is unknown . They provide an algorithm with sub-linear regret . Camara et al . ( 2020 ) also study a mechanism design setting without the common prior assumption . They give regret bounds for the mechanism designer compared to the best mechanism in hind sight . Babichenko et al . ( 2021 ) also considers the setting where the receiver ’ s utility is unknown . However , they focus on the case with only two actions and aim to provide a messaging scheme that performs well with all possible receiver utilities . Castiglioni et al . ( 2020 ) study the setting where the receiver has an unknown type that is chosen adversarially . They show that there is no efficient algorithm in this case but can achieve sub-linear regret . 2 PRELIMINARIES . In the standard Bayesian persuasion model , there are two players : a sender and a receiver , denoted by subscripts 1 and 2 , respectively . The receiver needs to make a decision by choosing an action from a set of possible actions A . Assume that both players ’ utility functions depend on a state of nature s ∈ S , which is drawn from a publicly known prior distribution p. In particular , the players ’ utility functions are ui : S × A 7→ R , i ∈ { 1 , 2 } , respectively . We focus on the case where both A and S are finite . We assume that the sender can observe the actual , realized state s , while the receiver has no access to it throughout the game . The sender can send a message m ∈ M to the receiver before he makes the decision to reveal information about the state s. Before the game starts , the sender can commit to a certain messaging scheme π ( m|s ) ∈ [ 0 , 1 ] , which is the probability of sending message m conditioned on that she observes state s. The standard persuasion model also assumes that the sender has commitment power ( the sender acts exactly as the messaging scheme they commit to ) , and that the receiver also knows π ( m|s ) . Therefore , when the receiver gets message m , he will update his belief about the state according to the Bayes ’ rule : p ( s|m ) = π ( m|s ) p ( s ) ∑ s′ π ( m|s′ ) p ( s′ ) . ( 1 ) Based on the posterior belief , the receiver then selects an action to maximize his expected utility : a ∈ arg max a′ ∑ s u2 ( s , a ′ ) p ( s|m ) = arg max a′ ∑ s u2 ( s , a ′ ) π ( m|s ) p ( s ) , . ( 2 ) An example of how the persuasion process works is provided in Appendix A . The core problem is to design an optimal messaging scheme to maximize the sender ’ s expected utility , subject to the constraint that the receiver always chooses the best action to him . Such a problem can be formulated as a linear program , and thus can be efficiently solved . With arguments analogous to the revelation principle ( Gibbard , 1973 ; Myerson , 1981 ) in the mechanism design theory , it is not difficult to show that an optimal messaging scheme needs to use no more than n messages , where n = |A| is the total number of actions available to the receiver . Therefore , it suffices to focus on the case with n messages and each message can actually be interpreted as an action recommendation , i.e. , the sender recommends the receiver to take action ai by sending him message mi . However , in order for the receiver to follow the sender ’ s recommendation , we need to pose a constraint on the sender ’ s messaging scheme : ∑ s∈S π ( mi|s ) u2 ( s , ai ) ≥ ∑ s∈S π ( mi|s ) u2 ( s , ai′ ) , ∀1 ≤ i , i′ ≤ n. ( 3 ) With the above constraints , the receiver has no incentive to choose any action other than the one recommended by the sender . Of course , the messaging scheme π should also satisfy the following feasibility constraints : n∑ i=1 π ( mi|s ) = 1 , ∀s ∈ S and π ( mi|s ) ≥ 0 , ∀1 ≤ i ≤ n , ∀s ∈ S ( 4 ) Therefore , we can formulate the problem as the following linear program : maximize : ∑ s∈S n∑ i=1 p ( s ) π ( mi|s ) u1 ( s , ai ) subject to : Constraint ( 3 ) and ( 4 ) ( 5 ) In our setting , we allow irrational behaviors of the receiver . Let q ( a|m ) be the receiver ’ s probability of choosing action a after receiving message m. If the receiver is rational , q ( a|m ) is simply a pure strategy . Otherwise , q ( a|m ) can be any probability distribution over A . We make the assumption that q ( a|m ) only depends on the messaging scheme π ( m|s ) ( as well as the prior p ( s ) , which is constant ) and thus we sometimes write qπ ( a|m ) to emphasize the dependence on π . The receiver needs to learn π ( m|s ) in order to determine q ( a|m ) , since the receiver can not observe the scheme in advance . We further assume that if the sender ’ s empirical messaging scheme converges to π , then the receiver can correctly learn π and the empirical frequency of the receiver ’ s actions also converges to qπ . Note that this includes the no-regret learning algorithms in the contextual bandit setting . Because when the receiver is rational and applies a no-regret learning algorithm , his strategy would surely converge to the one defined in Equation ( 2 ) , since otherwise , the learning algorithm can not have sub-linear regrets . | The authors propose a differentiable, end-to-end formulation for the standard Bayesian persuasion problem. The sender's and the receiver's strategies are modeled using neural networks, and the authors propose using a version of alternative training to simultaneously optimize the sender's strategy and predict the receiver's response. The authors analyze some theoretical properties of the approach in an idealized setting, and conduct experiments on synthetic data to evaluate the performance of their approach. The empirical results show that when the receiver observes the sender's entire strategy, their approach achieves about 90% of the optimal sender's utility for 32 states and 32 actions. When the receiver only observes individual messages (and therefore needs to learn the best response), the proposed approach significantly outperform baseline methods (which are not specifically designed for this task). The results also show diminishing marginal utility gain when the space of messages allowed becomes larger. | SP:1ff5df4aa57ece76ae9fa5e5d957ac3be595e3e3 |
Enhancing semi-supervised learning via self-interested coalitional learning | 1 INTRODUCTION . Despite the huge success of supervised learning with deep neural networks , they require large amounts of labeled data for model training to achieve high performance ( Meng et al. , 2019 ; Prabhu & Varma , 2014 ) . Collecting labeled data can be very difficult and costly in practice ( Meng et al. , 2020 ) . The challenge can be further exacerbated as in many cases , human or machine labeled data may contain errors or noises ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ) . Semi-supervised learning ( SSL ) ( Chapelle et al. , 2006 ) that leverages both labeled and unlabeled data has become an increasingly promising yet still challenging area , and is widely applicable to real-world problems . To utilize the hidden information in the unlabeled data , a general and popular semi-supervised learning paradigm is through self-training ( Yarowsky , 1995 ; Lee et al. , 2013 ) . Self-training uses a previously learned model to predict labels for the unlabeled data ( pseudo-labeling ) which are then used for subsequent model training ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Tarvainen & Valpola , 2017b ; Iscen et al. , 2019b ) . Despite some empirical successes , self-training methods still suffer from two core challenges , which are over-reliance on labeled data and error accumulation . Most existing semi-supervised learning methods ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Sohn et al. , 2020 ; Xie et al. , 2020 ; Kipf & Welling , 2017 ) assume the labeled and unlabeled data follow the same or similar data distribution , thus the data-label mapping mechanisms learned from the labeled data are somewhat transferable to unlabeled data . Essentially , the algorithm is still reinforcing the information in the labeled data rather than mining additional information from the unlabeled data . Second , the pseudo-labels of unlabeled data can be incorrectly predicted . Using such biased information for training in subsequent epochs could increase confidence in erroneous predictions , and eventually leading to a vicious circle of error accumulation ( Cai et al. , 2013 ; Arazo et al. , 2020 ) . The situation can be even worse when the labeled data contain errors or noises , as the model learned from labeled data will make more mistakes , resulting in more severe error accumulation . Alleviating the issue of over-reliance on labeled data requires extracting additional sources of information from the unlabeled data . One recent approach is to introduce input consistency regularization ( Sajjadi et al. , 2016 ) . Consistency regularization enforces the stability of the predictions with respect to the transformations of the unlabeled data ( e.g . data augmentation on images such as rotation , flip and shift , etc. ) . Although such data perturbation or augmentation are well-defined for images , they are not directly transferable to general settings , hence the success of consistency regularization methods are mostly restricted to image classification tasks ( Sajjadi et al. , 2016 ; Liu et al. , 2019 ; Xie et al. , 2020 ; Sohn et al. , 2020 ) . We provide a new insight by noting that , under the self-training paradigm , every semi-supervised learning task hides another auxiliary task of discriminating whether the data label is real or a pseudo-label predicted by a machine oracle . Jointly solving the main task together with the auxiliary task allows sufficient utilization of the hidden information in unlabeled data . To break the vicious circle of error accumulation , one needs to not always trust the machine-labeled data . A natural idea is to consider the reliability or confidence of data labels and treat them differently during training . A connected approach in supervised learning literature is to use the notion of “ soft label ” with confidence probability or weights , which has been verified in a number of noisy label learning problems ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ; Shen et al. , 2020 ; Algan & Ulusoy , 2021 ) . This treatment can also help a semi-supervised learning algorithm gain the ability to robustly learn from noisy labels . Combining previous insights , we develop a novel semi-supervised learning framework , called Selfinterested Coalitional Learning ( SCL ) . SCL contains three ingredients . First , it simultaneously solves a companion task by learning a discriminator as a critic to predict label observability ( whether it is a true label or a pseudo-label ) , which is used to mine additional information in the unlabeled data while facilitating main task learning . Second , the output of the discriminator is in fact a measure of label reliability , thus can be interpreted as the confidence probabilities of labels ( Qin et al. , 2021 ) . This converts the original problem into a soft label learning problem . Finally and most importantly , SCL introduces a cooperative-yet-competitive learning scheme to boost the performance of both the main task and the companion task . Specifically , SCL forges cooperation between both tasks by providing extra information to each other ( the main task provides prediction loss , companion task provides label confidence measures ) , leading to improved performance of both tasks . Moreover , we consider the main task model to be self-interested which tries to challenge the discriminator by providing as little information as possible . This design forms a semi-cooperative “ game ” with a partially adversarial main task model , which can be shown theoretically equivalent to a loss reweighting mechanism on noisy soft labels . Under this design , the main task and the companion task in SCL are neither fully cooperative as in multi-objective optimization ( Deb , 2014 ) nor fully adversarial to each other as in adversarial learning ( Goodfellow et al. , 2014 ; Matyasko & Chau , 2018 ) , but balance the benefit of cooperation and competition . In summary , the contribution of this work include : • We develop a novel and very general self-interested coalitional learning framework for SSL that fully utilizes the hidden information in the unlabeled data while addressing the error accumulation issue in the self-training paradigm of SSL . • SCL can be easily incorporated into a wide range of semi-supervised algorithms ( e.g . image classification , label propagation and data imputation ) with limited changes on the original method . We show with comprehensive empirical experiments that SCL consistently achieves superior performance and robustness compared with the original and self-training version of different semisupervised learning algorithms . • SCL naturally provides the data confidence measures from the discriminator as a byproduct of the learning process , which offers additional interpretability of the semi-supervised learning task . This can be particularly useful for many practical applications , while also providing extra benefits for scenarios with noisy data labels . 2 PRELIMINARIES . 2.1 PROBLEM DEFINITIONS AND FORMULATIONS . We formulate the semi-supervised learning problem as learning a model f ( · ) with input data x ∈ X to predict the label y ∈ Y . In SSL , only a partial set of data labels YL with ground truth are given in the training set , the rest are unlabeled YU ( Y = YL ⋃ YU ) . For convenience of later discussion , we denote L as the set of indices of data samples with labels and U as the set of indices for unlabeled data . In many real-world SSL problems , the size of labeled data |L| is often limited . In extreme cases , YL may potentially contain errors or noises . We further define a mask vector M to denote the observability of labels over each data sample . We set Mi ∈ M equals to 1 if i ∈ L and Mj ∈ M equals to 0 if j ∈ U . In our proposed SCL framework , we consider following common settings of semi-supervised classification ( inductive classification , label propagation ) and regression ( data imputation ) tasks : Inductive classification : a typical SSL task setting is to construct a classifier to predict labels y ∈ Y for any object in the input space x ∈ X . Common examples include semi-supervised image classification tasks ( Sajjadi et al. , 2016 ; Sohn et al. , 2020 ; Xie et al. , 2020 ) , where only a subset of data samples are given the known labels YL and the rest data labels YU are unknown . Label propagation : another class of SSL tasks under transductive setup is to use all input samples X and observed labels YL to train a classifier to predict on unseen labels YU . Examples include classifying nodes in a graph given only small subset of node labels YL ( Kipf & Welling , 2017 ) . Data imputation : one of the special case of SSL problem is that the missing state of input and output data are strongly correlated ( Richardson et al. , 2020 ; Qin et al. , 2021 ) , such as the data imputation tasks . In data imputation , the inputs X are partially filled and the labels Y are equivalent to a reconstructed version of X obtained through regression . 2.2 AUXILIARY TASK IN SEMI-SUPERVISED LEARNING PROBLEMS . We begin our discussion by first noting that , if we feed the unknown labels YU with the model f predicted labels ỸU = Ŷ ( k ) U ( Ŷ ( k ) U = f ( X ) represents the labels from the k-th round of pseudolabeling ) or other machine-generated labels , there actually hides an auxiliary task of discriminating whether the data label is real or a pseudo-label . Denote all the data labels under pseudo-labeling as Ỹ = YL ⋃ ỸU . We can train a discriminator d ( · ) to tell the confidence measure p ∈ P of whether x → ỹ ( x ∈ X , ỹ ∈ Ỹ ) is a valid mapping . This is always learnable since the ground truth of P is exactly the observability mask M . With a slight abuse of notation , we formulate the main SSL task A and the auxiliary companion task B as follows : A : f ( X ) = Ŷ , LA = lossA ( YL , ŶL ) B : d ( X , Ỹ ) = P , LB = lossB ( P , M ) ( 1 ) where lossA is the original loss function of the main task and lossB can be any binary classification loss between P and M , such as the binary cross entropy ( BCE ) loss . Jointly solving the above two tasks allows exploiting the underlying relationship between input data X and data label Y from another angle , which can potentially provide more information to facilitate main task training . There are some other works that embody the similar idea of jointly learning two tasks . For example , the multi-task style multi-objective optimization methods ( Ruder , 2017 ; Deb , 2014 ) exploit the shared information and underlying commonalities between two tasks and solve the problem by minimizing an augmented loss . The generative adversarial learning ( Goodfellow et al. , 2014 ) makes a generator and a discriminator learn against each other , thus improves the performance of both tasks . However , naı̈vely applying these two approaches has some drawbacks . For example , multiobjective optimization can not handle potential contradictions of the two tasks in certain settings , where jointly minimizing the augmented loss may impede both tasks from achieving the best performance ( Qin et al. , 2021 ) . Whereas under the adversarial learning framework , lossA is implicitly optimized through the discriminator , which could result in potential loss of information . Moreover , solving the minimax optimization problem under a GAN-style model is much harder compared with directly minimize both loss functions explicitly in ( 1 ) in a supervised learning fashion . | The paper introduces Self-interested Coalitional Learning (SCL), which is a novel approach to semi-supervised learning. SCL combines the traditional self-training approach to semi-supervised learning with an auxiliary task that infers label observability. The empirical results show that, in a variety of scenarios, SCL outperforms both self-training and the original model. | SP:9e8c438371dadf3648865b69aa177d47af6ed741 |
Enhancing semi-supervised learning via self-interested coalitional learning | 1 INTRODUCTION . Despite the huge success of supervised learning with deep neural networks , they require large amounts of labeled data for model training to achieve high performance ( Meng et al. , 2019 ; Prabhu & Varma , 2014 ) . Collecting labeled data can be very difficult and costly in practice ( Meng et al. , 2020 ) . The challenge can be further exacerbated as in many cases , human or machine labeled data may contain errors or noises ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ) . Semi-supervised learning ( SSL ) ( Chapelle et al. , 2006 ) that leverages both labeled and unlabeled data has become an increasingly promising yet still challenging area , and is widely applicable to real-world problems . To utilize the hidden information in the unlabeled data , a general and popular semi-supervised learning paradigm is through self-training ( Yarowsky , 1995 ; Lee et al. , 2013 ) . Self-training uses a previously learned model to predict labels for the unlabeled data ( pseudo-labeling ) which are then used for subsequent model training ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Tarvainen & Valpola , 2017b ; Iscen et al. , 2019b ) . Despite some empirical successes , self-training methods still suffer from two core challenges , which are over-reliance on labeled data and error accumulation . Most existing semi-supervised learning methods ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Sohn et al. , 2020 ; Xie et al. , 2020 ; Kipf & Welling , 2017 ) assume the labeled and unlabeled data follow the same or similar data distribution , thus the data-label mapping mechanisms learned from the labeled data are somewhat transferable to unlabeled data . Essentially , the algorithm is still reinforcing the information in the labeled data rather than mining additional information from the unlabeled data . Second , the pseudo-labels of unlabeled data can be incorrectly predicted . Using such biased information for training in subsequent epochs could increase confidence in erroneous predictions , and eventually leading to a vicious circle of error accumulation ( Cai et al. , 2013 ; Arazo et al. , 2020 ) . The situation can be even worse when the labeled data contain errors or noises , as the model learned from labeled data will make more mistakes , resulting in more severe error accumulation . Alleviating the issue of over-reliance on labeled data requires extracting additional sources of information from the unlabeled data . One recent approach is to introduce input consistency regularization ( Sajjadi et al. , 2016 ) . Consistency regularization enforces the stability of the predictions with respect to the transformations of the unlabeled data ( e.g . data augmentation on images such as rotation , flip and shift , etc. ) . Although such data perturbation or augmentation are well-defined for images , they are not directly transferable to general settings , hence the success of consistency regularization methods are mostly restricted to image classification tasks ( Sajjadi et al. , 2016 ; Liu et al. , 2019 ; Xie et al. , 2020 ; Sohn et al. , 2020 ) . We provide a new insight by noting that , under the self-training paradigm , every semi-supervised learning task hides another auxiliary task of discriminating whether the data label is real or a pseudo-label predicted by a machine oracle . Jointly solving the main task together with the auxiliary task allows sufficient utilization of the hidden information in unlabeled data . To break the vicious circle of error accumulation , one needs to not always trust the machine-labeled data . A natural idea is to consider the reliability or confidence of data labels and treat them differently during training . A connected approach in supervised learning literature is to use the notion of “ soft label ” with confidence probability or weights , which has been verified in a number of noisy label learning problems ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ; Shen et al. , 2020 ; Algan & Ulusoy , 2021 ) . This treatment can also help a semi-supervised learning algorithm gain the ability to robustly learn from noisy labels . Combining previous insights , we develop a novel semi-supervised learning framework , called Selfinterested Coalitional Learning ( SCL ) . SCL contains three ingredients . First , it simultaneously solves a companion task by learning a discriminator as a critic to predict label observability ( whether it is a true label or a pseudo-label ) , which is used to mine additional information in the unlabeled data while facilitating main task learning . Second , the output of the discriminator is in fact a measure of label reliability , thus can be interpreted as the confidence probabilities of labels ( Qin et al. , 2021 ) . This converts the original problem into a soft label learning problem . Finally and most importantly , SCL introduces a cooperative-yet-competitive learning scheme to boost the performance of both the main task and the companion task . Specifically , SCL forges cooperation between both tasks by providing extra information to each other ( the main task provides prediction loss , companion task provides label confidence measures ) , leading to improved performance of both tasks . Moreover , we consider the main task model to be self-interested which tries to challenge the discriminator by providing as little information as possible . This design forms a semi-cooperative “ game ” with a partially adversarial main task model , which can be shown theoretically equivalent to a loss reweighting mechanism on noisy soft labels . Under this design , the main task and the companion task in SCL are neither fully cooperative as in multi-objective optimization ( Deb , 2014 ) nor fully adversarial to each other as in adversarial learning ( Goodfellow et al. , 2014 ; Matyasko & Chau , 2018 ) , but balance the benefit of cooperation and competition . In summary , the contribution of this work include : • We develop a novel and very general self-interested coalitional learning framework for SSL that fully utilizes the hidden information in the unlabeled data while addressing the error accumulation issue in the self-training paradigm of SSL . • SCL can be easily incorporated into a wide range of semi-supervised algorithms ( e.g . image classification , label propagation and data imputation ) with limited changes on the original method . We show with comprehensive empirical experiments that SCL consistently achieves superior performance and robustness compared with the original and self-training version of different semisupervised learning algorithms . • SCL naturally provides the data confidence measures from the discriminator as a byproduct of the learning process , which offers additional interpretability of the semi-supervised learning task . This can be particularly useful for many practical applications , while also providing extra benefits for scenarios with noisy data labels . 2 PRELIMINARIES . 2.1 PROBLEM DEFINITIONS AND FORMULATIONS . We formulate the semi-supervised learning problem as learning a model f ( · ) with input data x ∈ X to predict the label y ∈ Y . In SSL , only a partial set of data labels YL with ground truth are given in the training set , the rest are unlabeled YU ( Y = YL ⋃ YU ) . For convenience of later discussion , we denote L as the set of indices of data samples with labels and U as the set of indices for unlabeled data . In many real-world SSL problems , the size of labeled data |L| is often limited . In extreme cases , YL may potentially contain errors or noises . We further define a mask vector M to denote the observability of labels over each data sample . We set Mi ∈ M equals to 1 if i ∈ L and Mj ∈ M equals to 0 if j ∈ U . In our proposed SCL framework , we consider following common settings of semi-supervised classification ( inductive classification , label propagation ) and regression ( data imputation ) tasks : Inductive classification : a typical SSL task setting is to construct a classifier to predict labels y ∈ Y for any object in the input space x ∈ X . Common examples include semi-supervised image classification tasks ( Sajjadi et al. , 2016 ; Sohn et al. , 2020 ; Xie et al. , 2020 ) , where only a subset of data samples are given the known labels YL and the rest data labels YU are unknown . Label propagation : another class of SSL tasks under transductive setup is to use all input samples X and observed labels YL to train a classifier to predict on unseen labels YU . Examples include classifying nodes in a graph given only small subset of node labels YL ( Kipf & Welling , 2017 ) . Data imputation : one of the special case of SSL problem is that the missing state of input and output data are strongly correlated ( Richardson et al. , 2020 ; Qin et al. , 2021 ) , such as the data imputation tasks . In data imputation , the inputs X are partially filled and the labels Y are equivalent to a reconstructed version of X obtained through regression . 2.2 AUXILIARY TASK IN SEMI-SUPERVISED LEARNING PROBLEMS . We begin our discussion by first noting that , if we feed the unknown labels YU with the model f predicted labels ỸU = Ŷ ( k ) U ( Ŷ ( k ) U = f ( X ) represents the labels from the k-th round of pseudolabeling ) or other machine-generated labels , there actually hides an auxiliary task of discriminating whether the data label is real or a pseudo-label . Denote all the data labels under pseudo-labeling as Ỹ = YL ⋃ ỸU . We can train a discriminator d ( · ) to tell the confidence measure p ∈ P of whether x → ỹ ( x ∈ X , ỹ ∈ Ỹ ) is a valid mapping . This is always learnable since the ground truth of P is exactly the observability mask M . With a slight abuse of notation , we formulate the main SSL task A and the auxiliary companion task B as follows : A : f ( X ) = Ŷ , LA = lossA ( YL , ŶL ) B : d ( X , Ỹ ) = P , LB = lossB ( P , M ) ( 1 ) where lossA is the original loss function of the main task and lossB can be any binary classification loss between P and M , such as the binary cross entropy ( BCE ) loss . Jointly solving the above two tasks allows exploiting the underlying relationship between input data X and data label Y from another angle , which can potentially provide more information to facilitate main task training . There are some other works that embody the similar idea of jointly learning two tasks . For example , the multi-task style multi-objective optimization methods ( Ruder , 2017 ; Deb , 2014 ) exploit the shared information and underlying commonalities between two tasks and solve the problem by minimizing an augmented loss . The generative adversarial learning ( Goodfellow et al. , 2014 ) makes a generator and a discriminator learn against each other , thus improves the performance of both tasks . However , naı̈vely applying these two approaches has some drawbacks . For example , multiobjective optimization can not handle potential contradictions of the two tasks in certain settings , where jointly minimizing the augmented loss may impede both tasks from achieving the best performance ( Qin et al. , 2021 ) . Whereas under the adversarial learning framework , lossA is implicitly optimized through the discriminator , which could result in potential loss of information . Moreover , solving the minimax optimization problem under a GAN-style model is much harder compared with directly minimize both loss functions explicitly in ( 1 ) in a supervised learning fashion . | This paper proposes a new semi-supervised learning framework by introducing an auxiliary task that distinguishes whether the pseudo-labels are truly labeled or not. Then, this information is used to add a reweighting loss to the main objective. Experiments on several simple benchmark datasets show that the proposed method outperforms some naive baselines. | SP:9e8c438371dadf3648865b69aa177d47af6ed741 |
Enhancing semi-supervised learning via self-interested coalitional learning | 1 INTRODUCTION . Despite the huge success of supervised learning with deep neural networks , they require large amounts of labeled data for model training to achieve high performance ( Meng et al. , 2019 ; Prabhu & Varma , 2014 ) . Collecting labeled data can be very difficult and costly in practice ( Meng et al. , 2020 ) . The challenge can be further exacerbated as in many cases , human or machine labeled data may contain errors or noises ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ) . Semi-supervised learning ( SSL ) ( Chapelle et al. , 2006 ) that leverages both labeled and unlabeled data has become an increasingly promising yet still challenging area , and is widely applicable to real-world problems . To utilize the hidden information in the unlabeled data , a general and popular semi-supervised learning paradigm is through self-training ( Yarowsky , 1995 ; Lee et al. , 2013 ) . Self-training uses a previously learned model to predict labels for the unlabeled data ( pseudo-labeling ) which are then used for subsequent model training ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Tarvainen & Valpola , 2017b ; Iscen et al. , 2019b ) . Despite some empirical successes , self-training methods still suffer from two core challenges , which are over-reliance on labeled data and error accumulation . Most existing semi-supervised learning methods ( Yarowsky , 1995 ; Lee et al. , 2013 ; Laine & Aila , 2017 ; Sohn et al. , 2020 ; Xie et al. , 2020 ; Kipf & Welling , 2017 ) assume the labeled and unlabeled data follow the same or similar data distribution , thus the data-label mapping mechanisms learned from the labeled data are somewhat transferable to unlabeled data . Essentially , the algorithm is still reinforcing the information in the labeled data rather than mining additional information from the unlabeled data . Second , the pseudo-labels of unlabeled data can be incorrectly predicted . Using such biased information for training in subsequent epochs could increase confidence in erroneous predictions , and eventually leading to a vicious circle of error accumulation ( Cai et al. , 2013 ; Arazo et al. , 2020 ) . The situation can be even worse when the labeled data contain errors or noises , as the model learned from labeled data will make more mistakes , resulting in more severe error accumulation . Alleviating the issue of over-reliance on labeled data requires extracting additional sources of information from the unlabeled data . One recent approach is to introduce input consistency regularization ( Sajjadi et al. , 2016 ) . Consistency regularization enforces the stability of the predictions with respect to the transformations of the unlabeled data ( e.g . data augmentation on images such as rotation , flip and shift , etc. ) . Although such data perturbation or augmentation are well-defined for images , they are not directly transferable to general settings , hence the success of consistency regularization methods are mostly restricted to image classification tasks ( Sajjadi et al. , 2016 ; Liu et al. , 2019 ; Xie et al. , 2020 ; Sohn et al. , 2020 ) . We provide a new insight by noting that , under the self-training paradigm , every semi-supervised learning task hides another auxiliary task of discriminating whether the data label is real or a pseudo-label predicted by a machine oracle . Jointly solving the main task together with the auxiliary task allows sufficient utilization of the hidden information in unlabeled data . To break the vicious circle of error accumulation , one needs to not always trust the machine-labeled data . A natural idea is to consider the reliability or confidence of data labels and treat them differently during training . A connected approach in supervised learning literature is to use the notion of “ soft label ” with confidence probability or weights , which has been verified in a number of noisy label learning problems ( Natarajan et al. , 2017 ; Schnabel et al. , 2016 ; Shen et al. , 2020 ; Algan & Ulusoy , 2021 ) . This treatment can also help a semi-supervised learning algorithm gain the ability to robustly learn from noisy labels . Combining previous insights , we develop a novel semi-supervised learning framework , called Selfinterested Coalitional Learning ( SCL ) . SCL contains three ingredients . First , it simultaneously solves a companion task by learning a discriminator as a critic to predict label observability ( whether it is a true label or a pseudo-label ) , which is used to mine additional information in the unlabeled data while facilitating main task learning . Second , the output of the discriminator is in fact a measure of label reliability , thus can be interpreted as the confidence probabilities of labels ( Qin et al. , 2021 ) . This converts the original problem into a soft label learning problem . Finally and most importantly , SCL introduces a cooperative-yet-competitive learning scheme to boost the performance of both the main task and the companion task . Specifically , SCL forges cooperation between both tasks by providing extra information to each other ( the main task provides prediction loss , companion task provides label confidence measures ) , leading to improved performance of both tasks . Moreover , we consider the main task model to be self-interested which tries to challenge the discriminator by providing as little information as possible . This design forms a semi-cooperative “ game ” with a partially adversarial main task model , which can be shown theoretically equivalent to a loss reweighting mechanism on noisy soft labels . Under this design , the main task and the companion task in SCL are neither fully cooperative as in multi-objective optimization ( Deb , 2014 ) nor fully adversarial to each other as in adversarial learning ( Goodfellow et al. , 2014 ; Matyasko & Chau , 2018 ) , but balance the benefit of cooperation and competition . In summary , the contribution of this work include : • We develop a novel and very general self-interested coalitional learning framework for SSL that fully utilizes the hidden information in the unlabeled data while addressing the error accumulation issue in the self-training paradigm of SSL . • SCL can be easily incorporated into a wide range of semi-supervised algorithms ( e.g . image classification , label propagation and data imputation ) with limited changes on the original method . We show with comprehensive empirical experiments that SCL consistently achieves superior performance and robustness compared with the original and self-training version of different semisupervised learning algorithms . • SCL naturally provides the data confidence measures from the discriminator as a byproduct of the learning process , which offers additional interpretability of the semi-supervised learning task . This can be particularly useful for many practical applications , while also providing extra benefits for scenarios with noisy data labels . 2 PRELIMINARIES . 2.1 PROBLEM DEFINITIONS AND FORMULATIONS . We formulate the semi-supervised learning problem as learning a model f ( · ) with input data x ∈ X to predict the label y ∈ Y . In SSL , only a partial set of data labels YL with ground truth are given in the training set , the rest are unlabeled YU ( Y = YL ⋃ YU ) . For convenience of later discussion , we denote L as the set of indices of data samples with labels and U as the set of indices for unlabeled data . In many real-world SSL problems , the size of labeled data |L| is often limited . In extreme cases , YL may potentially contain errors or noises . We further define a mask vector M to denote the observability of labels over each data sample . We set Mi ∈ M equals to 1 if i ∈ L and Mj ∈ M equals to 0 if j ∈ U . In our proposed SCL framework , we consider following common settings of semi-supervised classification ( inductive classification , label propagation ) and regression ( data imputation ) tasks : Inductive classification : a typical SSL task setting is to construct a classifier to predict labels y ∈ Y for any object in the input space x ∈ X . Common examples include semi-supervised image classification tasks ( Sajjadi et al. , 2016 ; Sohn et al. , 2020 ; Xie et al. , 2020 ) , where only a subset of data samples are given the known labels YL and the rest data labels YU are unknown . Label propagation : another class of SSL tasks under transductive setup is to use all input samples X and observed labels YL to train a classifier to predict on unseen labels YU . Examples include classifying nodes in a graph given only small subset of node labels YL ( Kipf & Welling , 2017 ) . Data imputation : one of the special case of SSL problem is that the missing state of input and output data are strongly correlated ( Richardson et al. , 2020 ; Qin et al. , 2021 ) , such as the data imputation tasks . In data imputation , the inputs X are partially filled and the labels Y are equivalent to a reconstructed version of X obtained through regression . 2.2 AUXILIARY TASK IN SEMI-SUPERVISED LEARNING PROBLEMS . We begin our discussion by first noting that , if we feed the unknown labels YU with the model f predicted labels ỸU = Ŷ ( k ) U ( Ŷ ( k ) U = f ( X ) represents the labels from the k-th round of pseudolabeling ) or other machine-generated labels , there actually hides an auxiliary task of discriminating whether the data label is real or a pseudo-label . Denote all the data labels under pseudo-labeling as Ỹ = YL ⋃ ỸU . We can train a discriminator d ( · ) to tell the confidence measure p ∈ P of whether x → ỹ ( x ∈ X , ỹ ∈ Ỹ ) is a valid mapping . This is always learnable since the ground truth of P is exactly the observability mask M . With a slight abuse of notation , we formulate the main SSL task A and the auxiliary companion task B as follows : A : f ( X ) = Ŷ , LA = lossA ( YL , ŶL ) B : d ( X , Ỹ ) = P , LB = lossB ( P , M ) ( 1 ) where lossA is the original loss function of the main task and lossB can be any binary classification loss between P and M , such as the binary cross entropy ( BCE ) loss . Jointly solving the above two tasks allows exploiting the underlying relationship between input data X and data label Y from another angle , which can potentially provide more information to facilitate main task training . There are some other works that embody the similar idea of jointly learning two tasks . For example , the multi-task style multi-objective optimization methods ( Ruder , 2017 ; Deb , 2014 ) exploit the shared information and underlying commonalities between two tasks and solve the problem by minimizing an augmented loss . The generative adversarial learning ( Goodfellow et al. , 2014 ) makes a generator and a discriminator learn against each other , thus improves the performance of both tasks . However , naı̈vely applying these two approaches has some drawbacks . For example , multiobjective optimization can not handle potential contradictions of the two tasks in certain settings , where jointly minimizing the augmented loss may impede both tasks from achieving the best performance ( Qin et al. , 2021 ) . Whereas under the adversarial learning framework , lossA is implicitly optimized through the discriminator , which could result in potential loss of information . Moreover , solving the minimax optimization problem under a GAN-style model is much harder compared with directly minimize both loss functions explicitly in ( 1 ) in a supervised learning fashion . | This paper proposes a new semi-supervised learning method. Motivated by the error accumulation problem of typical self-training paradigms, the authors propose to explicitly model the confidence of pseudo labels as an auxiliary task. They come up with a self-interested coalitional learning (SCL) strategy to solve both tasks jointly. Under the new framework, the main task is transformed into a cost-sensitive learning problem. Experiments demonstrate that pseudo labels are substantially more accurate with the new method and better performance of the main tasks at different label missing rates. | SP:9e8c438371dadf3648865b69aa177d47af6ed741 |
Efficiently Modeling Long Sequences with Structured State Spaces | 1 INTRODUCTION . A central problem in sequence modeling is efficiently handling data that contains long-range dependencies ( LRDs ) . Real-world time-series data often requires reasoning over tens of thousands of time steps , while few sequence models address even thousands of time steps . For instance , results from the long-range arena ( LRA ) benchmark ( Tay et al. , 2021 ) highlight that sequence models today perform poorly on LRD tasks , including one ( Path-X ) where no model performs better than random guessing . Since LRDs are perhaps the foremost challenge for sequence models , all standard model families such as continuous-time models ( CTMs ) , RNNs , CNNs , and Transformers include many specialized variants designed to address them . Modern examples include orthogonal and Lipschitz RNNs ( Arjovsky et al. , 2016 ; Erichson et al. , 2021 ) to combat vanishing gradients , dilated convolutions to increase context size ( Bai et al. , 2018 ; Oord et al. , 2016 ) , and an increasingly vast family of efficient Transformers that reduce the quadratic dependence on sequence length ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) . Despite being designed for LRDs , these solutions still perform poorly on challenging benchmarks such as LRA ( Tay et al. , 2021 ) or raw audio classification ( Gu et al. , 2021 ) . An alternative approach to LRDs was recently introduced based on the state space model ( SSM ) ( Fig . 1 ) . SSMs are a foundational scientific model used in fields such as control theory , computational neuroscience , and many more , but have not been applicable to deep learning for concrete theoretical reasons . In particular , Gu et al . ( 2021 ) showed that deep SSMs actually struggle even on simple tasks , but can perform exceptionally well when equipped with special state matrices A recently derived to solve a problem of continuous-time memorization ( Voelker et al. , 2019 ; Gu et al. , 2020a ) . Their Linear State Space Layer ( LSSL ) conceptually unifies the strengths of CTM , RNN and CNN models , and provides a proof of concept that deep SSMs can address LRDs in principle . Unfortunately , the LSSL is infeasible to use in practice because of prohibitive computation and memory requirements induced by the state representation . For state dimension N and sequence length L , computing the latent state requires O ( N2L ) operations and O ( NL ) space – compared to a Ω ( L + N ) lower bound for both . Thus for reasonably sized models ( e.g . N = 256 in Gu et al . ( 2021 ) ) , the LSSL uses orders of magnitude more memory than comparably-sized RNNs or CNNs . Although theoretically efficient algorithms for the LSSL were proposed , we show that these are numerically unstable . In particular , the special A matrix is highly non-normal in the linear algebraic sense , which prevents the application of conventional algorithmic techniques . Consequently , although the LSSL showed that SSMs have strong performance , they are currently computationally impractical as a general sequence modeling solution . In this work , we introduce the Structured State Space ( S4 ) sequence model based on the SSM that solves the critical computational bottleneck in previous work . Technically , S4 reparameterizes the structured state matrices A appearing in Voelker et al . ( 2019 ) ; Gu et al . ( 2020a ) by decomposing them as the sum of a low-rank and skew-symmetric term . Additionally , instead of expanding the standard SSM in coefficient space , we compute its truncated generating function in frequency space , which can be simplified into a multipole-like evaluation . Combining these two ideas , we show that the low-rank term can be corrected by the Woodbury identity while the skew-symmetric term can be diagonalized stably , ultimately reducing to a well-studied and theoretically stable Cauchy kernel ( Pan , 2001 ; 2017 ) . This results in Õ ( N + L ) computation and O ( N + L ) memory usage , which is essentially tight for sequence models . Compared to the LSSL , S4 is up to 30× faster with 400× less memory usage , while exceeding the LSSL ’ s performance empirically . Empirically , S4 significantly advances the state-of-the-art for LRD . On the LRA benchmark for efficient sequence models , S4 is as fast as all baselines while outperforming them by 20+ points on average . S4 is the first model to solve the difficult LRA Path-X task ( length-16384 ) , achieving 88 % accuracy compared to 50 % random guessing for all prior work . On speech classification with length-16000 sequences , S4 halves the test error ( 1.7 % ) of specialized Speech CNNs – by contrast , all RNN and Transformer baselines fail to learn ( ≥ 70 % error ) . Towards a general-purpose sequence model . Beyond LRD , a broad goal of machine learning is to develop a single model that can be used across a wide range of problems . Models today are typically specialized to solve problems from a particular domain ( e.g . images , audio , text , time-series ) , and enable a narrow range of capabilities ( e.g . efficient training , fast generation , handling irregularly sampled data ) . This specialization is typically expressed via domain-specific preprocessing , inductive biases , and architectures . Sequence models provide a general framework for solving many of these problems with reduced specialization – e.g . Vision Transformers for image classification with less 2D information ( Dosovitskiy et al. , 2020 ) . However , most models such as Transformers generally still require substantial specialization per task to achieve high performance . Deep SSMs in particular have conceptual strengths that suggest they may be promising as a general sequence modeling solution . These strengths include a principled approach to handling LRDs , as well as the ability to move between continuous-time , convolutional , and recurrent model representations , each with distinct capabilities ( Fig . 1 ) . Our technical contributions enable SSMs to be applied successfully to a varied set of benchmarks with minimal modification : • Large-scale generative modeling . On CIFAR-10 density estimation , S4 is competitive with the best autoregressive models ( 2.85 bits per dim ) . On WikiText-103 language modeling , S4 substantially closes the gap to Transformers ( within 0.8 perplexity ) , setting SoTA for attention-free models . • Fast autoregressive generation . Like RNNs , S4 can use its latent state to perform 60× faster pixel/token generation than standard autoregressive models on CIFAR-10 and WikiText-103 . • Irregularly sampled time-series . Like specialized CTMs , S4 can adapt to changes in time series sampling frequency without retraining , e.g . at 0.5× frequency on speech classification . • Learning with weaker inductive biases . With no architectural changes , S4 surpasses Speech CNNs on speech classification , outperforms the specialized Informer model on 40/50 time-series forecasting problems , and matches a 2-D ResNet on sequential CIFAR with over 90 % accuracy . 2 BACKGROUND : STATE SPACES . Sections 2.1 to 2.4 describe the four properties of SSMs in Fig . 1 : the classic continuous-time representation , addressing LRDs with the HiPPO framework , the discrete-time recurrent representation , and the parallelizable convolution representation . In particular , Section 2.4 introduces the SSM convolution kernel K , which is the focus of our theoretical contributions in Section 3 . 2.1 STATE SPACE MODELS : A CONTINUOUS-TIME LATENT STATE MODEL . The state space model is defined by the simple equation ( 1 ) . It maps a 1-D input signal u ( t ) to an N -D latent state x ( t ) before projecting to a 1-D output signal y ( t ) . x′ ( t ) = Ax ( t ) + Bu ( t ) y ( t ) = Cx ( t ) + Du ( t ) ( 1 ) SSMs are broadly used in many scientific disciplines and related to latent state models such as Hidden Markov Models ( HMM ) . Our goal is to simply use the SSM as a black-box representation in a deep sequence model , where A , B , C , D are parameters learned by gradient descent . For the remainder of this paper , we will omit the parameter D for exposition ( or equivalently , assume D = 0 ) because the term Du can be viewed as a skip connection and is easy to compute . 2.2 ADDRESSING LONG-RANGE DEPENDENCIES WITH HIPPO . Prior work found that the basic SSM ( 1 ) actually performs very poorly in practice . Intuitively , one explanation is that linear first-order ODEs solve to an exponential function , and thus may suffer from gradients scaling exponentially in the sequence length ( i.e. , the vanishing/exploding gradients problem ( Pascanu et al. , 2013 ) ) . To address this problem , the LSSL leveraged the HiPPO theory of continuous-time memorization ( Gu et al. , 2020a ) . HiPPO specifies a class of certain matrices A ∈ RN×N that when incorporated into ( 1 ) , allows the state x ( t ) to memorize the history of the input u ( t ) . The most important matrix in this class is defined by equation ( 2 ) , which we will call the HiPPO matrix . For example , the LSSL found that simply modifying an SSM from a random matrix A to equation ( 2 ) improved its performance on the sequential MNIST benchmark from 50 % to 98 % . ( HiPPO Matrix ) Ank = ( 2n+ 1 ) 1/2 ( 2k + 1 ) 1/2 if n > k n+ 1 if n = k 0 if n < k . ( 2 ) 2.3 DISCRETE-TIME SSM : THE RECURRENT REPRESENTATION . To be applied on a discrete input sequence ( u0 , u1 , . . . ) instead of continuous function u ( t ) , ( 1 ) must be discretized by a step size ∆ that represents the resolution of the input . Conceptually , the inputs uk can be viewed as sampling an implicit underlying continuous signal u ( t ) , where uk = u ( k∆ ) . To discretize the continuous-time SSM , we follow prior work in using the bilinear method ( Tustin , 1947 ) , which converts the state matrix A into an approximation A . The discrete SSM is xk = Axk−1 + Buk A = ( I −∆/2 ·A ) −1 ( I + ∆/2 ·A ) yk = Cxk B = ( I −∆/2 ·A ) −1∆B C = C. ( 3 ) Equation ( 3 ) is now a sequence-to-sequence map uk 7→ yk instead of function-to-function . Moreover the state equation is now a recurrence in xk , allowing the discrete SSM to be computed like an RNN . Concretely , xk ∈ RN can be viewed as a hidden state with transition matrix A. Notationally , throughout this paper we use A , B , . . . to denote discretized SSM matrices defined by ( 3 ) . Note that these matrices are a function of both A as well as a step size ∆ ; we suppress this dependence for notational convenience when it is clear . 2.4 TRAINING SSMS : THE CONVOLUTIONAL REPRESENTATION . The recurrent SSM ( 3 ) is not practical for training on modern hardware due to its sequentiality . Instead , there is a well-known connection between linear time-invariant ( LTI ) SSMs such as ( 1 ) and continuous convolutions . Correspondingly , ( 3 ) can actually be written as a discrete convolution . For simplicity let the initial state be x−1 = 0 . Then unrolling ( 3 ) explicitly yields x0 = Bu0 x1 = ABu0 + Bu1 x2 = A 2 Bu0 + ABu1 + Bu2 . . . y0 = CBu0 y1 = CABu0 + CBu1 y2 = CA 2 Bu0 + CABu1 + CBu2 . . . This can be vectorized into a convolution ( 4 ) with an explicit formula for the convolution kernel ( 5 ) . yk = CA k Bu0 + CA k−1 Bu1 + · · ·+ CABuk−1 + CBuk y = K ∗ u . ( 4 ) K ∈ RL : = KL ( A , B , C ) : = ( CA i B ) i∈ [ L ] = ( CB , CAB , . . . , CA L−1 B ) . ( 5 ) In other words , equation ( 4 ) is a single ( non-circular ) convolution and can be computed very efficiently with FFTs , provided that K is known . However , computing K in ( 5 ) is non-trivial and is the focus of our technical contributions in Section 3 . We call K the SSM convolution kernel or filter . | This paper presents a novel parameterization for the established state-space models (SSM), which tackles the scalability problem in linear state-space layers (LSSL) in modeling long-range dependencies for very long sequences. The proposed technique reparameterizes the structured state matrix in LSSL that allows the state to memorize the past, a key component following the continuous-time memorization theory. A complete theoretical description of this reparameterization and empirical evaluations on a diverse set of benchmarks are presented. The proposed model, S3, achieves astonishing results both in terms of performance and computational efficiency. | SP:1d9f7eccf05e8dfd1e33e23aacb36df247ca909f |
Efficiently Modeling Long Sequences with Structured State Spaces | 1 INTRODUCTION . A central problem in sequence modeling is efficiently handling data that contains long-range dependencies ( LRDs ) . Real-world time-series data often requires reasoning over tens of thousands of time steps , while few sequence models address even thousands of time steps . For instance , results from the long-range arena ( LRA ) benchmark ( Tay et al. , 2021 ) highlight that sequence models today perform poorly on LRD tasks , including one ( Path-X ) where no model performs better than random guessing . Since LRDs are perhaps the foremost challenge for sequence models , all standard model families such as continuous-time models ( CTMs ) , RNNs , CNNs , and Transformers include many specialized variants designed to address them . Modern examples include orthogonal and Lipschitz RNNs ( Arjovsky et al. , 2016 ; Erichson et al. , 2021 ) to combat vanishing gradients , dilated convolutions to increase context size ( Bai et al. , 2018 ; Oord et al. , 2016 ) , and an increasingly vast family of efficient Transformers that reduce the quadratic dependence on sequence length ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) . Despite being designed for LRDs , these solutions still perform poorly on challenging benchmarks such as LRA ( Tay et al. , 2021 ) or raw audio classification ( Gu et al. , 2021 ) . An alternative approach to LRDs was recently introduced based on the state space model ( SSM ) ( Fig . 1 ) . SSMs are a foundational scientific model used in fields such as control theory , computational neuroscience , and many more , but have not been applicable to deep learning for concrete theoretical reasons . In particular , Gu et al . ( 2021 ) showed that deep SSMs actually struggle even on simple tasks , but can perform exceptionally well when equipped with special state matrices A recently derived to solve a problem of continuous-time memorization ( Voelker et al. , 2019 ; Gu et al. , 2020a ) . Their Linear State Space Layer ( LSSL ) conceptually unifies the strengths of CTM , RNN and CNN models , and provides a proof of concept that deep SSMs can address LRDs in principle . Unfortunately , the LSSL is infeasible to use in practice because of prohibitive computation and memory requirements induced by the state representation . For state dimension N and sequence length L , computing the latent state requires O ( N2L ) operations and O ( NL ) space – compared to a Ω ( L + N ) lower bound for both . Thus for reasonably sized models ( e.g . N = 256 in Gu et al . ( 2021 ) ) , the LSSL uses orders of magnitude more memory than comparably-sized RNNs or CNNs . Although theoretically efficient algorithms for the LSSL were proposed , we show that these are numerically unstable . In particular , the special A matrix is highly non-normal in the linear algebraic sense , which prevents the application of conventional algorithmic techniques . Consequently , although the LSSL showed that SSMs have strong performance , they are currently computationally impractical as a general sequence modeling solution . In this work , we introduce the Structured State Space ( S4 ) sequence model based on the SSM that solves the critical computational bottleneck in previous work . Technically , S4 reparameterizes the structured state matrices A appearing in Voelker et al . ( 2019 ) ; Gu et al . ( 2020a ) by decomposing them as the sum of a low-rank and skew-symmetric term . Additionally , instead of expanding the standard SSM in coefficient space , we compute its truncated generating function in frequency space , which can be simplified into a multipole-like evaluation . Combining these two ideas , we show that the low-rank term can be corrected by the Woodbury identity while the skew-symmetric term can be diagonalized stably , ultimately reducing to a well-studied and theoretically stable Cauchy kernel ( Pan , 2001 ; 2017 ) . This results in Õ ( N + L ) computation and O ( N + L ) memory usage , which is essentially tight for sequence models . Compared to the LSSL , S4 is up to 30× faster with 400× less memory usage , while exceeding the LSSL ’ s performance empirically . Empirically , S4 significantly advances the state-of-the-art for LRD . On the LRA benchmark for efficient sequence models , S4 is as fast as all baselines while outperforming them by 20+ points on average . S4 is the first model to solve the difficult LRA Path-X task ( length-16384 ) , achieving 88 % accuracy compared to 50 % random guessing for all prior work . On speech classification with length-16000 sequences , S4 halves the test error ( 1.7 % ) of specialized Speech CNNs – by contrast , all RNN and Transformer baselines fail to learn ( ≥ 70 % error ) . Towards a general-purpose sequence model . Beyond LRD , a broad goal of machine learning is to develop a single model that can be used across a wide range of problems . Models today are typically specialized to solve problems from a particular domain ( e.g . images , audio , text , time-series ) , and enable a narrow range of capabilities ( e.g . efficient training , fast generation , handling irregularly sampled data ) . This specialization is typically expressed via domain-specific preprocessing , inductive biases , and architectures . Sequence models provide a general framework for solving many of these problems with reduced specialization – e.g . Vision Transformers for image classification with less 2D information ( Dosovitskiy et al. , 2020 ) . However , most models such as Transformers generally still require substantial specialization per task to achieve high performance . Deep SSMs in particular have conceptual strengths that suggest they may be promising as a general sequence modeling solution . These strengths include a principled approach to handling LRDs , as well as the ability to move between continuous-time , convolutional , and recurrent model representations , each with distinct capabilities ( Fig . 1 ) . Our technical contributions enable SSMs to be applied successfully to a varied set of benchmarks with minimal modification : • Large-scale generative modeling . On CIFAR-10 density estimation , S4 is competitive with the best autoregressive models ( 2.85 bits per dim ) . On WikiText-103 language modeling , S4 substantially closes the gap to Transformers ( within 0.8 perplexity ) , setting SoTA for attention-free models . • Fast autoregressive generation . Like RNNs , S4 can use its latent state to perform 60× faster pixel/token generation than standard autoregressive models on CIFAR-10 and WikiText-103 . • Irregularly sampled time-series . Like specialized CTMs , S4 can adapt to changes in time series sampling frequency without retraining , e.g . at 0.5× frequency on speech classification . • Learning with weaker inductive biases . With no architectural changes , S4 surpasses Speech CNNs on speech classification , outperforms the specialized Informer model on 40/50 time-series forecasting problems , and matches a 2-D ResNet on sequential CIFAR with over 90 % accuracy . 2 BACKGROUND : STATE SPACES . Sections 2.1 to 2.4 describe the four properties of SSMs in Fig . 1 : the classic continuous-time representation , addressing LRDs with the HiPPO framework , the discrete-time recurrent representation , and the parallelizable convolution representation . In particular , Section 2.4 introduces the SSM convolution kernel K , which is the focus of our theoretical contributions in Section 3 . 2.1 STATE SPACE MODELS : A CONTINUOUS-TIME LATENT STATE MODEL . The state space model is defined by the simple equation ( 1 ) . It maps a 1-D input signal u ( t ) to an N -D latent state x ( t ) before projecting to a 1-D output signal y ( t ) . x′ ( t ) = Ax ( t ) + Bu ( t ) y ( t ) = Cx ( t ) + Du ( t ) ( 1 ) SSMs are broadly used in many scientific disciplines and related to latent state models such as Hidden Markov Models ( HMM ) . Our goal is to simply use the SSM as a black-box representation in a deep sequence model , where A , B , C , D are parameters learned by gradient descent . For the remainder of this paper , we will omit the parameter D for exposition ( or equivalently , assume D = 0 ) because the term Du can be viewed as a skip connection and is easy to compute . 2.2 ADDRESSING LONG-RANGE DEPENDENCIES WITH HIPPO . Prior work found that the basic SSM ( 1 ) actually performs very poorly in practice . Intuitively , one explanation is that linear first-order ODEs solve to an exponential function , and thus may suffer from gradients scaling exponentially in the sequence length ( i.e. , the vanishing/exploding gradients problem ( Pascanu et al. , 2013 ) ) . To address this problem , the LSSL leveraged the HiPPO theory of continuous-time memorization ( Gu et al. , 2020a ) . HiPPO specifies a class of certain matrices A ∈ RN×N that when incorporated into ( 1 ) , allows the state x ( t ) to memorize the history of the input u ( t ) . The most important matrix in this class is defined by equation ( 2 ) , which we will call the HiPPO matrix . For example , the LSSL found that simply modifying an SSM from a random matrix A to equation ( 2 ) improved its performance on the sequential MNIST benchmark from 50 % to 98 % . ( HiPPO Matrix ) Ank = ( 2n+ 1 ) 1/2 ( 2k + 1 ) 1/2 if n > k n+ 1 if n = k 0 if n < k . ( 2 ) 2.3 DISCRETE-TIME SSM : THE RECURRENT REPRESENTATION . To be applied on a discrete input sequence ( u0 , u1 , . . . ) instead of continuous function u ( t ) , ( 1 ) must be discretized by a step size ∆ that represents the resolution of the input . Conceptually , the inputs uk can be viewed as sampling an implicit underlying continuous signal u ( t ) , where uk = u ( k∆ ) . To discretize the continuous-time SSM , we follow prior work in using the bilinear method ( Tustin , 1947 ) , which converts the state matrix A into an approximation A . The discrete SSM is xk = Axk−1 + Buk A = ( I −∆/2 ·A ) −1 ( I + ∆/2 ·A ) yk = Cxk B = ( I −∆/2 ·A ) −1∆B C = C. ( 3 ) Equation ( 3 ) is now a sequence-to-sequence map uk 7→ yk instead of function-to-function . Moreover the state equation is now a recurrence in xk , allowing the discrete SSM to be computed like an RNN . Concretely , xk ∈ RN can be viewed as a hidden state with transition matrix A. Notationally , throughout this paper we use A , B , . . . to denote discretized SSM matrices defined by ( 3 ) . Note that these matrices are a function of both A as well as a step size ∆ ; we suppress this dependence for notational convenience when it is clear . 2.4 TRAINING SSMS : THE CONVOLUTIONAL REPRESENTATION . The recurrent SSM ( 3 ) is not practical for training on modern hardware due to its sequentiality . Instead , there is a well-known connection between linear time-invariant ( LTI ) SSMs such as ( 1 ) and continuous convolutions . Correspondingly , ( 3 ) can actually be written as a discrete convolution . For simplicity let the initial state be x−1 = 0 . Then unrolling ( 3 ) explicitly yields x0 = Bu0 x1 = ABu0 + Bu1 x2 = A 2 Bu0 + ABu1 + Bu2 . . . y0 = CBu0 y1 = CABu0 + CBu1 y2 = CA 2 Bu0 + CABu1 + CBu2 . . . This can be vectorized into a convolution ( 4 ) with an explicit formula for the convolution kernel ( 5 ) . yk = CA k Bu0 + CA k−1 Bu1 + · · ·+ CABuk−1 + CBuk y = K ∗ u . ( 4 ) K ∈ RL : = KL ( A , B , C ) : = ( CA i B ) i∈ [ L ] = ( CB , CAB , . . . , CA L−1 B ) . ( 5 ) In other words , equation ( 4 ) is a single ( non-circular ) convolution and can be computed very efficiently with FFTs , provided that K is known . However , computing K in ( 5 ) is non-trivial and is the focus of our technical contributions in Section 3 . We call K the SSM convolution kernel or filter . | The paper extends previous work on linear state space models (SSM), where the state transition matrix is fixed to be a highly structured _HiPPO_ matrix, which has provably beneficial properties for memorizing long-term information from continuous-time signals. The main contribution of the paper is regarding the computational aspect of the model. Namely, a novel approach is proposed for computing the convolutional kernel associated to the discretized SSM unrolled over time. This is done by first showing that the state transition matrix can be decomposed as the sum of a normal (i.e. diagonalizable with orthonormal eigenvectors) and a low-rank (rank 1 or 2) matrix, and this representation is then combined with techniques from numerical linear algebra to reduce the problem to computing the Cauchy kernel (i.e. a well-studied problem). The resulting structured state space model (S3) is then placed into a deep neural network setting, and extensive experiments are carried out on various tasks, such as: 1) Long Range Arena, a benchmark collection for scalable transformers, 2) raw speech classification (length-16k audio signals), 3) generative modelling on CIFAR-10 and WikiText-103, 4) sequential image classification on sMNIST, pMNIST and sCIFAR. Overall, the model seems to perform very well on each task either performing close to SoTA or setting a new high score. | SP:1d9f7eccf05e8dfd1e33e23aacb36df247ca909f |
Efficiently Modeling Long Sequences with Structured State Spaces | 1 INTRODUCTION . A central problem in sequence modeling is efficiently handling data that contains long-range dependencies ( LRDs ) . Real-world time-series data often requires reasoning over tens of thousands of time steps , while few sequence models address even thousands of time steps . For instance , results from the long-range arena ( LRA ) benchmark ( Tay et al. , 2021 ) highlight that sequence models today perform poorly on LRD tasks , including one ( Path-X ) where no model performs better than random guessing . Since LRDs are perhaps the foremost challenge for sequence models , all standard model families such as continuous-time models ( CTMs ) , RNNs , CNNs , and Transformers include many specialized variants designed to address them . Modern examples include orthogonal and Lipschitz RNNs ( Arjovsky et al. , 2016 ; Erichson et al. , 2021 ) to combat vanishing gradients , dilated convolutions to increase context size ( Bai et al. , 2018 ; Oord et al. , 2016 ) , and an increasingly vast family of efficient Transformers that reduce the quadratic dependence on sequence length ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) . Despite being designed for LRDs , these solutions still perform poorly on challenging benchmarks such as LRA ( Tay et al. , 2021 ) or raw audio classification ( Gu et al. , 2021 ) . An alternative approach to LRDs was recently introduced based on the state space model ( SSM ) ( Fig . 1 ) . SSMs are a foundational scientific model used in fields such as control theory , computational neuroscience , and many more , but have not been applicable to deep learning for concrete theoretical reasons . In particular , Gu et al . ( 2021 ) showed that deep SSMs actually struggle even on simple tasks , but can perform exceptionally well when equipped with special state matrices A recently derived to solve a problem of continuous-time memorization ( Voelker et al. , 2019 ; Gu et al. , 2020a ) . Their Linear State Space Layer ( LSSL ) conceptually unifies the strengths of CTM , RNN and CNN models , and provides a proof of concept that deep SSMs can address LRDs in principle . Unfortunately , the LSSL is infeasible to use in practice because of prohibitive computation and memory requirements induced by the state representation . For state dimension N and sequence length L , computing the latent state requires O ( N2L ) operations and O ( NL ) space – compared to a Ω ( L + N ) lower bound for both . Thus for reasonably sized models ( e.g . N = 256 in Gu et al . ( 2021 ) ) , the LSSL uses orders of magnitude more memory than comparably-sized RNNs or CNNs . Although theoretically efficient algorithms for the LSSL were proposed , we show that these are numerically unstable . In particular , the special A matrix is highly non-normal in the linear algebraic sense , which prevents the application of conventional algorithmic techniques . Consequently , although the LSSL showed that SSMs have strong performance , they are currently computationally impractical as a general sequence modeling solution . In this work , we introduce the Structured State Space ( S4 ) sequence model based on the SSM that solves the critical computational bottleneck in previous work . Technically , S4 reparameterizes the structured state matrices A appearing in Voelker et al . ( 2019 ) ; Gu et al . ( 2020a ) by decomposing them as the sum of a low-rank and skew-symmetric term . Additionally , instead of expanding the standard SSM in coefficient space , we compute its truncated generating function in frequency space , which can be simplified into a multipole-like evaluation . Combining these two ideas , we show that the low-rank term can be corrected by the Woodbury identity while the skew-symmetric term can be diagonalized stably , ultimately reducing to a well-studied and theoretically stable Cauchy kernel ( Pan , 2001 ; 2017 ) . This results in Õ ( N + L ) computation and O ( N + L ) memory usage , which is essentially tight for sequence models . Compared to the LSSL , S4 is up to 30× faster with 400× less memory usage , while exceeding the LSSL ’ s performance empirically . Empirically , S4 significantly advances the state-of-the-art for LRD . On the LRA benchmark for efficient sequence models , S4 is as fast as all baselines while outperforming them by 20+ points on average . S4 is the first model to solve the difficult LRA Path-X task ( length-16384 ) , achieving 88 % accuracy compared to 50 % random guessing for all prior work . On speech classification with length-16000 sequences , S4 halves the test error ( 1.7 % ) of specialized Speech CNNs – by contrast , all RNN and Transformer baselines fail to learn ( ≥ 70 % error ) . Towards a general-purpose sequence model . Beyond LRD , a broad goal of machine learning is to develop a single model that can be used across a wide range of problems . Models today are typically specialized to solve problems from a particular domain ( e.g . images , audio , text , time-series ) , and enable a narrow range of capabilities ( e.g . efficient training , fast generation , handling irregularly sampled data ) . This specialization is typically expressed via domain-specific preprocessing , inductive biases , and architectures . Sequence models provide a general framework for solving many of these problems with reduced specialization – e.g . Vision Transformers for image classification with less 2D information ( Dosovitskiy et al. , 2020 ) . However , most models such as Transformers generally still require substantial specialization per task to achieve high performance . Deep SSMs in particular have conceptual strengths that suggest they may be promising as a general sequence modeling solution . These strengths include a principled approach to handling LRDs , as well as the ability to move between continuous-time , convolutional , and recurrent model representations , each with distinct capabilities ( Fig . 1 ) . Our technical contributions enable SSMs to be applied successfully to a varied set of benchmarks with minimal modification : • Large-scale generative modeling . On CIFAR-10 density estimation , S4 is competitive with the best autoregressive models ( 2.85 bits per dim ) . On WikiText-103 language modeling , S4 substantially closes the gap to Transformers ( within 0.8 perplexity ) , setting SoTA for attention-free models . • Fast autoregressive generation . Like RNNs , S4 can use its latent state to perform 60× faster pixel/token generation than standard autoregressive models on CIFAR-10 and WikiText-103 . • Irregularly sampled time-series . Like specialized CTMs , S4 can adapt to changes in time series sampling frequency without retraining , e.g . at 0.5× frequency on speech classification . • Learning with weaker inductive biases . With no architectural changes , S4 surpasses Speech CNNs on speech classification , outperforms the specialized Informer model on 40/50 time-series forecasting problems , and matches a 2-D ResNet on sequential CIFAR with over 90 % accuracy . 2 BACKGROUND : STATE SPACES . Sections 2.1 to 2.4 describe the four properties of SSMs in Fig . 1 : the classic continuous-time representation , addressing LRDs with the HiPPO framework , the discrete-time recurrent representation , and the parallelizable convolution representation . In particular , Section 2.4 introduces the SSM convolution kernel K , which is the focus of our theoretical contributions in Section 3 . 2.1 STATE SPACE MODELS : A CONTINUOUS-TIME LATENT STATE MODEL . The state space model is defined by the simple equation ( 1 ) . It maps a 1-D input signal u ( t ) to an N -D latent state x ( t ) before projecting to a 1-D output signal y ( t ) . x′ ( t ) = Ax ( t ) + Bu ( t ) y ( t ) = Cx ( t ) + Du ( t ) ( 1 ) SSMs are broadly used in many scientific disciplines and related to latent state models such as Hidden Markov Models ( HMM ) . Our goal is to simply use the SSM as a black-box representation in a deep sequence model , where A , B , C , D are parameters learned by gradient descent . For the remainder of this paper , we will omit the parameter D for exposition ( or equivalently , assume D = 0 ) because the term Du can be viewed as a skip connection and is easy to compute . 2.2 ADDRESSING LONG-RANGE DEPENDENCIES WITH HIPPO . Prior work found that the basic SSM ( 1 ) actually performs very poorly in practice . Intuitively , one explanation is that linear first-order ODEs solve to an exponential function , and thus may suffer from gradients scaling exponentially in the sequence length ( i.e. , the vanishing/exploding gradients problem ( Pascanu et al. , 2013 ) ) . To address this problem , the LSSL leveraged the HiPPO theory of continuous-time memorization ( Gu et al. , 2020a ) . HiPPO specifies a class of certain matrices A ∈ RN×N that when incorporated into ( 1 ) , allows the state x ( t ) to memorize the history of the input u ( t ) . The most important matrix in this class is defined by equation ( 2 ) , which we will call the HiPPO matrix . For example , the LSSL found that simply modifying an SSM from a random matrix A to equation ( 2 ) improved its performance on the sequential MNIST benchmark from 50 % to 98 % . ( HiPPO Matrix ) Ank = ( 2n+ 1 ) 1/2 ( 2k + 1 ) 1/2 if n > k n+ 1 if n = k 0 if n < k . ( 2 ) 2.3 DISCRETE-TIME SSM : THE RECURRENT REPRESENTATION . To be applied on a discrete input sequence ( u0 , u1 , . . . ) instead of continuous function u ( t ) , ( 1 ) must be discretized by a step size ∆ that represents the resolution of the input . Conceptually , the inputs uk can be viewed as sampling an implicit underlying continuous signal u ( t ) , where uk = u ( k∆ ) . To discretize the continuous-time SSM , we follow prior work in using the bilinear method ( Tustin , 1947 ) , which converts the state matrix A into an approximation A . The discrete SSM is xk = Axk−1 + Buk A = ( I −∆/2 ·A ) −1 ( I + ∆/2 ·A ) yk = Cxk B = ( I −∆/2 ·A ) −1∆B C = C. ( 3 ) Equation ( 3 ) is now a sequence-to-sequence map uk 7→ yk instead of function-to-function . Moreover the state equation is now a recurrence in xk , allowing the discrete SSM to be computed like an RNN . Concretely , xk ∈ RN can be viewed as a hidden state with transition matrix A. Notationally , throughout this paper we use A , B , . . . to denote discretized SSM matrices defined by ( 3 ) . Note that these matrices are a function of both A as well as a step size ∆ ; we suppress this dependence for notational convenience when it is clear . 2.4 TRAINING SSMS : THE CONVOLUTIONAL REPRESENTATION . The recurrent SSM ( 3 ) is not practical for training on modern hardware due to its sequentiality . Instead , there is a well-known connection between linear time-invariant ( LTI ) SSMs such as ( 1 ) and continuous convolutions . Correspondingly , ( 3 ) can actually be written as a discrete convolution . For simplicity let the initial state be x−1 = 0 . Then unrolling ( 3 ) explicitly yields x0 = Bu0 x1 = ABu0 + Bu1 x2 = A 2 Bu0 + ABu1 + Bu2 . . . y0 = CBu0 y1 = CABu0 + CBu1 y2 = CA 2 Bu0 + CABu1 + CBu2 . . . This can be vectorized into a convolution ( 4 ) with an explicit formula for the convolution kernel ( 5 ) . yk = CA k Bu0 + CA k−1 Bu1 + · · ·+ CABuk−1 + CBuk y = K ∗ u . ( 4 ) K ∈ RL : = KL ( A , B , C ) : = ( CA i B ) i∈ [ L ] = ( CB , CAB , . . . , CA L−1 B ) . ( 5 ) In other words , equation ( 4 ) is a single ( non-circular ) convolution and can be computed very efficiently with FFTs , provided that K is known . However , computing K in ( 5 ) is non-trivial and is the focus of our technical contributions in Section 3 . We call K the SSM convolution kernel or filter . | The authors propose a sequence modeling approach called the structured state space model (S3) which parameterized the SSM in a more computationally efficient manner. This is done through decomposing the structured state matrices A into a low-rank and skew-symmetric term and expanding the SSM in frequency space and using a multipole-like evaluation. This approach maintains much of the gains and efficiencies of past SSM approaches while being more computationally stable and efficient as demonstrated on several tasks across broad domains (speech, images, text). The paper first steps through the theoretical motivations and justifications of this approach and then performs a number of experiments to demonstrate the competitive or superior performance on a wide range of LRD tasks. | SP:1d9f7eccf05e8dfd1e33e23aacb36df247ca909f |
Structured Energy Network as a dynamic loss function. Case study. A case study with multi-label Classification | 1 INTRODUCTION . Structured prediction is a popular machine learning task wherein the model learns a mapping function from an input x to a multivariate-structured output y . Popular examples of this include image segmentation ( Müller , 2014 ) , extracting parse trees or semantic role labels from a text ( Palmer et al. , 2010 ) , and multi-label classification ( Belanger & McCallum , 2016 ; Gygli et al. , 2017 ) . In structured prediction , the output space Y is often extremely large . For example , in multi-label classification , the size of Y is 2L where model needs to predict output y ∈ { 0 , 1 } L. There are two key aspects that a model for structured prediction needs to balance : statistical efficiency and computational efficiency . Most models for structured prediction can be categorized into two categories : the feed-forward approach , wherein one learns a neural network that models the direct mapping between the input and the structured output , and the structured approach , in which the model explicitly models the interactions ( structure ) in the output space . The feed-forward approach learns all dimensions of y jointly in a conditionally independent manner given input x , relying on the representational power of the network to capture dependencies in output structure implicitly . While the feed-forward approach is computationally efficient , since it does not capture relationships in the label space , it lacks statistical efficiency . The traditional structured approaches , on the other hand , model a joint probability distribution P ( x , y ) that can capture the label relationships . However , due to the intractability of modeling the full joint distribution which captures every possible interaction of output space , these approaches resort to limiting the interaction terms to local subsets of the output space ( Lafferty et al. , 2001 ; Ghamrawi & McCallum , 2005 ) . In order to make inference for structured models more efficient , a recent line of work replaces the joint probability with a structured energy function E ( x , y ) ( LeCun et al. , 2006 ) , which can be thought of as an unnormalized probability distribution , allowing the model to learn arbitrary global dependencies in the output space . There have been several works that propose efficient approximate inference procedures for structured energy networks using gradient based inference ( Belanger et al. , 2017 ; Gygli et al. , 2017 ; Rooshenas et al. , 2019 ) , hence also called ’ prediction networks ’ . These models showed noticeable gains in predictive performance over feed-forward models and graphical models that assume partial structure such as full pairwise potential ( Chen et al. , 2015 ; Schwing & Urtasun , 2015 ) . Despite these efforts , the inference for energy-based models still remains relatively inefficient when compared to the feed-forward approach ( Tu & Gimpel , 2019 ) . Moreover , in our experience , the models using gradient based inference ( GBI ) are finicky to train as the training also utilizes GBI , requiring numerous hyperparameters : step size , number of iterations for GBI , and initial point to begin GBI . This raises a question : Can the energy network be used in a way that is as expressive as a full joint probability , as efficient at inference as a feed-forward approach , and also stable and easy to train ? We believe that using structured energy networks as a parameterized dynamic loss function for feed-forward networks , instead of a prediction network , can fulfill all these requirements . In this paper , we propose the Structured Energy As Loss ( SEAL ) framework that uses a trainable structured energy network ( SEN ) 1 as a loss function guiding the training of a feed-forward network . The key idea is to provide the feed-forward network access to rich relationships in the output space through a learned loss function . We also propose to learn SEN in a dynamic fashion by adjusting the energy function to be confident with the most up-to-date outputs of the feed-forward network . We show that learning the loss function dynamically leads to more efficient , more stable , and better performance . SEAL can be viewed as general-purpose framework where one can plugin various loss functions and architectures to train SEN as well as the feed-forward network . Through experiments ( §4 ) , we analyze the effect of applying different energy losses ( e.g . margin-based , regression-based ) within SEAL framework . We also propose the noise-contrastive ranking loss ( NCEranking ) for SEN which performs the best within the SEAL framework . To summarize , we introduce a general framework SEAL that interprets structured energy networks ( SEN ) as a dynamic loss functions . Through empirical evaluation on the task of multi-label classification , we analyse the impact of various loss functions for updating SEN . Finally , we propose an NCE ranking loss that is uniquely suited for the SEAL framework , and demonstrate its superior performance on 7 feature-based as well as 3 text-based multi-label classification datasets , when compared to simple feed-forward approach and various energy based models . Algorithm 1 : SEAL Algorithm Require : ( x , y ) : Training Instance Require : FΦ : Feedforward Network Require : sampling : True/False flag Require : optimizerΘ , optimizerΦ Require : T : No . of steps t← 0 Θ0 , Φ0 ← Random initialization while t < T do if sampling then S ← { y ( i ) , i = 1 , . . . , K|y ( i ) ∼ FΦt ( x ) } else S ← { FΦt ( x ) } . singleton set t← t + 1 Update Θ as Eqn . 3 using ỹ ∈ S and optimizerΘ Update Φ as Eqn . 4 using optimizerΦ 1The term comes from structured prediction energy network , minus ’ prediction ’ , as we do not use it for prediction anymore . For brevity , we use terms ’ energy network ’ and ’ strcutured energy newtork ’ interchangeably . 2 STRUCTURED ENERGY NETWORK AS LOSS ( SEAL ) This section first describes the proposed SEAL framework . LetX denote the input space , Y = { 0 , 1 } L the output space , and Ỹ = [ 0 , 1 ] L the continuous relaxation of Y . Then the structured energy EΘ : X ×Ỹ → R is defined to be a parameterized function of the input and the continuous relaxation of the output . The feedforward network FΦ : X → Ỹ is defined to be a neural network that maps an input to the continuous relaxation of the output space . We denote j-th training instance pair as ( x ( j ) , y ( j ) ) ∈ D and yi ∈ { 0 , 1 } , ỹi ∈ [ 0 , 1 ] to denote i-th label dimension where i ∈ { 1 , . . . , L } . As shown in Figure 1 , SEAL consists two loss functions : the energy loss LE that trains structured energy network ( Θ ) , and feedforward loss LF that guides the training of the feedforward network ( Φ ) . We first discuss how structured energy network implicitly affects training of the feedforward network by defining LF ( Φ ) . Given a training instance ( x , y ) , the feedforward loss is defined as : LF ( Φ ) = λ1EΘ ( x , FΦ ( x ) ) − λ2 L∑ j=1 [ yi logFΦ ( x ) i + ( 1− yi ) log ( 1− FΦ ( x ) i ) ] . ( 1 ) Here , the first term involving the energy captures interaction across label space whereas binary cross-entropy considers the predictions of each label independently ( More details in Appendix B ) . Since the training of feedforward network depends on the quality of the parameterized energy network , it is critical to find the parameters Θ that produce the best loss surface for training the feedforward network . This can be done in two ways : by first training the energy separately , or by training the energy and the feedforward network simultaneously . SEAL uses the latter , which is shown to perform better ( see §5 ) than the former . We denote the former method as SEAL-static for distinction . In SEAL-static , we first estimate the energy network parameter Θ̂ over training data and optimize Φ by plugging fixed Θ̂ into LF . Given ( x , y ) ∈ D , Φ is trained as equation 2. min Φ 1 |D| ∑ D LF ( Φ ) s.t . Θ̂ = arg min Θ 1 |D| ∑ D LE ( x , y , ỹ ; Θ ) ( 2 ) We finally present SEALwhich learns Θ̂t dynamically at step t. To do so , we alternate the optimization steps of Θ and Φ . Given a training instance ( x , y ) ∈ Bt , a complete training step is given as : Θt ← Θt−1 −∇Θ 1 |Bt| ∑ Bt LE ( x , y , FΦt−1 ( x ) ; Θ ) ( 3 ) Φt ← Φt−1 −∇Φ 1 |Bt| ∑ Bt LF ( Φ ) ( 4 ) Note that , from ( 2 ) to ( 3 ) , arbitrary ỹ got replaced with FΦt−1 ( x ) in estimating Θt so that estimation of energy surface depends on model output FΦt−1 ( x ) . Further , the update step for feedforward network Φ relies on Θt rather than static Θ̂ . In both SEAL and SEAL-static , test-time predictions are performed solely using the feedfoward network as ŷi = 1 ( FΦ ( x ) i ≥ 0.5 ) . The motivation for proposing dynamic loss function in SEAL is as following . It would be useful to learn perfect energy surface , if possible , by estimating Θ̂ that is static . However , doing so is challenging as we are estimating energy surface on the joint space of x , ỹ , a high-dimensional continuous space with limited data and resource . Instead , we hypothesize that it is more important to concentrate resource in depicting accurate energy surface around the current input , output pair ( x , FΦ ( x ) ) . In SEAL , utilizing the fact that we have access to trainable loss function , we dynamically adapt energy surface so that the region of interest for training feedforward network is well represented . We now discuss various energy loss ( margin-based , regression-based , and contrastive-sampling-based ) that can be plugged into LE in SEAL . For brevity , we use LE ( Θ ) and LE ( x , y , ỹ ; Θ ) interchangeably where again ( x , y ) denotes labeled data and ỹ denotes probability vector . We defer the description of specific energy network structure to the experiment section ( §4 ) as SEAL framework can work with arbitrary network structures . Margin-based ( LE−margin ) SPEN ( Belanger & McCallum , 2016 ) learned structured energy network with SSVM loss ( Taskar et al. , 2004 ; Tsochantaridis et al. , 2004 ) so that energy functions learn to have sufficient energy difference , larger than the margin ∆ ( ỹ , y ) , between arbitrary output ỹ and true output y . To examine the effect of the margin-based loss in SEAL , we follow SPEN and utilize the SSVM loss as LE−margin = ∑ x , y max ỹ [ ∆ ( ỹ , y ) − EΘ ( x , ỹ ) + EΘ ( x , y ) ] + ( 5 ) Regression-based ( LE−regression ) Deep Value Network ( DVN ) ( Gygli et al. , 2017 ) attempts to learn an energy network which directly outputs a score that is similar to the metric s ( ỹ , y ) of interest , such as F1 score , that compares arbitrary ỹ with true output y . Following DVN , by making score s ( · ) 2 and −E ( · ) to be between [ 0 , 1 ] , we express regression loss as cross entropy LE−regression = −s ( ỹ , y ) log−EΘ ( x , ỹ ) − ( 1− s ( ỹ , y ) ) log ( 1 + EΘ ( x , ỹ ) ) . ( 6 ) Noise-contrastive ranking ( LE−NCEranking and LE−ranking ) In SEAL , we are interested in capturing the output region that feedforward network has a high probability . We ask , rather than just taking a single point ỹ = FΦ ( x ) from a feedforward network , whether sampling many discrete binary vectors from ỹ and taking all those samples into consideration for learning EΘ could lead in better estimation of energy surface . Motivated from noise contrastive estimation ( NCE ) ( Ma & Collins , 2018 ) , we ask whether energy network EΘ trained to contrast the true output y from groups of K negative samples drawn from feedforward output FΦ ( x ) can induce a good loss for teaching Φ . The intuition is as the ỹ = FΦ ( x ) becomes better and better , the loss surface teaching feedforward network should become more fine grained as ỹ and samples from ỹ will be already close to the true y . Before we discuss LE−NCEranking of our choice , we first review original form of NCE ranking loss from Ma & Collins ( 2018 ) . For K samples y ( k ) ∼ PN , k = 1 , . . . , K drawn from noise distribution PN and rewriting y as y ( 0 ) without loss of generality , NCE ranking loss is defined as log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , where s ( x , y ; Θ ) = −EΘ ( x , y ) − logPN ( y ) . ( 7 ) Minimization of this loss makes P ( y|x ; Θ ) = exp ( −EΘ ( x , y ) ) ∑ y∈Y exp ( −EΘ ( x , y ) ) as an unbiased estimator of true distribution P ( Y |X ) . Thus , given perfect energy E ( · ) , minimizing −EΘ ( x , y ) with respect to y in LF would be equivalent to maximizing the estimate of − logP ( y|x ) . From the presented NCE ranking method , we propose to use P ( y|x ; Φt ) = ∏ i P ( yi|x ; Φt ) in place of PN ( y ) . The novelty of this proposal is that we view the output of feedforward network that we train as a noise distribution , and that the energy model that contrasts noise distribution teaches the noise distribution as well through our SEAL framework ( equation 3 ) . In short , we get LE−NCEranking when we plug in s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) into equation 7 , i.e . LE−NCEranking = log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) . ( 8 ) This achieves two benefits that we have in mind in using NCE . First benefit is that it captures the region of interest by sampling from the output distribution of Φt . Second benefit is that it brings more efficient NCE method . NCE method is known to work best when the noise distribution is close to the data distribution ( Gutmann & Hirayama , 2012 ) but not exactly the same . In our SEAL learning procedure , we hypothesize that P ( y|x ; Φt ) becomes closer to the data distribution as training steps proceed . Lastly , motivated that NCE can estimate the true distribution , we propose yet another loss function that can estimate the difference between the true probability P ( y|x ) and feedforward network probability . We show in appendix A , if we use plain ranking loss that sets s ( x , y ; Θ ) = −EΘ ( x , y ) in equation 7 , unbiased estimator of P ( y|x ) now becomes PN ( y ) exp ( −EΘ ( x , y ) ) ∑ y∈Y PN ( y ) exp ( −EΘ ( x , y ) ) ( 9 ) . This 2In this paper , we adopt soft F1 score s ( ỹ , y ) from Gygli et al . ( 2017 ) that is defined on the continuous ỹ ∈ [ 0 , 1 ] L. means if we take a derivative of EΘwith respect to y , then we are taking derivative with respect to − logP ( y|x ) + logPN ( y ) . With the trick of replacing the PN ( y ) with P ( y|x ; Φt ) in SEAL , we hypothesize that loss captured by energy network can focus only on the difference between true and feedforward probability which may end up being more informative surface . In short , we get plain ranking loss LE−ranking by plugging s ( x , y ; Θ ) = −EΘ ( x , y ) into equation 7 , resulting in LE−ranking = log exp ( −E ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( −E ( x , y ( k ) ; Θ ) ) . ( 10 ) | This paper proposes a framework named SEAL that can adopt structed energy network as both a trainable and adaptable loss function for training feedforward networks. 7 feature-based 3 text-based datasets are used for testing SEAL and showed better results and even better with combinations. Rich ablation study was given as well. | SP:3c5db5a905bec0fa2e198d2e911db95698bc90d0 |
Structured Energy Network as a dynamic loss function. Case study. A case study with multi-label Classification | 1 INTRODUCTION . Structured prediction is a popular machine learning task wherein the model learns a mapping function from an input x to a multivariate-structured output y . Popular examples of this include image segmentation ( Müller , 2014 ) , extracting parse trees or semantic role labels from a text ( Palmer et al. , 2010 ) , and multi-label classification ( Belanger & McCallum , 2016 ; Gygli et al. , 2017 ) . In structured prediction , the output space Y is often extremely large . For example , in multi-label classification , the size of Y is 2L where model needs to predict output y ∈ { 0 , 1 } L. There are two key aspects that a model for structured prediction needs to balance : statistical efficiency and computational efficiency . Most models for structured prediction can be categorized into two categories : the feed-forward approach , wherein one learns a neural network that models the direct mapping between the input and the structured output , and the structured approach , in which the model explicitly models the interactions ( structure ) in the output space . The feed-forward approach learns all dimensions of y jointly in a conditionally independent manner given input x , relying on the representational power of the network to capture dependencies in output structure implicitly . While the feed-forward approach is computationally efficient , since it does not capture relationships in the label space , it lacks statistical efficiency . The traditional structured approaches , on the other hand , model a joint probability distribution P ( x , y ) that can capture the label relationships . However , due to the intractability of modeling the full joint distribution which captures every possible interaction of output space , these approaches resort to limiting the interaction terms to local subsets of the output space ( Lafferty et al. , 2001 ; Ghamrawi & McCallum , 2005 ) . In order to make inference for structured models more efficient , a recent line of work replaces the joint probability with a structured energy function E ( x , y ) ( LeCun et al. , 2006 ) , which can be thought of as an unnormalized probability distribution , allowing the model to learn arbitrary global dependencies in the output space . There have been several works that propose efficient approximate inference procedures for structured energy networks using gradient based inference ( Belanger et al. , 2017 ; Gygli et al. , 2017 ; Rooshenas et al. , 2019 ) , hence also called ’ prediction networks ’ . These models showed noticeable gains in predictive performance over feed-forward models and graphical models that assume partial structure such as full pairwise potential ( Chen et al. , 2015 ; Schwing & Urtasun , 2015 ) . Despite these efforts , the inference for energy-based models still remains relatively inefficient when compared to the feed-forward approach ( Tu & Gimpel , 2019 ) . Moreover , in our experience , the models using gradient based inference ( GBI ) are finicky to train as the training also utilizes GBI , requiring numerous hyperparameters : step size , number of iterations for GBI , and initial point to begin GBI . This raises a question : Can the energy network be used in a way that is as expressive as a full joint probability , as efficient at inference as a feed-forward approach , and also stable and easy to train ? We believe that using structured energy networks as a parameterized dynamic loss function for feed-forward networks , instead of a prediction network , can fulfill all these requirements . In this paper , we propose the Structured Energy As Loss ( SEAL ) framework that uses a trainable structured energy network ( SEN ) 1 as a loss function guiding the training of a feed-forward network . The key idea is to provide the feed-forward network access to rich relationships in the output space through a learned loss function . We also propose to learn SEN in a dynamic fashion by adjusting the energy function to be confident with the most up-to-date outputs of the feed-forward network . We show that learning the loss function dynamically leads to more efficient , more stable , and better performance . SEAL can be viewed as general-purpose framework where one can plugin various loss functions and architectures to train SEN as well as the feed-forward network . Through experiments ( §4 ) , we analyze the effect of applying different energy losses ( e.g . margin-based , regression-based ) within SEAL framework . We also propose the noise-contrastive ranking loss ( NCEranking ) for SEN which performs the best within the SEAL framework . To summarize , we introduce a general framework SEAL that interprets structured energy networks ( SEN ) as a dynamic loss functions . Through empirical evaluation on the task of multi-label classification , we analyse the impact of various loss functions for updating SEN . Finally , we propose an NCE ranking loss that is uniquely suited for the SEAL framework , and demonstrate its superior performance on 7 feature-based as well as 3 text-based multi-label classification datasets , when compared to simple feed-forward approach and various energy based models . Algorithm 1 : SEAL Algorithm Require : ( x , y ) : Training Instance Require : FΦ : Feedforward Network Require : sampling : True/False flag Require : optimizerΘ , optimizerΦ Require : T : No . of steps t← 0 Θ0 , Φ0 ← Random initialization while t < T do if sampling then S ← { y ( i ) , i = 1 , . . . , K|y ( i ) ∼ FΦt ( x ) } else S ← { FΦt ( x ) } . singleton set t← t + 1 Update Θ as Eqn . 3 using ỹ ∈ S and optimizerΘ Update Φ as Eqn . 4 using optimizerΦ 1The term comes from structured prediction energy network , minus ’ prediction ’ , as we do not use it for prediction anymore . For brevity , we use terms ’ energy network ’ and ’ strcutured energy newtork ’ interchangeably . 2 STRUCTURED ENERGY NETWORK AS LOSS ( SEAL ) This section first describes the proposed SEAL framework . LetX denote the input space , Y = { 0 , 1 } L the output space , and Ỹ = [ 0 , 1 ] L the continuous relaxation of Y . Then the structured energy EΘ : X ×Ỹ → R is defined to be a parameterized function of the input and the continuous relaxation of the output . The feedforward network FΦ : X → Ỹ is defined to be a neural network that maps an input to the continuous relaxation of the output space . We denote j-th training instance pair as ( x ( j ) , y ( j ) ) ∈ D and yi ∈ { 0 , 1 } , ỹi ∈ [ 0 , 1 ] to denote i-th label dimension where i ∈ { 1 , . . . , L } . As shown in Figure 1 , SEAL consists two loss functions : the energy loss LE that trains structured energy network ( Θ ) , and feedforward loss LF that guides the training of the feedforward network ( Φ ) . We first discuss how structured energy network implicitly affects training of the feedforward network by defining LF ( Φ ) . Given a training instance ( x , y ) , the feedforward loss is defined as : LF ( Φ ) = λ1EΘ ( x , FΦ ( x ) ) − λ2 L∑ j=1 [ yi logFΦ ( x ) i + ( 1− yi ) log ( 1− FΦ ( x ) i ) ] . ( 1 ) Here , the first term involving the energy captures interaction across label space whereas binary cross-entropy considers the predictions of each label independently ( More details in Appendix B ) . Since the training of feedforward network depends on the quality of the parameterized energy network , it is critical to find the parameters Θ that produce the best loss surface for training the feedforward network . This can be done in two ways : by first training the energy separately , or by training the energy and the feedforward network simultaneously . SEAL uses the latter , which is shown to perform better ( see §5 ) than the former . We denote the former method as SEAL-static for distinction . In SEAL-static , we first estimate the energy network parameter Θ̂ over training data and optimize Φ by plugging fixed Θ̂ into LF . Given ( x , y ) ∈ D , Φ is trained as equation 2. min Φ 1 |D| ∑ D LF ( Φ ) s.t . Θ̂ = arg min Θ 1 |D| ∑ D LE ( x , y , ỹ ; Θ ) ( 2 ) We finally present SEALwhich learns Θ̂t dynamically at step t. To do so , we alternate the optimization steps of Θ and Φ . Given a training instance ( x , y ) ∈ Bt , a complete training step is given as : Θt ← Θt−1 −∇Θ 1 |Bt| ∑ Bt LE ( x , y , FΦt−1 ( x ) ; Θ ) ( 3 ) Φt ← Φt−1 −∇Φ 1 |Bt| ∑ Bt LF ( Φ ) ( 4 ) Note that , from ( 2 ) to ( 3 ) , arbitrary ỹ got replaced with FΦt−1 ( x ) in estimating Θt so that estimation of energy surface depends on model output FΦt−1 ( x ) . Further , the update step for feedforward network Φ relies on Θt rather than static Θ̂ . In both SEAL and SEAL-static , test-time predictions are performed solely using the feedfoward network as ŷi = 1 ( FΦ ( x ) i ≥ 0.5 ) . The motivation for proposing dynamic loss function in SEAL is as following . It would be useful to learn perfect energy surface , if possible , by estimating Θ̂ that is static . However , doing so is challenging as we are estimating energy surface on the joint space of x , ỹ , a high-dimensional continuous space with limited data and resource . Instead , we hypothesize that it is more important to concentrate resource in depicting accurate energy surface around the current input , output pair ( x , FΦ ( x ) ) . In SEAL , utilizing the fact that we have access to trainable loss function , we dynamically adapt energy surface so that the region of interest for training feedforward network is well represented . We now discuss various energy loss ( margin-based , regression-based , and contrastive-sampling-based ) that can be plugged into LE in SEAL . For brevity , we use LE ( Θ ) and LE ( x , y , ỹ ; Θ ) interchangeably where again ( x , y ) denotes labeled data and ỹ denotes probability vector . We defer the description of specific energy network structure to the experiment section ( §4 ) as SEAL framework can work with arbitrary network structures . Margin-based ( LE−margin ) SPEN ( Belanger & McCallum , 2016 ) learned structured energy network with SSVM loss ( Taskar et al. , 2004 ; Tsochantaridis et al. , 2004 ) so that energy functions learn to have sufficient energy difference , larger than the margin ∆ ( ỹ , y ) , between arbitrary output ỹ and true output y . To examine the effect of the margin-based loss in SEAL , we follow SPEN and utilize the SSVM loss as LE−margin = ∑ x , y max ỹ [ ∆ ( ỹ , y ) − EΘ ( x , ỹ ) + EΘ ( x , y ) ] + ( 5 ) Regression-based ( LE−regression ) Deep Value Network ( DVN ) ( Gygli et al. , 2017 ) attempts to learn an energy network which directly outputs a score that is similar to the metric s ( ỹ , y ) of interest , such as F1 score , that compares arbitrary ỹ with true output y . Following DVN , by making score s ( · ) 2 and −E ( · ) to be between [ 0 , 1 ] , we express regression loss as cross entropy LE−regression = −s ( ỹ , y ) log−EΘ ( x , ỹ ) − ( 1− s ( ỹ , y ) ) log ( 1 + EΘ ( x , ỹ ) ) . ( 6 ) Noise-contrastive ranking ( LE−NCEranking and LE−ranking ) In SEAL , we are interested in capturing the output region that feedforward network has a high probability . We ask , rather than just taking a single point ỹ = FΦ ( x ) from a feedforward network , whether sampling many discrete binary vectors from ỹ and taking all those samples into consideration for learning EΘ could lead in better estimation of energy surface . Motivated from noise contrastive estimation ( NCE ) ( Ma & Collins , 2018 ) , we ask whether energy network EΘ trained to contrast the true output y from groups of K negative samples drawn from feedforward output FΦ ( x ) can induce a good loss for teaching Φ . The intuition is as the ỹ = FΦ ( x ) becomes better and better , the loss surface teaching feedforward network should become more fine grained as ỹ and samples from ỹ will be already close to the true y . Before we discuss LE−NCEranking of our choice , we first review original form of NCE ranking loss from Ma & Collins ( 2018 ) . For K samples y ( k ) ∼ PN , k = 1 , . . . , K drawn from noise distribution PN and rewriting y as y ( 0 ) without loss of generality , NCE ranking loss is defined as log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , where s ( x , y ; Θ ) = −EΘ ( x , y ) − logPN ( y ) . ( 7 ) Minimization of this loss makes P ( y|x ; Θ ) = exp ( −EΘ ( x , y ) ) ∑ y∈Y exp ( −EΘ ( x , y ) ) as an unbiased estimator of true distribution P ( Y |X ) . Thus , given perfect energy E ( · ) , minimizing −EΘ ( x , y ) with respect to y in LF would be equivalent to maximizing the estimate of − logP ( y|x ) . From the presented NCE ranking method , we propose to use P ( y|x ; Φt ) = ∏ i P ( yi|x ; Φt ) in place of PN ( y ) . The novelty of this proposal is that we view the output of feedforward network that we train as a noise distribution , and that the energy model that contrasts noise distribution teaches the noise distribution as well through our SEAL framework ( equation 3 ) . In short , we get LE−NCEranking when we plug in s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) into equation 7 , i.e . LE−NCEranking = log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) . ( 8 ) This achieves two benefits that we have in mind in using NCE . First benefit is that it captures the region of interest by sampling from the output distribution of Φt . Second benefit is that it brings more efficient NCE method . NCE method is known to work best when the noise distribution is close to the data distribution ( Gutmann & Hirayama , 2012 ) but not exactly the same . In our SEAL learning procedure , we hypothesize that P ( y|x ; Φt ) becomes closer to the data distribution as training steps proceed . Lastly , motivated that NCE can estimate the true distribution , we propose yet another loss function that can estimate the difference between the true probability P ( y|x ) and feedforward network probability . We show in appendix A , if we use plain ranking loss that sets s ( x , y ; Θ ) = −EΘ ( x , y ) in equation 7 , unbiased estimator of P ( y|x ) now becomes PN ( y ) exp ( −EΘ ( x , y ) ) ∑ y∈Y PN ( y ) exp ( −EΘ ( x , y ) ) ( 9 ) . This 2In this paper , we adopt soft F1 score s ( ỹ , y ) from Gygli et al . ( 2017 ) that is defined on the continuous ỹ ∈ [ 0 , 1 ] L. means if we take a derivative of EΘwith respect to y , then we are taking derivative with respect to − logP ( y|x ) + logPN ( y ) . With the trick of replacing the PN ( y ) with P ( y|x ; Φt ) in SEAL , we hypothesize that loss captured by energy network can focus only on the difference between true and feedforward probability which may end up being more informative surface . In short , we get plain ranking loss LE−ranking by plugging s ( x , y ; Θ ) = −EΘ ( x , y ) into equation 7 , resulting in LE−ranking = log exp ( −E ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( −E ( x , y ( k ) ; Θ ) ) . ( 10 ) | This paper proposes a framework to use Structured Prediction Energy Network (SPEN, a prior work) as a loss function. Previously SPEN is a deep architecture to learn an energy function of candidate labels, which captures structural dependencies between labels that would lead to intractable graphical models. The author of this paper finds out that it is effective to jointly learn the parameters in SPEN and the parameters in the feed-forward network (MLP). In the training time, the model alternatingly minimizes the parameters in SPEN by fixing the parameters in MLP; and then minimizes the parameters in MLP by fixing the parameters in SPEN. Empirical results in 10 multi-label datasets are given, which shows good performance boost from using the proposed methods. | SP:3c5db5a905bec0fa2e198d2e911db95698bc90d0 |
Structured Energy Network as a dynamic loss function. Case study. A case study with multi-label Classification | 1 INTRODUCTION . Structured prediction is a popular machine learning task wherein the model learns a mapping function from an input x to a multivariate-structured output y . Popular examples of this include image segmentation ( Müller , 2014 ) , extracting parse trees or semantic role labels from a text ( Palmer et al. , 2010 ) , and multi-label classification ( Belanger & McCallum , 2016 ; Gygli et al. , 2017 ) . In structured prediction , the output space Y is often extremely large . For example , in multi-label classification , the size of Y is 2L where model needs to predict output y ∈ { 0 , 1 } L. There are two key aspects that a model for structured prediction needs to balance : statistical efficiency and computational efficiency . Most models for structured prediction can be categorized into two categories : the feed-forward approach , wherein one learns a neural network that models the direct mapping between the input and the structured output , and the structured approach , in which the model explicitly models the interactions ( structure ) in the output space . The feed-forward approach learns all dimensions of y jointly in a conditionally independent manner given input x , relying on the representational power of the network to capture dependencies in output structure implicitly . While the feed-forward approach is computationally efficient , since it does not capture relationships in the label space , it lacks statistical efficiency . The traditional structured approaches , on the other hand , model a joint probability distribution P ( x , y ) that can capture the label relationships . However , due to the intractability of modeling the full joint distribution which captures every possible interaction of output space , these approaches resort to limiting the interaction terms to local subsets of the output space ( Lafferty et al. , 2001 ; Ghamrawi & McCallum , 2005 ) . In order to make inference for structured models more efficient , a recent line of work replaces the joint probability with a structured energy function E ( x , y ) ( LeCun et al. , 2006 ) , which can be thought of as an unnormalized probability distribution , allowing the model to learn arbitrary global dependencies in the output space . There have been several works that propose efficient approximate inference procedures for structured energy networks using gradient based inference ( Belanger et al. , 2017 ; Gygli et al. , 2017 ; Rooshenas et al. , 2019 ) , hence also called ’ prediction networks ’ . These models showed noticeable gains in predictive performance over feed-forward models and graphical models that assume partial structure such as full pairwise potential ( Chen et al. , 2015 ; Schwing & Urtasun , 2015 ) . Despite these efforts , the inference for energy-based models still remains relatively inefficient when compared to the feed-forward approach ( Tu & Gimpel , 2019 ) . Moreover , in our experience , the models using gradient based inference ( GBI ) are finicky to train as the training also utilizes GBI , requiring numerous hyperparameters : step size , number of iterations for GBI , and initial point to begin GBI . This raises a question : Can the energy network be used in a way that is as expressive as a full joint probability , as efficient at inference as a feed-forward approach , and also stable and easy to train ? We believe that using structured energy networks as a parameterized dynamic loss function for feed-forward networks , instead of a prediction network , can fulfill all these requirements . In this paper , we propose the Structured Energy As Loss ( SEAL ) framework that uses a trainable structured energy network ( SEN ) 1 as a loss function guiding the training of a feed-forward network . The key idea is to provide the feed-forward network access to rich relationships in the output space through a learned loss function . We also propose to learn SEN in a dynamic fashion by adjusting the energy function to be confident with the most up-to-date outputs of the feed-forward network . We show that learning the loss function dynamically leads to more efficient , more stable , and better performance . SEAL can be viewed as general-purpose framework where one can plugin various loss functions and architectures to train SEN as well as the feed-forward network . Through experiments ( §4 ) , we analyze the effect of applying different energy losses ( e.g . margin-based , regression-based ) within SEAL framework . We also propose the noise-contrastive ranking loss ( NCEranking ) for SEN which performs the best within the SEAL framework . To summarize , we introduce a general framework SEAL that interprets structured energy networks ( SEN ) as a dynamic loss functions . Through empirical evaluation on the task of multi-label classification , we analyse the impact of various loss functions for updating SEN . Finally , we propose an NCE ranking loss that is uniquely suited for the SEAL framework , and demonstrate its superior performance on 7 feature-based as well as 3 text-based multi-label classification datasets , when compared to simple feed-forward approach and various energy based models . Algorithm 1 : SEAL Algorithm Require : ( x , y ) : Training Instance Require : FΦ : Feedforward Network Require : sampling : True/False flag Require : optimizerΘ , optimizerΦ Require : T : No . of steps t← 0 Θ0 , Φ0 ← Random initialization while t < T do if sampling then S ← { y ( i ) , i = 1 , . . . , K|y ( i ) ∼ FΦt ( x ) } else S ← { FΦt ( x ) } . singleton set t← t + 1 Update Θ as Eqn . 3 using ỹ ∈ S and optimizerΘ Update Φ as Eqn . 4 using optimizerΦ 1The term comes from structured prediction energy network , minus ’ prediction ’ , as we do not use it for prediction anymore . For brevity , we use terms ’ energy network ’ and ’ strcutured energy newtork ’ interchangeably . 2 STRUCTURED ENERGY NETWORK AS LOSS ( SEAL ) This section first describes the proposed SEAL framework . LetX denote the input space , Y = { 0 , 1 } L the output space , and Ỹ = [ 0 , 1 ] L the continuous relaxation of Y . Then the structured energy EΘ : X ×Ỹ → R is defined to be a parameterized function of the input and the continuous relaxation of the output . The feedforward network FΦ : X → Ỹ is defined to be a neural network that maps an input to the continuous relaxation of the output space . We denote j-th training instance pair as ( x ( j ) , y ( j ) ) ∈ D and yi ∈ { 0 , 1 } , ỹi ∈ [ 0 , 1 ] to denote i-th label dimension where i ∈ { 1 , . . . , L } . As shown in Figure 1 , SEAL consists two loss functions : the energy loss LE that trains structured energy network ( Θ ) , and feedforward loss LF that guides the training of the feedforward network ( Φ ) . We first discuss how structured energy network implicitly affects training of the feedforward network by defining LF ( Φ ) . Given a training instance ( x , y ) , the feedforward loss is defined as : LF ( Φ ) = λ1EΘ ( x , FΦ ( x ) ) − λ2 L∑ j=1 [ yi logFΦ ( x ) i + ( 1− yi ) log ( 1− FΦ ( x ) i ) ] . ( 1 ) Here , the first term involving the energy captures interaction across label space whereas binary cross-entropy considers the predictions of each label independently ( More details in Appendix B ) . Since the training of feedforward network depends on the quality of the parameterized energy network , it is critical to find the parameters Θ that produce the best loss surface for training the feedforward network . This can be done in two ways : by first training the energy separately , or by training the energy and the feedforward network simultaneously . SEAL uses the latter , which is shown to perform better ( see §5 ) than the former . We denote the former method as SEAL-static for distinction . In SEAL-static , we first estimate the energy network parameter Θ̂ over training data and optimize Φ by plugging fixed Θ̂ into LF . Given ( x , y ) ∈ D , Φ is trained as equation 2. min Φ 1 |D| ∑ D LF ( Φ ) s.t . Θ̂ = arg min Θ 1 |D| ∑ D LE ( x , y , ỹ ; Θ ) ( 2 ) We finally present SEALwhich learns Θ̂t dynamically at step t. To do so , we alternate the optimization steps of Θ and Φ . Given a training instance ( x , y ) ∈ Bt , a complete training step is given as : Θt ← Θt−1 −∇Θ 1 |Bt| ∑ Bt LE ( x , y , FΦt−1 ( x ) ; Θ ) ( 3 ) Φt ← Φt−1 −∇Φ 1 |Bt| ∑ Bt LF ( Φ ) ( 4 ) Note that , from ( 2 ) to ( 3 ) , arbitrary ỹ got replaced with FΦt−1 ( x ) in estimating Θt so that estimation of energy surface depends on model output FΦt−1 ( x ) . Further , the update step for feedforward network Φ relies on Θt rather than static Θ̂ . In both SEAL and SEAL-static , test-time predictions are performed solely using the feedfoward network as ŷi = 1 ( FΦ ( x ) i ≥ 0.5 ) . The motivation for proposing dynamic loss function in SEAL is as following . It would be useful to learn perfect energy surface , if possible , by estimating Θ̂ that is static . However , doing so is challenging as we are estimating energy surface on the joint space of x , ỹ , a high-dimensional continuous space with limited data and resource . Instead , we hypothesize that it is more important to concentrate resource in depicting accurate energy surface around the current input , output pair ( x , FΦ ( x ) ) . In SEAL , utilizing the fact that we have access to trainable loss function , we dynamically adapt energy surface so that the region of interest for training feedforward network is well represented . We now discuss various energy loss ( margin-based , regression-based , and contrastive-sampling-based ) that can be plugged into LE in SEAL . For brevity , we use LE ( Θ ) and LE ( x , y , ỹ ; Θ ) interchangeably where again ( x , y ) denotes labeled data and ỹ denotes probability vector . We defer the description of specific energy network structure to the experiment section ( §4 ) as SEAL framework can work with arbitrary network structures . Margin-based ( LE−margin ) SPEN ( Belanger & McCallum , 2016 ) learned structured energy network with SSVM loss ( Taskar et al. , 2004 ; Tsochantaridis et al. , 2004 ) so that energy functions learn to have sufficient energy difference , larger than the margin ∆ ( ỹ , y ) , between arbitrary output ỹ and true output y . To examine the effect of the margin-based loss in SEAL , we follow SPEN and utilize the SSVM loss as LE−margin = ∑ x , y max ỹ [ ∆ ( ỹ , y ) − EΘ ( x , ỹ ) + EΘ ( x , y ) ] + ( 5 ) Regression-based ( LE−regression ) Deep Value Network ( DVN ) ( Gygli et al. , 2017 ) attempts to learn an energy network which directly outputs a score that is similar to the metric s ( ỹ , y ) of interest , such as F1 score , that compares arbitrary ỹ with true output y . Following DVN , by making score s ( · ) 2 and −E ( · ) to be between [ 0 , 1 ] , we express regression loss as cross entropy LE−regression = −s ( ỹ , y ) log−EΘ ( x , ỹ ) − ( 1− s ( ỹ , y ) ) log ( 1 + EΘ ( x , ỹ ) ) . ( 6 ) Noise-contrastive ranking ( LE−NCEranking and LE−ranking ) In SEAL , we are interested in capturing the output region that feedforward network has a high probability . We ask , rather than just taking a single point ỹ = FΦ ( x ) from a feedforward network , whether sampling many discrete binary vectors from ỹ and taking all those samples into consideration for learning EΘ could lead in better estimation of energy surface . Motivated from noise contrastive estimation ( NCE ) ( Ma & Collins , 2018 ) , we ask whether energy network EΘ trained to contrast the true output y from groups of K negative samples drawn from feedforward output FΦ ( x ) can induce a good loss for teaching Φ . The intuition is as the ỹ = FΦ ( x ) becomes better and better , the loss surface teaching feedforward network should become more fine grained as ỹ and samples from ỹ will be already close to the true y . Before we discuss LE−NCEranking of our choice , we first review original form of NCE ranking loss from Ma & Collins ( 2018 ) . For K samples y ( k ) ∼ PN , k = 1 , . . . , K drawn from noise distribution PN and rewriting y as y ( 0 ) without loss of generality , NCE ranking loss is defined as log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , where s ( x , y ; Θ ) = −EΘ ( x , y ) − logPN ( y ) . ( 7 ) Minimization of this loss makes P ( y|x ; Θ ) = exp ( −EΘ ( x , y ) ) ∑ y∈Y exp ( −EΘ ( x , y ) ) as an unbiased estimator of true distribution P ( Y |X ) . Thus , given perfect energy E ( · ) , minimizing −EΘ ( x , y ) with respect to y in LF would be equivalent to maximizing the estimate of − logP ( y|x ) . From the presented NCE ranking method , we propose to use P ( y|x ; Φt ) = ∏ i P ( yi|x ; Φt ) in place of PN ( y ) . The novelty of this proposal is that we view the output of feedforward network that we train as a noise distribution , and that the energy model that contrasts noise distribution teaches the noise distribution as well through our SEAL framework ( equation 3 ) . In short , we get LE−NCEranking when we plug in s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) into equation 7 , i.e . LE−NCEranking = log exp ( s ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( s ( x , y ( k ) ; Θ ) ) , s ( x , y ; Θ ) = −EΘ ( x , y ) − logPΦ ( y|x ; Φt ) . ( 8 ) This achieves two benefits that we have in mind in using NCE . First benefit is that it captures the region of interest by sampling from the output distribution of Φt . Second benefit is that it brings more efficient NCE method . NCE method is known to work best when the noise distribution is close to the data distribution ( Gutmann & Hirayama , 2012 ) but not exactly the same . In our SEAL learning procedure , we hypothesize that P ( y|x ; Φt ) becomes closer to the data distribution as training steps proceed . Lastly , motivated that NCE can estimate the true distribution , we propose yet another loss function that can estimate the difference between the true probability P ( y|x ) and feedforward network probability . We show in appendix A , if we use plain ranking loss that sets s ( x , y ; Θ ) = −EΘ ( x , y ) in equation 7 , unbiased estimator of P ( y|x ) now becomes PN ( y ) exp ( −EΘ ( x , y ) ) ∑ y∈Y PN ( y ) exp ( −EΘ ( x , y ) ) ( 9 ) . This 2In this paper , we adopt soft F1 score s ( ỹ , y ) from Gygli et al . ( 2017 ) that is defined on the continuous ỹ ∈ [ 0 , 1 ] L. means if we take a derivative of EΘwith respect to y , then we are taking derivative with respect to − logP ( y|x ) + logPN ( y ) . With the trick of replacing the PN ( y ) with P ( y|x ; Φt ) in SEAL , we hypothesize that loss captured by energy network can focus only on the difference between true and feedforward probability which may end up being more informative surface . In short , we get plain ranking loss LE−ranking by plugging s ( x , y ; Θ ) = −EΘ ( x , y ) into equation 7 , resulting in LE−ranking = log exp ( −E ( x , y ( 0 ) ; Θ ) ) ∑K k=1 exp ( −E ( x , y ( k ) ; Θ ) ) . ( 10 ) | The paper presents Structured Energy As Loss (SEAL) that uses structured energy networks as a trainable loss for a feedforward network. SEAL is a general framework that supports multiple loss functions, including margin-based loss, regression-based loss, and NCE-based loss, and generalizes the recent approach in [Tu et al., 2020]. The paper presents extensive experiments on multi-label classification on a range of feature-based and text-based datasets. SEAL shows significant improvement over standard cross entropy trained networks, as well as approaches based on Structured Prediction Energy Networks (SPEN). | SP:3c5db5a905bec0fa2e198d2e911db95698bc90d0 |
Bayesian Relational Generative Model for Scalable Multi-modal Learning | 1 INTRODUCTION . Many prominent methods for multi-modal learning ( Argelaguet et al. , 2018 ; Andrew et al. , 2013 ; Klami et al. , 2013 ; Zhao et al. , 2016 ) are based on the canonical correlation analysis ( CCA ) , which extracts shared components across multiple views . The main idea is that , given two vectors of random variables , the method finds the linear projections in a shared latent space , in which the projected vectors are maximally correlated ( Thompson , 1984 ) . This can help to understand the overall dependency structure between these two vectors . However , the classical CCA can not handle non-linearity ( Andrew et al. , 2013 ) and suffers from a lack of probabilistic interpretation when applied to high dimensional data ( Klami et al. , 2013 ) . To address these issues , probabilistic CCA ( PCCA ) has been proposed and extended to non-linear settings using kernel methods and neural networks ( Bach & Jordan , 2005 ) . More recently , Wu & Goodman ( 2018 ) introduced the multimodal variational autoencoder ( mVAE ) that models the joint posterior as a product-of-experts ( PoE ) over the marginal posteriors , enabling cross-modal generation at test time without requiring additional inference networks and multi-stage training regimes . However , training a PoE is difficult and the following techniques are needed in order to ensure that the individual views are learnt faithfully ; i ) using artificial sub-sampling of the observed views ( Wu & Goodman , 2018 ) , ii ) : applying variants of contrastive divergence ( Hinton , 2002 ) , and iii ) : utilizing information bottleneck on the marginal representations of each view ( Lee & Schaar , 2021 ) . Furthermore , each expert holds the power of veto and low density of only one marginal posteriors among a given set of observations leads to the low density of joint distribution ( Shi et al. , 2019 ) . In the case of Gaussian experts , different levels of complexity of modalities or sub-optimal initialisation might result in the miscalibrated precisions that potentially lead to a biased overall mean prediction ( Shi et al. , 2019 ) . Despite the success of the existing multi-modal generative methods , they suffer from inducing stochasticity in their inferred functions . This leads to ; i ) poor adaptation to new observations1 , ii ) inefficient generalizability in few-shot settings and , iii ) inaccurate uncertainty estimation , all of which are important in many safety critical applications such as healthcare . On the other hand , stochastic processes , such as Gaussian processes ( GPs ) , are exchangeable models that posit distributions over possible functions , and are updated in light of data through the probabilistic inference . Despite these advantages , GPs are computationally expensive and their underlying model is not flexible for high-dimensional inputs , making them infeasible for multi-modal learning settings with multiple heterogeneous and high-dimensional data types . Apart from the aforementioned issues , existing generative models for multi-modal learning focus on latent representation , but do not fully incorporate the label information . In order to facilitate predictions on the target labels , they need to apply two-step procedures , in which the shared latent spaces are used for downstream classification . While information relevant to the reconstruction of views will be well-captured in the shared representations , discriminative information relevant to the target task may be discarded , leading to poor prediction performance of such models ( Lee & Schaar , 2021 ) . Furthermore , the shared representations of these methods in high-dimensional space are often difficult to interpret and need an extra downstream analyses such as PCA or t-SNE ( Van Der Maaten , 2014 ) that may cause biased results ( Lötsch & Ultsch , 2020 ) . In this paper , instead of following the existing multi-modal generative methods that rely on deterministic predictive functions , we propose the first multi-modal stochastic processes family that learns distributions over functions for inputs with any missing patterns . Like GPs , it naturally provides robust uncertainty estimates and can encode inductive biases . Unlike GPs , though , mRNP is computationally efficient during training and evaluation since it can take advantage of mini-batch optimization , and learns to adapt their priors to data . The inferred dependency graph in our model construction can be used to visualise the high dimensional latent representation , obviating the need for ad-hoc post-processing steps as required in most of the multi-modal learning methods . The presented work makes four major contributions : 1 ) We develop a novel multi-modal Relational Neural Process , mRNP , that defines a distribution over functions of multiple data types by employing local latent variables , and learns a dependency structure among the samples of the given modalities . 2 ) We theoretically prove exchangeability and consistency of mRNP , two necessary conditions that have to be satisfied during the construction of such a model , showing that mRNP is a valid stochastic process . 3 ) We further show that the local latent variable structure in mRNP is able to encode inductive biases and demonstrate this by designing an mRNP model that behaves similarly to a GP with an RBF kernel ( an ablation study ) . 4 ) We introduce mixture-of-graphs ( MoG ) in our model construction that can address the issues such as computational complexity and miscalibrated precisions observed in the previous approaches in multi-modal learning . 2 METHOD . We propose a new graph-structured multi-modal learning method , referred as multi-modal Relational Neural Process ( mRNP ) , that combines the benefits of neural networks with that of stochastic processes . In the supervised multi-modal setting , our dataset contains sets of feature-label pairs , { x̄ , y } from |V| different modalities with various missing patterns , where |V| is number of views , x̄ = { xv|vth modality present } v∈V ∈ X̄ is the input modalities and y ∈ Y is the given label . One of the key motivation of mRNP is that it gives us the ability to define a distribution over functions rather than learning a single static function when fitting the data . In this framework , inspired by the idea of inducing points in sparse Gaussian processes ( Titsias , 2009 ; Damianou & Lawrence , 2013 ) , we first select a reference set of samples that consists of functions f : x̄→ y that are sampled from some underlying distributionH . We then establish a probability distribution over fh around those samples . We define the reference set , XR = { XR,1 , . . . , XR , V } ⊂ X̄ , where XR , v ∈ RNv×Dv , and 1Rapid adaption to new observations is what distinguishes a model that can learn a whole distribution over functions by seeing different functions in each batch from the one that learns a single underlying function by observing several batches during the training . At the test time , the former will narrow down what the current function is by seeing a few context observations . Nv and Dv are the number of samples and dimension of features in the domain v , respectively . We also define O = X̄ \XR , which is the set of all possible samples that are not in XR . Please note that two sets XR and O includes both labeled and unlabeled samples . We also denote our labeled samples as Dx = { x̄1 , . . . , x̄N } , a set of any finite random set from X̄ , as well as defining sets XM = Dx\XR and XB = XR ∪ XM . The Venn diagram of the sets are provided in Figure 1 . We infer the parameters of our probabilistic model using variational inference . In the following , we first introduce each of the latent variables in our model as well as their corresponding prior and posterior distributions , and then prove that it corresponds to an infinitely exchangeable stochastic process . The graphical model of mRNP is illustrated in Figure 1 . Modality-specific latent spaces . The first step is to construct modality-specific latent representations , denoted by U = { Uv } v∈V , a set of Nv ×Du matrices , which independently embed samples of each modality ( i.e . Nv ) into a Du dimensional latent space as follows : ∫ pθ ( UB , XB ) dX = ∏ v∈V ∫ pθ ( UB , v , XB , v ) dXB , v = ∏ v∈V ∫ pθ ( UB , v |XB , v ) p ( XB , v ) dXB , v . We further parameterize the distribution over the samples ui , v independently : pθ ( UB , v |XB , v ) = ∏ i∈Bv pθ ( ui , v |xi , v ) , ( 1 ) where pθ ( ui , v |xi , v ) can be any distribution that is derived from the observed input data . For simplicity , we use a diagonal Gaussian , the parameters of which are a function of the observed input . More specifically , we use two functions denoted by ϕemb , µv ( XB , v ) and ϕ emb , σ v ( XB , v ) to infer the mean and variance of the distribution for each modality . Depending on the nature of the modality , these functions can be implemented using any highly expressive functions such as many variants of neural networks ( NNs ) and graph NNs . A directed graph among the reference samples . The next step is to construct a directed graph across the samples inXR using different modalities . Given the latent embedding UR , we first construct a set of directed acyclic graphs ( DAGs ) , G = { Gv } v∈V , where Gv is a random binary adjacency matrix between reference samples present in the vth modality . Then we combine the graphs Gv from multiple views to construct a common graph G. Inspired by the concept of stochastic orderings ( Shaked & Shanthikumar , 2007 ) , we impose a topological ordering over the vectors in UR to avoid cycles in each individual Gv . The distribution of the adjacency matrices are defined as follows : p ( Gv |UR , v ) = ∏ i∈Rv ∏ j∈Rv , j 6=i Bernoulli ( Gij , v | I [ t ( ui , v ) > t ( uj , v ) ] ϕsim ( ui , v , uj , v ) ) . ( 2 ) Similar to Louizos et al . ( 2019 ) , we employ a parameter free scalar projection t ( ui , v ) = ∑ k tk ( uik , v ) , where tk ( · ) is a monotonic function . In practice , we use the log cumulative distribution function of a standard normal distribution . Given the graphs Gv , we construct a directed graph G , in which the weight of each edge is average of its weights in different modalities , i.e . G = ∑ v∈V βvGv/ ∑ v∈Vmvm T v , where mv is a binary vector and mi , v = 1 when sample i is observed in the modality v , and βv = 1/|V | , assuming that the all modalities are equally important . The proposed formulation , referred as mixture-of-graphs ( MoG ) , is used to learn the shared structured representation of multi-modal inputs by using the graphs of individual modalities . A relational graph of dependencies from reference samples to XM . In addition to the directed graph G used for the reference samples , we apply MoG to construct a bipartite graph A = ∑ v∈V αvAv that is a bi-adjacency matrix from XR to XM . Given the latent embedding UB as described previously , we model the elements of each individual bi-adjacency matrix by Bernoulli distribution as follows : p ( Av |UM , v , UR , v ) = ∏ i∈Mv ∏ j∈Rv Bernoulli ( Aij |ϕsim ( ui , v , uj , v ) ) , ( 3 ) where ϕsim ( · , · ) is a score function measuring the similarity between the latent representations of the input samples in each modality v , and αv = 1/|V | , assuming the all modalities equally important . Depending on the desired relational inductive biases , we can appropriately define the function ϕsim ( · , · ) . The Bernoulli-Poisson link ϕsim ( ui , v , uj , v ) = 1− exp ( − ∑Du k=1 τk uik , v ujk , v ) and ϕsim ( ui , v , uj , v ) = exp ( − τ2 ||ui , v − uj , v|| 2 ) are two examples of such potential score functions . Please note that we use the latter one throughout this paper . For both A = { Av } v∈V and G , we use the concrete relaxation ( Maddison et al. , 2016 ; Gal et al. , 2017 ) during training while we sample from Bernoulli distributions in the testing phase . A shared latent variable . Having obtained the sample representations U and the dependency graphs A and G , we construct a shared latent variable , denoted by N ×Dz matrix Z , which can be used to predict target variable distributions yi . We parameterize the distributions of the predictive targets as follows : ∫ pθ ( yB , ZB |A , G , XR ) dZB = ∫ ∫ pθ ( yR , ZR |G , XR ) pθ ( yM , ZM |A , XR , yR ) dZR dZM = ∏ i∈R ∫ pθ ( zi |parGi ( XR , yR ) ) pθ ( yi | zi ) dzi ∏ j∈M ∫ pθ ( zj |parAj ( XR , yR ) ) pθ ( yj | zj ) dzj , where parGi ( · ) , parAj ( · ) are functions that return the parents of the points i and j according to G and A , respectively . We summarize the information from the parent samples and their targets in XR through the local latent variable zi , allowing the distribution yi to be explicitly dependent on the available graph dependency structures A and G. We set the distribution over zi as an independent Gaussian distribution whose parameters are a function of either A or G although any distribution with a permutation invariant probability density with respect to the parents can be used . More formally , the following distribution is adopted : pθ ( zi |parAi ( XR , yR ) ) = Dz∏ k=1 pθ ( zik |parAi ( XR , yR ) ) = Dz∏ k=1 N ( µpriorik , σ prior ik ) , ( 4 ) µpriorik = ci ∑ j∈XR Aijϕ prior , µ k ( xj , R , yj , R ) , σ prior ik = exp ( ci ∑ j∈XR Aijϕ prior , σ k ( xj , R , yj , R ) ) , where xj , R = { xj , R , v } v∈V , ϕprior , µ and ϕprior , σ are transform functions with a co-domain R|z| , and ci = ( ∑ j Aij + ) −1 is a normalization constant . Given input { XB , v } v∈V , we factorize the variational posterior distribution as qφ ( Z | XB ) = ∏ i∈B qφ ( zi |xi , B ) , ( 5 ) In practice , we also parameterize the priors over the latent zi in terms of the posterior distribution of the reference samples , i.e . qφ ( zi |xi , R ) . More precisely , we define ϕprior , µ and ϕprior , σ in equation ( 4 ) as ϕpost , µ ( xi , R ) +ϕ emb , µ label ( yi , R ) and ϕ post , σ ( xi , R ) +ϕ emb , σ label ( yi , R ) , respectively ; where ϕpost and ϕemblabel provide the means and variances of qφ ( zi |xi , R ) and the linear embedding of the labels of reference samples , respectively . We should point out that in this formulation , the prediction of yi indirectly depends on the input samples xi through the graphs G and A , which are functions of ui . This leads to an uninformative standard normal prior over zi for the samples with very small probability of being connected to the reference set through A , and hence the prediction of yi will be constant . This can be seen as encoding inductive bias similar to a GP with an RBF kernel . MoG vs PoE . PoE is a prime choice to learn the variational joint posteriors ; it can learn under any combination of missing modalities ( Shi et al. , 2019 ) . Despite this advantage , it also has two main limitations : 1 ) the underlying model suffers from the overconfident experts since experts with greater precision will have more influence over the combined prediction than experts with lower precision ; 2 ) training and inference can be costly due to its artificial sub-sampling procedure . Given the aforementioned limitations of PoE , we propose to build a graph of dependencies among local latent variables as a mixture of modality-specific graphs , i.e . mixture-of-graph ( MoG ) , and then parameterize the joint latent space Z conditioned on those graph . Unlike PoE , MoG effectively spreads its density over all the individual modalities by imposing a weight to each individual graphs . When prior knowledge is available , terms αv and βv in the MoG construction can be used to encourage certain modalities , which is the case in multi-omics data integration where individual modalities often contain complementary information of target task . A more detailed discussion can be found in Section D of the supplement . We also should point out that mRNP is not a graph learning model . Rather , we propose a novel multi-view NPs that is able to solve a pitfall in utilizing stochastic processes for multi-view setting by learning a graph of dependencies . We can also consider graph learning in mRNP as a kind of cross-attention in the form of a dependency graph among local latent variables . From this viewpoint , mRNP is learning attention mechanism to combine modalities . The current framework in which mRNP learns the individual graphs might not be computationally efficient , especially if training set is large . We may improve the scalability issue of graph construction part of our mRNP by e.g . considering hierarchical structure similar to hFGW ( Xu et al. , 2020 ) . We leave this for a future study . Overall likelihood and learning . Putting everything together , the marginal likelihood is pθ ( yB | XB ) = ∑ G , A ∫ ∏ v∈V pθ ( UB , v |XB , v ) p ( G , A | UB ) pθ ( yB , ZB |A , G , XR ) dUB dZB . ( 6 ) We should point out that , for the sake of simplicity , we choose the reference set to be part of the training set Dx throughout this paper . More specifically , we assume XB = Dx . In case of existing reference samples that are not part of the training set , we need to marginalize out over them in equation ( 6 ) in addition to the marginalizations over the latent variables and structured graphs . We can also use the marginalization technique to incorporate unlabelled data in order to learn a better representation and/or to impute the missing labels . We leave this for a future study . We deploy variational inference to optimize the model parameters θ and variational parameters φ by minimizing the following derived Evidence Lower Bound ( ELBO ) : L = Eqφ ( ZR | XR ) p ( G | UR ) ∏v∈V pθ ( UR , v |XR , v ) [ log pθ ( yR , ZR |G , XR ) − log qφ ( ZR | XR ) ] + Eqφ ( ZM | XM ) p ( A | UB ) ∏ v∈V pθ ( UB , v |XB , v ) [ log pθ ( yM |ZM ) + log pθ ( ZM |parA ( XR , yR ) ) − log qφ ( ZM | XM ) ] . Please note that we can use mini-batches for the second expectation term where the size of the batches scale according to the size of the reference set XR . Due to the DAG structure in the first expectation term , we can not decompose it to independent sums . Predictive distribution . After optimizing the model parameters , we derive the predictive distribution for unseen samples { x∗v } v∈V with missing modalities based on Bayes theorem as follows : pθ ( y ∗ | { x∗v } v∈V , XB , yB ) = ∑ a∗ ∫ ∏ v∈V pθ ( u ∗ v , UR , v |x∗v , XR , v ) p ( a∗ | { u∗v } v∈V , UR ) pθ ( z∗ |para∗ ( XR , yR ) ) pθ ( y∗ | z∗ ) dUR du∗v∈V dz∗ , where u∗v is the embedding representation of the observed modality x ∗ v through the neural network ϕembv and a ∗ is a binary vector similar to a row of A that denotes reference parents of the new samples . This is similar to the predictive distribution in few-shot learning ( Sung et al. , 2018 ) . Proposition I. mRNP corresponds to Bayesian models as the distributions defined in Equation ( 6 ) are valid , permutation invariant stochastic processes . proof . The proof is deferred to the supplement . | This paper proposed to use neural processes for supervised multi-modal learning, which have the abilities to estimate the uncertainty of prediction and to handle missing modalities. Specifically, a directed acyclic graph is learned for each modality in the neural process, which are then used to construct a mixture-of-graphs (MoG) to sidestep the modalities missing problem. The introduction of inducing points makes the predictive distribution tractable. Experimentally, on the label prediction and uncertainty estimation tasks, the proposed model performs well compared to the recent multimodal learning methods. | SP:0993bb3320aea46c49ec5afe897567a5ecd220ae |
Bayesian Relational Generative Model for Scalable Multi-modal Learning | 1 INTRODUCTION . Many prominent methods for multi-modal learning ( Argelaguet et al. , 2018 ; Andrew et al. , 2013 ; Klami et al. , 2013 ; Zhao et al. , 2016 ) are based on the canonical correlation analysis ( CCA ) , which extracts shared components across multiple views . The main idea is that , given two vectors of random variables , the method finds the linear projections in a shared latent space , in which the projected vectors are maximally correlated ( Thompson , 1984 ) . This can help to understand the overall dependency structure between these two vectors . However , the classical CCA can not handle non-linearity ( Andrew et al. , 2013 ) and suffers from a lack of probabilistic interpretation when applied to high dimensional data ( Klami et al. , 2013 ) . To address these issues , probabilistic CCA ( PCCA ) has been proposed and extended to non-linear settings using kernel methods and neural networks ( Bach & Jordan , 2005 ) . More recently , Wu & Goodman ( 2018 ) introduced the multimodal variational autoencoder ( mVAE ) that models the joint posterior as a product-of-experts ( PoE ) over the marginal posteriors , enabling cross-modal generation at test time without requiring additional inference networks and multi-stage training regimes . However , training a PoE is difficult and the following techniques are needed in order to ensure that the individual views are learnt faithfully ; i ) using artificial sub-sampling of the observed views ( Wu & Goodman , 2018 ) , ii ) : applying variants of contrastive divergence ( Hinton , 2002 ) , and iii ) : utilizing information bottleneck on the marginal representations of each view ( Lee & Schaar , 2021 ) . Furthermore , each expert holds the power of veto and low density of only one marginal posteriors among a given set of observations leads to the low density of joint distribution ( Shi et al. , 2019 ) . In the case of Gaussian experts , different levels of complexity of modalities or sub-optimal initialisation might result in the miscalibrated precisions that potentially lead to a biased overall mean prediction ( Shi et al. , 2019 ) . Despite the success of the existing multi-modal generative methods , they suffer from inducing stochasticity in their inferred functions . This leads to ; i ) poor adaptation to new observations1 , ii ) inefficient generalizability in few-shot settings and , iii ) inaccurate uncertainty estimation , all of which are important in many safety critical applications such as healthcare . On the other hand , stochastic processes , such as Gaussian processes ( GPs ) , are exchangeable models that posit distributions over possible functions , and are updated in light of data through the probabilistic inference . Despite these advantages , GPs are computationally expensive and their underlying model is not flexible for high-dimensional inputs , making them infeasible for multi-modal learning settings with multiple heterogeneous and high-dimensional data types . Apart from the aforementioned issues , existing generative models for multi-modal learning focus on latent representation , but do not fully incorporate the label information . In order to facilitate predictions on the target labels , they need to apply two-step procedures , in which the shared latent spaces are used for downstream classification . While information relevant to the reconstruction of views will be well-captured in the shared representations , discriminative information relevant to the target task may be discarded , leading to poor prediction performance of such models ( Lee & Schaar , 2021 ) . Furthermore , the shared representations of these methods in high-dimensional space are often difficult to interpret and need an extra downstream analyses such as PCA or t-SNE ( Van Der Maaten , 2014 ) that may cause biased results ( Lötsch & Ultsch , 2020 ) . In this paper , instead of following the existing multi-modal generative methods that rely on deterministic predictive functions , we propose the first multi-modal stochastic processes family that learns distributions over functions for inputs with any missing patterns . Like GPs , it naturally provides robust uncertainty estimates and can encode inductive biases . Unlike GPs , though , mRNP is computationally efficient during training and evaluation since it can take advantage of mini-batch optimization , and learns to adapt their priors to data . The inferred dependency graph in our model construction can be used to visualise the high dimensional latent representation , obviating the need for ad-hoc post-processing steps as required in most of the multi-modal learning methods . The presented work makes four major contributions : 1 ) We develop a novel multi-modal Relational Neural Process , mRNP , that defines a distribution over functions of multiple data types by employing local latent variables , and learns a dependency structure among the samples of the given modalities . 2 ) We theoretically prove exchangeability and consistency of mRNP , two necessary conditions that have to be satisfied during the construction of such a model , showing that mRNP is a valid stochastic process . 3 ) We further show that the local latent variable structure in mRNP is able to encode inductive biases and demonstrate this by designing an mRNP model that behaves similarly to a GP with an RBF kernel ( an ablation study ) . 4 ) We introduce mixture-of-graphs ( MoG ) in our model construction that can address the issues such as computational complexity and miscalibrated precisions observed in the previous approaches in multi-modal learning . 2 METHOD . We propose a new graph-structured multi-modal learning method , referred as multi-modal Relational Neural Process ( mRNP ) , that combines the benefits of neural networks with that of stochastic processes . In the supervised multi-modal setting , our dataset contains sets of feature-label pairs , { x̄ , y } from |V| different modalities with various missing patterns , where |V| is number of views , x̄ = { xv|vth modality present } v∈V ∈ X̄ is the input modalities and y ∈ Y is the given label . One of the key motivation of mRNP is that it gives us the ability to define a distribution over functions rather than learning a single static function when fitting the data . In this framework , inspired by the idea of inducing points in sparse Gaussian processes ( Titsias , 2009 ; Damianou & Lawrence , 2013 ) , we first select a reference set of samples that consists of functions f : x̄→ y that are sampled from some underlying distributionH . We then establish a probability distribution over fh around those samples . We define the reference set , XR = { XR,1 , . . . , XR , V } ⊂ X̄ , where XR , v ∈ RNv×Dv , and 1Rapid adaption to new observations is what distinguishes a model that can learn a whole distribution over functions by seeing different functions in each batch from the one that learns a single underlying function by observing several batches during the training . At the test time , the former will narrow down what the current function is by seeing a few context observations . Nv and Dv are the number of samples and dimension of features in the domain v , respectively . We also define O = X̄ \XR , which is the set of all possible samples that are not in XR . Please note that two sets XR and O includes both labeled and unlabeled samples . We also denote our labeled samples as Dx = { x̄1 , . . . , x̄N } , a set of any finite random set from X̄ , as well as defining sets XM = Dx\XR and XB = XR ∪ XM . The Venn diagram of the sets are provided in Figure 1 . We infer the parameters of our probabilistic model using variational inference . In the following , we first introduce each of the latent variables in our model as well as their corresponding prior and posterior distributions , and then prove that it corresponds to an infinitely exchangeable stochastic process . The graphical model of mRNP is illustrated in Figure 1 . Modality-specific latent spaces . The first step is to construct modality-specific latent representations , denoted by U = { Uv } v∈V , a set of Nv ×Du matrices , which independently embed samples of each modality ( i.e . Nv ) into a Du dimensional latent space as follows : ∫ pθ ( UB , XB ) dX = ∏ v∈V ∫ pθ ( UB , v , XB , v ) dXB , v = ∏ v∈V ∫ pθ ( UB , v |XB , v ) p ( XB , v ) dXB , v . We further parameterize the distribution over the samples ui , v independently : pθ ( UB , v |XB , v ) = ∏ i∈Bv pθ ( ui , v |xi , v ) , ( 1 ) where pθ ( ui , v |xi , v ) can be any distribution that is derived from the observed input data . For simplicity , we use a diagonal Gaussian , the parameters of which are a function of the observed input . More specifically , we use two functions denoted by ϕemb , µv ( XB , v ) and ϕ emb , σ v ( XB , v ) to infer the mean and variance of the distribution for each modality . Depending on the nature of the modality , these functions can be implemented using any highly expressive functions such as many variants of neural networks ( NNs ) and graph NNs . A directed graph among the reference samples . The next step is to construct a directed graph across the samples inXR using different modalities . Given the latent embedding UR , we first construct a set of directed acyclic graphs ( DAGs ) , G = { Gv } v∈V , where Gv is a random binary adjacency matrix between reference samples present in the vth modality . Then we combine the graphs Gv from multiple views to construct a common graph G. Inspired by the concept of stochastic orderings ( Shaked & Shanthikumar , 2007 ) , we impose a topological ordering over the vectors in UR to avoid cycles in each individual Gv . The distribution of the adjacency matrices are defined as follows : p ( Gv |UR , v ) = ∏ i∈Rv ∏ j∈Rv , j 6=i Bernoulli ( Gij , v | I [ t ( ui , v ) > t ( uj , v ) ] ϕsim ( ui , v , uj , v ) ) . ( 2 ) Similar to Louizos et al . ( 2019 ) , we employ a parameter free scalar projection t ( ui , v ) = ∑ k tk ( uik , v ) , where tk ( · ) is a monotonic function . In practice , we use the log cumulative distribution function of a standard normal distribution . Given the graphs Gv , we construct a directed graph G , in which the weight of each edge is average of its weights in different modalities , i.e . G = ∑ v∈V βvGv/ ∑ v∈Vmvm T v , where mv is a binary vector and mi , v = 1 when sample i is observed in the modality v , and βv = 1/|V | , assuming that the all modalities are equally important . The proposed formulation , referred as mixture-of-graphs ( MoG ) , is used to learn the shared structured representation of multi-modal inputs by using the graphs of individual modalities . A relational graph of dependencies from reference samples to XM . In addition to the directed graph G used for the reference samples , we apply MoG to construct a bipartite graph A = ∑ v∈V αvAv that is a bi-adjacency matrix from XR to XM . Given the latent embedding UB as described previously , we model the elements of each individual bi-adjacency matrix by Bernoulli distribution as follows : p ( Av |UM , v , UR , v ) = ∏ i∈Mv ∏ j∈Rv Bernoulli ( Aij |ϕsim ( ui , v , uj , v ) ) , ( 3 ) where ϕsim ( · , · ) is a score function measuring the similarity between the latent representations of the input samples in each modality v , and αv = 1/|V | , assuming the all modalities equally important . Depending on the desired relational inductive biases , we can appropriately define the function ϕsim ( · , · ) . The Bernoulli-Poisson link ϕsim ( ui , v , uj , v ) = 1− exp ( − ∑Du k=1 τk uik , v ujk , v ) and ϕsim ( ui , v , uj , v ) = exp ( − τ2 ||ui , v − uj , v|| 2 ) are two examples of such potential score functions . Please note that we use the latter one throughout this paper . For both A = { Av } v∈V and G , we use the concrete relaxation ( Maddison et al. , 2016 ; Gal et al. , 2017 ) during training while we sample from Bernoulli distributions in the testing phase . A shared latent variable . Having obtained the sample representations U and the dependency graphs A and G , we construct a shared latent variable , denoted by N ×Dz matrix Z , which can be used to predict target variable distributions yi . We parameterize the distributions of the predictive targets as follows : ∫ pθ ( yB , ZB |A , G , XR ) dZB = ∫ ∫ pθ ( yR , ZR |G , XR ) pθ ( yM , ZM |A , XR , yR ) dZR dZM = ∏ i∈R ∫ pθ ( zi |parGi ( XR , yR ) ) pθ ( yi | zi ) dzi ∏ j∈M ∫ pθ ( zj |parAj ( XR , yR ) ) pθ ( yj | zj ) dzj , where parGi ( · ) , parAj ( · ) are functions that return the parents of the points i and j according to G and A , respectively . We summarize the information from the parent samples and their targets in XR through the local latent variable zi , allowing the distribution yi to be explicitly dependent on the available graph dependency structures A and G. We set the distribution over zi as an independent Gaussian distribution whose parameters are a function of either A or G although any distribution with a permutation invariant probability density with respect to the parents can be used . More formally , the following distribution is adopted : pθ ( zi |parAi ( XR , yR ) ) = Dz∏ k=1 pθ ( zik |parAi ( XR , yR ) ) = Dz∏ k=1 N ( µpriorik , σ prior ik ) , ( 4 ) µpriorik = ci ∑ j∈XR Aijϕ prior , µ k ( xj , R , yj , R ) , σ prior ik = exp ( ci ∑ j∈XR Aijϕ prior , σ k ( xj , R , yj , R ) ) , where xj , R = { xj , R , v } v∈V , ϕprior , µ and ϕprior , σ are transform functions with a co-domain R|z| , and ci = ( ∑ j Aij + ) −1 is a normalization constant . Given input { XB , v } v∈V , we factorize the variational posterior distribution as qφ ( Z | XB ) = ∏ i∈B qφ ( zi |xi , B ) , ( 5 ) In practice , we also parameterize the priors over the latent zi in terms of the posterior distribution of the reference samples , i.e . qφ ( zi |xi , R ) . More precisely , we define ϕprior , µ and ϕprior , σ in equation ( 4 ) as ϕpost , µ ( xi , R ) +ϕ emb , µ label ( yi , R ) and ϕ post , σ ( xi , R ) +ϕ emb , σ label ( yi , R ) , respectively ; where ϕpost and ϕemblabel provide the means and variances of qφ ( zi |xi , R ) and the linear embedding of the labels of reference samples , respectively . We should point out that in this formulation , the prediction of yi indirectly depends on the input samples xi through the graphs G and A , which are functions of ui . This leads to an uninformative standard normal prior over zi for the samples with very small probability of being connected to the reference set through A , and hence the prediction of yi will be constant . This can be seen as encoding inductive bias similar to a GP with an RBF kernel . MoG vs PoE . PoE is a prime choice to learn the variational joint posteriors ; it can learn under any combination of missing modalities ( Shi et al. , 2019 ) . Despite this advantage , it also has two main limitations : 1 ) the underlying model suffers from the overconfident experts since experts with greater precision will have more influence over the combined prediction than experts with lower precision ; 2 ) training and inference can be costly due to its artificial sub-sampling procedure . Given the aforementioned limitations of PoE , we propose to build a graph of dependencies among local latent variables as a mixture of modality-specific graphs , i.e . mixture-of-graph ( MoG ) , and then parameterize the joint latent space Z conditioned on those graph . Unlike PoE , MoG effectively spreads its density over all the individual modalities by imposing a weight to each individual graphs . When prior knowledge is available , terms αv and βv in the MoG construction can be used to encourage certain modalities , which is the case in multi-omics data integration where individual modalities often contain complementary information of target task . A more detailed discussion can be found in Section D of the supplement . We also should point out that mRNP is not a graph learning model . Rather , we propose a novel multi-view NPs that is able to solve a pitfall in utilizing stochastic processes for multi-view setting by learning a graph of dependencies . We can also consider graph learning in mRNP as a kind of cross-attention in the form of a dependency graph among local latent variables . From this viewpoint , mRNP is learning attention mechanism to combine modalities . The current framework in which mRNP learns the individual graphs might not be computationally efficient , especially if training set is large . We may improve the scalability issue of graph construction part of our mRNP by e.g . considering hierarchical structure similar to hFGW ( Xu et al. , 2020 ) . We leave this for a future study . Overall likelihood and learning . Putting everything together , the marginal likelihood is pθ ( yB | XB ) = ∑ G , A ∫ ∏ v∈V pθ ( UB , v |XB , v ) p ( G , A | UB ) pθ ( yB , ZB |A , G , XR ) dUB dZB . ( 6 ) We should point out that , for the sake of simplicity , we choose the reference set to be part of the training set Dx throughout this paper . More specifically , we assume XB = Dx . In case of existing reference samples that are not part of the training set , we need to marginalize out over them in equation ( 6 ) in addition to the marginalizations over the latent variables and structured graphs . We can also use the marginalization technique to incorporate unlabelled data in order to learn a better representation and/or to impute the missing labels . We leave this for a future study . We deploy variational inference to optimize the model parameters θ and variational parameters φ by minimizing the following derived Evidence Lower Bound ( ELBO ) : L = Eqφ ( ZR | XR ) p ( G | UR ) ∏v∈V pθ ( UR , v |XR , v ) [ log pθ ( yR , ZR |G , XR ) − log qφ ( ZR | XR ) ] + Eqφ ( ZM | XM ) p ( A | UB ) ∏ v∈V pθ ( UB , v |XB , v ) [ log pθ ( yM |ZM ) + log pθ ( ZM |parA ( XR , yR ) ) − log qφ ( ZM | XM ) ] . Please note that we can use mini-batches for the second expectation term where the size of the batches scale according to the size of the reference set XR . Due to the DAG structure in the first expectation term , we can not decompose it to independent sums . Predictive distribution . After optimizing the model parameters , we derive the predictive distribution for unseen samples { x∗v } v∈V with missing modalities based on Bayes theorem as follows : pθ ( y ∗ | { x∗v } v∈V , XB , yB ) = ∑ a∗ ∫ ∏ v∈V pθ ( u ∗ v , UR , v |x∗v , XR , v ) p ( a∗ | { u∗v } v∈V , UR ) pθ ( z∗ |para∗ ( XR , yR ) ) pθ ( y∗ | z∗ ) dUR du∗v∈V dz∗ , where u∗v is the embedding representation of the observed modality x ∗ v through the neural network ϕembv and a ∗ is a binary vector similar to a row of A that denotes reference parents of the new samples . This is similar to the predictive distribution in few-shot learning ( Sung et al. , 2018 ) . Proposition I. mRNP corresponds to Bayesian models as the distributions defined in Equation ( 6 ) are valid , permutation invariant stochastic processes . proof . The proof is deferred to the supplement . | This paper tries to use Bayesian relational generative model for scalable multi-modal learning. They propose a class of stochastic processes that learns a graph of dependencies between samples across multi-modal data types through adopting priors over the relational structure of the given data modalities. The so-called mRNP method can address the limitations in joint posterior approximation. | SP:0993bb3320aea46c49ec5afe897567a5ecd220ae |
Bayesian Relational Generative Model for Scalable Multi-modal Learning | 1 INTRODUCTION . Many prominent methods for multi-modal learning ( Argelaguet et al. , 2018 ; Andrew et al. , 2013 ; Klami et al. , 2013 ; Zhao et al. , 2016 ) are based on the canonical correlation analysis ( CCA ) , which extracts shared components across multiple views . The main idea is that , given two vectors of random variables , the method finds the linear projections in a shared latent space , in which the projected vectors are maximally correlated ( Thompson , 1984 ) . This can help to understand the overall dependency structure between these two vectors . However , the classical CCA can not handle non-linearity ( Andrew et al. , 2013 ) and suffers from a lack of probabilistic interpretation when applied to high dimensional data ( Klami et al. , 2013 ) . To address these issues , probabilistic CCA ( PCCA ) has been proposed and extended to non-linear settings using kernel methods and neural networks ( Bach & Jordan , 2005 ) . More recently , Wu & Goodman ( 2018 ) introduced the multimodal variational autoencoder ( mVAE ) that models the joint posterior as a product-of-experts ( PoE ) over the marginal posteriors , enabling cross-modal generation at test time without requiring additional inference networks and multi-stage training regimes . However , training a PoE is difficult and the following techniques are needed in order to ensure that the individual views are learnt faithfully ; i ) using artificial sub-sampling of the observed views ( Wu & Goodman , 2018 ) , ii ) : applying variants of contrastive divergence ( Hinton , 2002 ) , and iii ) : utilizing information bottleneck on the marginal representations of each view ( Lee & Schaar , 2021 ) . Furthermore , each expert holds the power of veto and low density of only one marginal posteriors among a given set of observations leads to the low density of joint distribution ( Shi et al. , 2019 ) . In the case of Gaussian experts , different levels of complexity of modalities or sub-optimal initialisation might result in the miscalibrated precisions that potentially lead to a biased overall mean prediction ( Shi et al. , 2019 ) . Despite the success of the existing multi-modal generative methods , they suffer from inducing stochasticity in their inferred functions . This leads to ; i ) poor adaptation to new observations1 , ii ) inefficient generalizability in few-shot settings and , iii ) inaccurate uncertainty estimation , all of which are important in many safety critical applications such as healthcare . On the other hand , stochastic processes , such as Gaussian processes ( GPs ) , are exchangeable models that posit distributions over possible functions , and are updated in light of data through the probabilistic inference . Despite these advantages , GPs are computationally expensive and their underlying model is not flexible for high-dimensional inputs , making them infeasible for multi-modal learning settings with multiple heterogeneous and high-dimensional data types . Apart from the aforementioned issues , existing generative models for multi-modal learning focus on latent representation , but do not fully incorporate the label information . In order to facilitate predictions on the target labels , they need to apply two-step procedures , in which the shared latent spaces are used for downstream classification . While information relevant to the reconstruction of views will be well-captured in the shared representations , discriminative information relevant to the target task may be discarded , leading to poor prediction performance of such models ( Lee & Schaar , 2021 ) . Furthermore , the shared representations of these methods in high-dimensional space are often difficult to interpret and need an extra downstream analyses such as PCA or t-SNE ( Van Der Maaten , 2014 ) that may cause biased results ( Lötsch & Ultsch , 2020 ) . In this paper , instead of following the existing multi-modal generative methods that rely on deterministic predictive functions , we propose the first multi-modal stochastic processes family that learns distributions over functions for inputs with any missing patterns . Like GPs , it naturally provides robust uncertainty estimates and can encode inductive biases . Unlike GPs , though , mRNP is computationally efficient during training and evaluation since it can take advantage of mini-batch optimization , and learns to adapt their priors to data . The inferred dependency graph in our model construction can be used to visualise the high dimensional latent representation , obviating the need for ad-hoc post-processing steps as required in most of the multi-modal learning methods . The presented work makes four major contributions : 1 ) We develop a novel multi-modal Relational Neural Process , mRNP , that defines a distribution over functions of multiple data types by employing local latent variables , and learns a dependency structure among the samples of the given modalities . 2 ) We theoretically prove exchangeability and consistency of mRNP , two necessary conditions that have to be satisfied during the construction of such a model , showing that mRNP is a valid stochastic process . 3 ) We further show that the local latent variable structure in mRNP is able to encode inductive biases and demonstrate this by designing an mRNP model that behaves similarly to a GP with an RBF kernel ( an ablation study ) . 4 ) We introduce mixture-of-graphs ( MoG ) in our model construction that can address the issues such as computational complexity and miscalibrated precisions observed in the previous approaches in multi-modal learning . 2 METHOD . We propose a new graph-structured multi-modal learning method , referred as multi-modal Relational Neural Process ( mRNP ) , that combines the benefits of neural networks with that of stochastic processes . In the supervised multi-modal setting , our dataset contains sets of feature-label pairs , { x̄ , y } from |V| different modalities with various missing patterns , where |V| is number of views , x̄ = { xv|vth modality present } v∈V ∈ X̄ is the input modalities and y ∈ Y is the given label . One of the key motivation of mRNP is that it gives us the ability to define a distribution over functions rather than learning a single static function when fitting the data . In this framework , inspired by the idea of inducing points in sparse Gaussian processes ( Titsias , 2009 ; Damianou & Lawrence , 2013 ) , we first select a reference set of samples that consists of functions f : x̄→ y that are sampled from some underlying distributionH . We then establish a probability distribution over fh around those samples . We define the reference set , XR = { XR,1 , . . . , XR , V } ⊂ X̄ , where XR , v ∈ RNv×Dv , and 1Rapid adaption to new observations is what distinguishes a model that can learn a whole distribution over functions by seeing different functions in each batch from the one that learns a single underlying function by observing several batches during the training . At the test time , the former will narrow down what the current function is by seeing a few context observations . Nv and Dv are the number of samples and dimension of features in the domain v , respectively . We also define O = X̄ \XR , which is the set of all possible samples that are not in XR . Please note that two sets XR and O includes both labeled and unlabeled samples . We also denote our labeled samples as Dx = { x̄1 , . . . , x̄N } , a set of any finite random set from X̄ , as well as defining sets XM = Dx\XR and XB = XR ∪ XM . The Venn diagram of the sets are provided in Figure 1 . We infer the parameters of our probabilistic model using variational inference . In the following , we first introduce each of the latent variables in our model as well as their corresponding prior and posterior distributions , and then prove that it corresponds to an infinitely exchangeable stochastic process . The graphical model of mRNP is illustrated in Figure 1 . Modality-specific latent spaces . The first step is to construct modality-specific latent representations , denoted by U = { Uv } v∈V , a set of Nv ×Du matrices , which independently embed samples of each modality ( i.e . Nv ) into a Du dimensional latent space as follows : ∫ pθ ( UB , XB ) dX = ∏ v∈V ∫ pθ ( UB , v , XB , v ) dXB , v = ∏ v∈V ∫ pθ ( UB , v |XB , v ) p ( XB , v ) dXB , v . We further parameterize the distribution over the samples ui , v independently : pθ ( UB , v |XB , v ) = ∏ i∈Bv pθ ( ui , v |xi , v ) , ( 1 ) where pθ ( ui , v |xi , v ) can be any distribution that is derived from the observed input data . For simplicity , we use a diagonal Gaussian , the parameters of which are a function of the observed input . More specifically , we use two functions denoted by ϕemb , µv ( XB , v ) and ϕ emb , σ v ( XB , v ) to infer the mean and variance of the distribution for each modality . Depending on the nature of the modality , these functions can be implemented using any highly expressive functions such as many variants of neural networks ( NNs ) and graph NNs . A directed graph among the reference samples . The next step is to construct a directed graph across the samples inXR using different modalities . Given the latent embedding UR , we first construct a set of directed acyclic graphs ( DAGs ) , G = { Gv } v∈V , where Gv is a random binary adjacency matrix between reference samples present in the vth modality . Then we combine the graphs Gv from multiple views to construct a common graph G. Inspired by the concept of stochastic orderings ( Shaked & Shanthikumar , 2007 ) , we impose a topological ordering over the vectors in UR to avoid cycles in each individual Gv . The distribution of the adjacency matrices are defined as follows : p ( Gv |UR , v ) = ∏ i∈Rv ∏ j∈Rv , j 6=i Bernoulli ( Gij , v | I [ t ( ui , v ) > t ( uj , v ) ] ϕsim ( ui , v , uj , v ) ) . ( 2 ) Similar to Louizos et al . ( 2019 ) , we employ a parameter free scalar projection t ( ui , v ) = ∑ k tk ( uik , v ) , where tk ( · ) is a monotonic function . In practice , we use the log cumulative distribution function of a standard normal distribution . Given the graphs Gv , we construct a directed graph G , in which the weight of each edge is average of its weights in different modalities , i.e . G = ∑ v∈V βvGv/ ∑ v∈Vmvm T v , where mv is a binary vector and mi , v = 1 when sample i is observed in the modality v , and βv = 1/|V | , assuming that the all modalities are equally important . The proposed formulation , referred as mixture-of-graphs ( MoG ) , is used to learn the shared structured representation of multi-modal inputs by using the graphs of individual modalities . A relational graph of dependencies from reference samples to XM . In addition to the directed graph G used for the reference samples , we apply MoG to construct a bipartite graph A = ∑ v∈V αvAv that is a bi-adjacency matrix from XR to XM . Given the latent embedding UB as described previously , we model the elements of each individual bi-adjacency matrix by Bernoulli distribution as follows : p ( Av |UM , v , UR , v ) = ∏ i∈Mv ∏ j∈Rv Bernoulli ( Aij |ϕsim ( ui , v , uj , v ) ) , ( 3 ) where ϕsim ( · , · ) is a score function measuring the similarity between the latent representations of the input samples in each modality v , and αv = 1/|V | , assuming the all modalities equally important . Depending on the desired relational inductive biases , we can appropriately define the function ϕsim ( · , · ) . The Bernoulli-Poisson link ϕsim ( ui , v , uj , v ) = 1− exp ( − ∑Du k=1 τk uik , v ujk , v ) and ϕsim ( ui , v , uj , v ) = exp ( − τ2 ||ui , v − uj , v|| 2 ) are two examples of such potential score functions . Please note that we use the latter one throughout this paper . For both A = { Av } v∈V and G , we use the concrete relaxation ( Maddison et al. , 2016 ; Gal et al. , 2017 ) during training while we sample from Bernoulli distributions in the testing phase . A shared latent variable . Having obtained the sample representations U and the dependency graphs A and G , we construct a shared latent variable , denoted by N ×Dz matrix Z , which can be used to predict target variable distributions yi . We parameterize the distributions of the predictive targets as follows : ∫ pθ ( yB , ZB |A , G , XR ) dZB = ∫ ∫ pθ ( yR , ZR |G , XR ) pθ ( yM , ZM |A , XR , yR ) dZR dZM = ∏ i∈R ∫ pθ ( zi |parGi ( XR , yR ) ) pθ ( yi | zi ) dzi ∏ j∈M ∫ pθ ( zj |parAj ( XR , yR ) ) pθ ( yj | zj ) dzj , where parGi ( · ) , parAj ( · ) are functions that return the parents of the points i and j according to G and A , respectively . We summarize the information from the parent samples and their targets in XR through the local latent variable zi , allowing the distribution yi to be explicitly dependent on the available graph dependency structures A and G. We set the distribution over zi as an independent Gaussian distribution whose parameters are a function of either A or G although any distribution with a permutation invariant probability density with respect to the parents can be used . More formally , the following distribution is adopted : pθ ( zi |parAi ( XR , yR ) ) = Dz∏ k=1 pθ ( zik |parAi ( XR , yR ) ) = Dz∏ k=1 N ( µpriorik , σ prior ik ) , ( 4 ) µpriorik = ci ∑ j∈XR Aijϕ prior , µ k ( xj , R , yj , R ) , σ prior ik = exp ( ci ∑ j∈XR Aijϕ prior , σ k ( xj , R , yj , R ) ) , where xj , R = { xj , R , v } v∈V , ϕprior , µ and ϕprior , σ are transform functions with a co-domain R|z| , and ci = ( ∑ j Aij + ) −1 is a normalization constant . Given input { XB , v } v∈V , we factorize the variational posterior distribution as qφ ( Z | XB ) = ∏ i∈B qφ ( zi |xi , B ) , ( 5 ) In practice , we also parameterize the priors over the latent zi in terms of the posterior distribution of the reference samples , i.e . qφ ( zi |xi , R ) . More precisely , we define ϕprior , µ and ϕprior , σ in equation ( 4 ) as ϕpost , µ ( xi , R ) +ϕ emb , µ label ( yi , R ) and ϕ post , σ ( xi , R ) +ϕ emb , σ label ( yi , R ) , respectively ; where ϕpost and ϕemblabel provide the means and variances of qφ ( zi |xi , R ) and the linear embedding of the labels of reference samples , respectively . We should point out that in this formulation , the prediction of yi indirectly depends on the input samples xi through the graphs G and A , which are functions of ui . This leads to an uninformative standard normal prior over zi for the samples with very small probability of being connected to the reference set through A , and hence the prediction of yi will be constant . This can be seen as encoding inductive bias similar to a GP with an RBF kernel . MoG vs PoE . PoE is a prime choice to learn the variational joint posteriors ; it can learn under any combination of missing modalities ( Shi et al. , 2019 ) . Despite this advantage , it also has two main limitations : 1 ) the underlying model suffers from the overconfident experts since experts with greater precision will have more influence over the combined prediction than experts with lower precision ; 2 ) training and inference can be costly due to its artificial sub-sampling procedure . Given the aforementioned limitations of PoE , we propose to build a graph of dependencies among local latent variables as a mixture of modality-specific graphs , i.e . mixture-of-graph ( MoG ) , and then parameterize the joint latent space Z conditioned on those graph . Unlike PoE , MoG effectively spreads its density over all the individual modalities by imposing a weight to each individual graphs . When prior knowledge is available , terms αv and βv in the MoG construction can be used to encourage certain modalities , which is the case in multi-omics data integration where individual modalities often contain complementary information of target task . A more detailed discussion can be found in Section D of the supplement . We also should point out that mRNP is not a graph learning model . Rather , we propose a novel multi-view NPs that is able to solve a pitfall in utilizing stochastic processes for multi-view setting by learning a graph of dependencies . We can also consider graph learning in mRNP as a kind of cross-attention in the form of a dependency graph among local latent variables . From this viewpoint , mRNP is learning attention mechanism to combine modalities . The current framework in which mRNP learns the individual graphs might not be computationally efficient , especially if training set is large . We may improve the scalability issue of graph construction part of our mRNP by e.g . considering hierarchical structure similar to hFGW ( Xu et al. , 2020 ) . We leave this for a future study . Overall likelihood and learning . Putting everything together , the marginal likelihood is pθ ( yB | XB ) = ∑ G , A ∫ ∏ v∈V pθ ( UB , v |XB , v ) p ( G , A | UB ) pθ ( yB , ZB |A , G , XR ) dUB dZB . ( 6 ) We should point out that , for the sake of simplicity , we choose the reference set to be part of the training set Dx throughout this paper . More specifically , we assume XB = Dx . In case of existing reference samples that are not part of the training set , we need to marginalize out over them in equation ( 6 ) in addition to the marginalizations over the latent variables and structured graphs . We can also use the marginalization technique to incorporate unlabelled data in order to learn a better representation and/or to impute the missing labels . We leave this for a future study . We deploy variational inference to optimize the model parameters θ and variational parameters φ by minimizing the following derived Evidence Lower Bound ( ELBO ) : L = Eqφ ( ZR | XR ) p ( G | UR ) ∏v∈V pθ ( UR , v |XR , v ) [ log pθ ( yR , ZR |G , XR ) − log qφ ( ZR | XR ) ] + Eqφ ( ZM | XM ) p ( A | UB ) ∏ v∈V pθ ( UB , v |XB , v ) [ log pθ ( yM |ZM ) + log pθ ( ZM |parA ( XR , yR ) ) − log qφ ( ZM | XM ) ] . Please note that we can use mini-batches for the second expectation term where the size of the batches scale according to the size of the reference set XR . Due to the DAG structure in the first expectation term , we can not decompose it to independent sums . Predictive distribution . After optimizing the model parameters , we derive the predictive distribution for unseen samples { x∗v } v∈V with missing modalities based on Bayes theorem as follows : pθ ( y ∗ | { x∗v } v∈V , XB , yB ) = ∑ a∗ ∫ ∏ v∈V pθ ( u ∗ v , UR , v |x∗v , XR , v ) p ( a∗ | { u∗v } v∈V , UR ) pθ ( z∗ |para∗ ( XR , yR ) ) pθ ( y∗ | z∗ ) dUR du∗v∈V dz∗ , where u∗v is the embedding representation of the observed modality x ∗ v through the neural network ϕembv and a ∗ is a binary vector similar to a row of A that denotes reference parents of the new samples . This is similar to the predictive distribution in few-shot learning ( Sung et al. , 2018 ) . Proposition I. mRNP corresponds to Bayesian models as the distributions defined in Equation ( 6 ) are valid , permutation invariant stochastic processes . proof . The proof is deferred to the supplement . | The paper proposes a Bayesian model that learns a predictive distribution given multimodal data with labels. The novelty of the proposed method is that it learns a dependency graph between samples from different modalities and introduces a new mixture-of-graphs (MoG) method to aggregate different dependency graphs. Experimental results on several datasets demonstrate that the proposed method, which is fully supervised, improves the predictive performance compared to two unsupervised approaches and one supervised baseline. Qualitative results corroborate the quality of the learned representations, which can be visualized as relational graphs, whereas the baselines require additional dimensionality reduction techniques for visualization. | SP:0993bb3320aea46c49ec5afe897567a5ecd220ae |
The Unreasonable Effectiveness of Random Pruning: Return of the Most Naive Baseline for Sparse Training | 1 INTRODUCTION . Most recent breakthroughs in deep learning are fairly achieved with the increased complexity of over-parameterized networks ( Brown et al. , 2020 ; Raffel et al. , 2020 ; Dosovitskiy et al. , 2021 ; Fedus et al. , 2021. arXiv:2101.03961 ; Jumper et al. , 2021 ; Berner et al. , 2019 ) . It is well-known that large models train better ( Neyshabur et al. , 2019 ; Novak et al. , 2018 ; Allen-Zhu et al. , 2019 ) , generalize better ( Hendrycks & Dietterich , 2019 ; Xie & Yuille , 2020 ; Zhao et al. , 2018 ) , and transfer better ( Chen et al. , 2020 ; 2021 ) . However , the upsurge in the investment of large models exacerbates the gap between research and real-life applications since many practical applications demand compact and efficient networks . Neural network pruning , since proposed by ( Mozer & Smolensky , 1989 ; Janowsky , 1989 ) , has evolved as the most common technique in literature to reduce the computational and memory requirements of neural networks . Over the past few years , numerous pruning criteria have been proposed , including magnitude ( Mozer & Smolensky , 1989 ; Han et al. , 2015 ; Frankle & Carbin , 2019 ; Mocanu et al. , 2018 ) , Hessian ( LeCun et al. , 1990 ; Hassibi & Stork , 1993 ) , mutual information ( Dai et al. , 2018 ) , Taylor expansion ( Molchanov et al. , 2016 ) , movement ( Sanh et al. , 2020 ) , connection sensitivity ( Lee et al. , 2019 ) , etc . Motivated for different scenarios , pruning can occur after training ( Han et al. , 2015 ; Frankle & Carbin , 2019 ; Molchanov et al. , 2016 ; Lee et al. , 2021 ) , during training ( Zhu & Gupta , 2017 ; Gale et al. , 2019 ; Louizos et al. , 2018 ) , and even before training ( Mocanu et al. , 2018 ; Lee et al. , 2019 ; Gale et al. , 2019 ) . The last regime can be further categorized into “ static sparse training ” ( Mocanu et al. , 2016 ; Gale et al. , 2019 ; Lee et al. , 2019 ; Wang et al. , 2020 ) and “ dynamic sparse training ” ( Mocanu et al. , 2018 ; Bellec et al. , 2018 ; Evci et al. , 2020a ; Liu et al. , 2021b ) . While random pruning is a universal method that can happen at any stage of training , training a randomly pruned network from scratch is arguably the most appealing way , owing to its “ end-to-end ” saving potential for the entire training process besides the inference . Due to this reason , we focus on random pruning at initialization ( or sparse training ) in this paper . When new pruning approaches bloom , random pruning naturally becomes their performance ’ s empirical “ lower bound ” since the connections are randomly chosen without any good reasoning . Likely due to the same reason , the results of random pruning at initialization ( as “ easy to beat ” baselines to support fancier new pruning methods ) reported in the literature are unfortunately vague , often inconsistent , and sometimes casual . For instance , it is found in Liu et al . ( 2020b ) that randomly pruned sparse networks can be trained from scratch to match the full accuracy of dense networks with only 20 % parameters , whereas around 80 % parameters are required to do so in Frankle et al . ( 2021 ) . The differences may arise from architecture choices , training recipes , distribution hyperparameters/layer-wise ratios , and so on . In most pruning literature ( Gale et al. , 2019 ; Lee et al. , 2019 ; Frankle et al. , 2021 ; Tanaka et al. , 2020 ) , random pruning usually refers to randomly removing the same proportion of parameters per layer , ending up with uniform layer-wise sparsities . Nevertheless , researchers have explored other pre-defined layer-wise sparsities , e.g. , uniform+ ( Gale et al. , 2019 ) , Erdős-Rényi random graph ( ER ) ( Mocanu et al. , 2018 ) , and Erdős-Rényi-Kernel ( ERK ) ( Evci et al. , 2020a ) . These layerwise sparsities naturally fit the category of random pruning , as they require no training to obtain the corresponding sparsity ratios ( followed by sampling randomly ) . We assess random pruning at initialization with these layer-wise sparsity ratios , in terms of various perspectives besides the predictive accuracy . Our main findings during this course of study are summarized below : • We find that the network size matters for the effectiveness of random pruning at initialization . With small networks , random pruning at initialization hardly matches the full accuracy even at mild sparsities ( 10 % , 20 % ) . However , as the networks grow wider and deeper , the performance of training a randomly pruned sparse network will quickly grow to matching that of its dense equivalent , even at high sparsity ratios . • We further identify that appropriate layer-wise sparsity ratios can be an important booster for the performance of random pruning at initialization , particularly for large networks . We investigate several options to pre-define layer-wise sparsity ratios before any training ; one of them is able to push the performance of a completely random sparse Wide ResNet-50 to the densely trained Wide ResNet-50 on ImageNet . • We systematically assess the performance of random pruning at initialization and are somehow surprised by its accuracy and robustness . The accuracy achieved by ERK ratio can even surpass the ones learned by complex criteria , e.g. , SNIP , GraSP . In addition , randomly pruned sparse networks are found to outperform dense networks in other favorable aspects , such as out-of-distribution ( OoD ) performance , adversarial robustness , and uncertainty estimation . 2 RELATED WORK . 2.1 STATIC SPARSE TRAINING . Static sparse training represents a class of methods that aim to train a sparse subnetwork with a fixed sparse connectivity pattern during the course of training . We divide the static sparse training into random pruning and non-random pruning according to whether the connection is randomly selected . Random Pruning . Static sparse training with random pruning samples masks within each layer in a random fashion based on pre-defined layer-wise sparsities . The most naive approach is pruning each layer uniformly with the same pruning ratio , i.e. , uniform pruning ( Mariet & Sra , 2016. arXiv:1511.05077 ; He et al. , 2017 ; Suau et al. , 2019 ; Gale et al. , 2019 ) . Mocanu et al . ( 2016 ) proposed a non-uniform and scale-free topology , showing better performance than the dense counterpart when applied to restricted Boltzmann machines ( RBMs ) . Later , expander graphs were introduced to build sparse CNNs and showed comparable performance against the corresponding dense CNNs ( Prabhu et al. , 2018 ; Kepner & Robinett , 2019 ) . While not initially designed for static sparse training , ER ( Mocanu et al. , 2018 ) and ERK ( Evci et al. , 2020a ) are two advanced layer-wise sparsities introduced from the field of graph theory with strong results . Non-Random Pruning . Instead of pre-choosing a sparsity ratio for each layer , many works utilize the proposed saliency criteria to learn the layer-wise sparsity ratios before training , also termed as pruning at initialization ( PaI ) . Lee et al . ( 2019 ) first introduced SNIP that chooses structurally important connections at initialization via the proposed connection sensitivity . Following SNIP , many efficient criteria have been proposed to improve the performance of non-random pruning at initialization , including but not limited to gradient flow ( GraSP ; Wang et al . ( 2020 ) ) , synaptic strengths ( SynFlow ; Tanaka et al . ( 2020 ) ) , neural tangent kernel ( Liu & Zenke , 2020 ) , and iterative SNIP ( de Jorge et al. , 2021 ; Verdenius et al. , 2020 ) . 2.2 DYNAMIC SPARSE TRAINING . In contrast to static sparse training , dynamic sparse training stems from randomly initialized sparse subnetworks , and meanwhile dynamically explores new sparse connectivity during training . Dynamic sparse training starts from Sparse Evolutionary Training ( SET ) ( Mocanu et al. , 2018 ; Liu et al. , 2020a ) which initializes the sparse connectivity with Erdős-Rényi ( Erdős & Rényi , 1959 ) topology and periodically explores the sparse connectivity via a prune-and-grow scheme during the course of training . While there exist numerous pruning criteria in the literature , simple magnitude pruning typically performs well in the field of dynamic sparse training . On the other hand , the criteria used to grow weights back differs from method to method , including randomness ( Mocanu et al. , 2018 ; Mostafa & Wang , 2019 ) , momentum ( Dettmers & Zettlemoyer , 2019 ) , gradient ( Evci et al. , 2020a ; Jayakumar et al. , 2020 ; Liu et al. , 2021b ) . Besides the prune-and-grow scheme , layer-wise sparsities are vital to achieving high accuracy . ( Mostafa & Wang , 2019 ; Dettmers & Zettlemoyer , 2019 ) reallocates weights across layers during training based on reasonable heuristics , demonstrating performance improvement . Evci et al . ( 2020a ) extended ER to CNNs and showed considerable performance gains to sparse CNN training with the Erdős-Rényi-Kernel ( ERK ) ratio . Liu et al . ( 2021a ) recently showed that starting from a relatively lower sparsity ( 50 % ) rather than the target sparsity , provides a larger exploration space for DST , enables better sparsity ratios with higher accuracy but fewer FLOPs . Even though dynamic sparse training achieves promising sparse training performance , it changes the sparse connectivity during training and is thus out of the scope of random pruning . The most closely related works of our work are Su et al . ( 2020 ) and Frankle et al . ( 2021 ) . Su et al . ( 2020 ) proposed several sanity-check and showed that SNIP , GraSP , and Lottery Tickets ( LT ) 1 hardly exploit any information from the training data and are very robust to mask shuffling . They further show that random pruning at initialization with hand-designed layer-wise sparsity ratios outperforms or attains a similar performance compared with PaI methods . Frankle et al . ( 2021 ) further confirmed that what PaI discovers are the layer-wise sparsities rather than the specific weights or values , whereas magnitude pruning after training learns both , reflecting a broader challenge inherent to pruning at initialization . While prior works have observed that random pruning can be more competitive in certain cases ( Mocanu et al. , 2018 ; Liu et al. , 2020b ; Su et al. , 2020 ; Frankle et al. , 2021 ) , they did not give principled guidelines on when and how it can become that good ; nor do they show it can match the performance of dense networks on ImageNet . Standing on the shoulders of giants , our work summarized principles by more rigorous studies , and demonstrate the strongest result so far , that randomly pruned sparse Wide ResNet-50 can be sparsely trained to match a dense Wide ResNet-50 , on ImageNet . Moreover , compared with the ad-hoc sparsity ratios used in ( Su et al. , 2020 ) , we show that ERK ( Evci et al. , 2020a ) and our modified ERK+ are more general sparsity ratios that consistently demonstrate competitive performance without careful layer-wise sparsity design for every architecture , while being data free , feed-forward free , and dense initialization free . | This paper discusses pruning at initialization (PaI) and they argue random pruning can be quite strong actually, whose performance was under-rated in the past. They present abundant experiments to show random pruning can perform on par with other PaI methods with dedicated pruning criteria. They further show random pruning networks can outperform dense counterparts in other favorable aspects, such as out-of-distribution detection, uncertainty estimation, and adversarial robustness. | SP:1a7841538e2d15553c61fbdb9fa6ac0fa4f53728 |
The Unreasonable Effectiveness of Random Pruning: Return of the Most Naive Baseline for Sparse Training | 1 INTRODUCTION . Most recent breakthroughs in deep learning are fairly achieved with the increased complexity of over-parameterized networks ( Brown et al. , 2020 ; Raffel et al. , 2020 ; Dosovitskiy et al. , 2021 ; Fedus et al. , 2021. arXiv:2101.03961 ; Jumper et al. , 2021 ; Berner et al. , 2019 ) . It is well-known that large models train better ( Neyshabur et al. , 2019 ; Novak et al. , 2018 ; Allen-Zhu et al. , 2019 ) , generalize better ( Hendrycks & Dietterich , 2019 ; Xie & Yuille , 2020 ; Zhao et al. , 2018 ) , and transfer better ( Chen et al. , 2020 ; 2021 ) . However , the upsurge in the investment of large models exacerbates the gap between research and real-life applications since many practical applications demand compact and efficient networks . Neural network pruning , since proposed by ( Mozer & Smolensky , 1989 ; Janowsky , 1989 ) , has evolved as the most common technique in literature to reduce the computational and memory requirements of neural networks . Over the past few years , numerous pruning criteria have been proposed , including magnitude ( Mozer & Smolensky , 1989 ; Han et al. , 2015 ; Frankle & Carbin , 2019 ; Mocanu et al. , 2018 ) , Hessian ( LeCun et al. , 1990 ; Hassibi & Stork , 1993 ) , mutual information ( Dai et al. , 2018 ) , Taylor expansion ( Molchanov et al. , 2016 ) , movement ( Sanh et al. , 2020 ) , connection sensitivity ( Lee et al. , 2019 ) , etc . Motivated for different scenarios , pruning can occur after training ( Han et al. , 2015 ; Frankle & Carbin , 2019 ; Molchanov et al. , 2016 ; Lee et al. , 2021 ) , during training ( Zhu & Gupta , 2017 ; Gale et al. , 2019 ; Louizos et al. , 2018 ) , and even before training ( Mocanu et al. , 2018 ; Lee et al. , 2019 ; Gale et al. , 2019 ) . The last regime can be further categorized into “ static sparse training ” ( Mocanu et al. , 2016 ; Gale et al. , 2019 ; Lee et al. , 2019 ; Wang et al. , 2020 ) and “ dynamic sparse training ” ( Mocanu et al. , 2018 ; Bellec et al. , 2018 ; Evci et al. , 2020a ; Liu et al. , 2021b ) . While random pruning is a universal method that can happen at any stage of training , training a randomly pruned network from scratch is arguably the most appealing way , owing to its “ end-to-end ” saving potential for the entire training process besides the inference . Due to this reason , we focus on random pruning at initialization ( or sparse training ) in this paper . When new pruning approaches bloom , random pruning naturally becomes their performance ’ s empirical “ lower bound ” since the connections are randomly chosen without any good reasoning . Likely due to the same reason , the results of random pruning at initialization ( as “ easy to beat ” baselines to support fancier new pruning methods ) reported in the literature are unfortunately vague , often inconsistent , and sometimes casual . For instance , it is found in Liu et al . ( 2020b ) that randomly pruned sparse networks can be trained from scratch to match the full accuracy of dense networks with only 20 % parameters , whereas around 80 % parameters are required to do so in Frankle et al . ( 2021 ) . The differences may arise from architecture choices , training recipes , distribution hyperparameters/layer-wise ratios , and so on . In most pruning literature ( Gale et al. , 2019 ; Lee et al. , 2019 ; Frankle et al. , 2021 ; Tanaka et al. , 2020 ) , random pruning usually refers to randomly removing the same proportion of parameters per layer , ending up with uniform layer-wise sparsities . Nevertheless , researchers have explored other pre-defined layer-wise sparsities , e.g. , uniform+ ( Gale et al. , 2019 ) , Erdős-Rényi random graph ( ER ) ( Mocanu et al. , 2018 ) , and Erdős-Rényi-Kernel ( ERK ) ( Evci et al. , 2020a ) . These layerwise sparsities naturally fit the category of random pruning , as they require no training to obtain the corresponding sparsity ratios ( followed by sampling randomly ) . We assess random pruning at initialization with these layer-wise sparsity ratios , in terms of various perspectives besides the predictive accuracy . Our main findings during this course of study are summarized below : • We find that the network size matters for the effectiveness of random pruning at initialization . With small networks , random pruning at initialization hardly matches the full accuracy even at mild sparsities ( 10 % , 20 % ) . However , as the networks grow wider and deeper , the performance of training a randomly pruned sparse network will quickly grow to matching that of its dense equivalent , even at high sparsity ratios . • We further identify that appropriate layer-wise sparsity ratios can be an important booster for the performance of random pruning at initialization , particularly for large networks . We investigate several options to pre-define layer-wise sparsity ratios before any training ; one of them is able to push the performance of a completely random sparse Wide ResNet-50 to the densely trained Wide ResNet-50 on ImageNet . • We systematically assess the performance of random pruning at initialization and are somehow surprised by its accuracy and robustness . The accuracy achieved by ERK ratio can even surpass the ones learned by complex criteria , e.g. , SNIP , GraSP . In addition , randomly pruned sparse networks are found to outperform dense networks in other favorable aspects , such as out-of-distribution ( OoD ) performance , adversarial robustness , and uncertainty estimation . 2 RELATED WORK . 2.1 STATIC SPARSE TRAINING . Static sparse training represents a class of methods that aim to train a sparse subnetwork with a fixed sparse connectivity pattern during the course of training . We divide the static sparse training into random pruning and non-random pruning according to whether the connection is randomly selected . Random Pruning . Static sparse training with random pruning samples masks within each layer in a random fashion based on pre-defined layer-wise sparsities . The most naive approach is pruning each layer uniformly with the same pruning ratio , i.e. , uniform pruning ( Mariet & Sra , 2016. arXiv:1511.05077 ; He et al. , 2017 ; Suau et al. , 2019 ; Gale et al. , 2019 ) . Mocanu et al . ( 2016 ) proposed a non-uniform and scale-free topology , showing better performance than the dense counterpart when applied to restricted Boltzmann machines ( RBMs ) . Later , expander graphs were introduced to build sparse CNNs and showed comparable performance against the corresponding dense CNNs ( Prabhu et al. , 2018 ; Kepner & Robinett , 2019 ) . While not initially designed for static sparse training , ER ( Mocanu et al. , 2018 ) and ERK ( Evci et al. , 2020a ) are two advanced layer-wise sparsities introduced from the field of graph theory with strong results . Non-Random Pruning . Instead of pre-choosing a sparsity ratio for each layer , many works utilize the proposed saliency criteria to learn the layer-wise sparsity ratios before training , also termed as pruning at initialization ( PaI ) . Lee et al . ( 2019 ) first introduced SNIP that chooses structurally important connections at initialization via the proposed connection sensitivity . Following SNIP , many efficient criteria have been proposed to improve the performance of non-random pruning at initialization , including but not limited to gradient flow ( GraSP ; Wang et al . ( 2020 ) ) , synaptic strengths ( SynFlow ; Tanaka et al . ( 2020 ) ) , neural tangent kernel ( Liu & Zenke , 2020 ) , and iterative SNIP ( de Jorge et al. , 2021 ; Verdenius et al. , 2020 ) . 2.2 DYNAMIC SPARSE TRAINING . In contrast to static sparse training , dynamic sparse training stems from randomly initialized sparse subnetworks , and meanwhile dynamically explores new sparse connectivity during training . Dynamic sparse training starts from Sparse Evolutionary Training ( SET ) ( Mocanu et al. , 2018 ; Liu et al. , 2020a ) which initializes the sparse connectivity with Erdős-Rényi ( Erdős & Rényi , 1959 ) topology and periodically explores the sparse connectivity via a prune-and-grow scheme during the course of training . While there exist numerous pruning criteria in the literature , simple magnitude pruning typically performs well in the field of dynamic sparse training . On the other hand , the criteria used to grow weights back differs from method to method , including randomness ( Mocanu et al. , 2018 ; Mostafa & Wang , 2019 ) , momentum ( Dettmers & Zettlemoyer , 2019 ) , gradient ( Evci et al. , 2020a ; Jayakumar et al. , 2020 ; Liu et al. , 2021b ) . Besides the prune-and-grow scheme , layer-wise sparsities are vital to achieving high accuracy . ( Mostafa & Wang , 2019 ; Dettmers & Zettlemoyer , 2019 ) reallocates weights across layers during training based on reasonable heuristics , demonstrating performance improvement . Evci et al . ( 2020a ) extended ER to CNNs and showed considerable performance gains to sparse CNN training with the Erdős-Rényi-Kernel ( ERK ) ratio . Liu et al . ( 2021a ) recently showed that starting from a relatively lower sparsity ( 50 % ) rather than the target sparsity , provides a larger exploration space for DST , enables better sparsity ratios with higher accuracy but fewer FLOPs . Even though dynamic sparse training achieves promising sparse training performance , it changes the sparse connectivity during training and is thus out of the scope of random pruning . The most closely related works of our work are Su et al . ( 2020 ) and Frankle et al . ( 2021 ) . Su et al . ( 2020 ) proposed several sanity-check and showed that SNIP , GraSP , and Lottery Tickets ( LT ) 1 hardly exploit any information from the training data and are very robust to mask shuffling . They further show that random pruning at initialization with hand-designed layer-wise sparsity ratios outperforms or attains a similar performance compared with PaI methods . Frankle et al . ( 2021 ) further confirmed that what PaI discovers are the layer-wise sparsities rather than the specific weights or values , whereas magnitude pruning after training learns both , reflecting a broader challenge inherent to pruning at initialization . While prior works have observed that random pruning can be more competitive in certain cases ( Mocanu et al. , 2018 ; Liu et al. , 2020b ; Su et al. , 2020 ; Frankle et al. , 2021 ) , they did not give principled guidelines on when and how it can become that good ; nor do they show it can match the performance of dense networks on ImageNet . Standing on the shoulders of giants , our work summarized principles by more rigorous studies , and demonstrate the strongest result so far , that randomly pruned sparse Wide ResNet-50 can be sparsely trained to match a dense Wide ResNet-50 , on ImageNet . Moreover , compared with the ad-hoc sparsity ratios used in ( Su et al. , 2020 ) , we show that ERK ( Evci et al. , 2020a ) and our modified ERK+ are more general sparsity ratios that consistently demonstrate competitive performance without careful layer-wise sparsity design for every architecture , while being data free , feed-forward free , and dense initialization free . | This paper revisits the OG and the simplest pruning baselines out there: Random Pruning. Random Pruning randomly zeros out the weights in a network with a target budget and is often used at a layer level based on the chosen sparsity ratios. This paper is a detailed study into Random Pruning. As put forward in contributions, the discussion includes the dependence on network size, the importance of sparsity ratios, and lastly the general-purpose aspects like robustness and OOD, etc of these pruned networks. The observations seem to point to the fact that as the model size increases the pruning method becomes obsolete and everything converges to the same solution. They also show that sparsity ratios matter more than anything else for pruning techniques. These two observations have been made in the past in different settings but still are valid observations. Lastly, the paper extensively tries to evaluate the robustness aspects of these models + sparsity ratios for CIFAR. | SP:1a7841538e2d15553c61fbdb9fa6ac0fa4f53728 |
The Unreasonable Effectiveness of Random Pruning: Return of the Most Naive Baseline for Sparse Training | 1 INTRODUCTION . Most recent breakthroughs in deep learning are fairly achieved with the increased complexity of over-parameterized networks ( Brown et al. , 2020 ; Raffel et al. , 2020 ; Dosovitskiy et al. , 2021 ; Fedus et al. , 2021. arXiv:2101.03961 ; Jumper et al. , 2021 ; Berner et al. , 2019 ) . It is well-known that large models train better ( Neyshabur et al. , 2019 ; Novak et al. , 2018 ; Allen-Zhu et al. , 2019 ) , generalize better ( Hendrycks & Dietterich , 2019 ; Xie & Yuille , 2020 ; Zhao et al. , 2018 ) , and transfer better ( Chen et al. , 2020 ; 2021 ) . However , the upsurge in the investment of large models exacerbates the gap between research and real-life applications since many practical applications demand compact and efficient networks . Neural network pruning , since proposed by ( Mozer & Smolensky , 1989 ; Janowsky , 1989 ) , has evolved as the most common technique in literature to reduce the computational and memory requirements of neural networks . Over the past few years , numerous pruning criteria have been proposed , including magnitude ( Mozer & Smolensky , 1989 ; Han et al. , 2015 ; Frankle & Carbin , 2019 ; Mocanu et al. , 2018 ) , Hessian ( LeCun et al. , 1990 ; Hassibi & Stork , 1993 ) , mutual information ( Dai et al. , 2018 ) , Taylor expansion ( Molchanov et al. , 2016 ) , movement ( Sanh et al. , 2020 ) , connection sensitivity ( Lee et al. , 2019 ) , etc . Motivated for different scenarios , pruning can occur after training ( Han et al. , 2015 ; Frankle & Carbin , 2019 ; Molchanov et al. , 2016 ; Lee et al. , 2021 ) , during training ( Zhu & Gupta , 2017 ; Gale et al. , 2019 ; Louizos et al. , 2018 ) , and even before training ( Mocanu et al. , 2018 ; Lee et al. , 2019 ; Gale et al. , 2019 ) . The last regime can be further categorized into “ static sparse training ” ( Mocanu et al. , 2016 ; Gale et al. , 2019 ; Lee et al. , 2019 ; Wang et al. , 2020 ) and “ dynamic sparse training ” ( Mocanu et al. , 2018 ; Bellec et al. , 2018 ; Evci et al. , 2020a ; Liu et al. , 2021b ) . While random pruning is a universal method that can happen at any stage of training , training a randomly pruned network from scratch is arguably the most appealing way , owing to its “ end-to-end ” saving potential for the entire training process besides the inference . Due to this reason , we focus on random pruning at initialization ( or sparse training ) in this paper . When new pruning approaches bloom , random pruning naturally becomes their performance ’ s empirical “ lower bound ” since the connections are randomly chosen without any good reasoning . Likely due to the same reason , the results of random pruning at initialization ( as “ easy to beat ” baselines to support fancier new pruning methods ) reported in the literature are unfortunately vague , often inconsistent , and sometimes casual . For instance , it is found in Liu et al . ( 2020b ) that randomly pruned sparse networks can be trained from scratch to match the full accuracy of dense networks with only 20 % parameters , whereas around 80 % parameters are required to do so in Frankle et al . ( 2021 ) . The differences may arise from architecture choices , training recipes , distribution hyperparameters/layer-wise ratios , and so on . In most pruning literature ( Gale et al. , 2019 ; Lee et al. , 2019 ; Frankle et al. , 2021 ; Tanaka et al. , 2020 ) , random pruning usually refers to randomly removing the same proportion of parameters per layer , ending up with uniform layer-wise sparsities . Nevertheless , researchers have explored other pre-defined layer-wise sparsities , e.g. , uniform+ ( Gale et al. , 2019 ) , Erdős-Rényi random graph ( ER ) ( Mocanu et al. , 2018 ) , and Erdős-Rényi-Kernel ( ERK ) ( Evci et al. , 2020a ) . These layerwise sparsities naturally fit the category of random pruning , as they require no training to obtain the corresponding sparsity ratios ( followed by sampling randomly ) . We assess random pruning at initialization with these layer-wise sparsity ratios , in terms of various perspectives besides the predictive accuracy . Our main findings during this course of study are summarized below : • We find that the network size matters for the effectiveness of random pruning at initialization . With small networks , random pruning at initialization hardly matches the full accuracy even at mild sparsities ( 10 % , 20 % ) . However , as the networks grow wider and deeper , the performance of training a randomly pruned sparse network will quickly grow to matching that of its dense equivalent , even at high sparsity ratios . • We further identify that appropriate layer-wise sparsity ratios can be an important booster for the performance of random pruning at initialization , particularly for large networks . We investigate several options to pre-define layer-wise sparsity ratios before any training ; one of them is able to push the performance of a completely random sparse Wide ResNet-50 to the densely trained Wide ResNet-50 on ImageNet . • We systematically assess the performance of random pruning at initialization and are somehow surprised by its accuracy and robustness . The accuracy achieved by ERK ratio can even surpass the ones learned by complex criteria , e.g. , SNIP , GraSP . In addition , randomly pruned sparse networks are found to outperform dense networks in other favorable aspects , such as out-of-distribution ( OoD ) performance , adversarial robustness , and uncertainty estimation . 2 RELATED WORK . 2.1 STATIC SPARSE TRAINING . Static sparse training represents a class of methods that aim to train a sparse subnetwork with a fixed sparse connectivity pattern during the course of training . We divide the static sparse training into random pruning and non-random pruning according to whether the connection is randomly selected . Random Pruning . Static sparse training with random pruning samples masks within each layer in a random fashion based on pre-defined layer-wise sparsities . The most naive approach is pruning each layer uniformly with the same pruning ratio , i.e. , uniform pruning ( Mariet & Sra , 2016. arXiv:1511.05077 ; He et al. , 2017 ; Suau et al. , 2019 ; Gale et al. , 2019 ) . Mocanu et al . ( 2016 ) proposed a non-uniform and scale-free topology , showing better performance than the dense counterpart when applied to restricted Boltzmann machines ( RBMs ) . Later , expander graphs were introduced to build sparse CNNs and showed comparable performance against the corresponding dense CNNs ( Prabhu et al. , 2018 ; Kepner & Robinett , 2019 ) . While not initially designed for static sparse training , ER ( Mocanu et al. , 2018 ) and ERK ( Evci et al. , 2020a ) are two advanced layer-wise sparsities introduced from the field of graph theory with strong results . Non-Random Pruning . Instead of pre-choosing a sparsity ratio for each layer , many works utilize the proposed saliency criteria to learn the layer-wise sparsity ratios before training , also termed as pruning at initialization ( PaI ) . Lee et al . ( 2019 ) first introduced SNIP that chooses structurally important connections at initialization via the proposed connection sensitivity . Following SNIP , many efficient criteria have been proposed to improve the performance of non-random pruning at initialization , including but not limited to gradient flow ( GraSP ; Wang et al . ( 2020 ) ) , synaptic strengths ( SynFlow ; Tanaka et al . ( 2020 ) ) , neural tangent kernel ( Liu & Zenke , 2020 ) , and iterative SNIP ( de Jorge et al. , 2021 ; Verdenius et al. , 2020 ) . 2.2 DYNAMIC SPARSE TRAINING . In contrast to static sparse training , dynamic sparse training stems from randomly initialized sparse subnetworks , and meanwhile dynamically explores new sparse connectivity during training . Dynamic sparse training starts from Sparse Evolutionary Training ( SET ) ( Mocanu et al. , 2018 ; Liu et al. , 2020a ) which initializes the sparse connectivity with Erdős-Rényi ( Erdős & Rényi , 1959 ) topology and periodically explores the sparse connectivity via a prune-and-grow scheme during the course of training . While there exist numerous pruning criteria in the literature , simple magnitude pruning typically performs well in the field of dynamic sparse training . On the other hand , the criteria used to grow weights back differs from method to method , including randomness ( Mocanu et al. , 2018 ; Mostafa & Wang , 2019 ) , momentum ( Dettmers & Zettlemoyer , 2019 ) , gradient ( Evci et al. , 2020a ; Jayakumar et al. , 2020 ; Liu et al. , 2021b ) . Besides the prune-and-grow scheme , layer-wise sparsities are vital to achieving high accuracy . ( Mostafa & Wang , 2019 ; Dettmers & Zettlemoyer , 2019 ) reallocates weights across layers during training based on reasonable heuristics , demonstrating performance improvement . Evci et al . ( 2020a ) extended ER to CNNs and showed considerable performance gains to sparse CNN training with the Erdős-Rényi-Kernel ( ERK ) ratio . Liu et al . ( 2021a ) recently showed that starting from a relatively lower sparsity ( 50 % ) rather than the target sparsity , provides a larger exploration space for DST , enables better sparsity ratios with higher accuracy but fewer FLOPs . Even though dynamic sparse training achieves promising sparse training performance , it changes the sparse connectivity during training and is thus out of the scope of random pruning . The most closely related works of our work are Su et al . ( 2020 ) and Frankle et al . ( 2021 ) . Su et al . ( 2020 ) proposed several sanity-check and showed that SNIP , GraSP , and Lottery Tickets ( LT ) 1 hardly exploit any information from the training data and are very robust to mask shuffling . They further show that random pruning at initialization with hand-designed layer-wise sparsity ratios outperforms or attains a similar performance compared with PaI methods . Frankle et al . ( 2021 ) further confirmed that what PaI discovers are the layer-wise sparsities rather than the specific weights or values , whereas magnitude pruning after training learns both , reflecting a broader challenge inherent to pruning at initialization . While prior works have observed that random pruning can be more competitive in certain cases ( Mocanu et al. , 2018 ; Liu et al. , 2020b ; Su et al. , 2020 ; Frankle et al. , 2021 ) , they did not give principled guidelines on when and how it can become that good ; nor do they show it can match the performance of dense networks on ImageNet . Standing on the shoulders of giants , our work summarized principles by more rigorous studies , and demonstrate the strongest result so far , that randomly pruned sparse Wide ResNet-50 can be sparsely trained to match a dense Wide ResNet-50 , on ImageNet . Moreover , compared with the ad-hoc sparsity ratios used in ( Su et al. , 2020 ) , we show that ERK ( Evci et al. , 2020a ) and our modified ERK+ are more general sparsity ratios that consistently demonstrate competitive performance without careful layer-wise sparsity design for every architecture , while being data free , feed-forward free , and dense initialization free . | This paper investigates the effectiveness of random pruning for sparse training. Specifically, the paper adopted several random pruning methods(ERK, Uniform, Uniform+) and compare the results with non-random Pruning methods(SNIP,GraSP). They are conducted on different ResNet scaling models, with CIFAR-10/100 and ImageNet dataset under different sparsity ratios. Many observations and conclusions were proposed in the experiments. Results show that random pruning can be quite effective for sparse training especially on larger or wider models. In some cases, it can outperform well-versed pruning approaches and match the performance of dense networks. | SP:1a7841538e2d15553c61fbdb9fa6ac0fa4f53728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.