paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
VAE Approximation Error: ELBO and Exponential Families | 1 INTRODUCTION . Variational autoencoders proposed by Kingma & Welling ( 2014 ) strive at learning complex data distributions pd ( x ) , x ∈ X in a generative way . They introduce latent variables z ∈ Z and model the joint distribution as pθ ( x | z ) p ( z ) , where p ( z ) is a simple distribution that is usually assumed to be known . The conditional distribution pθ ( x | z ) , called decoder , is modeled in terms of a deep network parametrized by θ ∈ Θ . Models defined in this way allow to sample from pθ ( x ) = Ep ( z ) pθ ( x | z ) easily , however at the price that computing the posterior pθ ( z |x ) = pθ ( x | z ) p ( z ) /pθ ( x ) is usually intractable . To handle this problem , VAE approximates the posterior pθ ( z |x ) by an amortized inference encoder model qφ ( z |x ) parametrized by φ ∈ Φ . Given the empirical data distribution pd ( x ) , the model is learned by maximizing the evidence lower bound ( ELBO ) of the data loglikelihood L ( θ ) = Epd log pθ ( x ) . It can be expressed in the following two equivalent forms : LB ( θ , φ ) = Epd [ Eqφ log pθ ( x | z ) −DKL ( qφ ( z |x ) ‖ p ( z ) ) ] ( 1a ) = L ( θ ) − Epd [ DKL ( qφ ( z |x ) ‖ pθ ( z |x ) ) ] . ( 1b ) The first form allows for stochastic optimization of ELBO while the second form shows that the gap between log-likelihood and ELBO is exactly the mismatch between the encoder and the posterior . VAEs constitute a powerful deep learning extension of the expectation maximization approach to handle latent variables . They are useful not only as generative models but also , e.g. , in semisupervised learning ( Kingma et al. , 2014 ; Mattei & Frellsen , 2019 ) . Furthermore the encoder part constructs an efficient embedding of the data in the latent space , useful in many applications . The outreach of the VAE approach requires therefore a careful empirical and theoretical analysis of the problems and trade offs involved . The most important ones are ( i ) posterior collapse ( He et al. , 2019 ; Lucas et al. , 2019 ; Dai et al. , 2018 ; Dai & Wipf , 2019 ) and ( ii ) approximation errors caused by an inappropriate choice of the encoder family . The VAE approximation error has been studied ( e.g. , Cremer et al . 2018 ; Hjelm et al . 2016 ; Kim et al . 2018 ) so far mainly empirically . The problem also occurs and is well-recognized in the context of variational inference and variational Bayesian inference , where the target posterior distribution is expected to be complex . It is commonly understood , that the mean field approximation of pθ ( z |x ) by qφ ( z |x ) in ( 1b ) significantly limits variational Bayesian inference . In contrast , in VAEs , the decoder may adopt to compensate for the chosen encoder family . The effect of this coupling , we believe , is not fully understood . The phenomenon of decoder adopting to the posterior was experimentally observed , e.g. , by Cremer et al . ( 2018 , Section 5.4 ) , noting that the approximation error is often dominated by the amortization error . Turner & Sahani ( 2011 , Sec . 1.4 ) analytically show for linear state space models that simpler variational approximations ( such a mean-field ) can lead to less bias in parameter estimation than more complicated structured approximations . Similarly , Shu et al . ( 2018 ) view the VAE objective as providing a regularization and show that making the amortized inference model smoother , while increasing the amortization gap , leads to a better generalization . The common ( empirical ) understanding of the importance of the gap between the approximate and the true posterior has led to many generalizations of standard VAEs , which achieve impressive practical results , notably , tighter bounds using importance weighting ( Burda et al. , 2016 ; Nowozin , 2018 ) , encoders employing normalizing flows ( Rezende & Mohamed , 2015 ; Kingma et al. , 2016 ) , hierarchical and autoregressive encoders ( Vahdat & Kautz , 2020 ; Sønderby et al. , 2016 ; Ranganath et al. , 2016 ) , MRF encoders ( Vahdat et al. , 2020 ) and more . While these extensions mitigate the posterior mismatch problem , they often come at a price of a more difficult training and more expensive inference . Furthermore , simpler encoders may be of practical interest . Burda et al . ( 2016 , Appendix C ) illustrates that IWAE approximate posteriors are less regular and more spread out . In contrast , factorized encoders provide simple embeddings useful for downstream tasks such as semantic hashing ( Chaidaroon & Fang , 2017 ) . The aim of this paper is to study the approximation error of VAEs and its impact on the learned decoder . We consider a setting that generalizes many common VAEs , in particular popular models where encoder and decoder are conditionally independent Bernoulli or Gaussian distributions : we assume that both decoder and encoder are conditional exponential families . We identify the subclass of generative models where the encoder can model the posterior exactly , referred to as consistent VAEs . We give a characterization of consistent VAEs revealing that this set in fact does not depend on the complexity of the involved neural networks . We further show that the ELBO optimizer is pulled towards this set away from the likelihood optimizer . Specializing the characterization to several common VAE models , we show that the respective consistent models turn out to be RBMlike in many cases . We experimentally investigate the detrimental effect in one case and show that a simpler but more consistent VAE can perform better in the other . 2 PROBLEM STATEMENT . We adopt the following notion of approximation error . Consider a generative model class PΘ = { pθ ( x , z ) | θ∈Θ } , the encoder class QΦ = { qφ ( z |x ) | φ∈Φ } and the data distribution pd ( x ) . The maximum likelihood generative model is given by θML ∈ argmaxθ∈Θ Epd ( x ) log pθ ( x ) . For a decoder with parameters θ we define its approximation error as the likelihood difference L ( θML ) − L ( θ ) . Respectively , the VAE approximation error is defined for a given θ as : L ( θML ) −maxφ LB ( θ , φ ) ≥ L ( θML ) − L ( θ ) . ( 2 ) In order for this error to become zero , two conditions are necessary and sufficient : • Parameters ( θ , φ ) must be optimal for the ELBO objective . • ELBO must be tight at ( θ , φ ) , i.e. , LB ( θ , φ ) = L ( θ ) . Assuming that the optimality can be achieved , we study the non-tightness gap L ( θ ) − LB ( θ , φ ) . From ( 1b ) it expresses as Epd [ DKL ( qφ ( z |x ) ‖ pθ ( z |x ) ) ] . It follows that ELBO is tight at ( θ , φ ) iff qφ ( z |x ) ≡ pθ ( z |x ) . Hence , we define the consistent set ΘΦ ⊆ Θ as the subset of distributions pθ ( x , z ) whose posteriors are in QΦ , i.e. , ΘΦ = { θ ∈ Θ ∣∣ ∃φ ∈ Φ : qφ ( z |x ) ≡ pθ ( z |x ) } . ( 3 ) The KL-divergence in the ELBO objective ( 1b ) can vanish only if θ ∈ ΘΦ . If the likelihood maximizer θML is not contained in ΘΦ , then this KL-divergence pulls the optimizer towards ΘΦ and away from θML as illustrated in Fig . 1 . We characterize the consistent set ΘΦ , on which the bound is tight , and show that this set is quite narrow and does not depend on the complexity of the encoder and decoder networks beyond simple 1-layer linear mappings of sufficient statistics . 3 THEORETICAL ANALYSIS . We consider a general class of VAEs , where both encoder and decoder are defined as exponential families . This class includes many common models , in particular Gaussian VAEs and Bernoulli VAEs with conditional independence assumptions , but also more complex ones , e.g. , where the encoder is a conditional random field ( Vahdat et al. , 2020 ) 1 . Assumption 1 ( Exponential family VAE ) . LetX andZ be sets of observations and latent variables , respectively . We consider VAE models defined by pθ ( x | z ) = h ( x ) exp [ 〈ν ( x ) , fθ ( z ) 〉 −A ( fθ ( z ) ) ] ( 4a ) qφ ( z |x ) = h′ ( z ) exp [ 〈ψ ( z ) , gφ ( x ) 〉 −B ( gφ ( x ) ) ] , ( 4b ) where ν : X → Rn and ψ : Z → Rm are fixed sufficient statistics of dimensionality n and m ; fθ : Z → Rn and gφ : X → Rm are the the decoder , resp. , encoder networks , depending on learnable parameters θ , resp . φ ; h : X → R+ , h′ : Z → R+ are strictly positive base measures and A , B denote the respective log-partition functions . Notice that this assumption imposes no restrictions on the nature of random variables x and z . They can be discrete or continuous , univariate or multivariate . Similarly , it imposes no restrictions on the complexity of the decoder and encoder networks fθ ( z ) and gφ ( x ) . Characterization of the consistent set . In the first step of our analysis , we investigate the conditions under which the approximation error of an exponential family VAE can be made exactly zero . As discussed above , a tight VAE ( θ , φ ) must satisfy ∀ ( x , z ) qφ ( z |x ) = pθ ( z |x ) , which leads to the following theorem . Theorem 1 . The consistent set ΘΦ of an exponential family VAE is given by decoders of the form p ( x | z ) = h ( x ) exp [ 〈ν ( x ) , Wψ ( z ) 〉+ 〈ν ( x ) , u〉 −A ( z ) ] , ( 5 ) where W is a n×m matrix and u ∈ Rn . Moreover , the corresponding encoders have the form q ( z |x ) = h′ ( z ) exp [ 〈 ψ ( z ) , WT ν ( x ) 〉 + 〈ψ ( z ) , v〉 −B ( x ) ] , ( 6 ) where v ∈ Rm . This is a direct consequence of a theorem by Arnold & Strauss ( 1991 ) ( see Appendix A.1 for more details ) . For a tight VAE , Theorem 1 states that the decoder and encoder take the form ( 5 ) and ( 6 ) with the interaction between x and z parametrized by a single matrix W instead of the complex neural networks with parameters θ , φ . Thus they turn out to be generalized linear models ( GLMs ) . The corresponding joint probability distribution is an EF Harmonium ( Welling et al. , 2005 ) : p ( x , z ) = h ( x ) h′ ( z ) exp ( 〈ν ( x ) , Wψ ( z ) 〉+ 〈ν ( x ) , u〉+ 〈ψ ( z ) , v〉 −A ) . ( 7 ) 1Notice , however , that this class does not include VAEs with advanced encoder families like normalizing flows , hierarchical and autoregressive encoders . Corollary 1 . The subset ΘΦ of consistent models can not be enlarged by considering more complex encoder networks g ( x ) , provided that the affine family WTν ( x ) can already be represented . Corollary 2 . Let the decoder network family be affine in ψ ( z ) , i.e. , f ( z ) = Wψ ( z ) + a and let the encoder network family g ( x ) include at least all affine maps V ν ( x ) + b . Then any global optimum of ELBO attains a zero approximation error . VAEs can escape consistency when they degenerate to an invertible flow . In practice , VAE models are almost never tight . It is therefore natural to ask , whether a small VAE posterior mismatch error implies closeness of the optimal decoder to some decoder in the consistent set . Definition 1 . A VAE ( pθ , qφ ) is ε-tight for some ε > 0 if Epd ( x ) [ DKL ( qφ ( z |x ) ‖ pθ ( z |x ) ) ] ≤ ε . It turns out that the the KL divergence has a leak , which allows a VAE to approach tightness while not approaching consistency . In the continuous case an example satisfying ε-tightness with non-linear decoder follows from Dai & Wipf ( 2019 , Theorem 2 ) . They show for a class of Gaussian VAEs with general neural networks fθ , gφ , that it is possible to build a sequence of network parameters θt , φt with the following properties : i ) the target distribution is approximated arbitrary well , ii ) the posterior mismatch DKL ( qφt ( z |x ) ‖ pθt ( z |x ) ) approaches zero and iii ) both the encoder and decoder approach deterministic mappings . The VAE thus approaches a flow model ( or invertible neural network ) between the data manifold and a subspace of the latent space ( Dai & Wipf , 2019 ) . Clearly , in a general case the flow must be non-linear . A similar case can be made for discrete variables , see Example A.1 . Non-deterministic nearly-tight VAEs approach consistency . We would however argue that the mode where the decoder and encoder are nearly-deterministic is not a natural VAE solution . By making additional assumptions , excluding such deterministic solutions , and restricting ourselves to the finite space in order to simplify the analysis , we can show that the decoder of an ε-tight VAE does indeed approach a GLM . Theorem 2 . Let ( pθ , qφ ) be an exponential family VAE ( Assumption 1 ) on a discrete space X × Z with strictly positive encoder qφ ( z |x ) and decoder posterior pθ ( z |x ) , both bounded from below by α > 0 . If the VAE is ε-tight , then there exists W ∈ Rn , m such that the decoder can be approximated by a GLM of the form p̃ ( x | z ) = h̃ ( x ) exp [ 〈ν ( x ) , Wψ ( z ) 〉 − Ã ( z ) ] with the error Epd ( x ) [ ( log pθ ( x | z ) − log p̃ ( x | z ) ) 2 ] ≤ ε2α2 + o ( ε ) ∀z ∈ Z . ( 8 ) The proof is given in Appendix A.3 . | The paper studies the VAE approximation error, when the encoder and decoder distributions are from conditional exponential families (EFs). Theorem 1 characterizes the form of the joint probability (an EF-Harmonium) which is consistent, i.e. where q_{phi}(z|x) \equiv p_{theta}(z|x). Sec 4.2 shows a v interesting example of Gaussian VAEs for CelebA images, where it is shown that a VAE "unlearns" the ground truth solution (being pulled away from the likelihood optimizer towards the consistent subset). Sec 4.3 shows another interesting example, where a careful formulation of the model identifies that it should use word counts rather than frequencies, and this is demonstrated empirically (Table 2). | SP:2d237edc34601e158d7ed48ecc72bc873ae5f4dd |
Learning Representation from Neural Fisher Kernel with Low-rank Approximation | 1 INTRODUCTION . Modern deep learning systems rely on finding good representations of data . For supervised learning models with feed forward neural networks , representations can naturally be equated with the activations of each layer . Empirically , the community has developed a set of effective heuristics for representation extraction given a trained network . For example , ResNets ( He et al. , 2016 ) trained on Imagenet classification yield intermediate layer representations that can benefit downstream tasks such as object detection and semantic segmentation . The logits layer of a trained neural network also captures rich correlations across classes which can be distilled to a weaker model ( Knowledge Distillation ) ( Hinton et al. , 2015 ) . Despite empirical prevalence of using intermediate layer activations as data representation , it is far from being the optimal approach to representation extraction . For supervised learning models , it remains a manual procedure that relies on trial and error to select the optimal layer from a pre-trained model to facilitate transfer learning . Similar observations also apply to unsupervised learning models including GANs ( Goodfellow et al. , 2014 ) , VAEs ( Kingma and Welling , 2014 ) , as evident from recent studies ( Chen et al. , 2020a ) that the quality of representation in generative models heavily depends on the choice of layer from which we extract activations as features . Furthermore , although that GANs and VAEs are known to be able to generate high-quality samples from the data distribution , there is no strong evidence that they encode explicit layerwise representations to similar quality as in supervised learning models , which implies that there does not exist a natural way to explicitly extract a representation from intermediate layer activations in unsupervisedly pre-trained generative models . Additionally , layer activations alone do not suffice to reach the full power of learned representations hidden in neural network models , as shown in recent works ( Mu et al. , 2020 ) that incorporating additional gradients-based features into representation leads to substantial improvement over solely using activations-based features . In light of these constraints , we are interested in the question : is there a principled method for representation extraction beyond layer activations ? In this work , we turn to the kernel view of neural networks . Recently , initiated by the Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) work , there have been growing interests in the kernel interpretation of neural networks . It was shown that neural networks in the infinite width regime are reduced to kernel regression with the induced NTK . Our key intuition is that , the kernel machine induced by the neural network provides a powerful and principled way of investigating the non-linear feature transformation in neural networks using the linear feature space of the kernel . Kernel machines provide drastically different representations than layer activations , where the knowledge of a neural network is instantiated by the induced kernel function over data points . In this work , we propose to make use of the linear feature space of the kernel , associated with the pre-trained neural network model , as the data representation of interest . To this end , we made novel contributions on both theoretical and empirical side , as summarized below . • We propose Neural Fisher Kernel ( NFK ) as a unified and principled kernel formulation for neural networks models in both supervised learning and unsupervised learning settings . • We introduce a highly efficient and scalable algorithm for low-rank kernel approximation of NFK , which allows us to obtain a compact yet informative feature embedding as the data representation . • We validate the effectiveness of proposed approach from NFK in unsupervised learning , semisupervised learning and supervised learning settings , showing that our method enjoys superior sample efficiency and representation quality . 2 PRELIMINARY AND RELATED WORKS . In this section , we present technical background and formalize the motivation . We start by introducing the notion of data representation from the perspective of kernel methods , then introduce the connections between neural network models and kernel methods . Notations . Throughout this paper , we consider dataset with N data examples D ≡ { ( xi , yi ) } , we use p ( x ) to denote the probability density function for the data distribution and use pdata ( x ) to denote the empirical data distribution from D. Kernel Methods . Kernel methods ( Hofmann et al. , 2008 ) have long been a staple of practical machine learning . At their core , a kernel method relies on a kernel function which acts as a similarity function between different data examples in some feature space . Here we consider positive definite kernels K : X × X → R over a metric space X which defines a reproducing kernel Hilbert space H of function from X to R , along with a mapping function φ : X → H , such that the kernel function can be decomposed into the inner product K ( x , z ) = ⟨φ ( x ) , φ ( z ) ⟩ . Kernel methods aim to find a predictive linear function f ( x ) = ⟨f , φ ( x ) ⟩H in H , which gives label output prediction for each data point x ∈ X . The kernel maps each data example x ∈ X to a linear feature space φ ( x ) , which is the data representation of interest . Given dataset D , the predictive model function f is typically estimated via Kernel Ridge Regression ( KRR ) , f̂ = argminf∈H 1 N ∑N i=1 ( f ( xi ) − yi ) 2 + λ∥f∥2H . Neural Networks and Kernel Methods . A long line of works ( Neal , 1996 ; Williams , 1996 ; Roux and Bengio , 2007 ; Hazan and Jaakkola , 2015 ; Lee et al. , 2018 ; de G. Matthews et al. , 2018 ; Jacot et al. , 2018 ; Chen and Xu , 2021 ; Geifman et al. , 2020 ; Belkin et al. , 2018 ; Ghorbani et al. , 2020 ) , have studied that many kernel formulations can be associated to neural networks , while most of them correspond to neural network where being fixed kernels ( e.g . Laplace kernel , Gaussian kernel ) or only the last layer is trained , e.g. , Conjugate Kernel ( CK ) ( Daniely et al. , 2016 ) , also called as NNGP kernel ( Lee et al. , 2018 ) . On the other hand , Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) is a fundamentally different formulation corresponding to training the entire infinitely wide neural network models . Let f ( θ ; x ) denote a neural network function with parameters θ , then the empirical NTK is defined as Kntk ( x , z ) = ⟨∇θf ( θ ; x ) , ∇θf ( θ ; z ) ⟩ . ( Jacot et al. , 2018 ; Lee et al. , 2018 ) showed that under the so-called NTK parametrization and other proper assumptios , the function f ( x ; θ ) learned by training the neural network model with gradient descent is equivalent to the function estimated via ridgeless KRR using Kntk as the kernel . For finite-width neural networks , by taking first-order Taylor expansion of funnction f around the θ , kernel regression under Kntk can be seen as linearized neural network model at parameter θ , suggesting that pre-trained neural network models can also be studied and approximated from the perspective of kernel methods . Fisher Kernel . The Fisher Kernel ( FK ) is first introduced in the seminal work ( Jaakkola and Haussler , 1998 ) . Given a probabilistic generative model pθ ( x ) , the Fisher kernel is defined as : Kfisher ( x , z ) = ∇θ log pθ ( x ) ⊤I−1∇θ log pθ ( z ) = U⊤x I−1Uz where Ux = ∇θ log pθ ( x ) is the so-called Fisher score and I is the Fisher Information Matrix ( FIM ) defined as the covariance of the Fisher score : I = Ex∼pθ ( x ) ∇θ log pθ ( x ) ∇θ log pθ ( x ) ⊤ . Then the Fisher vector is defined as Vx = I− 1 2∇θ log pθ ( x ) = I− 1 2Ux . One can utilize the Fisher Score as a mapping from the data space X to parameter space Θ , and obtain representations that are linearized . As proposed in ( Jaakkola and Haussler , 1998 ; Perronnin and Dance , 2007 ) , the Fisher vector Vx can be used as the feature representation derived from probabilistic generative models , which was shown to be superior to hand-crafted visual descriptors in a variety of computer vision tasks . Generative Models In this work , we consider a variety of representative deep generative models , including generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) , variational autoencoders ( VAEs ) ( Kingma and Welling , 2014 ) , as well we normalizing flow models ( Dinh et al. , 2015 ) and auto-regressive models ( van den Oord et al. , 2016 ) . Please refer to ( Salakhutdinov , 2014 ) for more technical details on generative models . 3 LEARNING REPRESENTATION FROM NEURAL FISHER KERNEL . We aim to propose a general and efficient method for extracting high-quality representation from pre-trained neural network models . As formalized in previous section , we can describe the outline of our proposed approach as : given a pre-trained neural network model f ( x ; θ ) ( either unsupervised generative model p ( x ; θ ) or supervised learning model p ( y | x ; θ ) ) , with pre-trained weights θ , we adopt the kernel formulation Kf induced by model f ( x ; θ ) and make use of the associated linear feature embedding φ ( x ) of the kernel Kf as the feature representation of data x . We present an overview introduction to illustrate our approach in Figure . 1 . At this point , however , there exist both theoretical difficulties and practical challenges which impede a straightforward application of our proposed approach . On the theoretical side , the NTK theory is only developed in supervised learning setting , and its extension to unsupervised learning is not established yet . Though Fisher kernel is immediately applicable in unsupervised learning setting , deriving Fisher vector from supervised learning model p ( y | x ; θ ) can be tricky , which needs the log-density estimation of marginal distribution pθ ( x ) from p ( y | x ; θ ) . Note that it is a drastically different problem from previous works ( Achille et al. , 2019 ) where Fisher kernel is applied to the joint distribution over p ( x , y ) . On the practical efficiency side , the dimensionality of the feature space associated with NTK or FK is same as the number of model parameters |θ| , which poses unmanageably high time and space complexity when it comes to modern large-scale neural network models . Additionally , the size of the NTK scales quadratically with the number of classes in multi-class supervised learning setting , which gives rise to more efficiency concerns . To address the kernel formulation issue , we propose Neural Fisher Kernel ( NFK ) in Sec . 3.1 as a unified kernel for both supervised and unsupervised learning models . To tackle the efficiency challenge , we investigate the structural properties of the proposed NFK and propose a highly scalable low-rank kernel approximation algorithm in Sec . 3.2 to extract compact low-dimensional feature representation from NFK . | The paper investigates the representation of modern neural networks from the perspective of kernels by extracting features from pre-trained network models. The authors show the effectiveness of the proposed neural fisher kernel (NFK) for both unsupervised and supervised learning tasks. A low-rank approximation strategy of NFK is adopted to reduce computational burdens. | SP:1a9ccd94a645d76c015a116960899f08d3faaefe |
Learning Representation from Neural Fisher Kernel with Low-rank Approximation | 1 INTRODUCTION . Modern deep learning systems rely on finding good representations of data . For supervised learning models with feed forward neural networks , representations can naturally be equated with the activations of each layer . Empirically , the community has developed a set of effective heuristics for representation extraction given a trained network . For example , ResNets ( He et al. , 2016 ) trained on Imagenet classification yield intermediate layer representations that can benefit downstream tasks such as object detection and semantic segmentation . The logits layer of a trained neural network also captures rich correlations across classes which can be distilled to a weaker model ( Knowledge Distillation ) ( Hinton et al. , 2015 ) . Despite empirical prevalence of using intermediate layer activations as data representation , it is far from being the optimal approach to representation extraction . For supervised learning models , it remains a manual procedure that relies on trial and error to select the optimal layer from a pre-trained model to facilitate transfer learning . Similar observations also apply to unsupervised learning models including GANs ( Goodfellow et al. , 2014 ) , VAEs ( Kingma and Welling , 2014 ) , as evident from recent studies ( Chen et al. , 2020a ) that the quality of representation in generative models heavily depends on the choice of layer from which we extract activations as features . Furthermore , although that GANs and VAEs are known to be able to generate high-quality samples from the data distribution , there is no strong evidence that they encode explicit layerwise representations to similar quality as in supervised learning models , which implies that there does not exist a natural way to explicitly extract a representation from intermediate layer activations in unsupervisedly pre-trained generative models . Additionally , layer activations alone do not suffice to reach the full power of learned representations hidden in neural network models , as shown in recent works ( Mu et al. , 2020 ) that incorporating additional gradients-based features into representation leads to substantial improvement over solely using activations-based features . In light of these constraints , we are interested in the question : is there a principled method for representation extraction beyond layer activations ? In this work , we turn to the kernel view of neural networks . Recently , initiated by the Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) work , there have been growing interests in the kernel interpretation of neural networks . It was shown that neural networks in the infinite width regime are reduced to kernel regression with the induced NTK . Our key intuition is that , the kernel machine induced by the neural network provides a powerful and principled way of investigating the non-linear feature transformation in neural networks using the linear feature space of the kernel . Kernel machines provide drastically different representations than layer activations , where the knowledge of a neural network is instantiated by the induced kernel function over data points . In this work , we propose to make use of the linear feature space of the kernel , associated with the pre-trained neural network model , as the data representation of interest . To this end , we made novel contributions on both theoretical and empirical side , as summarized below . • We propose Neural Fisher Kernel ( NFK ) as a unified and principled kernel formulation for neural networks models in both supervised learning and unsupervised learning settings . • We introduce a highly efficient and scalable algorithm for low-rank kernel approximation of NFK , which allows us to obtain a compact yet informative feature embedding as the data representation . • We validate the effectiveness of proposed approach from NFK in unsupervised learning , semisupervised learning and supervised learning settings , showing that our method enjoys superior sample efficiency and representation quality . 2 PRELIMINARY AND RELATED WORKS . In this section , we present technical background and formalize the motivation . We start by introducing the notion of data representation from the perspective of kernel methods , then introduce the connections between neural network models and kernel methods . Notations . Throughout this paper , we consider dataset with N data examples D ≡ { ( xi , yi ) } , we use p ( x ) to denote the probability density function for the data distribution and use pdata ( x ) to denote the empirical data distribution from D. Kernel Methods . Kernel methods ( Hofmann et al. , 2008 ) have long been a staple of practical machine learning . At their core , a kernel method relies on a kernel function which acts as a similarity function between different data examples in some feature space . Here we consider positive definite kernels K : X × X → R over a metric space X which defines a reproducing kernel Hilbert space H of function from X to R , along with a mapping function φ : X → H , such that the kernel function can be decomposed into the inner product K ( x , z ) = ⟨φ ( x ) , φ ( z ) ⟩ . Kernel methods aim to find a predictive linear function f ( x ) = ⟨f , φ ( x ) ⟩H in H , which gives label output prediction for each data point x ∈ X . The kernel maps each data example x ∈ X to a linear feature space φ ( x ) , which is the data representation of interest . Given dataset D , the predictive model function f is typically estimated via Kernel Ridge Regression ( KRR ) , f̂ = argminf∈H 1 N ∑N i=1 ( f ( xi ) − yi ) 2 + λ∥f∥2H . Neural Networks and Kernel Methods . A long line of works ( Neal , 1996 ; Williams , 1996 ; Roux and Bengio , 2007 ; Hazan and Jaakkola , 2015 ; Lee et al. , 2018 ; de G. Matthews et al. , 2018 ; Jacot et al. , 2018 ; Chen and Xu , 2021 ; Geifman et al. , 2020 ; Belkin et al. , 2018 ; Ghorbani et al. , 2020 ) , have studied that many kernel formulations can be associated to neural networks , while most of them correspond to neural network where being fixed kernels ( e.g . Laplace kernel , Gaussian kernel ) or only the last layer is trained , e.g. , Conjugate Kernel ( CK ) ( Daniely et al. , 2016 ) , also called as NNGP kernel ( Lee et al. , 2018 ) . On the other hand , Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) is a fundamentally different formulation corresponding to training the entire infinitely wide neural network models . Let f ( θ ; x ) denote a neural network function with parameters θ , then the empirical NTK is defined as Kntk ( x , z ) = ⟨∇θf ( θ ; x ) , ∇θf ( θ ; z ) ⟩ . ( Jacot et al. , 2018 ; Lee et al. , 2018 ) showed that under the so-called NTK parametrization and other proper assumptios , the function f ( x ; θ ) learned by training the neural network model with gradient descent is equivalent to the function estimated via ridgeless KRR using Kntk as the kernel . For finite-width neural networks , by taking first-order Taylor expansion of funnction f around the θ , kernel regression under Kntk can be seen as linearized neural network model at parameter θ , suggesting that pre-trained neural network models can also be studied and approximated from the perspective of kernel methods . Fisher Kernel . The Fisher Kernel ( FK ) is first introduced in the seminal work ( Jaakkola and Haussler , 1998 ) . Given a probabilistic generative model pθ ( x ) , the Fisher kernel is defined as : Kfisher ( x , z ) = ∇θ log pθ ( x ) ⊤I−1∇θ log pθ ( z ) = U⊤x I−1Uz where Ux = ∇θ log pθ ( x ) is the so-called Fisher score and I is the Fisher Information Matrix ( FIM ) defined as the covariance of the Fisher score : I = Ex∼pθ ( x ) ∇θ log pθ ( x ) ∇θ log pθ ( x ) ⊤ . Then the Fisher vector is defined as Vx = I− 1 2∇θ log pθ ( x ) = I− 1 2Ux . One can utilize the Fisher Score as a mapping from the data space X to parameter space Θ , and obtain representations that are linearized . As proposed in ( Jaakkola and Haussler , 1998 ; Perronnin and Dance , 2007 ) , the Fisher vector Vx can be used as the feature representation derived from probabilistic generative models , which was shown to be superior to hand-crafted visual descriptors in a variety of computer vision tasks . Generative Models In this work , we consider a variety of representative deep generative models , including generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) , variational autoencoders ( VAEs ) ( Kingma and Welling , 2014 ) , as well we normalizing flow models ( Dinh et al. , 2015 ) and auto-regressive models ( van den Oord et al. , 2016 ) . Please refer to ( Salakhutdinov , 2014 ) for more technical details on generative models . 3 LEARNING REPRESENTATION FROM NEURAL FISHER KERNEL . We aim to propose a general and efficient method for extracting high-quality representation from pre-trained neural network models . As formalized in previous section , we can describe the outline of our proposed approach as : given a pre-trained neural network model f ( x ; θ ) ( either unsupervised generative model p ( x ; θ ) or supervised learning model p ( y | x ; θ ) ) , with pre-trained weights θ , we adopt the kernel formulation Kf induced by model f ( x ; θ ) and make use of the associated linear feature embedding φ ( x ) of the kernel Kf as the feature representation of data x . We present an overview introduction to illustrate our approach in Figure . 1 . At this point , however , there exist both theoretical difficulties and practical challenges which impede a straightforward application of our proposed approach . On the theoretical side , the NTK theory is only developed in supervised learning setting , and its extension to unsupervised learning is not established yet . Though Fisher kernel is immediately applicable in unsupervised learning setting , deriving Fisher vector from supervised learning model p ( y | x ; θ ) can be tricky , which needs the log-density estimation of marginal distribution pθ ( x ) from p ( y | x ; θ ) . Note that it is a drastically different problem from previous works ( Achille et al. , 2019 ) where Fisher kernel is applied to the joint distribution over p ( x , y ) . On the practical efficiency side , the dimensionality of the feature space associated with NTK or FK is same as the number of model parameters |θ| , which poses unmanageably high time and space complexity when it comes to modern large-scale neural network models . Additionally , the size of the NTK scales quadratically with the number of classes in multi-class supervised learning setting , which gives rise to more efficiency concerns . To address the kernel formulation issue , we propose Neural Fisher Kernel ( NFK ) in Sec . 3.1 as a unified kernel for both supervised and unsupervised learning models . To tackle the efficiency challenge , we investigate the structural properties of the proposed NFK and propose a highly scalable low-rank kernel approximation algorithm in Sec . 3.2 to extract compact low-dimensional feature representation from NFK . | The paper proposes a new strategy for extracting compact and intuitive representations of the data from a neural network. The approach exploits the feature map associated with the kernel representation of a neural network. In particular, the authors consider the Neural Fisher Kernel and propose a series of linear approximations to make their approach scalable. | SP:1a9ccd94a645d76c015a116960899f08d3faaefe |
Adversarial Collaborative Learning on Non-IID Features | 1 INTRODUCTION . Deep learning is data hungry . While data are always dispersed in multiple parties ( e.g. , mobile devices , hospitals ) in reality , data are not allowed to transfer to a central server for training due to privacy concerns and data regulations . Collaborative learning among multiple parties without the exchange of raw data has been an important machine learning topic . Federated learning ( McMahan et al. , 2016 ; Kairouz et al. , 2019 ; Li et al. , 2019b ; a ) has been a popular form of collaborative learning without exchanging raw data . A basic federated learning framework is FedAvg ( McMahan et al. , 2016 ) , which uses a model-averaging scheme . In each round , the parties update their local models and send them to the server . The server averages all local models to update the global model , which is sent back to the parties as the new local model in the next round . FedAvg has been widely used due to its effectiveness and simpleness . Most existing federated learning approaches are designed based on FedAvg . However , as shown in many existing studies ( Hsu et al. , 2019 ; Li et al. , 2020 ; Wang et al. , 2020b ; Karimireddy et al. , 2020 ; Acar et al. , 2021 ; Li et al. , 2021b ) , the performance of FedAvg and its alike algorithms may be significantly degraded in non-IID data among parties . While many studies try to improve FedAvg on non-IID data , most of them ( Li et al. , 2020 ; Wang et al. , 2020b ; Karimireddy et al. , 2020 ; Acar et al. , 2021 ; Li et al. , 2021a ; Wang et al. , 2020a ) focus on the label imbalance setting , where the parties have different label distributions . In their experiments , they usually simulate the federated setting by unbalanced partitioning the dataset into multiple subsets according to the labels . As summarized in ( Hsieh et al. , 2020 ; Kairouz et al. , 2019 ) , besides the label distribution skew , feature imbalance is also an important case of non-IID data . In the feature imbalance setting , the feature distribution Pi ( x ) varies across parties . This setting widely exists in reality , e.g. , people have different stroke width and slant when writing the same word . Another example in practice is that medical images of different hospitals have different intensity and contrast . However , compared with non-IID labels , federated learning on non-IID features has been less explored . Since the feature distributions are different across parties , there exists bias in the local training . It is challenging to mitigate the bias while exploiting the heterogeneous feature distributions in the training . In this paper , we think out of the model-averaging scheme used in federated learning , and propose a novel learning concept called adversarial collaborative learning . While the feature distribution of each party is different , to mitigate the local bias , we aim to learn a common representation distribution among parties . Specifically , the server aims to train a discriminator to distinguish the local representations by the party IDs , while the parties train the local models such that the generated representations can not be distinguished by the discriminator . Our experiments show that ADCOL outperforms state-of-the-art federated learning algorithms ( Li et al. , 2021b ; 2020 ; Fallah et al. , 2020 ; Collins et al. , 2021 ) on three real-world tasks . More importantly , ADCOL points out a promising research direction on collaborative learning . Inspired by our idea of conducting collaborative learning in an adversarial way , we believe there will be more interesting future works in this direction . 2 BACKGROUND AND RELATED WORK . 2.1 NON-IID DATA . We use Pi ( x , y ) to denote the data distribution of party i , where x is the features and y is the label . According to existing studies ( Kairouz et al. , 2019 ; Hsieh et al. , 2020 ) , we can categorize non-IID data in federated learning into the following four classes : ( 1 ) non-IID labels : the marginal distribution Pi ( y ) varies across parties . ( 2 ) non-IID features : the marginal distribution Pi ( x ) varies across parties . ( 3 ) concept drift : The conditional distributions Pi ( y|x ) or Pi ( x|y ) varies across parties . ( 4 ) quantity skew : the amount of data varies across parties . In this paper , we focus on non-IID features , which widely exist in reality . For example , while the pneumonia distribution of patients may be close among different hospitals , the distributions of CT images ( such as resolution , color , length and width ) may vary across hospitals , which are collected from different equipment and environments . 2.2 FEDERATED LEARNING ON NON-IID LABELS . Non-IID data is a key challenge in federated learning . There have been many studies trying to improve the performance of federated learning under non-IID data . However , most existing studies ( Li et al. , 2020 ; Wang et al. , 2020a ; Hsu et al. , 2019 ; Li et al. , 2021a ; Acar et al. , 2021 ; Karimireddy et al. , 2020 ) focus on label imbalance , where they usually simulate the federated setting with heterogeneous label distributions in the experiments . For example , FedProx ( Li et al. , 2020 ) introduces a proximal term in the objective of local training , which limits the update of the local model by the distance between the local model and the global model . FedMA ( Wang et al. , 2020a ) applies Bayesian non-parametric methods to update the global model in a layer-wise manner in the model aggregation phase . FedDyn ( Acar et al. , 2021 ) introduces a dynamic regularization term in the local training based on the global model and the local model from the previous round . More recently , MOON ( Li et al. , 2021a ) proposes model-contrastive federated learning , which corrects the local training by a contrastive loss which maximizes the agreement between the representation learned by the global model and the representation learned by the local model . As we will show in the experiments , existing algorithms have severe performance degradation on parties with non-IID features . More recently , a contemporary study ( Zhang et al. , 2021a ) proposed FedUFO , where each party trains a discriminator to apply feature and objective consistency constrains to address the non-IID data issue . However , FedUFO needs to transfer each local model to all the other parties , which causes massive communication overhead . Moreover , FedUFO is still based on FedAvg , while we propose a novel new collaborative training scheme based on adversarial training in this paper . 2.3 FEDERATED LEARNING ON NON-IID FEATURES . To the best of our knowledge , there is only one study named FedBN ( Li et al. , 2021b ) that focuses on non-IID features . FedBN introduces lightweight modifications on FedAvg . Instead of transferring and averaging all model parameters in FedAvg , FedBN keeps all the local batch normalization parameters and does not synchronize them with the global model . The operations for non-batch normalization parameters are the same as FedAvg . Our proposed ADCOL is based on a novel approach : adversarial learning for a common representation among multiple parties . ADCOL outperforms FedBN on three real-world datasets in both accuracy and communication-efficiency . 2.4 PERSONALIZED FEDERATED LEARNING . There are basically two kinds of objective in federated learning : learning a single global model or learning a personalized local model for each party ( i.e. , personalized federated learning ( Fallah et al. , 2020 ; Dinh et al. , 2020 ; Hanzely et al. , 2020 ; Zhang et al. , 2021b ; Huang et al. , 2021 ; Collins et al. , 2021 ) ) . When the training data is non-IID across parties , personalized federated learning is reasonable since a single global model may not be good for every local distribution . In this paper , same as FedBN , ADCOL is designed under the personalized federated learning setting , i.e. , each party aims to learn a local model for its own local task . 3 METHOD . 3.1 PROBLEM STATEMENT . Suppose there are N parties , where party i has a local datasetDi = { xi , yi } . The feature distributions P ( xi ) are different among parties while the label distributions P ( yi ) are similar among parties . The parties conduct collaborative learning over D ≜ ⋃ i∈ [ N ] Di with the help of a central server without exchanging the raw data . The goal of each party is to train a machine learning model which has good accuracy on its local test dataset . 3.2 MOTIVATION . The key idea of ADCOL is intuitive . While the feature distributions are different among parties , to mitigate the local bias , ADCOL aims to learn a common task-specific representation distribution . Inspired by GANs ( Goodfellow et al. , 2014 ) and adversarial learning for distribution matching ( Tzeng et al. , 2017 ; Peng et al. , 2019b ) , ADCOL adopts an adversarial way to restrict the representation distribution . Next we explain the motivation from a distribution perspective . The ultimate goal of each party in typical federated learning is to learn the oracle optimal distribution p∗ ( y|x ) . Here we introduce the representation z of the data x , which is supposed to be sufficient for the prediction of labels y ( Federici et al. , 2020 ) . Then , x , y , and z forms a Markov chain x→ z→ y . Thus , we decomposite the oracle optimal into two parts : p∗ ( z|x ) and p∗ ( y|z ) . The first part is to learn a good representation and the second part is to predict the label by the representation with simple linear layers . To learn the optimal representation distribution p∗ ( z|x ) , the objective of each party is min θi Ex∼DiℓKL ( p ( z|x ; θi ) || p∗ ( z|x ) ) , ( 1 ) where ℓKL is the KL divergence loss . We adopt KL divergence due to its popularity for evaluating the distance between probability distributions . However , the optimal representation distribution is unknown . Thus , we approximate the objective by two aspects : 1 ) By training in a novel adversarial way , we use the similarity between the representations of different parties to regularize the representation , i.e. , the parties learn a common representation z . 2 ) We ensure that the generated representation contains necessary information for the prediction of y by training on the labeled local data . Next , we describe our model architecture and training algorithm in details . 3.3 MODEL ARCHITECTURE . There are two kinds of models in ADCOL : the local models trained in the parties and the discriminator trained in the server . As ADCOL works from the perspective of representation , the architecture of the local model is similar as existing studies ( Chen et al. , 2020 ; He et al. , 2020 ; Chen and He , 2021 ) on self-supervised representation learning . The local model has three components : a base encoder , a projection head , and a predictor . The base encoder ( e.g. , ResNet-50 ) extracts representation vectors from inputs . Like SimCLR ( Chen et al. , 2020 ) and SimSam ( Chen and He , 2021 ) , an additional projection head is introduced to map the representation to a space with a fixed dimension . The final predictor is used to output predicted probabilities for each class . For ease of presentation , we use F ( · ) to denote the whole model and G ( · ) to denote the model before the predictor ( i.e. , G ( x ) is the mapped representation vector of input x ) . For the discriminator , we simply use a multi-layer perceptron in our experiments . … discriminator server ( a ) Step 1 : The server sends the discriminator to the parties . Representations discriminator targetsoutputs ℓ ! '' 1 𝑁ℓ # $ Base encoder Projection head Predictor ( b ) Step 2 : The parties update their local models Representations Representations … server ( c ) Step 3 : The parties send representations to the server . Representations Representations Representations … discriminator 1 2 N targetsoutputs ℓ ! '' … … ( d ) Step 4 : The server updates the discriminator . Figure 1 : The ADCOL framework | This paper focuses on federated learning on non-IID features. This is a crucial problem when applying federated learning. The authors propose a new federated learning scheme, called ADCOL (Adversarial Collaborative Learning) for non-IID features. Specifically, the server is designed to train a discriminator to distinguish the local representations from local parties. While the local parties train the local models and expect the representations not to be distinguished by the discriminator. Authors conduct experiments on multiple parties where the data have heterogeneous features but share the same labels and label distribution and the results clearly show the effectiveness. | SP:8347824ba3fc1c854115f6a776ac159d9978071a |
Adversarial Collaborative Learning on Non-IID Features | 1 INTRODUCTION . Deep learning is data hungry . While data are always dispersed in multiple parties ( e.g. , mobile devices , hospitals ) in reality , data are not allowed to transfer to a central server for training due to privacy concerns and data regulations . Collaborative learning among multiple parties without the exchange of raw data has been an important machine learning topic . Federated learning ( McMahan et al. , 2016 ; Kairouz et al. , 2019 ; Li et al. , 2019b ; a ) has been a popular form of collaborative learning without exchanging raw data . A basic federated learning framework is FedAvg ( McMahan et al. , 2016 ) , which uses a model-averaging scheme . In each round , the parties update their local models and send them to the server . The server averages all local models to update the global model , which is sent back to the parties as the new local model in the next round . FedAvg has been widely used due to its effectiveness and simpleness . Most existing federated learning approaches are designed based on FedAvg . However , as shown in many existing studies ( Hsu et al. , 2019 ; Li et al. , 2020 ; Wang et al. , 2020b ; Karimireddy et al. , 2020 ; Acar et al. , 2021 ; Li et al. , 2021b ) , the performance of FedAvg and its alike algorithms may be significantly degraded in non-IID data among parties . While many studies try to improve FedAvg on non-IID data , most of them ( Li et al. , 2020 ; Wang et al. , 2020b ; Karimireddy et al. , 2020 ; Acar et al. , 2021 ; Li et al. , 2021a ; Wang et al. , 2020a ) focus on the label imbalance setting , where the parties have different label distributions . In their experiments , they usually simulate the federated setting by unbalanced partitioning the dataset into multiple subsets according to the labels . As summarized in ( Hsieh et al. , 2020 ; Kairouz et al. , 2019 ) , besides the label distribution skew , feature imbalance is also an important case of non-IID data . In the feature imbalance setting , the feature distribution Pi ( x ) varies across parties . This setting widely exists in reality , e.g. , people have different stroke width and slant when writing the same word . Another example in practice is that medical images of different hospitals have different intensity and contrast . However , compared with non-IID labels , federated learning on non-IID features has been less explored . Since the feature distributions are different across parties , there exists bias in the local training . It is challenging to mitigate the bias while exploiting the heterogeneous feature distributions in the training . In this paper , we think out of the model-averaging scheme used in federated learning , and propose a novel learning concept called adversarial collaborative learning . While the feature distribution of each party is different , to mitigate the local bias , we aim to learn a common representation distribution among parties . Specifically , the server aims to train a discriminator to distinguish the local representations by the party IDs , while the parties train the local models such that the generated representations can not be distinguished by the discriminator . Our experiments show that ADCOL outperforms state-of-the-art federated learning algorithms ( Li et al. , 2021b ; 2020 ; Fallah et al. , 2020 ; Collins et al. , 2021 ) on three real-world tasks . More importantly , ADCOL points out a promising research direction on collaborative learning . Inspired by our idea of conducting collaborative learning in an adversarial way , we believe there will be more interesting future works in this direction . 2 BACKGROUND AND RELATED WORK . 2.1 NON-IID DATA . We use Pi ( x , y ) to denote the data distribution of party i , where x is the features and y is the label . According to existing studies ( Kairouz et al. , 2019 ; Hsieh et al. , 2020 ) , we can categorize non-IID data in federated learning into the following four classes : ( 1 ) non-IID labels : the marginal distribution Pi ( y ) varies across parties . ( 2 ) non-IID features : the marginal distribution Pi ( x ) varies across parties . ( 3 ) concept drift : The conditional distributions Pi ( y|x ) or Pi ( x|y ) varies across parties . ( 4 ) quantity skew : the amount of data varies across parties . In this paper , we focus on non-IID features , which widely exist in reality . For example , while the pneumonia distribution of patients may be close among different hospitals , the distributions of CT images ( such as resolution , color , length and width ) may vary across hospitals , which are collected from different equipment and environments . 2.2 FEDERATED LEARNING ON NON-IID LABELS . Non-IID data is a key challenge in federated learning . There have been many studies trying to improve the performance of federated learning under non-IID data . However , most existing studies ( Li et al. , 2020 ; Wang et al. , 2020a ; Hsu et al. , 2019 ; Li et al. , 2021a ; Acar et al. , 2021 ; Karimireddy et al. , 2020 ) focus on label imbalance , where they usually simulate the federated setting with heterogeneous label distributions in the experiments . For example , FedProx ( Li et al. , 2020 ) introduces a proximal term in the objective of local training , which limits the update of the local model by the distance between the local model and the global model . FedMA ( Wang et al. , 2020a ) applies Bayesian non-parametric methods to update the global model in a layer-wise manner in the model aggregation phase . FedDyn ( Acar et al. , 2021 ) introduces a dynamic regularization term in the local training based on the global model and the local model from the previous round . More recently , MOON ( Li et al. , 2021a ) proposes model-contrastive federated learning , which corrects the local training by a contrastive loss which maximizes the agreement between the representation learned by the global model and the representation learned by the local model . As we will show in the experiments , existing algorithms have severe performance degradation on parties with non-IID features . More recently , a contemporary study ( Zhang et al. , 2021a ) proposed FedUFO , where each party trains a discriminator to apply feature and objective consistency constrains to address the non-IID data issue . However , FedUFO needs to transfer each local model to all the other parties , which causes massive communication overhead . Moreover , FedUFO is still based on FedAvg , while we propose a novel new collaborative training scheme based on adversarial training in this paper . 2.3 FEDERATED LEARNING ON NON-IID FEATURES . To the best of our knowledge , there is only one study named FedBN ( Li et al. , 2021b ) that focuses on non-IID features . FedBN introduces lightweight modifications on FedAvg . Instead of transferring and averaging all model parameters in FedAvg , FedBN keeps all the local batch normalization parameters and does not synchronize them with the global model . The operations for non-batch normalization parameters are the same as FedAvg . Our proposed ADCOL is based on a novel approach : adversarial learning for a common representation among multiple parties . ADCOL outperforms FedBN on three real-world datasets in both accuracy and communication-efficiency . 2.4 PERSONALIZED FEDERATED LEARNING . There are basically two kinds of objective in federated learning : learning a single global model or learning a personalized local model for each party ( i.e. , personalized federated learning ( Fallah et al. , 2020 ; Dinh et al. , 2020 ; Hanzely et al. , 2020 ; Zhang et al. , 2021b ; Huang et al. , 2021 ; Collins et al. , 2021 ) ) . When the training data is non-IID across parties , personalized federated learning is reasonable since a single global model may not be good for every local distribution . In this paper , same as FedBN , ADCOL is designed under the personalized federated learning setting , i.e. , each party aims to learn a local model for its own local task . 3 METHOD . 3.1 PROBLEM STATEMENT . Suppose there are N parties , where party i has a local datasetDi = { xi , yi } . The feature distributions P ( xi ) are different among parties while the label distributions P ( yi ) are similar among parties . The parties conduct collaborative learning over D ≜ ⋃ i∈ [ N ] Di with the help of a central server without exchanging the raw data . The goal of each party is to train a machine learning model which has good accuracy on its local test dataset . 3.2 MOTIVATION . The key idea of ADCOL is intuitive . While the feature distributions are different among parties , to mitigate the local bias , ADCOL aims to learn a common task-specific representation distribution . Inspired by GANs ( Goodfellow et al. , 2014 ) and adversarial learning for distribution matching ( Tzeng et al. , 2017 ; Peng et al. , 2019b ) , ADCOL adopts an adversarial way to restrict the representation distribution . Next we explain the motivation from a distribution perspective . The ultimate goal of each party in typical federated learning is to learn the oracle optimal distribution p∗ ( y|x ) . Here we introduce the representation z of the data x , which is supposed to be sufficient for the prediction of labels y ( Federici et al. , 2020 ) . Then , x , y , and z forms a Markov chain x→ z→ y . Thus , we decomposite the oracle optimal into two parts : p∗ ( z|x ) and p∗ ( y|z ) . The first part is to learn a good representation and the second part is to predict the label by the representation with simple linear layers . To learn the optimal representation distribution p∗ ( z|x ) , the objective of each party is min θi Ex∼DiℓKL ( p ( z|x ; θi ) || p∗ ( z|x ) ) , ( 1 ) where ℓKL is the KL divergence loss . We adopt KL divergence due to its popularity for evaluating the distance between probability distributions . However , the optimal representation distribution is unknown . Thus , we approximate the objective by two aspects : 1 ) By training in a novel adversarial way , we use the similarity between the representations of different parties to regularize the representation , i.e. , the parties learn a common representation z . 2 ) We ensure that the generated representation contains necessary information for the prediction of y by training on the labeled local data . Next , we describe our model architecture and training algorithm in details . 3.3 MODEL ARCHITECTURE . There are two kinds of models in ADCOL : the local models trained in the parties and the discriminator trained in the server . As ADCOL works from the perspective of representation , the architecture of the local model is similar as existing studies ( Chen et al. , 2020 ; He et al. , 2020 ; Chen and He , 2021 ) on self-supervised representation learning . The local model has three components : a base encoder , a projection head , and a predictor . The base encoder ( e.g. , ResNet-50 ) extracts representation vectors from inputs . Like SimCLR ( Chen et al. , 2020 ) and SimSam ( Chen and He , 2021 ) , an additional projection head is introduced to map the representation to a space with a fixed dimension . The final predictor is used to output predicted probabilities for each class . For ease of presentation , we use F ( · ) to denote the whole model and G ( · ) to denote the model before the predictor ( i.e. , G ( x ) is the mapped representation vector of input x ) . For the discriminator , we simply use a multi-layer perceptron in our experiments . … discriminator server ( a ) Step 1 : The server sends the discriminator to the parties . Representations discriminator targetsoutputs ℓ ! '' 1 𝑁ℓ # $ Base encoder Projection head Predictor ( b ) Step 2 : The parties update their local models Representations Representations … server ( c ) Step 3 : The parties send representations to the server . Representations Representations Representations … discriminator 1 2 N targetsoutputs ℓ ! '' … … ( d ) Step 4 : The server updates the discriminator . Figure 1 : The ADCOL framework | This paper studies federated learning when different devices have non-iid features. To address the heterogeneity problem, it proposes a federated learning scheme called ADCOL based on adversarial learning. In ADCOL, the devices transfer local representations to the server while sending the discriminator to the devices. The server aims to distinguish the devices' local representations, while the devices aim to train local models that generate non-distinguishable representations. To make the representations non-distinguishable, ADCOL adds an additional regularization term to the devices' loss functions. This practice aims to maximize the probability that the discriminator cannot distinguish the local representations. The experimental results show that the proposed method has some advantages over several baselines. | SP:8347824ba3fc1c854115f6a776ac159d9978071a |
Discovering Invariant Rationales for Graph Neural Networks | 1 INTRODUCTION . The eye-catching success in graph neural networks ( GNNs ) ( Hamilton et al. , 2017 ; Kipf & Welling , 2017 ; Dwivedi et al. , 2020 ) provokes the rationalization task , answering “ What knowledge drives the model to make certain predictions ? ” . The goal of selective rationalization ( aka . feature attribution ) ( Chang et al. , 2020 ; Ying et al. , 2019 ; Luo et al. , 2020 ; Wang et al. , 2021c ) is to find a small subset of the input ’ s graph features — rationale — which best guides or explains the model prediction . Discovering the rationale in a model helps audit its inner workings and justify its predictions . Moreover , it has tremendous impacts on real-world applications , such as finding functional groups to shed light on protein structure prediction ( Senior et al. , 2020 ) . Two research lines of rationalization have recently emerged in GNNs . Post-hoc explainability ( Ying et al. , 2019 ; Luo et al. , 2020 ; Yuan et al. , 2021 ; Wang et al. , 2021c ) attributes a model ’ s prediction to the input graph with a separate explanation method , while intrinsic interpretability ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) incorporates a rationalization module into the model to make transparent predictions . Here we focus on intrinsically interpretable GNNs . Among them , graph attention ( Veličković et al. , 2018 ) and pooling ( Lee et al. , 2019 ; Knyazev et al. , 2019 ; Gao & Ji , 2019 ; Ranjan et al. , 2020 ) operators prevail , which work as a computational block of a GNN to generate soft or hard masks on the input graph . They cast the learning paradigm of GNN as minimizing the empirical risk with the masked subgraphs , which are regarded as rationales to guide the model predictions . Despite the appealing nature , recent studies ( Chang et al. , 2020 ; Knyazev et al. , 2019 ) show that the current rationalization methods are prone to ∗Corresponding author . exploit data biases as shortcuts to make predictions and compose rationales . Typically , shortcuts result from confounding factors , sampling biases , and artifacts in the training data . Considering Figure 1 , when the most bases of House-motif graphs are Tree , a GNN does not need to learn the correct function to reach high accuracy for the motif type . Instead , it is much easier to learn from the statistical shortcuts linking the bases Tree with the most occurring motifs House . Unfortunately , when facing with out-of-distribution ( OOD ) data , such methods generalize poorly since the shortcuts are changed . Hence , such shortcut-involved rationales hardly reveal the truly critical subgraphs for the predicted labels , being at odds with the true reasoning process that underlies the task of interest ( Teney et al. , 2020 ) and human cognition ( Alvarez-Melis & Jaakkola , 2017 ) . Here we ascribe the failure on OOD data to the inability to identify causal patterns , which are stable to distribution shift . Motivated by recent studies on invariant learning ( IL ) ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Chang et al. , 2020 ; Bühlmann , 2018 ) , we premise different distributions elicit different environments of data generating process . We argue that the causal patterns to the labels remain stable across environments , while the relations between the shortcut patterns and the labels vary . Such environment-invariant patterns are more plausible and qualified as rationales . Aiming to identify rationales that capture the environment-invariant causal patterns , we formalize a learning strategy , Discovering Invariant Rationales ( DIR ) , for intrinsically interpretable GNNs . One major problem is how to get multiple environments from a standard training set . Differing from the heterogeneous setting ( Bühlmann , 2018 ) of existing IL methods , where environments are observable and attainable , DIR does not assume prophets about environments . It instead generates distribution perturbations by causal intervention — interventional distributions ( Tian et al. , 2006 ; Pearl et al. , 2016 ) — to instantiate environments and further distinguish the causal and non-causal parts . Guided by this idea , our DIR strategy consists of four modules : a rationale generator , a distribution intervener , a feature encoder , two classifiers . Specifically , the rationale generator learns to split the input graph into causal and non-causal subgraphs , which are respectively encoded by the encoder into representations . Then , the distribution intervener conducts the causal interventions on the non-causal representations to create perturbed distributions , with which we can infer the invariant causal parts . Then , the two classifiers are respectively built upon the causal and non-causal parts to generate the joint prediction , whose invariant risk is minimized across different distributions . On one synthetic and three real datasets , extensive experiments demonstrate the generalization ability of DIR to surpass current state-of-the-art IL methods ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Sagawa et al. , 2019 ) , and the interpretability of DIR to outperform the attention- and pooling-based rationalization methods ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) . Our main contributions are : • We propose a novel invariant learning algorithm , DIR , for inherent interpretable models , improving the generalization ability and is suitable for any deep models . • We offer causality theoretic analysis to guarantee the preeminence of DIR . • We provide the implementation of DIR for graph classification tasks , which consistently achieves excellent performance on three datasets with various generalization types . 2 INVARIANT RATIONALE DISCOVERY . With a causal look at the data-generating process , we formalize the principle of discovering invariant rationales , which guides our discovery strategy . Throughout the paper , upper-cased letters like G denote random variables , while lower-case letters like g denote deterministic value of variables . 2.1 CAUSAL VIEW OF DATA-GENERATING PROCESS . Generating rationales for transparent predictions requires understanding the actual mechanisms of the task of interest . Without loss of generality , we focus on the graph classification task and present a causal view of the data-generating process behind this task . Here we formalize the causal view as a Structure Causal Model ( SCM ) ( Pearl et al. , 2016 ; Pearl , 2000 ) by inspecting on the causalities among four variables : input graph G , ground-truth label Y , causal part C , non-causal part S. Figure 2a illustrates the SCM , where each link denotes a causal relationship between two variables . • C → G ← S. The input graph G consists of two disjoint parts : the causal part C and the non-causal part S , such as the House motif and the Tree base in Figure 1 . Published as a conference paper at ICLR 2022 𝑺 𝒀 𝑮 𝑪 𝑮 𝑺 𝑪 𝒀 House Cycle Crane House Cycle Crane … ( b ) Illustration of Constructing Interventional Distributions House Cycle Crane 𝒅𝒐 ( 𝑺 = ∅ ) ∅ 𝒅𝒐 ( 𝑺 = ) 𝒅𝒐 ( 𝑺 = ) … … … 𝑺 𝒀 𝑮 𝑪 Original Distribution Multiple 𝒔-Interventional Distributions ( a ) SCM 𝑺 𝒀 𝑮 𝑪 𝑮 𝑺 𝑪 𝒀 House Cycle Crane House Cycle Crane … ( b ) Illustration of Constructing Interventional Distributions House Cycle Crane 𝒅𝒐 ( 𝑺 = ∅ ) ∅ 𝒅𝒐 ( 𝑺 = ) 𝒅𝒐 ( 𝑺 = ) … … … 𝑺 𝒀 𝑮 𝑪 Original Distribution Multiple 𝒔-Interventional Distributions ( b ) Interventional Distributions . Figure 2 : ( a ) Causal view of data-generating process ; ( b ) Illustration of interventional distributions . • C → Y . By “ causal part ” , we mean C is the only endogenous parent to determine the groundtruth label Y . Taking the motif-base example in Figure 1 again , C is the oracle rationale , which perfectly explains why the graph is labeled as Y . • C L9999K S. This dashed arrow indicates additional probabilistic dependencies ( Pearl , 2000 ; Pearl et al. , 2016 ) between C and S. We consider three typical relationships here : ( 1 ) C is independent of S , i.e. , C |= S ; ( 2 ) C is the direct cause of S , i.e. , C → S ; and ( 3 ) There exists a common cause E , i.e. , C ← E → S. See Appendix B for the corresponding examples . C L9999K S can create spurious correlations between the non-causal part S and the ground-truth label Y . Assuming C → S , C is a confounder between S and Y , which opens a backdoor path S ← C → Y , thus making S and Y spuriously correlated ( Pearl et al. , 2016 ) . We systematize such spurious correlations as Y 6⊥⊥ S. Wherein , we make feature induction assumption on S to avoid the confusion of the induced subset of S between C. See Appendix C for the formal assumption . Furthermore , data collected from different environments exhibit various spurious correlations ( Teney et al. , 2020 ; Arjovsky et al. , 2019 ) , e.g. , one mostly picks House motifs with Tree bases as the training data , while another selects House motifs with Wheel bases as the testing data . Hence , such spurious correlations are unstable and variant across different distributions . 2.2 TASK FORMALIZATION OF INVARIANT RATIONALIZATION . Oracle Rationale . With the causal theory ( Pearl et al. , 2016 ; Pearl , 2000 ) , for each variable X in a SCM , there exists a directed link from each of its parent variables PA ( X ) to X , if and only if the causal mechanism X = fX ( PA ( X ) , X ) persists , where X |= PA ( X ) is the exogenous noise of X . For simplicity , we omit the exogenous noise and simplify it as X = fX ( PA ( X ) ) . Hence , there exist a function fY : C → Y in our SCM , where the “ oracle rationale ” C satisfies : Y = fY ( C ) , Y |= S | C , ( 1 ) where Y |= S | C indicates that C shields Y from the influence of S , making the causal relationship C → Y invariant across different S. Rationalization . In general , only the pairs of input G and label Y are observed during training , while neither oracle rationale C nor oracle structural equation model fY is available . The absence of oracles calls for the study on intrinsic interpretability . We systematize an intrinsically-interpretable GNN as a combination of two modules , i.e. , h = hŶ ◦ hC̃ , where hC̃ : G→ C̃ discovers rationale C̃ from the observed G , and hŶ : C̃ → Ŷ outputs the prediction Ŷ to approach Y . Distinct from C and Y which are the variables in the causal mechanisms , C̃ and Ŷ represent the variables in the modeling process to approximateC and Y . To optimize these modules , most of current intrinsicallyinterpretable GNNs ( Veličković et al. , 2018 ; Lee et al. , 2019 ; Knyazev et al. , 2019 ; Gao & Ji , 2019 ; Ranjan et al. , 2020 ) adopt the learning strategy of minimizing the empirical risk : min hC̃ , hŶ R ( hŶ ◦ hC̃ ( G ) , Y ) , ( 2 ) where R ( · , · ) is the risk function , which can be the cross-entropy loss . Nevertheless , this learning strategy relies heavily on the statistical associations between the input features and labels , and can potentially exhibit non-causal rationales . Invariant Rationalization . We ascribe the limitation to ignoring Y |= S | C in Equation 1 , which is crucial to refine the causal relationship C → Y that is invariant across different S. By introducing this independence , we formalize the task of invariant rationalization as : min hC̃ , hŶ R ( hŶ ◦ hC̃ ( G ) , Y ) , s.t . Y |= S̃ | C̃ , ( 3 ) where S̃ = G \ C̃ is the complement of C̃ . This formulation encourages the rationale C̃ seeking the patterns that are stable across different distributions , while discarding the unstable patterns . | This paper proposes a novel algorithm DIR that allows the learned GNN model to make predictions based on causal patterns. The whole framework consists of four components where (1) the rationale generator splits the input into causal and spurious parts; (2) the distribution intervener replaces the spurious part; (3) the graph encoder embeds the graph based on the spurious and causal parts, respectively; (4) the shortcut and causal classifiers are applied to the spurious and causal embeddings, respectively. This algorithm is highlighted by its objective which encourages the predictions accurate while invariant to the spurious part. On both synthetic and real-world datasets, DIR outperforms the related baselines consistently. As a novel end2end rationalization method, As a novel end2end rationalization method, the underlying DIR principle is proved to be sufficient and necessary for satisfying the oracle function. | SP:bf66a9d224ff5090ed67cfb1a6a73a9c929e5b50 |
Discovering Invariant Rationales for Graph Neural Networks | 1 INTRODUCTION . The eye-catching success in graph neural networks ( GNNs ) ( Hamilton et al. , 2017 ; Kipf & Welling , 2017 ; Dwivedi et al. , 2020 ) provokes the rationalization task , answering “ What knowledge drives the model to make certain predictions ? ” . The goal of selective rationalization ( aka . feature attribution ) ( Chang et al. , 2020 ; Ying et al. , 2019 ; Luo et al. , 2020 ; Wang et al. , 2021c ) is to find a small subset of the input ’ s graph features — rationale — which best guides or explains the model prediction . Discovering the rationale in a model helps audit its inner workings and justify its predictions . Moreover , it has tremendous impacts on real-world applications , such as finding functional groups to shed light on protein structure prediction ( Senior et al. , 2020 ) . Two research lines of rationalization have recently emerged in GNNs . Post-hoc explainability ( Ying et al. , 2019 ; Luo et al. , 2020 ; Yuan et al. , 2021 ; Wang et al. , 2021c ) attributes a model ’ s prediction to the input graph with a separate explanation method , while intrinsic interpretability ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) incorporates a rationalization module into the model to make transparent predictions . Here we focus on intrinsically interpretable GNNs . Among them , graph attention ( Veličković et al. , 2018 ) and pooling ( Lee et al. , 2019 ; Knyazev et al. , 2019 ; Gao & Ji , 2019 ; Ranjan et al. , 2020 ) operators prevail , which work as a computational block of a GNN to generate soft or hard masks on the input graph . They cast the learning paradigm of GNN as minimizing the empirical risk with the masked subgraphs , which are regarded as rationales to guide the model predictions . Despite the appealing nature , recent studies ( Chang et al. , 2020 ; Knyazev et al. , 2019 ) show that the current rationalization methods are prone to ∗Corresponding author . exploit data biases as shortcuts to make predictions and compose rationales . Typically , shortcuts result from confounding factors , sampling biases , and artifacts in the training data . Considering Figure 1 , when the most bases of House-motif graphs are Tree , a GNN does not need to learn the correct function to reach high accuracy for the motif type . Instead , it is much easier to learn from the statistical shortcuts linking the bases Tree with the most occurring motifs House . Unfortunately , when facing with out-of-distribution ( OOD ) data , such methods generalize poorly since the shortcuts are changed . Hence , such shortcut-involved rationales hardly reveal the truly critical subgraphs for the predicted labels , being at odds with the true reasoning process that underlies the task of interest ( Teney et al. , 2020 ) and human cognition ( Alvarez-Melis & Jaakkola , 2017 ) . Here we ascribe the failure on OOD data to the inability to identify causal patterns , which are stable to distribution shift . Motivated by recent studies on invariant learning ( IL ) ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Chang et al. , 2020 ; Bühlmann , 2018 ) , we premise different distributions elicit different environments of data generating process . We argue that the causal patterns to the labels remain stable across environments , while the relations between the shortcut patterns and the labels vary . Such environment-invariant patterns are more plausible and qualified as rationales . Aiming to identify rationales that capture the environment-invariant causal patterns , we formalize a learning strategy , Discovering Invariant Rationales ( DIR ) , for intrinsically interpretable GNNs . One major problem is how to get multiple environments from a standard training set . Differing from the heterogeneous setting ( Bühlmann , 2018 ) of existing IL methods , where environments are observable and attainable , DIR does not assume prophets about environments . It instead generates distribution perturbations by causal intervention — interventional distributions ( Tian et al. , 2006 ; Pearl et al. , 2016 ) — to instantiate environments and further distinguish the causal and non-causal parts . Guided by this idea , our DIR strategy consists of four modules : a rationale generator , a distribution intervener , a feature encoder , two classifiers . Specifically , the rationale generator learns to split the input graph into causal and non-causal subgraphs , which are respectively encoded by the encoder into representations . Then , the distribution intervener conducts the causal interventions on the non-causal representations to create perturbed distributions , with which we can infer the invariant causal parts . Then , the two classifiers are respectively built upon the causal and non-causal parts to generate the joint prediction , whose invariant risk is minimized across different distributions . On one synthetic and three real datasets , extensive experiments demonstrate the generalization ability of DIR to surpass current state-of-the-art IL methods ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Sagawa et al. , 2019 ) , and the interpretability of DIR to outperform the attention- and pooling-based rationalization methods ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) . Our main contributions are : • We propose a novel invariant learning algorithm , DIR , for inherent interpretable models , improving the generalization ability and is suitable for any deep models . • We offer causality theoretic analysis to guarantee the preeminence of DIR . • We provide the implementation of DIR for graph classification tasks , which consistently achieves excellent performance on three datasets with various generalization types . 2 INVARIANT RATIONALE DISCOVERY . With a causal look at the data-generating process , we formalize the principle of discovering invariant rationales , which guides our discovery strategy . Throughout the paper , upper-cased letters like G denote random variables , while lower-case letters like g denote deterministic value of variables . 2.1 CAUSAL VIEW OF DATA-GENERATING PROCESS . Generating rationales for transparent predictions requires understanding the actual mechanisms of the task of interest . Without loss of generality , we focus on the graph classification task and present a causal view of the data-generating process behind this task . Here we formalize the causal view as a Structure Causal Model ( SCM ) ( Pearl et al. , 2016 ; Pearl , 2000 ) by inspecting on the causalities among four variables : input graph G , ground-truth label Y , causal part C , non-causal part S. Figure 2a illustrates the SCM , where each link denotes a causal relationship between two variables . • C → G ← S. The input graph G consists of two disjoint parts : the causal part C and the non-causal part S , such as the House motif and the Tree base in Figure 1 . Published as a conference paper at ICLR 2022 𝑺 𝒀 𝑮 𝑪 𝑮 𝑺 𝑪 𝒀 House Cycle Crane House Cycle Crane … ( b ) Illustration of Constructing Interventional Distributions House Cycle Crane 𝒅𝒐 ( 𝑺 = ∅ ) ∅ 𝒅𝒐 ( 𝑺 = ) 𝒅𝒐 ( 𝑺 = ) … … … 𝑺 𝒀 𝑮 𝑪 Original Distribution Multiple 𝒔-Interventional Distributions ( a ) SCM 𝑺 𝒀 𝑮 𝑪 𝑮 𝑺 𝑪 𝒀 House Cycle Crane House Cycle Crane … ( b ) Illustration of Constructing Interventional Distributions House Cycle Crane 𝒅𝒐 ( 𝑺 = ∅ ) ∅ 𝒅𝒐 ( 𝑺 = ) 𝒅𝒐 ( 𝑺 = ) … … … 𝑺 𝒀 𝑮 𝑪 Original Distribution Multiple 𝒔-Interventional Distributions ( b ) Interventional Distributions . Figure 2 : ( a ) Causal view of data-generating process ; ( b ) Illustration of interventional distributions . • C → Y . By “ causal part ” , we mean C is the only endogenous parent to determine the groundtruth label Y . Taking the motif-base example in Figure 1 again , C is the oracle rationale , which perfectly explains why the graph is labeled as Y . • C L9999K S. This dashed arrow indicates additional probabilistic dependencies ( Pearl , 2000 ; Pearl et al. , 2016 ) between C and S. We consider three typical relationships here : ( 1 ) C is independent of S , i.e. , C |= S ; ( 2 ) C is the direct cause of S , i.e. , C → S ; and ( 3 ) There exists a common cause E , i.e. , C ← E → S. See Appendix B for the corresponding examples . C L9999K S can create spurious correlations between the non-causal part S and the ground-truth label Y . Assuming C → S , C is a confounder between S and Y , which opens a backdoor path S ← C → Y , thus making S and Y spuriously correlated ( Pearl et al. , 2016 ) . We systematize such spurious correlations as Y 6⊥⊥ S. Wherein , we make feature induction assumption on S to avoid the confusion of the induced subset of S between C. See Appendix C for the formal assumption . Furthermore , data collected from different environments exhibit various spurious correlations ( Teney et al. , 2020 ; Arjovsky et al. , 2019 ) , e.g. , one mostly picks House motifs with Tree bases as the training data , while another selects House motifs with Wheel bases as the testing data . Hence , such spurious correlations are unstable and variant across different distributions . 2.2 TASK FORMALIZATION OF INVARIANT RATIONALIZATION . Oracle Rationale . With the causal theory ( Pearl et al. , 2016 ; Pearl , 2000 ) , for each variable X in a SCM , there exists a directed link from each of its parent variables PA ( X ) to X , if and only if the causal mechanism X = fX ( PA ( X ) , X ) persists , where X |= PA ( X ) is the exogenous noise of X . For simplicity , we omit the exogenous noise and simplify it as X = fX ( PA ( X ) ) . Hence , there exist a function fY : C → Y in our SCM , where the “ oracle rationale ” C satisfies : Y = fY ( C ) , Y |= S | C , ( 1 ) where Y |= S | C indicates that C shields Y from the influence of S , making the causal relationship C → Y invariant across different S. Rationalization . In general , only the pairs of input G and label Y are observed during training , while neither oracle rationale C nor oracle structural equation model fY is available . The absence of oracles calls for the study on intrinsic interpretability . We systematize an intrinsically-interpretable GNN as a combination of two modules , i.e. , h = hŶ ◦ hC̃ , where hC̃ : G→ C̃ discovers rationale C̃ from the observed G , and hŶ : C̃ → Ŷ outputs the prediction Ŷ to approach Y . Distinct from C and Y which are the variables in the causal mechanisms , C̃ and Ŷ represent the variables in the modeling process to approximateC and Y . To optimize these modules , most of current intrinsicallyinterpretable GNNs ( Veličković et al. , 2018 ; Lee et al. , 2019 ; Knyazev et al. , 2019 ; Gao & Ji , 2019 ; Ranjan et al. , 2020 ) adopt the learning strategy of minimizing the empirical risk : min hC̃ , hŶ R ( hŶ ◦ hC̃ ( G ) , Y ) , ( 2 ) where R ( · , · ) is the risk function , which can be the cross-entropy loss . Nevertheless , this learning strategy relies heavily on the statistical associations between the input features and labels , and can potentially exhibit non-causal rationales . Invariant Rationalization . We ascribe the limitation to ignoring Y |= S | C in Equation 1 , which is crucial to refine the causal relationship C → Y that is invariant across different S. By introducing this independence , we formalize the task of invariant rationalization as : min hC̃ , hŶ R ( hŶ ◦ hC̃ ( G ) , Y ) , s.t . Y |= S̃ | C̃ , ( 3 ) where S̃ = G \ C̃ is the complement of C̃ . This formulation encourages the rationale C̃ seeking the patterns that are stable across different distributions , while discarding the unstable patterns . | This paper proposes to address the limitation of current interpretable graph neural networks over out-of-distribution data. In this work, the intrinsically interpretable GNN is investigated by identifying the invariant rationales corresponding to environment-invariant causal patterns. The proposed model is evaluated on the graph classification task to demonstrate its effectiveness as compared to state-of-the-arts. | SP:bf66a9d224ff5090ed67cfb1a6a73a9c929e5b50 |
Gradient-based Meta-solving and Its Applications to Iterative Methods for Solving Differential Equations | 1 INTRODUCTION . It is common and important in science and engineering to solve similar problems repeatedly . For example , in material science , a tremendous amount of physical and numerical experiments are conducted to discover and characterize new materials ( Schmidt et al . ( 2019 ) ) . For another example , in computational fluid dynamics , many methods involve solving a Poisson equation to compute the pressure field in every time step of the simulation ( Ajuria Illarramendi et al . ( 2020 ) ) . In these situations , we can utilize the data of the previously solved problems to solve the next similar but unseen problems more efficiently , and machine learning is a natural and effective approach for this . Thus , in recent years , many learning-based methods have been proposed for repeated solutions of computational problems such as partial differential equations ( PDEs ) ( Tang et al . ( 2017 ) ; Özbay et al . ( 2021 ) ; Tompson et al . ( 2017 ) ; Hsieh et al . ( 2018 ) ; Huang et al . ( 2020 ) ) . For example , in Tang et al . ( 2017 ) , Ajuria Illarramendi et al . ( 2020 ) , and Özbay et al . ( 2021 ) , convolutional neural networks are used to predict the solution of Poisson equations , and Ajuria Illarramendi et al . ( 2020 ) and Özbay et al . ( 2021 ) propose to use the predicted solution as an initial guess of traditional numerical methods . Hsieh et al . ( 2018 ) combines a neural network and an iterative solver to accelerate it with maintaining the convergence guarantee . In addition to the regular supervised learning approaches , there are several works where meta-learning approaches are taken to solve computational problems ( Feliu-Fabà et al . ( 2020 ) ; Chen et al . ( 2020 ) ; Psaros et al . ( 2021 ) ; Guo et al . ( 2021 ) ) . Meta-learning , or learning to learn , leverages previous learning experiences to improve future learning performance ( Hospedales et al . ( 2021 ) ) , which fits the motivation utilizing the data from previously solved equations for the next one . For example , Chen et al . ( 2020 ) use meta-learning to generate a smoother of the Multi-grid Network for parametrized PDEs . Psaros et al . ( 2021 ) propose a meta-learning technique for offline discovery of physics-informed neural network loss functions . Although many methods have been proposed in this direction , they are often problem-specific . In other words , there lacks both a unified framework to explain them and a general design pattern to adapt them to new problem settings . On the other hand , in the machine learning literature , there exists a general methodology - gradient-based meta-learning ( Finn et al . ( 2017 ) ) - that covers a variety of meta-learning problem settings . In this paper , we generalize this approach to yield a framework , which we call gradient-based meta-solving ( GBMS ) , that encompasses both learning and computational problems . This offers a general means to understand and develop learning-based algorithms to speed up computation . As an illustration of our approach , we apply GBMS to accelerate the solution of differential equations with iterative methods through learning . We show the advantage of the proposed algorithm over the baseline classical and learning-based approaches through theoretical analysis and numerical experiments . Finally , we incorporate the algorithm into a practical application and demonstrate its versatility and performance . 2 GRADIENT-BASED META-SOLVING . In this section , we introduce our core idea of gradient-based meta-solving . First , we formulate a class of problems , which we call meta-solving , that includes both ordinary meta-learning and learning-based computational problems . We then propose a general gradient-based algorithm for solving them . Under our formulation , many methods proposed in related works can be regarded as special cases of the GBMS algorithm . 2.1 GENERAL FORMULATION OF META-SOLVING . Let us now introduce the general formulation of meta-solving . We first fix the required notations . A task τ is a tuple τ = ( Dτ , Uτ , Lτ ) consisting of a dataset Dτ , a solution space Uτ , and a loss function Lτ . A solution space Uτ is a set of parametric candidate solutions , which is usually a subset of RN for some N ∈ N. A loss function Lτ is a function from Uτ to R≥0 that measures the quality of solution candidates . To solve a task τ means to find an approximate solution û ∈ Uτ which minimizes Lτ ( · ) . Meta-solving considers the solution of not one , but a distribution of tasks by a learnable solver . Thus , we consider a task space ( T , P ) as a probability space that consists of a set of tasks T and a task distribution P , which is a probability measure defined on a suitable σ-algebra on T . A solver Φ is a function from T × Θ to U , where U = ⋃ τ∈T Uτ . θ ∈ Θ is the parameter of Φ , and Θ is its parameter space . Here , θ may or may not be trainable , depending on the problem . Then , solving a task τ ∈ T by an algorithm Φ with a parameter θ is denoted by Φ ( τ ; θ ) = û . A meta-solver Ψ is a function from T × Ω to Θ , where ω ∈ Ω is a parameter of Ψ and Ω is its parameter space . A meta-solver Ψ parametrized by ω ∈ Ω is expected to generate an appropriate parameter θτ ∈ Θ for solving a task τ ∈ T with a solver Φ , which is denoted by Ψ ( τ ; ω ) = θτ . Then , by using the notations above , our meta-solving problem is defined as follows : Definition 1 ( Meta-solving problem ) . For a given task space ( T , P ) , solver Φ , and meta-solver Ψ , find ω ∈ Ω which minimizes Eτ∼P [ Lτ ( Φ ( τ ; Ψ ( τ ; ω ) ) ] . We present some familiar examples , which can be regarded as special cases of the meta-solving problem . First , we can see that conventional meta-learning problems fall in this formulation . Example 1 ( Few-shot learning ) . As an example of the meta-learning problem , we take the fewshot regression problem with MAML ( Finn et al . ( 2017 ) ) . The components of the problem are the following . The task τ is to learn a regression model from data . The dataset is Dτ = { ( xi , yi ) Ki=1 } , which satisfies y = fτ ( x ) for an unknown function fτ . Dτ is divided into the training set Dtrainτ and validation set Dvalτ . The solution parameter space Uτ is a weights space of a neural network ( NN ) that models fτ . Note that U = Uτ because the architecture of NN is shared across all tasks . The approximate solution û ∈ U is the trained weights of NN , which is obtained by training on Dtrainτ . The loss function Lτ : U → R≥0 is the mean squared error ( MSE ) on Dvalτ . The task distribution ( T , P ) is determined by the distribution of the target function fτ and distribution of samples ( x , y ) . The solver Φ : T ×Θ→ U is the single step gradient descent to minimizeLtrainτ ( u ) = 1 |Dtrainτ | ∑ ( x , y ) ∈Dtrainτ ‖NN ( x ; u ) − y‖2 . Its parameter θ ∈ Θ is initial weights u ( 0 ) of NN , so Θ = U . Thus , Φ ( τ ; θ ) = u ( 0 ) − α∇u ( 0 ) Ltrainτ ( u ( 0 ) ) = û , where α is a learning rate . The meta-solver Ψ : T × Ω → Θ is considered as a constant function that returns its parameter ω ∈ Ω for any task τ ∈ T . The parameter ω ∈ Ω is expected to be an appropriate initial weights for all τ ∈ T to be fine-tuned easily . Thus , Ω = Θ = U , and Ψ ( τ ; ω ) = ω = θ = u ( 0 ) . Note that the output of the meta-solver , the initial weights u ( 0 ) , does not depend on τ . Then , the few-shot learning problem is defined as meta-solving problem , which is min ω E τ∼P [ Lτ ( Φ ( τ ; Ψ ( τ ; ω ) ) ] = min ω E τ∼P ∑ ( x , y ) ∈Dvalτ ∥∥NN ( x ; ω − α∇ωLtrainτ ( ω ) ) − y∥∥2 . ( 1 ) In addition to the conventional learning problems , we can regard other computational problems , such as solving a differential equation , as a task of the meta-solving problem . In constrast with MAML , the inner-loop learning is now replaced with a family of iterative solvers for differential equations . This necessitates the distinction of the meta-solver parameter space Ω and the solution space U . Moreover , the meta-solver has to produce a task-specific parameter for the inner solver . Example 2 ( Solving differential equations ) . Suppose that we need to repeatedly solve similar instances of a class of differential equations with a given numerical solver . The solver has a number of hyper-parameters , which sensitively affect accuracy and efficiency depending on the problem instance . Thus , finding a strategy to optimally select solver hyper-parameters given a problem instance can be viewed as a meta-solving problem . The components of the problem are the following . The task τ is to solve a differential equation . In this example , suppose that the target equation is the Poisson equation −∆u = fτ with Dirichlet boundary conditions u = gτ . The dataset Dτ contains data of the differential equation , Dτ = { fτ , gτ } . The solution parameter space Uτ is RNτ . The loss function Lτ : Uτ → R≥0 measures the accuracy of û ∈ Uτ . In this example , the ` 2-norm of the residuals obtained by substituting the approximate solution û into the equation can be used . The task distribution ( T , P ) is the joint distribution of fτ and gτ . The solver Φ : T ×Θ→ U is a numerical solver with a parameter θ ∈ Θ for the differential equation . In this example , suppose that Φ is the Jacobi method ( Saad ( 2003 ) ) and θ is its initial guess . The meta-solver Ψ : T ×Ω→ Θ is a strategy characterized by ω ∈ Ω to select a parameter , an initial guess , θτ ∈ Θ for each task τ ∈ T . Note that the output of the meta-solver depends on τ , which is different from the case of Example 1 . Then , finding the strategy to select parameters of the numerical solver becomes meta-solving problem . The above examples explain why we describe our problem as meta-solving instead of meta-learning . In Example 1 , the task τ is learning from data , and the solver Φ is gradient descent . In Example 2 , the task τ is solving a differential equation , and the solver Φ is an iterative differential equation solver . Regardless of the type of task and algorithm , in both cases , the solver Φ solves the task τ , and we do not distinguish whether Φ is a learning algorithm or other numerical solver . In other words , learning algorithms such as gradient descent are also a type of numerical solvers , and we regard learning as a special case of solving . It is also true for the outer learning algorithm to learn how to solve the task τ with the solver Φ , so learning to solve is a special case of solving to solve . In this sense , we call it meta-solving . | This paper proposes leveraging data from previous problem instances to improve efficiency of solving similar ones in the future. A general gradient-based method is proposed, which is applied to generating initial guesses to differential equation solutions. This problem is formulated as a meta-learning problem. | SP:664054eccfdebcb9ea3ac78f3d89501dc3f8a352 |
Gradient-based Meta-solving and Its Applications to Iterative Methods for Solving Differential Equations | 1 INTRODUCTION . It is common and important in science and engineering to solve similar problems repeatedly . For example , in material science , a tremendous amount of physical and numerical experiments are conducted to discover and characterize new materials ( Schmidt et al . ( 2019 ) ) . For another example , in computational fluid dynamics , many methods involve solving a Poisson equation to compute the pressure field in every time step of the simulation ( Ajuria Illarramendi et al . ( 2020 ) ) . In these situations , we can utilize the data of the previously solved problems to solve the next similar but unseen problems more efficiently , and machine learning is a natural and effective approach for this . Thus , in recent years , many learning-based methods have been proposed for repeated solutions of computational problems such as partial differential equations ( PDEs ) ( Tang et al . ( 2017 ) ; Özbay et al . ( 2021 ) ; Tompson et al . ( 2017 ) ; Hsieh et al . ( 2018 ) ; Huang et al . ( 2020 ) ) . For example , in Tang et al . ( 2017 ) , Ajuria Illarramendi et al . ( 2020 ) , and Özbay et al . ( 2021 ) , convolutional neural networks are used to predict the solution of Poisson equations , and Ajuria Illarramendi et al . ( 2020 ) and Özbay et al . ( 2021 ) propose to use the predicted solution as an initial guess of traditional numerical methods . Hsieh et al . ( 2018 ) combines a neural network and an iterative solver to accelerate it with maintaining the convergence guarantee . In addition to the regular supervised learning approaches , there are several works where meta-learning approaches are taken to solve computational problems ( Feliu-Fabà et al . ( 2020 ) ; Chen et al . ( 2020 ) ; Psaros et al . ( 2021 ) ; Guo et al . ( 2021 ) ) . Meta-learning , or learning to learn , leverages previous learning experiences to improve future learning performance ( Hospedales et al . ( 2021 ) ) , which fits the motivation utilizing the data from previously solved equations for the next one . For example , Chen et al . ( 2020 ) use meta-learning to generate a smoother of the Multi-grid Network for parametrized PDEs . Psaros et al . ( 2021 ) propose a meta-learning technique for offline discovery of physics-informed neural network loss functions . Although many methods have been proposed in this direction , they are often problem-specific . In other words , there lacks both a unified framework to explain them and a general design pattern to adapt them to new problem settings . On the other hand , in the machine learning literature , there exists a general methodology - gradient-based meta-learning ( Finn et al . ( 2017 ) ) - that covers a variety of meta-learning problem settings . In this paper , we generalize this approach to yield a framework , which we call gradient-based meta-solving ( GBMS ) , that encompasses both learning and computational problems . This offers a general means to understand and develop learning-based algorithms to speed up computation . As an illustration of our approach , we apply GBMS to accelerate the solution of differential equations with iterative methods through learning . We show the advantage of the proposed algorithm over the baseline classical and learning-based approaches through theoretical analysis and numerical experiments . Finally , we incorporate the algorithm into a practical application and demonstrate its versatility and performance . 2 GRADIENT-BASED META-SOLVING . In this section , we introduce our core idea of gradient-based meta-solving . First , we formulate a class of problems , which we call meta-solving , that includes both ordinary meta-learning and learning-based computational problems . We then propose a general gradient-based algorithm for solving them . Under our formulation , many methods proposed in related works can be regarded as special cases of the GBMS algorithm . 2.1 GENERAL FORMULATION OF META-SOLVING . Let us now introduce the general formulation of meta-solving . We first fix the required notations . A task τ is a tuple τ = ( Dτ , Uτ , Lτ ) consisting of a dataset Dτ , a solution space Uτ , and a loss function Lτ . A solution space Uτ is a set of parametric candidate solutions , which is usually a subset of RN for some N ∈ N. A loss function Lτ is a function from Uτ to R≥0 that measures the quality of solution candidates . To solve a task τ means to find an approximate solution û ∈ Uτ which minimizes Lτ ( · ) . Meta-solving considers the solution of not one , but a distribution of tasks by a learnable solver . Thus , we consider a task space ( T , P ) as a probability space that consists of a set of tasks T and a task distribution P , which is a probability measure defined on a suitable σ-algebra on T . A solver Φ is a function from T × Θ to U , where U = ⋃ τ∈T Uτ . θ ∈ Θ is the parameter of Φ , and Θ is its parameter space . Here , θ may or may not be trainable , depending on the problem . Then , solving a task τ ∈ T by an algorithm Φ with a parameter θ is denoted by Φ ( τ ; θ ) = û . A meta-solver Ψ is a function from T × Ω to Θ , where ω ∈ Ω is a parameter of Ψ and Ω is its parameter space . A meta-solver Ψ parametrized by ω ∈ Ω is expected to generate an appropriate parameter θτ ∈ Θ for solving a task τ ∈ T with a solver Φ , which is denoted by Ψ ( τ ; ω ) = θτ . Then , by using the notations above , our meta-solving problem is defined as follows : Definition 1 ( Meta-solving problem ) . For a given task space ( T , P ) , solver Φ , and meta-solver Ψ , find ω ∈ Ω which minimizes Eτ∼P [ Lτ ( Φ ( τ ; Ψ ( τ ; ω ) ) ] . We present some familiar examples , which can be regarded as special cases of the meta-solving problem . First , we can see that conventional meta-learning problems fall in this formulation . Example 1 ( Few-shot learning ) . As an example of the meta-learning problem , we take the fewshot regression problem with MAML ( Finn et al . ( 2017 ) ) . The components of the problem are the following . The task τ is to learn a regression model from data . The dataset is Dτ = { ( xi , yi ) Ki=1 } , which satisfies y = fτ ( x ) for an unknown function fτ . Dτ is divided into the training set Dtrainτ and validation set Dvalτ . The solution parameter space Uτ is a weights space of a neural network ( NN ) that models fτ . Note that U = Uτ because the architecture of NN is shared across all tasks . The approximate solution û ∈ U is the trained weights of NN , which is obtained by training on Dtrainτ . The loss function Lτ : U → R≥0 is the mean squared error ( MSE ) on Dvalτ . The task distribution ( T , P ) is determined by the distribution of the target function fτ and distribution of samples ( x , y ) . The solver Φ : T ×Θ→ U is the single step gradient descent to minimizeLtrainτ ( u ) = 1 |Dtrainτ | ∑ ( x , y ) ∈Dtrainτ ‖NN ( x ; u ) − y‖2 . Its parameter θ ∈ Θ is initial weights u ( 0 ) of NN , so Θ = U . Thus , Φ ( τ ; θ ) = u ( 0 ) − α∇u ( 0 ) Ltrainτ ( u ( 0 ) ) = û , where α is a learning rate . The meta-solver Ψ : T × Ω → Θ is considered as a constant function that returns its parameter ω ∈ Ω for any task τ ∈ T . The parameter ω ∈ Ω is expected to be an appropriate initial weights for all τ ∈ T to be fine-tuned easily . Thus , Ω = Θ = U , and Ψ ( τ ; ω ) = ω = θ = u ( 0 ) . Note that the output of the meta-solver , the initial weights u ( 0 ) , does not depend on τ . Then , the few-shot learning problem is defined as meta-solving problem , which is min ω E τ∼P [ Lτ ( Φ ( τ ; Ψ ( τ ; ω ) ) ] = min ω E τ∼P ∑ ( x , y ) ∈Dvalτ ∥∥NN ( x ; ω − α∇ωLtrainτ ( ω ) ) − y∥∥2 . ( 1 ) In addition to the conventional learning problems , we can regard other computational problems , such as solving a differential equation , as a task of the meta-solving problem . In constrast with MAML , the inner-loop learning is now replaced with a family of iterative solvers for differential equations . This necessitates the distinction of the meta-solver parameter space Ω and the solution space U . Moreover , the meta-solver has to produce a task-specific parameter for the inner solver . Example 2 ( Solving differential equations ) . Suppose that we need to repeatedly solve similar instances of a class of differential equations with a given numerical solver . The solver has a number of hyper-parameters , which sensitively affect accuracy and efficiency depending on the problem instance . Thus , finding a strategy to optimally select solver hyper-parameters given a problem instance can be viewed as a meta-solving problem . The components of the problem are the following . The task τ is to solve a differential equation . In this example , suppose that the target equation is the Poisson equation −∆u = fτ with Dirichlet boundary conditions u = gτ . The dataset Dτ contains data of the differential equation , Dτ = { fτ , gτ } . The solution parameter space Uτ is RNτ . The loss function Lτ : Uτ → R≥0 measures the accuracy of û ∈ Uτ . In this example , the ` 2-norm of the residuals obtained by substituting the approximate solution û into the equation can be used . The task distribution ( T , P ) is the joint distribution of fτ and gτ . The solver Φ : T ×Θ→ U is a numerical solver with a parameter θ ∈ Θ for the differential equation . In this example , suppose that Φ is the Jacobi method ( Saad ( 2003 ) ) and θ is its initial guess . The meta-solver Ψ : T ×Ω→ Θ is a strategy characterized by ω ∈ Ω to select a parameter , an initial guess , θτ ∈ Θ for each task τ ∈ T . Note that the output of the meta-solver depends on τ , which is different from the case of Example 1 . Then , finding the strategy to select parameters of the numerical solver becomes meta-solving problem . The above examples explain why we describe our problem as meta-solving instead of meta-learning . In Example 1 , the task τ is learning from data , and the solver Φ is gradient descent . In Example 2 , the task τ is solving a differential equation , and the solver Φ is an iterative differential equation solver . Regardless of the type of task and algorithm , in both cases , the solver Φ solves the task τ , and we do not distinguish whether Φ is a learning algorithm or other numerical solver . In other words , learning algorithms such as gradient descent are also a type of numerical solvers , and we regard learning as a special case of solving . It is also true for the outer learning algorithm to learn how to solve the task τ with the solver Φ , so learning to solve is a special case of solving to solve . In this sense , we call it meta-solving . | The paper proposed a gradient-based algorithm GBMS to solve PDEs based on the solutions of other similar problems. In GBMS, a network is trained to produce good initial guess for the iterative solver of the PDE. Numerical experiments are performed to show the effectiveness of the method. | SP:664054eccfdebcb9ea3ac78f3d89501dc3f8a352 |
Prototype memory and attention mechanisms for few shot image generation | 1 INTRODUCTION . Recent neurophysiological findings based on calcium imaging have revealed that many neurons in the superficial layers of V1 are strongly tuned to complex local patterns , rather than simple oriented edges or bars . These complex neurons exhibit far stronger responses ( a 3-5 fold increase ) when exposed to their preferred patterns than when exposed to simple grating and bar-like stimuli . The high degree of specificity in these neurons ’ selectivity suggests that they might serve as specific pattern detectors ( Tang et al. , 2018a ) . Due to the selectivity towards complex stimuli , the population response of these V1 neurons is extremely sparse . Only 4–6 out of roughly 1000 neurons respond strongly to any given pattern or natural stimulus ( Tang et al. , 2018b ) . This finding is reminiscent of an earlier study that found similarly sparse encoding of concepts in the hippocampus ( Quiroga et al. , 2005 ) . Recent data in V4 also indicate the existence of cells with a similarly high degree of sparsity1 . Thus , we theorize such cells should exist in every level of the hierarchical visual system . We called these highly selective sparsely-responding feature detectors `` grandmother neurons '' to highlight their possible explicit encoding of specific prototypes , even though in reality , a prototype is likely represented by a sparse cluster of neurons rather than a single cell . Neurons in different layers of each visual area exhibit different degrees of response sparsity , complementing one another in various functions . The observations of this diverse set of super-sparsely responding feature detectors raise the following question : what are the possible computational benefits and rationales of having such neurons in the early visual cortex ? In this paper , we hypothesize that these `` grandmother neurons '' can serve as a prototype memory prior to modulate the process of image synthesis . Image synthesis is a central theme in a number of hierarchical models of the visual system , including interactive activation and predictive coding ( McClelland & Rumelhart , 2020 ; Grossberg , 1987 ; Mumford , 1992 ; Rao & Ballard , 1999 ; Lee & Mumford , 2003 ) , and is hypothesized to take place through the top-down feedback connections between areas in the visual cortex . These priors allow the synthesis process to look beyond the current spatial context and utilize the prototype memories learned and accumulated over time . Thus , the `` grandmother cells '' serve as structural conceptual priors in a memory attention process during image generation . 1Unfortunately the data is not publicly available yet . To emphasize the importance of having an attention mechanism that operated beyond the current image representation , we name our proposed memory-based attentional process Memory Concept Attention ( MoCA ) . MoCA is a module that can be plugged into any layer of pre-existing generator architectures in the GAN framework . We test our model by performing extensive experiments using the state-of-the-art StyleGAN2 ( Karras et al. , 2020b ) and a newly proposed few-shot image generator FastGAN ( Liu et al. , 2021 ) . Our experiments demonstrate the utilization of prototype information accumulated within the semantic clusters during training can improve few-shot image generation on Animal-Face Dog ( Si & Zhu , 2012 ) , 100-Shot-Obama ( Zhao et al. , 2020 ) , ImageNet100 ( Russakovsky et al. , 2015 ) , COCO-300 ( Lin et al. , 2014 ) , CIFAR10 ( Krizhevsky et al. , 2009 ) and Caltech-UCSD Birds ( CUB ) ( Welinder et al. , 2010 ) . Additionally , we also find that generators with MoCA can resist a certain degree of injected noise corruption during testing time , suggesting that attending to a structured memory prior during generation can improve the robustness of the model . Our goal here is to explore the utility of prototype cells as memory priors in a standard computer vision image generation task , with a view to gaining some insights into the advantages of having these `` grandmother '' neurons in the visual cortex at a functional level . 2 RELATED WORK . Visual Concept Learning Visual concepts , defined as intermediate level semantic features , have been shown to be effective in overcoming misclassification of objects due to occlusion when used in a feedforward voting scheme ( Wang et al. , 2017 ) . Explicit representations of visual concepts using prototype neurons might also serve as effective reconfigurable parts for building compositional machines ( Bienenstock et al. , 1997 ; Geman et al. , 2002 ; Zhu & Mumford , 2007 ) . In this paper , we explore the use of visual concepts in the form of prototype memory priors to provide temporal spatial and temporal contextual modulation with an attention mechanism for the complex compositional task of image generation . Self-Attention The attention mechanism ( Vaswani et al. , 2017 ) in deep learning is popular in Natural Language Processing ( NLP ) and is also known as `` non-local networks '' in the vision community ( Wang et al. , 2018 ) . Zhang et al . ( 2019a ) introduced self-attention into generative models in the Self-Attention GAN . Since then , adding self-attention into Generative Adversarial Networks has become a standard practice . Brock et al . ( 2018 ) and Esser et al . ( 2020 ) demonstrate the benefits of using self-attention in high-fidelity image synthesis models . However , current self-attention mechanisms in GANs only utilize contextual information within the same image to modulate the activation . In this work , we propose the use of a memory cache of intermediate-level visual conceptual prototypes to provide additional modulation in addition to the standard self-attention . In our work , the activation mechanism attends not only to its spatial context within the image itself , but also attends to a cached set of memory prototypes accumulated over time . Prototype Memory Mechanism A memory bank can capture diverse features over a long time period , and has been shown to be effective in other domains . Wu et al . ( 2018 ) utilizes a memory bank in contrastive learning to obtain more diverse negative samples to contrast with . Caron et al . ( 2020 ) also uses a memory queue during training to accumulate representative negative samples . He et al . ( 2020 ) shows that the stability of the features accumulated in the memory bank can be improved using a momentum-updated encoder , a strategy we will also use in learning our prototypes . SimGAN ( Shrivastava et al. , 2017 ) introduces the image pool trick which uses a buffer to store previously generated samples , in order to make the discriminator focus not only on the current training batch , but also improve itself based on memory . The major innovation of our work is the proposal , inspired by recent neurophysiological findings , that we should have memory banks at intermediate levels , and , in principle , every level of the visual hierarchy . While early memory bank work stored images at the instance level for object recognition , which is not useful for image generation , we argue that memory banks at lower levels of the hierarchy can store prototypes of parts and sub-parts which are useful for image generation . Few-shot image generation , in particular , can benefit from memory mechanisms that support flexible composition and decomposition of parts , particularly when data are limited . Few-Shot Prototypes Learning Few-shot learning refers to performing computer vision tasks when training data are very limited . One of the popular ideas in the few-shot learning literature is to form distinct prototypes from the training set and use them during testing ( Snell et al. , 2017 ) . Although MoCA also forms prototypes during the training stage and uses them during inference , there are two important distinctions between our work and Snell et al . ( 2017 ) : ( 1 ) Snell et al . ( 2017 ) forms prototypes at the instance level whereas MoCA ’ s prototypes are generated at the intermediate parts level . ( 2 ) Snell et al . ( 2017 ) simply selects the closest prototype to obtain discrete class prediction , MoCA , on the other hand , employs an attention process to continuously modulate the activation features based on the prototypes , hence can be applied to a broader set of tasks , including image synthesis , which predicts continuous pixel values . Few-Shot Image Generation Few-shot image generation task is a challenging task as GANs are very data-hungry and inefficient . Unconditional image generation is especially difficult among the current few-shot image generation schemes . Different solutions have been developed in the literature . Recent works such as DiffAug ( Zhao et al. , 2020 ) , StyleGAN-Ada ( Karras et al. , 2020a ) propose differentiable augmentation to avoid overfitting in the discriminator . InsGen ( Yang et al. , 2021 ) proposes to use a contrastive learning objective to enhance the adversarial loss in the few-shot generation setting . These works mostly proposed methods to improve the discriminators so that they can provide better error signals to the generator , but do not specifically address the generator architecture . Another line of research proposed generator architectures to avoid mode collapse . The state-of-the-art architecture for few-shot image generation ( hundreds of real images ) is FastGAN ( Liu et al. , 2021 ) . Here , we propose a new architectural change on the generator side and make comparison against FastGAN architecture extensively in the experiment section . 3 METHODS . Our key contribution is the introduction of a novel prototype-based memory modulation module to improve the generator network of a GAN . The activation from the previous layer is modified by two attention processes : 1 ) contextual modulation with Memory Concept Attention ( MoCA ) , and 2 ) spatial contextual modulation within the generated image itself ( Self-Attention ) . Our module takes a feature map in the GAN hierarchy as input combines the results of these two mechanisms to modulate the feature map for further downstream processing . A high-level overview of our model is shown in Figure 1 . Formally , we denote the input to our MoCA layer to be the activation of a particular layer , A ∈ Rn×c×h×w . The output produces a modulation H ∈ Rn×c×h×w that update A into  . To allow the information to be flexibly modulated , we first transform A by 1× 1 convolutions into a lowerdimensional space via functions θ ( · ) , φ ( · ) , and ψ ( · ) , where { θ ( A ) , φ ( A ) , ψ ( A ) } ∈ Rn×c̃ ×h×w . 3.1 PROTOTYPE MEMORY LEARNING . In this section , we discuss the organization of our prototype memory that is used as one route of modulation . Our prototype concept memory is arranged hierarchically into semantic cells and prototype cells . As shown in Figure 2 , each semantic cell is cluster mean representative of a cluster of prototype cells . Formally , suppose our memory P consists of M semantic cells P = { K1 , K2 , ... , KM } . For each of the semantic cells Ki , there are T of prototype cells { E ( i ) 1 , E ( i ) 2 , E ( i ) 3 , ... , E ( i ) T } stored in the memory cell associated with Ki , where E ( i ) j and Ki both ∈ Rc̃ and Ki = ( ∑T j=1E ( i ) j ) /T is the mean of the stored prototype cells . These prototype cells come from the feature maps in previous iterations after being transformed via a momentum updated context encoder φ̃ ( · ) and are updated in the memory at the end of every training iteration . φ̃ ( · ) is a momentum counterpart of φ ( · ) and its parameter is updated as shown in Equation 1 with the momentum parameter m. φ̃ ( · ) does not change as rapidly as φ ( · ) so that the prototype learned are more stable , accumulating information beyond the current training batch . The rationale is similar to that in ( He et al. , 2020 ) ) . φ̃θ ← φ̃θ ∗ ( 1−m ) + φθ ∗m ( 1 ) After transformed by φ̃ ( · ) to a low-dimensional space , the activation at each hypercolumn ( pixel location ) in the feature map is assigned to its closest semantic cluster and replaces an existing prototype cell in the memory bank of that cluster . We use a random replacement policy to prevent the prototype cells from all collapsing to trivial solutions . The update is done in a batch synchronized fashion , i.e . we update Ki as the cluster mean of the ith cluster of prototypes after the entire memory is updated based on the recent batch . | In this paper, the authors propose a new “grandmother cell”-like memory mechanism for improving image generation performance in GANs. In short, this method clusters and stores activation vectors observed during training. Then at image generation time, activation vectors are augmented with the sum of the stored memories at the closest cluster. This seems to improve GAN performance for few-shot image generation tasks. The authors also visualize the learned memory clusters, which seems to reveal some semantic clustering. | SP:5b88514d3eba834efba72c605496c4c057c30387 |
Prototype memory and attention mechanisms for few shot image generation | 1 INTRODUCTION . Recent neurophysiological findings based on calcium imaging have revealed that many neurons in the superficial layers of V1 are strongly tuned to complex local patterns , rather than simple oriented edges or bars . These complex neurons exhibit far stronger responses ( a 3-5 fold increase ) when exposed to their preferred patterns than when exposed to simple grating and bar-like stimuli . The high degree of specificity in these neurons ’ selectivity suggests that they might serve as specific pattern detectors ( Tang et al. , 2018a ) . Due to the selectivity towards complex stimuli , the population response of these V1 neurons is extremely sparse . Only 4–6 out of roughly 1000 neurons respond strongly to any given pattern or natural stimulus ( Tang et al. , 2018b ) . This finding is reminiscent of an earlier study that found similarly sparse encoding of concepts in the hippocampus ( Quiroga et al. , 2005 ) . Recent data in V4 also indicate the existence of cells with a similarly high degree of sparsity1 . Thus , we theorize such cells should exist in every level of the hierarchical visual system . We called these highly selective sparsely-responding feature detectors `` grandmother neurons '' to highlight their possible explicit encoding of specific prototypes , even though in reality , a prototype is likely represented by a sparse cluster of neurons rather than a single cell . Neurons in different layers of each visual area exhibit different degrees of response sparsity , complementing one another in various functions . The observations of this diverse set of super-sparsely responding feature detectors raise the following question : what are the possible computational benefits and rationales of having such neurons in the early visual cortex ? In this paper , we hypothesize that these `` grandmother neurons '' can serve as a prototype memory prior to modulate the process of image synthesis . Image synthesis is a central theme in a number of hierarchical models of the visual system , including interactive activation and predictive coding ( McClelland & Rumelhart , 2020 ; Grossberg , 1987 ; Mumford , 1992 ; Rao & Ballard , 1999 ; Lee & Mumford , 2003 ) , and is hypothesized to take place through the top-down feedback connections between areas in the visual cortex . These priors allow the synthesis process to look beyond the current spatial context and utilize the prototype memories learned and accumulated over time . Thus , the `` grandmother cells '' serve as structural conceptual priors in a memory attention process during image generation . 1Unfortunately the data is not publicly available yet . To emphasize the importance of having an attention mechanism that operated beyond the current image representation , we name our proposed memory-based attentional process Memory Concept Attention ( MoCA ) . MoCA is a module that can be plugged into any layer of pre-existing generator architectures in the GAN framework . We test our model by performing extensive experiments using the state-of-the-art StyleGAN2 ( Karras et al. , 2020b ) and a newly proposed few-shot image generator FastGAN ( Liu et al. , 2021 ) . Our experiments demonstrate the utilization of prototype information accumulated within the semantic clusters during training can improve few-shot image generation on Animal-Face Dog ( Si & Zhu , 2012 ) , 100-Shot-Obama ( Zhao et al. , 2020 ) , ImageNet100 ( Russakovsky et al. , 2015 ) , COCO-300 ( Lin et al. , 2014 ) , CIFAR10 ( Krizhevsky et al. , 2009 ) and Caltech-UCSD Birds ( CUB ) ( Welinder et al. , 2010 ) . Additionally , we also find that generators with MoCA can resist a certain degree of injected noise corruption during testing time , suggesting that attending to a structured memory prior during generation can improve the robustness of the model . Our goal here is to explore the utility of prototype cells as memory priors in a standard computer vision image generation task , with a view to gaining some insights into the advantages of having these `` grandmother '' neurons in the visual cortex at a functional level . 2 RELATED WORK . Visual Concept Learning Visual concepts , defined as intermediate level semantic features , have been shown to be effective in overcoming misclassification of objects due to occlusion when used in a feedforward voting scheme ( Wang et al. , 2017 ) . Explicit representations of visual concepts using prototype neurons might also serve as effective reconfigurable parts for building compositional machines ( Bienenstock et al. , 1997 ; Geman et al. , 2002 ; Zhu & Mumford , 2007 ) . In this paper , we explore the use of visual concepts in the form of prototype memory priors to provide temporal spatial and temporal contextual modulation with an attention mechanism for the complex compositional task of image generation . Self-Attention The attention mechanism ( Vaswani et al. , 2017 ) in deep learning is popular in Natural Language Processing ( NLP ) and is also known as `` non-local networks '' in the vision community ( Wang et al. , 2018 ) . Zhang et al . ( 2019a ) introduced self-attention into generative models in the Self-Attention GAN . Since then , adding self-attention into Generative Adversarial Networks has become a standard practice . Brock et al . ( 2018 ) and Esser et al . ( 2020 ) demonstrate the benefits of using self-attention in high-fidelity image synthesis models . However , current self-attention mechanisms in GANs only utilize contextual information within the same image to modulate the activation . In this work , we propose the use of a memory cache of intermediate-level visual conceptual prototypes to provide additional modulation in addition to the standard self-attention . In our work , the activation mechanism attends not only to its spatial context within the image itself , but also attends to a cached set of memory prototypes accumulated over time . Prototype Memory Mechanism A memory bank can capture diverse features over a long time period , and has been shown to be effective in other domains . Wu et al . ( 2018 ) utilizes a memory bank in contrastive learning to obtain more diverse negative samples to contrast with . Caron et al . ( 2020 ) also uses a memory queue during training to accumulate representative negative samples . He et al . ( 2020 ) shows that the stability of the features accumulated in the memory bank can be improved using a momentum-updated encoder , a strategy we will also use in learning our prototypes . SimGAN ( Shrivastava et al. , 2017 ) introduces the image pool trick which uses a buffer to store previously generated samples , in order to make the discriminator focus not only on the current training batch , but also improve itself based on memory . The major innovation of our work is the proposal , inspired by recent neurophysiological findings , that we should have memory banks at intermediate levels , and , in principle , every level of the visual hierarchy . While early memory bank work stored images at the instance level for object recognition , which is not useful for image generation , we argue that memory banks at lower levels of the hierarchy can store prototypes of parts and sub-parts which are useful for image generation . Few-shot image generation , in particular , can benefit from memory mechanisms that support flexible composition and decomposition of parts , particularly when data are limited . Few-Shot Prototypes Learning Few-shot learning refers to performing computer vision tasks when training data are very limited . One of the popular ideas in the few-shot learning literature is to form distinct prototypes from the training set and use them during testing ( Snell et al. , 2017 ) . Although MoCA also forms prototypes during the training stage and uses them during inference , there are two important distinctions between our work and Snell et al . ( 2017 ) : ( 1 ) Snell et al . ( 2017 ) forms prototypes at the instance level whereas MoCA ’ s prototypes are generated at the intermediate parts level . ( 2 ) Snell et al . ( 2017 ) simply selects the closest prototype to obtain discrete class prediction , MoCA , on the other hand , employs an attention process to continuously modulate the activation features based on the prototypes , hence can be applied to a broader set of tasks , including image synthesis , which predicts continuous pixel values . Few-Shot Image Generation Few-shot image generation task is a challenging task as GANs are very data-hungry and inefficient . Unconditional image generation is especially difficult among the current few-shot image generation schemes . Different solutions have been developed in the literature . Recent works such as DiffAug ( Zhao et al. , 2020 ) , StyleGAN-Ada ( Karras et al. , 2020a ) propose differentiable augmentation to avoid overfitting in the discriminator . InsGen ( Yang et al. , 2021 ) proposes to use a contrastive learning objective to enhance the adversarial loss in the few-shot generation setting . These works mostly proposed methods to improve the discriminators so that they can provide better error signals to the generator , but do not specifically address the generator architecture . Another line of research proposed generator architectures to avoid mode collapse . The state-of-the-art architecture for few-shot image generation ( hundreds of real images ) is FastGAN ( Liu et al. , 2021 ) . Here , we propose a new architectural change on the generator side and make comparison against FastGAN architecture extensively in the experiment section . 3 METHODS . Our key contribution is the introduction of a novel prototype-based memory modulation module to improve the generator network of a GAN . The activation from the previous layer is modified by two attention processes : 1 ) contextual modulation with Memory Concept Attention ( MoCA ) , and 2 ) spatial contextual modulation within the generated image itself ( Self-Attention ) . Our module takes a feature map in the GAN hierarchy as input combines the results of these two mechanisms to modulate the feature map for further downstream processing . A high-level overview of our model is shown in Figure 1 . Formally , we denote the input to our MoCA layer to be the activation of a particular layer , A ∈ Rn×c×h×w . The output produces a modulation H ∈ Rn×c×h×w that update A into  . To allow the information to be flexibly modulated , we first transform A by 1× 1 convolutions into a lowerdimensional space via functions θ ( · ) , φ ( · ) , and ψ ( · ) , where { θ ( A ) , φ ( A ) , ψ ( A ) } ∈ Rn×c̃ ×h×w . 3.1 PROTOTYPE MEMORY LEARNING . In this section , we discuss the organization of our prototype memory that is used as one route of modulation . Our prototype concept memory is arranged hierarchically into semantic cells and prototype cells . As shown in Figure 2 , each semantic cell is cluster mean representative of a cluster of prototype cells . Formally , suppose our memory P consists of M semantic cells P = { K1 , K2 , ... , KM } . For each of the semantic cells Ki , there are T of prototype cells { E ( i ) 1 , E ( i ) 2 , E ( i ) 3 , ... , E ( i ) T } stored in the memory cell associated with Ki , where E ( i ) j and Ki both ∈ Rc̃ and Ki = ( ∑T j=1E ( i ) j ) /T is the mean of the stored prototype cells . These prototype cells come from the feature maps in previous iterations after being transformed via a momentum updated context encoder φ̃ ( · ) and are updated in the memory at the end of every training iteration . φ̃ ( · ) is a momentum counterpart of φ ( · ) and its parameter is updated as shown in Equation 1 with the momentum parameter m. φ̃ ( · ) does not change as rapidly as φ ( · ) so that the prototype learned are more stable , accumulating information beyond the current training batch . The rationale is similar to that in ( He et al. , 2020 ) ) . φ̃θ ← φ̃θ ∗ ( 1−m ) + φθ ∗m ( 1 ) After transformed by φ̃ ( · ) to a low-dimensional space , the activation at each hypercolumn ( pixel location ) in the feature map is assigned to its closest semantic cluster and replaces an existing prototype cell in the memory bank of that cluster . We use a random replacement policy to prevent the prototype cells from all collapsing to trivial solutions . The update is done in a batch synchronized fashion , i.e . we update Ki as the cluster mean of the ith cluster of prototypes after the entire memory is updated based on the recent batch . | Paper proposes a novel prototype-based memory modulation layer (MoCA) to improve the generator network of a GAN. The target problem is few-shot image generation. Memory is arranged hierarchically into prototype semantic cells and prototype component cells. This design is loosely inspired by the recent discovery of "grandmother cells" in V1. Experimental results show that in terms of FID score, using FastGAN base architecture, MoCA can bring 5.8% improvement on Animal Face Dog, 13.8% improvement on Obama, 21.7% improvement on ImageNet-100 and 12.4% improvement on COCO-300 dataset when using FastGAN as the baseline models. With StyleGAN2 base architecture, there was an 5.1% improvement on Animal Face Dog dataset, 8.1% improvement on Obama dataset, 14.1% improvement on ImageNet-100 dataset and 17.3% improvement on COCO-300 dataset. | SP:5b88514d3eba834efba72c605496c4c057c30387 |
Better Supervisory Signals by Observing Learning Paths | 1 INTRODUCTION . In multi-class classification problems , we usually supervise our model with “ one-hot ” labels : label vectors y which have yi = 1 for one i , and 0 for all other dimensions . Over time , however , it has gradually become clear that this “ default ” setup is not always the best choice in practice , as measured by the generalization performance of the resulting model.1 One alternative is to summarize a distribution of human annotations , as Peterson et al . ( 2019 ) did on CIFAR-10 . An alternative approach is label smoothing ( e.g . Szegedy et al. , 2016 ) , mixing between a one-hot label and the uniform distribution . Knowledge distillation ( KD ) , first training a teacher network on the training set and then a student network on the teacher ’ s output probabilities , was originally proposed for model compression ( Hinton et al. , 2015 ) but can also be thought of as refining the supervision signal : it provides “ soft ” teacher outputs rather than hard labels to the student . Knowledge distillation is promising because it requires no additional annotation effort , but , unlike label smoothing , can still provide sample-specific refinement . Perhaps surprisingly , knowledge distillation can improve student performance even when the teacher is of exactly the same form as the student ; this is known as self-distillation ( Furlanello et al. , 2018 ; Zhang et al. , 2019 ) . There have been many recent attempts to explain the success of knowledge distillation and specifically self-distillation ( e.g . Menon et al. , 2021 ; Allen-Zhu & Li , 2020 ; Tang et al. , 2020 ) , from both optimization and supervision perspectives . We focus on the latter area , where it is usually claimed that the teacher provides useful “ dark knowledge ” to the student through its labels . Inspired by this line of work , we further explore why and how this improved supervisory signal emerges during the teacher ’ s one-hot training . Specifically , we first clarify that given any input sample x , good supervision signals should be close ( in L2 distance ) to the ground truth categorical distribution , i.e. , p∗ ( y | x ) . We then show that a neural network ( NN ) can automatically refine “ bad labels ” , those where p∗ ( y | x ) is far from the one-hot vector from the training set.2 During one-hot training , the model prediction on such a sample first moves towards p∗ ( y | x ) , and then slowly 1We are concerned here only with traditional i.i.d . generalization from the training set to held-out test sets . 2This might be because x is ambiguous ( perhaps p∗ ( y | x ) is flat , or we simply got a sample from a less- likely class ) , or because the one-hot label has been corrupted through label noise or otherwise is “ wrong. ” converges to its supervisory label , following a “ zig-zag ” pattern . A well-trained teacher , one that does not overfit to particular training labels , can thus provide supervisory signals closer to p∗ ( y | x ) . We find this phenomenon is quite common in gradient descent training , and provide some analytical justification ( Section 3.3 ) . Based on our explanations , we point out that this signal can be better achieved if we take a moving average of the teacher ’ s prediction , an algorithm we term Filter-KD . This approach provides better supervision and hence better final performance , especially when there are more bad labels . 2 SUPERVISION INFLUENCES GENERALIZATION . We will begin by establishing the classification setting , and making clearer how the choice of supervisory signal affects the learned model . 2.1 CHOICES OF SUPERVISION SIGNAL . In K-way classification , our goal is to learn a mapping f : X → ∆K that can minimize the risk R ( f ) , E ( x , y ) ∼P [ L ( y , f ( x ) ] = ∫ p ( x ) p ( y|x ) L ( y , f ( x ) ) dxdy , ( 1 ) where L ( y , f ( x ) ) is the loss function measuring the gap between model ’ s prediction and the true label ( e.g . cross-entropy or square loss ) . The true label y is an integer ranging from 1 to K , and the input signal x is usually high dimensional , e.g. , an image or a sequence of word embeddings . The joint distribution of ( x , y ) is P , whose density3 can be written as p ( x ) p ( y|x ) . In practice , as P is unknown , we instead ( approximately ) minimize the empirical risk Remp ( f , D ) , N∑ n=1 K∑ k=1 1 N 1 ( yn=k ) L ( k , f ( xn ) ) = N∑ n=1 1 N eTynL ( f ( xn ) ) , ( 2 ) where 1 ( yn = k ) is an indicator function which equals 1 if yn = k or 0 otherwise , and eyn ∈ { 0 , 1 } K is its one-hot vector form . L ( f ( xn ) ) = ( L ( 1 , f ( xn ) ) , . . . , L ( K , f ( xn ) ) ) ∈ RK is the loss for each possible label . In Remp , the N training pairs D , { ( xn , yn ) } Nn=1 are sampled i.i.d . from P. Comparing ( 2 ) to ( 1 ) , we find that p ( x ) is approximated by an uniform distribution over the samples , which is reasonable . However , using an indicator function ( i.e. , one-hot distribution ) to approximate p ( y | x ) bears more consideration . For example , if a data point x is quite vague and its true p ( y|x ) is flat or multimodal , we might hope to see x multiple times with different label y during training . But actually , most datasets have only one copy of each x , so we only ever see one corresponding ey . Although Remp is an unbiased estimator for R , if we used a better ( e.g . lower-variance ) estimate of p ( y | x ) , we could get a better estimate for R and thus , hopefully , better generalization . Specifically , suppose we were provided a “ target ” distribution ptar ( y | x ) ( written in vector form as ptar ( x ) ) for each training point x , as D′ = { ( xn , ptar ( xn ) ) } Nn=1 . Then we could use Rtar ( f , D′ ) , N∑ n=1 K∑ k=1 1 N ptar ( yn = k | xn ) L ( k , f ( xn ) ) = N∑ n=1 1 N ptar ( xn ) TL ( f ( xn ) ) . ( 3 ) Standard training with Remp is a special case of Rtar , using ptar ( xn ) = eyn . The CIFAR-10H dataset ( Peterson et al. , 2019 ) is one attempt at a different ptar , using multiple human annotators to estimate ptar . Label smoothing ( e.g . Szegedy et al. , 2016 ) sets ptar to a convex combination of ey and the constant vector 1K 1 . In knowledge distillation ( KD ; Hinton et al. , 2015 ) , a teacher is first trained on D , then a student learns from D′ with ptar based on the teacher ’ s outputs . All three approaches yield improvements over standard training with Remp . 3Because we are working with classification problems , we use densities with respect to a product of some arbitrary measure on x ( probably Lebesgue ) with counting measure on y , and assume that these densities exist for notational convenience . None of our arguments will depend on the choice of base measure . 2.2 MEASURING THE QUALITY OF SUPERVISION . Choosing a different ptar , then , can lead to a better final model . Can we characterize which ptar will do well ? We propose the following , as a general trend . Hypothesis 1 . Suppose we train a model supervised by ptar , that is , we minimize Rtar ( f , D′ ) . Then , smaller average L2 distance between ptar and the ground truth p ∗ on these samples , i.e . small Ex [ ‖ptar ( x ) − p∗ ( x ) ‖2 ] , will in general lead to better generalization performance . This hypothesis is suggested by Proposition 3 of Menon et al . ( 2021 ) , which shows that for any predictor f and loss bounded as L ( y , ŷ ) ≤ ` , E x [ ( Rtar ( f , D′ ) −R ( f ) ) 2 ] ≤ 1 N Var x [ pTtarL ( f ( x ) ) ] +K ` 2 ( E x [ ‖ptar ( x ) − p∗ ( x ) ‖2 ] ) 2 . ( 4 ) When N is large , the second term will dominate the right-hand side , implying smaller average ‖ptar − p∗‖ will lead to Rtar being a better approximation of the true risk R. Minimizing a better Rtar should then lead to a better model , suggesting that the quality of the supervision signal can be roughly measured by its L2 distance to the ground truth p∗ . To further support this hypothesis , we conduct experiments on a synthetic Gaussian problem ( Figure 1 ( a ) ; details in Appendix B ) , where we can easily calculate p∗ ( y | x ) for each sample . We first generate several different ptar by adding noise 4 to the ground truth p∗ , then train simple 3-layer NNs under that supervision . We also show five baselines : one-hot training ( OHT ) , label smoothing ( LS ) , KD , early-stopped KD ( ESKD ) , and ground truth ( GT ) supervision ( using p∗ ) . KD refers to a teacher trained to convergence , while ESKD uses a teacher stopped early based on validation accuracy . We early-stop the student ’ s training in all settings . From Figure 1 ( b-c ) , it is clear that smaller ‖ptar − p∗‖2 leads to better generalization performance , as measured either by accuracy ( ACC ) or expected calibration error ( ECE ) 5 on a held-out test set . Appendix A has more detailed results . 3 INSIGHTS FROM THE LEARNING PATH . In the toy example of Section 2 , we see that ESKD outperforms other baselines in accuracy by a substantial margin ( and all baselines are roughly tied in ECE ) . We expect that supervision with smaller ‖ptar − p∗‖2 leads to better generalization performance , but it is not clear how better ptar emerges from when the teacher in ESKD is trained using one-hot labels . This section will answer this , by observing the learning paths of training samples . 4Whenever we mention adding noise to p∗ , we mean we add independent noise to each dimension , and then re-normalize it to be a distribution . Large noise can thus flip the “ correct ” label . 5ECE measures the calibration of a model ( Guo et al. , 2017 ) . Briefly , lower ECE means the model ’ s confidence in its predictions is more accurate . See Appendix A for details . | This paper proposes an explanation for the success of distillation. It first experiments with synthetic Gaussian data. On synthetic data, it shows that distillation works better from an early-stopped model. It probes why, and finds that, when the one-hot label is far from the true conditional distribution, the early-stopped model’s distribution tends to be closer to the true distribution than either the one-hot label or the converged model. The early-stopped model is better because, over the course of training, the model tends to produce a distribution close to the true one before finally overfitting the one-hot label. Some examples show similar patterns for real-world networks/datasets, provided the predictions over training are smoothed. Motivated by these results, the paper proposes to use an averaged distribution of labels from different steps of training rather than the distribution at the end of training, and shows that this improves performance by a little bit. | SP:781801713deb9efac5404cb98f6c40c83244cc14 |
Better Supervisory Signals by Observing Learning Paths | 1 INTRODUCTION . In multi-class classification problems , we usually supervise our model with “ one-hot ” labels : label vectors y which have yi = 1 for one i , and 0 for all other dimensions . Over time , however , it has gradually become clear that this “ default ” setup is not always the best choice in practice , as measured by the generalization performance of the resulting model.1 One alternative is to summarize a distribution of human annotations , as Peterson et al . ( 2019 ) did on CIFAR-10 . An alternative approach is label smoothing ( e.g . Szegedy et al. , 2016 ) , mixing between a one-hot label and the uniform distribution . Knowledge distillation ( KD ) , first training a teacher network on the training set and then a student network on the teacher ’ s output probabilities , was originally proposed for model compression ( Hinton et al. , 2015 ) but can also be thought of as refining the supervision signal : it provides “ soft ” teacher outputs rather than hard labels to the student . Knowledge distillation is promising because it requires no additional annotation effort , but , unlike label smoothing , can still provide sample-specific refinement . Perhaps surprisingly , knowledge distillation can improve student performance even when the teacher is of exactly the same form as the student ; this is known as self-distillation ( Furlanello et al. , 2018 ; Zhang et al. , 2019 ) . There have been many recent attempts to explain the success of knowledge distillation and specifically self-distillation ( e.g . Menon et al. , 2021 ; Allen-Zhu & Li , 2020 ; Tang et al. , 2020 ) , from both optimization and supervision perspectives . We focus on the latter area , where it is usually claimed that the teacher provides useful “ dark knowledge ” to the student through its labels . Inspired by this line of work , we further explore why and how this improved supervisory signal emerges during the teacher ’ s one-hot training . Specifically , we first clarify that given any input sample x , good supervision signals should be close ( in L2 distance ) to the ground truth categorical distribution , i.e. , p∗ ( y | x ) . We then show that a neural network ( NN ) can automatically refine “ bad labels ” , those where p∗ ( y | x ) is far from the one-hot vector from the training set.2 During one-hot training , the model prediction on such a sample first moves towards p∗ ( y | x ) , and then slowly 1We are concerned here only with traditional i.i.d . generalization from the training set to held-out test sets . 2This might be because x is ambiguous ( perhaps p∗ ( y | x ) is flat , or we simply got a sample from a less- likely class ) , or because the one-hot label has been corrupted through label noise or otherwise is “ wrong. ” converges to its supervisory label , following a “ zig-zag ” pattern . A well-trained teacher , one that does not overfit to particular training labels , can thus provide supervisory signals closer to p∗ ( y | x ) . We find this phenomenon is quite common in gradient descent training , and provide some analytical justification ( Section 3.3 ) . Based on our explanations , we point out that this signal can be better achieved if we take a moving average of the teacher ’ s prediction , an algorithm we term Filter-KD . This approach provides better supervision and hence better final performance , especially when there are more bad labels . 2 SUPERVISION INFLUENCES GENERALIZATION . We will begin by establishing the classification setting , and making clearer how the choice of supervisory signal affects the learned model . 2.1 CHOICES OF SUPERVISION SIGNAL . In K-way classification , our goal is to learn a mapping f : X → ∆K that can minimize the risk R ( f ) , E ( x , y ) ∼P [ L ( y , f ( x ) ] = ∫ p ( x ) p ( y|x ) L ( y , f ( x ) ) dxdy , ( 1 ) where L ( y , f ( x ) ) is the loss function measuring the gap between model ’ s prediction and the true label ( e.g . cross-entropy or square loss ) . The true label y is an integer ranging from 1 to K , and the input signal x is usually high dimensional , e.g. , an image or a sequence of word embeddings . The joint distribution of ( x , y ) is P , whose density3 can be written as p ( x ) p ( y|x ) . In practice , as P is unknown , we instead ( approximately ) minimize the empirical risk Remp ( f , D ) , N∑ n=1 K∑ k=1 1 N 1 ( yn=k ) L ( k , f ( xn ) ) = N∑ n=1 1 N eTynL ( f ( xn ) ) , ( 2 ) where 1 ( yn = k ) is an indicator function which equals 1 if yn = k or 0 otherwise , and eyn ∈ { 0 , 1 } K is its one-hot vector form . L ( f ( xn ) ) = ( L ( 1 , f ( xn ) ) , . . . , L ( K , f ( xn ) ) ) ∈ RK is the loss for each possible label . In Remp , the N training pairs D , { ( xn , yn ) } Nn=1 are sampled i.i.d . from P. Comparing ( 2 ) to ( 1 ) , we find that p ( x ) is approximated by an uniform distribution over the samples , which is reasonable . However , using an indicator function ( i.e. , one-hot distribution ) to approximate p ( y | x ) bears more consideration . For example , if a data point x is quite vague and its true p ( y|x ) is flat or multimodal , we might hope to see x multiple times with different label y during training . But actually , most datasets have only one copy of each x , so we only ever see one corresponding ey . Although Remp is an unbiased estimator for R , if we used a better ( e.g . lower-variance ) estimate of p ( y | x ) , we could get a better estimate for R and thus , hopefully , better generalization . Specifically , suppose we were provided a “ target ” distribution ptar ( y | x ) ( written in vector form as ptar ( x ) ) for each training point x , as D′ = { ( xn , ptar ( xn ) ) } Nn=1 . Then we could use Rtar ( f , D′ ) , N∑ n=1 K∑ k=1 1 N ptar ( yn = k | xn ) L ( k , f ( xn ) ) = N∑ n=1 1 N ptar ( xn ) TL ( f ( xn ) ) . ( 3 ) Standard training with Remp is a special case of Rtar , using ptar ( xn ) = eyn . The CIFAR-10H dataset ( Peterson et al. , 2019 ) is one attempt at a different ptar , using multiple human annotators to estimate ptar . Label smoothing ( e.g . Szegedy et al. , 2016 ) sets ptar to a convex combination of ey and the constant vector 1K 1 . In knowledge distillation ( KD ; Hinton et al. , 2015 ) , a teacher is first trained on D , then a student learns from D′ with ptar based on the teacher ’ s outputs . All three approaches yield improvements over standard training with Remp . 3Because we are working with classification problems , we use densities with respect to a product of some arbitrary measure on x ( probably Lebesgue ) with counting measure on y , and assume that these densities exist for notational convenience . None of our arguments will depend on the choice of base measure . 2.2 MEASURING THE QUALITY OF SUPERVISION . Choosing a different ptar , then , can lead to a better final model . Can we characterize which ptar will do well ? We propose the following , as a general trend . Hypothesis 1 . Suppose we train a model supervised by ptar , that is , we minimize Rtar ( f , D′ ) . Then , smaller average L2 distance between ptar and the ground truth p ∗ on these samples , i.e . small Ex [ ‖ptar ( x ) − p∗ ( x ) ‖2 ] , will in general lead to better generalization performance . This hypothesis is suggested by Proposition 3 of Menon et al . ( 2021 ) , which shows that for any predictor f and loss bounded as L ( y , ŷ ) ≤ ` , E x [ ( Rtar ( f , D′ ) −R ( f ) ) 2 ] ≤ 1 N Var x [ pTtarL ( f ( x ) ) ] +K ` 2 ( E x [ ‖ptar ( x ) − p∗ ( x ) ‖2 ] ) 2 . ( 4 ) When N is large , the second term will dominate the right-hand side , implying smaller average ‖ptar − p∗‖ will lead to Rtar being a better approximation of the true risk R. Minimizing a better Rtar should then lead to a better model , suggesting that the quality of the supervision signal can be roughly measured by its L2 distance to the ground truth p∗ . To further support this hypothesis , we conduct experiments on a synthetic Gaussian problem ( Figure 1 ( a ) ; details in Appendix B ) , where we can easily calculate p∗ ( y | x ) for each sample . We first generate several different ptar by adding noise 4 to the ground truth p∗ , then train simple 3-layer NNs under that supervision . We also show five baselines : one-hot training ( OHT ) , label smoothing ( LS ) , KD , early-stopped KD ( ESKD ) , and ground truth ( GT ) supervision ( using p∗ ) . KD refers to a teacher trained to convergence , while ESKD uses a teacher stopped early based on validation accuracy . We early-stop the student ’ s training in all settings . From Figure 1 ( b-c ) , it is clear that smaller ‖ptar − p∗‖2 leads to better generalization performance , as measured either by accuracy ( ACC ) or expected calibration error ( ECE ) 5 on a held-out test set . Appendix A has more detailed results . 3 INSIGHTS FROM THE LEARNING PATH . In the toy example of Section 2 , we see that ESKD outperforms other baselines in accuracy by a substantial margin ( and all baselines are roughly tied in ECE ) . We expect that supervision with smaller ‖ptar − p∗‖2 leads to better generalization performance , but it is not clear how better ptar emerges from when the teacher in ESKD is trained using one-hot labels . This section will answer this , by observing the learning paths of training samples . 4Whenever we mention adding noise to p∗ , we mean we add independent noise to each dimension , and then re-normalize it to be a distribution . Large noise can thus flip the “ correct ” label . 5ECE measures the calibration of a model ( Guo et al. , 2017 ) . Briefly , lower ECE means the model ’ s confidence in its predictions is more accurate . See Appendix A for details . | This paper introduces a method for doing knowledge distillation with noisy labels. The contribution consists on representing distilled labels as a weighted moving average of the predicted labels from a teacher as it trains (using noisy one-hot encoded labels). Finally, a student is trained using the distilled labels. | SP:781801713deb9efac5404cb98f6c40c83244cc14 |
Group equivariant neural posterior estimation | 1 INTRODUCTION . Bayesian inference provides a means of characterizing a system by comparing models against data . Given a forward model or likelihood p ( x|θ ) for data x described by parameters θ , and a prior p ( θ ) , the Bayesian posterior is proportional to the product , p ( θ|x ) ∝ p ( x|θ ) p ( θ ) . Sampling techniques such as Markov Chain Monte Carlo ( MCMC ) can be used to build up a posterior distribution provided the likelihood and prior can be evaluated . For models with intractable or expensive likelihoods ( as often arise in scientific applications ) simulation-based ( or likelihood-free ) inference methods offer a powerful alternative ( Cranmer et al. , 2020 ) . In particular , neural posterior estimation ( NPE ) ( Papamakarios & Murray , 2016 ) uses expressive conditional density estimators such as normalizing flows ( Rezende & Mohamed , 2015 ; Papamakarios et al. , 2021 ) to build surrogates for the posterior . These are trained using model simulations x ∼ p ( x|θ ) , and allow for rapid sampling for any x ∼ p ( x ) , thereby amortizing training costs across future observations . NPE and other density-estimation methods for simulation-based inference ( Gutmann & Corander , 2016 ; Papamakarios et al. , 2019 ; Hermans et al. , 2020 ) have been reported to be more simulation-efficient ( Lueckmann et al. , 2021 ) than classical likelihood-free methods such as Approximate Bayesian Computation ( Sisson et al. , 2018 ) . Hanford Livingston stan dard ized dire ctio n Virgo Training an inference network for any x ∼ p ( x ) can nevertheless present challenges due to the large number of training samples and powerful networks required . The present study is motivated by the problem of gravitational-wave ( GW ) data analysis . Here the task is to infer properties of astrophysical black-hole mergers based on GW signals observed at the LIGO and Virgo observatories on Earth . Due to the complexity of signal models , it has previously not been possible to train networks to estimate posteriors to the same accuracy as conventional likelihood-based methods ( Veitch et al. , 2015 ; Ashton et al. , 2019 ) . The GW posterior , however , is equivariant1 under an overall change in the time of arrival of the data . It is also approximately equivariant under a joint change in the sky position and ( by triangulation ) individual shifts in the arrival times in each detector ( Fig . 1 ) . If we could constrain these parameters a priori , we could therefore apply time shifts to align the detector data and simplify the inference task for the remaining parameters . More generally , we consider forward models with known equivariances under group transformations applied jointly to data and parameters . Our aim is to exploit this knowledge to standardize the pose of the data2 and simplify analysis . The obvious roadblock is that the pose is contained in the set of parameters θ and is therefore unknown prior to inference . Here we describe group equivariant neural posterior estimation ( GNPE ) , a method to self-consistently infer parameters and standardize the pose . The basic approach is to introduce a proxy for the pose—a blurred version—on which one conditions the posterior . The pose of the data is then transformed based on the proxy , placing it in a band about the standard value , and resulting in an easier inference task . Finally , the joint posterior over θ and the pose proxy can be sampled at inference time using Gibbs sampling . The standard method to incorporating equivariances is to integrate them directly into network architectures , e.g. , to use convolutional networks for translational equivariances . Although these approaches can be highly effective , they impose design constraints on network architectures . For GWs , for example , we use specialized embedding networks to extract signal waveforms from frequencydomain data , as well as expressive normalizing flows to estimate the posterior—neither of which is straightforward to make explicitly equivariant . We also have complex equivariance connections between subsets of parameters and data , including approximate equivariances . The GNPE algorithm is extremely general : it is architecture-independent , it applies whether equivariances are exact or approximate , and it allows for arbitrary equivariance relations between parameters and data . We discuss related work in Sec . 2 and describe the GNPE algorithm in Sec . 3 . In Sec . 4 we apply GNPE to a toy example with exact translational equivariance , showing comparable simulation efficiency to NPE combined with a convolutional network . In Sec . 5 we show that standard NPE does not achieve adequate accuracy for GW parameter inference , even with an essentially unlimited number of simulations . In contrast , GNPE achieves highly accurate posteriors at a computational cost three orders of magnitude lower than bespoke MCMC approaches ( Veitch et al. , 2015 ) . The present paper describes the GNPE method which we developed for GW analysis ( Dax et al. , 2021 ) , and extends it to general equivariance transformations which makes it applicable to a wide range of problems . A detailed description of GW results is presented in Dax et al . ( 2021 ) . 2 RELATED WORK . The most common way of integrating equivariances into machine learning algorithms is to use equivariant network architectures ( Krizhevsky et al. , 2012 ; Cohen & Welling , 2016 ) . This can be in 1In physics , the term “ covariant ” is frequently used instead of “ equivariant ” . 2We adopt the language from computer vision by Jaderberg et al . ( 2015 ) . conflict with design considerations such as data representation and flexibility of the architecture , and imposes constraints such as locality . GNPE achieves complete separation of equivariances from these considerations , requiring only the ability to efficiently transform the pose . Normalizing flows are particularly well suited to NPE , and there has been significant progress in constructing equivariant flows ( Boyda et al. , 2021 ) . However , these studies consider joint transformations of parameters of the base space and sample space—not joint transformation of data and parameters for conditional flows , as we consider here . GNPE enables end-to-end equivariances from data to parameters . Consider , by contrast , a conditional normalizing flow with a convolutional embedding network : the equivariance persists through the embedding network but is broken by the flow . Although this may improve learning , it does not enforce an end-to-end equivariance . This contrasts with an invariance , for which the above would be sufficient . Finally , GNPE can also be applied if the equivariance is only approximate . Several other approaches integrate domain knowledge of the forward model ( Baydin et al. , 2019 ; Brehmer et al. , 2020 ) by considering a “ gray-box ” setting . GNPE allows us to incorporate high-level domain knowledge about approximate equivariances of forward models without requiring access to its implementation or internal states of the simulator . Rather , it can be applied to “ black-box ” code . An alternative approach to incorporate geometrical knowledge into classical likelihood-free inference algorithms ( e.g. , Approximate Bayesian Computation , see ( Sisson et al. , 2018 ) ) is by constructing ( Fearnhead & Prangle , 2012 ) or learning ( Jiang et al. , 2017 ; Chen et al. , 2021 ) equivariant summary statistics s ( x ) , which are used as input to the inference algorithm instead of the raw data x . However , designing equivariant summary statistics ( rather than invariant ones ) can be challenging , and furthermore inference will be biased if the equivariance only holds approximately . Past studies using machine-learning techniques for amortized GW parameter inference ( Gabbard et al. , 2019 ; Chua & Vallisneri , 2020 ; Green & Gair , 2021 ; Delaunoy et al. , 2020 ) all consider simplified problems ( e.g. , only a subset of parameters , a simplified posterior , or a limited treatment of detector noise ) . In contrast , the GNPE-based study in Dax et al . ( 2021 ) is the only one to treat the full amortized parameter inference problem with accuracy matching standard methods . 3 METHODS . 3.1 NEURAL POSTERIOR ESTIMATION . NPE ( Papamakarios & Murray , 2016 ; Greenberg et al. , 2019 ) is a simulation-based inference method that directly targets the posterior . Given a dataset of prior parameter samples θ ( i ) ∼ p ( θ ) and corresponding model simulations x ( i ) ∼ p ( x|θ ( i ) ) , it trains a neural density estimator q ( θ|x ) to estimate p ( θ|x ) . This is achieved by minimizing the loss LNPE = Ep ( θ ) Ep ( x|θ ) [ − log q ( θ|x ) ] ( 1 ) across the dataset of ( θ ( i ) , x ( i ) ) pairs . This maximum likelihood objective leads to recovery of p ( θ|x ) if q ( θ|x ) is sufficiently flexible . Normalizing flows ( Rezende & Mohamed , 2015 ; Durkan et al. , 2019 ) are a particularly expressive class of conditional density estimators commonly used for NPE . NPE amortizes inference : once q ( θ|x ) is trained , inference is very fast for any observed data xo , so training costs are shared across observations . The approach is also extremely flexible , as it treats the forward model as a black box , relying only on prior samples and model simulations . In many situations , however , these data have known structure that one wants to exploit to improve learning . 3.2 EQUIVARIANCES UNDER TRANSFORMATION GROUPS . In this work we describe a generic method to incorporate equivariances under joint transformations of θ and x into NPE . A typical example arises when inferring the position of an object from image data . In this case , if we spatially translate an image x by some offset ~d—effected by relabeling the pixels— then the inferred position θ should also transform by ~d—by addition to the position coordinates θ. Translations are composable and invertible , and there exists a trivial identity translation , so the set of translations has a natural group structure . Our method works for any continuous transformation group , including rotations , dilations , etc. , and in this section we keep the discussion general . For a transformation group G , we denote the action of g ∈ G on parameters and data as θ → gθ , ( 2 ) x→ Tgx . ( 3 ) Here , Tg refers to the group representation under which the data transform ( e.g. , for image translations , the pixel relabeling ) . We adopt the natural convention that G is defined by its action on θ , so we do not introduce an explicit representation on parameters . The posterior distribution p ( θ|x ) is said to be equivariant under G if , when the parameter and data spaces are jointly G-transformed , the posterior is unchanged , i.e. , p ( θ|x ) = p ( gθ|Tgx ) |det Jg| , ∀g ∈ G. ( 4 ) The right-hand side comes from the change-of-variables rule . For translations the Jacobian Jg has unit determinant , but we include it for generality . For NPE , we are concerned with equivariant posteriors , however it is often more natural to think of equivariant forward models ( or likelihoods ) . An equivariant likelihood and an invariant prior together yield an equivariant posterior ( App . A.1 ) . Our goal is to use equivariances to simplify the data—to G-transform x such that θ is taken to a fiducial value . For the image example , this could mean translating the object of interest to the center . In general , θ can also include parameters unchanged under G ( e.g. , the color of the object ) , so we denote the corresponding standardized parameters by θ0 . These are related to θ by a group transformation denoted gθ , such that gθθ0 = θ . We refer to gθ as the “ pose ” of θ , and standardizing the pose means to take it to the group identity element e ∈ G. Applying T ( gθ ) −1 to the data space effectively reduces its dimensionality , making it easier to interpret for a neural network . Although the preceding discussion applies to equivariances that hold exactly , our method in fact generalizes to approximate equivariances . We say that a posterior is approximately equivariant under G if ( 4 ) does not hold , but standardizing the pose nevertheless reduces the effective dimensionality of the dataset . An approximately equivariant posterior can arise if an exact equivariance of the forward model is broken by a non-invariant prior , or if the forward model is itself non-equivariant . | The authors propose group equivariant neural posterior estimation (GNPE), a posterior estimation method which can self-consistently infer parameters and standardize the pose. For equivariant posterior distributions, the GNPE can achieve better performance than the traditional NPE. Moreover, GNPE can also be applied to cases where the equivariance of the posterior is approximately estimated. The major advantage of GNPE over the other flow based models under equivariance constraints is that GNPE is architecture-indepenent, i.e., an arbitrary flow model can be utilized in GNPE and we don't need to design a special network structure for the equivariance. | SP:b0f193db92cf2541bc252cb492ee3f9a6d50fc16 |
Group equivariant neural posterior estimation | 1 INTRODUCTION . Bayesian inference provides a means of characterizing a system by comparing models against data . Given a forward model or likelihood p ( x|θ ) for data x described by parameters θ , and a prior p ( θ ) , the Bayesian posterior is proportional to the product , p ( θ|x ) ∝ p ( x|θ ) p ( θ ) . Sampling techniques such as Markov Chain Monte Carlo ( MCMC ) can be used to build up a posterior distribution provided the likelihood and prior can be evaluated . For models with intractable or expensive likelihoods ( as often arise in scientific applications ) simulation-based ( or likelihood-free ) inference methods offer a powerful alternative ( Cranmer et al. , 2020 ) . In particular , neural posterior estimation ( NPE ) ( Papamakarios & Murray , 2016 ) uses expressive conditional density estimators such as normalizing flows ( Rezende & Mohamed , 2015 ; Papamakarios et al. , 2021 ) to build surrogates for the posterior . These are trained using model simulations x ∼ p ( x|θ ) , and allow for rapid sampling for any x ∼ p ( x ) , thereby amortizing training costs across future observations . NPE and other density-estimation methods for simulation-based inference ( Gutmann & Corander , 2016 ; Papamakarios et al. , 2019 ; Hermans et al. , 2020 ) have been reported to be more simulation-efficient ( Lueckmann et al. , 2021 ) than classical likelihood-free methods such as Approximate Bayesian Computation ( Sisson et al. , 2018 ) . Hanford Livingston stan dard ized dire ctio n Virgo Training an inference network for any x ∼ p ( x ) can nevertheless present challenges due to the large number of training samples and powerful networks required . The present study is motivated by the problem of gravitational-wave ( GW ) data analysis . Here the task is to infer properties of astrophysical black-hole mergers based on GW signals observed at the LIGO and Virgo observatories on Earth . Due to the complexity of signal models , it has previously not been possible to train networks to estimate posteriors to the same accuracy as conventional likelihood-based methods ( Veitch et al. , 2015 ; Ashton et al. , 2019 ) . The GW posterior , however , is equivariant1 under an overall change in the time of arrival of the data . It is also approximately equivariant under a joint change in the sky position and ( by triangulation ) individual shifts in the arrival times in each detector ( Fig . 1 ) . If we could constrain these parameters a priori , we could therefore apply time shifts to align the detector data and simplify the inference task for the remaining parameters . More generally , we consider forward models with known equivariances under group transformations applied jointly to data and parameters . Our aim is to exploit this knowledge to standardize the pose of the data2 and simplify analysis . The obvious roadblock is that the pose is contained in the set of parameters θ and is therefore unknown prior to inference . Here we describe group equivariant neural posterior estimation ( GNPE ) , a method to self-consistently infer parameters and standardize the pose . The basic approach is to introduce a proxy for the pose—a blurred version—on which one conditions the posterior . The pose of the data is then transformed based on the proxy , placing it in a band about the standard value , and resulting in an easier inference task . Finally , the joint posterior over θ and the pose proxy can be sampled at inference time using Gibbs sampling . The standard method to incorporating equivariances is to integrate them directly into network architectures , e.g. , to use convolutional networks for translational equivariances . Although these approaches can be highly effective , they impose design constraints on network architectures . For GWs , for example , we use specialized embedding networks to extract signal waveforms from frequencydomain data , as well as expressive normalizing flows to estimate the posterior—neither of which is straightforward to make explicitly equivariant . We also have complex equivariance connections between subsets of parameters and data , including approximate equivariances . The GNPE algorithm is extremely general : it is architecture-independent , it applies whether equivariances are exact or approximate , and it allows for arbitrary equivariance relations between parameters and data . We discuss related work in Sec . 2 and describe the GNPE algorithm in Sec . 3 . In Sec . 4 we apply GNPE to a toy example with exact translational equivariance , showing comparable simulation efficiency to NPE combined with a convolutional network . In Sec . 5 we show that standard NPE does not achieve adequate accuracy for GW parameter inference , even with an essentially unlimited number of simulations . In contrast , GNPE achieves highly accurate posteriors at a computational cost three orders of magnitude lower than bespoke MCMC approaches ( Veitch et al. , 2015 ) . The present paper describes the GNPE method which we developed for GW analysis ( Dax et al. , 2021 ) , and extends it to general equivariance transformations which makes it applicable to a wide range of problems . A detailed description of GW results is presented in Dax et al . ( 2021 ) . 2 RELATED WORK . The most common way of integrating equivariances into machine learning algorithms is to use equivariant network architectures ( Krizhevsky et al. , 2012 ; Cohen & Welling , 2016 ) . This can be in 1In physics , the term “ covariant ” is frequently used instead of “ equivariant ” . 2We adopt the language from computer vision by Jaderberg et al . ( 2015 ) . conflict with design considerations such as data representation and flexibility of the architecture , and imposes constraints such as locality . GNPE achieves complete separation of equivariances from these considerations , requiring only the ability to efficiently transform the pose . Normalizing flows are particularly well suited to NPE , and there has been significant progress in constructing equivariant flows ( Boyda et al. , 2021 ) . However , these studies consider joint transformations of parameters of the base space and sample space—not joint transformation of data and parameters for conditional flows , as we consider here . GNPE enables end-to-end equivariances from data to parameters . Consider , by contrast , a conditional normalizing flow with a convolutional embedding network : the equivariance persists through the embedding network but is broken by the flow . Although this may improve learning , it does not enforce an end-to-end equivariance . This contrasts with an invariance , for which the above would be sufficient . Finally , GNPE can also be applied if the equivariance is only approximate . Several other approaches integrate domain knowledge of the forward model ( Baydin et al. , 2019 ; Brehmer et al. , 2020 ) by considering a “ gray-box ” setting . GNPE allows us to incorporate high-level domain knowledge about approximate equivariances of forward models without requiring access to its implementation or internal states of the simulator . Rather , it can be applied to “ black-box ” code . An alternative approach to incorporate geometrical knowledge into classical likelihood-free inference algorithms ( e.g. , Approximate Bayesian Computation , see ( Sisson et al. , 2018 ) ) is by constructing ( Fearnhead & Prangle , 2012 ) or learning ( Jiang et al. , 2017 ; Chen et al. , 2021 ) equivariant summary statistics s ( x ) , which are used as input to the inference algorithm instead of the raw data x . However , designing equivariant summary statistics ( rather than invariant ones ) can be challenging , and furthermore inference will be biased if the equivariance only holds approximately . Past studies using machine-learning techniques for amortized GW parameter inference ( Gabbard et al. , 2019 ; Chua & Vallisneri , 2020 ; Green & Gair , 2021 ; Delaunoy et al. , 2020 ) all consider simplified problems ( e.g. , only a subset of parameters , a simplified posterior , or a limited treatment of detector noise ) . In contrast , the GNPE-based study in Dax et al . ( 2021 ) is the only one to treat the full amortized parameter inference problem with accuracy matching standard methods . 3 METHODS . 3.1 NEURAL POSTERIOR ESTIMATION . NPE ( Papamakarios & Murray , 2016 ; Greenberg et al. , 2019 ) is a simulation-based inference method that directly targets the posterior . Given a dataset of prior parameter samples θ ( i ) ∼ p ( θ ) and corresponding model simulations x ( i ) ∼ p ( x|θ ( i ) ) , it trains a neural density estimator q ( θ|x ) to estimate p ( θ|x ) . This is achieved by minimizing the loss LNPE = Ep ( θ ) Ep ( x|θ ) [ − log q ( θ|x ) ] ( 1 ) across the dataset of ( θ ( i ) , x ( i ) ) pairs . This maximum likelihood objective leads to recovery of p ( θ|x ) if q ( θ|x ) is sufficiently flexible . Normalizing flows ( Rezende & Mohamed , 2015 ; Durkan et al. , 2019 ) are a particularly expressive class of conditional density estimators commonly used for NPE . NPE amortizes inference : once q ( θ|x ) is trained , inference is very fast for any observed data xo , so training costs are shared across observations . The approach is also extremely flexible , as it treats the forward model as a black box , relying only on prior samples and model simulations . In many situations , however , these data have known structure that one wants to exploit to improve learning . 3.2 EQUIVARIANCES UNDER TRANSFORMATION GROUPS . In this work we describe a generic method to incorporate equivariances under joint transformations of θ and x into NPE . A typical example arises when inferring the position of an object from image data . In this case , if we spatially translate an image x by some offset ~d—effected by relabeling the pixels— then the inferred position θ should also transform by ~d—by addition to the position coordinates θ. Translations are composable and invertible , and there exists a trivial identity translation , so the set of translations has a natural group structure . Our method works for any continuous transformation group , including rotations , dilations , etc. , and in this section we keep the discussion general . For a transformation group G , we denote the action of g ∈ G on parameters and data as θ → gθ , ( 2 ) x→ Tgx . ( 3 ) Here , Tg refers to the group representation under which the data transform ( e.g. , for image translations , the pixel relabeling ) . We adopt the natural convention that G is defined by its action on θ , so we do not introduce an explicit representation on parameters . The posterior distribution p ( θ|x ) is said to be equivariant under G if , when the parameter and data spaces are jointly G-transformed , the posterior is unchanged , i.e. , p ( θ|x ) = p ( gθ|Tgx ) |det Jg| , ∀g ∈ G. ( 4 ) The right-hand side comes from the change-of-variables rule . For translations the Jacobian Jg has unit determinant , but we include it for generality . For NPE , we are concerned with equivariant posteriors , however it is often more natural to think of equivariant forward models ( or likelihoods ) . An equivariant likelihood and an invariant prior together yield an equivariant posterior ( App . A.1 ) . Our goal is to use equivariances to simplify the data—to G-transform x such that θ is taken to a fiducial value . For the image example , this could mean translating the object of interest to the center . In general , θ can also include parameters unchanged under G ( e.g. , the color of the object ) , so we denote the corresponding standardized parameters by θ0 . These are related to θ by a group transformation denoted gθ , such that gθθ0 = θ . We refer to gθ as the “ pose ” of θ , and standardizing the pose means to take it to the group identity element e ∈ G. Applying T ( gθ ) −1 to the data space effectively reduces its dimensionality , making it easier to interpret for a neural network . Although the preceding discussion applies to equivariances that hold exactly , our method in fact generalizes to approximate equivariances . We say that a posterior is approximately equivariant under G if ( 4 ) does not hold , but standardizing the pose nevertheless reduces the effective dimensionality of the dataset . An approximately equivariant posterior can arise if an exact equivariance of the forward model is broken by a non-invariant prior , or if the forward model is itself non-equivariant . | In this paper the authors present a method for performing Bayesian inference in likehood-free settings where the data and parameters are jointly equivariant or approximately equivariant. Examples include translational or rotational equivariance, where if the latent parameter are translate or rotated, then the distribution over the data is the same, except that the data are translated or rotated in the same way as the latent parameters. The method presented here acts by mapping each simulation to a standard "pose" and then aims to learn both the original pose and any additional parameters from the data. There are two main components to this method -- 1) the standard simulation-based inference method of estimating latent parameters from data, but applied to data that have had their pose standardized and 2) a Gibbs sampling framework to use the family of posteriors learned from the first component to jointly estimate the pose and ant other parameters from unposed data. | SP:b0f193db92cf2541bc252cb492ee3f9a6d50fc16 |
Spatial Frequency Sensitivity Regularization for Robustness | 1 INTRODUCTION . While deep neural networks ( DNN ) achieve remarkable performance on many challenging image classification tasks , they can suffer significant drops in performance when evaluated on out-ofdistribution ( o.o.d . ) data . Intriguingly , this lack of robustness has been partially attributed to the frequency characteristics of data shifts at test time in relation to the frequency sensitivity characteristics of the model ( Yin et al. , 2019 ; Jo & Bengio , 2017 ) . Distinct spatial frequencies in images contain features at different spatial scales ; low spatial frequencies ( LSF ) carry global structure and shape information in a scene whereas high spatial frequencies ( HSF ) carry local information such as edges and borders of objects in a scene ( Kauffmann et al. , 2014 ) ; in fact , spatial frequencies are differentially processed in distinct channels of the visual cortex in the brain to learn features at different scales ( Appendix B ) . When information is destroyed or corrupted in frequency bands that a model relies on , performance suffers . Hence , understanding the spatial frequency sensitivity of a DNN can help us characterise the features it relies on to make predictions . DNNs have been demonstrated to be sensitive to Fourier-basis directions in the input ( Tsuzuku & Sato , 2019 ; Yin et al. , 2019 ) both empirically and using theoretical analysis of linear convolutional networks ( Tsuzuku & Sato , 2019 ) . In fact , the existence of so-called “ universal adversarial perturbations ” ( Moosavi-Dezfooli et al. , 2017 ) , simple semantics-preserving distortions that can degrade models ’ accuracy across inputs and architectures , is attributed to this structural sensitivity and the use of convolution operations . Yin et al . ( 2019 ) also showed that many natural and digital image corruptions that degrade model performance may also be targeting this vulnerability . The Fouriercharacteristics of adversarial examples are also known to closely match the Fourier-sensitivity of models ( Yin et al. , 2019 ) . Hence , understanding and modifying Fourier-sensitivity can aid efforts to improve model robustness . While this Fourier-sensitivity has been studied empirically , the precise definition and measurement of a computer vision model ’ s spatial frequency sensitivity still lacks a rigorous approach across studies . In addition , there has been no principled method to specifically modify the spatial frequency sensitivity of a model . Existing works have heuristically applied filters on convolution layer parameters ( Wang et al. , 2020 ; Saikia et al. , 2021 ) and data augmentations ( Yin et al. , 2019 ) to modify a model ’ s frequency sensitivity . In this work , we propose a novel and rigorous measure of a deep neural network ’ s spatial frequency sensitivity using the input-Jacobian represented in the Fourier-basis and show that deep neural networks demonstrate consistent spatial frequency sensitivities across samples , an observation that suggests DNNs are more likely to consistently use some frequencies more than others , and has implications for robustness . In addition , using our proposed measure , which is differentiable with respect to model parameters , we propose a novel family of spatial frequency regularizers to directly induce specific frequency sensitivities in a model . We hypothesize and show in empirical evaluations that spatial frequency regularization can modify the frequency sensitivity characteristics of computer vision models and can significantly improve the generalization performance of models on o.o.d . datasets where the Fourier-statistics are unfavorably shifted . In summary , the main contributions of this work are as follows : 1 . We propose a novel and rigorous measure of a model ’ s spatial frequency sensitivity based on its input-Jacobian represented in the Fourier-basis 2 . We propose a novel family of spatial frequency regularizers to directly induce specific spatial frequency sensitivities 3 . We demonstrate that spatial frequency regularization can significantly improve generalization performance on out-of-distribution data where Fourier-statistics are unfavorably shifted 2 RELATED WORK . Characterising frequency sensitivity : Yin et al . ( 2019 ) ; Tsuzuku & Sato ( 2019 ) characterised the Fourier characteristics of trained CNNs using perturbation analysis of their test error under Fourierbasis noise . They showed that a naturally trained model is most sensitive to all but low frequencies whereas models adversarially trained ( Madry et al. , 2018 ) models are sensitive to low-frequency noise . They further showed that these Fourier characteristics relate to model robustness on corruptions and noise , with models biased towards low frequencies performing better under high frequency noise and vice versa . Abello et al . ( 2021 ) took a different approach by measuring the impact on accuracy of removing individual frequency components from the input using filters whereas OrtizJimenez et al . ( 2020 ) computed the margin in input space along basis directions of the discrete cosine transform ( DCT ) . Wang et al . ( 2020 ) made observations about the Fourier characteristics of CNNs in different training regimes including standard and adversarial training by evaluating accuracy on band-pass filtered data . In contrast to these disparate approaches , in this work , we propose a rigorous measure of a model ’ s spatial frequency sensitivity . Regularizing frequency sensitivity : Yin et al . ( 2019 ) proposed adversarial training ( Madry et al. , 2018 ) and gaussian noise augmentations as methods that induce a low-frequency sensitivity . Wang et al . ( 2020 ) proposed smoothing convolution filter parameters to induce a low-frequency sensitivity in models . We note that , in general , techniques that apply filters on convolutional parameters to affect a model ’ s frequency sensitivity do not take into account complex operations such as nonlinearities , pooling and other transformations that often follow convolutional layers that can modify as well as undo the effects of such filters . In addition , data augmentations do not provide precise control over the Fourier-sensitivity of a model . In this work , we propose a family of spatial frequency regularizers that can precisely modify the overall spatial frequency sensitivity of any differentiable model . Jacobian regularization : Methods that regularize the Jacobian of a model ’ s output-logits or loss with respect to its input can broadly be divided into two types ; one regularizes the norm of the input-Jacobian and the other regularizes its direction or directional derivatives . Drucker & Le Cun ( 1991 ) proposed a method that penalized the norm of the input-Jacobian to improve generalization , more recently this has been explored to improve robustness to adversarial perturbations ( Ross & Doshi-Velez , 2018 ; Jakubovitz & Giryes , 2018 ; Hoffman et al. , 2019 ) . Simard et al . ( 1992 ) proposed ” Tangent Prop ” , which minimized directional derivatives of classifiers in the direction of local inputtransformations ( e.g . rotations , translations ; called ” tangent vectors ” ) to reduce model sensitivity to such transformations . Czarnecki et al . ( 2017 ) proposed Sobolev training of neural networks to improve model distillation by matching the input-Jacobian of the original model . Regularizing the direction of the input-Jacobian has also been used to improve adversarial robustness ( Chan et al. , 2020 ) . In the present work , we regularize Fourier-components in the input-Jacobian to modify the spatial frequency sensitivity of models . As such , we are directly modifying the direction of the input-Jacobian instead of its norm . 3 METHODS . Preliminaries : We introduce all relevant definitions and notations before describing the proposed methods . Consider an image classification task with input images x , target labels y , and the standard cross-entropy loss function LCE . Let f denote any differentiable model , F ( · ) the unitary 2D discrete Fourier transform ( DFT ) , F−1 ( · ) its inverse , and F−1∗ ( · ) the adjoint of the inverse-Fourier transform , and let xf denote the Fourier space representation of the input , i.e . xf = F ( x ) . We denote the input-Jacobian in the standard input basis as ∂LCE∂x , and ∂LCE ∂xf as the input-Jacobian in the Fourier-basis . Let N denote the height of the input images x ( although not necessary , all images used in this work are square ) . The zero-shifted 2D-DFT of the input-Jacobian is denoted F = F ( ∂LCE∂x ) . Since the input-Jacobian typically has three color channels , they are averaged before computing the 2D-DFT . Fourier coefficients in F are complex numbers with real and imaginary components ; F ( u , v ) = Real ( u , v ) + Imag ( u , v ) , where ( u , v ) are indices of coefficients . The power in a coefficient is its squared amplitude , P ( u , v ) = |F ( u , v ) |2 = Real ( u , v ) 2 + Imag ( u , v ) 2 and the matrix of powers is denoted P ( power-matrix ) . Each coefficient has a radial distance r ( u , v ) from the centre of the matrix , r ( u , v ) = d ( ( u , v ) , ( cu , cv ) ) , where ( cu , cv ) denotes the centroid of P and d ( · , · ) is Euclidean distance . Distinct radial distances , rounded to the nearest integer , of coefficients in the matrix are the set of integers { 1 , . . . , N/ √ 2 } and correspond to low to high spatial frequency bands , the highest spatial frequency being limited by the Nyquist frequency . We denote PTotal as the total power in P , excluding the zero-frequency coefficient , PTotal = ∑ r ( u , v ) > =1 P ( u , v ) . Similarly , we define P̃Total as the total power in P excluding the zero-frequency coefficient as well as coefficients with radial distance r ( u , v ) > N/2 , i.e . outside the largest circle inscribed in the power-matrix P ; P̃Total = ∑ 1 < =r ( u , v ) < =N/2 P ( u , v ) ( please see Figure 5 in Appendix A.1 for an illustration ) . We denote Pk as the total power at radial distance k normalized by PTotal , Pk = 1 PTotal ∑ r ( u , v ) =k P ( u , v ) and P̃k as total power at radial distance k normalized by P̃Total in- stead , P̃k = 1P̃Total ∑ r ( u , v ) =k P ( u , v ) . 3.1 SPATIAL FREQUENCY SENSITIVITY OF A MODEL . In this section , we define the proposed spatial frequency sensitivity ( SFS ) of any differentiable model using its input-Jacobian represented in the Fourier-basis . As the input-Jacobian provides the direction of highest input sensitivity , we show below that its Fourier transform , which is simply a change of basis , provides the model ’ s sensitivities to spatial frequency components in the input . The input-Jacobian in the Fourier-basis , ∂LCE∂xf , comprises the sensitivities of the model with respect to individual frequencies in the input and we obtain this by simply computing the Fourier transform of the input-Jacobian ∂LCE∂x . In order to justify this , consider the computation graph where the input x is mapped to a scalar loss via a model f and loss function LCE ( Figure 2 ) . We introduce an implicit operation ( shown in red ) that maps the Fourier space representation of the input , xf , to the standard input x through the inverse Fourier-transform ; xf F−1−−−→ x , so in order to compute the input-Jacobian in the Fourier-basis , ∂LCE∂xf , we must differentiate through this implicit operation in the forward graph . Since the inverse-Fourier transform is a unitary operator , its adjoint is also its inverse , i.e . F−1∗ = ( F−1 ) −1 = F . Hence , following the chain rule for complex operators , ∂LCE∂xf is simply the Fourier transform of the input-Jacobian ∂LCE∂x . Input image Input-Jacobian of model 2D DFT input-Jacobian SFS=proportion of power in circular frequency bands ∂LCE ∂xf = F−1∗ ( ∂LCE ∂x ) = F ( ∂LCE ∂x ) Hence , even though we do not explicitly use the Fourier representation of the input , this shows that the Fourier transform of the input-Jacobian provides us the sensitivity of the model with respect to spatial frequencies of the input . In fact , similar results hold for any unitary operation on the inputJacobian , such as the discrete cosine transform ( DCT ) . Interested readers can replace the DFT ( F ) with other such transforms if they would like to understand the sensitivity of a model with respect to other components in the input . We now define the spatial frequency sensitivity fSFS ( x , y ) with respect to an individual input ( x , y ) as , fSFS ( x , y ) = { P1 , . . . , PN/√2 } where Pk is the proportion of total power in Fourier coefficients at radial distance k in the power matrix P of the Fourier-transformed input-Jacobian . The overall spatial frequency sensitivity of a model is defined as the expectation of fSFS ( x , y ) over the data distribution , i.e . fSFS ( · ; θ ) = E ( x , y ) ∼p [ fSFS ( x , y ) ] ( please see Figure 1 for an illustration and Algorithm 1 in Appendix A.1 ) . We note that although we use the Jacobian of the loss function to estimate the SFS of a model , this formulation is valid for other output functions and tasks as well . An alternative approach that does not require image labels is to compute the Jacobian of the model ’ s output logits or softmax probabilities . In addition , while the spatial frequency sensitivity assumes the input is spatial 2D data ( e.g . images ) , we can extend this approach to any n-dimensional data by using the n-dimensional Fourier-transform as well as to other computer vision tasks . | This paper proposes a novel spatial frequency regularization technique that improves the robustness of training neural networks against superficial fourier statistics in a dataset. In the loss function, It adds a regularization term that is based on the Fourier-transformed input-Jacobian. This term could be customized such that the trained model could ignore (be insensitive to) features with specific frequency in the dataset. The authors define spatial frequency sensitivity using input-Jacobian in Fourier space. Although this paper focuses on datasets with images, the method is extendable to any n-dimensional data. Empirically, the method is evaluated for its robustness against fourier filtering, corruptions, and image patches shuffling in CIFAR10 & CIFAR100 datasets. It shows better results than other baselines in maintaining the classification accuracy of a model against fourier filtering and image patches shuffling. There do seem to be slight performance gaps from the SOTA AugMix method in image corruptions. However, the method is considered to be simpler than AugMix and still outperforms other baselines in many cases. Experiments demonstrate that the proposed method could learn global features present in a dataset. | SP:cb6397f78128e20abf726c63700dd49370335418 |
Spatial Frequency Sensitivity Regularization for Robustness | 1 INTRODUCTION . While deep neural networks ( DNN ) achieve remarkable performance on many challenging image classification tasks , they can suffer significant drops in performance when evaluated on out-ofdistribution ( o.o.d . ) data . Intriguingly , this lack of robustness has been partially attributed to the frequency characteristics of data shifts at test time in relation to the frequency sensitivity characteristics of the model ( Yin et al. , 2019 ; Jo & Bengio , 2017 ) . Distinct spatial frequencies in images contain features at different spatial scales ; low spatial frequencies ( LSF ) carry global structure and shape information in a scene whereas high spatial frequencies ( HSF ) carry local information such as edges and borders of objects in a scene ( Kauffmann et al. , 2014 ) ; in fact , spatial frequencies are differentially processed in distinct channels of the visual cortex in the brain to learn features at different scales ( Appendix B ) . When information is destroyed or corrupted in frequency bands that a model relies on , performance suffers . Hence , understanding the spatial frequency sensitivity of a DNN can help us characterise the features it relies on to make predictions . DNNs have been demonstrated to be sensitive to Fourier-basis directions in the input ( Tsuzuku & Sato , 2019 ; Yin et al. , 2019 ) both empirically and using theoretical analysis of linear convolutional networks ( Tsuzuku & Sato , 2019 ) . In fact , the existence of so-called “ universal adversarial perturbations ” ( Moosavi-Dezfooli et al. , 2017 ) , simple semantics-preserving distortions that can degrade models ’ accuracy across inputs and architectures , is attributed to this structural sensitivity and the use of convolution operations . Yin et al . ( 2019 ) also showed that many natural and digital image corruptions that degrade model performance may also be targeting this vulnerability . The Fouriercharacteristics of adversarial examples are also known to closely match the Fourier-sensitivity of models ( Yin et al. , 2019 ) . Hence , understanding and modifying Fourier-sensitivity can aid efforts to improve model robustness . While this Fourier-sensitivity has been studied empirically , the precise definition and measurement of a computer vision model ’ s spatial frequency sensitivity still lacks a rigorous approach across studies . In addition , there has been no principled method to specifically modify the spatial frequency sensitivity of a model . Existing works have heuristically applied filters on convolution layer parameters ( Wang et al. , 2020 ; Saikia et al. , 2021 ) and data augmentations ( Yin et al. , 2019 ) to modify a model ’ s frequency sensitivity . In this work , we propose a novel and rigorous measure of a deep neural network ’ s spatial frequency sensitivity using the input-Jacobian represented in the Fourier-basis and show that deep neural networks demonstrate consistent spatial frequency sensitivities across samples , an observation that suggests DNNs are more likely to consistently use some frequencies more than others , and has implications for robustness . In addition , using our proposed measure , which is differentiable with respect to model parameters , we propose a novel family of spatial frequency regularizers to directly induce specific frequency sensitivities in a model . We hypothesize and show in empirical evaluations that spatial frequency regularization can modify the frequency sensitivity characteristics of computer vision models and can significantly improve the generalization performance of models on o.o.d . datasets where the Fourier-statistics are unfavorably shifted . In summary , the main contributions of this work are as follows : 1 . We propose a novel and rigorous measure of a model ’ s spatial frequency sensitivity based on its input-Jacobian represented in the Fourier-basis 2 . We propose a novel family of spatial frequency regularizers to directly induce specific spatial frequency sensitivities 3 . We demonstrate that spatial frequency regularization can significantly improve generalization performance on out-of-distribution data where Fourier-statistics are unfavorably shifted 2 RELATED WORK . Characterising frequency sensitivity : Yin et al . ( 2019 ) ; Tsuzuku & Sato ( 2019 ) characterised the Fourier characteristics of trained CNNs using perturbation analysis of their test error under Fourierbasis noise . They showed that a naturally trained model is most sensitive to all but low frequencies whereas models adversarially trained ( Madry et al. , 2018 ) models are sensitive to low-frequency noise . They further showed that these Fourier characteristics relate to model robustness on corruptions and noise , with models biased towards low frequencies performing better under high frequency noise and vice versa . Abello et al . ( 2021 ) took a different approach by measuring the impact on accuracy of removing individual frequency components from the input using filters whereas OrtizJimenez et al . ( 2020 ) computed the margin in input space along basis directions of the discrete cosine transform ( DCT ) . Wang et al . ( 2020 ) made observations about the Fourier characteristics of CNNs in different training regimes including standard and adversarial training by evaluating accuracy on band-pass filtered data . In contrast to these disparate approaches , in this work , we propose a rigorous measure of a model ’ s spatial frequency sensitivity . Regularizing frequency sensitivity : Yin et al . ( 2019 ) proposed adversarial training ( Madry et al. , 2018 ) and gaussian noise augmentations as methods that induce a low-frequency sensitivity . Wang et al . ( 2020 ) proposed smoothing convolution filter parameters to induce a low-frequency sensitivity in models . We note that , in general , techniques that apply filters on convolutional parameters to affect a model ’ s frequency sensitivity do not take into account complex operations such as nonlinearities , pooling and other transformations that often follow convolutional layers that can modify as well as undo the effects of such filters . In addition , data augmentations do not provide precise control over the Fourier-sensitivity of a model . In this work , we propose a family of spatial frequency regularizers that can precisely modify the overall spatial frequency sensitivity of any differentiable model . Jacobian regularization : Methods that regularize the Jacobian of a model ’ s output-logits or loss with respect to its input can broadly be divided into two types ; one regularizes the norm of the input-Jacobian and the other regularizes its direction or directional derivatives . Drucker & Le Cun ( 1991 ) proposed a method that penalized the norm of the input-Jacobian to improve generalization , more recently this has been explored to improve robustness to adversarial perturbations ( Ross & Doshi-Velez , 2018 ; Jakubovitz & Giryes , 2018 ; Hoffman et al. , 2019 ) . Simard et al . ( 1992 ) proposed ” Tangent Prop ” , which minimized directional derivatives of classifiers in the direction of local inputtransformations ( e.g . rotations , translations ; called ” tangent vectors ” ) to reduce model sensitivity to such transformations . Czarnecki et al . ( 2017 ) proposed Sobolev training of neural networks to improve model distillation by matching the input-Jacobian of the original model . Regularizing the direction of the input-Jacobian has also been used to improve adversarial robustness ( Chan et al. , 2020 ) . In the present work , we regularize Fourier-components in the input-Jacobian to modify the spatial frequency sensitivity of models . As such , we are directly modifying the direction of the input-Jacobian instead of its norm . 3 METHODS . Preliminaries : We introduce all relevant definitions and notations before describing the proposed methods . Consider an image classification task with input images x , target labels y , and the standard cross-entropy loss function LCE . Let f denote any differentiable model , F ( · ) the unitary 2D discrete Fourier transform ( DFT ) , F−1 ( · ) its inverse , and F−1∗ ( · ) the adjoint of the inverse-Fourier transform , and let xf denote the Fourier space representation of the input , i.e . xf = F ( x ) . We denote the input-Jacobian in the standard input basis as ∂LCE∂x , and ∂LCE ∂xf as the input-Jacobian in the Fourier-basis . Let N denote the height of the input images x ( although not necessary , all images used in this work are square ) . The zero-shifted 2D-DFT of the input-Jacobian is denoted F = F ( ∂LCE∂x ) . Since the input-Jacobian typically has three color channels , they are averaged before computing the 2D-DFT . Fourier coefficients in F are complex numbers with real and imaginary components ; F ( u , v ) = Real ( u , v ) + Imag ( u , v ) , where ( u , v ) are indices of coefficients . The power in a coefficient is its squared amplitude , P ( u , v ) = |F ( u , v ) |2 = Real ( u , v ) 2 + Imag ( u , v ) 2 and the matrix of powers is denoted P ( power-matrix ) . Each coefficient has a radial distance r ( u , v ) from the centre of the matrix , r ( u , v ) = d ( ( u , v ) , ( cu , cv ) ) , where ( cu , cv ) denotes the centroid of P and d ( · , · ) is Euclidean distance . Distinct radial distances , rounded to the nearest integer , of coefficients in the matrix are the set of integers { 1 , . . . , N/ √ 2 } and correspond to low to high spatial frequency bands , the highest spatial frequency being limited by the Nyquist frequency . We denote PTotal as the total power in P , excluding the zero-frequency coefficient , PTotal = ∑ r ( u , v ) > =1 P ( u , v ) . Similarly , we define P̃Total as the total power in P excluding the zero-frequency coefficient as well as coefficients with radial distance r ( u , v ) > N/2 , i.e . outside the largest circle inscribed in the power-matrix P ; P̃Total = ∑ 1 < =r ( u , v ) < =N/2 P ( u , v ) ( please see Figure 5 in Appendix A.1 for an illustration ) . We denote Pk as the total power at radial distance k normalized by PTotal , Pk = 1 PTotal ∑ r ( u , v ) =k P ( u , v ) and P̃k as total power at radial distance k normalized by P̃Total in- stead , P̃k = 1P̃Total ∑ r ( u , v ) =k P ( u , v ) . 3.1 SPATIAL FREQUENCY SENSITIVITY OF A MODEL . In this section , we define the proposed spatial frequency sensitivity ( SFS ) of any differentiable model using its input-Jacobian represented in the Fourier-basis . As the input-Jacobian provides the direction of highest input sensitivity , we show below that its Fourier transform , which is simply a change of basis , provides the model ’ s sensitivities to spatial frequency components in the input . The input-Jacobian in the Fourier-basis , ∂LCE∂xf , comprises the sensitivities of the model with respect to individual frequencies in the input and we obtain this by simply computing the Fourier transform of the input-Jacobian ∂LCE∂x . In order to justify this , consider the computation graph where the input x is mapped to a scalar loss via a model f and loss function LCE ( Figure 2 ) . We introduce an implicit operation ( shown in red ) that maps the Fourier space representation of the input , xf , to the standard input x through the inverse Fourier-transform ; xf F−1−−−→ x , so in order to compute the input-Jacobian in the Fourier-basis , ∂LCE∂xf , we must differentiate through this implicit operation in the forward graph . Since the inverse-Fourier transform is a unitary operator , its adjoint is also its inverse , i.e . F−1∗ = ( F−1 ) −1 = F . Hence , following the chain rule for complex operators , ∂LCE∂xf is simply the Fourier transform of the input-Jacobian ∂LCE∂x . Input image Input-Jacobian of model 2D DFT input-Jacobian SFS=proportion of power in circular frequency bands ∂LCE ∂xf = F−1∗ ( ∂LCE ∂x ) = F ( ∂LCE ∂x ) Hence , even though we do not explicitly use the Fourier representation of the input , this shows that the Fourier transform of the input-Jacobian provides us the sensitivity of the model with respect to spatial frequencies of the input . In fact , similar results hold for any unitary operation on the inputJacobian , such as the discrete cosine transform ( DCT ) . Interested readers can replace the DFT ( F ) with other such transforms if they would like to understand the sensitivity of a model with respect to other components in the input . We now define the spatial frequency sensitivity fSFS ( x , y ) with respect to an individual input ( x , y ) as , fSFS ( x , y ) = { P1 , . . . , PN/√2 } where Pk is the proportion of total power in Fourier coefficients at radial distance k in the power matrix P of the Fourier-transformed input-Jacobian . The overall spatial frequency sensitivity of a model is defined as the expectation of fSFS ( x , y ) over the data distribution , i.e . fSFS ( · ; θ ) = E ( x , y ) ∼p [ fSFS ( x , y ) ] ( please see Figure 1 for an illustration and Algorithm 1 in Appendix A.1 ) . We note that although we use the Jacobian of the loss function to estimate the SFS of a model , this formulation is valid for other output functions and tasks as well . An alternative approach that does not require image labels is to compute the Jacobian of the model ’ s output logits or softmax probabilities . In addition , while the spatial frequency sensitivity assumes the input is spatial 2D data ( e.g . images ) , we can extend this approach to any n-dimensional data by using the n-dimensional Fourier-transform as well as to other computer vision tasks . | This paper proposes a measure for a model’s spatial frequency sensitivity (SFS) based on the input-Jacobian in the Fourier basis. With this measure, the authors observe standard CNN training biases towards certain particular spatial frequencies consistently across samples. Based on this measure, the authors propose a family of spatial frequency regularization techniques to suppress the model’s sensitivities to certain spatial frequencies. | SP:cb6397f78128e20abf726c63700dd49370335418 |
Neuronal Learning Analysis using Cycle-Consistent Adversarial Networks | Understanding how activity in neural circuits reshapes following task learning could reveal fundamental mechanisms of learning . Thanks to the recent advances in neural imaging technologies , high-quality recordings can be obtained from hundreds of neurons over multiple days or even weeks . However , the complexity and dimensionality of population responses pose significant challenges for analysis . Existing methods of studying neuronal adaptation and learning often impose strong assumptions on the data or model , resulting in biased descriptions that do not generalize . In this work , we use a variant of deep generative models called – cycle-consistent adversarial networks , to learn the unknown mapping between pre- and post-learning neuronal activities recorded in vivo . To do so , we develop an end-to-end pipeline to preprocess , train and evaluate calcium fluorescence signals , and a procedure to interpret the resulting deep learning models . To assess the validity of our method , we first test our framework on a synthetic dataset with known ground-truth transformation . Subsequently , we applied our method to neuronal activities recorded from the primary visual cortex of behaving mice , where the mice transition from novice to expert-level performance in a visual-based virtual reality experiment . We evaluate model performance on generated calcium imaging signals and their inferred spike trains . To maximize performance , we derive a novel approach to pre-sort neurons such that convolutional-based networks can take advantage of the spatial information that exists in neuronal activities . In addition , we incorporate visual explanation methods to improve the interpretability of our work and gain insights into the learning process as manifested in the cellular activities . Together , our results demonstrate that analyzing neuronal learning processes with data-driven deep unsupervised methods holds the potential to unravel changes in an unbiased way . 1 INTRODUCTION . One of the main objectives in computational neuroscience is to study the dynamics of neural processing and how neural activity reshapes in the course of learning . A major hurdle was the difficulty in obtaining high-quality neural recordings of the same set of neurons across multiple experiments , though such limitation in recording techniques has seen tremendous improvements in recent years . With the advent of modern neural imaging technologies , it is now possible to monitor a large population of neurons over days or even weeks ( Williams et al. , 2018a ; Steinmetz et al. , 2021 ) , thus allowing experimentalists to obtain in vivo recordings from the same set of neurons across different learning stages . Significant efforts have been put into extracting interpretable and unbiased descriptions of how cortical responses change with experience . Proposed approaches to model changes in neuronal activity include linear latent variable models such as PCA , TCA , GPFA , GPFADS and PSID ( Cunningham & Byron , 2014 ; Williams et al. , 2018b ; Sani et al. , 2021 ; Yu et al. , 2009 ; Rutten et al. , 2020 ) . Methods employing deep learning models but with linear changes or mapping include LFADS and PfLDS ( Pandarinath et al. , 2018 ; Gao et al. , 2016 ) . While these methods enabled substantial progress in understanding the structure of neuronal activity , they do have strong assumptions inherent in the modelling technique or the analysis , such as the linearity assumption in linear latent variable models . Therefore , making sense of the unknown mapping between pre- and post-learning neural activity in an unbiased manner remains a significant challenge , and a data-driven method to interpret the circuit dynamics in learning is highly desirable . Thanks to their ability to self-identity and self-learn features from complex data , deep neural networks ( DNNs ) have seen tremendous success in many biomedical applications ( Cao et al. , 2018 ; Zemouri et al. , 2019 ; Piccialli et al. , 2021 ) . Specifically , deep generative networks have shown promising results in analyzing and synthesizing neuronal activities in recent years . Pandarinath et al . ( 2018 ) developed a variational autoencoder ( VAE ) to learn latent dynamics from single-trial spiking activities and Prince et al . ( 2020 ) extended the framework to work with calcium imaging data . Numerous work have demonstrated generative adversarial networks ( GAN ) are capable of synthesizing neuronal activities that capture the low-level statistics of recordings obtained from behaving animals ( Molano-Mazon et al. , 2018 ; Ramesh et al. , 2019 ; Li et al. , 2020 ) . In this work , we explore the use of cycle-consistent adversarial networks ( Zhu et al. , 2017 ) , or CycleGAN , to learn the mapping between pre- and post-learning neuronal activities in an unsupervised and data-driven manner . In other words , given the neural recordings of a novice animal , can we translate the neuronal activities that correspond to the animal with expert-level performance , and vice versa ? The resulting transformation summarizes these changes in response characteristics in a compact form and is obtained in a fully data-driven way . Such a transformation can be useful in follow-up studies to 1 ) identify neurons that are particularly important for describing the changes in the overall response statistics , not limited to first or second order statistics ; 2 ) detect response patterns relevant for changes from pre- to post-learning ; and 3 ) determine what experimental details are of particular interest for learning . To learn the transformation , we derive a standardized procedure to train , evaluate and interpret the CycleGAN framework . To improve the explainability of our work , we incorporate a self-attention mechanism into our generator models and also employ a feature-importance visualization method into our pipeline so that we can visualize and identify the input that the networks deemed relevant in their decision making process . In addition , we introduced a novel neuron ordering method to improve the learning performance of convolutional neural networks ( CNN ) . To quantify the capability of the proposed unsupervised learning method , we evaluate our method on two datasets : 1 ) an artificially constructed dataset with a handcrafted transformation , and 2 ) recordings obtained from the primary visual cortex of a behaving animal across multiple days . We then compare several metrics and statistics between the recorded and translated calcium traces and their inferred spike trains . 2 METHODS . 2.1 ANIMAL EXPERIMENT To obtain neuronal activities that can demonstrate pre- and postlearning responses , we conducted a visual-based experiment which follows a similar procedure as Pakan et al . ( 2018 ) and Henschke et al . ( 2020 ) . Briefly , a head-fixed mouse was placed on a linear treadmill that allows it to move forward and backward . A lick spout and two monitors were placed in front of the treadmill and a virtual corridor with defined grating pattern was shown to the mouse . A reward ( water drop ) would be made available if the mouse licked within the predefined reward location ( at 120-140 cm ) , in which a black screen is displayed as a visual clue . Figure A.1 illustrates the experiment setup . The mouse should learn to utilize both visual information and self-motion feedback to maximize reward . The same set of neurons in the primary visual cortex were labelled with GCaMP6 calcium indicator and monitored throughout 4 days of experiment , the relative changes in fluorescence ( ∆F/F0 ) over time were used as a proxy for an action potential . 4 mice were used in the virtual-corridor experiment and all mice transitioned from novice to expert in the behaviour task within 4 days of training . Mouse 1 took on average 6.94s per trial on day 1 and 4.43s per trial on day 4 , Table A.1 and A.2 shows the trial information of all the mice . Hence , this dataset can provide excellent insights into how cortical responses reshape with experience . 2.2 CYCLEGAN CycleGAN ( Zhu et al. , 2017 ) is a GAN-based unsupervised framework that learns the mapping between two unpaired distributions X and Y via the adversarial training and cycle-consistency optimization . The framework has shown excellent results in a number of unsupervised translation tasks , including natural language translation ( Gomez et al. , 2018 ) and molecular optimization ( Maziarka et al. , 2020 ) , to name a few . Let X and Y be two distributions with unknown mappings that correspond to ( novice ) pre- and ( expert ) post-learning neuronal activity , respectively . CycleGAN consists of four DNNs : generator G : X → Y that maps novice activities to expert activities and generator F : Y → X that maps expert activities to novice activities ; discriminator DX : X → [ 0 , 1 ] and discriminator DY : Y → [ 0 , 1 ] that learn to distinguish novice and expert neural activities , respectively . In a forward cycle step ( X → Y → X , illustrated in Figure B.1 ) , we first sample a novice recording x from distribution X and apply transformation G to obtain ŷ = G ( x ) . We expect ŷ to resembles data from the expert distribution Y , hence DY learns to minimize ( 1 ) LDY = −Ey∼Y [ ( DY ( y ) − 1 ) 2 ] + Ex∼X [ DY ( G ( x ) ) 2 ] . Similar to a typical GAN , generator G learns to deceive DY with the objective of ( 2 ) LG = −Ex∼X [ ( DY ( G ( x ) ) −1 ) 2 ] . Note that these are same objectives in LSGAN ( Mao et al. , 2017 ) . However , DY can only verify if ŷ ∈ Y , though can not ensure that ŷ is the corresponding expert activity of the novice recording x. Moreover , X and Y are not paired hence we can not directly compare ŷ with samples in Y . To tackle this issue , CycleGAN applies another transformation to reconstruct the novice recording x̄ = F ( ŷ ) where the distance ‖ x − x̄ ‖ or ‖ x − F ( G ( x ) ) ‖ should be minimal . Therefore , the generators also optimize this cycle-consistent loss ( 3 ) Lcycle = Ex∼X [ ‖ x − F ( G ( x ) ) ‖ ] + Ey∼Y [ ‖ y − G ( F ( y ) ) ‖ ] . Mean absolute error ( MAE ) was used as the distance function , though other distance functions can also be employed . In addition , we would expect x̂ = F ( x ) and ŷ = G ( y ) to be in distributions X and Y given that F : Y → X and G : X → Y , hence the identity loss objective ( 4 ) LGidentity = Ey∼Y [ ‖ y −G ( y ) ‖ ] . Taken all together , G optimizes the following objectives : ( 5 ) LGtotal = LG + λcycleLcycle + λidentityLGidentity where λidentity and λcycle are hyper-parameters for identity and cycle loss coefficients . All four networks are trained jointly where LFtotal and LDX are similar to LGtotal and LDY though in opposite directions . In this work , we adapt the CycleGAN framework to learn the unknown mapping between pre- and post-learning neuronal activities recorded from the primary visual cortex of behaving mice . In addition , we experiment with different GANs objective formulations on top of the original LSGAN objective , including GAN ( Goodfellow et al. , 2014 ) , WGANGP ( Arjovsky et al. , 2017 ) and DRAGAN ( Kodali et al. , 2017 ) . Table C.2 shows their exact formulations in CycleGAN . 2.3 MODEL PIPELINE We devise a consistent analysis framework , including data preprocessing and augmentation , networks interpretation , and evaluation of the generated calcium fluorescence signals and their inferred spike trains . Figure C.1 illustrates the complete pipeline of our work.1 We denote the day 1 ( pre-learning ) and day 4 ( post-learning ) recording distributions to be X and Y . With Mouse 1 , W = 102 neurons from the primary visual cortex were monitored , as well as trial information such as the virtual distance , licks and rewards . In total , 21471 and 21556 samples were recorded on day 1 and 4 . Since we want the generators and discriminators to identify patterns relevant to the animal experiment in a data-driven manner , we do not incorporate any trial information into the training data . We first segment the two datasets with a sliding window of size H = 2048 along the temporal dimension ( around 85 s in wall-time ) , resulting in data with shape ( N , H , W ) for X and Y where N is the total number of segments . We select a stride size that space out each segment evenly so that we obtained a sufficient number of samples while keeping the correlations between samples reasonably low . In order to take advantage of the spatiotemporal information in the neuronal activities in a 2D CNN , we further convert the two sets to have shape ( N , H , W , C ) where C = 1 . Finally , we normalize each set to the range [ 0 , 1 ] , and divide them into train , validation and test set with 3000 , 200 and 200 samples respectively . To evaluate the transformation results of G and F , we can compare the cycle-consistency MAE ( X , F ( G ( X ) ) ) and MAE ( Y , G ( F ( Y ) ) ) , as well as the identity losses MAE ( X , F ( X ) ) and MAE ( Y , G ( Y ) ) ( e.g . we expect F to apply no transformation to a novice sample x ) . We also evaluate the generated data in terms of spike activities in the following distribution combinations : novice against translated novice ( X | F ( Y ) ) , novice against reconstructed novice ( X | F ( G ( X ) ) ) , expert against translated expert ( Y | G ( X ) ) and expert against reconstructed expert ( Y | G ( F ( Y ) ) ) . We use Cascade ( Rupprecht et al. , 2021 ) to infer spike trains from the recorded and generated calcium signals to assess the credibility of the generated signals . We measure the following commonly used spike train similarities and statistics : 1 ) mean firing rate for evaluating single neuron statistics ; 2 ) pairwise Pearson correlation for evaluating pairwise statistics ; 3 ) pairwise van Rossum distance ( Rossum , 2001 ) for evaluating general spike train similarity . We evaluate these quantities across the whole population for each neuron or neuron pairs and compare the resulting distributions over these quantities obtained from the recorded and generated data . We , therefore , validate the whole spatiotemporal first and second-order statistics as well as general spike train similarities . To improve the explainability of this work we introduce a number of recently proposed model interpretation methods into our pipeline . We design a self-attention generator architecture which allows 1The software codebase will be made publicly available upon acceptance . the network to learn a set of attention masks such that it encourages the network to better focus on specific areas of interest in the input and also enables us to visually inspect the learned attention maps . In addition , we use GradCAM ( Selvaraju et al. , 2017 ) , a method to visualize discriminative region ( s ) learned by a CNN classifier w.r.t to the input , to extract localization maps from the generators and discriminators . The self-attention mechanism and GradCAM visualization allow us to verify and interpret that the networks are learning meaningful features . Moreover , these extracted attention maps can reveal neurons or activity patterns that are informative in the neuronal learning process . A detail description of the model architectures are available in Section D. 2.3.1 NEURON ORDERING CNNs with a smaller kernel can often perform as well or even better than models with larger kernels while consisting of fewer trainable parameters ( He et al. , 2016a ; Li et al. , 2021 ) . Nevertheless , a smaller kernel can also limit the receptive field of the model , or the region in the input that the model is exposed to in each convolution step ( Araujo et al. , 2019 ) . In addition , the recordings obtained from the virtual-corridor experiment were annotated based on how visible the neurons were in the calcium image , rather than ordered in a particular manner ( see Figure A.1 ) . This could potentially restrict CNNs with small receptive field to learn meaningful spatial-temporal information from the population responses . To mitigate this issue , we derive a procedure to pre-sort X and Y , such that neurons that are highly correlated or relevant are nearby in their ordering . A naive approach is to sort the neurons by their firing rate or average pairwise correlation , where the neuron with the highest firing rate or the neuron that , on average , is most correlated to other neurons is ranked first in the data matrix . However , it is possible that not all highfiring neurons or most correlated neurons are the most influential in the learning process . Therefore , we also explore a data-driven approach . Deep autoencoders have shown excellent results in feature extraction and representation learning ( Gondara , 2016 ; Wang et al. , 2016 ; Tschannen et al. , 2018 ) , and we can take advantage of its unsupervised feature learning ability . We employ a deep autoencoder AE which learns to reconstruct calcium signals in X and Y jointly . AE consists of 3 convolution down-sampling blocks , followed by a bottleneck layer , then 3 transposed-convolution up-sampling blocks . The down-sampling block consists of a convolution layer followed by Instance Normalization ( Ulyanov et al. , 2016 ) , Leaky ReLU ( LReLU ) activation ( Maas et al. , 2013 ) and Spatial Dropout ( Tompson et al. , 2015 ) , whereas a transpose convolution is used in the up-sampling block instead . We optimize the mean-squared error ( MSE ) reconstruction loss on the training set of X and Y , then we use the per-neuron reconstruction error on the test set to sort the neurons ( in ascending order ) : order = argsort ( 0.5× [ MSE ( X , AE ( X ) ) +MSE ( Y , AE ( Y ) ) ] ) . The neuron sorting process is part of the data preprocessing step and is independent from the CycleGAN framework . 2.3.2 SYNTHETIC DATA CycleGAN was originally introduced for image-to-image translation . Albeit the two image distributions are not aligned hence can not be directly compared easily , one could still visually inspect whether or not x̂ = F ( y ) and ŷ = G ( x ) are reasonable transformations . However , it would be difficult to visually inspect the two transformations with calcium signals . To this end , we introduce an additional dataset Y = Φ ( X ) with a known transformation Φ , such that G : X → Y = Φ ( X ) and F : Y = Φ ( X ) → X . We can then verify G ( x ) = ŷ = Φ ( x ) and F ( y ) = x̂ = x . We defined the spatiotemporal transformation Φ that can be identified visually as follows : ( 6 ) Φ ( x ) = mdiagonalx + 0.5η , where mdiagonal is a diagonal mask to zero-out the lower left corners of the signals and η ∼ N ( µx , σ2x ) . µx and σx are the per-neuron mean and standard deviation ofX . Figure 1 shows an augmented example . Importantly , we shuffle the train set after the augmentation procedure so that X and Y appears to be unpaired to the model . Whereas the test set remains in its original paired arrangement so that we can compare ‖ X−F ( Y ) ‖ and ‖ Y −G ( X ) ‖ . | This paper uses CycleGAN to map neuronal activities of mice (as measured by Calcium traces) pre- and post-learning. The main contributions are (1) empirical results of using CycleGAN to learn the pre- and post-learning mapping look promising. (2) using both attention mask (which is for gating residual concatenations) and Grad-CAM to help with interpretation. (3) sorting neurons with an autoencoder’s reconstruction error, essentially sorting them based on their importance. | SP:1640224fbb539102c940e326404114dfdd4abf98 |
Neuronal Learning Analysis using Cycle-Consistent Adversarial Networks | Understanding how activity in neural circuits reshapes following task learning could reveal fundamental mechanisms of learning . Thanks to the recent advances in neural imaging technologies , high-quality recordings can be obtained from hundreds of neurons over multiple days or even weeks . However , the complexity and dimensionality of population responses pose significant challenges for analysis . Existing methods of studying neuronal adaptation and learning often impose strong assumptions on the data or model , resulting in biased descriptions that do not generalize . In this work , we use a variant of deep generative models called – cycle-consistent adversarial networks , to learn the unknown mapping between pre- and post-learning neuronal activities recorded in vivo . To do so , we develop an end-to-end pipeline to preprocess , train and evaluate calcium fluorescence signals , and a procedure to interpret the resulting deep learning models . To assess the validity of our method , we first test our framework on a synthetic dataset with known ground-truth transformation . Subsequently , we applied our method to neuronal activities recorded from the primary visual cortex of behaving mice , where the mice transition from novice to expert-level performance in a visual-based virtual reality experiment . We evaluate model performance on generated calcium imaging signals and their inferred spike trains . To maximize performance , we derive a novel approach to pre-sort neurons such that convolutional-based networks can take advantage of the spatial information that exists in neuronal activities . In addition , we incorporate visual explanation methods to improve the interpretability of our work and gain insights into the learning process as manifested in the cellular activities . Together , our results demonstrate that analyzing neuronal learning processes with data-driven deep unsupervised methods holds the potential to unravel changes in an unbiased way . 1 INTRODUCTION . One of the main objectives in computational neuroscience is to study the dynamics of neural processing and how neural activity reshapes in the course of learning . A major hurdle was the difficulty in obtaining high-quality neural recordings of the same set of neurons across multiple experiments , though such limitation in recording techniques has seen tremendous improvements in recent years . With the advent of modern neural imaging technologies , it is now possible to monitor a large population of neurons over days or even weeks ( Williams et al. , 2018a ; Steinmetz et al. , 2021 ) , thus allowing experimentalists to obtain in vivo recordings from the same set of neurons across different learning stages . Significant efforts have been put into extracting interpretable and unbiased descriptions of how cortical responses change with experience . Proposed approaches to model changes in neuronal activity include linear latent variable models such as PCA , TCA , GPFA , GPFADS and PSID ( Cunningham & Byron , 2014 ; Williams et al. , 2018b ; Sani et al. , 2021 ; Yu et al. , 2009 ; Rutten et al. , 2020 ) . Methods employing deep learning models but with linear changes or mapping include LFADS and PfLDS ( Pandarinath et al. , 2018 ; Gao et al. , 2016 ) . While these methods enabled substantial progress in understanding the structure of neuronal activity , they do have strong assumptions inherent in the modelling technique or the analysis , such as the linearity assumption in linear latent variable models . Therefore , making sense of the unknown mapping between pre- and post-learning neural activity in an unbiased manner remains a significant challenge , and a data-driven method to interpret the circuit dynamics in learning is highly desirable . Thanks to their ability to self-identity and self-learn features from complex data , deep neural networks ( DNNs ) have seen tremendous success in many biomedical applications ( Cao et al. , 2018 ; Zemouri et al. , 2019 ; Piccialli et al. , 2021 ) . Specifically , deep generative networks have shown promising results in analyzing and synthesizing neuronal activities in recent years . Pandarinath et al . ( 2018 ) developed a variational autoencoder ( VAE ) to learn latent dynamics from single-trial spiking activities and Prince et al . ( 2020 ) extended the framework to work with calcium imaging data . Numerous work have demonstrated generative adversarial networks ( GAN ) are capable of synthesizing neuronal activities that capture the low-level statistics of recordings obtained from behaving animals ( Molano-Mazon et al. , 2018 ; Ramesh et al. , 2019 ; Li et al. , 2020 ) . In this work , we explore the use of cycle-consistent adversarial networks ( Zhu et al. , 2017 ) , or CycleGAN , to learn the mapping between pre- and post-learning neuronal activities in an unsupervised and data-driven manner . In other words , given the neural recordings of a novice animal , can we translate the neuronal activities that correspond to the animal with expert-level performance , and vice versa ? The resulting transformation summarizes these changes in response characteristics in a compact form and is obtained in a fully data-driven way . Such a transformation can be useful in follow-up studies to 1 ) identify neurons that are particularly important for describing the changes in the overall response statistics , not limited to first or second order statistics ; 2 ) detect response patterns relevant for changes from pre- to post-learning ; and 3 ) determine what experimental details are of particular interest for learning . To learn the transformation , we derive a standardized procedure to train , evaluate and interpret the CycleGAN framework . To improve the explainability of our work , we incorporate a self-attention mechanism into our generator models and also employ a feature-importance visualization method into our pipeline so that we can visualize and identify the input that the networks deemed relevant in their decision making process . In addition , we introduced a novel neuron ordering method to improve the learning performance of convolutional neural networks ( CNN ) . To quantify the capability of the proposed unsupervised learning method , we evaluate our method on two datasets : 1 ) an artificially constructed dataset with a handcrafted transformation , and 2 ) recordings obtained from the primary visual cortex of a behaving animal across multiple days . We then compare several metrics and statistics between the recorded and translated calcium traces and their inferred spike trains . 2 METHODS . 2.1 ANIMAL EXPERIMENT To obtain neuronal activities that can demonstrate pre- and postlearning responses , we conducted a visual-based experiment which follows a similar procedure as Pakan et al . ( 2018 ) and Henschke et al . ( 2020 ) . Briefly , a head-fixed mouse was placed on a linear treadmill that allows it to move forward and backward . A lick spout and two monitors were placed in front of the treadmill and a virtual corridor with defined grating pattern was shown to the mouse . A reward ( water drop ) would be made available if the mouse licked within the predefined reward location ( at 120-140 cm ) , in which a black screen is displayed as a visual clue . Figure A.1 illustrates the experiment setup . The mouse should learn to utilize both visual information and self-motion feedback to maximize reward . The same set of neurons in the primary visual cortex were labelled with GCaMP6 calcium indicator and monitored throughout 4 days of experiment , the relative changes in fluorescence ( ∆F/F0 ) over time were used as a proxy for an action potential . 4 mice were used in the virtual-corridor experiment and all mice transitioned from novice to expert in the behaviour task within 4 days of training . Mouse 1 took on average 6.94s per trial on day 1 and 4.43s per trial on day 4 , Table A.1 and A.2 shows the trial information of all the mice . Hence , this dataset can provide excellent insights into how cortical responses reshape with experience . 2.2 CYCLEGAN CycleGAN ( Zhu et al. , 2017 ) is a GAN-based unsupervised framework that learns the mapping between two unpaired distributions X and Y via the adversarial training and cycle-consistency optimization . The framework has shown excellent results in a number of unsupervised translation tasks , including natural language translation ( Gomez et al. , 2018 ) and molecular optimization ( Maziarka et al. , 2020 ) , to name a few . Let X and Y be two distributions with unknown mappings that correspond to ( novice ) pre- and ( expert ) post-learning neuronal activity , respectively . CycleGAN consists of four DNNs : generator G : X → Y that maps novice activities to expert activities and generator F : Y → X that maps expert activities to novice activities ; discriminator DX : X → [ 0 , 1 ] and discriminator DY : Y → [ 0 , 1 ] that learn to distinguish novice and expert neural activities , respectively . In a forward cycle step ( X → Y → X , illustrated in Figure B.1 ) , we first sample a novice recording x from distribution X and apply transformation G to obtain ŷ = G ( x ) . We expect ŷ to resembles data from the expert distribution Y , hence DY learns to minimize ( 1 ) LDY = −Ey∼Y [ ( DY ( y ) − 1 ) 2 ] + Ex∼X [ DY ( G ( x ) ) 2 ] . Similar to a typical GAN , generator G learns to deceive DY with the objective of ( 2 ) LG = −Ex∼X [ ( DY ( G ( x ) ) −1 ) 2 ] . Note that these are same objectives in LSGAN ( Mao et al. , 2017 ) . However , DY can only verify if ŷ ∈ Y , though can not ensure that ŷ is the corresponding expert activity of the novice recording x. Moreover , X and Y are not paired hence we can not directly compare ŷ with samples in Y . To tackle this issue , CycleGAN applies another transformation to reconstruct the novice recording x̄ = F ( ŷ ) where the distance ‖ x − x̄ ‖ or ‖ x − F ( G ( x ) ) ‖ should be minimal . Therefore , the generators also optimize this cycle-consistent loss ( 3 ) Lcycle = Ex∼X [ ‖ x − F ( G ( x ) ) ‖ ] + Ey∼Y [ ‖ y − G ( F ( y ) ) ‖ ] . Mean absolute error ( MAE ) was used as the distance function , though other distance functions can also be employed . In addition , we would expect x̂ = F ( x ) and ŷ = G ( y ) to be in distributions X and Y given that F : Y → X and G : X → Y , hence the identity loss objective ( 4 ) LGidentity = Ey∼Y [ ‖ y −G ( y ) ‖ ] . Taken all together , G optimizes the following objectives : ( 5 ) LGtotal = LG + λcycleLcycle + λidentityLGidentity where λidentity and λcycle are hyper-parameters for identity and cycle loss coefficients . All four networks are trained jointly where LFtotal and LDX are similar to LGtotal and LDY though in opposite directions . In this work , we adapt the CycleGAN framework to learn the unknown mapping between pre- and post-learning neuronal activities recorded from the primary visual cortex of behaving mice . In addition , we experiment with different GANs objective formulations on top of the original LSGAN objective , including GAN ( Goodfellow et al. , 2014 ) , WGANGP ( Arjovsky et al. , 2017 ) and DRAGAN ( Kodali et al. , 2017 ) . Table C.2 shows their exact formulations in CycleGAN . 2.3 MODEL PIPELINE We devise a consistent analysis framework , including data preprocessing and augmentation , networks interpretation , and evaluation of the generated calcium fluorescence signals and their inferred spike trains . Figure C.1 illustrates the complete pipeline of our work.1 We denote the day 1 ( pre-learning ) and day 4 ( post-learning ) recording distributions to be X and Y . With Mouse 1 , W = 102 neurons from the primary visual cortex were monitored , as well as trial information such as the virtual distance , licks and rewards . In total , 21471 and 21556 samples were recorded on day 1 and 4 . Since we want the generators and discriminators to identify patterns relevant to the animal experiment in a data-driven manner , we do not incorporate any trial information into the training data . We first segment the two datasets with a sliding window of size H = 2048 along the temporal dimension ( around 85 s in wall-time ) , resulting in data with shape ( N , H , W ) for X and Y where N is the total number of segments . We select a stride size that space out each segment evenly so that we obtained a sufficient number of samples while keeping the correlations between samples reasonably low . In order to take advantage of the spatiotemporal information in the neuronal activities in a 2D CNN , we further convert the two sets to have shape ( N , H , W , C ) where C = 1 . Finally , we normalize each set to the range [ 0 , 1 ] , and divide them into train , validation and test set with 3000 , 200 and 200 samples respectively . To evaluate the transformation results of G and F , we can compare the cycle-consistency MAE ( X , F ( G ( X ) ) ) and MAE ( Y , G ( F ( Y ) ) ) , as well as the identity losses MAE ( X , F ( X ) ) and MAE ( Y , G ( Y ) ) ( e.g . we expect F to apply no transformation to a novice sample x ) . We also evaluate the generated data in terms of spike activities in the following distribution combinations : novice against translated novice ( X | F ( Y ) ) , novice against reconstructed novice ( X | F ( G ( X ) ) ) , expert against translated expert ( Y | G ( X ) ) and expert against reconstructed expert ( Y | G ( F ( Y ) ) ) . We use Cascade ( Rupprecht et al. , 2021 ) to infer spike trains from the recorded and generated calcium signals to assess the credibility of the generated signals . We measure the following commonly used spike train similarities and statistics : 1 ) mean firing rate for evaluating single neuron statistics ; 2 ) pairwise Pearson correlation for evaluating pairwise statistics ; 3 ) pairwise van Rossum distance ( Rossum , 2001 ) for evaluating general spike train similarity . We evaluate these quantities across the whole population for each neuron or neuron pairs and compare the resulting distributions over these quantities obtained from the recorded and generated data . We , therefore , validate the whole spatiotemporal first and second-order statistics as well as general spike train similarities . To improve the explainability of this work we introduce a number of recently proposed model interpretation methods into our pipeline . We design a self-attention generator architecture which allows 1The software codebase will be made publicly available upon acceptance . the network to learn a set of attention masks such that it encourages the network to better focus on specific areas of interest in the input and also enables us to visually inspect the learned attention maps . In addition , we use GradCAM ( Selvaraju et al. , 2017 ) , a method to visualize discriminative region ( s ) learned by a CNN classifier w.r.t to the input , to extract localization maps from the generators and discriminators . The self-attention mechanism and GradCAM visualization allow us to verify and interpret that the networks are learning meaningful features . Moreover , these extracted attention maps can reveal neurons or activity patterns that are informative in the neuronal learning process . A detail description of the model architectures are available in Section D. 2.3.1 NEURON ORDERING CNNs with a smaller kernel can often perform as well or even better than models with larger kernels while consisting of fewer trainable parameters ( He et al. , 2016a ; Li et al. , 2021 ) . Nevertheless , a smaller kernel can also limit the receptive field of the model , or the region in the input that the model is exposed to in each convolution step ( Araujo et al. , 2019 ) . In addition , the recordings obtained from the virtual-corridor experiment were annotated based on how visible the neurons were in the calcium image , rather than ordered in a particular manner ( see Figure A.1 ) . This could potentially restrict CNNs with small receptive field to learn meaningful spatial-temporal information from the population responses . To mitigate this issue , we derive a procedure to pre-sort X and Y , such that neurons that are highly correlated or relevant are nearby in their ordering . A naive approach is to sort the neurons by their firing rate or average pairwise correlation , where the neuron with the highest firing rate or the neuron that , on average , is most correlated to other neurons is ranked first in the data matrix . However , it is possible that not all highfiring neurons or most correlated neurons are the most influential in the learning process . Therefore , we also explore a data-driven approach . Deep autoencoders have shown excellent results in feature extraction and representation learning ( Gondara , 2016 ; Wang et al. , 2016 ; Tschannen et al. , 2018 ) , and we can take advantage of its unsupervised feature learning ability . We employ a deep autoencoder AE which learns to reconstruct calcium signals in X and Y jointly . AE consists of 3 convolution down-sampling blocks , followed by a bottleneck layer , then 3 transposed-convolution up-sampling blocks . The down-sampling block consists of a convolution layer followed by Instance Normalization ( Ulyanov et al. , 2016 ) , Leaky ReLU ( LReLU ) activation ( Maas et al. , 2013 ) and Spatial Dropout ( Tompson et al. , 2015 ) , whereas a transpose convolution is used in the up-sampling block instead . We optimize the mean-squared error ( MSE ) reconstruction loss on the training set of X and Y , then we use the per-neuron reconstruction error on the test set to sort the neurons ( in ascending order ) : order = argsort ( 0.5× [ MSE ( X , AE ( X ) ) +MSE ( Y , AE ( Y ) ) ] ) . The neuron sorting process is part of the data preprocessing step and is independent from the CycleGAN framework . 2.3.2 SYNTHETIC DATA CycleGAN was originally introduced for image-to-image translation . Albeit the two image distributions are not aligned hence can not be directly compared easily , one could still visually inspect whether or not x̂ = F ( y ) and ŷ = G ( x ) are reasonable transformations . However , it would be difficult to visually inspect the two transformations with calcium signals . To this end , we introduce an additional dataset Y = Φ ( X ) with a known transformation Φ , such that G : X → Y = Φ ( X ) and F : Y = Φ ( X ) → X . We can then verify G ( x ) = ŷ = Φ ( x ) and F ( y ) = x̂ = x . We defined the spatiotemporal transformation Φ that can be identified visually as follows : ( 6 ) Φ ( x ) = mdiagonalx + 0.5η , where mdiagonal is a diagonal mask to zero-out the lower left corners of the signals and η ∼ N ( µx , σ2x ) . µx and σx are the per-neuron mean and standard deviation ofX . Figure 1 shows an augmented example . Importantly , we shuffle the train set after the augmentation procedure so that X and Y appears to be unpaired to the model . Whereas the test set remains in its original paired arrangement so that we can compare ‖ X−F ( Y ) ‖ and ‖ Y −G ( X ) ‖ . | This paper presents a new method for learning the transformation in neural population activity that takes place during task learning. The method is based on CycleGAN, but includes additional modifications related to neural data and the manner in which it is collected. The paper also presents visual interrogations of the learned model to better understand details of the learning process. | SP:1640224fbb539102c940e326404114dfdd4abf98 |
Provably Calibrated Regression Under Distribution Drift | 1 INTRODUCTION . Accurate uncertainty quantification is crucial for machine learning predictions used in high-stakes decision making . Typically , uncertainty is represented by probability distributions over the possible outcomes , and these probabilities should be calibrated . In the regression setup , for example , the true label should be below the predicted 95 % quantile for 95 % of the samples ( Gneiting et al. , 2007 ) . Calibration can convey confidence to decision makers because extreme values ( e.g . true label above 95 % quantile ) are guaranteed to be rare . In addition to calibration , these probabilities should be sharp ( i.e . concentrated and have low variance ) . Sharp probabilities are useful to decision makers because they are informative . If data is i.i.d. , then recalibration ( Kuleshov et al. , 2018 ) and conformal prediction ( Vovk et al. , 2020 ) algorithms can achieve low calibration error and good sharpness in the regression setup . However , the i.i.d . assumption is unlikely to hold in most time-series prediction tasks . Under distribution drift , it is possible to adapt regret minimization algorithms ( Cesa-Bianchi & Lugosi , 2006 ; Kuleshov & Ermon , 2017 ) to achieve calibration . However , regret minimization calibration algorithms are designed for the asymptotic regime , and empirically we show that they are effective only with large sample size , and have very poor calibration and sharpness with short time series ( e.g . 50 samples ) , limiting their practical utility . Our goal is to design an algorithm to achieve good calibration and sharpness in the online regression setup even for short time series . We start with an existing prediction algorithm that has good calibration and sharpness for i.i.d . data ( such as conformal prediction ) , and track the empirical frequency that the labels are below e.g . the 75 % quantile . If the empirical frequency is significantly below 75 % , we move future predictions up so more labels are below the prediction ; vice versa . We design a very efficient adjustment method that can guarantee near perfect calibration with only tens of samples . We call this the “ basic ” prediction algorithm shown in Figure 1 ( upper right ) . Our main technical contribution is an improved algorithm that addresses two short-comings of the “ basic ” algorithm without breaking guaranteed calibration . First , the predictions should be feasible , e.g . the 75 % quantile should never be smaller than the 25 % quantile . The basic algorithm might violate this requirement because we adjust each quantile separately with no constraint on their relation . Second , the predictions should be stable if the distribution drift stops ; empirically instability harms sharpness and proper scores . Our improved algorithm is based on an analogy between the prediction task and a mechanical system . We encode the feasibility constraints as the feasible states of a mechanical system , and use proportional-integral-derivative ( PID ) control ( Minorsky , 1922 ) to stabilize the system . Our final algorithm makes predictions that satisfy all three desirable properties : provable calibration , feasibility , and stability ( Figure 1 bottom right ) . We test our algorithm on two real world time series datasets ( stock earnings and COVID cases ) and a large benchmark of 17 common regression datasets . We reduce calibration error by approximately 2x compared too all baselines , while achieving comparable or better sharpness . We also simulate COVID response decisions based on predictions on the COVID dataset , and observe improved decision loss compared to baselines during periods of distribution drift ( e.g . when case numbers surge ) . 2 PROBLEM SETUP AND BACKGROUND . We consider regression problems . Let X ∈ X denote the input feature and Y denote the label . We assume that the label is bounded by B , i.e . Y can not take any value outside [ −B , B ] for some pre-specified B > 0 . We consider quantile predictions with a set of K equally spaced quantiles 0 < α1 < · · · < αK < 1 . For example , when K = 9 we choose α1 = 10 % , α2 = 20 % , · · · , αK = 90 % . A quantile prediction is a vector of K numbers ( denoted by Z ) where Zk should ideally predict the αk-th quantile of the label Y |X conditioned on the input feature X . We say a quantile prediction is feasible , if Yk < Yk+1 , ∀k , i.e . a lower quantile is always smaller than a higher quantile . In the limit of infinitely many quantiles K → ∞ , a quantile prediction is equivalent to a probability distribution , however , for technical reasons that will become evident later , we only consider finitely many quantiles in this paper . Our setup is an online prediction setup , where the forecaster sequentially makes the predictions . Consider a COVID prediction example : at time t , the forecaster observes some features Xt ( such as current vaccination rate ) and makes a prediction Zt about next week ’ s case number . After the forecaster makes a prediction , the true case number Y t is revealed ; then we move on to time step t + 1 and repeat this process . Following standard terminology we will use “ nature ” to refer to the process that generates the featuresXt and the true label Y t. Our setup is formalized by the following interaction between forecaster and nature : for t = 1 , 2 , · · · , T 1 . Nature reveals feature Xt 2 . Forecaster makes a quantile prediction Zt ∈ RK where Ztk is the αk-th quantile . 3 . Nature reveals label Y t ∈ [ −B , B ] We call a finite sequence of interactions a transcript , i.e . a sequence X1 , Z1 , Y 1 , · · · , XT , ZT , Y T . A forecasting algorithm ψ is a function that maps a transcript and a new feature to a prediction : ψ : X1 , Z1 , Y 1 , · · · , Xt−1 , Zt−1 , Y t−1 , Xt 7→ Zt . ( 1 ) We will consider two types of assumptions on nature . We say that nature is i.i.d . if ∀t , Xt , Y t are drawn from some i.i.d . random variable ( but we make no assumption on the probability law on this random variable ) . We say that nature is causal if nature chooses Xt , Yt without depending on the future . Specifically , Xt , Y t can only depend on the variables that precede it in the transcript ( i.e . Xt can depend on X1 , · · · , Y t−1 and Y t can only depend on X1 , · · · , Y t−1 , Xt , Zt ) . Causal is an extremely weak assumption . For example , nature can even adversarially choose the label Y t to increase prediction error after observing the forecaster ’ s prediction Zt . 2.1 CALIBRATION AND ACHIEVING CALIBRATION WITH CONFORMAL METHODS . A natural property that we can request is ( probabilistic ) calibration ( Gneiting et al. , 2007 ; Kuleshov et al. , 2018 ) . Intuitively , ∀k , the label Y t should be below the predicted αk-th quantile for an αk proportion of the samples . Formally , given a transcript of any length , consider the empirical frequency that the label Y t is below the predicted quantile Ztk up to time T ( for any T that ’ s less than the length of transcript ) FTk = ∑ 1≤t≤T I ( Y t ≤ Ztk ) . ( 2 ) Ideally , the label Y t should be below the αk-th quantile exactly αkT many times , i.e. , ∀k , FTk /T = αk . Achieving this perfectly is difficult , so we define an approximation . For any function b : N → R+ we say that a transcript is b-calibrated if ∀k = 1 , · · · , K , ∀T , |FTk /T − αk| ≤ b ( T ) . Correspondingly , a forecasting strategy is calibrated if the resulting transcript is calibrated : , Definition 1 . For any function b : N → R+ , a forecasting algorithm ψ is b-calibrated under i.i.d . ( or causal ) assumptions if for any nature ’ s strategy that is i.i.d . ( or causal ) , the resulting transcript is b-calibrated almost surely . Conformal Calibration Conformal calibration ( Vovk et al. , 2020 ) is a forecasting algorithm based on conformal prediction ideas ( Vovk et al. , 2005 ; Shafer & Vovk , 2008 ) . It is a wrapper algorithm that transforms a initial predictor ( such as an off-the-shelf predictor ) into new predictions that are provably calibrated under i.i.d . assumptions . Conformal calibration is based on the following intuition : for example , if 75 % of past labels are below the initial prediction ’ s mean , then we can use the initial prediction ’ s mean as the 75 % -quantile prediction in the future . More generally , we identify a statistic of the initial prediction , such that αk-proportion of the past labels are below that statistic . We use this statistic as the αk-th quantile of the future prediction . If the data is i.i.d. , conformal calibration is a very useful algorithm . This is because it has extremely strong calibration properties ( Proven in Proposition 1 of ( Vovk et al. , 2020 ) ) , where the random variables I ( Y t ≤ Ztk ) , t = 1 , 2 , · · · is a sequence of i.i.d . Bernoulli random variables with mean αk . This is impressive because even if we have access to the oracle forecaster ( i.e . Y tk is equal to the true conditional αk-th quantile of Y t|Xt ) , we can not achieve better calibration — I ( Y t ≤ Ztk ) is also a sequence of i.i.d . Bernoulli random variables with mean αk . Empirically , conformal prediction also has very good sharpness if the initial prediction function is reasonable ( Burnaev & Vovk , 2014 ) . A minor property ( but needed for proofs ) is that the predictions should bounded in [ −B , B ] . Conformal calibration satisfies this property when t > K , i.e . there are more samples than predicted quantiles . To bypass this limitation , we can initialize the conformal calibration algorithm with at least K offline samples . Alternatively , if we know B in advance , we can clip the prediction by B . 3 CALIBRATION UNDER DISTRIBUTION DRIFT . This section introduces our algorithm that guarantees calibration even when nature is not i.i.d . We start from a basic algorithm in Section 3.1 , and discuss its shortcomings . Then we move on to more advanced algorithms in Section 3.2 and 3.3 to address the shortcomings . 3.1 A BASIC CALIBRATED PREDICTION ALGORITHM . Conformal calibration achieves good calibration and sharpness when nature is i.i.d . When we are unsure if nature is i.i.d. , our basic idea is to use conformal calibration until it has failed to achieve calibration . Specifically , when nature is i.i.d. , I ( Y t ≤ Ztk ) is a sequence of Bernoulli random variables , so FTk is the sum of these Bernoulli random variables ( i.e . a binomial ) . We use b ∗ δ ( T ) to denote the confidence interval of a binomial distribution , i.e . Pr [ FTk /T ∈ αk ± b∗δ ( T ) ] = 1 − δ . We fix some small δ ( such as 0.05 ) and if under the conformal calibration algorithm FTk /T 6∈ αk ± b∗δ ( T ) , we know ( with 0.95 confidence ) that nature is not i.i.d , so we will make adjustments to salvage calibration . From a high level , F tk > αkt + b ∗ δ ( t ) t implies that the true label is below the αk-th quantile too often , so our prediction Ztk has been too large and we should reduce it ; vice versa ; There are some design freedom in choosing how much to reduce or increase the prediction . We choose an adjustment that grows exponentially with larger calibration error . The reason for this choice is to make very large adjustments when the calibration error is large , so we can tightly bound the calibration error . Formally , let Z̃tk denote the initial prediction generated by the conformal calibration prediction algorithm , the prediction of our algorithm Y tk is given by Zt+1k = Z̃ t+1 k + E t+1 k , where E t+1 k = 1− e β ( F tk−αkt−b ∗ δ ( t ) t ) F tk > αkt+ b ∗ δ ( t ) t eβ ( αkt−b ∗ δ ( t ) t−F t k ) − 1 F tk < αkt− b∗δ ( t ) t 0 otherwise ( 3 ) Intuitively , if F tk is within the correct range we make no adjustments ( i.e . Z t+1 k = Z̃ t+1 k ) ; when F tk falls outside the correct range , we make aggressive adjustments that increase exponentially with how much it falls outside the correct range . β > 0 is a hyper-parameter that controls how large the adjustments are ( we will show in Section 3.4 that these hyper-parameters are easy to choose ) . Note that Et+1k is for the ( t + 1 ) -th time step ( instead of t ) . This is because any adjustments can only depend on past information , so we will only have access to F tk at the ( t+ 1 ) -th time step . The following theorem shows that such adjustments indeed guarantee calibration . Theorem 1 . Let Z̃tk be generated by any forecasting algorithm and bounded in [ −B , B ] , for any δ > 0 , the prediction algorithm defined by Eq . ( 3 ) is b-calibrated where b ( T ) = b∗δ ( T ) + log ( 2B+1 ) +β βT . Note that the guarantee of Theorem 1 does not require that conformal calibration generate the initial prediction Z̃tk . The use of conformal calibration is motivated by its strong empirical performance ( Vovk et al. , 2020 ) when the data is i.i.d . or close to i.i.d . ( which is further supported by our experiments ) . The calibration guarantee is strong because under conformal calibration with i.i.d . data ( or the oracle forecaster ) we can expect to see b∗δ ( T ) calibration error ( with 1 − δ probability ) ; without i.i.d . assumptions , our algorithm can ensure that the calibration error only increases by O ( logB/T ) . Notably , the calibration error scales logarithmically with the assumed upper bound logB , so choosing a loose bound B does not significantly degrade the guarantee . The basic idea has two shortcomings illustrated in Figure 1 that we will address in the next sections . First , in a feasible quantile prediction , the 75 % quantile should never be smaller than the 25 % quantile , but our adjustments might violate this requirement because we adjust each quantile separately with no constraint . Second , the basic idea might lead to oscillation and instability . Intuitively , when the empirical frequency is incorrect , we make adjustments to correct it , but once the empirical frequency improves , we reduce the adjustments , which will cause the empirical frequency to become incorrect again , leading to oscillation . Empirically instability can hurt performance metrics such as sharpness . | This paper considers the problem of calibrating quantiles outputted by a regression model. The data is assumed to draw from a non-iid source (e.g. time series with distribution shift). The paper proposes a method that adjusts the output quantiles to be better calibrated for a less-restricted definition of b-calibrated. Some further methods are also proposed to ensure the quantiles are monotonic and stable. Experiments are conducted to compare the proposed method with uncalibrated models and conformal predictions. | SP:221f1dde4d5baeae63e928e94f8759a7b4b1c926 |
Provably Calibrated Regression Under Distribution Drift | 1 INTRODUCTION . Accurate uncertainty quantification is crucial for machine learning predictions used in high-stakes decision making . Typically , uncertainty is represented by probability distributions over the possible outcomes , and these probabilities should be calibrated . In the regression setup , for example , the true label should be below the predicted 95 % quantile for 95 % of the samples ( Gneiting et al. , 2007 ) . Calibration can convey confidence to decision makers because extreme values ( e.g . true label above 95 % quantile ) are guaranteed to be rare . In addition to calibration , these probabilities should be sharp ( i.e . concentrated and have low variance ) . Sharp probabilities are useful to decision makers because they are informative . If data is i.i.d. , then recalibration ( Kuleshov et al. , 2018 ) and conformal prediction ( Vovk et al. , 2020 ) algorithms can achieve low calibration error and good sharpness in the regression setup . However , the i.i.d . assumption is unlikely to hold in most time-series prediction tasks . Under distribution drift , it is possible to adapt regret minimization algorithms ( Cesa-Bianchi & Lugosi , 2006 ; Kuleshov & Ermon , 2017 ) to achieve calibration . However , regret minimization calibration algorithms are designed for the asymptotic regime , and empirically we show that they are effective only with large sample size , and have very poor calibration and sharpness with short time series ( e.g . 50 samples ) , limiting their practical utility . Our goal is to design an algorithm to achieve good calibration and sharpness in the online regression setup even for short time series . We start with an existing prediction algorithm that has good calibration and sharpness for i.i.d . data ( such as conformal prediction ) , and track the empirical frequency that the labels are below e.g . the 75 % quantile . If the empirical frequency is significantly below 75 % , we move future predictions up so more labels are below the prediction ; vice versa . We design a very efficient adjustment method that can guarantee near perfect calibration with only tens of samples . We call this the “ basic ” prediction algorithm shown in Figure 1 ( upper right ) . Our main technical contribution is an improved algorithm that addresses two short-comings of the “ basic ” algorithm without breaking guaranteed calibration . First , the predictions should be feasible , e.g . the 75 % quantile should never be smaller than the 25 % quantile . The basic algorithm might violate this requirement because we adjust each quantile separately with no constraint on their relation . Second , the predictions should be stable if the distribution drift stops ; empirically instability harms sharpness and proper scores . Our improved algorithm is based on an analogy between the prediction task and a mechanical system . We encode the feasibility constraints as the feasible states of a mechanical system , and use proportional-integral-derivative ( PID ) control ( Minorsky , 1922 ) to stabilize the system . Our final algorithm makes predictions that satisfy all three desirable properties : provable calibration , feasibility , and stability ( Figure 1 bottom right ) . We test our algorithm on two real world time series datasets ( stock earnings and COVID cases ) and a large benchmark of 17 common regression datasets . We reduce calibration error by approximately 2x compared too all baselines , while achieving comparable or better sharpness . We also simulate COVID response decisions based on predictions on the COVID dataset , and observe improved decision loss compared to baselines during periods of distribution drift ( e.g . when case numbers surge ) . 2 PROBLEM SETUP AND BACKGROUND . We consider regression problems . Let X ∈ X denote the input feature and Y denote the label . We assume that the label is bounded by B , i.e . Y can not take any value outside [ −B , B ] for some pre-specified B > 0 . We consider quantile predictions with a set of K equally spaced quantiles 0 < α1 < · · · < αK < 1 . For example , when K = 9 we choose α1 = 10 % , α2 = 20 % , · · · , αK = 90 % . A quantile prediction is a vector of K numbers ( denoted by Z ) where Zk should ideally predict the αk-th quantile of the label Y |X conditioned on the input feature X . We say a quantile prediction is feasible , if Yk < Yk+1 , ∀k , i.e . a lower quantile is always smaller than a higher quantile . In the limit of infinitely many quantiles K → ∞ , a quantile prediction is equivalent to a probability distribution , however , for technical reasons that will become evident later , we only consider finitely many quantiles in this paper . Our setup is an online prediction setup , where the forecaster sequentially makes the predictions . Consider a COVID prediction example : at time t , the forecaster observes some features Xt ( such as current vaccination rate ) and makes a prediction Zt about next week ’ s case number . After the forecaster makes a prediction , the true case number Y t is revealed ; then we move on to time step t + 1 and repeat this process . Following standard terminology we will use “ nature ” to refer to the process that generates the featuresXt and the true label Y t. Our setup is formalized by the following interaction between forecaster and nature : for t = 1 , 2 , · · · , T 1 . Nature reveals feature Xt 2 . Forecaster makes a quantile prediction Zt ∈ RK where Ztk is the αk-th quantile . 3 . Nature reveals label Y t ∈ [ −B , B ] We call a finite sequence of interactions a transcript , i.e . a sequence X1 , Z1 , Y 1 , · · · , XT , ZT , Y T . A forecasting algorithm ψ is a function that maps a transcript and a new feature to a prediction : ψ : X1 , Z1 , Y 1 , · · · , Xt−1 , Zt−1 , Y t−1 , Xt 7→ Zt . ( 1 ) We will consider two types of assumptions on nature . We say that nature is i.i.d . if ∀t , Xt , Y t are drawn from some i.i.d . random variable ( but we make no assumption on the probability law on this random variable ) . We say that nature is causal if nature chooses Xt , Yt without depending on the future . Specifically , Xt , Y t can only depend on the variables that precede it in the transcript ( i.e . Xt can depend on X1 , · · · , Y t−1 and Y t can only depend on X1 , · · · , Y t−1 , Xt , Zt ) . Causal is an extremely weak assumption . For example , nature can even adversarially choose the label Y t to increase prediction error after observing the forecaster ’ s prediction Zt . 2.1 CALIBRATION AND ACHIEVING CALIBRATION WITH CONFORMAL METHODS . A natural property that we can request is ( probabilistic ) calibration ( Gneiting et al. , 2007 ; Kuleshov et al. , 2018 ) . Intuitively , ∀k , the label Y t should be below the predicted αk-th quantile for an αk proportion of the samples . Formally , given a transcript of any length , consider the empirical frequency that the label Y t is below the predicted quantile Ztk up to time T ( for any T that ’ s less than the length of transcript ) FTk = ∑ 1≤t≤T I ( Y t ≤ Ztk ) . ( 2 ) Ideally , the label Y t should be below the αk-th quantile exactly αkT many times , i.e. , ∀k , FTk /T = αk . Achieving this perfectly is difficult , so we define an approximation . For any function b : N → R+ we say that a transcript is b-calibrated if ∀k = 1 , · · · , K , ∀T , |FTk /T − αk| ≤ b ( T ) . Correspondingly , a forecasting strategy is calibrated if the resulting transcript is calibrated : , Definition 1 . For any function b : N → R+ , a forecasting algorithm ψ is b-calibrated under i.i.d . ( or causal ) assumptions if for any nature ’ s strategy that is i.i.d . ( or causal ) , the resulting transcript is b-calibrated almost surely . Conformal Calibration Conformal calibration ( Vovk et al. , 2020 ) is a forecasting algorithm based on conformal prediction ideas ( Vovk et al. , 2005 ; Shafer & Vovk , 2008 ) . It is a wrapper algorithm that transforms a initial predictor ( such as an off-the-shelf predictor ) into new predictions that are provably calibrated under i.i.d . assumptions . Conformal calibration is based on the following intuition : for example , if 75 % of past labels are below the initial prediction ’ s mean , then we can use the initial prediction ’ s mean as the 75 % -quantile prediction in the future . More generally , we identify a statistic of the initial prediction , such that αk-proportion of the past labels are below that statistic . We use this statistic as the αk-th quantile of the future prediction . If the data is i.i.d. , conformal calibration is a very useful algorithm . This is because it has extremely strong calibration properties ( Proven in Proposition 1 of ( Vovk et al. , 2020 ) ) , where the random variables I ( Y t ≤ Ztk ) , t = 1 , 2 , · · · is a sequence of i.i.d . Bernoulli random variables with mean αk . This is impressive because even if we have access to the oracle forecaster ( i.e . Y tk is equal to the true conditional αk-th quantile of Y t|Xt ) , we can not achieve better calibration — I ( Y t ≤ Ztk ) is also a sequence of i.i.d . Bernoulli random variables with mean αk . Empirically , conformal prediction also has very good sharpness if the initial prediction function is reasonable ( Burnaev & Vovk , 2014 ) . A minor property ( but needed for proofs ) is that the predictions should bounded in [ −B , B ] . Conformal calibration satisfies this property when t > K , i.e . there are more samples than predicted quantiles . To bypass this limitation , we can initialize the conformal calibration algorithm with at least K offline samples . Alternatively , if we know B in advance , we can clip the prediction by B . 3 CALIBRATION UNDER DISTRIBUTION DRIFT . This section introduces our algorithm that guarantees calibration even when nature is not i.i.d . We start from a basic algorithm in Section 3.1 , and discuss its shortcomings . Then we move on to more advanced algorithms in Section 3.2 and 3.3 to address the shortcomings . 3.1 A BASIC CALIBRATED PREDICTION ALGORITHM . Conformal calibration achieves good calibration and sharpness when nature is i.i.d . When we are unsure if nature is i.i.d. , our basic idea is to use conformal calibration until it has failed to achieve calibration . Specifically , when nature is i.i.d. , I ( Y t ≤ Ztk ) is a sequence of Bernoulli random variables , so FTk is the sum of these Bernoulli random variables ( i.e . a binomial ) . We use b ∗ δ ( T ) to denote the confidence interval of a binomial distribution , i.e . Pr [ FTk /T ∈ αk ± b∗δ ( T ) ] = 1 − δ . We fix some small δ ( such as 0.05 ) and if under the conformal calibration algorithm FTk /T 6∈ αk ± b∗δ ( T ) , we know ( with 0.95 confidence ) that nature is not i.i.d , so we will make adjustments to salvage calibration . From a high level , F tk > αkt + b ∗ δ ( t ) t implies that the true label is below the αk-th quantile too often , so our prediction Ztk has been too large and we should reduce it ; vice versa ; There are some design freedom in choosing how much to reduce or increase the prediction . We choose an adjustment that grows exponentially with larger calibration error . The reason for this choice is to make very large adjustments when the calibration error is large , so we can tightly bound the calibration error . Formally , let Z̃tk denote the initial prediction generated by the conformal calibration prediction algorithm , the prediction of our algorithm Y tk is given by Zt+1k = Z̃ t+1 k + E t+1 k , where E t+1 k = 1− e β ( F tk−αkt−b ∗ δ ( t ) t ) F tk > αkt+ b ∗ δ ( t ) t eβ ( αkt−b ∗ δ ( t ) t−F t k ) − 1 F tk < αkt− b∗δ ( t ) t 0 otherwise ( 3 ) Intuitively , if F tk is within the correct range we make no adjustments ( i.e . Z t+1 k = Z̃ t+1 k ) ; when F tk falls outside the correct range , we make aggressive adjustments that increase exponentially with how much it falls outside the correct range . β > 0 is a hyper-parameter that controls how large the adjustments are ( we will show in Section 3.4 that these hyper-parameters are easy to choose ) . Note that Et+1k is for the ( t + 1 ) -th time step ( instead of t ) . This is because any adjustments can only depend on past information , so we will only have access to F tk at the ( t+ 1 ) -th time step . The following theorem shows that such adjustments indeed guarantee calibration . Theorem 1 . Let Z̃tk be generated by any forecasting algorithm and bounded in [ −B , B ] , for any δ > 0 , the prediction algorithm defined by Eq . ( 3 ) is b-calibrated where b ( T ) = b∗δ ( T ) + log ( 2B+1 ) +β βT . Note that the guarantee of Theorem 1 does not require that conformal calibration generate the initial prediction Z̃tk . The use of conformal calibration is motivated by its strong empirical performance ( Vovk et al. , 2020 ) when the data is i.i.d . or close to i.i.d . ( which is further supported by our experiments ) . The calibration guarantee is strong because under conformal calibration with i.i.d . data ( or the oracle forecaster ) we can expect to see b∗δ ( T ) calibration error ( with 1 − δ probability ) ; without i.i.d . assumptions , our algorithm can ensure that the calibration error only increases by O ( logB/T ) . Notably , the calibration error scales logarithmically with the assumed upper bound logB , so choosing a loose bound B does not significantly degrade the guarantee . The basic idea has two shortcomings illustrated in Figure 1 that we will address in the next sections . First , in a feasible quantile prediction , the 75 % quantile should never be smaller than the 25 % quantile , but our adjustments might violate this requirement because we adjust each quantile separately with no constraint . Second , the basic idea might lead to oscillation and instability . Intuitively , when the empirical frequency is incorrect , we make adjustments to correct it , but once the empirical frequency improves , we reduce the adjustments , which will cause the empirical frequency to become incorrect again , leading to oscillation . Empirically instability can hurt performance metrics such as sharpness . | For real-world applications where ML models are used, quantifying predictive uncertainty is an essential task as, for example, in safety-critical applications misclassification might have disastrous consequences. On the theory side, the analysis is typically performed under the i.i.d. assumption which could be unsatisfactory as deployed models inevitably encounter changes in the data generating distribution and/or certain dependencies that invalidate the results established for the i.i.d. setting. Focusing on regression, the authors design an adaptive (to distribution shifts) procedure that satisfies a certain calibration guarantee. The authors study the empirical performance of the proposed procedure on a collection of time-series and regression datasets. | SP:221f1dde4d5baeae63e928e94f8759a7b4b1c926 |
Graph Auto-Encoder via Neighborhood Wasserstein Reconstruction | 1 INTRODUCTION . Network/Graph representation learning ( a.k.a . embedding ) aims to preserve the high-dimensional complex graph information involving node features and link structures in a low-dimensional embedding space , which requires effective feature selection and dimension reduction ( Hamilton et al. , 2017b ) . Graph neural networks ( GNNs ) have done great jobs to this end , but most of them rely on node labels from specific downstream tasks to be trained in a semi-supervised fashion ( Kipf & Welling , 2017 ; Hamilton et al. , 2017a ; Wu et al. , 2019 ; Veličković et al. , 2018a ; Klicpera et al. , 2019 ; Chien et al. , 2021 ) . However , similar to other domains , unsupervised representation learning is preferred in many cases , not only because labeled data is not always available ( Hu et al. , 2020 ; Xie et al. , 2021 ) , but also task-agnostic representations can better transfer and generalize among different scenarios ( Erhan et al. , 2010 ; Bengio , 2012 ; Radford et al. , 2016 ) . To train GNNs in an unsupervised fashion , the classic auto-encoder framework ( Baldi , 2012 ; Goodfellow et al. , 2016 ) provides a natural solution and has been widely explored such as the prominent work ( V ) GAE ( Kipf & Welling , 2016 ) . Specifically , classic auto-encoders aim to decode from the low-dimensional representations information in the entire receptive field of the neural networks . For GNNs , the receptive field of a node representation is its entire neighborhood . However , existing graph auto-encoders appear away from such a motivation and are designed to merely decode the direct links between the node pairs by minimizing a link reconstruction loss . The fundamental difficulty to reconstruct the entire receptive fields of GNNs is due to the non-trivial design of a reconstruction loss on the irregular graph structures . Unfortunately , the over-simplification into link reconstruction makes the learned node representations drop much information and thus provides undesired performance in many downstream tasks . ∗Equal contribution . †Corresponding author . 1Code available at https : //github.com/mtang724/NWR-GAE . Take Figure 1 as an example , where different types of information are mixed in a graph ( e.g. , proximity and structure information as illustrated in Figure 5 in Appendix B ( Cui et al. , 2021 ) ) . The node representations learned by existing graph auto-encoders such as GAE ( Kipf & Welling , 2016 ) are driven too much to be similar on linked nodes due to their simple link reconstruction objective , and thus fail to distinguish node pairs like ( 2 , 4 ) and ( 3 , 5 ) in the cliques , though they clearly have different structural roles and node features . On the other hand , structure-oriented embedding models like GraphWave ( Donnat et al. , 2018 ) can not consider node features and spatial proximity , and thus fail to distinguish node pairs like ( 0 , 1 ) , ( 2 , 4 ) and ( 3 , 5 ) though they have different features , as well as ( 2 , 5 ) and ( 3 , 4 ) though they are further apart . An ideal unsupervised node representation learning model as we advocate in this work is expected to be task-agnostic and encode as much information as possible of all types in a low-dimensional embedding space . In this work , we aim to fundamentally address the above limitations of existing unsupervised node representation learning models by proposing a novel graph auto-encoder framework for unsupervised GNN training . The new framework is equipped with a powerful decoder that fully reconstructs the information from the entire receptive field of a node representation . Our key technical contribution lies in designing a principled and easy-to-compute loss to reconstruct the entire irregular structures of the node neighborhood . Specifically , we characterize the decoding procedure as iteratively sampling from a series of probability distributions defined over multi-hop neighbors ’ representations obtained through the GNN encoder . Then , the reconstruction loss can be decomposed into three parts , for sampling numbers ( node degrees ) , neighbor-representation distributions and node features . All of these terms are easy to compute but may represent the entire receptive field of a node instead of just the linkage information to its direct neighbors . For the most novel and important term , neighborrepresentation distribution reconstruction , we adopt an optimal-transport loss based on Wasserstein distance ( Frogner et al. , 2015 ) and thus name this new framework as Neighborhood Wasserstein Reconstruction Graph Auto-Encoder ( NWR-GAE ) . As also illustrated in Figure 1 , NWR-GAE can effectively distinguish all pairs of nodes dissimilar in different perspectives , and concisely reflect their similarities in the low-dimensional embedding space . We have conducted extensive experiments on four synthetic datasets and nine real-world datasets . Among the real-world datasets , three have proximity-oriented tasks , three have structure-oriented tasks , and three have proximity-structure-mixed tasks . We can observe significant improvements brought by NWR-GAE over the best method among the state-of-the-art baselines on all structureoriented tasks ( 8.74 % to 18.48 % ) and proximity-structure-mixed tasks ( -2.98 % to 8.62 % ) , and competitive performance on proximity-oriented tasks ( -3.21 % to -0.32 % ) . In-depth ablation and hyper-parameter studies further consolidate the claimed advantages of NWR-GAE . 2 PRELIMINARIES , MOTIVATIONS & OTHER RELATED WORKS . In this work , we focus on the auto-encoder framework for unsupervised task-agnostic graph representation learning . The original motivation of auto-encoders is to perform neural-network-based dimension reduction of the data that originally lies in a high-dimensional space ( Hinton & Salakhutdinov , 2006 ) . Specifically , an auto-encoder consists of two components , an encoder and a decoder . The encoder works to compress each data point into a low-dimensional vector representation , while the decoder works to reconstruct the original information from this vector . By minimizing the reconstruc- tion error , the encoder automatically converges to a good compressor that allows the low-dimensional representations to capture as much information as possible from the original data . Although the above high-level idea of auto-encoders is clear , when it is applied to graph structured data , the problem becomes challenging . This is because in graph-structured data , information of data points ( nodes to be specific as most widely studied ) is correlated due to the ambient graph structure . Without a specific task needed in a priori , the learned low-dimensional representation of a node should carry as much information as possible from not only its own features but also the features of the nodes it connects to ( both directly and indirectly ) . This implies that when building auto-encoders for graph-structure data , we expect the node representations to be able to reconstruct all correlated node features . However , existing graph auto-encoders seem to be away from this motivation . Previous prominent works such as unsupervised GraphSAGE ( Hamilton et al. , 2017a ) , GAE ( Kipf & Welling , 2016 ) , their generative variants such as VGAE ( Kipf & Welling , 2016 ) , CondGen ( Yang et al. , 2019 ) ( ) , and many others ( Grover et al. , 2019 ; Pan et al. , 2018 ; Shi et al. , 2020 ; Yang et al. , 2021 ) , use GNNs to encode graph structured data into node representations . Without exception , they follow the rationale of traditional network embedding techniques ( Perozzi et al. , 2014 ; Qiu et al. , 2018 ; Grover & Leskovec , 2016 ) and adopt link reconstruction in the decoder as the main drive to optimize their GNN encoders . The obtained node representations best record the network linkage information but lose much of other important information , such as local structures , neighbors ’ features , etc . Hence , these auto-encoders will most likely fail in other tasks such as node classifications ( especially structure-oriented ones as manifested in Figure 1 ) . To better understand this point , we carefully analyze the source of information encoded in each node representation via a GNN . Suppose a standard message-passing GNN ( Gilmer et al. , 2017 ) is adopted as the encoder , which is a general framework that includes GCN ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2017a ) , GAT ( Veličković et al. , 2018a ) , GIN ( Xu et al. , 2019c ) and so on . After k-hop message passing , the source of information encoded in the representation of a node v essentially comes from the k-hop neighborhood of v ( Fig . 2 ) . Therefore , a good representation of node v should capture the information of features from all nodes in its k-hop neighborhood , which is agnostic to downstream tasks . Note that this may not be ideal as nodes out of k-hop neighborhood may also provide useful information , but this is what GNN-based graph auto-encoders can be expected to do due to the architectures of GNN encoders . This observation motivates our study on a novel graph decoder that can better facilitate the goal of GNN-based graph auto-encoders , based on the neighborhood reconstruction principle . We will formalize this principle in Sec . 3 . Relation to the InfoMax principle . Recently , DGI ( Veličković et al. , 2018b ) , EGI ( Zhu et al. , 2021 ) and others ( Sun et al. , 2020 ; Hu et al. , 2020 ; You et al. , 2020 ; Hassani & Khasahmadi , 2020 ; Suresh et al. , 2021 ) have used constrasive learning for unsupervised GNN training methods and may capture information beyond the directed links . They adopt the rule of mutual information maximization ( InfoMax ) , which essentially works to maximize certain correspondence between the learned representations and the original data . For example , DGI ( Veličković et al. , 2018b ) maximizes the correspondence between a node representation and which graph the node belongs to , but this has no guarantee to reconstruct the structural information of node neighborhoods . Recent works even demonstrate that maximizing such correspondence risks capturing only the noisy information that is irrelevant to the downsteam tasks because noisy information itself is sufficient for the models to achieve InfoMax ( Tschannen et al. , 2020 ; Suresh et al. , 2021 ) , which gets demonstrated again by our experiments . Our goal instead is to let node representations not just capture the information to distinguish nodes but capture as much information as possible to reconstruct the features and structure of the neighborhood . Optimal-transport ( OT ) losses . Many machine learning problems depend on the characterization of the distance between two probability measures . The family f -divergence has the non-continuous issue when the two measures of interest have non-overlapped support ( Ali & Silvey , 1966 ) . Therefore , OT-losses are often adopted and have shown great success in generative models ( Gulrajani et al. , 2017 ) and domain adaptation ( Courty et al. , 2016 ) . OT-losses have been used to build variational auto-encoders for non-graph data ( Tolstikhin et al. , 2018 ; Kolouri et al. , 2018 ; Patrini et al. , 2020 ) . But one should note the our work is not a graph-data-oriented generalization of these works : They use OT-losses to characterize the distance between the variational distribution and the data empirical distribution while our model even does not use a variational distribution . Our model may be further improved by being reformulated as a variational autoencoder but we leave it as a future direction . Here , we give a frequently-used OT loss based on 2-Wasserstein distance that will be used later . Definition 2.1 . Let P , Q denote two probability distributions with finite second moment defined on Z ⊆ Rm . The 2-Wasserstein distance between P and Q defined on Z , Z ′ ⊆ Rm is the solution to the optimal mass transportation problem with ` 2 transport cost ( Villani , 2008 ) : W2 ( P , Q ) = ( inf γ∈Γ ( P , Q ) ∫ Z×Z′ ‖Z − Z ′‖22dγ ( Z , Z ′ ) ) 1/2 ( 1 ) where Γ ( P , Q ) contains all joint distributions of ( Z , Z ′ ) with marginals P and Q respectively . | This paper studies the problem of graph representation learning with graph autoencoder. The paper argues that most GNNs are designed for semi-supervised learning and cannot learn task-agnostic embedding. As a result, the paper proposes a graph autoencoder architecture that trains the GNN in an unsupervised manner. The key idea is to develop a decoder to reconstruct both the node degree and feature distribution. Experimental results show that the results outperform existing autoencoder baselines in several datasets. | SP:9afba78dbb1607966ebd8b973563bb07efd8377b |
Graph Auto-Encoder via Neighborhood Wasserstein Reconstruction | 1 INTRODUCTION . Network/Graph representation learning ( a.k.a . embedding ) aims to preserve the high-dimensional complex graph information involving node features and link structures in a low-dimensional embedding space , which requires effective feature selection and dimension reduction ( Hamilton et al. , 2017b ) . Graph neural networks ( GNNs ) have done great jobs to this end , but most of them rely on node labels from specific downstream tasks to be trained in a semi-supervised fashion ( Kipf & Welling , 2017 ; Hamilton et al. , 2017a ; Wu et al. , 2019 ; Veličković et al. , 2018a ; Klicpera et al. , 2019 ; Chien et al. , 2021 ) . However , similar to other domains , unsupervised representation learning is preferred in many cases , not only because labeled data is not always available ( Hu et al. , 2020 ; Xie et al. , 2021 ) , but also task-agnostic representations can better transfer and generalize among different scenarios ( Erhan et al. , 2010 ; Bengio , 2012 ; Radford et al. , 2016 ) . To train GNNs in an unsupervised fashion , the classic auto-encoder framework ( Baldi , 2012 ; Goodfellow et al. , 2016 ) provides a natural solution and has been widely explored such as the prominent work ( V ) GAE ( Kipf & Welling , 2016 ) . Specifically , classic auto-encoders aim to decode from the low-dimensional representations information in the entire receptive field of the neural networks . For GNNs , the receptive field of a node representation is its entire neighborhood . However , existing graph auto-encoders appear away from such a motivation and are designed to merely decode the direct links between the node pairs by minimizing a link reconstruction loss . The fundamental difficulty to reconstruct the entire receptive fields of GNNs is due to the non-trivial design of a reconstruction loss on the irregular graph structures . Unfortunately , the over-simplification into link reconstruction makes the learned node representations drop much information and thus provides undesired performance in many downstream tasks . ∗Equal contribution . †Corresponding author . 1Code available at https : //github.com/mtang724/NWR-GAE . Take Figure 1 as an example , where different types of information are mixed in a graph ( e.g. , proximity and structure information as illustrated in Figure 5 in Appendix B ( Cui et al. , 2021 ) ) . The node representations learned by existing graph auto-encoders such as GAE ( Kipf & Welling , 2016 ) are driven too much to be similar on linked nodes due to their simple link reconstruction objective , and thus fail to distinguish node pairs like ( 2 , 4 ) and ( 3 , 5 ) in the cliques , though they clearly have different structural roles and node features . On the other hand , structure-oriented embedding models like GraphWave ( Donnat et al. , 2018 ) can not consider node features and spatial proximity , and thus fail to distinguish node pairs like ( 0 , 1 ) , ( 2 , 4 ) and ( 3 , 5 ) though they have different features , as well as ( 2 , 5 ) and ( 3 , 4 ) though they are further apart . An ideal unsupervised node representation learning model as we advocate in this work is expected to be task-agnostic and encode as much information as possible of all types in a low-dimensional embedding space . In this work , we aim to fundamentally address the above limitations of existing unsupervised node representation learning models by proposing a novel graph auto-encoder framework for unsupervised GNN training . The new framework is equipped with a powerful decoder that fully reconstructs the information from the entire receptive field of a node representation . Our key technical contribution lies in designing a principled and easy-to-compute loss to reconstruct the entire irregular structures of the node neighborhood . Specifically , we characterize the decoding procedure as iteratively sampling from a series of probability distributions defined over multi-hop neighbors ’ representations obtained through the GNN encoder . Then , the reconstruction loss can be decomposed into three parts , for sampling numbers ( node degrees ) , neighbor-representation distributions and node features . All of these terms are easy to compute but may represent the entire receptive field of a node instead of just the linkage information to its direct neighbors . For the most novel and important term , neighborrepresentation distribution reconstruction , we adopt an optimal-transport loss based on Wasserstein distance ( Frogner et al. , 2015 ) and thus name this new framework as Neighborhood Wasserstein Reconstruction Graph Auto-Encoder ( NWR-GAE ) . As also illustrated in Figure 1 , NWR-GAE can effectively distinguish all pairs of nodes dissimilar in different perspectives , and concisely reflect their similarities in the low-dimensional embedding space . We have conducted extensive experiments on four synthetic datasets and nine real-world datasets . Among the real-world datasets , three have proximity-oriented tasks , three have structure-oriented tasks , and three have proximity-structure-mixed tasks . We can observe significant improvements brought by NWR-GAE over the best method among the state-of-the-art baselines on all structureoriented tasks ( 8.74 % to 18.48 % ) and proximity-structure-mixed tasks ( -2.98 % to 8.62 % ) , and competitive performance on proximity-oriented tasks ( -3.21 % to -0.32 % ) . In-depth ablation and hyper-parameter studies further consolidate the claimed advantages of NWR-GAE . 2 PRELIMINARIES , MOTIVATIONS & OTHER RELATED WORKS . In this work , we focus on the auto-encoder framework for unsupervised task-agnostic graph representation learning . The original motivation of auto-encoders is to perform neural-network-based dimension reduction of the data that originally lies in a high-dimensional space ( Hinton & Salakhutdinov , 2006 ) . Specifically , an auto-encoder consists of two components , an encoder and a decoder . The encoder works to compress each data point into a low-dimensional vector representation , while the decoder works to reconstruct the original information from this vector . By minimizing the reconstruc- tion error , the encoder automatically converges to a good compressor that allows the low-dimensional representations to capture as much information as possible from the original data . Although the above high-level idea of auto-encoders is clear , when it is applied to graph structured data , the problem becomes challenging . This is because in graph-structured data , information of data points ( nodes to be specific as most widely studied ) is correlated due to the ambient graph structure . Without a specific task needed in a priori , the learned low-dimensional representation of a node should carry as much information as possible from not only its own features but also the features of the nodes it connects to ( both directly and indirectly ) . This implies that when building auto-encoders for graph-structure data , we expect the node representations to be able to reconstruct all correlated node features . However , existing graph auto-encoders seem to be away from this motivation . Previous prominent works such as unsupervised GraphSAGE ( Hamilton et al. , 2017a ) , GAE ( Kipf & Welling , 2016 ) , their generative variants such as VGAE ( Kipf & Welling , 2016 ) , CondGen ( Yang et al. , 2019 ) ( ) , and many others ( Grover et al. , 2019 ; Pan et al. , 2018 ; Shi et al. , 2020 ; Yang et al. , 2021 ) , use GNNs to encode graph structured data into node representations . Without exception , they follow the rationale of traditional network embedding techniques ( Perozzi et al. , 2014 ; Qiu et al. , 2018 ; Grover & Leskovec , 2016 ) and adopt link reconstruction in the decoder as the main drive to optimize their GNN encoders . The obtained node representations best record the network linkage information but lose much of other important information , such as local structures , neighbors ’ features , etc . Hence , these auto-encoders will most likely fail in other tasks such as node classifications ( especially structure-oriented ones as manifested in Figure 1 ) . To better understand this point , we carefully analyze the source of information encoded in each node representation via a GNN . Suppose a standard message-passing GNN ( Gilmer et al. , 2017 ) is adopted as the encoder , which is a general framework that includes GCN ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2017a ) , GAT ( Veličković et al. , 2018a ) , GIN ( Xu et al. , 2019c ) and so on . After k-hop message passing , the source of information encoded in the representation of a node v essentially comes from the k-hop neighborhood of v ( Fig . 2 ) . Therefore , a good representation of node v should capture the information of features from all nodes in its k-hop neighborhood , which is agnostic to downstream tasks . Note that this may not be ideal as nodes out of k-hop neighborhood may also provide useful information , but this is what GNN-based graph auto-encoders can be expected to do due to the architectures of GNN encoders . This observation motivates our study on a novel graph decoder that can better facilitate the goal of GNN-based graph auto-encoders , based on the neighborhood reconstruction principle . We will formalize this principle in Sec . 3 . Relation to the InfoMax principle . Recently , DGI ( Veličković et al. , 2018b ) , EGI ( Zhu et al. , 2021 ) and others ( Sun et al. , 2020 ; Hu et al. , 2020 ; You et al. , 2020 ; Hassani & Khasahmadi , 2020 ; Suresh et al. , 2021 ) have used constrasive learning for unsupervised GNN training methods and may capture information beyond the directed links . They adopt the rule of mutual information maximization ( InfoMax ) , which essentially works to maximize certain correspondence between the learned representations and the original data . For example , DGI ( Veličković et al. , 2018b ) maximizes the correspondence between a node representation and which graph the node belongs to , but this has no guarantee to reconstruct the structural information of node neighborhoods . Recent works even demonstrate that maximizing such correspondence risks capturing only the noisy information that is irrelevant to the downsteam tasks because noisy information itself is sufficient for the models to achieve InfoMax ( Tschannen et al. , 2020 ; Suresh et al. , 2021 ) , which gets demonstrated again by our experiments . Our goal instead is to let node representations not just capture the information to distinguish nodes but capture as much information as possible to reconstruct the features and structure of the neighborhood . Optimal-transport ( OT ) losses . Many machine learning problems depend on the characterization of the distance between two probability measures . The family f -divergence has the non-continuous issue when the two measures of interest have non-overlapped support ( Ali & Silvey , 1966 ) . Therefore , OT-losses are often adopted and have shown great success in generative models ( Gulrajani et al. , 2017 ) and domain adaptation ( Courty et al. , 2016 ) . OT-losses have been used to build variational auto-encoders for non-graph data ( Tolstikhin et al. , 2018 ; Kolouri et al. , 2018 ; Patrini et al. , 2020 ) . But one should note the our work is not a graph-data-oriented generalization of these works : They use OT-losses to characterize the distance between the variational distribution and the data empirical distribution while our model even does not use a variational distribution . Our model may be further improved by being reformulated as a variational autoencoder but we leave it as a future direction . Here , we give a frequently-used OT loss based on 2-Wasserstein distance that will be used later . Definition 2.1 . Let P , Q denote two probability distributions with finite second moment defined on Z ⊆ Rm . The 2-Wasserstein distance between P and Q defined on Z , Z ′ ⊆ Rm is the solution to the optimal mass transportation problem with ` 2 transport cost ( Villani , 2008 ) : W2 ( P , Q ) = ( inf γ∈Γ ( P , Q ) ∫ Z×Z′ ‖Z − Z ′‖22dγ ( Z , Z ′ ) ) 1/2 ( 1 ) where Γ ( P , Q ) contains all joint distributions of ( Z , Z ′ ) with marginals P and Q respectively . | The paper proposes a novel approach to graph representation learning. In particular, a graph auto-encoder is proposed that aims to better capture the topological structure by utilising a neighbourhood reconstruction and a degree reconstruction objective. An optimal-transport based objective is proposed for the neighbourhood reconstruction that optimises the 2-Wasserstein distance between the decoded distribution and an empirical estimate of the neighbourhood distribution. An extensive experimental analysis is performed, highlighting the benefits of the proposed approach on a range of synthetic datasets to capture structure information. The experimental results also highlight its robustness across 9 different real-world graph datasets (ranging from proximity-oriented to structure-oriented datasets). | SP:9afba78dbb1607966ebd8b973563bb07efd8377b |
Positive-Unlabeled Learning with Uncertainty-aware Pseudo-label Selection | 1 INTRODUCTION . Many real-world applications involve positive and unlabeled ( PU ) datasets in which only some of the data is labeled positive while the majority is unlabeled and contains both positives and negatives . PU learning aims to learn a binary classifier in this challenging setting without any labeled negative examples . Learning from PU data can reduce deployment costs in many deep learning applications that otherwise require annotations from experts such as medical image diagnosis ( Armenian and Lilienfeld , 1974 ) and protein function prediction ( Gligorijević et al. , 2021 ) , and it can even enable applications in settings where the measurement technology itself can not detect negative examples ( Purcell et al. , 2019 ) . Some recent approaches such as unbiased PU ( Du Plessis et al. , 2014 , uPU ) and non-negative PU ( Kiryo et al. , 2017 , nnPU ) formulate this problem as cost-sensitive learning . Others approach PU learning as a two-step procedure first identifying and labeling some reliable negative examples , and then re-training the model based on this newly constructed labeled dataset ( Bekker and Davis , 2020 ) . These approaches show similarities with pseudo-labeling in semi-supervised classification settings ( Lee , 2013 ) . Such pseudo-labeling techniques are however especially vulnerable to incorrectly assigned labels of the selected examples as these errors will propagate and magnify in the retrained model , resulting in a negative feedback loop . Worse yet , since the true labels are unavailable in PU learning , this situation is hard to detect by any metrics computed on the training set . This erroneous selection of unreliable pseudo-labels occurs when wrong model predictions are associated with excessive model confidence . Such poor model calibration is accompanied by a distortion of the signal for the pseudo label selection ( Van Engelen and Hoos , 2020 ) . In recent literature on pseudo-labeling , this problem is recognized and successfully addressed by explicitly estimating the prediction uncertainty ( Abdar et al. , 2021 ; Rizve et al. , 2021 ; Arazo et al. , 2020 ) . While this is the case for semi-supervised classification , there does not yet exist a method that explores the use of uncertainty quantification for pseudo-labeling in a PU learning context . Contributions : Motivated by this , we propose a novel , uncertainty-aware pseudo-labeling framework for PU learning that uses established uncertainty quantification techniques to identify reliable examples to pseudo-label ( Fig . 1 ) . In particular , our contributions are : ( 1 ) We introduce PUUPL ( Positive-Unlabeled , Uncertainty-Aware Pseudo-Labeling ) , a simple uncertainty-aware pseudolabeling framework for PU learning . ( 2 ) PUUPL can use any loss function for PU learning , improving model performance while being robust to the specific data biases that the respective loss considers . ( 3 ) We evaluate our methods on a wide range of benchmarks and PU datasets , achieving state-of-the-art performance in PU learning . ( 4 ) Our extensive ablation studies provide new insights into uncertainty-aware pseudo-labeling for PU learning . Further , they show that our method is robust to the choices of hyperparameters , with 1 % or less variability in test accuracy among different choices as well as distribution shifts between labeled positives in the train and test datasets . To the best of our knowledge , PUUPL is the first framework for PU learning which leverages uncertainty information during pseudo-labeling . 2 RELATED WORK . PU Learning PUL was introduced as a variant of binary classification ( Liu et al. , 2003 ) and is related to one-class learning ( Ruff et al. , 2018 ; Li et al. , 2010 ) , multi-positive learning ( Xu et al. , 2017 ) , multi-task learning ( Kaji et al. , 2018 ) , and semi-supervised learning ( Chapelle et al. , 2009 ) . There exist three main research branches for PUL : two-step techniques , class prior incorporation , and biased PUL ( Bekker and Davis , 2020 ) . In this work , we combine Pseudo-Labeling which has similarities to two-step techniques , with biased PUL , also coined as reweighting methods , and refer to Bekker and Davis ( 2020 ) for a comprehensive overview of the field . In this context , Du Plessis et al . ( 2014 ) introduced the unbiased risk estimator uPU . Kiryo et al . ( 2017 ) showed this loss function is prone to overfitting in deep learning contexts as it lacks a lower bound and proposed the non-negative risk estimator nnPU as a remedy . Follow-up work on loss functions for PUL has focused on robustness w.r.t biases in the sampling process such as PUSB ( Kato et al. , 2019 ) , PUbN ( Hsieh et al. , 2019 ) or PULNS ( Luo et al. , 2021 ) . Uncertainty-aware Pseudo-Labeling Pseudo-labeling follows the rationale that the model leverages its own predictions on unlabeled data as pseudo training targets to enable iterative semisupervised model training . The first such approach for deep learning was introduced by Lee ( 2013 ) , simply selecting the class with the highest predicted probability as a pseudo label . One weakness of pseudo-labeling is that erroneously selected pseudo-labels can amplify for training , potentially leading to model degradation . This is grounded in poor model calibration distorting the signal for the pseudo label selection ( Van Engelen and Hoos , 2020 ) . Iscen et al . ( 2019 ) try to mitigate this issue using confidence and class weights . Shi et al . ( 2018 ) use confident scores based on the geometric neighborhood of the unlabeled samples while Arazo et al . ( 2020 ) effectively tackle this confirmation bias using Mixup ( Zhang et al. , 2017 ) , Label Noise ( Tanaka et al. , 2018 ) , and Entropy Regularization ( Grandvalet et al. , 2005 ) . Rizve et al . ( 2021 ) introduced a pseudo-labeling framework using a weighting scheme for class balancing and MC dropout ( Gal and Ghahramani , 2016 ) for calibration , while Beluch et al . ( 2018 ) found deep ensembles ( Lakshminarayanan et al. , 2017a ) to yield the best model calibration in an active learning context , especially in low-label regimes . The commonality of these works is the explicit consideration of model uncertainty to improve pseudo-label selection , which motivates us to apply this in the context of PU learning . Pseudo-Labeling for PU Learning Two-step approaches in PU learning first identify negative samples from the unlabeled dataset , and then train a binary classification model on the original dataset augmented with the newly identified negatives ( Bekker and Davis , 2020 ) . These approaches share similarities with pseudo-labeling but lack an iterative feedback loop after the completion of the second step . A first attempt to combine pseudo-labeling with PU learning was made with Self-PU ( Chen et al. , 2020b ) , where self-paced learning , a confidence-weighting scheme based on the model predictions and a teacher-student distillation approach are combined . Via this complex training scheme , Self-PU was shown to marginally outperform recent baselines . With PUUPL , we propose an alternative PL strategy for PU learning that performs better in a simpler and more principled way using implicitly well-calibrated models to improve the pseudo-label selection . Uncertainty-aware pseudo-labeling for PU learning To the best of our knowledge , we are the first to introduce an uncertainty-aware pseudo-labeling paradigm to PU learning . Although our method shares the same motivation as that from Rizve et al . ( 2021 ) for semi-supervised classification , we differ in several important aspects : ( 1 ) we specifically target PU data with a PU loss , ( 2 ) we quantify uncertainty with an ensemble instead of Monte Carlo dropout , ( 3 ) we use epistemic uncertainty instead of the predicted class probabilities for the selection , ( 4 ) we do not use temperature scaling , and ( 5 ) we use soft labels . 3 METHOD . We propose PUUPL ( Positive Unlabeled , Uncertainty-aware Pseudo-Labeling ) , an iterative pseudolabeling procedure to progressively select and label the most confident examples from unlabeled data . The pseudo-code for PUUPL is shown as Algorithm 1 . Our method separates the training set Xtr into the sets P , U , and L which contain the initial positives , the currently unlabeled , and the pseudo-labeled samples respectively . The set L is initially empty . At each pseudo-labeling iteration , we first train our model using all samples in P , U , and L until some convergence condition is met ( Section 3.2 ) . Then , samples in U are predicted and ranked w.r.t their predictive uncertainty ( Section 3.3 ) and samples with the most confident score are assigned the predicted label and moved into the set L ( Section 3.4 ) . Similarly , samples in L are also predicted and the most uncertain samples are moved back to the unlabeled set U ( Section 3.5 ) . Next , the model is re-initialized to the same initial weights and a new pseudo-labeling iteration starts . In the following , we first describe the notation used in this paper and then explain in detail the training procedure of PUUPL . 3.1 NOTATION . Consider input samples X with label y and superscripts ·tr , ·va and ·te for training , validation , and test data respectively . The initial training labels ytr are set to one for all samples in P and zero for all others in U . We group the indices of original positives , unlabeled , and pseudo-labeled samples Algorithm 1 Pseudocode for the PUUPL Training Procedure Input • Train , validation and test data Xtr , ytr , Xva , yva , Xte , yte • Number K of networks in the ensemble ( suggested K = 2 ) • Maximum number T of pseudo-labels to assign at each round ( suggested T = 1000 ) • Maximum uncertainty threshold tl to assign pseudo-labels ( suggested tl = 0.05 ) • Minimum uncertainty threshold tu to remove pseudo-labels ( suggested tu = 0.35 ) Output Model parameters θ∗ 1 : P ← indices of positive samples in Xtr 2 : U ← indices of unlabeled samples in Xtr 3 : L← ∅ . Indices of pseudo-labeled samples 4 : θ0 ← Random weight initialization 5 : while not converged do 6 : Initialize model weights to θ0 . Training 7 : Train an ensemble of K networks on Xtr , ytr using the loss in Eq . 1 8 : Validate on Xva , yva and update weights θ∗ if accuracy improved 9 : f̂ ← ensemble predictions for Xtr . Uncertainty 10 : Compute epistemic uncertainty ûe with f̂ via Eq . 6 11 : Lnew ← Balanced set of examples to pseudo-label via Eq . 7 using ûeU , T and tl . Pseudo-labeling 12 : U new ← Examples to pseudo-unlabel via Eq . 10 using ûeL and tu 13 : L← L ∪ Lnewb \ U new . Update indices 14 : U ← U \ Lnewb ∪ U new 15 : yLnew ← p̂Lnew . Update pseudo-labels 16 : yUnew ← 0 17 : end while 18 : Restore the weights θ∗ that scored highest on the validation set 19 : Compute accuracy on the held-out test set Xte , yte 20 : return θ∗ in Xtr into the sets P , U , and L respectively . Our proposed model is an ensemble of K deep neural networks whose random initial weights are collectively denoted as θ0 . The predictions of the k-th network for sample i are indicated with p̂ik = σ ( f̂ik ) , with σ ( · ) the logistic function and f̂ik the predicted logits . The logits and predictions for a sample averaged across the networks in the ensemble are denoted by f̂i and p̂i respectively . We subscript data and predictions with i to index individual samples , and use an index set in the subscript to index all samples in the set ( e.g. , XtrU = { Xtri |i ∈ U } denotes the features of all unlabeled samples ) . We denote the total , epistemic and aleatoric uncertainty of sample i as ûti , û e i , and û a i , respectively . | This paper proposes PUUPL, an uncertainty-aware pseudo-label selection method for positive-unlabeled (PU) learning. To improve the performance of pseudo-labeling, the authors suggest using the epistemic uncertainty (the difference between the entropy of the mean prediction and the mean of entropies of each prediction). In the experiments, PUUPL outperformed the existing state-of-the-art PU learning methods. | SP:50de6aaf2c0749724bf725075d84a00021646310 |
Positive-Unlabeled Learning with Uncertainty-aware Pseudo-label Selection | 1 INTRODUCTION . Many real-world applications involve positive and unlabeled ( PU ) datasets in which only some of the data is labeled positive while the majority is unlabeled and contains both positives and negatives . PU learning aims to learn a binary classifier in this challenging setting without any labeled negative examples . Learning from PU data can reduce deployment costs in many deep learning applications that otherwise require annotations from experts such as medical image diagnosis ( Armenian and Lilienfeld , 1974 ) and protein function prediction ( Gligorijević et al. , 2021 ) , and it can even enable applications in settings where the measurement technology itself can not detect negative examples ( Purcell et al. , 2019 ) . Some recent approaches such as unbiased PU ( Du Plessis et al. , 2014 , uPU ) and non-negative PU ( Kiryo et al. , 2017 , nnPU ) formulate this problem as cost-sensitive learning . Others approach PU learning as a two-step procedure first identifying and labeling some reliable negative examples , and then re-training the model based on this newly constructed labeled dataset ( Bekker and Davis , 2020 ) . These approaches show similarities with pseudo-labeling in semi-supervised classification settings ( Lee , 2013 ) . Such pseudo-labeling techniques are however especially vulnerable to incorrectly assigned labels of the selected examples as these errors will propagate and magnify in the retrained model , resulting in a negative feedback loop . Worse yet , since the true labels are unavailable in PU learning , this situation is hard to detect by any metrics computed on the training set . This erroneous selection of unreliable pseudo-labels occurs when wrong model predictions are associated with excessive model confidence . Such poor model calibration is accompanied by a distortion of the signal for the pseudo label selection ( Van Engelen and Hoos , 2020 ) . In recent literature on pseudo-labeling , this problem is recognized and successfully addressed by explicitly estimating the prediction uncertainty ( Abdar et al. , 2021 ; Rizve et al. , 2021 ; Arazo et al. , 2020 ) . While this is the case for semi-supervised classification , there does not yet exist a method that explores the use of uncertainty quantification for pseudo-labeling in a PU learning context . Contributions : Motivated by this , we propose a novel , uncertainty-aware pseudo-labeling framework for PU learning that uses established uncertainty quantification techniques to identify reliable examples to pseudo-label ( Fig . 1 ) . In particular , our contributions are : ( 1 ) We introduce PUUPL ( Positive-Unlabeled , Uncertainty-Aware Pseudo-Labeling ) , a simple uncertainty-aware pseudolabeling framework for PU learning . ( 2 ) PUUPL can use any loss function for PU learning , improving model performance while being robust to the specific data biases that the respective loss considers . ( 3 ) We evaluate our methods on a wide range of benchmarks and PU datasets , achieving state-of-the-art performance in PU learning . ( 4 ) Our extensive ablation studies provide new insights into uncertainty-aware pseudo-labeling for PU learning . Further , they show that our method is robust to the choices of hyperparameters , with 1 % or less variability in test accuracy among different choices as well as distribution shifts between labeled positives in the train and test datasets . To the best of our knowledge , PUUPL is the first framework for PU learning which leverages uncertainty information during pseudo-labeling . 2 RELATED WORK . PU Learning PUL was introduced as a variant of binary classification ( Liu et al. , 2003 ) and is related to one-class learning ( Ruff et al. , 2018 ; Li et al. , 2010 ) , multi-positive learning ( Xu et al. , 2017 ) , multi-task learning ( Kaji et al. , 2018 ) , and semi-supervised learning ( Chapelle et al. , 2009 ) . There exist three main research branches for PUL : two-step techniques , class prior incorporation , and biased PUL ( Bekker and Davis , 2020 ) . In this work , we combine Pseudo-Labeling which has similarities to two-step techniques , with biased PUL , also coined as reweighting methods , and refer to Bekker and Davis ( 2020 ) for a comprehensive overview of the field . In this context , Du Plessis et al . ( 2014 ) introduced the unbiased risk estimator uPU . Kiryo et al . ( 2017 ) showed this loss function is prone to overfitting in deep learning contexts as it lacks a lower bound and proposed the non-negative risk estimator nnPU as a remedy . Follow-up work on loss functions for PUL has focused on robustness w.r.t biases in the sampling process such as PUSB ( Kato et al. , 2019 ) , PUbN ( Hsieh et al. , 2019 ) or PULNS ( Luo et al. , 2021 ) . Uncertainty-aware Pseudo-Labeling Pseudo-labeling follows the rationale that the model leverages its own predictions on unlabeled data as pseudo training targets to enable iterative semisupervised model training . The first such approach for deep learning was introduced by Lee ( 2013 ) , simply selecting the class with the highest predicted probability as a pseudo label . One weakness of pseudo-labeling is that erroneously selected pseudo-labels can amplify for training , potentially leading to model degradation . This is grounded in poor model calibration distorting the signal for the pseudo label selection ( Van Engelen and Hoos , 2020 ) . Iscen et al . ( 2019 ) try to mitigate this issue using confidence and class weights . Shi et al . ( 2018 ) use confident scores based on the geometric neighborhood of the unlabeled samples while Arazo et al . ( 2020 ) effectively tackle this confirmation bias using Mixup ( Zhang et al. , 2017 ) , Label Noise ( Tanaka et al. , 2018 ) , and Entropy Regularization ( Grandvalet et al. , 2005 ) . Rizve et al . ( 2021 ) introduced a pseudo-labeling framework using a weighting scheme for class balancing and MC dropout ( Gal and Ghahramani , 2016 ) for calibration , while Beluch et al . ( 2018 ) found deep ensembles ( Lakshminarayanan et al. , 2017a ) to yield the best model calibration in an active learning context , especially in low-label regimes . The commonality of these works is the explicit consideration of model uncertainty to improve pseudo-label selection , which motivates us to apply this in the context of PU learning . Pseudo-Labeling for PU Learning Two-step approaches in PU learning first identify negative samples from the unlabeled dataset , and then train a binary classification model on the original dataset augmented with the newly identified negatives ( Bekker and Davis , 2020 ) . These approaches share similarities with pseudo-labeling but lack an iterative feedback loop after the completion of the second step . A first attempt to combine pseudo-labeling with PU learning was made with Self-PU ( Chen et al. , 2020b ) , where self-paced learning , a confidence-weighting scheme based on the model predictions and a teacher-student distillation approach are combined . Via this complex training scheme , Self-PU was shown to marginally outperform recent baselines . With PUUPL , we propose an alternative PL strategy for PU learning that performs better in a simpler and more principled way using implicitly well-calibrated models to improve the pseudo-label selection . Uncertainty-aware pseudo-labeling for PU learning To the best of our knowledge , we are the first to introduce an uncertainty-aware pseudo-labeling paradigm to PU learning . Although our method shares the same motivation as that from Rizve et al . ( 2021 ) for semi-supervised classification , we differ in several important aspects : ( 1 ) we specifically target PU data with a PU loss , ( 2 ) we quantify uncertainty with an ensemble instead of Monte Carlo dropout , ( 3 ) we use epistemic uncertainty instead of the predicted class probabilities for the selection , ( 4 ) we do not use temperature scaling , and ( 5 ) we use soft labels . 3 METHOD . We propose PUUPL ( Positive Unlabeled , Uncertainty-aware Pseudo-Labeling ) , an iterative pseudolabeling procedure to progressively select and label the most confident examples from unlabeled data . The pseudo-code for PUUPL is shown as Algorithm 1 . Our method separates the training set Xtr into the sets P , U , and L which contain the initial positives , the currently unlabeled , and the pseudo-labeled samples respectively . The set L is initially empty . At each pseudo-labeling iteration , we first train our model using all samples in P , U , and L until some convergence condition is met ( Section 3.2 ) . Then , samples in U are predicted and ranked w.r.t their predictive uncertainty ( Section 3.3 ) and samples with the most confident score are assigned the predicted label and moved into the set L ( Section 3.4 ) . Similarly , samples in L are also predicted and the most uncertain samples are moved back to the unlabeled set U ( Section 3.5 ) . Next , the model is re-initialized to the same initial weights and a new pseudo-labeling iteration starts . In the following , we first describe the notation used in this paper and then explain in detail the training procedure of PUUPL . 3.1 NOTATION . Consider input samples X with label y and superscripts ·tr , ·va and ·te for training , validation , and test data respectively . The initial training labels ytr are set to one for all samples in P and zero for all others in U . We group the indices of original positives , unlabeled , and pseudo-labeled samples Algorithm 1 Pseudocode for the PUUPL Training Procedure Input • Train , validation and test data Xtr , ytr , Xva , yva , Xte , yte • Number K of networks in the ensemble ( suggested K = 2 ) • Maximum number T of pseudo-labels to assign at each round ( suggested T = 1000 ) • Maximum uncertainty threshold tl to assign pseudo-labels ( suggested tl = 0.05 ) • Minimum uncertainty threshold tu to remove pseudo-labels ( suggested tu = 0.35 ) Output Model parameters θ∗ 1 : P ← indices of positive samples in Xtr 2 : U ← indices of unlabeled samples in Xtr 3 : L← ∅ . Indices of pseudo-labeled samples 4 : θ0 ← Random weight initialization 5 : while not converged do 6 : Initialize model weights to θ0 . Training 7 : Train an ensemble of K networks on Xtr , ytr using the loss in Eq . 1 8 : Validate on Xva , yva and update weights θ∗ if accuracy improved 9 : f̂ ← ensemble predictions for Xtr . Uncertainty 10 : Compute epistemic uncertainty ûe with f̂ via Eq . 6 11 : Lnew ← Balanced set of examples to pseudo-label via Eq . 7 using ûeU , T and tl . Pseudo-labeling 12 : U new ← Examples to pseudo-unlabel via Eq . 10 using ûeL and tu 13 : L← L ∪ Lnewb \ U new . Update indices 14 : U ← U \ Lnewb ∪ U new 15 : yLnew ← p̂Lnew . Update pseudo-labels 16 : yUnew ← 0 17 : end while 18 : Restore the weights θ∗ that scored highest on the validation set 19 : Compute accuracy on the held-out test set Xte , yte 20 : return θ∗ in Xtr into the sets P , U , and L respectively . Our proposed model is an ensemble of K deep neural networks whose random initial weights are collectively denoted as θ0 . The predictions of the k-th network for sample i are indicated with p̂ik = σ ( f̂ik ) , with σ ( · ) the logistic function and f̂ik the predicted logits . The logits and predictions for a sample averaged across the networks in the ensemble are denoted by f̂i and p̂i respectively . We subscript data and predictions with i to index individual samples , and use an index set in the subscript to index all samples in the set ( e.g. , XtrU = { Xtri |i ∈ U } denotes the features of all unlabeled samples ) . We denote the total , epistemic and aleatoric uncertainty of sample i as ûti , û e i , and û a i , respectively . | This paper studies the PU learning problem. It proposes a two-step approach that can estimate the pseudo-label uncertainty so that more reliable pseudo-labels can be assigned, which improves the predictive performance. The proposed estimation method is different from previous methods. | SP:50de6aaf2c0749724bf725075d84a00021646310 |
Stability analysis of SGD through the normalized loss function | 1 INTRODUCTION . In the last few years , deep learning has succeeded in establishing state-of-the-art performances in a wide variety of tasks in fields like computer vision , natural language processing and bioinformatics ( LeCun et al. , 2015 ) . Understanding when and how these networks generalize better is important to keep improving their performance . Many works starting mainly from Neyshabur et al . ( 2015 ) , Zhang et al . ( 2017 ) and Keskar et al . ( 2017 ) hint a rich interplay between regularization and the optimization process of learning the weights of the network . The idea is that a form of inductive bias can be realized implicitly by the optimization algorithm . The most popular algorithm to train neural networks is stochastic gradient descent ( SGD ) . It is therefore of great interest to study the generalization properties of this algorithm . An approach that is particularly well suited to investigate learning algorithms directly is the framework of stability ( Bousquet & Elisseeff , 2002 ) , ( Elisseeff et al. , 2005 ) . It is argued in Nagarajan & Kolter ( 2019 ) that generalization bounds based on uniform convergence might be condemned to be essentially vacuous for deep networks . Stability bounds offer a possible alternative by trying to bound directly the generalization error of the output of the algorithm . The seminal work of Hardt et al . ( 2016 ) exploits this framework to study SGD for both the convex and non-convex cases . The main intuitive idea is to look at how much changing one example in the training set can generate a different trajectory when running SGD . If the two trajectories must remain close to each other then the algorithm has better stability . This raises the question of how to best measure the distance between two classifiers . Our work investigates a measure of distance respecting invariances in homogeneous neural networks ( and linear classifiers ) instead of the usual euclidean distance . The measure of distance we consider is directly related to analyzing stability with respect to the normalized loss function instead of the standard loss function used for training . In the convex case , we prove an upper bound on uniform stability with respect to the normalized loss function , which can then be used to prove a high probability bound on the test error of the output of SGD . In the non-convex case , we propose an analysis directly targeted toward homogeneous neural networks . We prove an upper bound on the on-average stability with respect to the normalized loss function , which can then be used to give a generalization bound on the test error . One nice advantage coming with our approach is that we do not need to assume that the loss function is bounded . Indeed , even if the loss function used for training is unbounded , the normalized loss is necessarily bounded . Our main results for neural networks involve a data-dependent quantity that we estimate during training in our numerical experiments . The quantity is the sum over each layer of the ratio between the norm of the gradient for this layer and the norm of the parameters for the layer . We observe that larger learning rates lead to trajectories in parameter space keeping this quantity smaller during training . There are two ways to get our data-dependent quantity smaller during training . The first is by facilitating convergence ( having smaller norms for the gradients ) . The second is by increasing the weights of the network . If the weights are larger , the same magnitude for an update in weight space results in a smaller change in angle ( see Figure 1 ) . In our experiments , larger learning rates are seen to be more favorable in both regards . Our main contributions are summarized as follows : 2 RELATED WORK . Normalized loss functions have been considered before ( Poggio et al. , 2019 ) , ( Liao et al. , 2018 ) . In Liao et al . ( 2018 ) , test error is seen to be well correlated with the normalized loss . This observation is one motivation for our study . We might expect generalization bounds on the test error to be better by using the normalized surrogate loss in the analysis . ( Poggio et al. , 2019 ) writes down a generalization bound based on Rademacher complexity but motivated by the possible limitations of uniform convergence for deep learning ( Nagarajan & Kolter , 2019 ) we take the stability approach instead . Generalization of SGD has been investigated before in a large body of literature . Soudry et al . ( 2018 ) showed that gradient descent converges to the max-margin solution for logistic regression and Lyu & Li ( 2019 ) provides an extension to deep non-linear homogeneous networks . Nacson et al . ( 2019 ) gives similar results for stochastic gradient descent . From the point of view of stability , starting from Hardt et al . ( 2016 ) without being exhaustive , a few representative examples are Bassily et al . ( 2020 ) , Yuan et al . ( 2019 ) , Kuzborskij & Lampert ( 2018 ) , Liu et al . ( 2017 ) , London ( 2017 ) . Since the work of Zhang et al . ( 2017 ) showing that currently used deep neural networks are so overparameterized that they can easily fit random labels , taking properties of the data distribution into account seems necessary to understand generalization of deep networks . In the context of stability , this means moving from uniform stability to on-average stability . This is the main concern of the work of Kuzborskij & Lampert ( 2018 ) . They develop data-dependent stability bounds for SGD by extending over the work of Hardt et al . ( 2016 ) . Their results have a dependence on the risk of the initialization point and the curvature of the initialization . They have to assume a bound on the noise of the stochastic gradient . We do not make this assumption in our work . Furthermore , we maintain in our bounds for neural networks the properties after the “ burn-in ” period and therefore closer to the final output since we are interested in the effect of the learning rate on the trajectory . This is motivated by the empirical work of Jastrzebski et al . ( 2020 ) arguing that in the early phase of training , the learning rate and batch size determine the properties of the trajectory after a “ break-even point ” . Another work interested in on-average stability is Zhou et al . ( 2021 ) . Differently from our work , their approach makes the extra assumptions that the variance of the stochastic gradients is bounded and also that the loss is bounded . Furthermore , our analysis directly exploits the structure of neural networks and the properties following from using homogeneous non-linearities . It has been observed in the early work of Keskar et al . ( 2017 ) that training with larger batch sizes can lead to a deterioration in test accuracy . The simplest strategy to reduce ( at least partially ) the gap with small batch training is to increase the learning rate ( He et al. , 2019 ) , ( Smith & Le , 2018 ) , ( Hoffer et al. , 2017 ) , ( Goyal et al. , 2017 ) . We choose this scenario to investigate empirically the relevance of our stability bound for SGD on neural networks . Note that the results in Hardt et al . ( 2016 ) are more favorable to smaller learning rates . It seems therefore important in order to get theory closer to practice to understand better in what sense larger learning rates can improve stability . 3 PRELIMINARIES . Let l ( w , z ) be a non-negative loss function . Furthermore , let A be a randomized algorithm and denote by A ( S ) the output of A when trained on training set S = { z1 , · · · , zn } ∼ Dn . The true risk for a classifier w is given as LD ( w ) : = Ez∼Dl ( w , z ) and the empirical risk is given by LS ( w ) : = 1 n ∑n i=1 l ( w , zi ) . When considering the 0− 1 loss of a classifier w , we will write L0−1D ( w ) . Furthermore , we will add a superscript α when the normalized losses lα are under consideration ( these will be defined more clearly in the subsequent sections respectively for the convex case and the non-convex case ) . Our main interest is to ensure small test error and so we want to bound L0−1D ( w ) . The usual approach is to minimize a surrogate loss upper bounding the 0− 1 loss . In this paper , we consider stochastic gradient descent with different batch sizes to minimize the empirical surrogate loss . The update rule of this algorithm for learning rates λt and a subset Bt ⊂ S of size B is given by wt+1 = wt − λt 1 B ∑ zj∈Bt ∇l ( wt , zj ) . ( 1 ) We assume sampling uniformly with replacement in order to form each batch of training examples . In order to investigate generalization of this algorithm , we consider the framework of stability ( Bousquet & Elisseeff , 2002 ) . We now give the definitions for uniform stability and on-average stability ( random pointwise hypothesis stability in Elisseeff et al . ( 2005 ) ) for randomized algorithms ( see also Hardt et al . ( 2016 ) and Kuzborskij & Lampert ( 2018 ) ) . The definitions can be formulated with respect to any loss function but since we will study stability with respect to the lα losses , we write the definitions in the context of this special case . Definition 1 The algorithm A is said to be αuni-uniformly stable if for all i ∈ { 1 , . . . , n } sup S , z′i , z E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αuni . ( 2 ) Here , the expectation is taken over the randomness of A . The notation S ( i ) means that we replace the ith example of S with z′i . Definition 2 The algorithm A is said to be αav-on-average stable if for all i ∈ { 1 , . . . , n } E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αav . ( 3 ) Here , the expectation is taken over S ∼ Dn , z ∼ D and the randomness of A . The notation S ( i ) means that we replace the ith example of S with z . Throughout the paper , ||·|| will denote the euclidean norm for vectors and the Frobenius norm for matrices . The proofs are given in Appendix A for the convex case and in Appendix B for the non-convex case . 4 CONVEX CASE : A FIRST STEP TOWARD THE NON-CONVEX CASE . Since the convex case is easier to handle , it can be seen as a good preparation for the non-convex case . Consider a linear classifier parameterized by either a vector of weights ( binary case ) or a matrix of weights ( multi-class case ) that we denote by w in both cases . The normalized losses are defined by lα ( w , z ) : = l ( α w ||w|| , z ) , ( 4 ) for α > 0 . In order to state the main result of this section , we need two common assumptions : L-Lipschitzness of l as a function of w and β-smoothness . Definition 3 The function l ( w , z ) is L−Lipschitz for all z in the domain ( with respect to w ) if for all w , w′ , z , |l ( w , z ) − l ( w′ , z ) |≤ L||w − w′|| . ( 5 ) Definition 4 The function l ( w , z ) is β−smooth if for all w , w′ , z , ||∇l ( w , z ) −∇l ( w′ , z ) ||≤ β||w − w′|| . ( 6 ) We are now ready to state the main result of this section . Theorem 1 Assume that l ( w , z ) is convex , β−smooth and L−Lipschitz for all z . Furthermore , assume that the initial point w0 satisfies ||w0||≥ K for some K such that K̂ = K −L ∑T−1 i=0 λi > 0 for a sequence of learning rates λi ≤ 2/β . SGD is then run with batch size B on loss function l ( w , z ) for T steps with the learning rates λt starting from w0 . Denote by αuni the uniform stability of this algorithm with respect to lα . Then , αuni ≤ α 2L2B nK̂ T−1∑ i=0 λi . ( 7 ) What is the main difference between our bound and the bound in Hardt et al . ( 2016 ) ( see theorem 7 in Appendix A ) ? Our bound takes into account the norm of the initialization . The meaning of the bound is that it is not enough to use small learning rates and a small number of epochs to guarantee good stability ( with respect to the normalized loss ) . We also need to take into account the norm of the parameters ( here the norm of the initialization ) to make sure that the “ effective ” learning rates are small . Note that all classifiers are contained in any ball around the origin even if the radius of the ball is arbitrarily small . Therefore , all control over stability is lost very close to the origin where even a small step ( in Euclidean distance ) can lead to a drastic change in the classifier . The norm of the initialization must therefore be large enough to ensure that the trajectory can not get too close to the origin ( in worst case , since uniform stability is considered ) . An alternative if the conditions of the theorem are too strong in some practical scenarios is to use on-average stability ( l = 1 layer in the results of section 5 ) . As a side note , we also incorporated the batch size into the bound which is not present in Hardt et al . ( 2016 ) ( only B = 1 is considered ) . From this result , it is now possible to obtain a high probability bound for the test error . The bound is over draws of training sets S but not over the randomness of A . 1 So , we actually have the expected 1It is possible to obtain a bound holding over the randomness of A by exploiting the framework of Elisseeff et al . ( 2005 ) . However , the term involving ρ in their theorem 15 does not converge to 0 when the size of the training set grows to infinity . test error over the randomness of A in the bound . This is reminiscent of PAC-Bayes bounds where here the posterior distribution would be induced from the randomness of the algorithm A. Theorem 2 Fix α > 0 . Let Mα : = sup { l ( w , z ) s.t . ||w||≤ α , ||x||≤ R } . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : ( 8 ) EAL0−1D ( A ( S ) ) ≤ EAL α S ( A ( S ) ) + α uni + ( 2n α uni +Mα ) √ ln ( 1/δ ) 2n . Proof : The proof is an application of McDiarmid ’ s concentration bound . Note that we do not need the training loss to be bounded since we consider the normalized loss which is bounded . The proof follows the same line as theorem 12 in Bousquet & Elisseeff ( 2002 ) and we do not replicate it here . Note that we need to use that uniform stability implies generalization in expectation which is proven for example in theorem 2.2 from Hardt et al . ( 2016 ) . Furthermore , a bound holding uniformly over all α ’ s can be obtained using standard techniques . Theorem 3 Let C > 0 . Assume that lα ( w , z ) is a convex function of α for all w , z and that αuni is a non-decreasing function of α . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : EAL0−1D ( A ( S ) ) ≤ inf α∈ ( 0 , C ] { EA max ( Lα/2S ( A ( S ) ) , L α S ( A ( S ) ) ) + α uni + ( 2n α uni + Mα ) √ 2 ln ( √ 2 ( 2 + log2 C − log2 α ) ) + ln ( 1/δ ) 2n } . In the next section , we investigate the non-convex case . We exploit on-average stability to obtain a data-dependent quantity in the bound . Note that it is also argued in Kuzborskij & Lampert ( 2018 ) that the worst case analysis of uniform stability might not be appropriate for deep learning . | This paper conducted a stability analysis of Stochastic Gradient Descent (SGD) for empirical risk minimization induced by the so-called normalized loss function. Here, the normalization is taken with respect to parameters involved in an individual loss; see (4) for the definition of the normalized loss function. The paper should be regarded as a theoretical paper. The main results are stability bounds of SGD for convex and nonconvex ERM schemes. | SP:9070183afc9422af7dcef84aea785cb59bbba3ae |
Stability analysis of SGD through the normalized loss function | 1 INTRODUCTION . In the last few years , deep learning has succeeded in establishing state-of-the-art performances in a wide variety of tasks in fields like computer vision , natural language processing and bioinformatics ( LeCun et al. , 2015 ) . Understanding when and how these networks generalize better is important to keep improving their performance . Many works starting mainly from Neyshabur et al . ( 2015 ) , Zhang et al . ( 2017 ) and Keskar et al . ( 2017 ) hint a rich interplay between regularization and the optimization process of learning the weights of the network . The idea is that a form of inductive bias can be realized implicitly by the optimization algorithm . The most popular algorithm to train neural networks is stochastic gradient descent ( SGD ) . It is therefore of great interest to study the generalization properties of this algorithm . An approach that is particularly well suited to investigate learning algorithms directly is the framework of stability ( Bousquet & Elisseeff , 2002 ) , ( Elisseeff et al. , 2005 ) . It is argued in Nagarajan & Kolter ( 2019 ) that generalization bounds based on uniform convergence might be condemned to be essentially vacuous for deep networks . Stability bounds offer a possible alternative by trying to bound directly the generalization error of the output of the algorithm . The seminal work of Hardt et al . ( 2016 ) exploits this framework to study SGD for both the convex and non-convex cases . The main intuitive idea is to look at how much changing one example in the training set can generate a different trajectory when running SGD . If the two trajectories must remain close to each other then the algorithm has better stability . This raises the question of how to best measure the distance between two classifiers . Our work investigates a measure of distance respecting invariances in homogeneous neural networks ( and linear classifiers ) instead of the usual euclidean distance . The measure of distance we consider is directly related to analyzing stability with respect to the normalized loss function instead of the standard loss function used for training . In the convex case , we prove an upper bound on uniform stability with respect to the normalized loss function , which can then be used to prove a high probability bound on the test error of the output of SGD . In the non-convex case , we propose an analysis directly targeted toward homogeneous neural networks . We prove an upper bound on the on-average stability with respect to the normalized loss function , which can then be used to give a generalization bound on the test error . One nice advantage coming with our approach is that we do not need to assume that the loss function is bounded . Indeed , even if the loss function used for training is unbounded , the normalized loss is necessarily bounded . Our main results for neural networks involve a data-dependent quantity that we estimate during training in our numerical experiments . The quantity is the sum over each layer of the ratio between the norm of the gradient for this layer and the norm of the parameters for the layer . We observe that larger learning rates lead to trajectories in parameter space keeping this quantity smaller during training . There are two ways to get our data-dependent quantity smaller during training . The first is by facilitating convergence ( having smaller norms for the gradients ) . The second is by increasing the weights of the network . If the weights are larger , the same magnitude for an update in weight space results in a smaller change in angle ( see Figure 1 ) . In our experiments , larger learning rates are seen to be more favorable in both regards . Our main contributions are summarized as follows : 2 RELATED WORK . Normalized loss functions have been considered before ( Poggio et al. , 2019 ) , ( Liao et al. , 2018 ) . In Liao et al . ( 2018 ) , test error is seen to be well correlated with the normalized loss . This observation is one motivation for our study . We might expect generalization bounds on the test error to be better by using the normalized surrogate loss in the analysis . ( Poggio et al. , 2019 ) writes down a generalization bound based on Rademacher complexity but motivated by the possible limitations of uniform convergence for deep learning ( Nagarajan & Kolter , 2019 ) we take the stability approach instead . Generalization of SGD has been investigated before in a large body of literature . Soudry et al . ( 2018 ) showed that gradient descent converges to the max-margin solution for logistic regression and Lyu & Li ( 2019 ) provides an extension to deep non-linear homogeneous networks . Nacson et al . ( 2019 ) gives similar results for stochastic gradient descent . From the point of view of stability , starting from Hardt et al . ( 2016 ) without being exhaustive , a few representative examples are Bassily et al . ( 2020 ) , Yuan et al . ( 2019 ) , Kuzborskij & Lampert ( 2018 ) , Liu et al . ( 2017 ) , London ( 2017 ) . Since the work of Zhang et al . ( 2017 ) showing that currently used deep neural networks are so overparameterized that they can easily fit random labels , taking properties of the data distribution into account seems necessary to understand generalization of deep networks . In the context of stability , this means moving from uniform stability to on-average stability . This is the main concern of the work of Kuzborskij & Lampert ( 2018 ) . They develop data-dependent stability bounds for SGD by extending over the work of Hardt et al . ( 2016 ) . Their results have a dependence on the risk of the initialization point and the curvature of the initialization . They have to assume a bound on the noise of the stochastic gradient . We do not make this assumption in our work . Furthermore , we maintain in our bounds for neural networks the properties after the “ burn-in ” period and therefore closer to the final output since we are interested in the effect of the learning rate on the trajectory . This is motivated by the empirical work of Jastrzebski et al . ( 2020 ) arguing that in the early phase of training , the learning rate and batch size determine the properties of the trajectory after a “ break-even point ” . Another work interested in on-average stability is Zhou et al . ( 2021 ) . Differently from our work , their approach makes the extra assumptions that the variance of the stochastic gradients is bounded and also that the loss is bounded . Furthermore , our analysis directly exploits the structure of neural networks and the properties following from using homogeneous non-linearities . It has been observed in the early work of Keskar et al . ( 2017 ) that training with larger batch sizes can lead to a deterioration in test accuracy . The simplest strategy to reduce ( at least partially ) the gap with small batch training is to increase the learning rate ( He et al. , 2019 ) , ( Smith & Le , 2018 ) , ( Hoffer et al. , 2017 ) , ( Goyal et al. , 2017 ) . We choose this scenario to investigate empirically the relevance of our stability bound for SGD on neural networks . Note that the results in Hardt et al . ( 2016 ) are more favorable to smaller learning rates . It seems therefore important in order to get theory closer to practice to understand better in what sense larger learning rates can improve stability . 3 PRELIMINARIES . Let l ( w , z ) be a non-negative loss function . Furthermore , let A be a randomized algorithm and denote by A ( S ) the output of A when trained on training set S = { z1 , · · · , zn } ∼ Dn . The true risk for a classifier w is given as LD ( w ) : = Ez∼Dl ( w , z ) and the empirical risk is given by LS ( w ) : = 1 n ∑n i=1 l ( w , zi ) . When considering the 0− 1 loss of a classifier w , we will write L0−1D ( w ) . Furthermore , we will add a superscript α when the normalized losses lα are under consideration ( these will be defined more clearly in the subsequent sections respectively for the convex case and the non-convex case ) . Our main interest is to ensure small test error and so we want to bound L0−1D ( w ) . The usual approach is to minimize a surrogate loss upper bounding the 0− 1 loss . In this paper , we consider stochastic gradient descent with different batch sizes to minimize the empirical surrogate loss . The update rule of this algorithm for learning rates λt and a subset Bt ⊂ S of size B is given by wt+1 = wt − λt 1 B ∑ zj∈Bt ∇l ( wt , zj ) . ( 1 ) We assume sampling uniformly with replacement in order to form each batch of training examples . In order to investigate generalization of this algorithm , we consider the framework of stability ( Bousquet & Elisseeff , 2002 ) . We now give the definitions for uniform stability and on-average stability ( random pointwise hypothesis stability in Elisseeff et al . ( 2005 ) ) for randomized algorithms ( see also Hardt et al . ( 2016 ) and Kuzborskij & Lampert ( 2018 ) ) . The definitions can be formulated with respect to any loss function but since we will study stability with respect to the lα losses , we write the definitions in the context of this special case . Definition 1 The algorithm A is said to be αuni-uniformly stable if for all i ∈ { 1 , . . . , n } sup S , z′i , z E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αuni . ( 2 ) Here , the expectation is taken over the randomness of A . The notation S ( i ) means that we replace the ith example of S with z′i . Definition 2 The algorithm A is said to be αav-on-average stable if for all i ∈ { 1 , . . . , n } E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αav . ( 3 ) Here , the expectation is taken over S ∼ Dn , z ∼ D and the randomness of A . The notation S ( i ) means that we replace the ith example of S with z . Throughout the paper , ||·|| will denote the euclidean norm for vectors and the Frobenius norm for matrices . The proofs are given in Appendix A for the convex case and in Appendix B for the non-convex case . 4 CONVEX CASE : A FIRST STEP TOWARD THE NON-CONVEX CASE . Since the convex case is easier to handle , it can be seen as a good preparation for the non-convex case . Consider a linear classifier parameterized by either a vector of weights ( binary case ) or a matrix of weights ( multi-class case ) that we denote by w in both cases . The normalized losses are defined by lα ( w , z ) : = l ( α w ||w|| , z ) , ( 4 ) for α > 0 . In order to state the main result of this section , we need two common assumptions : L-Lipschitzness of l as a function of w and β-smoothness . Definition 3 The function l ( w , z ) is L−Lipschitz for all z in the domain ( with respect to w ) if for all w , w′ , z , |l ( w , z ) − l ( w′ , z ) |≤ L||w − w′|| . ( 5 ) Definition 4 The function l ( w , z ) is β−smooth if for all w , w′ , z , ||∇l ( w , z ) −∇l ( w′ , z ) ||≤ β||w − w′|| . ( 6 ) We are now ready to state the main result of this section . Theorem 1 Assume that l ( w , z ) is convex , β−smooth and L−Lipschitz for all z . Furthermore , assume that the initial point w0 satisfies ||w0||≥ K for some K such that K̂ = K −L ∑T−1 i=0 λi > 0 for a sequence of learning rates λi ≤ 2/β . SGD is then run with batch size B on loss function l ( w , z ) for T steps with the learning rates λt starting from w0 . Denote by αuni the uniform stability of this algorithm with respect to lα . Then , αuni ≤ α 2L2B nK̂ T−1∑ i=0 λi . ( 7 ) What is the main difference between our bound and the bound in Hardt et al . ( 2016 ) ( see theorem 7 in Appendix A ) ? Our bound takes into account the norm of the initialization . The meaning of the bound is that it is not enough to use small learning rates and a small number of epochs to guarantee good stability ( with respect to the normalized loss ) . We also need to take into account the norm of the parameters ( here the norm of the initialization ) to make sure that the “ effective ” learning rates are small . Note that all classifiers are contained in any ball around the origin even if the radius of the ball is arbitrarily small . Therefore , all control over stability is lost very close to the origin where even a small step ( in Euclidean distance ) can lead to a drastic change in the classifier . The norm of the initialization must therefore be large enough to ensure that the trajectory can not get too close to the origin ( in worst case , since uniform stability is considered ) . An alternative if the conditions of the theorem are too strong in some practical scenarios is to use on-average stability ( l = 1 layer in the results of section 5 ) . As a side note , we also incorporated the batch size into the bound which is not present in Hardt et al . ( 2016 ) ( only B = 1 is considered ) . From this result , it is now possible to obtain a high probability bound for the test error . The bound is over draws of training sets S but not over the randomness of A . 1 So , we actually have the expected 1It is possible to obtain a bound holding over the randomness of A by exploiting the framework of Elisseeff et al . ( 2005 ) . However , the term involving ρ in their theorem 15 does not converge to 0 when the size of the training set grows to infinity . test error over the randomness of A in the bound . This is reminiscent of PAC-Bayes bounds where here the posterior distribution would be induced from the randomness of the algorithm A. Theorem 2 Fix α > 0 . Let Mα : = sup { l ( w , z ) s.t . ||w||≤ α , ||x||≤ R } . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : ( 8 ) EAL0−1D ( A ( S ) ) ≤ EAL α S ( A ( S ) ) + α uni + ( 2n α uni +Mα ) √ ln ( 1/δ ) 2n . Proof : The proof is an application of McDiarmid ’ s concentration bound . Note that we do not need the training loss to be bounded since we consider the normalized loss which is bounded . The proof follows the same line as theorem 12 in Bousquet & Elisseeff ( 2002 ) and we do not replicate it here . Note that we need to use that uniform stability implies generalization in expectation which is proven for example in theorem 2.2 from Hardt et al . ( 2016 ) . Furthermore , a bound holding uniformly over all α ’ s can be obtained using standard techniques . Theorem 3 Let C > 0 . Assume that lα ( w , z ) is a convex function of α for all w , z and that αuni is a non-decreasing function of α . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : EAL0−1D ( A ( S ) ) ≤ inf α∈ ( 0 , C ] { EA max ( Lα/2S ( A ( S ) ) , L α S ( A ( S ) ) ) + α uni + ( 2n α uni + Mα ) √ 2 ln ( √ 2 ( 2 + log2 C − log2 α ) ) + ln ( 1/δ ) 2n } . In the next section , we investigate the non-convex case . We exploit on-average stability to obtain a data-dependent quantity in the bound . Note that it is also argued in Kuzborskij & Lampert ( 2018 ) that the worst case analysis of uniform stability might not be appropriate for deep learning . | This paper considers the problem of understanding the generalization of SGD using the stability framework. The well-known result in this line of work is the paper by Hardt'16. In Hardt'16, the stability is measured using the difference between the "actual" weights of two copy of SGD which differ in a single data point. The main observation by the authors in this paper is that in many cases, the loss function is invariant to the scaling of weights. Then, they reformulate the stability analysis using the "normalized loss function" which is defined by l^alpha(w,z) = loss(alpha*w/||w||,z) where alpha is a constant. Their main results are the new stability analysis for this new notion for convex and non-convex settings. Specifically, for the convex case the analysis is very similar to the Hardt paper. For the non-convex the authors define a new measure for generalization "zeta" in Theorem 4 which governs the stability. | SP:9070183afc9422af7dcef84aea785cb59bbba3ae |
Stability and Generalisation in Batch Reinforcement Learning | 1 INTRODUCTION . A central aim of machine learning theory is to provide wort-case bounds on overfitting . However , in reinforcement learning ( RL ) , which typically employs online learning on an unlimited stream of data and does not minimise an empirical risk , generalisation is more difficult to characterise than in the supervised learning case . This said , overfitting is still observed in RL settings , with various definitions of data scarcity . This work looks to characterise generalisation and overfitting in batch , off-policy RL . Batch RL has been of particular recent interest , for reasons of data efficiency , policy safety , or as a component of a more complex online algorithm . Despite this , overfitting has never been directly characterised in this context . Fortunately , batch RL makes use of a limited data regime close to the ERM formulation , allowing us to contribute such an analysis . Algorithmic stability ( Bousquet & Elisseeff , 2002 ) describes the change in the model learned by an algorithm when the data employed is changed at a single point . It is a useful property , as it bounds the generalisation gap–the difference between error on our dataset , and the true population error . As such , if we can bound the stability of a batch RL algorithm , we can also make guarantees about how prone it is to overfitting : how well the error on our dataset represents the error across the whole MDP . Specifically , this work formulates an off-distribution notion of uniform stability ( Bousquet & Elisseeff , 2002 ) , suitable for batch policy evaluation algorithms . We show the relationship between this variant of stability and an off-policy generalisation gap . This allows us to characterise overfitting in batch RL via stability , answering the question : when can we expect a batch RL algorithm to generalise well ? This framework is then applied to a partially fitted variant of temporal difference ( TD ) learning , that bridges the gap between fitted and traditional TD methods . Importantly , no realisability assumptions about the ability of the function class to fit values are needed . The iterative , partially fitted batch method employed here means that our result characterises the use of target networks ( Mnih et al. , 2015 ) , common in deep RL algorithms . Our bound expresses a bias-variance trade-off in the number of steps taken between updates of the target network–as more steps are taken , less data is incorporated into the update dynamics , leading to a higher variance , but lower bias procedure , as the value targets are also less correlated with the value parameters . 2 RELATED WORK . Our work builds directly on the results of Hardt et al . ( 2016 ) , which establishes stability bounds for stochastic gradient methods in non-convex optimisation settings . That work in turn builds on algorithmic stability , a topic in learning theory that characterises the generalisation gap in a manner agnostic to model capacity ( Rogers & Wagner , 1978 ; Devroye & Wagner , 1979 ; Bousquet & Elisseeff , 2002 ) . Bounds for batch RL have seen significant recent interest , especially for linearly parameterised value estimators . Existing bounds in this setting study generalisation by directly bounding the suboptimality of value function estimators , rather than the generalisation gap . Most relevant here is the work of Duan & Wang ( 2020 ) , where tight upper bounds on finite time regret are given for linear value function approximators applied to fitted off-policy evaluation , but restricted to the finite-horizon RL problem , where data can be separated into specific trajectories , and under a function approximation class that is closed under Bellman backups . Fan et al . ( 2020 ) provides generalisation bounds in deep RL with use of a target network but these are capacity dependent and do not characterise partial fitting . Other key bounds for batch fitted methods include those of Murphy ( 2005 ) ; Antos et al . ( 2007 ) ; Munos & Szepesvári ( 2008 ) ; Tosatto et al . ( 2017 ) , though settings and assumptions differ from those used here . Zhang et al . ( 2021 ) also characterise the convergence properties of a target network used with linear function approximation . Furthermore , exponential worst-case lower bounds have been constructed for batch RL . Chen & Jiang ( 2019 ) show that concentration assumptions are needed for polynomial-time learning without strong assumptions on the function approximation class . Zanette ( 2021 ) ; Wang et al . ( 2020 ) ; Amortila et al . ( 2020 ) provide exponential lower bounds for batch RL with only realizability and coverage assumptions . Wang et al . ( 2021 ) investigate these lower bounds empirically for fitted Q-iteration , and provides upper bounds using either realizability , or strong concentration assumptions . Direct characterisation of overfitting in RL has seen more interest recently , though the vast majority of work thus far is empirical . To our knowlege , Wang et al . ( 2019 ) provide the only theoretical characterisation of the generalisation gap beyond this work , though it applies in the online setting , depends on the model complexity , and makes the restrictive assumption that the reparameterization trick ( Kingma & Welling , 2013 ) can be applied to the random variables of the MDP . Francois-Lavet et al . ( 2019 ) characterise overfitting asymptotically for batch RL as applied to partially observable Markov decision processes with finite observation , state , and action spaces . Empirical characterisation of overfitting in RL across several settings can be found in Zhang et al . ( 2018a ) , Zhang et al . ( 2018b ) ; Cobbe et al . ( 2019 ) , and Packer et al . ( 2019 ) . 3 PRELIMINARIES . We consider the infinite horizon discounted RL setting . The agent interacts with an environment , formalised as a Markov Decision Process , M with ( potentially infinite ) state space S , a finite action space A , transition kernel P : S × A × S → [ 0 , 1 ] , bounded stochastic reward kernel R : S × A → P ( −rmax , rmax ) , where P ( a , b ) is a probability distribution with bounded support on the interval [ a , b ] and scalar discount factor γ ∈ [ 0 , 1 ) . The agent ’ s behaviour is determined by a policy that maps a state to a distribution over actions : pi : S × A → [ 0 , 1 ] . We seek to optimise ( in the control case ) , or estimate ( in the policy evaluation case ) the expected discounted sum of future rewards starting from a given state . This quantity is given by the state value function , V ( S ) = ∑ A∈A π ( S , A ) Q ( S , A ) , with Q : S × A → [ −rmax/ ( 1 − γ ) , rmax/ ( 1 − γ ) ] , the action value function , given recursively through the Bellman equation : Q ( S , A ) = r̄ ( S , A ) + γES′∼P ( S , A ) , A′∼π ( S′ ) [ Q ( S′ , A′ ) ] , ( 1 ) where r̄ ( S , A ) is the mean reward as sampled from the reward kernel . The Bellman operator T π projects functions forwards by one step through the dynamics of the MDP : T π ( Q ) ( S , A ) = r̄ ( S , A ) + γES′∼P ( S , A ) [ EA′∼π ( S′ ) [ Q ( S′ , A′ ) ] ] . ( 2 ) T is a γ-contractive mapping and thus has a fixed point . The fixed point of this operator corresponds to the true value of the policy in question ( Puterman , 2014 ) . We make use of a feature mapping to encode states and actions , φ : S×A : → Rd . When estimating MDP values , we employ parameterised value functions with a linear approximation : Qw ( φ ( S , A ) ) = φ > ( S , A ) w . 3.1 BATCH RL . In batch RL , rather than interacting directly with the MDP , the algorithm is given a fixed dataset , with samples drawn from the transition and reward kernels of the MDP . The agent uses these samples to estimate either the value of a fixed target policy π , or to learn an optimal policy , π∗ . Usually , the state-action distribution induced by the target policy differs from that of the dataset , so batch RL is generally viewed as an extreme case of off-policy RL , in which additional data can not be generated from any policy . In this paper , we focus on off-policy evaluation , leaving control to future work . Fitted temporal difference methods are a class of batch RL algorithms that iteratively fix a target estimator for the value function , g : S × A → R , and then minimise the mean squared empirical Bellman error ( MSBE ) of a separate estimator , fw : S ×A → R , over a batch of data : 1 D D∑ i=1 min w ( fw ( si , ai ) − T̂ g ( si , ai ) ) 2 , ( 3 ) where T̂ is the pointwise empirical Bellman operator : T̂ π ( Q ) ( S , A ) = r + γ ∑ A′ π ( A′|S′ ) Q ( S′ , A′ ) , ( 4 ) and r and S′ are sampled by taking action A in state S. Once the minimum is attained , g is updated to match fw . This procedure repeats until convergence . In practice , particularly when using neural networks , the minimiser of ( 3 ) can not be found in closed form . Furthermore , it may be too computationally expensive , or undesirable from the perspective of learning dynamics , to reach this optimum . Instead , partial optimisation is performed : a few updates of an iterative optimisation procedure often suffice . We summarise this process using linear function approximation and expected SARSA as our off-policy estimator of the Bellman error in Algorithm 1 . Algorithm 1 Partially Fitted Linear Expected SARSA Input : D ∼ Dµ , learning rate α , target policy π Output : value parameters w 1 : initialize value parameters w0 2 : for epoch i = 0 , ... , N do 3 : fix w̄ = wiK 4 : sample minibatch of size K , U = { ( Sj , Aj , Rj , S ′ j ) } 5 : for update k = 1 , ... , K do 6 : t = iK + k 7 : δu ( w ) = ( φ ( Sk , Ak ) > w −Rk − γ ∑ A′ π ( S ′ k , A ′ ) φ ( S′k , A ′ ) > w̄ ) 8 : wt = wt−1 + αφ ( Su , Au ) δu ( wt−1 ) 9 : end for 10 : project w = argmin||w′||≤wmax ||w − w ′|| 11 : end for 12 : return wt Algorithm 1 also includes a projection step for the purposes of the theory in Section 4 . After each epoch i , the value parameters , w are projected to a closed ball of fixed radius . This prevents the step sizes from growing too quickly , as our update rule is non-Lipschitz for unbounded parameter spaces . By varying the hyperparameters of Algorithm 1 , we move between traditional and fitted temporal difference algorithms . If the minimiser of ( 3 ) exists , setting K large enough to allow for convergence recovers fitted expected SARSA , while setting K = 1 recovers expected SARSA applied to the uniform distribution over data . Update Rules and Parameterisation One challenge that arises when treating the stability of Algorithm 1 comes from the fact that we need to reason over the behaviour of two separate sets of parameters–both the value and target parameters affect the update rule . In order to manage this , we propose a unified parameterisation for which we maintain a single set of parameters , ŵ which combines the value parameters and the frozen ones : ŵ : = [ w w̄ ] With this setup we need to use two update rules that operate on the same set of parameters . The parameter fitting update is given by : G ( ŵ ) s , a , r , s′ : = ŵ − α [ φ ( s , a ) 0 ] ( φ ( s , a ) > w − r − γ ∑ a′ π ( a′|s′ ) φ ( s′ , a′ ) > w̄ ) ( 5 ) Where 0 is the zero vector in d dimensions . This is identical to performing the fitted TD update on w and does not alter the value of w̄ . When we need to update the frozen parameters , we simply use an assignment : Ĝ ( ŵ ) = [ w w ] ( 6 ) This setup allows our update rules to depend only on the data being used to perform that update , rather than having an implicit dependency on previous updates , due to the fact that there are two sets of parameters being maintained . | The paper aims to study the effect of stability on generalization of a particular off-policy policy evaluation algorithm. Specifically, the authors study a version of Fitted Q-evaluation where the iterative procedure is instead thought of as a gradient update and is performed by only partially fitting the new Q-function to the current target Q function. The authors look at a linear function approximation setting and connect the recent results on stability of stochastic gradient methods (Hardt et al, 2016) with their method and show stability results, and connect that with overfitting of the policy evaluation scheme. The authors discuss the effect of the number of updates performed in each epoch during the partially fitted linear-update scheme and further show empirical simulations. | SP:90f90a6bb1e055d5cf386162c2e1d17a95d4db29 |
Stability and Generalisation in Batch Reinforcement Learning | 1 INTRODUCTION . A central aim of machine learning theory is to provide wort-case bounds on overfitting . However , in reinforcement learning ( RL ) , which typically employs online learning on an unlimited stream of data and does not minimise an empirical risk , generalisation is more difficult to characterise than in the supervised learning case . This said , overfitting is still observed in RL settings , with various definitions of data scarcity . This work looks to characterise generalisation and overfitting in batch , off-policy RL . Batch RL has been of particular recent interest , for reasons of data efficiency , policy safety , or as a component of a more complex online algorithm . Despite this , overfitting has never been directly characterised in this context . Fortunately , batch RL makes use of a limited data regime close to the ERM formulation , allowing us to contribute such an analysis . Algorithmic stability ( Bousquet & Elisseeff , 2002 ) describes the change in the model learned by an algorithm when the data employed is changed at a single point . It is a useful property , as it bounds the generalisation gap–the difference between error on our dataset , and the true population error . As such , if we can bound the stability of a batch RL algorithm , we can also make guarantees about how prone it is to overfitting : how well the error on our dataset represents the error across the whole MDP . Specifically , this work formulates an off-distribution notion of uniform stability ( Bousquet & Elisseeff , 2002 ) , suitable for batch policy evaluation algorithms . We show the relationship between this variant of stability and an off-policy generalisation gap . This allows us to characterise overfitting in batch RL via stability , answering the question : when can we expect a batch RL algorithm to generalise well ? This framework is then applied to a partially fitted variant of temporal difference ( TD ) learning , that bridges the gap between fitted and traditional TD methods . Importantly , no realisability assumptions about the ability of the function class to fit values are needed . The iterative , partially fitted batch method employed here means that our result characterises the use of target networks ( Mnih et al. , 2015 ) , common in deep RL algorithms . Our bound expresses a bias-variance trade-off in the number of steps taken between updates of the target network–as more steps are taken , less data is incorporated into the update dynamics , leading to a higher variance , but lower bias procedure , as the value targets are also less correlated with the value parameters . 2 RELATED WORK . Our work builds directly on the results of Hardt et al . ( 2016 ) , which establishes stability bounds for stochastic gradient methods in non-convex optimisation settings . That work in turn builds on algorithmic stability , a topic in learning theory that characterises the generalisation gap in a manner agnostic to model capacity ( Rogers & Wagner , 1978 ; Devroye & Wagner , 1979 ; Bousquet & Elisseeff , 2002 ) . Bounds for batch RL have seen significant recent interest , especially for linearly parameterised value estimators . Existing bounds in this setting study generalisation by directly bounding the suboptimality of value function estimators , rather than the generalisation gap . Most relevant here is the work of Duan & Wang ( 2020 ) , where tight upper bounds on finite time regret are given for linear value function approximators applied to fitted off-policy evaluation , but restricted to the finite-horizon RL problem , where data can be separated into specific trajectories , and under a function approximation class that is closed under Bellman backups . Fan et al . ( 2020 ) provides generalisation bounds in deep RL with use of a target network but these are capacity dependent and do not characterise partial fitting . Other key bounds for batch fitted methods include those of Murphy ( 2005 ) ; Antos et al . ( 2007 ) ; Munos & Szepesvári ( 2008 ) ; Tosatto et al . ( 2017 ) , though settings and assumptions differ from those used here . Zhang et al . ( 2021 ) also characterise the convergence properties of a target network used with linear function approximation . Furthermore , exponential worst-case lower bounds have been constructed for batch RL . Chen & Jiang ( 2019 ) show that concentration assumptions are needed for polynomial-time learning without strong assumptions on the function approximation class . Zanette ( 2021 ) ; Wang et al . ( 2020 ) ; Amortila et al . ( 2020 ) provide exponential lower bounds for batch RL with only realizability and coverage assumptions . Wang et al . ( 2021 ) investigate these lower bounds empirically for fitted Q-iteration , and provides upper bounds using either realizability , or strong concentration assumptions . Direct characterisation of overfitting in RL has seen more interest recently , though the vast majority of work thus far is empirical . To our knowlege , Wang et al . ( 2019 ) provide the only theoretical characterisation of the generalisation gap beyond this work , though it applies in the online setting , depends on the model complexity , and makes the restrictive assumption that the reparameterization trick ( Kingma & Welling , 2013 ) can be applied to the random variables of the MDP . Francois-Lavet et al . ( 2019 ) characterise overfitting asymptotically for batch RL as applied to partially observable Markov decision processes with finite observation , state , and action spaces . Empirical characterisation of overfitting in RL across several settings can be found in Zhang et al . ( 2018a ) , Zhang et al . ( 2018b ) ; Cobbe et al . ( 2019 ) , and Packer et al . ( 2019 ) . 3 PRELIMINARIES . We consider the infinite horizon discounted RL setting . The agent interacts with an environment , formalised as a Markov Decision Process , M with ( potentially infinite ) state space S , a finite action space A , transition kernel P : S × A × S → [ 0 , 1 ] , bounded stochastic reward kernel R : S × A → P ( −rmax , rmax ) , where P ( a , b ) is a probability distribution with bounded support on the interval [ a , b ] and scalar discount factor γ ∈ [ 0 , 1 ) . The agent ’ s behaviour is determined by a policy that maps a state to a distribution over actions : pi : S × A → [ 0 , 1 ] . We seek to optimise ( in the control case ) , or estimate ( in the policy evaluation case ) the expected discounted sum of future rewards starting from a given state . This quantity is given by the state value function , V ( S ) = ∑ A∈A π ( S , A ) Q ( S , A ) , with Q : S × A → [ −rmax/ ( 1 − γ ) , rmax/ ( 1 − γ ) ] , the action value function , given recursively through the Bellman equation : Q ( S , A ) = r̄ ( S , A ) + γES′∼P ( S , A ) , A′∼π ( S′ ) [ Q ( S′ , A′ ) ] , ( 1 ) where r̄ ( S , A ) is the mean reward as sampled from the reward kernel . The Bellman operator T π projects functions forwards by one step through the dynamics of the MDP : T π ( Q ) ( S , A ) = r̄ ( S , A ) + γES′∼P ( S , A ) [ EA′∼π ( S′ ) [ Q ( S′ , A′ ) ] ] . ( 2 ) T is a γ-contractive mapping and thus has a fixed point . The fixed point of this operator corresponds to the true value of the policy in question ( Puterman , 2014 ) . We make use of a feature mapping to encode states and actions , φ : S×A : → Rd . When estimating MDP values , we employ parameterised value functions with a linear approximation : Qw ( φ ( S , A ) ) = φ > ( S , A ) w . 3.1 BATCH RL . In batch RL , rather than interacting directly with the MDP , the algorithm is given a fixed dataset , with samples drawn from the transition and reward kernels of the MDP . The agent uses these samples to estimate either the value of a fixed target policy π , or to learn an optimal policy , π∗ . Usually , the state-action distribution induced by the target policy differs from that of the dataset , so batch RL is generally viewed as an extreme case of off-policy RL , in which additional data can not be generated from any policy . In this paper , we focus on off-policy evaluation , leaving control to future work . Fitted temporal difference methods are a class of batch RL algorithms that iteratively fix a target estimator for the value function , g : S × A → R , and then minimise the mean squared empirical Bellman error ( MSBE ) of a separate estimator , fw : S ×A → R , over a batch of data : 1 D D∑ i=1 min w ( fw ( si , ai ) − T̂ g ( si , ai ) ) 2 , ( 3 ) where T̂ is the pointwise empirical Bellman operator : T̂ π ( Q ) ( S , A ) = r + γ ∑ A′ π ( A′|S′ ) Q ( S′ , A′ ) , ( 4 ) and r and S′ are sampled by taking action A in state S. Once the minimum is attained , g is updated to match fw . This procedure repeats until convergence . In practice , particularly when using neural networks , the minimiser of ( 3 ) can not be found in closed form . Furthermore , it may be too computationally expensive , or undesirable from the perspective of learning dynamics , to reach this optimum . Instead , partial optimisation is performed : a few updates of an iterative optimisation procedure often suffice . We summarise this process using linear function approximation and expected SARSA as our off-policy estimator of the Bellman error in Algorithm 1 . Algorithm 1 Partially Fitted Linear Expected SARSA Input : D ∼ Dµ , learning rate α , target policy π Output : value parameters w 1 : initialize value parameters w0 2 : for epoch i = 0 , ... , N do 3 : fix w̄ = wiK 4 : sample minibatch of size K , U = { ( Sj , Aj , Rj , S ′ j ) } 5 : for update k = 1 , ... , K do 6 : t = iK + k 7 : δu ( w ) = ( φ ( Sk , Ak ) > w −Rk − γ ∑ A′ π ( S ′ k , A ′ ) φ ( S′k , A ′ ) > w̄ ) 8 : wt = wt−1 + αφ ( Su , Au ) δu ( wt−1 ) 9 : end for 10 : project w = argmin||w′||≤wmax ||w − w ′|| 11 : end for 12 : return wt Algorithm 1 also includes a projection step for the purposes of the theory in Section 4 . After each epoch i , the value parameters , w are projected to a closed ball of fixed radius . This prevents the step sizes from growing too quickly , as our update rule is non-Lipschitz for unbounded parameter spaces . By varying the hyperparameters of Algorithm 1 , we move between traditional and fitted temporal difference algorithms . If the minimiser of ( 3 ) exists , setting K large enough to allow for convergence recovers fitted expected SARSA , while setting K = 1 recovers expected SARSA applied to the uniform distribution over data . Update Rules and Parameterisation One challenge that arises when treating the stability of Algorithm 1 comes from the fact that we need to reason over the behaviour of two separate sets of parameters–both the value and target parameters affect the update rule . In order to manage this , we propose a unified parameterisation for which we maintain a single set of parameters , ŵ which combines the value parameters and the frozen ones : ŵ : = [ w w̄ ] With this setup we need to use two update rules that operate on the same set of parameters . The parameter fitting update is given by : G ( ŵ ) s , a , r , s′ : = ŵ − α [ φ ( s , a ) 0 ] ( φ ( s , a ) > w − r − γ ∑ a′ π ( a′|s′ ) φ ( s′ , a′ ) > w̄ ) ( 5 ) Where 0 is the zero vector in d dimensions . This is identical to performing the fitted TD update on w and does not alter the value of w̄ . When we need to update the frozen parameters , we simply use an assignment : Ĝ ( ŵ ) = [ w w ] ( 6 ) This setup allows our update rules to depend only on the data being used to perform that update , rather than having an implicit dependency on previous updates , due to the fact that there are two sets of parameters being maintained . | As far as I can see, this work tries to leverage the connection between stability and generalization studied in supervised learning settings, and tries to build a similar connection for batch RL settings. To reason about stability in a batch RL problem, this work proposes a modified definition of stability that takes into account the two different distributions involved: the distribution generated by the interaction between the environment and the policy that generated the data, and the distribution corresponding to the policy being evaluated. Then the main result of the paper (Theorem 1) proposes an upper bound on the stability for fitted expected SARSA (and linear value function approximation). | SP:90f90a6bb1e055d5cf386162c2e1d17a95d4db29 |
Optimal Transport for Long-Tailed Recognition with Learnable Cost Matrix | 1 INTRODUCTION . Classification problems in the real world are generally challenged by the long-tailed label distribution , i.e. , having a small number of samples for a majority of labels , and a dominant number of samples for a minority of labels ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Liu et al. , 2019 ) on the training data set . It is also known as imbalanced recognition , which has been widely studied in the past decades ( Cardie & Howe , 1997 ; Chawla et al. , 2002 ; Qiao & Liu , 2009 ; Cui et al. , 2019 ) . These distribution biases pose a significant challenge to predictive modeling ; conceivably , models often suffer from poor generalisation and undesirable estimation bias ( Cao et al. , 2019 ; Kang et al. , 2019 ; Zhou et al. , 2020 ) . Recently , a renewed interest in the problem of long-tail recognition has emerged following the context of neural networks , as numerous publications in the literature endeavour to resolve the problem albeit in different ways including decouple ( Kang et al. , 2019 ) , meta-learning ( Ren et al. , 2020 ; Wang et al. , 2020a ; Li et al. , 2021 ) , post-hoc correction ( Tang et al. , 2020 ; Hong et al. , 2020 ) , etc ( Liu et al. , 2019 ; Cao et al. , 2019 ; Tang et al. , 2020 ) . One of the representative methods of post-hoc correction , Logit Adjustment Menon et al . ( 2020 ) , provides a statistical correction to the prediction , receiving widespread attention for its simplicity and validity , but the downside is that its optimisation is conducted on individual samples , without any indication that rectified marginal distribution satisfies the desired distribution we are striving for . Figuring out how to solve the above problem , our explicit modeling of the problem mathematically turns into an equational constraint , meanwhile to minimise the difference between refined distribution and the original one , this minimisation is motivated upon the inner-product similarity . A little further , the resulting problem can be linked to OT . Drawing on this linkage , we develop it further by proposing a linear mapping to automatically learn cost matrix , thereby circumventing the requirement for expert knowledge to configure this matrix . In short , we contribute as follows : • We propose an alternative direction based on convex optimisation to do post-hoc correction , which goes beyond previous direction from the statistical view . • Imposing marginal distributions to align ideal marginal distributions , we derive an optimisation problem tied to the OT that is solved using Sinkhorn , a highly efficient algorithm . More further , for better learning of the cost matrix , we present a linear mapping enabling very elegant learning with one-layer neural network . • The experimental evidence shows the high efficiency of the algorithm , and the best performance achieved on three benchmarks , also supports our claim that addressing the post-hoc problem via OT is helpful and effective . 2 PRELIMINARIES . In this section , we begin by giving a notational definition , followed by an introduction to the longtailed recognition problem , and finally , we briefly review the OT , and give a quick recap of Logit Adjustment Menon et al . ( 2020 ) . Notations : In what follows , for two matrices X , Y ∈ RN×K , we denote 〈X , Y 〉 =∑N n=1 ∑K k=1XnkYnk as the Frobenius dot-product . δ ( · ) stands for the Dirac function , p ( · ) represents the probability distribution . U ( r , c ) = { P ∈ RN×K+ |P1K = r , P ᵀ1N = c } , where 1N and 1K are N -dimension and K-dimension vector whose elements are all 1. r and c refer to the vectors of size N and K respectively , U ( r , c ) include all matrices with row and column sums r and c respectively 2.1 PROBLEM FORMULATION . Having a collection of training samples { ( xsn , ysn ) } Ns n=1 , validation samples { ( xvn , yvn ) } Nv n=1 and test samples { ( xtn , yn ) t } Nt n=1 for classification with K labels and input x ∈ Rd , long-tailed recognition assumes that the class-prior distribution for training data p ( ys ) is different from that for validation data p ( yv ) and test data p ( yt ) . Specifically , long-tailed recognition means the distribution p ( ys ) is highly skewed , some classes have the dominant number of samples , while tailed labels own a very small number of samples . We can use imbalance ratio to measure the skewness in training data set , which can be defined as R = N s max Nsmin , where Nsmax and N s min denote the largest and smallest number of samples in the training data set , respectively . In this paper , we assume that the marginal distribution of the test set is known , we consider it as an implicit prior knowledge to be applied . Stepping back , even if we do not know the marginal distribution of the test dataset in advance . There are still ways to estimate the marginal distribution of the test dataset relatively precisely , such as methods in Hendrycks et al . ( 2018 ) ; Azizzadenesheli et al . ( 2019 ) . Obviously , most models trained on imbalanced training data set would suffer from extremely limited generalisation ability . Hence the ultimate goal is to learn a model that minimises the empirical risk , which can be formulated as : J ( Φ ( xsn ) , ysn ) = 1 Ns Ns∑ n=1 L ( Φ ( xsn ) , ysn ) , ( 1 ) where Φ ( xsn ) ∈ RK denotes logits with associated sample , Φ ( · ) : Rd → RK represents the mapping via neural networks , L stands for the loss function , typically cross entropy loss function for classification problem . 2.2 REMINDERS ON OPTIMAL TRANSPORT . OT is used to calculate the cost of transporting one probability measure to another . We next present a brief introduction to OT with the aim of helping us better view the long-tailed problem from an OT perspective . Consider probability measures r and c of the two random variables X and Y respectively , when the cost function C ( X , Y ) : X × Y → R+ is defined to denote the cost of transporting X to Y , the OT distance can be defined as : d ( r , c ) = min π∈Π ( r , c ) ∫ X×Y C ( x , y ) π ( x , y ) dxdy , ( 2 ) where Π ( r , c ) = { ∫ Y π ( x , y ) dy = r , ∫ X π ( x , y ) dx = c } is the joint probability measure with r and c. When we extend the above continuous case to the discrete situation , we consider following discrete distributions : r = N∑ i=1 pi ( xi ) δ ( xi ) c = K∑ j=1 pi ( yj ) δ ( yj ) ( 3 ) where pi ( xi ) and pi ( yj ) represent the probability mass to the sample xi and yj respectively . In this context , OT distance can be expressed as : dM ( r , c ) = min P∈U ( r , c ) 〈P , M〉 . ( 4 ) where M stands for the cost matrix constructed by Mij = C ( xi , yj ) . The goal of OT is to find a transportation matrix P that minimizes the distance dM ( r , c ) As we can see , OT is a distance measure between two probability distributions under some cost matrix ( Villani , 2008 ) . However , when we use network simplex or interior point methods to solve the above optimization problem , it often comes at the cost of heavy computational demands . To tackle this issue , OT with entropy constraint is proposed to allow the optimisation at small computational cost in sufficient smoothness ( Cuturi , 2013 ) . By adding a Lagrangian multiplier to the entropy constraint , the new formulation can be defined as follows : dλM ( r , c ) = 〈P λ , M〉 where P λ = arg min P∈U ( r , c ) 〈P , M〉 − λh ( P ) , ( 5 ) where λ ∈ [ 0 , +∞ ] , h ( P ) = − ∑N n=1 ∑K k=1Pnk logPnk , d λ M ( r , c ) is also known as dual-Sinkhorn divergence , besides , it can be calculated with matrix scaling algorithms for cheaper computational demand . The following lemma guarantees the convergence and uniqueness of the solution of the algorithm . Lemma 1 For λ > 0 , the solution P λ is unique and has the form P λ = diag ( u ) Kdiag ( v ) , where u and v are two non-negative vectors uniquely defined up to a multiplicative factor andK = e−M/λ is the element-wise exponential of −M/λ . The above lemma states the uniqueness of P λ ( Sinkhorn , 1974 ) , and P λ can be efficiently computed via Sinkhorn ’ s fixed point iteration u , v ← r./Kv , c./Kᵀu . 2.3 A QUICK RECAP OF LOGIT ADJUSTMENT . We give a brief introduction to Logit Adjustment ( Menon et al. , 2020 ; Hong et al. , 2020 ) . For the model Φ ( · ) , it is trained by the standard cross-entropy loss function on imbalanced training data set , and evaluated on test data . In this algorithm , the test logit is adjusted as follows : Φ ( xtn ) = Φ ( x t n ) − log p ( ys ) ( 6 ) This simple procedure is derived from the Bayes optimal rule . It is apparent that Logit Adjustment involves a post hoc correction on an individual sample , which does not necessarily guarantee that the marginal distribution of the whole dataset matches the desired distribution . 3 METHODOLOGY . The first part of this section explores post-hoc correction from an OT perspective , proceeds to the automatic learning of the cost matrix via linear mapping . Lastly , we demonstrate how it can be achieved simply with one-layer neural network . 3.1 POST-HOC CORRECTION FORMALISED FROM AN OT PERSPECTIVE . Since Logit Adjustment applies adjustment at the individual sample level . It doesn ’ t assure that the marginal distribution of the overall data set fulfils our desired distribution . In this respect , we clearly put the constraint into an equation : Y ᵀ1N = µ , ( 7 ) where Y ∈ RN×K indicates the refined prediction value in matrix form , µ represents the expected distribution on the test set . Alternatively , it is desirable to preserve another characteristic of Y , namely , remaining almost as similar to the original prediction as possible . We consider inner-product based similarity to measure the similarity , which is a straightforward yet useful similarity measure . In mathematical terms , this can be expressed as follows : maximize Y 〈C ( Ẑ ) , Y 〉 , ( 8 ) where Ẑ represents the original prediction in matrix form , C ( · ) denotes to perform some transformation to Ẑ , it can be some simple function , like Logarithmic function log ( z ) , exponential function zα . Here we select − log ( · ) as the cost function . This choice was driven by the requirement that the cost matrix must be positive definite , whereas the transformation of the original prediction by − log ( · ) satisfies this condition , in addition , as log likelihood represents the local probability density of the associated samples , it can also be used to substitute Ẑ for the similarity approximation . In brief , the resulting numerical form can be put in formal terms as follows : minimize Y 〈− log ( Ẑ ) , Y 〉 ( 9 ) subject to Y ᵀ1N = µ , Y 1K = 1N . ( 10 ) Extra constraint on Y are imposed simply cos the tuned estimation has to fulfil the basic probabilistic requirement that its sum is one . Comparing Eq . ( 9-10 ) with Eq . ( 4 ) , we can see that if we substitute P with Y and substitute r and c with 1N and µ respectively , we find that the above optimization problem is actually a special case of OT . In preliminaries , the entropy regularised OT is introduced ( EOT ) , by adding entropy regularisation to OT , the given equation can be solved efficiently by Sinkhorn algorithm . Specifically , the optimisation problem is : minimize Y 〈− log ( Ẑ ) , Y 〉+ λY log ( Y ) ( 11 ) subject to Y ᵀ1N = µ , Y 1K = 1N . ( 12 ) The associated algorithmic flow is outlined in detail in Algorithm 1 . Algorithm 1 : Solve OT-related algorithm efficiently in the post-hoc correction via Sinkhorn Algorithm . Input : Cost matrixM , trade-off parameter λ , max number of iterations NT , iteration number t , error threshold , current error δ , two probability vectors r and c , |·| denotes the vector norm . Result : Refined predictions Y 1 InitialiseK = e−M/λ , uold = 1N , v = 1K , t = 0 ; 2 while t ≤ NT and δ ≤ do 3 u = r./Kv ; 4 v = c./Kᵀu ; 5 σ = |uold − u| ; 6 uold = u ; 7 t = t+ 1 ; 8 end 9 Output Y = diag ( u ) Kdiag ( v ) Assigning λ with 1 , it is observed that we equate our objective function to the KL divergence , thus illustrating the extensive nature of our approach . DARP ( Kim et al. , 2020a ) has previously applied it to long-tailed semi-supervised classification . Remark We would like to illustrate the non-applicable scenarios of our method . Firstly , our method requires a large number of samples for evaluation . This is because if the batch size is small , we can not guarantee that the desired marginal distribution can be satisfied within the batch . In some online scenarios , the sample-wise correction method is more suitable . In addition , our method assumes that the marginal distribution is already known , and in the paper we assume in particular that it is consistent with a uniform distribution . | This paper contributes an extension of post hoc correction of long-tailed recognition with Optimal Transport (OT). Unlike the previous work (e.g. logit adjustment) which focuses on sample-wise correction, this work, on the other hand, considers the marginal distribution of the overall data for correction. The method is further extended by learning a cost matrix. Their experiments show the effectiveness of optimal transport in the long-tail recognition problem via comprehensive comparison with previous works in terms of performance and efficiency. | SP:ac3bde5bb8c4674166478734b66c277fc74f5053 |
Optimal Transport for Long-Tailed Recognition with Learnable Cost Matrix | 1 INTRODUCTION . Classification problems in the real world are generally challenged by the long-tailed label distribution , i.e. , having a small number of samples for a majority of labels , and a dominant number of samples for a minority of labels ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Liu et al. , 2019 ) on the training data set . It is also known as imbalanced recognition , which has been widely studied in the past decades ( Cardie & Howe , 1997 ; Chawla et al. , 2002 ; Qiao & Liu , 2009 ; Cui et al. , 2019 ) . These distribution biases pose a significant challenge to predictive modeling ; conceivably , models often suffer from poor generalisation and undesirable estimation bias ( Cao et al. , 2019 ; Kang et al. , 2019 ; Zhou et al. , 2020 ) . Recently , a renewed interest in the problem of long-tail recognition has emerged following the context of neural networks , as numerous publications in the literature endeavour to resolve the problem albeit in different ways including decouple ( Kang et al. , 2019 ) , meta-learning ( Ren et al. , 2020 ; Wang et al. , 2020a ; Li et al. , 2021 ) , post-hoc correction ( Tang et al. , 2020 ; Hong et al. , 2020 ) , etc ( Liu et al. , 2019 ; Cao et al. , 2019 ; Tang et al. , 2020 ) . One of the representative methods of post-hoc correction , Logit Adjustment Menon et al . ( 2020 ) , provides a statistical correction to the prediction , receiving widespread attention for its simplicity and validity , but the downside is that its optimisation is conducted on individual samples , without any indication that rectified marginal distribution satisfies the desired distribution we are striving for . Figuring out how to solve the above problem , our explicit modeling of the problem mathematically turns into an equational constraint , meanwhile to minimise the difference between refined distribution and the original one , this minimisation is motivated upon the inner-product similarity . A little further , the resulting problem can be linked to OT . Drawing on this linkage , we develop it further by proposing a linear mapping to automatically learn cost matrix , thereby circumventing the requirement for expert knowledge to configure this matrix . In short , we contribute as follows : • We propose an alternative direction based on convex optimisation to do post-hoc correction , which goes beyond previous direction from the statistical view . • Imposing marginal distributions to align ideal marginal distributions , we derive an optimisation problem tied to the OT that is solved using Sinkhorn , a highly efficient algorithm . More further , for better learning of the cost matrix , we present a linear mapping enabling very elegant learning with one-layer neural network . • The experimental evidence shows the high efficiency of the algorithm , and the best performance achieved on three benchmarks , also supports our claim that addressing the post-hoc problem via OT is helpful and effective . 2 PRELIMINARIES . In this section , we begin by giving a notational definition , followed by an introduction to the longtailed recognition problem , and finally , we briefly review the OT , and give a quick recap of Logit Adjustment Menon et al . ( 2020 ) . Notations : In what follows , for two matrices X , Y ∈ RN×K , we denote 〈X , Y 〉 =∑N n=1 ∑K k=1XnkYnk as the Frobenius dot-product . δ ( · ) stands for the Dirac function , p ( · ) represents the probability distribution . U ( r , c ) = { P ∈ RN×K+ |P1K = r , P ᵀ1N = c } , where 1N and 1K are N -dimension and K-dimension vector whose elements are all 1. r and c refer to the vectors of size N and K respectively , U ( r , c ) include all matrices with row and column sums r and c respectively 2.1 PROBLEM FORMULATION . Having a collection of training samples { ( xsn , ysn ) } Ns n=1 , validation samples { ( xvn , yvn ) } Nv n=1 and test samples { ( xtn , yn ) t } Nt n=1 for classification with K labels and input x ∈ Rd , long-tailed recognition assumes that the class-prior distribution for training data p ( ys ) is different from that for validation data p ( yv ) and test data p ( yt ) . Specifically , long-tailed recognition means the distribution p ( ys ) is highly skewed , some classes have the dominant number of samples , while tailed labels own a very small number of samples . We can use imbalance ratio to measure the skewness in training data set , which can be defined as R = N s max Nsmin , where Nsmax and N s min denote the largest and smallest number of samples in the training data set , respectively . In this paper , we assume that the marginal distribution of the test set is known , we consider it as an implicit prior knowledge to be applied . Stepping back , even if we do not know the marginal distribution of the test dataset in advance . There are still ways to estimate the marginal distribution of the test dataset relatively precisely , such as methods in Hendrycks et al . ( 2018 ) ; Azizzadenesheli et al . ( 2019 ) . Obviously , most models trained on imbalanced training data set would suffer from extremely limited generalisation ability . Hence the ultimate goal is to learn a model that minimises the empirical risk , which can be formulated as : J ( Φ ( xsn ) , ysn ) = 1 Ns Ns∑ n=1 L ( Φ ( xsn ) , ysn ) , ( 1 ) where Φ ( xsn ) ∈ RK denotes logits with associated sample , Φ ( · ) : Rd → RK represents the mapping via neural networks , L stands for the loss function , typically cross entropy loss function for classification problem . 2.2 REMINDERS ON OPTIMAL TRANSPORT . OT is used to calculate the cost of transporting one probability measure to another . We next present a brief introduction to OT with the aim of helping us better view the long-tailed problem from an OT perspective . Consider probability measures r and c of the two random variables X and Y respectively , when the cost function C ( X , Y ) : X × Y → R+ is defined to denote the cost of transporting X to Y , the OT distance can be defined as : d ( r , c ) = min π∈Π ( r , c ) ∫ X×Y C ( x , y ) π ( x , y ) dxdy , ( 2 ) where Π ( r , c ) = { ∫ Y π ( x , y ) dy = r , ∫ X π ( x , y ) dx = c } is the joint probability measure with r and c. When we extend the above continuous case to the discrete situation , we consider following discrete distributions : r = N∑ i=1 pi ( xi ) δ ( xi ) c = K∑ j=1 pi ( yj ) δ ( yj ) ( 3 ) where pi ( xi ) and pi ( yj ) represent the probability mass to the sample xi and yj respectively . In this context , OT distance can be expressed as : dM ( r , c ) = min P∈U ( r , c ) 〈P , M〉 . ( 4 ) where M stands for the cost matrix constructed by Mij = C ( xi , yj ) . The goal of OT is to find a transportation matrix P that minimizes the distance dM ( r , c ) As we can see , OT is a distance measure between two probability distributions under some cost matrix ( Villani , 2008 ) . However , when we use network simplex or interior point methods to solve the above optimization problem , it often comes at the cost of heavy computational demands . To tackle this issue , OT with entropy constraint is proposed to allow the optimisation at small computational cost in sufficient smoothness ( Cuturi , 2013 ) . By adding a Lagrangian multiplier to the entropy constraint , the new formulation can be defined as follows : dλM ( r , c ) = 〈P λ , M〉 where P λ = arg min P∈U ( r , c ) 〈P , M〉 − λh ( P ) , ( 5 ) where λ ∈ [ 0 , +∞ ] , h ( P ) = − ∑N n=1 ∑K k=1Pnk logPnk , d λ M ( r , c ) is also known as dual-Sinkhorn divergence , besides , it can be calculated with matrix scaling algorithms for cheaper computational demand . The following lemma guarantees the convergence and uniqueness of the solution of the algorithm . Lemma 1 For λ > 0 , the solution P λ is unique and has the form P λ = diag ( u ) Kdiag ( v ) , where u and v are two non-negative vectors uniquely defined up to a multiplicative factor andK = e−M/λ is the element-wise exponential of −M/λ . The above lemma states the uniqueness of P λ ( Sinkhorn , 1974 ) , and P λ can be efficiently computed via Sinkhorn ’ s fixed point iteration u , v ← r./Kv , c./Kᵀu . 2.3 A QUICK RECAP OF LOGIT ADJUSTMENT . We give a brief introduction to Logit Adjustment ( Menon et al. , 2020 ; Hong et al. , 2020 ) . For the model Φ ( · ) , it is trained by the standard cross-entropy loss function on imbalanced training data set , and evaluated on test data . In this algorithm , the test logit is adjusted as follows : Φ ( xtn ) = Φ ( x t n ) − log p ( ys ) ( 6 ) This simple procedure is derived from the Bayes optimal rule . It is apparent that Logit Adjustment involves a post hoc correction on an individual sample , which does not necessarily guarantee that the marginal distribution of the whole dataset matches the desired distribution . 3 METHODOLOGY . The first part of this section explores post-hoc correction from an OT perspective , proceeds to the automatic learning of the cost matrix via linear mapping . Lastly , we demonstrate how it can be achieved simply with one-layer neural network . 3.1 POST-HOC CORRECTION FORMALISED FROM AN OT PERSPECTIVE . Since Logit Adjustment applies adjustment at the individual sample level . It doesn ’ t assure that the marginal distribution of the overall data set fulfils our desired distribution . In this respect , we clearly put the constraint into an equation : Y ᵀ1N = µ , ( 7 ) where Y ∈ RN×K indicates the refined prediction value in matrix form , µ represents the expected distribution on the test set . Alternatively , it is desirable to preserve another characteristic of Y , namely , remaining almost as similar to the original prediction as possible . We consider inner-product based similarity to measure the similarity , which is a straightforward yet useful similarity measure . In mathematical terms , this can be expressed as follows : maximize Y 〈C ( Ẑ ) , Y 〉 , ( 8 ) where Ẑ represents the original prediction in matrix form , C ( · ) denotes to perform some transformation to Ẑ , it can be some simple function , like Logarithmic function log ( z ) , exponential function zα . Here we select − log ( · ) as the cost function . This choice was driven by the requirement that the cost matrix must be positive definite , whereas the transformation of the original prediction by − log ( · ) satisfies this condition , in addition , as log likelihood represents the local probability density of the associated samples , it can also be used to substitute Ẑ for the similarity approximation . In brief , the resulting numerical form can be put in formal terms as follows : minimize Y 〈− log ( Ẑ ) , Y 〉 ( 9 ) subject to Y ᵀ1N = µ , Y 1K = 1N . ( 10 ) Extra constraint on Y are imposed simply cos the tuned estimation has to fulfil the basic probabilistic requirement that its sum is one . Comparing Eq . ( 9-10 ) with Eq . ( 4 ) , we can see that if we substitute P with Y and substitute r and c with 1N and µ respectively , we find that the above optimization problem is actually a special case of OT . In preliminaries , the entropy regularised OT is introduced ( EOT ) , by adding entropy regularisation to OT , the given equation can be solved efficiently by Sinkhorn algorithm . Specifically , the optimisation problem is : minimize Y 〈− log ( Ẑ ) , Y 〉+ λY log ( Y ) ( 11 ) subject to Y ᵀ1N = µ , Y 1K = 1N . ( 12 ) The associated algorithmic flow is outlined in detail in Algorithm 1 . Algorithm 1 : Solve OT-related algorithm efficiently in the post-hoc correction via Sinkhorn Algorithm . Input : Cost matrixM , trade-off parameter λ , max number of iterations NT , iteration number t , error threshold , current error δ , two probability vectors r and c , |·| denotes the vector norm . Result : Refined predictions Y 1 InitialiseK = e−M/λ , uold = 1N , v = 1K , t = 0 ; 2 while t ≤ NT and δ ≤ do 3 u = r./Kv ; 4 v = c./Kᵀu ; 5 σ = |uold − u| ; 6 uold = u ; 7 t = t+ 1 ; 8 end 9 Output Y = diag ( u ) Kdiag ( v ) Assigning λ with 1 , it is observed that we equate our objective function to the KL divergence , thus illustrating the extensive nature of our approach . DARP ( Kim et al. , 2020a ) has previously applied it to long-tailed semi-supervised classification . Remark We would like to illustrate the non-applicable scenarios of our method . Firstly , our method requires a large number of samples for evaluation . This is because if the batch size is small , we can not guarantee that the desired marginal distribution can be satisfied within the batch . In some online scenarios , the sample-wise correction method is more suitable . In addition , our method assumes that the marginal distribution is already known , and in the paper we assume in particular that it is consistent with a uniform distribution . | This paper proposes a new method for post-hoc correction in long-tailed recognition. Specifically, they leverage the idea of optimal transport (OT) and propose a linear mapping to replace the original exact cost matrix in OT problem. From the experiments, the proposed method can be combined with existing methods and boost their performance further. | SP:ac3bde5bb8c4674166478734b66c277fc74f5053 |
Learning Representation for Bayesian Optimization with Collision-free Regularization | Bayesian Optimization has been challenged by the large-scale and highdimensional datasets , which are common in real-world scenarios . Recent works attempt to handle such input by applying neural networks ahead of the classical Gaussian process to learn a ( low-dimensional ) latent representation . We show that even with proper network design , such learned representation often leads to collision in the latent space : two points with significantly different observations collide in the learned latent space , leading to degraded optimization performance . To address this issue , we propose LOCO , an efficient deep Bayesian optimization framework which employs a novel regularizer to reduce the collision in the learned latent space and encourage the mapping from the latent space to the objective value to be Lipschitz continuous . LOCO takes in pairs of data points and penalizes those too close in the latent space compared to their target space distance . We provide a rigorous theoretical justification for LOCO by inspecting the regret of this dynamic-embedding-based Bayesian optimization algorithm , where the neural network is iteratively retrained with the regularizer . Our empirical results further demonstrate the effectiveness of LOCO on several synthetic and realworld benchmark Bayesian optimization tasks . 1 INTRODUCTION . Bayesian optimization is a classical sequential optimization method and is widely used in various fields in science and engineering , including recommender systems ( Galuzzi et al. , 2019 ) , medical trials ( Sui et al. , 2018 ) , robotic controller optimization ( Berkenkamp et al. , 2016 ) , scientific experimental design ( Yang et al. , 2019 ) , and hyper-parameter tuning ( Snoek et al. , 2012 ) , among many others . Many of these applications involve evaluating an expensive blackbox function ; therefore , the number of queries should be minimized . A common way to model the unknown function is via Gaussian processes ( GPs ) ( Rasmussen and Williams , 2006 ) , which have been extensively studied under the bandit setting , as an effective surrogate model of the unknown objective function in a broad class of blackbox function optimization problems ( Srinivas et al. , 2010 ; Djolonga et al. , 2013 ) . A key computational challenge for learning with GPs lies in optimizing specific kernels used for modeling the covariance structures . Such an optimization task depends on the dimension of the input space . For high-dimensional data , it is often prohibitive to train a GP model . Meanwhile , local kernel machines are known to suffer from the curse of dimensionality ( Bengio et al. , 2005 ) , while the required number of training samples could grow exponentially with the dimensionality of the data . Therefore , dimensionality reduction and representation learning algorithms are needed to optimize the learning process . Recently , Gaussian process optimization has been investigated in the context of latent space models . For example , deep kernel learning ( Wilson et al. , 2016 ) learns a ( low-dimensional ) data representation and a scalable kernel simultaneously via an end-to-end trainable deep neural network . In general , the neural network is trained to learn a simpler latent representation with reduced dimension and has the structure information already embedded for the GP . Combining the representation learned via a neural network with GP could improve the scalability and extensibility of classical Bayesian optimization , but it also poses new challenges for the optimization task , such as dealing with the tradeoff between representation learning and function optimization ( Tripp et al. , 2020 ) . As we later demonstrate , a critical challenge brought by introducing representation learning into Bayesian optimization is that the latent representation is prone to collisions : two points with significantly different observations can get too close , and therefore collide in the latent space . The collision effect in latent space models for Bayesian optimization is especially evident when information is lost during dimensionality reduction and/or when the training data is limited in size . As illustrated in Figure 1 , when passed through the neural network , data points with drastically different observations are mapped to close positions in the latent space . Such collisions could be regarded as additional noise introduced by the neural network . Although Bayesian optimization is known to be robust to mild noisy observations ( Bogunovic et al. , 2018 ) , the collision in latent space could be harmful to the optimization performance , as it is non-trivial to model the collision into the acquisition function explicitly . Also , the additional noise induced by the collision effect will further loosen the regret bound for classical Bayesian optimization algorithms ( Srinivas et al. , 2010 ) . Overview of main results To mitigate the collision effect , we propose a novel regularization scheme that can be applied as a simple plugin amendment for the latent space based Bayesian optimization models . The proposed algorithm , namely Latent Space Optimization via Collision-free regularization ( LOCO ) , leverages a regularized regression loss function to optimize the latent space for Bayesian optimization periodically . Concretely , our collision-free regularizer is encoded by a novel pairwise collision penalty function defined jointly on the latent space and the output domain . In order to mitigate the risk of collision in the latent space ( and consequently boost the optimization performance ) , LOCO applies the regularizer to minimize the collisions uniformly in the latent space . We further note that for Bayesian optimization tasks , collisions in regions close to the optimum are more likely to mislead the optimization algorithm . Based on this insight , we propose an optimization-aware regularization scheme that assigns higher weight to the collision penalty on those pairs of points closer to the optimum region in the latent space . This algorithm , which we refer to as Dynamically-Weighted LOCO , is designed to dynamically assess the importance of a collision during optimiza- tion . Compared with the uniform collision penalty in the latent space , the dynamic weighting mechanism has demonstrated drastic improvement over the state-of-the-art latent space based Bayesian optimization models . We summarize our key contributions as follows : I . We investigate latent space based Bayesian optimization , and expose the limitations of existing latent space optimization approaches due to the collision effect on the latent space ( Section 3 ) . II . We propose a novel regularization scheme as a simple plugin amendment for latent space based Bayesian optimization models . Our regularizer penalizes collisions in the latent space and effectively reduces the collision effect . Furthermore , we propose an optimization-aware dynamic weighting mechanism for adjusting the collision penalty to improve the effectiveness of regularization for Bayesian optimization ( Section 4 ) . III . We provide theoretical analysis for the performance of Bayesian optimization on regularized latent space ( Section 5 ) . IV . We conducted an extensive empirical study on several synthetic and real-world datasets , including a real-world case study for cosmic experimental design , and demonstrate the promising empirical performance for our algorithm ( Section 6 ) . 2 RELATED WORK . This section provides a short survey on recent work in Bayesian learning , which was designed to overcome the high-dimensionality challenge for Gaussian process regression tasks and Bayesian optimization . Different surrogate models with internal latent space Some alternative surrogate models have been proposed to replace classical GP in Bayesian optimization to overcome the challenge of highdimensional and highly-structured input in BO . Deep Network for Global Optimization ( DNGO ) Snoek et al . ( 2015 ) uses a pre-trained deep neural network with a Bayesian linear regressor at the last hidden layer of the network as the surrogate model . More generally , Deep Kernel Learning ( DKL ) combines the power of the Gaussian process and neural network by introducing a deep neural network g to learn a mapping g : X → Z from the input domain X to a latent space Z ( Wilson et al. , 2016 ) . It uses the latent representation z ∈ Z as the input of the base Gaussian process . The neural network g and a spectral mixture-based kernel k form a scalable expressive closed-form deep covariance kernel , denoted by kDK ( xi , xj ) → k ( g ( xi ) , g ( xj ) ) . The deep kernel allows end-to-end learning and Bayesian optimization on the original input space . Representation learning and latent space optimization Instead of reducing the dimensionality and performing optimization in an end-to-end process , other methods aim to optimize in a related low-dimensional space first and then map the solution back to the original input space . Djolonga et al . ( 2013 ) assume that only a subset of input dimensions varies , and the kernel is smooth ( i.e . with bounded RKHS norm ) . Under these assumptions , the underlying subspace is learned via low-rank matrix recovery . Random feature is another solution under this setting ( Rahimi et al. , 2007 ; Letham et al. , 2020 ; Binois et al. , 2015 ; Nayebi et al. , 2019 ; Wang et al. , 2016 ) . It is known that a random representation space of sufficiently large dimension is guaranteed to contain the optima with high probability . Mutnỳ and Krause ( 2019 ) consider Quadrature Fourier Features ( QFF ) —as opposed to Random Fourier Feature ( RFF ) in Rahimi et al . ( 2007 ) —to overcome the variance starvation problem , and proved that Thompson sampling and GP-UCB achieve no-regret with squared exponential kernel in optimization tasks . However , both RFF and QFF methods rely on a key assumption that the function to be optimized has a low effective dimension . In contrast , as discussed in Section 6 and the supplemental materials , we show that LOCO performs well for challenging high-dimensional BO problems where algorithms relying on the low effective dimension assumption may fail . Another line of work on latent space optimization uses autoencoders to learn low-dimensional representations of the inputs to improve the scalability and capability to leverage the structural information ( Mathieu et al. , 2019 ) , ( Ding et al. , 2020 ) , ( Gómez-Bombarelli et al. , 2018 ; Huang et al. , 2015 ; Tripp et al. , 2020 ; Lu et al. , 2018 ) . Mathieu et al . ( 2019 ) , Ding et al . ( 2020 ) focus on disentangled representation learning that breaks down , or disentangles , each feature into narrowly defined variables and encodes them as separate dimensions.Tripp et al . ( 2020 ) iteratively train the autoencoder with a dynamic weighting scheme when performing optimization to improve the embedding . Griffiths and Hernández-Lobato ( 2020 ) and Letham et al . ( 2020 ) enforce certain properties on the representation space to improve the optimization performance . To the best of the authors ’ knowledge , collision of the embeddings has not been explicitly studied . Binois et al . ( 2015 ) propose a warped kernel to guarantee the injectivity in the random linear embedding , which is not applicable in neural network-based methods . A common challenge in applying these techniques to generic optimization tasks lies in the assumption on the accessibility of training data : Bayesian optimization often assumes limited access to labeled data , while surrogate models built on deep neural networks often rely on abundant access to data for pretraining . Another problem lies in the training objective : During the training phase , these surrogate models typically focus on improving the regression performance , and do not explicitly address the artifact caused by collisions of the learned embeddings , which—as we later demonstrate in Section 3.3—could be harmful to sequential decision-making tasks . | Despite its success, Gaussian process based Bayesian optimization still struggles in high dimensional search spaces. Current approaches aim to learn an embedding to optimize the objective in a low dimensional continuous latent space. This paper provides evidence that with current approaches, different data points in the input space can be mapped to same point in the latent space. To avoid these collisions, the paper proposes a new regularization technique based on pairs of observed datapoints. | SP:ec387dc36bcda590bbe0a3cf735b83b49616da3e |
Learning Representation for Bayesian Optimization with Collision-free Regularization | Bayesian Optimization has been challenged by the large-scale and highdimensional datasets , which are common in real-world scenarios . Recent works attempt to handle such input by applying neural networks ahead of the classical Gaussian process to learn a ( low-dimensional ) latent representation . We show that even with proper network design , such learned representation often leads to collision in the latent space : two points with significantly different observations collide in the learned latent space , leading to degraded optimization performance . To address this issue , we propose LOCO , an efficient deep Bayesian optimization framework which employs a novel regularizer to reduce the collision in the learned latent space and encourage the mapping from the latent space to the objective value to be Lipschitz continuous . LOCO takes in pairs of data points and penalizes those too close in the latent space compared to their target space distance . We provide a rigorous theoretical justification for LOCO by inspecting the regret of this dynamic-embedding-based Bayesian optimization algorithm , where the neural network is iteratively retrained with the regularizer . Our empirical results further demonstrate the effectiveness of LOCO on several synthetic and realworld benchmark Bayesian optimization tasks . 1 INTRODUCTION . Bayesian optimization is a classical sequential optimization method and is widely used in various fields in science and engineering , including recommender systems ( Galuzzi et al. , 2019 ) , medical trials ( Sui et al. , 2018 ) , robotic controller optimization ( Berkenkamp et al. , 2016 ) , scientific experimental design ( Yang et al. , 2019 ) , and hyper-parameter tuning ( Snoek et al. , 2012 ) , among many others . Many of these applications involve evaluating an expensive blackbox function ; therefore , the number of queries should be minimized . A common way to model the unknown function is via Gaussian processes ( GPs ) ( Rasmussen and Williams , 2006 ) , which have been extensively studied under the bandit setting , as an effective surrogate model of the unknown objective function in a broad class of blackbox function optimization problems ( Srinivas et al. , 2010 ; Djolonga et al. , 2013 ) . A key computational challenge for learning with GPs lies in optimizing specific kernels used for modeling the covariance structures . Such an optimization task depends on the dimension of the input space . For high-dimensional data , it is often prohibitive to train a GP model . Meanwhile , local kernel machines are known to suffer from the curse of dimensionality ( Bengio et al. , 2005 ) , while the required number of training samples could grow exponentially with the dimensionality of the data . Therefore , dimensionality reduction and representation learning algorithms are needed to optimize the learning process . Recently , Gaussian process optimization has been investigated in the context of latent space models . For example , deep kernel learning ( Wilson et al. , 2016 ) learns a ( low-dimensional ) data representation and a scalable kernel simultaneously via an end-to-end trainable deep neural network . In general , the neural network is trained to learn a simpler latent representation with reduced dimension and has the structure information already embedded for the GP . Combining the representation learned via a neural network with GP could improve the scalability and extensibility of classical Bayesian optimization , but it also poses new challenges for the optimization task , such as dealing with the tradeoff between representation learning and function optimization ( Tripp et al. , 2020 ) . As we later demonstrate , a critical challenge brought by introducing representation learning into Bayesian optimization is that the latent representation is prone to collisions : two points with significantly different observations can get too close , and therefore collide in the latent space . The collision effect in latent space models for Bayesian optimization is especially evident when information is lost during dimensionality reduction and/or when the training data is limited in size . As illustrated in Figure 1 , when passed through the neural network , data points with drastically different observations are mapped to close positions in the latent space . Such collisions could be regarded as additional noise introduced by the neural network . Although Bayesian optimization is known to be robust to mild noisy observations ( Bogunovic et al. , 2018 ) , the collision in latent space could be harmful to the optimization performance , as it is non-trivial to model the collision into the acquisition function explicitly . Also , the additional noise induced by the collision effect will further loosen the regret bound for classical Bayesian optimization algorithms ( Srinivas et al. , 2010 ) . Overview of main results To mitigate the collision effect , we propose a novel regularization scheme that can be applied as a simple plugin amendment for the latent space based Bayesian optimization models . The proposed algorithm , namely Latent Space Optimization via Collision-free regularization ( LOCO ) , leverages a regularized regression loss function to optimize the latent space for Bayesian optimization periodically . Concretely , our collision-free regularizer is encoded by a novel pairwise collision penalty function defined jointly on the latent space and the output domain . In order to mitigate the risk of collision in the latent space ( and consequently boost the optimization performance ) , LOCO applies the regularizer to minimize the collisions uniformly in the latent space . We further note that for Bayesian optimization tasks , collisions in regions close to the optimum are more likely to mislead the optimization algorithm . Based on this insight , we propose an optimization-aware regularization scheme that assigns higher weight to the collision penalty on those pairs of points closer to the optimum region in the latent space . This algorithm , which we refer to as Dynamically-Weighted LOCO , is designed to dynamically assess the importance of a collision during optimiza- tion . Compared with the uniform collision penalty in the latent space , the dynamic weighting mechanism has demonstrated drastic improvement over the state-of-the-art latent space based Bayesian optimization models . We summarize our key contributions as follows : I . We investigate latent space based Bayesian optimization , and expose the limitations of existing latent space optimization approaches due to the collision effect on the latent space ( Section 3 ) . II . We propose a novel regularization scheme as a simple plugin amendment for latent space based Bayesian optimization models . Our regularizer penalizes collisions in the latent space and effectively reduces the collision effect . Furthermore , we propose an optimization-aware dynamic weighting mechanism for adjusting the collision penalty to improve the effectiveness of regularization for Bayesian optimization ( Section 4 ) . III . We provide theoretical analysis for the performance of Bayesian optimization on regularized latent space ( Section 5 ) . IV . We conducted an extensive empirical study on several synthetic and real-world datasets , including a real-world case study for cosmic experimental design , and demonstrate the promising empirical performance for our algorithm ( Section 6 ) . 2 RELATED WORK . This section provides a short survey on recent work in Bayesian learning , which was designed to overcome the high-dimensionality challenge for Gaussian process regression tasks and Bayesian optimization . Different surrogate models with internal latent space Some alternative surrogate models have been proposed to replace classical GP in Bayesian optimization to overcome the challenge of highdimensional and highly-structured input in BO . Deep Network for Global Optimization ( DNGO ) Snoek et al . ( 2015 ) uses a pre-trained deep neural network with a Bayesian linear regressor at the last hidden layer of the network as the surrogate model . More generally , Deep Kernel Learning ( DKL ) combines the power of the Gaussian process and neural network by introducing a deep neural network g to learn a mapping g : X → Z from the input domain X to a latent space Z ( Wilson et al. , 2016 ) . It uses the latent representation z ∈ Z as the input of the base Gaussian process . The neural network g and a spectral mixture-based kernel k form a scalable expressive closed-form deep covariance kernel , denoted by kDK ( xi , xj ) → k ( g ( xi ) , g ( xj ) ) . The deep kernel allows end-to-end learning and Bayesian optimization on the original input space . Representation learning and latent space optimization Instead of reducing the dimensionality and performing optimization in an end-to-end process , other methods aim to optimize in a related low-dimensional space first and then map the solution back to the original input space . Djolonga et al . ( 2013 ) assume that only a subset of input dimensions varies , and the kernel is smooth ( i.e . with bounded RKHS norm ) . Under these assumptions , the underlying subspace is learned via low-rank matrix recovery . Random feature is another solution under this setting ( Rahimi et al. , 2007 ; Letham et al. , 2020 ; Binois et al. , 2015 ; Nayebi et al. , 2019 ; Wang et al. , 2016 ) . It is known that a random representation space of sufficiently large dimension is guaranteed to contain the optima with high probability . Mutnỳ and Krause ( 2019 ) consider Quadrature Fourier Features ( QFF ) —as opposed to Random Fourier Feature ( RFF ) in Rahimi et al . ( 2007 ) —to overcome the variance starvation problem , and proved that Thompson sampling and GP-UCB achieve no-regret with squared exponential kernel in optimization tasks . However , both RFF and QFF methods rely on a key assumption that the function to be optimized has a low effective dimension . In contrast , as discussed in Section 6 and the supplemental materials , we show that LOCO performs well for challenging high-dimensional BO problems where algorithms relying on the low effective dimension assumption may fail . Another line of work on latent space optimization uses autoencoders to learn low-dimensional representations of the inputs to improve the scalability and capability to leverage the structural information ( Mathieu et al. , 2019 ) , ( Ding et al. , 2020 ) , ( Gómez-Bombarelli et al. , 2018 ; Huang et al. , 2015 ; Tripp et al. , 2020 ; Lu et al. , 2018 ) . Mathieu et al . ( 2019 ) , Ding et al . ( 2020 ) focus on disentangled representation learning that breaks down , or disentangles , each feature into narrowly defined variables and encodes them as separate dimensions.Tripp et al . ( 2020 ) iteratively train the autoencoder with a dynamic weighting scheme when performing optimization to improve the embedding . Griffiths and Hernández-Lobato ( 2020 ) and Letham et al . ( 2020 ) enforce certain properties on the representation space to improve the optimization performance . To the best of the authors ’ knowledge , collision of the embeddings has not been explicitly studied . Binois et al . ( 2015 ) propose a warped kernel to guarantee the injectivity in the random linear embedding , which is not applicable in neural network-based methods . A common challenge in applying these techniques to generic optimization tasks lies in the assumption on the accessibility of training data : Bayesian optimization often assumes limited access to labeled data , while surrogate models built on deep neural networks often rely on abundant access to data for pretraining . Another problem lies in the training objective : During the training phase , these surrogate models typically focus on improving the regression performance , and do not explicitly address the artifact caused by collisions of the learned embeddings , which—as we later demonstrate in Section 3.3—could be harmful to sequential decision-making tasks . | This paper is concerned with latent space Bayesian optimisation that typically involves a step of learning a lower-dimensional latent representation. The authors focus on non-linear embeddings generated through neural networks. They observe a collision problem in the latent space and attempt to resolve it by introducing a regulariser based on Lipschitz continuity. In a set of experiments, they demonstrate that such a method is effective in various benchmarks. Although interesting, I still find this paper lacking as presented in the next section. | SP:ec387dc36bcda590bbe0a3cf735b83b49616da3e |
Concurrent Adversarial Learning for Large-Batch Training | 1 INTRODUCTION . With larger datasets and bigger models proposed , training neural networks has become quite timeconsuming . For instance , training BERT ( Devlin et al. , 2019 ) takes 3 days on 16 v3 TPUs . GPT-2 ( Radford et al. , 2019 ) contains 1,542M parameters and requires 168 hours of training on 16 v3 TPU chips . This also leads to the developments of high performance computing clusters . For example , Google and NVIDIA build high performance clusters with thousands of TPU or GPU chips . How to fully utilize those computing resources for machine learning training thus becomes an important problem . Data parallelism is a commonly used technique for distributed neural network training , where each processor computes the gradient of a local batch and the gradients across processors are aggregated at each iteration for a parameter update . Training with hundreds or thousands of processors with data parallelism is thus equivalent to running a stochastic gradient optimizer ( e.g. , SGD or Adam ) with a very large batch size , also known as large batch training . For example , Google and NVIDIA showed that by increasing the batch size to 64k on ImageNet , they can finish 90-epoch ResNet training within one minute ( Kumar et al. , 2021 ; Mattson et al. , 2019 ) . But why can ’ t we infinitely increase the batch size as long as more computing resources are available ? Large batch training often faces two challenges . First , under a fixed number of training epochs , increasing the batch size implies reducing number of training iterations . Even worse , it has been observed that large-batch training often converges to solutions with bad generalization performance ( also known as sharp local minima ) , possibly due to the lack of inherent noise in each stochastic gradient update . Although this problem can be partially mitigated by using different optimizers such as LARS ( You et al. , 2017 ) and LAMB ( You et al. , 2019 ) , the limit of batch size still exists . For instance , Google utilizes several techniques , such as distributed batch normalization and Mixedprecision training , to further scale the traing of ResNet-50 on 4096 v3 TPU chips . However , it can just expand the batch size to 64k ( Kumar et al. , 2021 ; Ying et al. , 2018 ) . Data augmentation has become an indispensable component of large-batch training pipeline . For instance , researchers at Facebook use augmentation to scale the training of ResNet-50 to 256 NVIDIA P100 GPUs with a batch size of 8k on ImageNet ( Goyal et al. , 2017 ) . You et al . also use data augmentation to expand the batch size to 32k on 2048 KNL nodes ( You et al. , 2018 ) . However , in this paper we find that when batch size is large enough ( i.e. , larger than 32k ) , the increased diversity in augmented data will also increase the difficulty of training and even have a negative impact on test accuracy . This motivates us to study the application of adversarial training in large-batch training . Adversarial training methods find a perturbation within a bounded set around each sample to train the model . Previous work finds the adversarial training would lead to a significant decrease in the curvature of the loss surface and make the network more ” linear ” in the small batch size case , which could be used as a way to improve generalization ( Xie et al. , 2020 ; Moosavi-Dezfooli et al. , 2019 ) . However , adversarial training has not been used in large-batch training since it requires a series of sequential gradient computations within each update to find an adversarial example . Even when conducting only 1 gradient ascent for finding adversarial examples , adversarial training requires 2 sequential gradient computations ( one for adversarial example and one for weight update ) that can not be parallelized . Therefore , even with infinite computing resources , adversarial training is at least 2 times slower than standard training and increasing the batch size can not compensate for that . To resolve this issue and make adversarial training applicable for large-batch training , we propose a novel Concurrent Adversarial Learning ( ConAdv ) algorithm for large-batch training . We show that by allowing the computation of adversarial examples using staled weights , the two sequential gradient computations in adversarial training can be decoupled , leading to fully parallelized computations at each step . As a result , extra processors can be fully utilized to achieve the same iteration throughput as original SGD or Adam optimizers . Comprehensive experimental results on large-batch training demonstrate that ConAdv is a better choice than existing augmentations . Our main contributions are listed below : • This is the first work showing adversarial learning can significantly increase the batch size limit of large-batch training without using data augmentation . • The proposed algorithm , ConvAdv , can successfully decouple the two sequential gradient computations in adversarial training and make them parallelizable . This makes adversarial training achieve similar efficiency with standard stochastic optimizers when using sufficient computing resources . Furthermore , we empirically show that ConAdv achieves almost identical performance as the original adversarial training . We also provide a theoretical analysis on ConAdv . • Comprehensive experimental studies demonstrate that the proposed method can push the limit of large batch training on various tasks . For ResNet-50 training on ImageNet , ConAdv alone achieves 75.3 % accuracy when using 96K batch size . Further , the accuracy will rise to 76.2 % when combined with data augmentation . This is the first method scaling ResNet-50 batch size to 96K with accuracy matching the MLPerf standard ( 75.9 % ) , while previous methods fail to scale beyond 64K batch size . 2 BACKGROUND . 2.1 LARGE-BATCH TRAINING . Using data parallelism with SGD naturally leads to large-batch training on distributed systems . However , it was shown that extremely large batch is difficult to converge and has a generalization gap ( Keskar et al. , 2017 ; Hoffer et al. , 2017 ) . Therefore , related work start to carefully fine-tune the hyper-parameters to bridge the gap , such as learning rate , momentum ( You et al. , 2018 ; Goyal et al. , 2017 ; Li , 2017 ; Shallue et al. , 2018 ) . Goyal et al . try to narrow the generalization gap with the heuristics of learning rate scaling ( Goyal et al. , 2017 ) . However , there is still big room to increase the batch size . Several recent works try to use adaptive learning rate to reduce the fine-tuning of hyper-parameters and further scaling the batch size to larger value ( You et al. , 2018 ; Iandola et al. , 2016 ; Codreanu et al. , 2017 ; Akiba et al. , 2017 ; Jia et al. , 2018 ; Smith et al. , 2017 ; Martens & Grosse , 2015 ; Devarakonda et al. , 2017 ; Osawa et al. , 2018 ; You et al. , 2019 ; Yamazaki et al. , 2019 ) . You et al . propose Layer-wise Adaptive Rate Scaling ( LARS ) ( You et al. , 2017 ) for better optimization and scaling to the batch size of 32k without performance penalty on ImageNet . Ying et al . use LARS optimizer to train ResNet-50 on TPU Pods in 2.2 minutes . In addition , related work also try to bridge the gap from aspect of augmentation . Goyal et al . use data augmentation to further scale the training of ResNet-50 on ImageNet ( Goyal et al. , 2017 ) . Yao et al . propose an adaptive batch size method based on Hessian information to gradually increase batch size during training and use vanilla adversarial training to regularize against the sharp minima Yao et al . ( 2018a ) . However , the process of adversarial training is time consuming and they just use the batch size of 16k in the second half of training process ( the initial batch size is 256 ) . How to further accelerate the training process based on adversarial training and reduce its computational burden is still an open problem . 2.2 ADVERSARIAL LEARNING . Adversarial training has shown great success on improving the model robustness through collecting adversarial examples and injecting them into training data Goodfellow et al . ( 2015 ) ; Papernot et al . ( 2016 ) ; Wang et al . ( 2019 ) . Madry et al . ( 2017 ) formulates it into a min-max optimization framework as follows : min θ E ( xi , yi ) ∼D [ max||δ||p∈ L ( θt , x+ δ , y ) ] , ( 1 ) where D = { ( xi , yi ) } ni=1 denotes training samples and xi ∈ Rd , yi ∈ { 1 , ... , Z } , δ is the adversarial perturbation , || · ||p denotes some Lp-norm distance metric , θt is the parameters of time t and Z is the number of classes . Goodfellow et al . proposes FGSM to collect adversarial data Goodfellow et al . ( 2015 ) , which performs a one-step update along the gradient direction ( the sign ) of the loss function . Project Gradient Descent ( PGD ) algorithm Madry et al . ( 2017 ) firstly carries out random initial search in the allowable range ( spherical noise region ) near the original input , and then iterates FGSM several times to generate adversarial examples . Recently , several papers Shafahi et al . ( 2019 ) ; Wong et al . ( 2020 ) ; Andriushchenko & Flammarion ( 2020 ) aim to improve the computation overhead brought by adversarial training . Specifically , FreeAdv Shafahi et al . ( 2019 ) tries to update both weight parameter θ and adversarial example x at the same time by exploiting the correlation between the gradient to the input and to the model weights . Similar to Free-adv , Zhang et al . Zhang et al . ( 2019 ) further restrict most of the forward and back propagation within the first layer to speedup computation . FastAdv Wong et al . ( 2020 ) finds the overhead could be further reduced by using single-step FGSM with random initialization . While these work aim to improve the efficiency of adversarial training , they still require at least two sequential gradient computations for every step . Our concurrent framework could decouple the two sequential gradient computation to further boost the efficiently , which is more suitable for large-batch training . Recently , several works Xie et al . ( 2020 ) ; Cheng et al . ( 2021 ) ; Chen et al . ( 2021 ) show that the adversarial example can serve as an augmentation to benefit the clean accuracy in the small batch size setting . However , whether adversarial training can improve the performance of large-batch training is still an open problem . 2.3 MLPERF . MLPerf Mattson et al . ( 2019 ) is an industry-standard performance benchmark for machine learning , which aims to fairly evaluate system performance . Currently , it includes several representative tasks from major ML areas , such as vision , language , recommendation . In this paper , we use ResNet-50 He et al . ( 2016 ) as our baseline model and the convergence baseline is 75.9 % accuracy on ImageNet . 3 PROPOSED ALGORITHM . In this section , we introduce our enlightening findings and the proposed algorithm . We first study the limitation of data augmentation in large-batch training . Then we discuss the bottleneck of adversarial training in distributed system and propose a novel Concurrent Adversarial Learning ( ConAdv ) method for large-batch training . | This paper presents a simple algorithm named ConAdv to incorporate adversarial training into the large-batch training setting such that one can further increase the batch size without harming too much accuracy while maintaining the high utilization of the hardware. The core idea is to use adversarial training to improve the accuracy for large batch training and at the same time use stale weights to allow parallel computation of the adversarial example and the normal gradient updates. With his simple yet novel approach, the paper has demonstrated good performance on ImageNet with batch size as large as 96k while maintaining the accuracy above MLPerf's 75.9. | SP:d203a332170f0f196a66a40e4b23ac99e07aeb7f |
Concurrent Adversarial Learning for Large-Batch Training | 1 INTRODUCTION . With larger datasets and bigger models proposed , training neural networks has become quite timeconsuming . For instance , training BERT ( Devlin et al. , 2019 ) takes 3 days on 16 v3 TPUs . GPT-2 ( Radford et al. , 2019 ) contains 1,542M parameters and requires 168 hours of training on 16 v3 TPU chips . This also leads to the developments of high performance computing clusters . For example , Google and NVIDIA build high performance clusters with thousands of TPU or GPU chips . How to fully utilize those computing resources for machine learning training thus becomes an important problem . Data parallelism is a commonly used technique for distributed neural network training , where each processor computes the gradient of a local batch and the gradients across processors are aggregated at each iteration for a parameter update . Training with hundreds or thousands of processors with data parallelism is thus equivalent to running a stochastic gradient optimizer ( e.g. , SGD or Adam ) with a very large batch size , also known as large batch training . For example , Google and NVIDIA showed that by increasing the batch size to 64k on ImageNet , they can finish 90-epoch ResNet training within one minute ( Kumar et al. , 2021 ; Mattson et al. , 2019 ) . But why can ’ t we infinitely increase the batch size as long as more computing resources are available ? Large batch training often faces two challenges . First , under a fixed number of training epochs , increasing the batch size implies reducing number of training iterations . Even worse , it has been observed that large-batch training often converges to solutions with bad generalization performance ( also known as sharp local minima ) , possibly due to the lack of inherent noise in each stochastic gradient update . Although this problem can be partially mitigated by using different optimizers such as LARS ( You et al. , 2017 ) and LAMB ( You et al. , 2019 ) , the limit of batch size still exists . For instance , Google utilizes several techniques , such as distributed batch normalization and Mixedprecision training , to further scale the traing of ResNet-50 on 4096 v3 TPU chips . However , it can just expand the batch size to 64k ( Kumar et al. , 2021 ; Ying et al. , 2018 ) . Data augmentation has become an indispensable component of large-batch training pipeline . For instance , researchers at Facebook use augmentation to scale the training of ResNet-50 to 256 NVIDIA P100 GPUs with a batch size of 8k on ImageNet ( Goyal et al. , 2017 ) . You et al . also use data augmentation to expand the batch size to 32k on 2048 KNL nodes ( You et al. , 2018 ) . However , in this paper we find that when batch size is large enough ( i.e. , larger than 32k ) , the increased diversity in augmented data will also increase the difficulty of training and even have a negative impact on test accuracy . This motivates us to study the application of adversarial training in large-batch training . Adversarial training methods find a perturbation within a bounded set around each sample to train the model . Previous work finds the adversarial training would lead to a significant decrease in the curvature of the loss surface and make the network more ” linear ” in the small batch size case , which could be used as a way to improve generalization ( Xie et al. , 2020 ; Moosavi-Dezfooli et al. , 2019 ) . However , adversarial training has not been used in large-batch training since it requires a series of sequential gradient computations within each update to find an adversarial example . Even when conducting only 1 gradient ascent for finding adversarial examples , adversarial training requires 2 sequential gradient computations ( one for adversarial example and one for weight update ) that can not be parallelized . Therefore , even with infinite computing resources , adversarial training is at least 2 times slower than standard training and increasing the batch size can not compensate for that . To resolve this issue and make adversarial training applicable for large-batch training , we propose a novel Concurrent Adversarial Learning ( ConAdv ) algorithm for large-batch training . We show that by allowing the computation of adversarial examples using staled weights , the two sequential gradient computations in adversarial training can be decoupled , leading to fully parallelized computations at each step . As a result , extra processors can be fully utilized to achieve the same iteration throughput as original SGD or Adam optimizers . Comprehensive experimental results on large-batch training demonstrate that ConAdv is a better choice than existing augmentations . Our main contributions are listed below : • This is the first work showing adversarial learning can significantly increase the batch size limit of large-batch training without using data augmentation . • The proposed algorithm , ConvAdv , can successfully decouple the two sequential gradient computations in adversarial training and make them parallelizable . This makes adversarial training achieve similar efficiency with standard stochastic optimizers when using sufficient computing resources . Furthermore , we empirically show that ConAdv achieves almost identical performance as the original adversarial training . We also provide a theoretical analysis on ConAdv . • Comprehensive experimental studies demonstrate that the proposed method can push the limit of large batch training on various tasks . For ResNet-50 training on ImageNet , ConAdv alone achieves 75.3 % accuracy when using 96K batch size . Further , the accuracy will rise to 76.2 % when combined with data augmentation . This is the first method scaling ResNet-50 batch size to 96K with accuracy matching the MLPerf standard ( 75.9 % ) , while previous methods fail to scale beyond 64K batch size . 2 BACKGROUND . 2.1 LARGE-BATCH TRAINING . Using data parallelism with SGD naturally leads to large-batch training on distributed systems . However , it was shown that extremely large batch is difficult to converge and has a generalization gap ( Keskar et al. , 2017 ; Hoffer et al. , 2017 ) . Therefore , related work start to carefully fine-tune the hyper-parameters to bridge the gap , such as learning rate , momentum ( You et al. , 2018 ; Goyal et al. , 2017 ; Li , 2017 ; Shallue et al. , 2018 ) . Goyal et al . try to narrow the generalization gap with the heuristics of learning rate scaling ( Goyal et al. , 2017 ) . However , there is still big room to increase the batch size . Several recent works try to use adaptive learning rate to reduce the fine-tuning of hyper-parameters and further scaling the batch size to larger value ( You et al. , 2018 ; Iandola et al. , 2016 ; Codreanu et al. , 2017 ; Akiba et al. , 2017 ; Jia et al. , 2018 ; Smith et al. , 2017 ; Martens & Grosse , 2015 ; Devarakonda et al. , 2017 ; Osawa et al. , 2018 ; You et al. , 2019 ; Yamazaki et al. , 2019 ) . You et al . propose Layer-wise Adaptive Rate Scaling ( LARS ) ( You et al. , 2017 ) for better optimization and scaling to the batch size of 32k without performance penalty on ImageNet . Ying et al . use LARS optimizer to train ResNet-50 on TPU Pods in 2.2 minutes . In addition , related work also try to bridge the gap from aspect of augmentation . Goyal et al . use data augmentation to further scale the training of ResNet-50 on ImageNet ( Goyal et al. , 2017 ) . Yao et al . propose an adaptive batch size method based on Hessian information to gradually increase batch size during training and use vanilla adversarial training to regularize against the sharp minima Yao et al . ( 2018a ) . However , the process of adversarial training is time consuming and they just use the batch size of 16k in the second half of training process ( the initial batch size is 256 ) . How to further accelerate the training process based on adversarial training and reduce its computational burden is still an open problem . 2.2 ADVERSARIAL LEARNING . Adversarial training has shown great success on improving the model robustness through collecting adversarial examples and injecting them into training data Goodfellow et al . ( 2015 ) ; Papernot et al . ( 2016 ) ; Wang et al . ( 2019 ) . Madry et al . ( 2017 ) formulates it into a min-max optimization framework as follows : min θ E ( xi , yi ) ∼D [ max||δ||p∈ L ( θt , x+ δ , y ) ] , ( 1 ) where D = { ( xi , yi ) } ni=1 denotes training samples and xi ∈ Rd , yi ∈ { 1 , ... , Z } , δ is the adversarial perturbation , || · ||p denotes some Lp-norm distance metric , θt is the parameters of time t and Z is the number of classes . Goodfellow et al . proposes FGSM to collect adversarial data Goodfellow et al . ( 2015 ) , which performs a one-step update along the gradient direction ( the sign ) of the loss function . Project Gradient Descent ( PGD ) algorithm Madry et al . ( 2017 ) firstly carries out random initial search in the allowable range ( spherical noise region ) near the original input , and then iterates FGSM several times to generate adversarial examples . Recently , several papers Shafahi et al . ( 2019 ) ; Wong et al . ( 2020 ) ; Andriushchenko & Flammarion ( 2020 ) aim to improve the computation overhead brought by adversarial training . Specifically , FreeAdv Shafahi et al . ( 2019 ) tries to update both weight parameter θ and adversarial example x at the same time by exploiting the correlation between the gradient to the input and to the model weights . Similar to Free-adv , Zhang et al . Zhang et al . ( 2019 ) further restrict most of the forward and back propagation within the first layer to speedup computation . FastAdv Wong et al . ( 2020 ) finds the overhead could be further reduced by using single-step FGSM with random initialization . While these work aim to improve the efficiency of adversarial training , they still require at least two sequential gradient computations for every step . Our concurrent framework could decouple the two sequential gradient computation to further boost the efficiently , which is more suitable for large-batch training . Recently , several works Xie et al . ( 2020 ) ; Cheng et al . ( 2021 ) ; Chen et al . ( 2021 ) show that the adversarial example can serve as an augmentation to benefit the clean accuracy in the small batch size setting . However , whether adversarial training can improve the performance of large-batch training is still an open problem . 2.3 MLPERF . MLPerf Mattson et al . ( 2019 ) is an industry-standard performance benchmark for machine learning , which aims to fairly evaluate system performance . Currently , it includes several representative tasks from major ML areas , such as vision , language , recommendation . In this paper , we use ResNet-50 He et al . ( 2016 ) as our baseline model and the convergence baseline is 75.9 % accuracy on ImageNet . 3 PROPOSED ALGORITHM . In this section , we introduce our enlightening findings and the proposed algorithm . We first study the limitation of data augmentation in large-batch training . Then we discuss the bottleneck of adversarial training in distributed system and propose a novel Concurrent Adversarial Learning ( ConAdv ) method for large-batch training . | This manuscript empirically show that adversarial training in large-batch training scenario has better performance than traditional data augmentation. And furthermore, the authors proposed a simple method to conduct adversarial example generation and gradient computation w.r.t. to weights concurrently to accelerate the adversarial training in distributed setting. The key strategy is to use staled weights to generate adversarial examples, and then decoupled the bi-level optimization. | SP:d203a332170f0f196a66a40e4b23ac99e07aeb7f |
Source-Target Unified Knowledge Distillation for Memory-Efficient Federated Domain Adaptation on Edge Devices | To conduct local inference on edge devices , it is necessary to deploy compact machine learning models on such devices . When such a compact model is applied to a new environment , its inference accuracy can be degradedif the target data from the new environment have a different distribution fromthe source data used for model training . To ensure high inference accuracy in thenew environment , it is indispensable to adapt the compact model to the target data . However , to protect users ’ privacy , the target data can not be sent to a centralized server for joint training with the source data . Furthermore , utilizing the target data to directly train the compact model can not achieve sufficient inferenceaccuracy due to its low model capacity . To this end , a scheme called source-target unified knowledge distillation ( STU-KD ) is developed in this paper . It first adapts a large source model to the target data on the edge device , and a large targetmodel is obtained . The knowledge of the large target model is then transferred to the compact model via knowledge distillation . Since training the large modelleads to large memory consumption , a domain adaptation method called lite residual hypothesis transfer is designed to achieve memory-efficient adaptation to the targe data on the edge device . Moreover , to prevent the compact model from forgetting the knowledge of the source data during knowledge distillation , a collabor tive knowledge distillation ( Co-KD ) method is developed to unify the source data on the server and the target data on the edge device to train the compact model.STU-KD can be easily integrated with secure aggregation so that the server can not obtain the true model parameters of the compact model . Extensive experiments co ducted upon several tasks of object recognition show that STU-KD can improve the inference accuracy by up to14.7 % , as compared to the state-of-the-art schemes . The results also reveal that the inference accuracy of the compact modelis not impacted by incorporating secure aggregation into STU-KD . 1 INTRODUCTION . Many computer vision ( CV ) applications , such as mobile robots , require local inference on edge devices because of the requirements on data privacy and low latency . To enable local inference on edge devices , it is necessary to deploy compact machine learning models on such devices . For example , considering an edge computing device Jetson Nano with 472 GFLOPS GPU and 4 GB memory space1 , which is commonly used for image recognition , a ResNet-18 model ( He et al. , 2016 ) is preferred over a ResNet-50 model , as the inference time of the former case ( 26 ms ) is much smaller than the latter one ( 64 ms ) ( Yang et al. , 2020 ) . Such compact machine learning models can be obtained by manual design based on experts ’ experience ( Sandler et al. , 2018 ; Howard et al. , 2019 ; Lin et al. , 2020 ) or by some automated machine learning ( AutoML ) techniques , e.g. , network compression ( Ning et al. , 2020 ; Li et al. , 2020b ) and neural architecturesearch ( He et al. , 2018 ; Liu et al. , 2019 ) . When an edge device with a compact model works in a new environment , the unlabeled target data collected from the new environment can have a different distribution from the labeled source data that are used to train the compact model , i.e. , domain shift ( Gretton et al. , 2009 ) occurs . Con- 1https : //developer.nvidia.com/embedded/jetson-nano-developer-kit sequently , the compact model suffers low inference accuracy on the target data . To ensure high inference accuracy in the new environment , it is necessary to adapt the compact model to the target data . A typical approach is to send the target data to a cloud server where the model is trained via unsupervised domain adaptation ( UDA ) ( e.g. , the methods inKang et al . ( 2019 ) ; Tang & Jia ( 2020 ) ; Xu et al . ( 2020 ) ) and then deployed back to the device . However , it leads to loss of data privacy . To avoid this issue , another type of approach is to train the compact model locally over the target data via UDA methods . It is doable on an edge device . For example , training ResNet-18 with batch size48 consumes nearly172 GFLOPs and1.1 GB memory space per batch , which is affordable for Jetson Nano . However , this type of approach can not achieve hgh inference accuracy on the target data due to limited model capacity of the compact model . To this end , a scheme called source-target unified knowledgedistillation ( STU-KD ) is developed in this paper . The key idea is to utilize a large model with sufficient model capacity to learn fine-grained representations of the target data , and then transfer its knowledge to the compact model . As shown in step 1 in Figure 1 , a large source model is loaded on the edgedevice and is then adapted to the target data to obtain a large target model . The challenges ofthis step are two-fold . First , the target data are unlabeled , so the fine-grained representations canot be learned via supervised learning . As a result , unsupervised domain adaptation ( UDA ) is needed instep 1 . Second , the edge device does not have the source data , since the volume of the source data can be too large to be stored on the edge device , or the source data can not be exposed to the edge devicue to confidentiality of these data . Without the source data , many UDA methods ( Kang et al. , 2019 ; Tang & Jia , 2020 ; Xu et al. , 2020 ) are not applicable for the adaptation of the large source model . Thus , source-free UDA methods ( Li et al. , 2020a ; Liang et al. , 2020 ; Liu et al. , 2021 ) must beemployed . However , existing sourcefree UDA methods , e.g. , source hypothesis transfer ( SHOT ) ( Liang et al. , 2020 ) , require retraining of the large source model , which leads to large memory consumption on the edge device . For example , if ResNet-50 is retrained with batch size48 on Jetson Nano , the computational cost is nearly 364 GFLOPs , which is affordable for Jetson Nano . However , the memory consumption per batch is nearly5 GB , exceeding the4 GB memory space limit of Jetson Nano . To tackle the challenges in step 1 of STU-KD , a memory-efficient UDA method called literesidual hypothesis transfer ( LRHT ) is designed by enhancing the architecture of a source-free UDA method such as SHOT . More specifically , the same loss function as that of SHOT is adopted , so unsupervised learning can be conducted with unlabeled target data . However , the featureextractor in SHOT must be replaced with a new architecture that can be trained in a memory-efficint manner . Thus , the new architecture is designed by adding lite residual ( LR ) modules ( Cai et al.,2020 ) to the feature extractor such that its outputs can be fine-tuned by training the LR modules only while keeping the parameters of the feature extractor fixed . As a result , in LRHT the training process of the large source model involves neither the feature extractor nor the classifier . Since training the LR modules generates a much smaller volume of activations and demands much lower memory fotprint , the training process of the large target model is highly memory-efficient . In other words , by using LRHT the large source model can be adapted to the target data to obtain a large target model in a memory-efficient manner . In step 2 of STU-KD ( in Figure 1 ) , the large target model is utilized to generate soft labels for the target data . The knowledge of the target data is then transferred to the compact model by training it over the target data and the soft labels via knowledge distillation ( KD ) ( Hinton et al. , 2015 ) . However , no source data are involved in the KD process , leading to the compact model gradually forgetting the the knowledge of the source data , i.e. , catastrophic forgetting ( McCloskey & Cohen , 1989 ) occurs . As a result , when the edge device encounters data from the source domain after the KD process , the compact model can suffer low inference accury . For example , consider a mobile robot whose compact model is trained via the above KD process . When it moves to an environment similar to that of the source domain , its compact model can not recognize the objects in that environment with a high accuracy . To avoid catastrophic forgetting , it is necessary to train the compact model considering both the target data and the source data . Thus , a collaborative knowledge distillation ( Co-KD ) method is designed as follows . On the edgeevice , a compact model is trained over the target data and the soft labels via KD . On the server , another compact model is trained over the source data via supervised learning . The challengehere is how to consolidate these two compact models into a global compact model . The setting of this c allenging problem is similar to that of federated learning ( FL ) ( McMahan et al. , 2017 ) . However , there exists one major difference . FL requires that different nodes have the same type of loss functions , while Co-KD has to use the cross-entropy loss on the server and the loss function of KD ( i.e. , Kullback–Leibler ( KL ) divergence in the state-of-the-art methods ) on the edge device . Due to such a difference , existing FL algorithms ( e.g. , McMahan et al . ( 2017 ) ; Karimireddy et al . ( 2020 ) ) arenot effective for consolidating the compact models in Co-KD . To this end , an alternating direction method of multipliers ( ADMM ) based learning algorithm is designed for Co-KD to consolidate thecompact model on the edge device and that on the server , as shown in step 2 in Figure 1 . More specifically , the training process of the global compact model is formulated into a consensus problemover the edge device and the server . The consensus problem is then divided into two subproblems by ADMM . The edge device trains its compact model by iteratively solving the subproblem related to the target data , and the server trains its compact model by iteratively solving the subproblem relat d to the source data . In the second step of STU-KD , the edge device needs to upload the parameters of the compact model to the server . It is possible for the server to recover some information of the target data from these parameters ( Zhu et al. , 2019 ) . To ensure privacy of the target data , secure aggregation ( Bonawitz et al. , 2017 ) is adopted in STU-KD so that the server can not obtain the true parameters of the compact model . Extensive experiments are conducted to evaluate the performance of STU-KD . The results show that STU-KD increases the compact model ’ s inference accuracy onthe target data by up to14.7 % while maintaining high inference accuracy on the source data , as compared to the state-of-art methods . Moreover , after employing secure aggregation , the performance of STU-KD is not affected . | This paper considers a new and complex setting involving domain adaptation, federated learning, and knowledge distillation: Under the premise of protecting privacy, one needs to deploy a compact model from a source central server to target client devices and requires the model to learn new knowledge with target unlabeled client data while remembering knowledge of source data on the central server. Generally, the authors propose a source-target unified knowledge distillation scheme. Within this scheme, the authors propose solutions to tackle corresponding difficulties with this setting. Specifically, to avoid the low inference accuracy due to low model capacity, a large source central model is adapted to target clients with SHOT (ICML'20). A lite-residual hypothesis transfer method is proposed to keep memory-efficient adaptation on target clients. A collaborative knowledge distillation method is proposed to defy catastrophic forgetting of source knowledge. To protect the privacy of target clients, a secure aggregation method is used. The authors validate the effectiveness of the proposed scheme on three domain adaptation datasets. | SP:792688942b9ebce1d30ed067109066ebeaf1236a |
Source-Target Unified Knowledge Distillation for Memory-Efficient Federated Domain Adaptation on Edge Devices | To conduct local inference on edge devices , it is necessary to deploy compact machine learning models on such devices . When such a compact model is applied to a new environment , its inference accuracy can be degradedif the target data from the new environment have a different distribution fromthe source data used for model training . To ensure high inference accuracy in thenew environment , it is indispensable to adapt the compact model to the target data . However , to protect users ’ privacy , the target data can not be sent to a centralized server for joint training with the source data . Furthermore , utilizing the target data to directly train the compact model can not achieve sufficient inferenceaccuracy due to its low model capacity . To this end , a scheme called source-target unified knowledge distillation ( STU-KD ) is developed in this paper . It first adapts a large source model to the target data on the edge device , and a large targetmodel is obtained . The knowledge of the large target model is then transferred to the compact model via knowledge distillation . Since training the large modelleads to large memory consumption , a domain adaptation method called lite residual hypothesis transfer is designed to achieve memory-efficient adaptation to the targe data on the edge device . Moreover , to prevent the compact model from forgetting the knowledge of the source data during knowledge distillation , a collabor tive knowledge distillation ( Co-KD ) method is developed to unify the source data on the server and the target data on the edge device to train the compact model.STU-KD can be easily integrated with secure aggregation so that the server can not obtain the true model parameters of the compact model . Extensive experiments co ducted upon several tasks of object recognition show that STU-KD can improve the inference accuracy by up to14.7 % , as compared to the state-of-the-art schemes . The results also reveal that the inference accuracy of the compact modelis not impacted by incorporating secure aggregation into STU-KD . 1 INTRODUCTION . Many computer vision ( CV ) applications , such as mobile robots , require local inference on edge devices because of the requirements on data privacy and low latency . To enable local inference on edge devices , it is necessary to deploy compact machine learning models on such devices . For example , considering an edge computing device Jetson Nano with 472 GFLOPS GPU and 4 GB memory space1 , which is commonly used for image recognition , a ResNet-18 model ( He et al. , 2016 ) is preferred over a ResNet-50 model , as the inference time of the former case ( 26 ms ) is much smaller than the latter one ( 64 ms ) ( Yang et al. , 2020 ) . Such compact machine learning models can be obtained by manual design based on experts ’ experience ( Sandler et al. , 2018 ; Howard et al. , 2019 ; Lin et al. , 2020 ) or by some automated machine learning ( AutoML ) techniques , e.g. , network compression ( Ning et al. , 2020 ; Li et al. , 2020b ) and neural architecturesearch ( He et al. , 2018 ; Liu et al. , 2019 ) . When an edge device with a compact model works in a new environment , the unlabeled target data collected from the new environment can have a different distribution from the labeled source data that are used to train the compact model , i.e. , domain shift ( Gretton et al. , 2009 ) occurs . Con- 1https : //developer.nvidia.com/embedded/jetson-nano-developer-kit sequently , the compact model suffers low inference accuracy on the target data . To ensure high inference accuracy in the new environment , it is necessary to adapt the compact model to the target data . A typical approach is to send the target data to a cloud server where the model is trained via unsupervised domain adaptation ( UDA ) ( e.g. , the methods inKang et al . ( 2019 ) ; Tang & Jia ( 2020 ) ; Xu et al . ( 2020 ) ) and then deployed back to the device . However , it leads to loss of data privacy . To avoid this issue , another type of approach is to train the compact model locally over the target data via UDA methods . It is doable on an edge device . For example , training ResNet-18 with batch size48 consumes nearly172 GFLOPs and1.1 GB memory space per batch , which is affordable for Jetson Nano . However , this type of approach can not achieve hgh inference accuracy on the target data due to limited model capacity of the compact model . To this end , a scheme called source-target unified knowledgedistillation ( STU-KD ) is developed in this paper . The key idea is to utilize a large model with sufficient model capacity to learn fine-grained representations of the target data , and then transfer its knowledge to the compact model . As shown in step 1 in Figure 1 , a large source model is loaded on the edgedevice and is then adapted to the target data to obtain a large target model . The challenges ofthis step are two-fold . First , the target data are unlabeled , so the fine-grained representations canot be learned via supervised learning . As a result , unsupervised domain adaptation ( UDA ) is needed instep 1 . Second , the edge device does not have the source data , since the volume of the source data can be too large to be stored on the edge device , or the source data can not be exposed to the edge devicue to confidentiality of these data . Without the source data , many UDA methods ( Kang et al. , 2019 ; Tang & Jia , 2020 ; Xu et al. , 2020 ) are not applicable for the adaptation of the large source model . Thus , source-free UDA methods ( Li et al. , 2020a ; Liang et al. , 2020 ; Liu et al. , 2021 ) must beemployed . However , existing sourcefree UDA methods , e.g. , source hypothesis transfer ( SHOT ) ( Liang et al. , 2020 ) , require retraining of the large source model , which leads to large memory consumption on the edge device . For example , if ResNet-50 is retrained with batch size48 on Jetson Nano , the computational cost is nearly 364 GFLOPs , which is affordable for Jetson Nano . However , the memory consumption per batch is nearly5 GB , exceeding the4 GB memory space limit of Jetson Nano . To tackle the challenges in step 1 of STU-KD , a memory-efficient UDA method called literesidual hypothesis transfer ( LRHT ) is designed by enhancing the architecture of a source-free UDA method such as SHOT . More specifically , the same loss function as that of SHOT is adopted , so unsupervised learning can be conducted with unlabeled target data . However , the featureextractor in SHOT must be replaced with a new architecture that can be trained in a memory-efficint manner . Thus , the new architecture is designed by adding lite residual ( LR ) modules ( Cai et al.,2020 ) to the feature extractor such that its outputs can be fine-tuned by training the LR modules only while keeping the parameters of the feature extractor fixed . As a result , in LRHT the training process of the large source model involves neither the feature extractor nor the classifier . Since training the LR modules generates a much smaller volume of activations and demands much lower memory fotprint , the training process of the large target model is highly memory-efficient . In other words , by using LRHT the large source model can be adapted to the target data to obtain a large target model in a memory-efficient manner . In step 2 of STU-KD ( in Figure 1 ) , the large target model is utilized to generate soft labels for the target data . The knowledge of the target data is then transferred to the compact model by training it over the target data and the soft labels via knowledge distillation ( KD ) ( Hinton et al. , 2015 ) . However , no source data are involved in the KD process , leading to the compact model gradually forgetting the the knowledge of the source data , i.e. , catastrophic forgetting ( McCloskey & Cohen , 1989 ) occurs . As a result , when the edge device encounters data from the source domain after the KD process , the compact model can suffer low inference accury . For example , consider a mobile robot whose compact model is trained via the above KD process . When it moves to an environment similar to that of the source domain , its compact model can not recognize the objects in that environment with a high accuracy . To avoid catastrophic forgetting , it is necessary to train the compact model considering both the target data and the source data . Thus , a collaborative knowledge distillation ( Co-KD ) method is designed as follows . On the edgeevice , a compact model is trained over the target data and the soft labels via KD . On the server , another compact model is trained over the source data via supervised learning . The challengehere is how to consolidate these two compact models into a global compact model . The setting of this c allenging problem is similar to that of federated learning ( FL ) ( McMahan et al. , 2017 ) . However , there exists one major difference . FL requires that different nodes have the same type of loss functions , while Co-KD has to use the cross-entropy loss on the server and the loss function of KD ( i.e. , Kullback–Leibler ( KL ) divergence in the state-of-the-art methods ) on the edge device . Due to such a difference , existing FL algorithms ( e.g. , McMahan et al . ( 2017 ) ; Karimireddy et al . ( 2020 ) ) arenot effective for consolidating the compact models in Co-KD . To this end , an alternating direction method of multipliers ( ADMM ) based learning algorithm is designed for Co-KD to consolidate thecompact model on the edge device and that on the server , as shown in step 2 in Figure 1 . More specifically , the training process of the global compact model is formulated into a consensus problemover the edge device and the server . The consensus problem is then divided into two subproblems by ADMM . The edge device trains its compact model by iteratively solving the subproblem related to the target data , and the server trains its compact model by iteratively solving the subproblem relat d to the source data . In the second step of STU-KD , the edge device needs to upload the parameters of the compact model to the server . It is possible for the server to recover some information of the target data from these parameters ( Zhu et al. , 2019 ) . To ensure privacy of the target data , secure aggregation ( Bonawitz et al. , 2017 ) is adopted in STU-KD so that the server can not obtain the true parameters of the compact model . Extensive experiments are conducted to evaluate the performance of STU-KD . The results show that STU-KD increases the compact model ’ s inference accuracy onthe target data by up to14.7 % while maintaining high inference accuracy on the source data , as compared to the state-of-art methods . Moreover , after employing secure aggregation , the performance of STU-KD is not affected . | A compact model deployed to a device may not work well if this device has a different data distribution. This work proposes to load a large pretrained model onto a device and then adapt it to the target data on the device. As directly training the full large model is too memory-heavy, this work proposes to adapt the large model's knowledge by training only part of its parameters on the local device data. To then transfer global model knowledge to the compact model this work proposes a collaborative knowledge distillation. | SP:792688942b9ebce1d30ed067109066ebeaf1236a |
ShiftAddNAS: Hardware-Inspired Search for More Accurate and Efficient Neural Networks | 1 INTRODUCTION . The unprecedented performance achieved by neural networks ( NNs ) , e.g. , convolutional neural networks ( CNNs ) and Transformers , requires intensive multiplications and thus prohibitive training and inference costs , contradicting the explosive demand for embedding various intelligent functionalities into pervasive resource-constrained edge devices . In response , multiplication-free networks have been proposed to alleviate the prohibitive resource requirements by replacing the costly multiplications with lower-cost operators for boosting hardware efficiency . For example , AdderNet ( Chen et al. , 2020 ) utilizes mere additions to design NNs ; and ShiftAddNet ( You et al. , 2020a ) follows a commonly used hardware practice to re-parameterize NNs with both bitwise shifts and additions . Despite their promising performance in hardware efficiency , multiplication-free NNs in general under-perform their CNN and Transformer counterparts in terms of task accuracy for both computer vision ( CV ) and natural language processing ( NLP ) applications . To marry the best of both worlds , we advocate hybrid multiplication-reduced network architectures that integrate both multiplication-based operators ( e.g. , vanilla convolution ( Krizhevsky et al. , 2012 ) and attention ( Vaswani et al. , 2017 ) ) and multiplication-free operators ( e.g. , shift and add ( You et al. , 2020a ) ) to simultaneously boost task accuracy and efficiency . Thanks to the amazing success of neural architecture search ( NAS ) in automating the process of designing state-of-the-art NNs , it is natural to consider NAS as the design engine of the aforementioned hybrid NNs for various applications and tasks , each often requiring a different performance-efficiency trade-off . However , there still exist a few challenges in leveraging NAS to design the hybrid NNs . First , existing NAS methods mostly consider the search for either efficient CNNs ( Wan et al. , 2020 ) , Transformers ( Chen et al. , 2021b ) , or hybrid CNN-Transformers ( Ding et al. , 2021 ; Li et al. , 2021 ) , and there still is a lack of a seminal work that searches for multiplication-reduced hybrid networks , especially for the hardware-inspired networks that incorporate both bitwise shifts and additions . Second , a hybrid search space could make it more challenging to achieve effective NAS and further aggravate the search burden , due to the enlarged search space imposed by the newly introduced multiplicationfree operators . It is worth noting that existing weight sharing strategies of NAS do not directly apply to the target hybrid search space , because weights of different operators follow heterogeneous distributions , leading to a dilemma of either inefficient search or inconsistent architecture ranking . Specifically , weights in convolutional and adder layers follow Gaussian and Laplacian distributions , respectively , as also highlighted by ( Chen et al. , 2020 ; Xu et al. , 2020 ) . As such , forcing weight sharing among heterogeneous operators could hurt the capacity and thus the achieved accuracy of the resulting NNs , while treating them separately could explode the search space and make it more difficult to achieve effective NAS , i.e. , the dilemma mentioned above . To tackle the aforementioned challenges towards more accurate and efficient NNs , this work makes the following contributions : 1 . We propose a generic NAS framework dubbed ShiftAddNAS , which for the first time can automatically search for efficient hybrid NNs with both superior accuracy and efficiency . Our ShiftAddNAS integrates a hybrid hardware-inspired search space that incorporates both multiplication-based operators ( e.g. , convolution and attention ) and multiplicationfree operators ( e.g. , shift and add ) , and can serve as a play-and-plug module to be applied on top of SOTA NAS works for further boosting their achievable accuracy and efficiency . 2 . We develop a new weight sharing strategy for effective search with hybrid search spaces , which only incurs a negligible overhead when searching for hybrid operators with heterogeneous ( e.g. , Gaussian vs. Laplacian ) weight distributions as compared to the vanilla NAS with merely multiplication-based operators , alleviating the dilemma mentioned above regarding either inefficient search or inconsistent architecture ranking . 3 . We conduct extensive experiments and ablation studies to validate the effectiveness of ShiftAddNAS against state-of-the-art ( SOTA ) works . Results on multiple benchmarks demonstrate the superior accuracy and hardware efficiency of its searched NNs as compared to both ( 1 ) manually designed multiplication-free networks , CNNs , Transformers , and hybrid CNN-Transformers , and ( 2 ) SOTA NAS works , on both CV and NLP tasks . 2 RELATED WORKS . Multiplication-free NNs . Many efficient NNs aim to reduce their intensive multiplications that dominate the time/energy costs . One important trend is to replace the multiplications with lowercost operators : BNNs ( Courbariaux et al. , 2016 ; Juefei-Xu et al. , 2017 ) binarize both the weights and activations and reduce multiplications to merely sign flips at non-negligible accuracy drops ; AdderNets ( Chen et al. , 2020 ; Xu et al. , 2020 ; Wang et al. , 2021b ) fully replace the multiplications with lower-cost additions and further develop an effective backpropagation scheme for efficient AdderNet training ; Shift-based NNs leverage either spatial shift ( Wu et al. , 2018 ) or bit-wise shift operations , e.g. , DeepShift ( Elhoushi et al. , 2021 ) , to reduce the amount of multiplications ; and ShiftAddNet ( You et al. , 2020a ) draws inspirations from efficient hardware designs to reparamatize NNs with mere bitwise shifts and additions . While multiplication-free NNs under-perform their vanilla NN counterparts in terms of achieved accuracy , ShiftAddNAS aims to automatically search for multiplication-reduced NNs that incorporate both multiplication-based and multiplication-free operators for marrying the best of both worlds , i.e. , boosted accuracy and efficiency . Neural architecture search . NAS has achieved an amazing success in automating the design of efficient NN architectures . For searching for CNNs , early works ( Tan & Le , 2019 ; Tan et al. , 2019 ; Howard et al. , 2019 ) adopt reinforcement learning based methods that require a prohibitive search time and computing resources , while recent works ( Liu et al. , 2018 ; Wu et al. , 2019a ; Wan et al. , 2020 ; Yang et al. , 2021 ) utilize differentiable search to greatly improve the search efficiency . More recently , SOTA works adopt one-shot NAS ( Guo et al. , 2020 ; Cai et al. , 2019 ; Yu et al. , 2020 ; Wang et al. , 2021a ) to decouple the architecture search from supernet training and then evaluates the performance of sub-networks whose weights are directly inherited from the pretrained supernet . For searching for Transformers , recently emerging works ( Wang et al. , 2020a ; Su et al. , 2021 ; Chen et al. , 2021b ; a ) adopt one-shot NAS and an evolutionary algorithm to search for optimal Transformer architectures for both NLP and CV tasks . Additionally , BossNAS ( Li et al. , 2021 ) and HR-NAS ( Ding et al. , 2021 ) further search for hybrid CNN-Transformer architectures . Nevertheless , little effort has been made to exploring NAS methods especially their search strategies for multiplication-reduced NNs that incorporate both multiplication-based and multiplication-free operations . Furthermore , it is not clear whether existing efficient NAS methods are applicable to searching for such multiplication-reduced NNs . Specifically , prior weight sharing strategies may not work since weights and activations in CNNs and AdderNets follow a different distribution ( Chen et al. , 2020 ) . As such , it is highly desirable to develop NAS methods , e.g. , ShiftAddNAS , dedicated for hardware-inspired multiplication-reduced NNs to increase achievable accuracy and efficiency . Transformers . Transformers ( Vaswani et al. , 2017 ) were first proposed for NLP tasks , which has inspired many interesting works . Some advance Transformer design by improving the attention mechanism ( Chen et al. , 2018 ) , training deeper Transformers ( Wang et al. , 2019 ) , and replacing the attention with convolutional modules ( Wu et al. , 2019b ) ; and others strive to reduce Transformers ’ computational complexity by adopting sparse attention mechanisms ( Zaheer et al. , 2020 ) , low-rank approximation ( Wang et al. , 2020b ) , or compression techniques ( Wu et al. , 2020 ) . Recently , there has been a growing interest in developing Transformers for CV tasks : Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2021 ) for the first time successfully applies pure Transformers to image classification and achieves SOTA task accuracy , which yet relies on pretraining on giant datasets ( Hinton et al. , 2015 ) ; following works including DeiT ( Touvron et al. , 2021 ) T2T-ViT ( Yuan et al. , 2021 ) develop new training recipes and tokenization schemes , for achieving comparable accuracy without the necessity of costly pretraining ; and another trend is to incorporate CNN modules into Transformer architectures for better accuracy and efficiency tradeoffs ( Wu et al. , 2021 ; Xiao et al. , 2021 ; Graham et al. , 2021 ) . In contrast , we advocate hybrid multiplication-reduced NNs and develop an automated search framework that can automatically search for such hardware inspired hybrid models . 3 THE PROPOSED SHIFTADDNAS FRAMEWORK . In this section , we first introduce the hybrid search space from both algorithmic and hardware costs perspectives , providing high-level background and justification for motivating ShiftAddNAS ; Sec . 3.2 elaborates the one-shot search method of ShiftAddNAS by first analyzing the dilemma of either inefficient search or inconsistent architecture ranking and then introducing the proposed novel heterogeneous weight sharing strategy tackling the aforementioned dilemma . 3.1 SHIFTADDNAS : HYBRID SEARCH SPACE . Candidate blocks . The first step of developing ShiftAddNAS is to construct a hybrid search space incorporating suitable building blocks that exhibit various performance-efficiency trade-offs . Specifically , we hypothesize that integrating both multiplication-based and multiplication-free blocks into the search space could lead to both boosted accuracy and efficiency , and consider blocks from two trends of designing NNs : ( 1 ) capable NNs , e.g. , vanilla CNNs and Transformers , leverage either convolutions ( Conv ) or multi-head self-attentions ( Attn ) that comprise of intensive multiplications to capture local or global correlations , achieving a SOTA accuracy in both CV and NLP tasks ; and ( 2 ) efficient multiplication-free NNs , e.g , ShiftAddNet , draw inspirations from hardware design practices to incorporate two efficient and complementary blocks , i.e. , coarse-grained Shift and fine-grained Add , for favoring hardware efficiency , while maintaining a decent accuracy . While our constructed general hybrid search space for both NLP and CV tasks are shown in Fig . 2 , we next analyze the building blocks from both algorithmic and hardware costs perspectives . • Attn is a core component of Transformers ( Vaswani et al. , 2017 ) , which consists of a number of heads H with each capturing different global-context information by measuring pairwise correlations among tokens as defined below : OAttn=Concat ( H1 , · · · , Hh ) ·WO , where Hi=Softmax ( QWQi · ( KWKi ) T√ dk ) · VWVi , ( 1 ) where h denotes the number of heads , Q , K , V ∈ Rn×d are the query , key , and value embeddings of hidden dimension d obtained by linearly projecting the input sequence of length n. For each head , WQi , W K i , W V i ∈ Rd×dk are learned projection weight matrices where dk = d/h is the embedding dimension of each head . In this way , the Attn block first computes dot-products between key-query pairs , scales to stabilize the training , uses Softmax to normalize the resulting attention scores , and then computes a weighted sum of the value embeddings corresponding to different inputs . Finally , the results from all heads are concatenated and further projected with a weight matrix WO ∈ Rd×d to generate the outputs . • Conv is a key operator of CNNs , which models the local-context information of highdimensional inputs such as images through sliding kernel weights W on top of inputs X to measure their similarity ( Gu et al. , 2018 ) , as defined in Eq . ( 2 ) . Its translation invariant and weight sharing ability leads to various SOTA CNNs ( He et al. , 2016 ) or hybrid CNN-Transformer models ( Xiao et al. , 2021 ) . However , the computational complexities of CNNs can be prohibitive due to their required intensive multiplications . For example , one forward pass of ResNet-50 ( He et al. , 2016 ) requires 4G floating point multiplications . OConv = ∑ XT ∗W ; OShift = ∑ XT ∗ ( S · 2P ) ; OAdd = − ∑ ‖X −W‖1 , ( 2 ) • Shift is a well-known efficient hardware primitive , motivating the recent development of shiftbased efficient NNs . For example , DeepShift ( Elhoushi et al. , 2021 ) parametrizes NNs with bitwise shifts and sign flips , as formulated in the middle of Eq . ( 2 ) , with W = S · 2P denoting weights in the shift blocks , where S ∈ { −1 , 0 , 1 } are sign flip operators and the power-of-two parameter for P represents the bitwise shifts . However , NNs built with shift blocks and quantized weights are observed to be inferior to multiplication-based NNs in terms of expressiveness ( accuracy ) as validated in ( You et al. , 2020a ) . • Add is another efficient hardware primitive which motivates recent works ( Chen et al. , 2020 ; Wang et al. , 2021b ; Song et al. , 2021 ) to design efficient NNs using merely additions to measure the similarity between kernel weights W and inputs X , as shown in the right part of Eq . ( 2 ) . Such add-based NNs ( Chen et al. , 2020 ; Xu et al. , 2020 ) in general have a better expressive capacity than their shift-based counterparts . For example , AdderNets ( Chen et al. , 2020 ) achieve a 1.37 % higher accuracy than DeepShift under similar or even lower FLOPs on ResNet-18 with the ImageNet dataset . However , add-based operators ( i.e. , repeated additions ) are not parameterefficient as compared to bitwise shift operations ( You et al. , 2020a ) . While NNs combining shfit and add achieve a boosted accuracy , efficiency , and robustness than NNs using merely either of them , their accuracy still compares unfavorably as compared with vanilla CNNs or Transformers . Based on the above introduction , the search space in ShiftAddNAS incorporates all the four different types of blocks ( i.e. , Attn , Conv , Shift , and Add ) , aiming to push forward both NNs ’ accuracy and efficiency . Note that we refer to all operators as blocks , and adopt block based search space because it has been evidenced and proven that block based ones can reduce the search space size and lead to more accurate architecture ranking/rating ( Li et al. , 2020b ; a ) . Hardware cost analysis . As mentioned , multiplicationbased operators ( e.g. , Attn and Conv ) favor a superior accuracy yet is not hardware efficient , while multiplication-free operators ( e.g. , Shift and Add ) favors a better hardware efficiency yet can hurt the achievable accuracy . Specifically , as shown in Fig . 1 , bitwise shifts can save as high as 196× and 24× energy costs over multiplications , when implemented in a 45nm CMOS technology and SOTA FPGA ( Xilinx Inc. ) , respectively ; with a 16-bit precision , bitwise shifts may achieve at least 9.7× and 1.45× average power and area savings than multipliers ( Elhoushi et al. , 2021 ) ; and similarly , additions can save up to 196× and 31× energy costs over multiplications in 32-bit fixed-point ( FIX32 ) formats , and 47× and 4.1× energy costs in 32-bit floating-point ( FP32 ) formats , when implemented in a 45nm CMOS technology and SOTA FPGA ( Xilinx Inc. ) , respectively , while aggressively leading to 1.84× , 25.5× , and 7.83× area savings than multiplications in a 45nm CMOS technology with FP32 , FIX32 , and FIX8 formats , respectively ( Chen et al. , 2021c ) . Supernet for NLP tasks . Based on the above search space , we construct a supernet for the convenience of search following SOTA one-shot NAS methods ( Cai et al. , 2018 ; Guo et al. , 2020 ) by estimating the performance of each candidate hybrid model ( i.e. , subnet ) without fully training it . As shown in Fig . 2 ( a ) , each macro-block in the supernet includes all the aforementioned four candidate blocks and three multi-branch combinations ( e.g. , Attn+Conv ) along the channel dimension for capturing both global and local context information following ( Wu et al. , 2020 ) , where the candidate blocks in the same layer are isolated with each followed by two-layer MLPs and enabling elastic embedding dimension , head numbers , and MLP hidden dimension for fine-grained search for efficient NNs as ( Wang et al. , 2020a ) . Overall , our supernet for NLP tasks contains about 1014 subnet candidates , and the searchable choices are listed in Tab . 1 . During training , all possible subnets are uniformly sampled and only one path is activated for each layer at run-time considering the practical concern on memory consumption for supernet training . For ease of evaluation , we incorporate common treatments of NAS in our suppenet design . First , for the elastic dimensions mentioned above , all sub- nets share the front portion of weights or heads of the largest dimension . Second , all decoder blocks can take the last one , two , or three encoder blocks as inputs for abstracting both high-level and lowlevel information ( Wang et al. , 2020a ) . Note that the number of decoder blocks are also searchable and the conv , shift and add operators are disabled for decoder blocks , as they are observed to be sensitive and activating those paths might hurt the accuracy ( You et al. , 2020a ; Wu et al. , 2019b ) . Supernet for CV tasks . Different from the commonly used elastic hidden dimension design for NLP tasks , various spatial resolutions or scales are essential for CV tasks . As such , to ensure more capable feature description of the searched NNs , we adopt a multi-resolution supernet design . As shown in Fig . 2 ( b ) , the supernet incorporates flexible downsampling options , where the spatial resolution for each layer can either stay unchanged or be reduced to half of its previous layer ’ s scale until reaching the smallest resolution . In this way , the four candidate blocks can work collaboratively to deliver the multiscale features required by most CV tasks . Overall , our supernet contains about 109 subnets , for which the detailed searchable choices are summarized in Tab . 2 . Note that the Attn block is followed by two-layer MLPs and we also include a residual connection for each block as inspired by ( Srinivas et al. , 2021 ) . During training , the supernet performs uniform sampling and only activates one path of the chosen resolution and block type for each layer as for the NLP tasks . | This paper designs a hybrid search space that includes multiplication-based operators and multiplication-free operations to find good trading points between accuracy-efficiency. Further, this work defines the problem when training weight-sharing supernet on the hybrid search space and proposes the heterogenous weight sharing algorithm to address the problem. The proposed method is validated on both NLP and CV tasks, outperforming several competitive baseline methods in terms of accuracy and saving efficiency on latency or energy. | SP:e34072bff0b40655ed566bd88f75b458d381edc4 |
ShiftAddNAS: Hardware-Inspired Search for More Accurate and Efficient Neural Networks | 1 INTRODUCTION . The unprecedented performance achieved by neural networks ( NNs ) , e.g. , convolutional neural networks ( CNNs ) and Transformers , requires intensive multiplications and thus prohibitive training and inference costs , contradicting the explosive demand for embedding various intelligent functionalities into pervasive resource-constrained edge devices . In response , multiplication-free networks have been proposed to alleviate the prohibitive resource requirements by replacing the costly multiplications with lower-cost operators for boosting hardware efficiency . For example , AdderNet ( Chen et al. , 2020 ) utilizes mere additions to design NNs ; and ShiftAddNet ( You et al. , 2020a ) follows a commonly used hardware practice to re-parameterize NNs with both bitwise shifts and additions . Despite their promising performance in hardware efficiency , multiplication-free NNs in general under-perform their CNN and Transformer counterparts in terms of task accuracy for both computer vision ( CV ) and natural language processing ( NLP ) applications . To marry the best of both worlds , we advocate hybrid multiplication-reduced network architectures that integrate both multiplication-based operators ( e.g. , vanilla convolution ( Krizhevsky et al. , 2012 ) and attention ( Vaswani et al. , 2017 ) ) and multiplication-free operators ( e.g. , shift and add ( You et al. , 2020a ) ) to simultaneously boost task accuracy and efficiency . Thanks to the amazing success of neural architecture search ( NAS ) in automating the process of designing state-of-the-art NNs , it is natural to consider NAS as the design engine of the aforementioned hybrid NNs for various applications and tasks , each often requiring a different performance-efficiency trade-off . However , there still exist a few challenges in leveraging NAS to design the hybrid NNs . First , existing NAS methods mostly consider the search for either efficient CNNs ( Wan et al. , 2020 ) , Transformers ( Chen et al. , 2021b ) , or hybrid CNN-Transformers ( Ding et al. , 2021 ; Li et al. , 2021 ) , and there still is a lack of a seminal work that searches for multiplication-reduced hybrid networks , especially for the hardware-inspired networks that incorporate both bitwise shifts and additions . Second , a hybrid search space could make it more challenging to achieve effective NAS and further aggravate the search burden , due to the enlarged search space imposed by the newly introduced multiplicationfree operators . It is worth noting that existing weight sharing strategies of NAS do not directly apply to the target hybrid search space , because weights of different operators follow heterogeneous distributions , leading to a dilemma of either inefficient search or inconsistent architecture ranking . Specifically , weights in convolutional and adder layers follow Gaussian and Laplacian distributions , respectively , as also highlighted by ( Chen et al. , 2020 ; Xu et al. , 2020 ) . As such , forcing weight sharing among heterogeneous operators could hurt the capacity and thus the achieved accuracy of the resulting NNs , while treating them separately could explode the search space and make it more difficult to achieve effective NAS , i.e. , the dilemma mentioned above . To tackle the aforementioned challenges towards more accurate and efficient NNs , this work makes the following contributions : 1 . We propose a generic NAS framework dubbed ShiftAddNAS , which for the first time can automatically search for efficient hybrid NNs with both superior accuracy and efficiency . Our ShiftAddNAS integrates a hybrid hardware-inspired search space that incorporates both multiplication-based operators ( e.g. , convolution and attention ) and multiplicationfree operators ( e.g. , shift and add ) , and can serve as a play-and-plug module to be applied on top of SOTA NAS works for further boosting their achievable accuracy and efficiency . 2 . We develop a new weight sharing strategy for effective search with hybrid search spaces , which only incurs a negligible overhead when searching for hybrid operators with heterogeneous ( e.g. , Gaussian vs. Laplacian ) weight distributions as compared to the vanilla NAS with merely multiplication-based operators , alleviating the dilemma mentioned above regarding either inefficient search or inconsistent architecture ranking . 3 . We conduct extensive experiments and ablation studies to validate the effectiveness of ShiftAddNAS against state-of-the-art ( SOTA ) works . Results on multiple benchmarks demonstrate the superior accuracy and hardware efficiency of its searched NNs as compared to both ( 1 ) manually designed multiplication-free networks , CNNs , Transformers , and hybrid CNN-Transformers , and ( 2 ) SOTA NAS works , on both CV and NLP tasks . 2 RELATED WORKS . Multiplication-free NNs . Many efficient NNs aim to reduce their intensive multiplications that dominate the time/energy costs . One important trend is to replace the multiplications with lowercost operators : BNNs ( Courbariaux et al. , 2016 ; Juefei-Xu et al. , 2017 ) binarize both the weights and activations and reduce multiplications to merely sign flips at non-negligible accuracy drops ; AdderNets ( Chen et al. , 2020 ; Xu et al. , 2020 ; Wang et al. , 2021b ) fully replace the multiplications with lower-cost additions and further develop an effective backpropagation scheme for efficient AdderNet training ; Shift-based NNs leverage either spatial shift ( Wu et al. , 2018 ) or bit-wise shift operations , e.g. , DeepShift ( Elhoushi et al. , 2021 ) , to reduce the amount of multiplications ; and ShiftAddNet ( You et al. , 2020a ) draws inspirations from efficient hardware designs to reparamatize NNs with mere bitwise shifts and additions . While multiplication-free NNs under-perform their vanilla NN counterparts in terms of achieved accuracy , ShiftAddNAS aims to automatically search for multiplication-reduced NNs that incorporate both multiplication-based and multiplication-free operators for marrying the best of both worlds , i.e. , boosted accuracy and efficiency . Neural architecture search . NAS has achieved an amazing success in automating the design of efficient NN architectures . For searching for CNNs , early works ( Tan & Le , 2019 ; Tan et al. , 2019 ; Howard et al. , 2019 ) adopt reinforcement learning based methods that require a prohibitive search time and computing resources , while recent works ( Liu et al. , 2018 ; Wu et al. , 2019a ; Wan et al. , 2020 ; Yang et al. , 2021 ) utilize differentiable search to greatly improve the search efficiency . More recently , SOTA works adopt one-shot NAS ( Guo et al. , 2020 ; Cai et al. , 2019 ; Yu et al. , 2020 ; Wang et al. , 2021a ) to decouple the architecture search from supernet training and then evaluates the performance of sub-networks whose weights are directly inherited from the pretrained supernet . For searching for Transformers , recently emerging works ( Wang et al. , 2020a ; Su et al. , 2021 ; Chen et al. , 2021b ; a ) adopt one-shot NAS and an evolutionary algorithm to search for optimal Transformer architectures for both NLP and CV tasks . Additionally , BossNAS ( Li et al. , 2021 ) and HR-NAS ( Ding et al. , 2021 ) further search for hybrid CNN-Transformer architectures . Nevertheless , little effort has been made to exploring NAS methods especially their search strategies for multiplication-reduced NNs that incorporate both multiplication-based and multiplication-free operations . Furthermore , it is not clear whether existing efficient NAS methods are applicable to searching for such multiplication-reduced NNs . Specifically , prior weight sharing strategies may not work since weights and activations in CNNs and AdderNets follow a different distribution ( Chen et al. , 2020 ) . As such , it is highly desirable to develop NAS methods , e.g. , ShiftAddNAS , dedicated for hardware-inspired multiplication-reduced NNs to increase achievable accuracy and efficiency . Transformers . Transformers ( Vaswani et al. , 2017 ) were first proposed for NLP tasks , which has inspired many interesting works . Some advance Transformer design by improving the attention mechanism ( Chen et al. , 2018 ) , training deeper Transformers ( Wang et al. , 2019 ) , and replacing the attention with convolutional modules ( Wu et al. , 2019b ) ; and others strive to reduce Transformers ’ computational complexity by adopting sparse attention mechanisms ( Zaheer et al. , 2020 ) , low-rank approximation ( Wang et al. , 2020b ) , or compression techniques ( Wu et al. , 2020 ) . Recently , there has been a growing interest in developing Transformers for CV tasks : Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2021 ) for the first time successfully applies pure Transformers to image classification and achieves SOTA task accuracy , which yet relies on pretraining on giant datasets ( Hinton et al. , 2015 ) ; following works including DeiT ( Touvron et al. , 2021 ) T2T-ViT ( Yuan et al. , 2021 ) develop new training recipes and tokenization schemes , for achieving comparable accuracy without the necessity of costly pretraining ; and another trend is to incorporate CNN modules into Transformer architectures for better accuracy and efficiency tradeoffs ( Wu et al. , 2021 ; Xiao et al. , 2021 ; Graham et al. , 2021 ) . In contrast , we advocate hybrid multiplication-reduced NNs and develop an automated search framework that can automatically search for such hardware inspired hybrid models . 3 THE PROPOSED SHIFTADDNAS FRAMEWORK . In this section , we first introduce the hybrid search space from both algorithmic and hardware costs perspectives , providing high-level background and justification for motivating ShiftAddNAS ; Sec . 3.2 elaborates the one-shot search method of ShiftAddNAS by first analyzing the dilemma of either inefficient search or inconsistent architecture ranking and then introducing the proposed novel heterogeneous weight sharing strategy tackling the aforementioned dilemma . 3.1 SHIFTADDNAS : HYBRID SEARCH SPACE . Candidate blocks . The first step of developing ShiftAddNAS is to construct a hybrid search space incorporating suitable building blocks that exhibit various performance-efficiency trade-offs . Specifically , we hypothesize that integrating both multiplication-based and multiplication-free blocks into the search space could lead to both boosted accuracy and efficiency , and consider blocks from two trends of designing NNs : ( 1 ) capable NNs , e.g. , vanilla CNNs and Transformers , leverage either convolutions ( Conv ) or multi-head self-attentions ( Attn ) that comprise of intensive multiplications to capture local or global correlations , achieving a SOTA accuracy in both CV and NLP tasks ; and ( 2 ) efficient multiplication-free NNs , e.g , ShiftAddNet , draw inspirations from hardware design practices to incorporate two efficient and complementary blocks , i.e. , coarse-grained Shift and fine-grained Add , for favoring hardware efficiency , while maintaining a decent accuracy . While our constructed general hybrid search space for both NLP and CV tasks are shown in Fig . 2 , we next analyze the building blocks from both algorithmic and hardware costs perspectives . • Attn is a core component of Transformers ( Vaswani et al. , 2017 ) , which consists of a number of heads H with each capturing different global-context information by measuring pairwise correlations among tokens as defined below : OAttn=Concat ( H1 , · · · , Hh ) ·WO , where Hi=Softmax ( QWQi · ( KWKi ) T√ dk ) · VWVi , ( 1 ) where h denotes the number of heads , Q , K , V ∈ Rn×d are the query , key , and value embeddings of hidden dimension d obtained by linearly projecting the input sequence of length n. For each head , WQi , W K i , W V i ∈ Rd×dk are learned projection weight matrices where dk = d/h is the embedding dimension of each head . In this way , the Attn block first computes dot-products between key-query pairs , scales to stabilize the training , uses Softmax to normalize the resulting attention scores , and then computes a weighted sum of the value embeddings corresponding to different inputs . Finally , the results from all heads are concatenated and further projected with a weight matrix WO ∈ Rd×d to generate the outputs . • Conv is a key operator of CNNs , which models the local-context information of highdimensional inputs such as images through sliding kernel weights W on top of inputs X to measure their similarity ( Gu et al. , 2018 ) , as defined in Eq . ( 2 ) . Its translation invariant and weight sharing ability leads to various SOTA CNNs ( He et al. , 2016 ) or hybrid CNN-Transformer models ( Xiao et al. , 2021 ) . However , the computational complexities of CNNs can be prohibitive due to their required intensive multiplications . For example , one forward pass of ResNet-50 ( He et al. , 2016 ) requires 4G floating point multiplications . OConv = ∑ XT ∗W ; OShift = ∑ XT ∗ ( S · 2P ) ; OAdd = − ∑ ‖X −W‖1 , ( 2 ) • Shift is a well-known efficient hardware primitive , motivating the recent development of shiftbased efficient NNs . For example , DeepShift ( Elhoushi et al. , 2021 ) parametrizes NNs with bitwise shifts and sign flips , as formulated in the middle of Eq . ( 2 ) , with W = S · 2P denoting weights in the shift blocks , where S ∈ { −1 , 0 , 1 } are sign flip operators and the power-of-two parameter for P represents the bitwise shifts . However , NNs built with shift blocks and quantized weights are observed to be inferior to multiplication-based NNs in terms of expressiveness ( accuracy ) as validated in ( You et al. , 2020a ) . • Add is another efficient hardware primitive which motivates recent works ( Chen et al. , 2020 ; Wang et al. , 2021b ; Song et al. , 2021 ) to design efficient NNs using merely additions to measure the similarity between kernel weights W and inputs X , as shown in the right part of Eq . ( 2 ) . Such add-based NNs ( Chen et al. , 2020 ; Xu et al. , 2020 ) in general have a better expressive capacity than their shift-based counterparts . For example , AdderNets ( Chen et al. , 2020 ) achieve a 1.37 % higher accuracy than DeepShift under similar or even lower FLOPs on ResNet-18 with the ImageNet dataset . However , add-based operators ( i.e. , repeated additions ) are not parameterefficient as compared to bitwise shift operations ( You et al. , 2020a ) . While NNs combining shfit and add achieve a boosted accuracy , efficiency , and robustness than NNs using merely either of them , their accuracy still compares unfavorably as compared with vanilla CNNs or Transformers . Based on the above introduction , the search space in ShiftAddNAS incorporates all the four different types of blocks ( i.e. , Attn , Conv , Shift , and Add ) , aiming to push forward both NNs ’ accuracy and efficiency . Note that we refer to all operators as blocks , and adopt block based search space because it has been evidenced and proven that block based ones can reduce the search space size and lead to more accurate architecture ranking/rating ( Li et al. , 2020b ; a ) . Hardware cost analysis . As mentioned , multiplicationbased operators ( e.g. , Attn and Conv ) favor a superior accuracy yet is not hardware efficient , while multiplication-free operators ( e.g. , Shift and Add ) favors a better hardware efficiency yet can hurt the achievable accuracy . Specifically , as shown in Fig . 1 , bitwise shifts can save as high as 196× and 24× energy costs over multiplications , when implemented in a 45nm CMOS technology and SOTA FPGA ( Xilinx Inc. ) , respectively ; with a 16-bit precision , bitwise shifts may achieve at least 9.7× and 1.45× average power and area savings than multipliers ( Elhoushi et al. , 2021 ) ; and similarly , additions can save up to 196× and 31× energy costs over multiplications in 32-bit fixed-point ( FIX32 ) formats , and 47× and 4.1× energy costs in 32-bit floating-point ( FP32 ) formats , when implemented in a 45nm CMOS technology and SOTA FPGA ( Xilinx Inc. ) , respectively , while aggressively leading to 1.84× , 25.5× , and 7.83× area savings than multiplications in a 45nm CMOS technology with FP32 , FIX32 , and FIX8 formats , respectively ( Chen et al. , 2021c ) . Supernet for NLP tasks . Based on the above search space , we construct a supernet for the convenience of search following SOTA one-shot NAS methods ( Cai et al. , 2018 ; Guo et al. , 2020 ) by estimating the performance of each candidate hybrid model ( i.e. , subnet ) without fully training it . As shown in Fig . 2 ( a ) , each macro-block in the supernet includes all the aforementioned four candidate blocks and three multi-branch combinations ( e.g. , Attn+Conv ) along the channel dimension for capturing both global and local context information following ( Wu et al. , 2020 ) , where the candidate blocks in the same layer are isolated with each followed by two-layer MLPs and enabling elastic embedding dimension , head numbers , and MLP hidden dimension for fine-grained search for efficient NNs as ( Wang et al. , 2020a ) . Overall , our supernet for NLP tasks contains about 1014 subnet candidates , and the searchable choices are listed in Tab . 1 . During training , all possible subnets are uniformly sampled and only one path is activated for each layer at run-time considering the practical concern on memory consumption for supernet training . For ease of evaluation , we incorporate common treatments of NAS in our suppenet design . First , for the elastic dimensions mentioned above , all sub- nets share the front portion of weights or heads of the largest dimension . Second , all decoder blocks can take the last one , two , or three encoder blocks as inputs for abstracting both high-level and lowlevel information ( Wang et al. , 2020a ) . Note that the number of decoder blocks are also searchable and the conv , shift and add operators are disabled for decoder blocks , as they are observed to be sensitive and activating those paths might hurt the accuracy ( You et al. , 2020a ; Wu et al. , 2019b ) . Supernet for CV tasks . Different from the commonly used elastic hidden dimension design for NLP tasks , various spatial resolutions or scales are essential for CV tasks . As such , to ensure more capable feature description of the searched NNs , we adopt a multi-resolution supernet design . As shown in Fig . 2 ( b ) , the supernet incorporates flexible downsampling options , where the spatial resolution for each layer can either stay unchanged or be reduced to half of its previous layer ’ s scale until reaching the smallest resolution . In this way , the four candidate blocks can work collaboratively to deliver the multiscale features required by most CV tasks . Overall , our supernet contains about 109 subnets , for which the detailed searchable choices are summarized in Tab . 2 . Note that the Attn block is followed by two-layer MLPs and we also include a residual connection for each block as inspired by ( Srinivas et al. , 2021 ) . During training , the supernet performs uniform sampling and only activates one path of the chosen resolution and block type for each layer as for the NLP tasks . | This paper proposes a NAS method for both multiplication-based and adder-based networks. The contributions mainly lie on hybrid search space and new weight sharing strategy. The experimental results shows the method can obtain energy-efficient networks with high performance. | SP:e34072bff0b40655ed566bd88f75b458d381edc4 |
Gradient-Guided Importance Sampling for Learning Discrete Energy-Based Models | 1 INTRODUCTION . Energy-Based models ( EBMs ) , also known as unnormalized probabilistic models , model distributions by associating unnormalized probability densities . Such methods have been developed for decades ( Hopfield , 1982 ; Ackley et al. , 1985 ; Cipra , 1987 ; Dayan et al. , 1995 ; Zhu et al. , 1998 ; Hinton , 2012 ) and are unified as energy-based models ( EBMs ) ( LeCun et al. , 2006 ) in the machine learning community . EBMs have great simplicity and flexibility since energy functions are not required to integrate or sum to one , thus enabling the usage of various energy functions . In practice , given different data types , we can parameterize the energy function with different neural networks as needed , such as multi-layer perceptrons ( MLPs ) , convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) , and graph neural networks ( GNNs ) ( Gori et al. , 2005 ; Scarselli et al. , 2008 ) . Recently , EBMs have been drawing increasing attention and are demonstrated to be effective in various domains , including images ( Ngiam et al. , 2011 ; Xie et al. , 2016 ; Du & Mordatch , 2019 ) , videos ( Xie et al. , 2017 ) , texts ( Deng et al. , 2020 ) , 3D objects ( Xie et al. , 2018 ) , molecules ( Liu et al. , 2021 ; Hataya et al. , 2021 ) , and proteins ( Du et al. , 2020b ) . Nonetheless , learning ( a.k.a. , training ) EBMs is known to be challenging since we can not compute the exact likelihood due to the intractable normalization constant . As reviewed in Section 4 , many approaches have been proposed to learn EBMs , such as maximum likelihood training with MCMC sampling ( Hinton , 2002 ) and score matching ( Hyvärinen & Dayan , 2005 ) . However , most recent advanced methods can not be applied to discrete data directly since they usually leverage gradients over the continuous data space . For example , for many methods based on maximum likelihood training with MCMC sampling , they use the gradient w.r.t . the data space to update samples in each MCMC step . If we update discrete samples using such gradient , the resulting samples are usually invalid in the discrete space . Notably , discrete data is common in our real world , such as texts , graphs , and genome sequences . Therefore , learning EBMs on discrete data remains to be challenging and in demand . Ratio matching ( Hyvärinen , 2007 ; Lyu , 2009 ) is proposed to learn discrete EBMs by matching ratios of probabilities between the data distribution and the model distribution , as detailed in Section 2.2 . However , as analyzed in Section 3.1 , it requires expensive computations and excessive memory usages , which is infeasible if the data is high-dimensional . In this work , we propose to use the gradient of the energy function w.r.t . the discrete data space to guide the importance sampling for estimating the original ratio matching objective . More specifically , we utilize such gradient to approximately construct the provable optimal proposal distribution for importance sampling . Thus , the proposed approach is termed as ratio matching with gradient-guided importance sampling ( RMwGGIS ) . Our RMwGGIS can significantly overcome the limitations of ratio matching . In addition , it is demonstrated to be more effective than the original ratio matching because it can be optimized better in practice . Experimental results on synthetic discrete data , graph generation , and Ising model training demonstrate that our RMwGGIS significantly alleviates the limitations of ratio matching , achieves better performance with obvious margins , and has the ability of scaling to high-dimensional relevant problems . 2 PRELIMINARIES . 2.1 ENERGY-BASED MODELS . Let x be a data point and Eθ ( x ) ∈ R be the corresponding energy , where θ represents the learnable parameters of the parameterized energy function Eθ ( · ) . The probability density function of the model distribution is given as pθ ( x ) = e−Eθ ( x ) Zθ ∝ e−Eθ ( x ) , ( 1 ) where Zθ ∈ R is the normalization constant ( a.k.a. , partition function ) . To be specific , Zθ =∫ e−Eθ ( x ) dx if x is in the continuous space and Zθ = ∑ e−Eθ ( x ) for discrete data . Hence , computing Zθ is usually infeasible due to the intractable integral or summation . Note that Zθ is a variable depending on θ but a constant w.r.t . x . 2.2 RATIO MATCHING . Ratio matching ( Hyvärinen , 2007 ) is developed for learning EBMs on discrete data by matching ratios of probabilities between the data distribution and the model distribution . Note that we focus on d-dimensional binary discrete data x ∈ { 0 , 1 } d in this work . Specifically , ratio matching considers the ratio of p ( x ) and p ( x−i ) , where x−i = ( x1 , x2 , · · · , x̄i , · · · , xd ) denotes a point in the data space obtained by flipping the i-th dimension of x . The key idea is to force the ratios pθ ( x ) pθ ( x−i ) defined by the model distribution pθ to be as close as possible to the ratios pD ( x ) pD ( x−i ) given by the data distribution pD . The benefit of considering ratios of probabilities is that they do not involve the intractable normalization constant Zθ since pθ ( x ) pθ ( x−i ) = e−Eθ ( x ) e−Eθ ( x−i ) = eEθ ( x−i ) −Eθ ( x ) according to Eq . ( 1 ) . To achieve the match between ratios , Hyvärinen ( 2007 ) proposes to minimize the objective function JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ g ( pD ( x ) pD ( x−i ) ) − g ( pθ ( x ) pθ ( x−i ) ) ] 2 + [ g ( pD ( x−i ) pD ( x ) ) − g ( pθ ( x−i ) pθ ( x ) ) ] 2 . ( 2 ) The sum of two square distances with the role of x and x−i switched is specifically designed since it is essential for the following simplification . In addition , the function g ( u ) = 11+u is also carefully chosen in order to obtain the subsequent simplification . To compute the objective defined in Eq . ( 2 ) , it is known that the expectation over data distribution ( i.e. , Ex∼pD ( x ) ) can be unbiasedly estimated by the empirical mean of samples x ∼ pD ( x ) . However , to obtain the ratios between pD ( x ) and pD ( x−i ) in Eq . ( 2 ) , the exact data distribution is required to be known , which is usually impossible . Fortunately , thanks to the above carefully designed objective , Hyvärinen ( 2007 ) demostrates that the objective function in Eq . ( 2 ) is equivalent to the following simplified version JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ g ( pθ ( x ) pθ ( x−i ) ) ] 2 = Ex∼pD ( x ) d∑ i=1 [ g ( eEθ ( x−i ) −Eθ ( x ) ) ] 2 , ( 3 ) which does not require the data distribution to be known and can be easily computed by evaluating the energy of x and x−i . It is proved that the estimator given by Eq . ( 3 ) is consistent ( Hyvärinen , 2007 ) . That means if it is minimized perfectly , the obtained model distribution will capture the data distribution exactly . Further , Lyu ( 2009 ) shows that the objective function of ratio matching can be reduced to JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ pθ ( x−i ) pθ ( x ) ] 2 = Ex∼pD ( x ) d∑ i=1 [ eEθ ( x ) −Eθ ( x−i ) ] 2 . ( 4 ) It is obvious that Eq . ( 3 ) and Eq . ( 4 ) agree with each other since function g ( · ) decreases monotonically in [ 0 , +∞ ) , which aligns with the value range of probability ratios pθ ( x ) pθ ( x−i ) . Intuitively , the objective function of ratio matching , as formulated in Eq . ( 4 ) , can push down the energy of the training sample x and push up the energies of other data points obtained by flipping one dimension of x . Thus , this objective faithfully expect that each training sample x has higher probability than its local neighboring points that are hamming distance 1 from x . 3 THE PROPOSED METHOD . In this section , we analyze the limitations of the ratio matching method from the perspective of computational time and memory usage . Then , we describe our proposed method , ratio matching with gradient-guided importance sampling ( RMwGGIS ) , which utilizes the gradient of the energy function w.r.t . the discrete input x to guide the importance sampling for estimating the original ratio matching objective . Our approach can alleviate the limitations significantly and is shown to be more effective in practice . 3.1 ANALYSIS OF RATIO MATCHING . Time-intensive computations . According to Eq . ( 4 ) , for a given training sample x , we have to compute the energies for all x−i , where i = 1 , · · · , d. In other words , we have O ( d ) evaluations of the energy function for each training sample . This is computationally intensive , especially when the data dimension d is large . Excessive memory usages . Besides the expensive computation , the memory usage of ratio matching is another limitation that can not be ignored , especially when we learn the energy function using modern GPUs with limited memory . As shown in Eq . ( 4 ) , the objective function consists of d terms for each training sample . When we do backpropagation , computing the gradient of the objective function w.r.t . the learnable parameters of the energy function is required . Therefore , in order to compute such gradient , we have to store the whole computational graph and the intermediate tensors for all of the d terms , thereby leading to excessive memory usages especially if the data dimension d is large . Hence , it is challenging to learn EBMs with ratio matching on modern devices , such as GPUs , for high-dimensional discrete data . 3.2 RATIO MATCHING WITH GRADIENT-GUIDED IMPORTANCE SAMPLING . The key idea of our approach is to use the well-known importance sampling technique to reduce the variance of estimating JRM ( θ ) with Monte Carlo method . The most critical and challenging part of using the importance sampling technique is choosing a good proposal distribution . In this work , we propose to utilize the gradient of the energy function w.r.t . the discrete input x to approximately construct the optimal proposal distribution for importance sampling . We describe the details of our method below . The objective for each sample x , defined by Eq . ( 4 ) , can be reformulated as JRM ( θ , x ) = d d∑ i=1 1 d [ eEθ ( x ) −Eθ ( x−i ) ] 2 = dEx−i∼m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 , ( 5 ) where m ( x−i ) = 1d for i = 1 , · · · , d is a discrete distribution . Thus , the objective of ratio matching for each sample x can be viewed as the expectation of [ eEθ ( x ) −Eθ ( x−i ) ] 2 over the discrete distribu- tion m ( x−i ) . In the original ratio matching method , as described in Section 2.2 , we compute such expectation exactly by considering all possible x−i , leading to expensive computations and excessive memory usages as analyzed in Section 3.1 . Naturally , we can estimate the desired expectation with Monte Carlo method by considering fewer terms sampled based on m ( x−i ) . However , such estimation usually has a high variance , and is empirically verified to be ineffective by our experiments in Section 5 . Further , we can apply the importance sampling method to reduce the variance of Monte Carlo estimation . Intuitively , certain values have more impact on the expectation than others . Hence , the estimator variance can be reduced if such important values are sampled more frequently than others . To be specific , instead of sampling based on the distribution m ( x−i ) , importance sampling aims to sample from another distribution n ( x−i ) , namely , proposal distribution . Formally , JRM ( θ , x ) = dEx−i∼m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 = dEx−i∼n ( x−i ) m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 n ( x−i ) . ( 6 ) The detailed derivation of Eq . ( 6 ) is given in Appendix A . Afterwards , we can apply Monte Carlo estimation based on the proposal distribution n ( x−i ) . Specifically , we sample s terms , denoted as x ( 1 ) −i , · · · , x ( s ) −i , according to the proposal distribution n ( x−i ) . Note that s is usually chosen to be much smaller than d. Then the Monte Carlo estimation for JRM ( θ , x ) is computed based on these s terms . Formally , JRM ( θ , x ) ̂n = d 1 s s∑ t=1 m ( x ( t ) −i ) [ eEθ ( x ) −Eθ ( x ( t ) −i ) ] 2 n ( x ( t ) −i ) , x ( t ) −i ∼ n ( x−i ) . ( 7 ) It is known that the estimator obtained by Monte Carlo estimation with importance sampling is an unbiased estimator , as the conventional Monte Carlo estimator . The key point of importance sampling is to choose an appropriate proposal distribution n ( x−i ) , which determines the variance of the corresponding estimator . The optimal proposal distribution n∗ ( x−i ) , which yields the minimum variance , is given by the following theorem . Theorem 1 . Let n∗ ( x−i ) = [ eEθ ( x ) −Eθ ( x−i ) ] 2∑d k=1 [ e Eθ ( x ) −Eθ ( x−k ) ] 2 be a discrete distribution on x−i , where i = 1 , · · · , d. Then for any discrete distribution n ( x−i ) on x−i , where i = 1 , · · · , d , we have V ar ( JRM ( θ , x ) ̂n∗ ) ≤ V ar ( JRM ( θ , x ) ̂n ) . Proof . The proof of Theorem 1 is included in Appendix B . To construct the exact optimal proposal distribution n∗ ( x−i ) given by Theorem 1 , we still have to evaluate the energies of all x−i , where i = 1 , · · · , d. To avoid such complexity , we propose to leverage the gradient of the energy function w.r.t . the discrete input x to approximately construct the optimal proposal distribution . Our approach only needs O ( 1 ) evaluations of the energy function to construct the proposal distribution . It is observed by Grathwohl et al . ( 2021 ) that many discrete distributions are implemented as continuous and differentiable functions , although they are evaluated only in discrete domains . Grathwohl et al . ( 2021 ) further proposes a scalable sampling method for discrete distributions by utilizing the gradients of the underlying continuous functions w.r.t . the discrete input . In this study , we extend this idea to improve ratio matching . More specifically , in our case , even though our input x is discrete , our parameterized energy function Eθ ( · ) , such as a neural network , is usually continuous and differentiable . Hence , we can use such gradient information to efficiently and approximately construct the optimal proposal distribution given by Theorem 1 . The basic idea is that we can approximate Eθ ( x−i ) based on the Taylor series of Eθ ( · ) at x , given that x−i is close to x in the data space because they only have differences in one dimension1 . Formally , Eθ ( x−i ) ≈ Eθ ( x ) + ( x−i − x ) T ∇xEθ ( x ) . ( 8 ) Thus , we can approximately obtain the desired term Eθ ( x ) −Eθ ( x−i ) in Theorem 1 using Eq . ( 8 ) . Note that ∇xEθ ( x ) ∈ Rd contains the information for approximating all Eθ ( x ) −Eθ ( x−i ) , where 1We have this assumption because data space is usually high-dimensional . If the number of data dimension is small , we can use the original ratio matching method with affordable time and memory budgets . Algorithm 1 Ratio Matching with Gradient-Guided Importance Sampling ( RMwGGIS ) Input : Observed dataset D = { x ( m ) } |D| m=1 , parameterized energy function Eθ ( · ) , number of samples s for Monte Carlo estimation with importance sampling 1 : for x ∼ D do ▷ Batch training is applied in practice 2 : Compute Eθ ( x ) 3 : Compute ∇xEθ ( x ) 4 : Compute the proposal distribution ñ∗ ( x−i ) = [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] i∑d k=1 [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] k ▷ Eq . ( 11 ) 5 : Sample s terms , denoted as x ( 1 ) −i , · · · , x ( s ) −i , according to ñ ∗ ( x−i ) 6 : Compute JRM ( θ , x ) ̂ñ∗ = d 1 s ∑s t=1 m ( x ( t ) −i ) [ e Eθ ( x ) −Eθ ( x ( t ) −i ) ] 2 ñ∗ ( x ( t ) −i ) ▷ Eq . ( 7 ) ( or Eq . ( 12 ) ) 7 : Update θ based on ∇θJRM ( θ , x ) ̂ñ∗ 8 : end for i = 1 , · · · , d. Hence , we can consider the following d-dimensional vector ( 2x− 1 ) ⊙∇xEθ ( x ) ∈ Rd , ( 9 ) where ⊙ denotes element-wise multiplication . Note that we have xi − x̄i = −1 if xi = 0 and xi − x̄i = 1 if xi = 1 , which can be unified as xi − x̄i = 2xi − 1 . Therefore , we have Eθ ( x ) − Eθ ( x−i ) ≈ [ ( 2x− 1 ) ⊙∇xEθ ( x ) ] i , i = 1 , · · · , d. ( 10 ) Afterwards , we can provide a proposal distribution ñ∗ ( x−i ) as an approximation of the optimal proposal distribution n∗ ( x−i ) given by Theorem 1 . Formally , ñ∗ ( x−i ) = [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] i∑d k=1 [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] k , i = 1 , · · · , d. ( 11 ) Then ñ∗ ( x−i ) is used as the proposal distribution for Monte Carlo estimation with importance sampling , as described by Eq . ( 7 ) . The overall process of our RMwGGIS method is summarized in Algorithm 1 . | This paper proposes a more efficient version of ratio matching (RM) for training discrete energy-based models. The proposed method subsamples the dimensions to use in the original RM objective and then uses importance sampling to reduce variance. The importance sampling distribution is based on a Taylor-series approximation to the target energy function which approximates the minimal-variance importance sampling distribution. The authors show that this estimator is considerably more efficient than standard RM and enables RM to be applied to training EBMs in higher dimensions. The authors demonstrate their estimator on some toy datasets and to fit EBMs on graph data. The method is evaluated using MMD. | SP:6d70759d66c94400778b2bad913422e2ea28dac5 |
Gradient-Guided Importance Sampling for Learning Discrete Energy-Based Models | 1 INTRODUCTION . Energy-Based models ( EBMs ) , also known as unnormalized probabilistic models , model distributions by associating unnormalized probability densities . Such methods have been developed for decades ( Hopfield , 1982 ; Ackley et al. , 1985 ; Cipra , 1987 ; Dayan et al. , 1995 ; Zhu et al. , 1998 ; Hinton , 2012 ) and are unified as energy-based models ( EBMs ) ( LeCun et al. , 2006 ) in the machine learning community . EBMs have great simplicity and flexibility since energy functions are not required to integrate or sum to one , thus enabling the usage of various energy functions . In practice , given different data types , we can parameterize the energy function with different neural networks as needed , such as multi-layer perceptrons ( MLPs ) , convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) , and graph neural networks ( GNNs ) ( Gori et al. , 2005 ; Scarselli et al. , 2008 ) . Recently , EBMs have been drawing increasing attention and are demonstrated to be effective in various domains , including images ( Ngiam et al. , 2011 ; Xie et al. , 2016 ; Du & Mordatch , 2019 ) , videos ( Xie et al. , 2017 ) , texts ( Deng et al. , 2020 ) , 3D objects ( Xie et al. , 2018 ) , molecules ( Liu et al. , 2021 ; Hataya et al. , 2021 ) , and proteins ( Du et al. , 2020b ) . Nonetheless , learning ( a.k.a. , training ) EBMs is known to be challenging since we can not compute the exact likelihood due to the intractable normalization constant . As reviewed in Section 4 , many approaches have been proposed to learn EBMs , such as maximum likelihood training with MCMC sampling ( Hinton , 2002 ) and score matching ( Hyvärinen & Dayan , 2005 ) . However , most recent advanced methods can not be applied to discrete data directly since they usually leverage gradients over the continuous data space . For example , for many methods based on maximum likelihood training with MCMC sampling , they use the gradient w.r.t . the data space to update samples in each MCMC step . If we update discrete samples using such gradient , the resulting samples are usually invalid in the discrete space . Notably , discrete data is common in our real world , such as texts , graphs , and genome sequences . Therefore , learning EBMs on discrete data remains to be challenging and in demand . Ratio matching ( Hyvärinen , 2007 ; Lyu , 2009 ) is proposed to learn discrete EBMs by matching ratios of probabilities between the data distribution and the model distribution , as detailed in Section 2.2 . However , as analyzed in Section 3.1 , it requires expensive computations and excessive memory usages , which is infeasible if the data is high-dimensional . In this work , we propose to use the gradient of the energy function w.r.t . the discrete data space to guide the importance sampling for estimating the original ratio matching objective . More specifically , we utilize such gradient to approximately construct the provable optimal proposal distribution for importance sampling . Thus , the proposed approach is termed as ratio matching with gradient-guided importance sampling ( RMwGGIS ) . Our RMwGGIS can significantly overcome the limitations of ratio matching . In addition , it is demonstrated to be more effective than the original ratio matching because it can be optimized better in practice . Experimental results on synthetic discrete data , graph generation , and Ising model training demonstrate that our RMwGGIS significantly alleviates the limitations of ratio matching , achieves better performance with obvious margins , and has the ability of scaling to high-dimensional relevant problems . 2 PRELIMINARIES . 2.1 ENERGY-BASED MODELS . Let x be a data point and Eθ ( x ) ∈ R be the corresponding energy , where θ represents the learnable parameters of the parameterized energy function Eθ ( · ) . The probability density function of the model distribution is given as pθ ( x ) = e−Eθ ( x ) Zθ ∝ e−Eθ ( x ) , ( 1 ) where Zθ ∈ R is the normalization constant ( a.k.a. , partition function ) . To be specific , Zθ =∫ e−Eθ ( x ) dx if x is in the continuous space and Zθ = ∑ e−Eθ ( x ) for discrete data . Hence , computing Zθ is usually infeasible due to the intractable integral or summation . Note that Zθ is a variable depending on θ but a constant w.r.t . x . 2.2 RATIO MATCHING . Ratio matching ( Hyvärinen , 2007 ) is developed for learning EBMs on discrete data by matching ratios of probabilities between the data distribution and the model distribution . Note that we focus on d-dimensional binary discrete data x ∈ { 0 , 1 } d in this work . Specifically , ratio matching considers the ratio of p ( x ) and p ( x−i ) , where x−i = ( x1 , x2 , · · · , x̄i , · · · , xd ) denotes a point in the data space obtained by flipping the i-th dimension of x . The key idea is to force the ratios pθ ( x ) pθ ( x−i ) defined by the model distribution pθ to be as close as possible to the ratios pD ( x ) pD ( x−i ) given by the data distribution pD . The benefit of considering ratios of probabilities is that they do not involve the intractable normalization constant Zθ since pθ ( x ) pθ ( x−i ) = e−Eθ ( x ) e−Eθ ( x−i ) = eEθ ( x−i ) −Eθ ( x ) according to Eq . ( 1 ) . To achieve the match between ratios , Hyvärinen ( 2007 ) proposes to minimize the objective function JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ g ( pD ( x ) pD ( x−i ) ) − g ( pθ ( x ) pθ ( x−i ) ) ] 2 + [ g ( pD ( x−i ) pD ( x ) ) − g ( pθ ( x−i ) pθ ( x ) ) ] 2 . ( 2 ) The sum of two square distances with the role of x and x−i switched is specifically designed since it is essential for the following simplification . In addition , the function g ( u ) = 11+u is also carefully chosen in order to obtain the subsequent simplification . To compute the objective defined in Eq . ( 2 ) , it is known that the expectation over data distribution ( i.e. , Ex∼pD ( x ) ) can be unbiasedly estimated by the empirical mean of samples x ∼ pD ( x ) . However , to obtain the ratios between pD ( x ) and pD ( x−i ) in Eq . ( 2 ) , the exact data distribution is required to be known , which is usually impossible . Fortunately , thanks to the above carefully designed objective , Hyvärinen ( 2007 ) demostrates that the objective function in Eq . ( 2 ) is equivalent to the following simplified version JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ g ( pθ ( x ) pθ ( x−i ) ) ] 2 = Ex∼pD ( x ) d∑ i=1 [ g ( eEθ ( x−i ) −Eθ ( x ) ) ] 2 , ( 3 ) which does not require the data distribution to be known and can be easily computed by evaluating the energy of x and x−i . It is proved that the estimator given by Eq . ( 3 ) is consistent ( Hyvärinen , 2007 ) . That means if it is minimized perfectly , the obtained model distribution will capture the data distribution exactly . Further , Lyu ( 2009 ) shows that the objective function of ratio matching can be reduced to JRM ( θ ) = Ex∼pD ( x ) d∑ i=1 [ pθ ( x−i ) pθ ( x ) ] 2 = Ex∼pD ( x ) d∑ i=1 [ eEθ ( x ) −Eθ ( x−i ) ] 2 . ( 4 ) It is obvious that Eq . ( 3 ) and Eq . ( 4 ) agree with each other since function g ( · ) decreases monotonically in [ 0 , +∞ ) , which aligns with the value range of probability ratios pθ ( x ) pθ ( x−i ) . Intuitively , the objective function of ratio matching , as formulated in Eq . ( 4 ) , can push down the energy of the training sample x and push up the energies of other data points obtained by flipping one dimension of x . Thus , this objective faithfully expect that each training sample x has higher probability than its local neighboring points that are hamming distance 1 from x . 3 THE PROPOSED METHOD . In this section , we analyze the limitations of the ratio matching method from the perspective of computational time and memory usage . Then , we describe our proposed method , ratio matching with gradient-guided importance sampling ( RMwGGIS ) , which utilizes the gradient of the energy function w.r.t . the discrete input x to guide the importance sampling for estimating the original ratio matching objective . Our approach can alleviate the limitations significantly and is shown to be more effective in practice . 3.1 ANALYSIS OF RATIO MATCHING . Time-intensive computations . According to Eq . ( 4 ) , for a given training sample x , we have to compute the energies for all x−i , where i = 1 , · · · , d. In other words , we have O ( d ) evaluations of the energy function for each training sample . This is computationally intensive , especially when the data dimension d is large . Excessive memory usages . Besides the expensive computation , the memory usage of ratio matching is another limitation that can not be ignored , especially when we learn the energy function using modern GPUs with limited memory . As shown in Eq . ( 4 ) , the objective function consists of d terms for each training sample . When we do backpropagation , computing the gradient of the objective function w.r.t . the learnable parameters of the energy function is required . Therefore , in order to compute such gradient , we have to store the whole computational graph and the intermediate tensors for all of the d terms , thereby leading to excessive memory usages especially if the data dimension d is large . Hence , it is challenging to learn EBMs with ratio matching on modern devices , such as GPUs , for high-dimensional discrete data . 3.2 RATIO MATCHING WITH GRADIENT-GUIDED IMPORTANCE SAMPLING . The key idea of our approach is to use the well-known importance sampling technique to reduce the variance of estimating JRM ( θ ) with Monte Carlo method . The most critical and challenging part of using the importance sampling technique is choosing a good proposal distribution . In this work , we propose to utilize the gradient of the energy function w.r.t . the discrete input x to approximately construct the optimal proposal distribution for importance sampling . We describe the details of our method below . The objective for each sample x , defined by Eq . ( 4 ) , can be reformulated as JRM ( θ , x ) = d d∑ i=1 1 d [ eEθ ( x ) −Eθ ( x−i ) ] 2 = dEx−i∼m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 , ( 5 ) where m ( x−i ) = 1d for i = 1 , · · · , d is a discrete distribution . Thus , the objective of ratio matching for each sample x can be viewed as the expectation of [ eEθ ( x ) −Eθ ( x−i ) ] 2 over the discrete distribu- tion m ( x−i ) . In the original ratio matching method , as described in Section 2.2 , we compute such expectation exactly by considering all possible x−i , leading to expensive computations and excessive memory usages as analyzed in Section 3.1 . Naturally , we can estimate the desired expectation with Monte Carlo method by considering fewer terms sampled based on m ( x−i ) . However , such estimation usually has a high variance , and is empirically verified to be ineffective by our experiments in Section 5 . Further , we can apply the importance sampling method to reduce the variance of Monte Carlo estimation . Intuitively , certain values have more impact on the expectation than others . Hence , the estimator variance can be reduced if such important values are sampled more frequently than others . To be specific , instead of sampling based on the distribution m ( x−i ) , importance sampling aims to sample from another distribution n ( x−i ) , namely , proposal distribution . Formally , JRM ( θ , x ) = dEx−i∼m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 = dEx−i∼n ( x−i ) m ( x−i ) [ eEθ ( x ) −Eθ ( x−i ) ] 2 n ( x−i ) . ( 6 ) The detailed derivation of Eq . ( 6 ) is given in Appendix A . Afterwards , we can apply Monte Carlo estimation based on the proposal distribution n ( x−i ) . Specifically , we sample s terms , denoted as x ( 1 ) −i , · · · , x ( s ) −i , according to the proposal distribution n ( x−i ) . Note that s is usually chosen to be much smaller than d. Then the Monte Carlo estimation for JRM ( θ , x ) is computed based on these s terms . Formally , JRM ( θ , x ) ̂n = d 1 s s∑ t=1 m ( x ( t ) −i ) [ eEθ ( x ) −Eθ ( x ( t ) −i ) ] 2 n ( x ( t ) −i ) , x ( t ) −i ∼ n ( x−i ) . ( 7 ) It is known that the estimator obtained by Monte Carlo estimation with importance sampling is an unbiased estimator , as the conventional Monte Carlo estimator . The key point of importance sampling is to choose an appropriate proposal distribution n ( x−i ) , which determines the variance of the corresponding estimator . The optimal proposal distribution n∗ ( x−i ) , which yields the minimum variance , is given by the following theorem . Theorem 1 . Let n∗ ( x−i ) = [ eEθ ( x ) −Eθ ( x−i ) ] 2∑d k=1 [ e Eθ ( x ) −Eθ ( x−k ) ] 2 be a discrete distribution on x−i , where i = 1 , · · · , d. Then for any discrete distribution n ( x−i ) on x−i , where i = 1 , · · · , d , we have V ar ( JRM ( θ , x ) ̂n∗ ) ≤ V ar ( JRM ( θ , x ) ̂n ) . Proof . The proof of Theorem 1 is included in Appendix B . To construct the exact optimal proposal distribution n∗ ( x−i ) given by Theorem 1 , we still have to evaluate the energies of all x−i , where i = 1 , · · · , d. To avoid such complexity , we propose to leverage the gradient of the energy function w.r.t . the discrete input x to approximately construct the optimal proposal distribution . Our approach only needs O ( 1 ) evaluations of the energy function to construct the proposal distribution . It is observed by Grathwohl et al . ( 2021 ) that many discrete distributions are implemented as continuous and differentiable functions , although they are evaluated only in discrete domains . Grathwohl et al . ( 2021 ) further proposes a scalable sampling method for discrete distributions by utilizing the gradients of the underlying continuous functions w.r.t . the discrete input . In this study , we extend this idea to improve ratio matching . More specifically , in our case , even though our input x is discrete , our parameterized energy function Eθ ( · ) , such as a neural network , is usually continuous and differentiable . Hence , we can use such gradient information to efficiently and approximately construct the optimal proposal distribution given by Theorem 1 . The basic idea is that we can approximate Eθ ( x−i ) based on the Taylor series of Eθ ( · ) at x , given that x−i is close to x in the data space because they only have differences in one dimension1 . Formally , Eθ ( x−i ) ≈ Eθ ( x ) + ( x−i − x ) T ∇xEθ ( x ) . ( 8 ) Thus , we can approximately obtain the desired term Eθ ( x ) −Eθ ( x−i ) in Theorem 1 using Eq . ( 8 ) . Note that ∇xEθ ( x ) ∈ Rd contains the information for approximating all Eθ ( x ) −Eθ ( x−i ) , where 1We have this assumption because data space is usually high-dimensional . If the number of data dimension is small , we can use the original ratio matching method with affordable time and memory budgets . Algorithm 1 Ratio Matching with Gradient-Guided Importance Sampling ( RMwGGIS ) Input : Observed dataset D = { x ( m ) } |D| m=1 , parameterized energy function Eθ ( · ) , number of samples s for Monte Carlo estimation with importance sampling 1 : for x ∼ D do ▷ Batch training is applied in practice 2 : Compute Eθ ( x ) 3 : Compute ∇xEθ ( x ) 4 : Compute the proposal distribution ñ∗ ( x−i ) = [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] i∑d k=1 [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] k ▷ Eq . ( 11 ) 5 : Sample s terms , denoted as x ( 1 ) −i , · · · , x ( s ) −i , according to ñ ∗ ( x−i ) 6 : Compute JRM ( θ , x ) ̂ñ∗ = d 1 s ∑s t=1 m ( x ( t ) −i ) [ e Eθ ( x ) −Eθ ( x ( t ) −i ) ] 2 ñ∗ ( x ( t ) −i ) ▷ Eq . ( 7 ) ( or Eq . ( 12 ) ) 7 : Update θ based on ∇θJRM ( θ , x ) ̂ñ∗ 8 : end for i = 1 , · · · , d. Hence , we can consider the following d-dimensional vector ( 2x− 1 ) ⊙∇xEθ ( x ) ∈ Rd , ( 9 ) where ⊙ denotes element-wise multiplication . Note that we have xi − x̄i = −1 if xi = 0 and xi − x̄i = 1 if xi = 1 , which can be unified as xi − x̄i = 2xi − 1 . Therefore , we have Eθ ( x ) − Eθ ( x−i ) ≈ [ ( 2x− 1 ) ⊙∇xEθ ( x ) ] i , i = 1 , · · · , d. ( 10 ) Afterwards , we can provide a proposal distribution ñ∗ ( x−i ) as an approximation of the optimal proposal distribution n∗ ( x−i ) given by Theorem 1 . Formally , ñ∗ ( x−i ) = [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] i∑d k=1 [ e2 ( 2x−1 ) ⊙∇xEθ ( x ) ] k , i = 1 , · · · , d. ( 11 ) Then ñ∗ ( x−i ) is used as the proposal distribution for Monte Carlo estimation with importance sampling , as described by Eq . ( 7 ) . The overall process of our RMwGGIS method is summarized in Algorithm 1 . | The paper propose a Monte Carlo approximation for the expensive ratio matching method for learning discrete energy-based models. The key idea is to first write the ratio matching objective as an expectation wrt a uniform distribution, then use importance sampling for a more efficient estimation, where the optimal proposal distribution can be approximated by the gradient of the energy wrt the data space. Empirically, such an approximation shows even better results than the original expensive objective, possibly due to regularization from stochasticity and more focus on neighbors with low energies. | SP:6d70759d66c94400778b2bad913422e2ea28dac5 |
Delayed Geometric Discounts: An alternative criterion for Reinforcement Learning | 1 INTRODUCTION . In the infinite horizon setting , and without further assumptions on the underlying Markov Decision Process ( MDP ) , available RL algorithms learn optimal policies only in the sense of the discounted cumulative rewards ( Puterman , 2014 ) . While the geometric discounting is well suited to model a termination probability or an exponentially decaying interest in the future , it is not flexible enough to model alternative weighting of the returns . Consider for example settings where the agent is willing to sacrifice short term rewards in favor of the long term outcome . Clearly , for such situations , a discounted optimality criterion is limited and does not describe the actual objective function . This is particularly true in hard exploration tasks , where rewards can be sparse , deceptive or adversarial . In such scenarios , performing random exploration can rarely lead to successful states and thus rarely obtain meaningful feedback . Geometric discounts tend to fail in such scenarios . Consider for example the U-maze environment in Figure 1a , where the reinforcement signal provides a high reward ( +1 ) when reaching the green dot in the bottom arm , a deceptive reward ( +0.9 ) when reaching the blue dot in the upper arm , and a negative reward ( −1 ) for crossing the red corridor . If the agent is only interested in the long term returns , then the optimal control should always lead to the green dot . However , depending on the initial state , optimal policies in the sense of the discounted RL problem are likely to prefer the deceptive reward due to the exponentially decaying interest in the future ( Figure 1b ) . Naturally , higher discount factors are associated with optimal policies that also optimize the average returns ( Blackwell , 1962 ) , which can solve in principle the described hard exploration problem . However , in practice , such discount values can be arbitrarily close to 1 which entails severe computational instabilities . In addition , and particularly in continuous settings or when tasks span over extremely long episodes , discount-based RL approaches are sample-inefficient and are slow at propagating interesting feed-backs to early states . In this paper , we generalize the geometric discount to derive a variety of alternative time weighting distributions and we investigate the underlying implications of solving the associated RL problem both theoretically and practically . Our contributions are twofold . First , we introduce a novel family that generalizes the geometrically discounted criteria , which we call the delayed discounted criteria . Second , we derive tractable solutions for optimal control for both stationary and non-stationary policies using these novel criteria . Finally , we evaluate our methods on both hard exploration tabular environments and continuous long-episodic robotics tasks where we show that : 1 . Our agents can solve the hard exploration problem in a proof of concept setup . 2 . Our methods improve sample-efficiency on continuous robotics tasks compared to Soft- Actor-Critic . Figure 1c showcases how non-geometrically discounted criteria impacts the profile of optimal value function in the U-maze example . 2 REINFORCEMENT LEARNING WITH NON GEOMETRIC DISCOUNT . Consider an infinite horizon Markov Decision Process ( MDP ) M = { S , A , P , r , γ , p0 } , where S and A are either finite or compact subsets of respectively Rd and Rd′ , ( d , d′ ) ∈ N2 , P : S × A → ∆ ( S ) is a state transition kernel1 , r : S × A → R is a continuous reward function , p0 ∈ ∆ ( S ) an initial state distribution and γ ∈ ( 0 , 1 ) is the discount factor . A policy π is a mapping indicating , at each time step t ∈ N , the action at to be chosen at the current state st . The goal of geometrically discounted reinforcement learning algorithms is to optimize the discounted returns : L ( π , r ) : = Eπ , p0 [ ∞∑ t=0 γtrt ] ; rt : = r ( st , at ) where Eπ , p0 denotes the expectation over trajectories generated in M using the policy π and initialised according to p0 . In this section , we present our methods . First , Section 2.1 introduces our delayed discounted family of optimality criteria . Then , Section 2.2 investigates the optimization of the linear combination of this new family in the context of stationary policies . Finally , Section 2.3 generalizes the optimal control to non-stationary policies . 2.1 BEYOND THE GEOMETRIC DISCOUNT : A DELAYED DISCOUNTED CRITERION . We propose to investigate a particular parametric family of optimality criteria that is defined by a sequence of discount factors . For a given delay parameter D ∈ N , we define the discount factors γd ∈ ( 0 , 1 ) for any integer d ∈ [ 0 , D ] and we consider the following loss function : LD ( π , r ) : = Eπ , p0 [ ∞∑ t=0 ΦD ( t ) rt ] where ΦD ( t ) : = ∑ { ad∈N } Dd=0 such that ∑ d ad=t N∏ d=0 γadd ( 1 ) This class of optimality criteria can be seen as a generalization of the classical geometric discount . In fact , we highlight that for D = 0 , Φ0 ( t ) = γt0 which implies that L0 ( π , r ) = L ( π , r ) for any policy π and any reward function r. In Figure 2 , we report the normalized distribution of the weights ΦD ( t ) ( i.e . y ( t ) = ΦD ( t ) ∑ i ΦD ( i ) ) over time as we vary the parameter D ∈ { 0 , . . . , 9 } . Notice how the mode of the probability distribution is shifted towards the right as we increased the delay , thus putting more weights on future time steps . 1∆ ( S ) denotes the set of probability measures over S Intuitively , the proposed criterion ( LD ) describes the goal of an agent that discards short term gains in favor of long term discounted returns . In the following , we consider yet a more diverse problem formulation by using a linear combination of the delayed losses . Let Lη be the following objective function defined as : Lη ( π , r ) : = Eπ , p0 [ ∑ t η ( t ) rt ] such that η ( t ) = D∑ d=0 wdΦd ( t ) ( 2 ) where the depth D ∈ N and the coefficients wd ∈ R for any d ∈ [ 0 , D ] are known . In general , the optimal control in the sense of Lη is not stationary . However , learning solutions that admit compact representations is crucial for obvious computational reasons . In the following we propose to learn either the optimal stationary solution , or to approximate the optimal control with a non-stationary policy over a finite horizon followed by a stationary one . 2.2 OPTIMAL STATIONARY POLICIES . In this section , we propose to learn stationary solution using a policy-iteration like algorithmic scheme . As in the classical setting , the goal is to learn a control π∗ that maximizes the state-action value function Qπη : Qπη ( s , a ) = D∑ d=0 wdQ π d ( s , a ) where Q π d ( s , a ) : = Eπ [ ∞∑ t=0 Φd ( t ) rt|s0 , a0 = s , a ] ( 3 ) This is done by iteratively evaluatingQπη and then updating the policy to maximize the learned value function . Due to the linearity illustrated in Equation 3 , the policy evaluation step is reduced to the estimation of Qπd . In geometrically discounted setting , the value function is the fixed point of the Bellman optimality operator . Luckily , this property is also valid for the quantities Qπd : Proposition 1 For any discount parameters ( γd ) Dd=0 , the value functions QπD is the unique fixed point of the following γD-contraction : [ TDπ ( q ) ] ( s , a ) = Es′∼P ( s , a ) a′∼π ( s′ ) [ r ( s , a ) + D−1∑ d=0 γdQ π d ( s ′ , a′ ) ] ︸ ︷︷ ︸ : = rπD ( s , a ) +γDEs′∼P ( s , a ) a′∼π ( s′ ) [ q ( s′ , a′ ) ] . ( 4 ) The valueQπD of a policy π with respect to the delayed criterionLD is the state-action value function of the same policy using an augmented policy dependent reward rπD w.r.t . the γD-discounted returns . Intuitively , the instantaneous worth of an action ( rπD ) is the sum of the environments ’ myopic returns ( r ( s , a ) ) and the long term evaluations ( with lower delay parameters ( Qπd ) d < D ) . This has the beneficial side-effect of enhancing sample efficiency as it helps the agent to rapidly back-propagate long-term feed-backs to early states . This reduces the time needed to distinguish good from bad behaviors , particularly in continuous settings where function approximation are typically used to learn policies . This is discussed in details in Section 4.2 . Similarly to standard value based RL algorithms , given a data set of trajectories D = { s , a , s′ } , the value function Qπd can be approximated with parametric approximator Qθd by optimising J Q d ( θ ) : JQD ( θ ) = E s , a , s′∼D a′∼πφ ( s′ ) [ 1 2 ( Qθ − ( r ( s , a ) + D∑ d=0 γdQθ̄d ( s ′ , a′ ) ) 2 ) ] ( 5 ) As for the policy update step , inspired from the Soft-Actor-Critic ( SAC ) algorithm , we propose to optimize an entropy regularized soft Q-value using the following loss where α is a parameter : Jπη ( φ ) = −Es∼D , a∼πφ [ D∑ d=0 wdQθ̄d ( s , a ) − α log ( πφ ( a|s ) ) ] ( 6 ) We use Equations 5 and 6 to construct Algorithm 1 , a generalization of the SAC algorithm that approximates optimal stationary policies in the sense of Lη . In practice , this can be further improved using the double Q-network trick and the automatic tuning of the regularization parameter α . This is discussed in Appendix A.1 . Unfortunately , unlike the geometrically discounted setting , the policy improvement theorem is no longer guaranteed in the sense of Lη . This means that depending on the initialization parameters , Algorithm 1 can either converge to the optimal stationary control or get stuck in a loop of sub-optimal policies . This is discussed in detail in Section 4.1 . Algorithm 1 Generalized Soft Actor Critic 1 : Input : initial parameters ( θd ) Dd=0 , φ , learning rates ( λd ) Dd=0 , λπ , pollyak parameter τ 2 : initialise target network θ̄d ← θd and initialise replay buffer D ← ∅ 3 : for each iteration do 4 : for each environment step do 5 : at ∼ πφ ( st ) , st+1 ∼ P ( st , at ) , D ← D ∪ { ( st , at , st+1 , ct ) } 6 : for d ∈ [ 0 , D ] do 7 : for each Qd gradient step do 8 : update parameter θd ← θd − λd∇̂θdJ Q d ( θd ) and update target θ̄d ← τ θ̄d + ( 1− τ ) θd 9 : for each policy update do 10 : update policy φ← φ− λπ∇̂φJπη ( φ ) 11 : Return : πφ , ( Qθ̄d ) D d=0 | The paper proposes an optimality criterion for RL that is generalizes the standard exponential discount commonly used in a large volume of RL research. In particular, the paper proposes substituting the standard discount term $\gamma^t$ by a generalized discount term $\Phi_D(t)$ built from a set of discounts $\gamma_0,\ldots,\gamma_D$. The discount terms $\Phi_D$ can be defined recursively as - $\Phi_0(t)=\gamma_0^t$ (corresponding to the standard exponential discounting); - $\Phi_D(t)=\sum_{k=0}^t\gamma_D^k\Phi_{D-1}(t-k)$ The consideration of non-uniform discounting implies that the resulting optimal policies may, in general, be non-stationary. Nevertheless, the paper introduces an equivalent to the $Q$-functions in the standard RL formulation and shows that these functions can be computed using standard dynamic programming. Letting $Q_d^\pi(s,a)=E\left[\sum_{t=0}^\infty\Phi_d(t)r_t\mid s_0=s,a_0=a\right]$, it follows that $Q_0^\pi$ corresponds to the standard $Q^\pi$ with discount factor $\gamma_0$, and each $Q_d^\pi$ can be computed from $Q_{d-1}^\pi$ using a dynamic programming operator $T_\pi^d$ that has $Q_d^\pi$ as its unique fixed point. These functions can also be computed using existing RL algorithms as part of a generalized policy iteration cycle that---upon convergence---may yield an "optimal stationary policy" (convergence is not guaranteed, though). The paper also proposes an approximate policy that breaks down the value function for the problem into two terms---one that accounts for the rewards in the first $H$ steps and the other for the remaining steps. Under mild conditions on the discounts $\gamma_0,\ldots,\gamma_D$, the latter term can be approximated by the standard optimal value function (with standard exponential discounting) for large $H$, allowing for the computation of an approximate (non-stationary) policy. | SP:27c8b1b419259661fd5388f4a53055f90fe0b4f9 |
Delayed Geometric Discounts: An alternative criterion for Reinforcement Learning | 1 INTRODUCTION . In the infinite horizon setting , and without further assumptions on the underlying Markov Decision Process ( MDP ) , available RL algorithms learn optimal policies only in the sense of the discounted cumulative rewards ( Puterman , 2014 ) . While the geometric discounting is well suited to model a termination probability or an exponentially decaying interest in the future , it is not flexible enough to model alternative weighting of the returns . Consider for example settings where the agent is willing to sacrifice short term rewards in favor of the long term outcome . Clearly , for such situations , a discounted optimality criterion is limited and does not describe the actual objective function . This is particularly true in hard exploration tasks , where rewards can be sparse , deceptive or adversarial . In such scenarios , performing random exploration can rarely lead to successful states and thus rarely obtain meaningful feedback . Geometric discounts tend to fail in such scenarios . Consider for example the U-maze environment in Figure 1a , where the reinforcement signal provides a high reward ( +1 ) when reaching the green dot in the bottom arm , a deceptive reward ( +0.9 ) when reaching the blue dot in the upper arm , and a negative reward ( −1 ) for crossing the red corridor . If the agent is only interested in the long term returns , then the optimal control should always lead to the green dot . However , depending on the initial state , optimal policies in the sense of the discounted RL problem are likely to prefer the deceptive reward due to the exponentially decaying interest in the future ( Figure 1b ) . Naturally , higher discount factors are associated with optimal policies that also optimize the average returns ( Blackwell , 1962 ) , which can solve in principle the described hard exploration problem . However , in practice , such discount values can be arbitrarily close to 1 which entails severe computational instabilities . In addition , and particularly in continuous settings or when tasks span over extremely long episodes , discount-based RL approaches are sample-inefficient and are slow at propagating interesting feed-backs to early states . In this paper , we generalize the geometric discount to derive a variety of alternative time weighting distributions and we investigate the underlying implications of solving the associated RL problem both theoretically and practically . Our contributions are twofold . First , we introduce a novel family that generalizes the geometrically discounted criteria , which we call the delayed discounted criteria . Second , we derive tractable solutions for optimal control for both stationary and non-stationary policies using these novel criteria . Finally , we evaluate our methods on both hard exploration tabular environments and continuous long-episodic robotics tasks where we show that : 1 . Our agents can solve the hard exploration problem in a proof of concept setup . 2 . Our methods improve sample-efficiency on continuous robotics tasks compared to Soft- Actor-Critic . Figure 1c showcases how non-geometrically discounted criteria impacts the profile of optimal value function in the U-maze example . 2 REINFORCEMENT LEARNING WITH NON GEOMETRIC DISCOUNT . Consider an infinite horizon Markov Decision Process ( MDP ) M = { S , A , P , r , γ , p0 } , where S and A are either finite or compact subsets of respectively Rd and Rd′ , ( d , d′ ) ∈ N2 , P : S × A → ∆ ( S ) is a state transition kernel1 , r : S × A → R is a continuous reward function , p0 ∈ ∆ ( S ) an initial state distribution and γ ∈ ( 0 , 1 ) is the discount factor . A policy π is a mapping indicating , at each time step t ∈ N , the action at to be chosen at the current state st . The goal of geometrically discounted reinforcement learning algorithms is to optimize the discounted returns : L ( π , r ) : = Eπ , p0 [ ∞∑ t=0 γtrt ] ; rt : = r ( st , at ) where Eπ , p0 denotes the expectation over trajectories generated in M using the policy π and initialised according to p0 . In this section , we present our methods . First , Section 2.1 introduces our delayed discounted family of optimality criteria . Then , Section 2.2 investigates the optimization of the linear combination of this new family in the context of stationary policies . Finally , Section 2.3 generalizes the optimal control to non-stationary policies . 2.1 BEYOND THE GEOMETRIC DISCOUNT : A DELAYED DISCOUNTED CRITERION . We propose to investigate a particular parametric family of optimality criteria that is defined by a sequence of discount factors . For a given delay parameter D ∈ N , we define the discount factors γd ∈ ( 0 , 1 ) for any integer d ∈ [ 0 , D ] and we consider the following loss function : LD ( π , r ) : = Eπ , p0 [ ∞∑ t=0 ΦD ( t ) rt ] where ΦD ( t ) : = ∑ { ad∈N } Dd=0 such that ∑ d ad=t N∏ d=0 γadd ( 1 ) This class of optimality criteria can be seen as a generalization of the classical geometric discount . In fact , we highlight that for D = 0 , Φ0 ( t ) = γt0 which implies that L0 ( π , r ) = L ( π , r ) for any policy π and any reward function r. In Figure 2 , we report the normalized distribution of the weights ΦD ( t ) ( i.e . y ( t ) = ΦD ( t ) ∑ i ΦD ( i ) ) over time as we vary the parameter D ∈ { 0 , . . . , 9 } . Notice how the mode of the probability distribution is shifted towards the right as we increased the delay , thus putting more weights on future time steps . 1∆ ( S ) denotes the set of probability measures over S Intuitively , the proposed criterion ( LD ) describes the goal of an agent that discards short term gains in favor of long term discounted returns . In the following , we consider yet a more diverse problem formulation by using a linear combination of the delayed losses . Let Lη be the following objective function defined as : Lη ( π , r ) : = Eπ , p0 [ ∑ t η ( t ) rt ] such that η ( t ) = D∑ d=0 wdΦd ( t ) ( 2 ) where the depth D ∈ N and the coefficients wd ∈ R for any d ∈ [ 0 , D ] are known . In general , the optimal control in the sense of Lη is not stationary . However , learning solutions that admit compact representations is crucial for obvious computational reasons . In the following we propose to learn either the optimal stationary solution , or to approximate the optimal control with a non-stationary policy over a finite horizon followed by a stationary one . 2.2 OPTIMAL STATIONARY POLICIES . In this section , we propose to learn stationary solution using a policy-iteration like algorithmic scheme . As in the classical setting , the goal is to learn a control π∗ that maximizes the state-action value function Qπη : Qπη ( s , a ) = D∑ d=0 wdQ π d ( s , a ) where Q π d ( s , a ) : = Eπ [ ∞∑ t=0 Φd ( t ) rt|s0 , a0 = s , a ] ( 3 ) This is done by iteratively evaluatingQπη and then updating the policy to maximize the learned value function . Due to the linearity illustrated in Equation 3 , the policy evaluation step is reduced to the estimation of Qπd . In geometrically discounted setting , the value function is the fixed point of the Bellman optimality operator . Luckily , this property is also valid for the quantities Qπd : Proposition 1 For any discount parameters ( γd ) Dd=0 , the value functions QπD is the unique fixed point of the following γD-contraction : [ TDπ ( q ) ] ( s , a ) = Es′∼P ( s , a ) a′∼π ( s′ ) [ r ( s , a ) + D−1∑ d=0 γdQ π d ( s ′ , a′ ) ] ︸ ︷︷ ︸ : = rπD ( s , a ) +γDEs′∼P ( s , a ) a′∼π ( s′ ) [ q ( s′ , a′ ) ] . ( 4 ) The valueQπD of a policy π with respect to the delayed criterionLD is the state-action value function of the same policy using an augmented policy dependent reward rπD w.r.t . the γD-discounted returns . Intuitively , the instantaneous worth of an action ( rπD ) is the sum of the environments ’ myopic returns ( r ( s , a ) ) and the long term evaluations ( with lower delay parameters ( Qπd ) d < D ) . This has the beneficial side-effect of enhancing sample efficiency as it helps the agent to rapidly back-propagate long-term feed-backs to early states . This reduces the time needed to distinguish good from bad behaviors , particularly in continuous settings where function approximation are typically used to learn policies . This is discussed in details in Section 4.2 . Similarly to standard value based RL algorithms , given a data set of trajectories D = { s , a , s′ } , the value function Qπd can be approximated with parametric approximator Qθd by optimising J Q d ( θ ) : JQD ( θ ) = E s , a , s′∼D a′∼πφ ( s′ ) [ 1 2 ( Qθ − ( r ( s , a ) + D∑ d=0 γdQθ̄d ( s ′ , a′ ) ) 2 ) ] ( 5 ) As for the policy update step , inspired from the Soft-Actor-Critic ( SAC ) algorithm , we propose to optimize an entropy regularized soft Q-value using the following loss where α is a parameter : Jπη ( φ ) = −Es∼D , a∼πφ [ D∑ d=0 wdQθ̄d ( s , a ) − α log ( πφ ( a|s ) ) ] ( 6 ) We use Equations 5 and 6 to construct Algorithm 1 , a generalization of the SAC algorithm that approximates optimal stationary policies in the sense of Lη . In practice , this can be further improved using the double Q-network trick and the automatic tuning of the regularization parameter α . This is discussed in Appendix A.1 . Unfortunately , unlike the geometrically discounted setting , the policy improvement theorem is no longer guaranteed in the sense of Lη . This means that depending on the initialization parameters , Algorithm 1 can either converge to the optimal stationary control or get stuck in a loop of sub-optimal policies . This is discussed in detail in Section 4.1 . Algorithm 1 Generalized Soft Actor Critic 1 : Input : initial parameters ( θd ) Dd=0 , φ , learning rates ( λd ) Dd=0 , λπ , pollyak parameter τ 2 : initialise target network θ̄d ← θd and initialise replay buffer D ← ∅ 3 : for each iteration do 4 : for each environment step do 5 : at ∼ πφ ( st ) , st+1 ∼ P ( st , at ) , D ← D ∪ { ( st , at , st+1 , ct ) } 6 : for d ∈ [ 0 , D ] do 7 : for each Qd gradient step do 8 : update parameter θd ← θd − λd∇̂θdJ Q d ( θd ) and update target θ̄d ← τ θ̄d + ( 1− τ ) θd 9 : for each policy update do 10 : update policy φ← φ− λπ∇̂φJπη ( φ ) 11 : Return : πφ , ( Qθ̄d ) D d=0 | **Summary.** This paper proposes a generalization to the typical geometric discounting scheme in reinforcement learning. In particular, a new _delayed_ discount criterion is proposed (Equation 1) that captures traditional geometric discounting when $D=0$, but also allows for other kinds of temporal preferences. Figure 2 provides a clean visual illustrating the different kinds of discounting afforded for different settings of $D$. Following this, several natural questions emerge: What happens to the $\gamma$-contraction in repeated application of the Bellman Operator? Proposition 1 addresses this question by stating that a $\gamma_D$-contraction is still guaranteed. How might typical reinforcement learning algorithms handle this new discounting scheme? The paper addresses this question by introducing two new algorithms. The first (Algorithm 1) is a generalization of Soft Actor Critic, while the second (Algorithm 2) is a policy-based algorithm that approximates the finite horizon problem. The first set of experiments focus on three maze problems. Estimates of the expected returns of learned stationary policies are reported for Algorithm 1 under four conditions as the depth $D$ is changed from 0 up to 8. The main finding is that as $D$, returns do tend to increase up to a certain point, at which point it drops (around when $D = 6$ or $7$). Further experiments inspect the performance of Algorithm 2 in a similar way (Figure 5), and contrast the performance of Algorithm 1 with typical SAC on continuous control games like Ant-v2. On the chosen four games (Figure 6), the average reward of GSAC improves over SAC slightly, though the variance is arguably slightly higher. | SP:27c8b1b419259661fd5388f4a53055f90fe0b4f9 |
Disentangling Properties of Contrastive Methods | 1 INTRODUCTION . Learning a disentangled representation is a long-desired goal in the deep learning community ( Bengio et al. , 2013 ; Peters et al. , 2017 ; Goodfellow et al. , 2016 ; Bengio et al. , 2007 ; Schmidhuber , 1992 ; Lake et al. , 2017 ; Tschannen et al. , 2018 ) . A disentangled representation matches how humans understand the world and provides many other benefits besides model interpretability ( Bengio et al. , 2013 ; Chen et al. , 2016 ; Kulkarni et al. , 2015 ) . And it usually needs much fewer labels to learn challenging downstream tasks ( van Steenkiste et al. , 2019 ) . It also generalizes much better even in face of examples generated by an unseen combination of the attribute values ( Achille et al. , 2018 ) . Given its importance and potential large impacts on downstream applications , disentangled representation learning has recently attracted great attention . Previous research has proposed a lot of methods , either built on variational auto-encoders ( Kingma & Welling , 2013 ) , such as β-VAE ( Higgins et al. , 2016 ) and FactorVAE ( Kim & Mnih , 2018 ) , or generative adversarial network ( Goodfellow et al. , 2014 ) , such as InfoGAN ( Chen et al. , 2016 ) and InfoGAN-CR ( Lin et al. , 2020 ) . Those methods have achieved preliminary successes on synthetic datasets such as dSprites ( Matthey et al. , 2017 ) and 3Dshapes ( Burgess & Kim , 2018 ) . Albeit the initial successes , those synthetic datasets are limited in many aspects , for example , the background is usually clean and composed of a single color , the number of objects is small and the objects are mainly 2D without texture and occlusions . It is still an open question to scale those models to real-world complex datasets . It is even non-trivial to scale basic generative models to complex datasets to learn disentangled features , such as ImageNet ( Deng et al. , 2009 ) . In this paper , instead of studying disentanglement feature learning with a generative model , we investigate whether the discriminatively-trained contrastive models have the disentanglement property . Contrastive learning is a class of self-supervised learning methods that pull two augmentations of the same image close . The recent contrastive methods have achieved state-of-the-art performance on the image pretraining tasks . Representative methods include MoCo ( He et al. , 2020 ) , BYOL ( Grill et al. , 2020 ) , SimCLR ( Chen et al. , 2020 ) and SwAV ( Caron et al. , 2020 ) , etc . Contrastive learning has been proven to learn good visual representations from large-scale datasets . We continue to investigate the disentanglement property of their learned representations in this work . To our surprise , we find that the widely used BYOL algorithm without any auxiliary loss exhibits strong feature disentanglement property . However , the disentanglement of contrastive learning is a weaker form of disentanglement . It follows the pattern that a representation dimension is disentangled to correspond to a single factor but a single ground truth factor might appear in multiple latent feature dimensions . We name this type of disentanglement as “ group disentanglement ” . Although group disentanglement is a weaker form of disentanglement , we hypothesize that directly learning a compact and disentangled representation might be hard , due to the lottery ticket hypothesis ( Frankle & Carbin , 2018 ) . Pursuing group disentanglement instead of full disentanglement might be necessary to achieve disentanglement on the complex real-world dataset . The reason is probably that real-world images usually contain more details and noise , and a “ factor ” might be always correlated to some other visual existence due to dataset bias . A good example is a ship that usually comes together with a large area of blue background in existing datasets . Further , we find that contrastively trained representation achieves the state-of-the-art FactorVAE disentanglement score when evaluated on established benchmarks , such as Car3D ( Reed et al. , 2015 ) , dSprites ( Matthey et al. , 2017 ) and SmallNORB ( LeCun et al. , 2004 ) . Besides the widely used synthetic benchmarks , we also evaluate the contrastive method on the CelebA ( Liu et al. , 2018 ) human faces real-world dataset . We find that it also achieves better or comparable performances than the other methods on five commonly used disentanglement metrics . In summary , our contributions in this paper is mainly empirical and include the follows : 1 . We show that a contrastive method , in particular BYOL , learns “ group-disentangled ” representations , without any extra auxiliary losses . 2 . The contrastive method achieves the state-of-the-art performance on several widely used disentanglement learning benchmarks . 3 . We propose to quantitatively evaluate disentanglements on a real-world dataset , which avoids the biases of synthetic images . Our contrastive method also achieves state-of-the-art performance on this benchmark . 2 RELATED WORKS . Disentangled Representation Learning Disentangled representation is desired as it represents a human interpretable pattern ( Bengio et al. , 2013 ; Chen et al. , 2016 ; Kulkarni et al. , 2015 ) , enabling the downstream tasks learned more easily ( van Steenkiste et al. , 2019 ) and generalizes better ( Achille et al. , 2018 ) . In this paper , we consider the fully unsupervised disentangled representation learning setting , i.e . we assume no annotations on which factors should be learned . We notice the recent study of disentanglement is promoted by two communities : Disentanglement in Deep Features and Independent Component Analysis . Their research previously lie on different assumptions , data patterns , and evaluation metrics . One community is motivated by the newly raised deep learning for encouraging disentangled representation over independent factors . they have shown much empirical progress on this problem and they directly term their goal as “ disentanglement ” . The related study is usually based on deep generative models . For instance , VAE-based methods have achieved successes on this task ( Higgins et al. , 2016 ; Kim & Mnih , 2018 ; Chen et al. , 2018 ; Kumar et al. , 2017 ) . Besides , Generative Adversarial Networks ( GAN ) ( Goodfellow et al. , 2014 ; Chen et al. , 2016 ) are also put into the discussion of encouraging representations ’ disentanglement . More recently , people have shown that the GAN-based approach can achieve competitive performance as the above VAE variants ( Lin et al. , 2020 ; Jeon et al. , 2018 ; Lee et al. , 2020b ) . A recent work ( Locatello et al. , 2019 ) summarizes the popular methods and metrics in this community and proposes a tool for evaluation called disentanglement lib , including popular metrics such as DCI ( Eastwood & Williams , 2018 ) , SAP ( Kumar et al. , 2017 ) , MIG ( Chen et al. , 2018 ) and so on . Besides this series of studies , exploring underlying factors of variation in data pattern is a longstanding goal of the Independent Component Analysis ( ICA ) community ( Hyvärinen & Oja , 2000 ) . They share many similarities , for example , generative models , e.g. , VAEs , are recently popular in both ( Khemakhem et al. , 2020a ; Klindt et al. , 2020 ) . ICA usually has different assumptions with the “ purely unsupervised learning ” ( Hälvä et al. , 2021 ) . For example , the pattern of noise ( Hyvarinen & Morioka , 2016 ; Khemakhem et al. , 2020a ) or some additional auxiliary variables ( Hyvarinen et al. , 2019 ; Khemakhem et al. , 2020b ) can be observed . Traditionally , ICA uses identifiability to assess their desired representation pattern and the popular metric is Mean Correlation Coefficient ( MCC ) . SlowVAE ( Klindt et al. , 2020 ) recently makes a great effort to connect the two branches of study but it still requires additional information such as temporal transition pattern . As our study is for purely unsupervised learning and some assumptions of ICA methods can not be well matched , we mainly follow the settings and benchmark by disentanglement libk ( Locatello et al. , 2019 ) . Contrastive Learning Contrastive learning methods such as SimCLR ( Chen et al. , 2020 ) , MoCo ( He et al. , 2020 ) and BYOL ( Grill et al. , 2020 ) have achieved great successes to learn good visual representation from no label . They create “ views ” by applying augmentations over images . They treat two views of the same image as “ positive pairs ” , and views of all the other images as negatives . This setup is also known as examplar classification ( Dosovitskiy et al. , 2014 ) , or instance discrimination ( Wu et al. , 2018 ) . Representation learned by contrastive learning has shown great transfer capabilities to downstream tasks , such as object detection and semantic segmentation . More recently , there are a lot of works trying to understand contrastive learning either theoretically ( Wang & Isola , 2020 ; Arora et al. , 2019 ; Tsai et al. , 2020 ; Tosh et al. , 2021 ; Tian et al. , 2020b ; Lee et al. , 2020a ) or empirically ( Tian et al. , 2020a ; Zhao et al. , 2020 ; Purushwalkam & Gupta , 2020 ) . Zimmermann et al . ( 2021 ) suggests that the contrastive method can invert the data generation process . The conclusion is based on the analysis of Wang & Isola ( 2020 ) where negative samples are necessary and expected to be infinite . Zimmermann et al . ( 2021 ) make a good bridge between contrastive learning and independent analysis and study the model identifiability quantitatively in terms of MCC score . Compared with that , we focus more on more direct disentanglement analysis . Our contribution is more empirical but suggests the good disentanglement property of contrastive learning even without negative samples . 3 METHOD . In this paper , we explore whether contrastive methods learn a disentangled feature representation . If yes , under what condition it learns a disentangled representation . There are quite a few contrastive learning algorithms proposed ( Grill et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ; Caron et al. , 2020 ) . Although they differ on some specific aspects , they all aim to pull two augmentations of one image close . Without the uniformity property provided by negative samples ( Wang & Isola , 2020 ) , we find BYOL ( Grill et al. , 2020 ) still achieves unexpected good disentangled feature representation . 3.1 BYOL METHOD . BYOL is an unsupervised learning method that pulls two augmentation views of the same image close ( Grill et al. , 2020 ) to learn a high-level image representation . A significant difference of it against other contrastive learning is the absence of negative pairs during training . As shown in Figure 1 , for each image x , we obtain two views of it : x1 and x2 by data augmentations . One of them goes through the online network stream , and the other goes through the target network stream . The target network ’ s parameter is not trained by the gradient descent algorithm but set as the exponential moving average ( ema ) of the online network . Both the online and the target stream have a representation network ( encoder ) and a projection network . The online network has an extra prediction network after the projection network . The online stream ’ s output z1 and the target stream ’ s output z2 are pulled close to each other by requiring the two vectors to have similar directions in the latent space . More specifically , the loss function is L = − 〈z1 , z2〉 ‖z1‖2 ‖z2‖2 . In practice , the online representation network ( without the projection or the prediction network ) is usually the representation model for the downstream tasks . In this work , we follow the same convention , i.e . we study the disentanglement property of the output of the representation network . | This paper makes an interesting empirical observation - BYOL representations have better disentanglement properties, according to some metrics, than current specialized methods. Furthermore, the authors found that the selection of the normalization function affects the results. The authors also claim the dimensions are "group disentangled" although this is only shown on one dataset. | SP:9240db905d01022b6dc03f6789c3c853d8c84b4b |
Disentangling Properties of Contrastive Methods | 1 INTRODUCTION . Learning a disentangled representation is a long-desired goal in the deep learning community ( Bengio et al. , 2013 ; Peters et al. , 2017 ; Goodfellow et al. , 2016 ; Bengio et al. , 2007 ; Schmidhuber , 1992 ; Lake et al. , 2017 ; Tschannen et al. , 2018 ) . A disentangled representation matches how humans understand the world and provides many other benefits besides model interpretability ( Bengio et al. , 2013 ; Chen et al. , 2016 ; Kulkarni et al. , 2015 ) . And it usually needs much fewer labels to learn challenging downstream tasks ( van Steenkiste et al. , 2019 ) . It also generalizes much better even in face of examples generated by an unseen combination of the attribute values ( Achille et al. , 2018 ) . Given its importance and potential large impacts on downstream applications , disentangled representation learning has recently attracted great attention . Previous research has proposed a lot of methods , either built on variational auto-encoders ( Kingma & Welling , 2013 ) , such as β-VAE ( Higgins et al. , 2016 ) and FactorVAE ( Kim & Mnih , 2018 ) , or generative adversarial network ( Goodfellow et al. , 2014 ) , such as InfoGAN ( Chen et al. , 2016 ) and InfoGAN-CR ( Lin et al. , 2020 ) . Those methods have achieved preliminary successes on synthetic datasets such as dSprites ( Matthey et al. , 2017 ) and 3Dshapes ( Burgess & Kim , 2018 ) . Albeit the initial successes , those synthetic datasets are limited in many aspects , for example , the background is usually clean and composed of a single color , the number of objects is small and the objects are mainly 2D without texture and occlusions . It is still an open question to scale those models to real-world complex datasets . It is even non-trivial to scale basic generative models to complex datasets to learn disentangled features , such as ImageNet ( Deng et al. , 2009 ) . In this paper , instead of studying disentanglement feature learning with a generative model , we investigate whether the discriminatively-trained contrastive models have the disentanglement property . Contrastive learning is a class of self-supervised learning methods that pull two augmentations of the same image close . The recent contrastive methods have achieved state-of-the-art performance on the image pretraining tasks . Representative methods include MoCo ( He et al. , 2020 ) , BYOL ( Grill et al. , 2020 ) , SimCLR ( Chen et al. , 2020 ) and SwAV ( Caron et al. , 2020 ) , etc . Contrastive learning has been proven to learn good visual representations from large-scale datasets . We continue to investigate the disentanglement property of their learned representations in this work . To our surprise , we find that the widely used BYOL algorithm without any auxiliary loss exhibits strong feature disentanglement property . However , the disentanglement of contrastive learning is a weaker form of disentanglement . It follows the pattern that a representation dimension is disentangled to correspond to a single factor but a single ground truth factor might appear in multiple latent feature dimensions . We name this type of disentanglement as “ group disentanglement ” . Although group disentanglement is a weaker form of disentanglement , we hypothesize that directly learning a compact and disentangled representation might be hard , due to the lottery ticket hypothesis ( Frankle & Carbin , 2018 ) . Pursuing group disentanglement instead of full disentanglement might be necessary to achieve disentanglement on the complex real-world dataset . The reason is probably that real-world images usually contain more details and noise , and a “ factor ” might be always correlated to some other visual existence due to dataset bias . A good example is a ship that usually comes together with a large area of blue background in existing datasets . Further , we find that contrastively trained representation achieves the state-of-the-art FactorVAE disentanglement score when evaluated on established benchmarks , such as Car3D ( Reed et al. , 2015 ) , dSprites ( Matthey et al. , 2017 ) and SmallNORB ( LeCun et al. , 2004 ) . Besides the widely used synthetic benchmarks , we also evaluate the contrastive method on the CelebA ( Liu et al. , 2018 ) human faces real-world dataset . We find that it also achieves better or comparable performances than the other methods on five commonly used disentanglement metrics . In summary , our contributions in this paper is mainly empirical and include the follows : 1 . We show that a contrastive method , in particular BYOL , learns “ group-disentangled ” representations , without any extra auxiliary losses . 2 . The contrastive method achieves the state-of-the-art performance on several widely used disentanglement learning benchmarks . 3 . We propose to quantitatively evaluate disentanglements on a real-world dataset , which avoids the biases of synthetic images . Our contrastive method also achieves state-of-the-art performance on this benchmark . 2 RELATED WORKS . Disentangled Representation Learning Disentangled representation is desired as it represents a human interpretable pattern ( Bengio et al. , 2013 ; Chen et al. , 2016 ; Kulkarni et al. , 2015 ) , enabling the downstream tasks learned more easily ( van Steenkiste et al. , 2019 ) and generalizes better ( Achille et al. , 2018 ) . In this paper , we consider the fully unsupervised disentangled representation learning setting , i.e . we assume no annotations on which factors should be learned . We notice the recent study of disentanglement is promoted by two communities : Disentanglement in Deep Features and Independent Component Analysis . Their research previously lie on different assumptions , data patterns , and evaluation metrics . One community is motivated by the newly raised deep learning for encouraging disentangled representation over independent factors . they have shown much empirical progress on this problem and they directly term their goal as “ disentanglement ” . The related study is usually based on deep generative models . For instance , VAE-based methods have achieved successes on this task ( Higgins et al. , 2016 ; Kim & Mnih , 2018 ; Chen et al. , 2018 ; Kumar et al. , 2017 ) . Besides , Generative Adversarial Networks ( GAN ) ( Goodfellow et al. , 2014 ; Chen et al. , 2016 ) are also put into the discussion of encouraging representations ’ disentanglement . More recently , people have shown that the GAN-based approach can achieve competitive performance as the above VAE variants ( Lin et al. , 2020 ; Jeon et al. , 2018 ; Lee et al. , 2020b ) . A recent work ( Locatello et al. , 2019 ) summarizes the popular methods and metrics in this community and proposes a tool for evaluation called disentanglement lib , including popular metrics such as DCI ( Eastwood & Williams , 2018 ) , SAP ( Kumar et al. , 2017 ) , MIG ( Chen et al. , 2018 ) and so on . Besides this series of studies , exploring underlying factors of variation in data pattern is a longstanding goal of the Independent Component Analysis ( ICA ) community ( Hyvärinen & Oja , 2000 ) . They share many similarities , for example , generative models , e.g. , VAEs , are recently popular in both ( Khemakhem et al. , 2020a ; Klindt et al. , 2020 ) . ICA usually has different assumptions with the “ purely unsupervised learning ” ( Hälvä et al. , 2021 ) . For example , the pattern of noise ( Hyvarinen & Morioka , 2016 ; Khemakhem et al. , 2020a ) or some additional auxiliary variables ( Hyvarinen et al. , 2019 ; Khemakhem et al. , 2020b ) can be observed . Traditionally , ICA uses identifiability to assess their desired representation pattern and the popular metric is Mean Correlation Coefficient ( MCC ) . SlowVAE ( Klindt et al. , 2020 ) recently makes a great effort to connect the two branches of study but it still requires additional information such as temporal transition pattern . As our study is for purely unsupervised learning and some assumptions of ICA methods can not be well matched , we mainly follow the settings and benchmark by disentanglement libk ( Locatello et al. , 2019 ) . Contrastive Learning Contrastive learning methods such as SimCLR ( Chen et al. , 2020 ) , MoCo ( He et al. , 2020 ) and BYOL ( Grill et al. , 2020 ) have achieved great successes to learn good visual representation from no label . They create “ views ” by applying augmentations over images . They treat two views of the same image as “ positive pairs ” , and views of all the other images as negatives . This setup is also known as examplar classification ( Dosovitskiy et al. , 2014 ) , or instance discrimination ( Wu et al. , 2018 ) . Representation learned by contrastive learning has shown great transfer capabilities to downstream tasks , such as object detection and semantic segmentation . More recently , there are a lot of works trying to understand contrastive learning either theoretically ( Wang & Isola , 2020 ; Arora et al. , 2019 ; Tsai et al. , 2020 ; Tosh et al. , 2021 ; Tian et al. , 2020b ; Lee et al. , 2020a ) or empirically ( Tian et al. , 2020a ; Zhao et al. , 2020 ; Purushwalkam & Gupta , 2020 ) . Zimmermann et al . ( 2021 ) suggests that the contrastive method can invert the data generation process . The conclusion is based on the analysis of Wang & Isola ( 2020 ) where negative samples are necessary and expected to be infinite . Zimmermann et al . ( 2021 ) make a good bridge between contrastive learning and independent analysis and study the model identifiability quantitatively in terms of MCC score . Compared with that , we focus more on more direct disentanglement analysis . Our contribution is more empirical but suggests the good disentanglement property of contrastive learning even without negative samples . 3 METHOD . In this paper , we explore whether contrastive methods learn a disentangled feature representation . If yes , under what condition it learns a disentangled representation . There are quite a few contrastive learning algorithms proposed ( Grill et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ; Caron et al. , 2020 ) . Although they differ on some specific aspects , they all aim to pull two augmentations of one image close . Without the uniformity property provided by negative samples ( Wang & Isola , 2020 ) , we find BYOL ( Grill et al. , 2020 ) still achieves unexpected good disentangled feature representation . 3.1 BYOL METHOD . BYOL is an unsupervised learning method that pulls two augmentation views of the same image close ( Grill et al. , 2020 ) to learn a high-level image representation . A significant difference of it against other contrastive learning is the absence of negative pairs during training . As shown in Figure 1 , for each image x , we obtain two views of it : x1 and x2 by data augmentations . One of them goes through the online network stream , and the other goes through the target network stream . The target network ’ s parameter is not trained by the gradient descent algorithm but set as the exponential moving average ( ema ) of the online network . Both the online and the target stream have a representation network ( encoder ) and a projection network . The online network has an extra prediction network after the projection network . The online stream ’ s output z1 and the target stream ’ s output z2 are pulled close to each other by requiring the two vectors to have similar directions in the latent space . More specifically , the loss function is L = − 〈z1 , z2〉 ‖z1‖2 ‖z2‖2 . In practice , the online representation network ( without the projection or the prediction network ) is usually the representation model for the downstream tasks . In this work , we follow the same convention , i.e . we study the disentanglement property of the output of the representation network . | This work explores the disentangling properties of contrastive methods. The authors discover that contrastive methods, particularly BYOL, learns disentangled representations with just a change of normalization method in the encoder. The work also proposes a new concept called "group disentanglement", which is a relaxed version of the original disentanglement. BYOL learns representations with group disentanglement and achieves SOTA on disentanglement benchmarks on not only synthetic image datasets but also a real world dataset. | SP:9240db905d01022b6dc03f6789c3c853d8c84b4b |
Surrogate NAS Benchmarks: Going Beyond the Limited Search Spaces of Tabular NAS Benchmarks | The most significant barrier to the advancement of Neural Architecture Search ( NAS ) is its demand for large computational resources , which hinders scientifically sound empirical evaluations of NAS methods . Tabular NAS benchmarks have alleviated this problem substantially , making it possible to properly evaluate NAS methods in seconds on commodity machines . However , an unintended consequence of tabular NAS benchmarks has been a focus on extremely small architectural search spaces since their construction relies on exhaustive evaluations of the space . This leads to unrealistic results that do not transfer to larger spaces . To overcome this fundamental limitation , we propose a methodology to create cheap NAS surrogate benchmarks for arbitrary search spaces . We exemplify this approach by creating surrogate NAS benchmarks on the existing tabular NAS-Bench-101 and on two widely used NAS search spaces with up to 1021 architectures ( 1013 times larger than any previous tabular NAS benchmark ) . We show that surrogate NAS benchmarks can model the true performance of architectures better than tabular benchmarks ( at a small fraction of the cost ) , that they lead to faithful estimates of how well different NAS methods work on the original non-surrogate benchmark , and that they can generate new scientific insight . We open-source all our code and believe that surrogate NAS benchmarks are an indispensable tool to extend scientifically sound work on NAS to large and exciting search spaces . 1 INTRODUCTION . Neural Architecture Search ( NAS ) has seen huge advances in search efficiency , but the field has recently been criticized substantially for non-reproducible research , strong sensitivity of results to carefully-chosen training pipelines , hyperparameters and even random seeds ( Yang et al. , 2019 ; Li & Talwalkar , 2020 ; Lindauer & Hutter , 2020 ; Shu et al. , 2020 ; Yu et al. , 2020 ) . A leading cause that complicates reproducible research in NAS is the computational cost of even just single evaluations of NAS algorithms , not least in terms of carbon emissions ( Patterson et al. , 2021 ; Li et al. , 2021a ) . Tabular NAS benchmarks , such as NAS-Bench-101 ( Ying et al. , 2019 ) and NAS-Bench-201 ( Dong & Yang , 2020 ) , have been a game-changer for reproducible NAS research , for the first time allowing scientifically sound empirical evaluations of NAS methods with many seeds in minutes , while ruling out confounding factors , such as different search spaces , training pipelines or hardware/software versions . This success has recently led to the creation of many additional tabular NAS benchmarks , such as NAS-Bench-1shot1 ( Zela et al. , 2020b ) , NATS-Bench ( Dong et al. , 2021 ) , NAS-HPO-bench ( Klein & Hutter , 2019 ) , NAS-Bench-NLP ( Klyuchnikov et al. , 2020 ) , NAS-Bench-ASR ( Mehrotra et al. , 2021 ) , and HW-NAS-Bench ( Li et al. , 2021b ) ( see Appendix A.1 for more details on these previous NAS benchmarks ) . However , these tabular NAS benchmarks rely on an exhaustive evaluation of all architectures in a search space , limiting them to unrealistically small search spaces ( so far containing only between 6k and 423k architectures ) . This is a far shot from standard spaces used in the NAS literature , which contain more than 1018 architectures ( Zoph & Le , 2017 ; Liu et al. , 2019 ; Wu et al. , 2019a ) . This discrepancy can cause results gained on tabular NAS benchmarks to not generalize to realistic search spaces ; e.g. , promising anytime results of local search on tabular NAS benchmarks were indeed shown to not transfer to realistic search spaces ( White et al. , 2020b ) . Making things worse , as discussed in the panel of the most recent NAS workshop at ICLR 2021 , to succeed in automatically discovering qualitatively new types of architectures ( such as , e.g. , Transformers ( Vaswani et al. , 2017 ) ) the NAS community will have to focus on even more expressive search spaces in the future . To not give up the recent progress in terms of reproducibility that tabular NAS benchmarks have brought , we thus need to develop their equivalent for arbitrary search spaces . That is the goal of this paper . Our contributions . Our main contribution is to introduce the concept of surrogate NAS benchmarks that can be constructed for arbitrary NAS search spaces and allow for the same cheap query interface as tabular NAS benchmarks . We substantiate this contribution as follows : 1 . We demonstrate that a surrogate fitted on a subset of architectures can model the true performance of architectures better than a tabular benchmark ( Section 2 ) . 2 . We showcase our methodology by building surrogate benchmarks on a realistically-sized NAS search space ( up to 1021 possible architectures , i.e. , 1013 times more than any previous tabular NAS benchmark ) , thoroughly evaluating a range of regression models as surrogate candidates , and showing that strong generalization performance is possible even in large spaces ( Section 3 ) . 3 . We show that the search trajectories of various NAS optimizers running on the surrogate benchmarks closely resemble the ground truth trajectories . This enables sound simulations of runs usually requiring thousands of GPU hours in a few seconds on a single CPU machine ( Section 3 ) . 4 . We demonstrate that surrogate benchmarks can help in generating new scientific insights by rectifying a previous hypothesis on the performance of local search in large spaces ( Section 4 ) . To foster reproducibility , we open-source all our code , data , and surrogate NAS benchmarks.1 . 2 MOTIVATION – CAN WE DO BETTER THAN A TABULAR BENCHMARK ? . We start by motivating the use of surrogate benchmarks by exposing an issue of tabular benchmarks that has largely gone unnoticed . Tabular benchmarks are built around a costly , exhaustive evaluation of all possible architectures in a search space , and when an architecture ’ s performance is queried , the tabular benchmark simply returns the respective table entry . The issue with this process is that the stochasticity of mini-batch training is also reflected in the performance of an architecture i , hence making it a random variable Yi . Therefore , the table only contains results of a few draws yi ∼ Yi ( existing NAS benchmarks feature up to 3 runs per architecture ) . Given the variance in these evaluations , a tabular benchmark acts as a simple estimator that assumes independent random variables , and thus estimates the performance of an architecture based only on previous evaluations of the same architecture . From a machine learning perspective , knowing that similar architectures tend to yield similar performance and that the variance of individual evaluations can be high ( both shown to be the case by Ying et al . ( 2019 ) ) , it is natural to assume that better estimators may exist . In the remainder of this section , we empirically verify this hypothesis and show that surrogate benchmarks can provide better performance estimates than tabular benchmarks based on less data . Setup . For the analysis in this section , we choose NAS-Bench-101 ( Ying et al. , 2019 ) as a tabular benchmark and a Graph Isomorphism Network ( GIN , Xu et al . ( 2019a ) ) as our surrogate model . 2 Each architecture xi in NAS-Bench-101 contains 3 validation accuracies y1i , y 2 i , y 3 i from training xi with 3 different seeds . We excluded all diverged models with less than 50 % validation accuracy on any of the three evaluations in NAS-Bench-101 . We split this dataset to train the GIN surrogate model on 1https : //anonymous.4open.science/r/3f99ef91-c472-4394-b666-5d464e099aca 2We used a GIN implementation by Errica et al . ( 2020 ) ; see Appendix B for details on training the GIN . one of the seeds , e.g. , Dtrain = { ( xi , y1i ) } i and evaluate on the other two , e.g. , Dtest = { ( xi , ȳ23i ) } i , where ȳ23i = ( y 2 i + y 3 i ) /2 . Results . We compute the mean absolute error MAE = ∑ i |ŷi−ȳ 23 i | n of the surrogate model trained on Dtrain = { ( xi , y1i ) } i , where ŷi is the predicted validation accuracy and n = |Dtest| . Table 1 shows that the surrogate model yields a lower MAE than the tabular benchmark , i.e . MAE = ∑ i |y 1 i−ȳ 23 i | n . We also report the mean squared error and Kendall tau correlation coefficient in Table 4 in the appendix showing that the ranking between architectures is also predicted better by the surrogate . We repeat the experiment in a cross-validation fashion w.r.t to the seeds and conclude : In contrast to a single tabular entry , the surrogate model learns to smooth out the noise.3 Next , we fit the GIN surrogate on subsets of Dtrain and show in Figure 1 how its performance scales with the amount of training data used . The surrogate model performs better than the tabular benchmark when the training set has more than∼21,500 architectures . ( Note that Dtest remains the same as in the previous experiment , i.e. , it includes all 423k architectures in NAS-Bench-101 . ) As a result , we conclude that : A surrogate model can yield strong predictive performance when only a subset of the search space is available as training data . These empirical findings suggest that we can create reliable surrogate benchmarks for much larger and more realistic NAS spaces , which are infeasible to be exhaustively evaluated ( as would be required to construct tabular benchmarks ) . 3 GOING BEYOND SPACE SIZE LIMITS WITH SURROGATE BENCHMARKS . We now introduce the general methodology that we propose to effectively build realistic and reliable surrogate NAS benchmarks . We showcase this methodology by building surrogate benchmarks on two widely used search spaces and datasets , namely DARTS ( Liu et al. , 2019 ) + CIFAR-10 and FBNet ( Wu et al. , 2019a ) + CIFAR-100 . Having verified our surrogate NAS benchmark methodology on these well-known spaces , we strongly encourage the creation of additional future surrogate NAS benchmarks on a broad range of large and exciting search spaces , and the compute time saved by replacing expensive real experiments on the DARTS or FBNet space with cheap experiments on our surrogate versions of them might already be used for this purpose . We name our surrogate benchmarks depending on the space and surrogate model considered as follows : Surr-NAS-Bench- { space } - { surrogate } ( or , SNB- { space } - { surrogate } for short ) . For example , we introduce SNB-DARTS-GIN , which is a surrogate benchmark on the DARTS space and uses a GIN ( Xu et al. , 2019a ) as a surrogate model . 3.1 GENERAL METHODOLOGY AND SURR-NAS-BENCH-DARTS We first explain our methodology for the DARTS ( Liu et al. , 2019 ) search space , which consists of more than 1018 architectures . We selected this search space for two main reasons : ( 1 ) due to the huge number of papers building on DARTS and extending it , the DARTS search space , applied to CIFAR-10 is the most widely used non-tabular NAS benchmark in the literature , and as such it provides a convincing testbed for our surrogate benchmarks4 ; and ( 2 ) the surrogate benchmark we construct frees up the substantial compute resources that are currently being invested for experiments on this non-tabular benchmark ; we hope that these will instead be used to study additional novel and more exciting spaces and/or datasets . 3We note that the average estimation error of tabular benchmarks could be reduced by a factor of √ k by performing k runs per architecture . The error of surrogate models would also shrink when they are based on more data , but as k grows large tabular benchmarks would become competitive with surrogate models . 4In particular , the alternative of first constructing a new non-tabular benchmark and then building a surrogate benchmark for it would have been susceptible to many confounding factors . | This work explored how to use surrogate models to expand the existing (and limited) neural architecture search -- NAS -- benchmark. The new expanded benchmark is named as surrogate NAS benchmark. All codes are open-sourced, which demonstrated the good reproducibility of this work. The authors have conducted extensive experiments to demonstrate the usability of this new surrogate NAS benchmark and showed much analysis of existing NAS methods on this new benchmark. | SP:98df8621044599cf615f32412eb38d812d5be743 |
Surrogate NAS Benchmarks: Going Beyond the Limited Search Spaces of Tabular NAS Benchmarks | The most significant barrier to the advancement of Neural Architecture Search ( NAS ) is its demand for large computational resources , which hinders scientifically sound empirical evaluations of NAS methods . Tabular NAS benchmarks have alleviated this problem substantially , making it possible to properly evaluate NAS methods in seconds on commodity machines . However , an unintended consequence of tabular NAS benchmarks has been a focus on extremely small architectural search spaces since their construction relies on exhaustive evaluations of the space . This leads to unrealistic results that do not transfer to larger spaces . To overcome this fundamental limitation , we propose a methodology to create cheap NAS surrogate benchmarks for arbitrary search spaces . We exemplify this approach by creating surrogate NAS benchmarks on the existing tabular NAS-Bench-101 and on two widely used NAS search spaces with up to 1021 architectures ( 1013 times larger than any previous tabular NAS benchmark ) . We show that surrogate NAS benchmarks can model the true performance of architectures better than tabular benchmarks ( at a small fraction of the cost ) , that they lead to faithful estimates of how well different NAS methods work on the original non-surrogate benchmark , and that they can generate new scientific insight . We open-source all our code and believe that surrogate NAS benchmarks are an indispensable tool to extend scientifically sound work on NAS to large and exciting search spaces . 1 INTRODUCTION . Neural Architecture Search ( NAS ) has seen huge advances in search efficiency , but the field has recently been criticized substantially for non-reproducible research , strong sensitivity of results to carefully-chosen training pipelines , hyperparameters and even random seeds ( Yang et al. , 2019 ; Li & Talwalkar , 2020 ; Lindauer & Hutter , 2020 ; Shu et al. , 2020 ; Yu et al. , 2020 ) . A leading cause that complicates reproducible research in NAS is the computational cost of even just single evaluations of NAS algorithms , not least in terms of carbon emissions ( Patterson et al. , 2021 ; Li et al. , 2021a ) . Tabular NAS benchmarks , such as NAS-Bench-101 ( Ying et al. , 2019 ) and NAS-Bench-201 ( Dong & Yang , 2020 ) , have been a game-changer for reproducible NAS research , for the first time allowing scientifically sound empirical evaluations of NAS methods with many seeds in minutes , while ruling out confounding factors , such as different search spaces , training pipelines or hardware/software versions . This success has recently led to the creation of many additional tabular NAS benchmarks , such as NAS-Bench-1shot1 ( Zela et al. , 2020b ) , NATS-Bench ( Dong et al. , 2021 ) , NAS-HPO-bench ( Klein & Hutter , 2019 ) , NAS-Bench-NLP ( Klyuchnikov et al. , 2020 ) , NAS-Bench-ASR ( Mehrotra et al. , 2021 ) , and HW-NAS-Bench ( Li et al. , 2021b ) ( see Appendix A.1 for more details on these previous NAS benchmarks ) . However , these tabular NAS benchmarks rely on an exhaustive evaluation of all architectures in a search space , limiting them to unrealistically small search spaces ( so far containing only between 6k and 423k architectures ) . This is a far shot from standard spaces used in the NAS literature , which contain more than 1018 architectures ( Zoph & Le , 2017 ; Liu et al. , 2019 ; Wu et al. , 2019a ) . This discrepancy can cause results gained on tabular NAS benchmarks to not generalize to realistic search spaces ; e.g. , promising anytime results of local search on tabular NAS benchmarks were indeed shown to not transfer to realistic search spaces ( White et al. , 2020b ) . Making things worse , as discussed in the panel of the most recent NAS workshop at ICLR 2021 , to succeed in automatically discovering qualitatively new types of architectures ( such as , e.g. , Transformers ( Vaswani et al. , 2017 ) ) the NAS community will have to focus on even more expressive search spaces in the future . To not give up the recent progress in terms of reproducibility that tabular NAS benchmarks have brought , we thus need to develop their equivalent for arbitrary search spaces . That is the goal of this paper . Our contributions . Our main contribution is to introduce the concept of surrogate NAS benchmarks that can be constructed for arbitrary NAS search spaces and allow for the same cheap query interface as tabular NAS benchmarks . We substantiate this contribution as follows : 1 . We demonstrate that a surrogate fitted on a subset of architectures can model the true performance of architectures better than a tabular benchmark ( Section 2 ) . 2 . We showcase our methodology by building surrogate benchmarks on a realistically-sized NAS search space ( up to 1021 possible architectures , i.e. , 1013 times more than any previous tabular NAS benchmark ) , thoroughly evaluating a range of regression models as surrogate candidates , and showing that strong generalization performance is possible even in large spaces ( Section 3 ) . 3 . We show that the search trajectories of various NAS optimizers running on the surrogate benchmarks closely resemble the ground truth trajectories . This enables sound simulations of runs usually requiring thousands of GPU hours in a few seconds on a single CPU machine ( Section 3 ) . 4 . We demonstrate that surrogate benchmarks can help in generating new scientific insights by rectifying a previous hypothesis on the performance of local search in large spaces ( Section 4 ) . To foster reproducibility , we open-source all our code , data , and surrogate NAS benchmarks.1 . 2 MOTIVATION – CAN WE DO BETTER THAN A TABULAR BENCHMARK ? . We start by motivating the use of surrogate benchmarks by exposing an issue of tabular benchmarks that has largely gone unnoticed . Tabular benchmarks are built around a costly , exhaustive evaluation of all possible architectures in a search space , and when an architecture ’ s performance is queried , the tabular benchmark simply returns the respective table entry . The issue with this process is that the stochasticity of mini-batch training is also reflected in the performance of an architecture i , hence making it a random variable Yi . Therefore , the table only contains results of a few draws yi ∼ Yi ( existing NAS benchmarks feature up to 3 runs per architecture ) . Given the variance in these evaluations , a tabular benchmark acts as a simple estimator that assumes independent random variables , and thus estimates the performance of an architecture based only on previous evaluations of the same architecture . From a machine learning perspective , knowing that similar architectures tend to yield similar performance and that the variance of individual evaluations can be high ( both shown to be the case by Ying et al . ( 2019 ) ) , it is natural to assume that better estimators may exist . In the remainder of this section , we empirically verify this hypothesis and show that surrogate benchmarks can provide better performance estimates than tabular benchmarks based on less data . Setup . For the analysis in this section , we choose NAS-Bench-101 ( Ying et al. , 2019 ) as a tabular benchmark and a Graph Isomorphism Network ( GIN , Xu et al . ( 2019a ) ) as our surrogate model . 2 Each architecture xi in NAS-Bench-101 contains 3 validation accuracies y1i , y 2 i , y 3 i from training xi with 3 different seeds . We excluded all diverged models with less than 50 % validation accuracy on any of the three evaluations in NAS-Bench-101 . We split this dataset to train the GIN surrogate model on 1https : //anonymous.4open.science/r/3f99ef91-c472-4394-b666-5d464e099aca 2We used a GIN implementation by Errica et al . ( 2020 ) ; see Appendix B for details on training the GIN . one of the seeds , e.g. , Dtrain = { ( xi , y1i ) } i and evaluate on the other two , e.g. , Dtest = { ( xi , ȳ23i ) } i , where ȳ23i = ( y 2 i + y 3 i ) /2 . Results . We compute the mean absolute error MAE = ∑ i |ŷi−ȳ 23 i | n of the surrogate model trained on Dtrain = { ( xi , y1i ) } i , where ŷi is the predicted validation accuracy and n = |Dtest| . Table 1 shows that the surrogate model yields a lower MAE than the tabular benchmark , i.e . MAE = ∑ i |y 1 i−ȳ 23 i | n . We also report the mean squared error and Kendall tau correlation coefficient in Table 4 in the appendix showing that the ranking between architectures is also predicted better by the surrogate . We repeat the experiment in a cross-validation fashion w.r.t to the seeds and conclude : In contrast to a single tabular entry , the surrogate model learns to smooth out the noise.3 Next , we fit the GIN surrogate on subsets of Dtrain and show in Figure 1 how its performance scales with the amount of training data used . The surrogate model performs better than the tabular benchmark when the training set has more than∼21,500 architectures . ( Note that Dtest remains the same as in the previous experiment , i.e. , it includes all 423k architectures in NAS-Bench-101 . ) As a result , we conclude that : A surrogate model can yield strong predictive performance when only a subset of the search space is available as training data . These empirical findings suggest that we can create reliable surrogate benchmarks for much larger and more realistic NAS spaces , which are infeasible to be exhaustively evaluated ( as would be required to construct tabular benchmarks ) . 3 GOING BEYOND SPACE SIZE LIMITS WITH SURROGATE BENCHMARKS . We now introduce the general methodology that we propose to effectively build realistic and reliable surrogate NAS benchmarks . We showcase this methodology by building surrogate benchmarks on two widely used search spaces and datasets , namely DARTS ( Liu et al. , 2019 ) + CIFAR-10 and FBNet ( Wu et al. , 2019a ) + CIFAR-100 . Having verified our surrogate NAS benchmark methodology on these well-known spaces , we strongly encourage the creation of additional future surrogate NAS benchmarks on a broad range of large and exciting search spaces , and the compute time saved by replacing expensive real experiments on the DARTS or FBNet space with cheap experiments on our surrogate versions of them might already be used for this purpose . We name our surrogate benchmarks depending on the space and surrogate model considered as follows : Surr-NAS-Bench- { space } - { surrogate } ( or , SNB- { space } - { surrogate } for short ) . For example , we introduce SNB-DARTS-GIN , which is a surrogate benchmark on the DARTS space and uses a GIN ( Xu et al. , 2019a ) as a surrogate model . 3.1 GENERAL METHODOLOGY AND SURR-NAS-BENCH-DARTS We first explain our methodology for the DARTS ( Liu et al. , 2019 ) search space , which consists of more than 1018 architectures . We selected this search space for two main reasons : ( 1 ) due to the huge number of papers building on DARTS and extending it , the DARTS search space , applied to CIFAR-10 is the most widely used non-tabular NAS benchmark in the literature , and as such it provides a convincing testbed for our surrogate benchmarks4 ; and ( 2 ) the surrogate benchmark we construct frees up the substantial compute resources that are currently being invested for experiments on this non-tabular benchmark ; we hope that these will instead be used to study additional novel and more exciting spaces and/or datasets . 3We note that the average estimation error of tabular benchmarks could be reduced by a factor of √ k by performing k runs per architecture . The error of surrogate models would also shrink when they are based on more data , but as k grows large tabular benchmarks would become competitive with surrogate models . 4In particular , the alternative of first constructing a new non-tabular benchmark and then building a surrogate benchmark for it would have been susceptible to many confounding factors . | Overview: This work proposes a new NAS benchmark based on the results of surrogate models prediction. This surrogate model is able to predict all architectures in DARTS search space, which is about 10^18 possible architectures. The author compared the predict performance among different type of surrogate models and also leveraged surrogate models to investigate different NAS methods. | SP:98df8621044599cf615f32412eb38d812d5be743 |
Creating Training Sets via Weak Indirect Supervision | 1 INTRODUCTION . One of the greatest bottlenecks of using modern machine learning models is the need for substantial amounts of manually-labeled training data . In real-world applications , such manual annotations are typically time-consuming , labor-intensive and static . To reduce the efforts of annotation , researchers have proposed Weak Supervision ( WS ) frameworks ( Ratner et al. , 2016 ; 2018 ; 2019 ; Fu et al. , 2020 ) for synthesizing labels from multiple weak supervision sources , e.g. , heuristics , knowledge bases , or pre-trained classifiers . These frameworks have been widely applied on various machine learning tasks ( Dunnmon et al. , 2020 ; Fries et al. , 2021 ; Safranchik et al. , 2020 ; Lison et al. , 2020 ; Zhou et al. , 2020 ; Hooper et al. , 2021 ; Zhan et al. , 2019 ; Varma et al. , 2019 ) and industrial data ( Bach et al. , 2019 ) . Among them , data programming ( Ratner et al. , 2016 ) , one representative example that generalizes many approaches in the literature , represents weak supervision sources as labeling functions ( LFs ) and synthesizes training labels using Probabilistic Graphical Model ( PGM ) . Given both the increasing popularity of WS and the general increase in open-source availability of machine learning models and tools , there is a rising tide of available supervision sources that WS frameworks and practitioners could potentially leverage , including pre-trained machine learning models or prediction APIs ( Chen et al. , 2020 ; d ’ Andrea & Mintz , 2019 ; Yao et al. , 2017 ) . However , existing WS frameworks only utilize weak supervision sources with the same label space as the target task . This incompatibility largely limits the scope of usable sources , necessitating manual effort from domain experts to provide supervision for unseen labels . For example , consider target task of classifying { “ dog ” , “ wolf ” , “ cat ” , “ lion ” } and a set of three weak supervision sources ( e.g . trained classifiers or expert heuristics ) with disjoint output spaces { “ caninae ” , “ felidae ” } , { “ domestic animals ” , “ wild animals ” } and { “ husky ” , “ bengal cat ” } respectively . We call these types of sources indirect supervision sources . For concreteness , we follow the general convention of data programming ( Ratner et al. , 2016 ) and refer to these sources as indirect labeling functions ( ILFs ) . Despite their apparent utility , existing weak supervision methods could not directly leverage such ILFs , as their output spaces have no overlap with the target one . In this paper , we formulate a novel research problem that aims to leverage such ILFs automatically , minimizing the manual efforts to develop and deploy new models . We refer to this as the Weak Indirect Supervision ( WIS ) setting , a new Weak Supervision paradigm which leverages ILFs , along with the relational structures between individual labels , to automatically create training labels . The key difficulty of leveraging ILFs is due to the mismatched label spaces . To overcome this , we introduce pairwise relations between individual labels to the WIS setup , which are often available in structured sources ( e.g . off-the-shelf Knowledge Bases ( Miller , 1995 ; Sinha et al. , 2015 ; Dong et al. , 2020 ) or large scale label hierarchies ( Murty et al. , 2017 ; The Gene Ontology Consortium , 2018 ; Partalas et al. , 2015 ) for various domains ) , or can be provided by subject matter experts in far less time than generating entirely new sets of weak supervision sources . For example , in the aforementioned example , we could rely on a biological species ontology to see that the unseen labels “ dog ” and “ cat ” are both subsumed by the seen label “ domestic animals ” . Based on the label relations , we can automatically leverage the supervision sources as ILFs . Notably , previous work ( Qu et al. , 2020 ) also leveraged a label relation graph but was focused on relation extraction task in a few-shot learning setting , while You et al . ( 2020 ) proposed to learn label relations given data for each label in a transfer learning scenario . In contrast , we aim to solve the target task directly and without clean labeled data . The remaining questions are ( 1 ) how to synthesize labels based on pair-wise label relations and ILFs ? and ( 2 ) How can we know whether , given a set of ILFs and label relations , the unseen labels are distinguishable or not ? To address the first question , we develop a probabilistic label relation model ( PLRM ) , the first PGM for WIS which aggregates the output of ILFs and models the label relations as dependencies between random variables . In turn , we use the learned PLRM to produce labels for training an end model . Furthermore , we derive the generalization error bound of PLRM based on assumptions similar to previous work ( Ratner et al. , 2016 ) . The second question presents an important stumbling block when dealing with unseen labels , as we may not be able to distinguish the unseen labels given existing label relations and ILFs , resulting in an unsatisfactory synthesized training set . To address this issue , we formally introduce the notion of distinguishability in WIS setting and theoretically establish an equivalence between : ( 1 ) the distinguishability of the label relation structure as well as the ILFs , and ( 2 ) the capability of PLRM to distinguish unseen labels . This result then leads to a simple sanity test for preventing the model from failing to distinguish unseen labels . In preliminary experiments , we observe a significant drop in model performance when the condition is violated . In experiments , we make non-trivial adaptations for baselines from related settings to the new WIS problem . On both text and image classification tasks , we demonstrate the advantages of PLRM over adapted baselines . Finally , in a commercial advertising system where developers need to collect annotations for new ads tags , we illustrate how to formulate the training label collection as a WIS problem and apply PLRM to achieve an effective performance . Summary of Contributions . Our contributions are summarized as follows : • We formulate Weak Indirect Supervision ( WIS ) , a new research problem which synthesizes training labels based on indirect supervision sources and label relations , minimizing human efforts of both data annotation and weak supervision sources construction ; • We develop the first model for WIS , the Probabilistic Label Relation Model ( PLRM ) with comparable statistical efficiency to previous WS frameworks and standard supervised learning ; • We introduce a new notion of distinguishability in WIS setting , and provide a simple test of the distinguishability of PLRM for unseen labels by theoretically establishing the connection between the label relation structures and distinguishability ; • We showcase the potential of the WIS formulation and the effectiveness of PLRM in a commercial advertising system for synthesizing training labels of new ads tags . On academic image and text classification tasks , we demonstrate the advantages of PLRM over baselines by quantitative experiments . Overall , PLRM outperforms baselines by a margin of 2 % -9 % . 2 RELATED WORK . We briefly review related settings . The comparison between WIS and related tasks is in Table 1 . Weak Supervision : We draw motivation from recent work which model and integrate weak supervision sources using PGMs ( Ratner et al. , 2016 ; 2018 ; 2019 ; Fu et al. , 2020 ) and other methods ( Guan et al. , 2018 ; Khetan et al. , 2018 ) to create training sets . While they assume supervision sources share the same label space as the new tasks , we aim to leverage indirect supervision sources with mismatched label spaces in a labor-free way . Indirect Supervision : Indirect supervision arises more generally in latent-variable models for various domains ( Brown et al. , 1993 ; Liang et al. , 2013 ; Quattoni et al. , 2004 ; Chang et al. , 2010 ; Zhang et al. , 2019 ) . Very recently , Raghunathan et al . ( 2016 ) proposed to use the linear moment method for indirect supervision , wherein the transition between desired label space Y and indirect supervision space O is known , as well as the ground truth of indirect supervisions for training . In contrast , both are unavailable in WIS. Theoretically , Wang et al . ( 2020 ) developed a unified framework for analyzing the learnability of indirect supervision with shared or superset label spaces , while we focus on disjoint label spaces and the consequent unique challenge of distinguishability of unseen classes . Zero-Shot Learning : Zero-Shot Learning ( ZSL ) ( Lampert et al. , 2009 ; Wang et al. , 2019 ) aims to learn a classifier that is able to generalize to unseen classes . The WIS problem differentiates from ZSL by ( 1 ) in ZSL setting , the training and test data belong to seen and unseen classes , respectively , and training data is labeled , while for WIS , both training and test data belong to unseen classes and unlabeled ; ( 2 ) ZSL tends to render a classifier that could predict unseen classes given certain label information , e.g. , label attributes ( Romera-Paredes & Torr , 2015 ) , label descriptions ( Srivastava et al. , 2018 ) or label similarities ( Frome et al. , 2013 ) , while WIS aims to provide training labels for unlabeled training data , allowing users to train any machine learning models , and the label relations are used only in synthesizing training labels . 3 PRELIMINARY : WEAK SUPERVISION . We first describe the Weak Supervision ( WS ) setting . A glossary of notations used is in App . A. Definitions and notations . We assume a k-way classification task , and have an unlabeled dataset D consisting of m data points . Denote by Xi ∈ X the individual data point and Yi ∈ Y = { y1 , . . . , yk } the unobserved interested label of Xi . We also have n sources , each represented by a labeling function ( LF ) and denoted by λj . Each λj outputs a label Ŷ j i ∈ Yλj = { ŷj1 , . . . , ŷjkλj } on Xi , where Yλj is the label space associated with λj and |Yλj | = kλj . We denote the concatenation of LFs ’ output as Ŷi = [ Ŷ 1i , Ŷ 2 i , . . . , Ŷ n i ] , and the union set of LFs ’ label spaces as Ŷ with |Ŷ| = k̂ . Note that k̂ is not necessarily equal to the sum over kλj , since LFs may have overlapping label spaces . We call ŷ ∈ Ŷ seen label and y ∈ Y desired labels . In WS settings , we have Y ⊂ Ŷ . Notably , we assume all the involved labels come from the same semantic space . The goal of WS . The goal is to infer the training labels for the dataset D based on LFs , and to use them to train an end discriminative classifier fW : X → Y , all without ground truth training labels . | This paper studied a weakly supervised classification problem, called **weak indirect supervision**, where the supervision signals are from labels that are different from but still informative of the classes. The author proposed a new two-step method that first creates probabilistic labels using an **exponential family graphical model** based on (1) a set of **indirect labeling functions** (pretrained classifier, heuristic rules, etc.) that output deterministic labels and (2) a given **label relation graph** (ontology graph, knowledge base, etc.) that captures the relations between the observed labels and the target classes, then uses the generated labels to train a classifier for the target classes. The author provided a theoretical analysis on the requirements of the labeling functions and derived a generalization error bound. The proposed method was evaluated on semi-synthetic datasets based on the ImageNet dataset for image classification and the LSHTC dataset for text classification. | SP:55199c8f21981b3956a07d485d040defc5ba3fa9 |
Creating Training Sets via Weak Indirect Supervision | 1 INTRODUCTION . One of the greatest bottlenecks of using modern machine learning models is the need for substantial amounts of manually-labeled training data . In real-world applications , such manual annotations are typically time-consuming , labor-intensive and static . To reduce the efforts of annotation , researchers have proposed Weak Supervision ( WS ) frameworks ( Ratner et al. , 2016 ; 2018 ; 2019 ; Fu et al. , 2020 ) for synthesizing labels from multiple weak supervision sources , e.g. , heuristics , knowledge bases , or pre-trained classifiers . These frameworks have been widely applied on various machine learning tasks ( Dunnmon et al. , 2020 ; Fries et al. , 2021 ; Safranchik et al. , 2020 ; Lison et al. , 2020 ; Zhou et al. , 2020 ; Hooper et al. , 2021 ; Zhan et al. , 2019 ; Varma et al. , 2019 ) and industrial data ( Bach et al. , 2019 ) . Among them , data programming ( Ratner et al. , 2016 ) , one representative example that generalizes many approaches in the literature , represents weak supervision sources as labeling functions ( LFs ) and synthesizes training labels using Probabilistic Graphical Model ( PGM ) . Given both the increasing popularity of WS and the general increase in open-source availability of machine learning models and tools , there is a rising tide of available supervision sources that WS frameworks and practitioners could potentially leverage , including pre-trained machine learning models or prediction APIs ( Chen et al. , 2020 ; d ’ Andrea & Mintz , 2019 ; Yao et al. , 2017 ) . However , existing WS frameworks only utilize weak supervision sources with the same label space as the target task . This incompatibility largely limits the scope of usable sources , necessitating manual effort from domain experts to provide supervision for unseen labels . For example , consider target task of classifying { “ dog ” , “ wolf ” , “ cat ” , “ lion ” } and a set of three weak supervision sources ( e.g . trained classifiers or expert heuristics ) with disjoint output spaces { “ caninae ” , “ felidae ” } , { “ domestic animals ” , “ wild animals ” } and { “ husky ” , “ bengal cat ” } respectively . We call these types of sources indirect supervision sources . For concreteness , we follow the general convention of data programming ( Ratner et al. , 2016 ) and refer to these sources as indirect labeling functions ( ILFs ) . Despite their apparent utility , existing weak supervision methods could not directly leverage such ILFs , as their output spaces have no overlap with the target one . In this paper , we formulate a novel research problem that aims to leverage such ILFs automatically , minimizing the manual efforts to develop and deploy new models . We refer to this as the Weak Indirect Supervision ( WIS ) setting , a new Weak Supervision paradigm which leverages ILFs , along with the relational structures between individual labels , to automatically create training labels . The key difficulty of leveraging ILFs is due to the mismatched label spaces . To overcome this , we introduce pairwise relations between individual labels to the WIS setup , which are often available in structured sources ( e.g . off-the-shelf Knowledge Bases ( Miller , 1995 ; Sinha et al. , 2015 ; Dong et al. , 2020 ) or large scale label hierarchies ( Murty et al. , 2017 ; The Gene Ontology Consortium , 2018 ; Partalas et al. , 2015 ) for various domains ) , or can be provided by subject matter experts in far less time than generating entirely new sets of weak supervision sources . For example , in the aforementioned example , we could rely on a biological species ontology to see that the unseen labels “ dog ” and “ cat ” are both subsumed by the seen label “ domestic animals ” . Based on the label relations , we can automatically leverage the supervision sources as ILFs . Notably , previous work ( Qu et al. , 2020 ) also leveraged a label relation graph but was focused on relation extraction task in a few-shot learning setting , while You et al . ( 2020 ) proposed to learn label relations given data for each label in a transfer learning scenario . In contrast , we aim to solve the target task directly and without clean labeled data . The remaining questions are ( 1 ) how to synthesize labels based on pair-wise label relations and ILFs ? and ( 2 ) How can we know whether , given a set of ILFs and label relations , the unseen labels are distinguishable or not ? To address the first question , we develop a probabilistic label relation model ( PLRM ) , the first PGM for WIS which aggregates the output of ILFs and models the label relations as dependencies between random variables . In turn , we use the learned PLRM to produce labels for training an end model . Furthermore , we derive the generalization error bound of PLRM based on assumptions similar to previous work ( Ratner et al. , 2016 ) . The second question presents an important stumbling block when dealing with unseen labels , as we may not be able to distinguish the unseen labels given existing label relations and ILFs , resulting in an unsatisfactory synthesized training set . To address this issue , we formally introduce the notion of distinguishability in WIS setting and theoretically establish an equivalence between : ( 1 ) the distinguishability of the label relation structure as well as the ILFs , and ( 2 ) the capability of PLRM to distinguish unseen labels . This result then leads to a simple sanity test for preventing the model from failing to distinguish unseen labels . In preliminary experiments , we observe a significant drop in model performance when the condition is violated . In experiments , we make non-trivial adaptations for baselines from related settings to the new WIS problem . On both text and image classification tasks , we demonstrate the advantages of PLRM over adapted baselines . Finally , in a commercial advertising system where developers need to collect annotations for new ads tags , we illustrate how to formulate the training label collection as a WIS problem and apply PLRM to achieve an effective performance . Summary of Contributions . Our contributions are summarized as follows : • We formulate Weak Indirect Supervision ( WIS ) , a new research problem which synthesizes training labels based on indirect supervision sources and label relations , minimizing human efforts of both data annotation and weak supervision sources construction ; • We develop the first model for WIS , the Probabilistic Label Relation Model ( PLRM ) with comparable statistical efficiency to previous WS frameworks and standard supervised learning ; • We introduce a new notion of distinguishability in WIS setting , and provide a simple test of the distinguishability of PLRM for unseen labels by theoretically establishing the connection between the label relation structures and distinguishability ; • We showcase the potential of the WIS formulation and the effectiveness of PLRM in a commercial advertising system for synthesizing training labels of new ads tags . On academic image and text classification tasks , we demonstrate the advantages of PLRM over baselines by quantitative experiments . Overall , PLRM outperforms baselines by a margin of 2 % -9 % . 2 RELATED WORK . We briefly review related settings . The comparison between WIS and related tasks is in Table 1 . Weak Supervision : We draw motivation from recent work which model and integrate weak supervision sources using PGMs ( Ratner et al. , 2016 ; 2018 ; 2019 ; Fu et al. , 2020 ) and other methods ( Guan et al. , 2018 ; Khetan et al. , 2018 ) to create training sets . While they assume supervision sources share the same label space as the new tasks , we aim to leverage indirect supervision sources with mismatched label spaces in a labor-free way . Indirect Supervision : Indirect supervision arises more generally in latent-variable models for various domains ( Brown et al. , 1993 ; Liang et al. , 2013 ; Quattoni et al. , 2004 ; Chang et al. , 2010 ; Zhang et al. , 2019 ) . Very recently , Raghunathan et al . ( 2016 ) proposed to use the linear moment method for indirect supervision , wherein the transition between desired label space Y and indirect supervision space O is known , as well as the ground truth of indirect supervisions for training . In contrast , both are unavailable in WIS. Theoretically , Wang et al . ( 2020 ) developed a unified framework for analyzing the learnability of indirect supervision with shared or superset label spaces , while we focus on disjoint label spaces and the consequent unique challenge of distinguishability of unseen classes . Zero-Shot Learning : Zero-Shot Learning ( ZSL ) ( Lampert et al. , 2009 ; Wang et al. , 2019 ) aims to learn a classifier that is able to generalize to unseen classes . The WIS problem differentiates from ZSL by ( 1 ) in ZSL setting , the training and test data belong to seen and unseen classes , respectively , and training data is labeled , while for WIS , both training and test data belong to unseen classes and unlabeled ; ( 2 ) ZSL tends to render a classifier that could predict unseen classes given certain label information , e.g. , label attributes ( Romera-Paredes & Torr , 2015 ) , label descriptions ( Srivastava et al. , 2018 ) or label similarities ( Frome et al. , 2013 ) , while WIS aims to provide training labels for unlabeled training data , allowing users to train any machine learning models , and the label relations are used only in synthesizing training labels . 3 PRELIMINARY : WEAK SUPERVISION . We first describe the Weak Supervision ( WS ) setting . A glossary of notations used is in App . A. Definitions and notations . We assume a k-way classification task , and have an unlabeled dataset D consisting of m data points . Denote by Xi ∈ X the individual data point and Yi ∈ Y = { y1 , . . . , yk } the unobserved interested label of Xi . We also have n sources , each represented by a labeling function ( LF ) and denoted by λj . Each λj outputs a label Ŷ j i ∈ Yλj = { ŷj1 , . . . , ŷjkλj } on Xi , where Yλj is the label space associated with λj and |Yλj | = kλj . We denote the concatenation of LFs ’ output as Ŷi = [ Ŷ 1i , Ŷ 2 i , . . . , Ŷ n i ] , and the union set of LFs ’ label spaces as Ŷ with |Ŷ| = k̂ . Note that k̂ is not necessarily equal to the sum over kλj , since LFs may have overlapping label spaces . We call ŷ ∈ Ŷ seen label and y ∈ Y desired labels . In WS settings , we have Y ⊂ Ŷ . Notably , we assume all the involved labels come from the same semantic space . The goal of WS . The goal is to infer the training labels for the dataset D based on LFs , and to use them to train an end discriminative classifier fW : X → Y , all without ground truth training labels . | The paper addresses a novel research problem of using "indirect" label sources in the weak supervision framework to create labelled datasets. The indirect label sources are similar to the labeling functions in prior works in weak supervision ( data programming) with one caveat that these sources produce labels from different space than that of the original ( target) label spaces. It can be useful, when there are good indirect LFs and there is some relationships between the labels in the LF's label space and target label space. This paper, gives a probabilistic label model (PRML) which utilizes these indirect LFs and label relationships to produce desired labels for the given unlabeled data. The methodology is backed by theoretical analysis and real-world experiments. In analysis, a generalization error bound (for the end model learned using estimated labels) is provided which turns out to be similar to the work in Data programming (Ratner et al. 2016). One needs to be careful with the issue of indistinguishability between labels, in such setup. This issue has been studied in detail and they provide definition, conditions for distinguishability. Experiments on real-world data shows that the proposed method works well in comparison to several competing baselines. | SP:55199c8f21981b3956a07d485d040defc5ba3fa9 |
Using Document Similarity Methods to create Parallel Datasets for Code Translation | Translating source code from one programming language to another is a critical , time-consuming task in modernizing legacy applications and codebases . Recent work in this space has drawn inspiration from the software naturalness hypothesis by applying natural language processing techniques towards automating the code translation task . However , due to the paucity of parallel data in this domain , supervised techniques have only been applied to a limited set of popular programming languages . To bypass this limitation , unsupervised neural machine translation techniques have been proposed to learn code translation using only monolingual corpora . In this work , we propose to use document similarity methods to create noisy parallel datasets of code , thus enabling supervised techniques to be applied for automated code translation without having to rely on the availability or expensive curation of parallel code datasets . We explore the noise tolerance of models trained on such automatically-created datasets and show that these models perform comparably to models trained on ground truth for reasonable levels of noise . Finally , we exhibit the practical utility of the proposed method by creating parallel datasets for languages beyond the ones explored in prior work , thus expanding the set of programming languages for automated code translation . 1 INTRODUCTION . As the pace of software development increases and the famous adage “ software is eating the world ” ( Andreessen , 2011 ) is borne out , there is a corresponding increase in the amount of source code and number of software artefacts in active use for which support has lapsed . At the same time , the number of software professionals and programmers who can support and understand such code is unable to keep pace with the rate at which it is produced . This problem , while important when it comes to relatively modern programming languages ( such as Java and Python ) , becomes even more pressing when it come to legacy languages ( like COBOL ) that mission-critical applications and systems are written in ( Charette , 2020 ) . In recent years , there have been multiple instances of organizations struggling to maintain their legacy systems and making considerable investments to upgrade them . In 2021 the Commonwealth Bank of Australia upgraded its core banking platform originally written in COBOL : this ultimately took 5 years and more than 1 Billion AUD to complete ( Irrera , 2017 ) . During the COVID-19 pandemic , software systems implemented in COBOL slowed down the release of US unemployment stimulus checks ( Kelly , 2020 ) , leaving governments scrambling to find COBOL experts who were already hard to come by . A recent study by the United States Government Accountability Office ( Walsh , 2021 ) has identified 65 critical federal legacy systems in need of urgent modernization . Some of these systems are over 50 years old , and cost millions of dollars annually to operate and maintain . Parallel to these developments are recent efforts at the intersection of software engineering , machine learning ( ML ) , and natural language processing ( NLP ) , which have posited the naturalness hypothesis of software ( Hindle et al. , 2016 ) . The hypothesis states that “ ... Software is a form of human communication ; software corpora have similar statistical properties to natural language corpora ; and these properties can be exploited to build better software engineering tools ” ( Allamanis et al. , 2018 ) . This hypothesis has been used to extend breakthroughs and advances from various NLP sub-fields to software engineering tasks such as code translation . Prior works in the code translation domain have proposed the application of statistical , supervised , and unsupervised machine translation techniques to learn code translation models to varying degrees of success . A key limitation of a majority of the proposed code translation approaches , however , is the lack of availability of parallel data for training . Unlike natural language , where a piece of text is verbatim translated in multiple languages – legal documents , parliamentary proceedings in multilingual societies – code is rarely implemented as is in multiple languages ; thus making it hard to create parallel datasets . A few limited datasets – such as Java↔ C # ( Nguyen et al. , 2013 ) and AVATAR for Java ↔ Python ( Ahmad et al. , 2021b ) – are currently available . However , these are extremely limited in the number of programming language they cover , and manually curating a dataset for a specific use-case is impractical . To bypass this limitation , unsupervised techniques have been applied to the code translation task . Unsupervised techniques come with their own limitations however ; and often , supervised techniques can outperform them when the source and target corpora are from different domains , the source and target languages use different scripts , and on low-resource language pairs , among other concerns ( Kim et al. , 2020 ; Marchisio et al. , 2020 ) . It is for this reason that in this work , we focus on one of the main blockers impeding the application of supervised techniques to code translation : the availability of parallel corpora and datasets . Specifically , we propose to utilize document similarity methods to create parallel source code datasets that are noisy by design . In this work , we empirically demonstrate the effectiveness of document similarity methods in creating such parallel datasets with high levels of accuracy . Given that datasets created in this manner are bound to be noisy , we study the performance characteristics of models for code translation that have been trained on data with varying degrees of noise ; and show that these models have considerable resistance to noise and perform well even with moderate amounts of noise . Finally , we demonstrate the practical utility of the proposed approach by training models to translate between 10 pairs of languages – a majority of which have not been looked at in prior work . 2 RELATED WORK . Code translation datasets : Typical methods for creating parallel datasets for code translation have either relied on the availability of open-sourced projects with implementations in multiple languages , or on the existence of transpilers . The earliest widely-used large-scale dataset for code translation was for Java↔ C # ( Nguyen et al. , 2013 ) translation , created by indexing open-sourced projects implemented in both languages . Aggarwal et al . ( 2015 ) used the Python 2to3 1 transpiler to create a dataset ; while Chen et al . ( 2018 ) used CoffeeScript ’ s compiler ( which compiles down to JavaScript ) to create a parallel dataset . More recently , Ahmad et al . ( 2021b ) released AVATAR – a parallel corpus of Java to Python manually curated through submissions on competitive programming websites . Publicly available datasets for code translation are however extremely limited , and manually curating these datasets for a specific use-case is expensive and often impractical . Source-to-Source translation : The earliest code translation models were rule-based systems , operating on handcrafted rules . These systems require a lot of effort to build , are not easily extendable to other languages , and are also outperformed by neural techniques . Some of these systems are : Java2CSharp 2 , Java2Python 3 , SmallTalk to C ( Yasumatsu & Doi , 1995 ) , Cobol to Java ( Mossienko , 2003 ) , and Tangible Software Solutions 4 ( VB.NET , C # , Java , C++ , and Python ) . Moving away from rule-based systems , Nguyen et al . ( 2013 ) , Karaivanov et al . ( 2014 ) , and Nguyen et al . ( 2014 ) applied different versions of Phrase-Based Statistical Machine Translation to translate between Java and C # . Chen et al . ( 2018 ) proposed a tree-to-tree neural network to translate the parsed tree of the source code into the target code parse tree . The aforementioned supervised techniques have all been benchmarked on the Java↔ C # dataset , and are limited by the availability of parallel datasets . To bypass this limitation , Roziere et al . ( 2020 ) used unsupervised neural machine translation techniques to translate between languages using only monolingual corpora , and showed impressive results for translation between Java , C++ , and Python . While Roziere et al . ( 2020 ) trained the model specifically for code translation , large language models – such as GPT-2 ( Radford et al. , 2019 ) , GPT-3 ( Brown et al. , 2020 ) , and Codex ( Chen et al. , 2021 ) – have also been shown to have some competence in generating code ( Hendrycks et al. , 2021 ) . Parallel corpus mining : Prior work in natural language research has looked at various ways of creating parallel corpora from a non-parallel corpus . Munteanu & Marcu ( 2005 ) train a maximum 1https : //docs.python.org/3/library/2to3.html 2https : //sourceforge.net/projects/j2cstranslator/ 3https : //github.com/natural/java2python 4https : //www.tangiblesoftwaresolutions.com/ entropy classifier to identify if two given sentences are translations of each other . They extract parallel data from large-scale Chinese , Arabic , and English non-parallel newspaper corpora , and show improvement in model performance when trained with a combination of a small parallel corpus and the extracted dataset . Uszkoreit et al . ( 2010 ) describe a system that uses n-gram features to mine parallel documents from a billion-scale corpus . Smith et al . ( 2010 ) focus on aligning Wikipedia documents by creating features suitable for such documents . Artetxe & Schwenk ( 2019 ) utilize specific scoring functions based on multilingual sentence embeddings to create parallel corpora , and Hangya & Fraser ( 2019 ) rely on continuous parallel segments rather than word similarities to find parallel sentences . Banón et al . ( 2020 ) released the largest publicly available parallel corpora of sentences ( 223 million parallel sentences ) by aligning sentences from data crawled over the web . There is a substantial precedence of parallel corpus mining in the natural language domain ; however , such studies in the code translation domain are non-existent . Machine Translation using noisy data : Prior studies have aimed to study the impact of noise on the performance of machine translation systems . Formiga & Fonollosa ( 2012 ) study the impact of misspelled words on the performance of Statistical Machine Translation and suggest strategies to deal with them , while Goutte et al . ( 2012 ) study the impact of sentence alignment errors on the performance of SMT . Further , Khayrallah & Koehn ( 2018 ) define 5 categories of artificial noise in Neural Machine Translation , and study the impact each of these types has on performance . We motivate our work from these prior efforts in order to study the impact that noise has on the performance of code translation models . 3 PROPOSED METHOD . In this work , we propose to utilize document similarity methods to create noisy parallel datasets for code translation . We refer to the datasets created in this manner as “ noisy ” because unlike manually curated datasets , there is no guarantee of a parallel implementation of the specific source file/code being available in the corpus : this may result in near-similar code samples being paired as ground truth examples instead . Algorithm 1 presents the proposed approach as pseudocode . Algorithm 1 Creating parallel code corpus 1 : CreateParallelCorpora ( D , D ′ , M , δ ) 2 : initialize P = { } 3 : for i = 1 to |D| do 4 : Dsim = GetSimilarDocuments ( di , D ′ , M ) 5 : for ( di , d ′ j ) in Dsim do 6 : if ( · , d′j ) /∈ P and M ( di , d ′ j ) ≤ δ then 7 : P = P ∪ ( di , d ′ j ) 8 : break 9 : Dres = sort ( ( d1 , d2 ) ∈ P , key =M ( d1 , d2 ) ) 10 : Return : Dres The algorithm expects two non-parallel sets of documents D = { d1 , · · · , dn } and D ′ = { d′1 , · · · , d ′ m } as input . Within the context of our work , the documents in these two sets represent code samples from two distinct programming languages . Along with the documents , the algorithm also expects a similarity measure M ( d , d ′ ) as input , to compare two given documents for similarity . A lower score from the similarity measure indicates higher similarity between documents . Finally , the algorithm expects a similarity threshold δ to help keep only sufficiently similar documents in the resulting parallel corpus . Thereafter , the algorithm follows a simple procedure of iterating over all documents ; finding the most similar documents in the target set ; and adding the newly found similar document pairs to the result only if the target document has not been paired before , and if the similarity is below the threshold value . Once all the documents are iterated upon , the algorithm produces a list of unique pairs of code segments ( documents ) ordered by their similarity , ready to be used for downstream tasks . | This paper mines noisy parallel datasets of code by calculating the similarity between two non-parallel sets of documents. The authors first show that the document similarity methods can indeed align parallel documents and find that the word movers distance (WMD) is the most effective one. Then, the authors show the high tolerance of models trained with noisy datasets. Based on the two findings, the authors finally apply the proposed method to a large, non-parallel code dataset, and observe a performance boost of using a noisy parallel dataset compared to randomly paired datasets. | SP:7d2e5993fea3dc4fc8090cfe569d8206a16f7bfb |
Using Document Similarity Methods to create Parallel Datasets for Code Translation | Translating source code from one programming language to another is a critical , time-consuming task in modernizing legacy applications and codebases . Recent work in this space has drawn inspiration from the software naturalness hypothesis by applying natural language processing techniques towards automating the code translation task . However , due to the paucity of parallel data in this domain , supervised techniques have only been applied to a limited set of popular programming languages . To bypass this limitation , unsupervised neural machine translation techniques have been proposed to learn code translation using only monolingual corpora . In this work , we propose to use document similarity methods to create noisy parallel datasets of code , thus enabling supervised techniques to be applied for automated code translation without having to rely on the availability or expensive curation of parallel code datasets . We explore the noise tolerance of models trained on such automatically-created datasets and show that these models perform comparably to models trained on ground truth for reasonable levels of noise . Finally , we exhibit the practical utility of the proposed method by creating parallel datasets for languages beyond the ones explored in prior work , thus expanding the set of programming languages for automated code translation . 1 INTRODUCTION . As the pace of software development increases and the famous adage “ software is eating the world ” ( Andreessen , 2011 ) is borne out , there is a corresponding increase in the amount of source code and number of software artefacts in active use for which support has lapsed . At the same time , the number of software professionals and programmers who can support and understand such code is unable to keep pace with the rate at which it is produced . This problem , while important when it comes to relatively modern programming languages ( such as Java and Python ) , becomes even more pressing when it come to legacy languages ( like COBOL ) that mission-critical applications and systems are written in ( Charette , 2020 ) . In recent years , there have been multiple instances of organizations struggling to maintain their legacy systems and making considerable investments to upgrade them . In 2021 the Commonwealth Bank of Australia upgraded its core banking platform originally written in COBOL : this ultimately took 5 years and more than 1 Billion AUD to complete ( Irrera , 2017 ) . During the COVID-19 pandemic , software systems implemented in COBOL slowed down the release of US unemployment stimulus checks ( Kelly , 2020 ) , leaving governments scrambling to find COBOL experts who were already hard to come by . A recent study by the United States Government Accountability Office ( Walsh , 2021 ) has identified 65 critical federal legacy systems in need of urgent modernization . Some of these systems are over 50 years old , and cost millions of dollars annually to operate and maintain . Parallel to these developments are recent efforts at the intersection of software engineering , machine learning ( ML ) , and natural language processing ( NLP ) , which have posited the naturalness hypothesis of software ( Hindle et al. , 2016 ) . The hypothesis states that “ ... Software is a form of human communication ; software corpora have similar statistical properties to natural language corpora ; and these properties can be exploited to build better software engineering tools ” ( Allamanis et al. , 2018 ) . This hypothesis has been used to extend breakthroughs and advances from various NLP sub-fields to software engineering tasks such as code translation . Prior works in the code translation domain have proposed the application of statistical , supervised , and unsupervised machine translation techniques to learn code translation models to varying degrees of success . A key limitation of a majority of the proposed code translation approaches , however , is the lack of availability of parallel data for training . Unlike natural language , where a piece of text is verbatim translated in multiple languages – legal documents , parliamentary proceedings in multilingual societies – code is rarely implemented as is in multiple languages ; thus making it hard to create parallel datasets . A few limited datasets – such as Java↔ C # ( Nguyen et al. , 2013 ) and AVATAR for Java ↔ Python ( Ahmad et al. , 2021b ) – are currently available . However , these are extremely limited in the number of programming language they cover , and manually curating a dataset for a specific use-case is impractical . To bypass this limitation , unsupervised techniques have been applied to the code translation task . Unsupervised techniques come with their own limitations however ; and often , supervised techniques can outperform them when the source and target corpora are from different domains , the source and target languages use different scripts , and on low-resource language pairs , among other concerns ( Kim et al. , 2020 ; Marchisio et al. , 2020 ) . It is for this reason that in this work , we focus on one of the main blockers impeding the application of supervised techniques to code translation : the availability of parallel corpora and datasets . Specifically , we propose to utilize document similarity methods to create parallel source code datasets that are noisy by design . In this work , we empirically demonstrate the effectiveness of document similarity methods in creating such parallel datasets with high levels of accuracy . Given that datasets created in this manner are bound to be noisy , we study the performance characteristics of models for code translation that have been trained on data with varying degrees of noise ; and show that these models have considerable resistance to noise and perform well even with moderate amounts of noise . Finally , we demonstrate the practical utility of the proposed approach by training models to translate between 10 pairs of languages – a majority of which have not been looked at in prior work . 2 RELATED WORK . Code translation datasets : Typical methods for creating parallel datasets for code translation have either relied on the availability of open-sourced projects with implementations in multiple languages , or on the existence of transpilers . The earliest widely-used large-scale dataset for code translation was for Java↔ C # ( Nguyen et al. , 2013 ) translation , created by indexing open-sourced projects implemented in both languages . Aggarwal et al . ( 2015 ) used the Python 2to3 1 transpiler to create a dataset ; while Chen et al . ( 2018 ) used CoffeeScript ’ s compiler ( which compiles down to JavaScript ) to create a parallel dataset . More recently , Ahmad et al . ( 2021b ) released AVATAR – a parallel corpus of Java to Python manually curated through submissions on competitive programming websites . Publicly available datasets for code translation are however extremely limited , and manually curating these datasets for a specific use-case is expensive and often impractical . Source-to-Source translation : The earliest code translation models were rule-based systems , operating on handcrafted rules . These systems require a lot of effort to build , are not easily extendable to other languages , and are also outperformed by neural techniques . Some of these systems are : Java2CSharp 2 , Java2Python 3 , SmallTalk to C ( Yasumatsu & Doi , 1995 ) , Cobol to Java ( Mossienko , 2003 ) , and Tangible Software Solutions 4 ( VB.NET , C # , Java , C++ , and Python ) . Moving away from rule-based systems , Nguyen et al . ( 2013 ) , Karaivanov et al . ( 2014 ) , and Nguyen et al . ( 2014 ) applied different versions of Phrase-Based Statistical Machine Translation to translate between Java and C # . Chen et al . ( 2018 ) proposed a tree-to-tree neural network to translate the parsed tree of the source code into the target code parse tree . The aforementioned supervised techniques have all been benchmarked on the Java↔ C # dataset , and are limited by the availability of parallel datasets . To bypass this limitation , Roziere et al . ( 2020 ) used unsupervised neural machine translation techniques to translate between languages using only monolingual corpora , and showed impressive results for translation between Java , C++ , and Python . While Roziere et al . ( 2020 ) trained the model specifically for code translation , large language models – such as GPT-2 ( Radford et al. , 2019 ) , GPT-3 ( Brown et al. , 2020 ) , and Codex ( Chen et al. , 2021 ) – have also been shown to have some competence in generating code ( Hendrycks et al. , 2021 ) . Parallel corpus mining : Prior work in natural language research has looked at various ways of creating parallel corpora from a non-parallel corpus . Munteanu & Marcu ( 2005 ) train a maximum 1https : //docs.python.org/3/library/2to3.html 2https : //sourceforge.net/projects/j2cstranslator/ 3https : //github.com/natural/java2python 4https : //www.tangiblesoftwaresolutions.com/ entropy classifier to identify if two given sentences are translations of each other . They extract parallel data from large-scale Chinese , Arabic , and English non-parallel newspaper corpora , and show improvement in model performance when trained with a combination of a small parallel corpus and the extracted dataset . Uszkoreit et al . ( 2010 ) describe a system that uses n-gram features to mine parallel documents from a billion-scale corpus . Smith et al . ( 2010 ) focus on aligning Wikipedia documents by creating features suitable for such documents . Artetxe & Schwenk ( 2019 ) utilize specific scoring functions based on multilingual sentence embeddings to create parallel corpora , and Hangya & Fraser ( 2019 ) rely on continuous parallel segments rather than word similarities to find parallel sentences . Banón et al . ( 2020 ) released the largest publicly available parallel corpora of sentences ( 223 million parallel sentences ) by aligning sentences from data crawled over the web . There is a substantial precedence of parallel corpus mining in the natural language domain ; however , such studies in the code translation domain are non-existent . Machine Translation using noisy data : Prior studies have aimed to study the impact of noise on the performance of machine translation systems . Formiga & Fonollosa ( 2012 ) study the impact of misspelled words on the performance of Statistical Machine Translation and suggest strategies to deal with them , while Goutte et al . ( 2012 ) study the impact of sentence alignment errors on the performance of SMT . Further , Khayrallah & Koehn ( 2018 ) define 5 categories of artificial noise in Neural Machine Translation , and study the impact each of these types has on performance . We motivate our work from these prior efforts in order to study the impact that noise has on the performance of code translation models . 3 PROPOSED METHOD . In this work , we propose to utilize document similarity methods to create noisy parallel datasets for code translation . We refer to the datasets created in this manner as “ noisy ” because unlike manually curated datasets , there is no guarantee of a parallel implementation of the specific source file/code being available in the corpus : this may result in near-similar code samples being paired as ground truth examples instead . Algorithm 1 presents the proposed approach as pseudocode . Algorithm 1 Creating parallel code corpus 1 : CreateParallelCorpora ( D , D ′ , M , δ ) 2 : initialize P = { } 3 : for i = 1 to |D| do 4 : Dsim = GetSimilarDocuments ( di , D ′ , M ) 5 : for ( di , d ′ j ) in Dsim do 6 : if ( · , d′j ) /∈ P and M ( di , d ′ j ) ≤ δ then 7 : P = P ∪ ( di , d ′ j ) 8 : break 9 : Dres = sort ( ( d1 , d2 ) ∈ P , key =M ( d1 , d2 ) ) 10 : Return : Dres The algorithm expects two non-parallel sets of documents D = { d1 , · · · , dn } and D ′ = { d′1 , · · · , d ′ m } as input . Within the context of our work , the documents in these two sets represent code samples from two distinct programming languages . Along with the documents , the algorithm also expects a similarity measure M ( d , d ′ ) as input , to compare two given documents for similarity . A lower score from the similarity measure indicates higher similarity between documents . Finally , the algorithm expects a similarity threshold δ to help keep only sufficiently similar documents in the resulting parallel corpus . Thereafter , the algorithm follows a simple procedure of iterating over all documents ; finding the most similar documents in the target set ; and adding the newly found similar document pairs to the result only if the target document has not been paired before , and if the similarity is below the threshold value . Once all the documents are iterated upon , the algorithm produces a list of unique pairs of code segments ( documents ) ordered by their similarity , ready to be used for downstream tasks . | This paper proposes to use similarity metric to generate pseudo alignments between source/target program pairs. Generated pairs are utilized to train program translation model. The paper described a simple greedy method to align both codes, and experimented 5 types of similarity metric as its inner measure. According to the experiments, the word mover's distance works notably well for this purpose, but other metric can also improve the translation accuracy significantly against random selection. The other experiment investigating a performance curve by changing noise ratio in the ground-truth parallel corpus hypothesized that certain amount of alignment errors can be acceptable since the actual performance can be maintained. The paper also challenged to construct translation systems between arbitrary pairs in 10 programming languages using the proposed framework and observed that the trained system works with certain accuracies. | SP:7d2e5993fea3dc4fc8090cfe569d8206a16f7bfb |
Adaptive Filters for Low-Latency and Memory-Efficient Graph Neural Networks | 1 INTRODUCTION . Graph Neural Networks ( GNNs ) have emerged as an effective way to build models over arbitrarily structured data . For example , they have successfully been applied to computer vision tasks : GNNs can deliver high performance on point cloud data ( Qi et al. , 2017 ) and for feature matching across images ( Sarlin et al. , 2020 ) . Recent work has also shown that they can be applied to physical simulations ( Pfaff et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) . Code analysis is another application domain where GNNs have found success ( Guo et al. , 2020 ; Allamanis et al. , 2017 ) . In recent years , the research community has devoted significant attention to building more expressive , and better performing , models to process graphs . Efforts to benchmark GNN models , such as Open Graph Benchmark ( Hu et al. , 2020 ) , or the work by Dwivedi et al . ( 2020 ) , have attempted to more rigorously quantify the relative performance of different proposed architectures . One common conclusion—explicitly stated by Dwivedi et al . ( 2020 ) —is that anisotropic models , in which messages sent between nodes are a function of both the source and target node , are the best performing models . By comparison , isotropic models , where messages are a function of the source node only , achieve lower accuracy , even if they have efficiency benefits over comparable anisotropic models . Intuitively , this conclusion is satisfying : anisotropic models are inherently more expressive , hence we would expect them to perform better in most situations . Our work provides a surprising challenge to this wisdom by providing an isotropic model , called Efficient Graph Convolution ( EGC ) , ∗Corresponding author . Contact at sat62 @ cam.ac.uk that outperforms comparable anisotropic approaches , including the popular GAT ( Veličković et al. , 2018 ) and PNA ( Corso et al. , 2020 ) architectures . In addition to providing a surprising empirical result for the community , our work has significant practical implications for efficiency , as shown in Figure 1 . As EGC is an isotropic model achieving high accuracy , we can take advantage of the efficiency benefits offered by isotropic models without having to compromise on model accuracy . We have seen memory consumption and latency for state-of-the-art GNN architectures increase to O ( E ) in recent years , due to state-of-the-art models incorporating anisotropic mechanisms to boost accuracy . EGC reduces the complexity to O ( V ) , delivering substantial real-world benefits , albeit with the precise benefit being dependent on the topology of the graphs the model is applied to . The reader should note that our approach can also be combined with other approaches for improving the efficiency of GNNs . For example , common hardware-software co-design techniques include quantization and pruning ( Sze et al. , 2020 ) could be combined with this work , which proposes an orthogonal approach of improving model efficiency by improving the underlying architecture design . We also note that our approach can be combined with graph sampling techniques ( Zeng et al. , 2019 ; Hamilton et al. , 2017 ; Chen et al. , 2018a ) to improve scalability further when training on graphs with millions , or billions , of nodes . Contributions ( 1 ) We propose a new GNN architecture , Efficient Graph Convolution ( EGC ) , and provide both spatial and spectral interpretations for it . ( 2 ) We provide a rigorous evaluation of our architecture across 6 large graph datasets covering both transductive and inductive use-cases , and demonstrate that EGC consistently achieves better results than strong baselines . ( 3 ) We provide several ablation studies to motivate the selection of the hyperparameters in our model . ( 4 ) We demonstrate that our model simultaneously achieves better parameter efficiency , latency and memory consumption than competing approaches . Code and pre-trained models for our experiments ( including baselines ) can be found at https : //github.com/shyam196/egc . At time of publication , EGC has also been upstreamed to PyTorch Geometric ( Fey & Lenssen , 2019 ) . 2 BACKGROUND . 2.1 HARDWARE-SOFTWARE CO-DESIGN FOR DEEP LEARNING . Several of the popular approaches for co-design have already been described in the introduction : quantization , pruning , and careful architecture design are all common for CNNs and Transformers ( Vaswani et al. , 2017 ) . In addition to enabling better performance to be obtained from general purpose processors such as CPUs and GPUs , these techniques are also essential for maximizing the return from specialized accelerators ; while it may be possible to improve performance over time due to improvements in CMOS technology , further improvements plateau without innovation at the algorithmic level ( Fuchs & Wentzlaff , 2019 ) . As neural network architecture designers , we can not simply rely on improvements in hardware to make our proposals viable for real-world deployment . 2.2 GRAPH NEURAL NETWORKS . Many GNN architectures can be viewed as a generalization of CNN architectures to the irregular domain : as in CNNs , representations at each node are built based on the local neighborhood using parameters that are shared across the graph . GNNs differ as we can not make assumptions about the the size of the neighborhood , or the ordering . One common framework used to define GNNs is the message passing neural network ( MPNN ) paradigm ( Gilmer et al. , 2017 ) . A graph G = ( V , E ) has node features X ∈ RN×F , adjacency matrix A ∈ RN×N and optionally D-dimensional edge features E ∈ RE×D . We define a function φ that calculates messages from node u to node v , a differentiable and permutation-invariant aggregator ⊕ , and an update function γ to calculate representations at layer l + 1 : h ( i ) l+1 = γ ( h ( i ) l , ⊕j∈N ( i ) [ φ ( h ( i ) l , h ( j ) l , eij ) ] ) . Propagation rules for baseline architecture are provided in Table 1 , with further details supplied in Table 5 in the Appendix . Relative Expressivity of GNNs Common wisdom in the research community states that isotropic GNNs are less expressive than anisotropic GNNs ; empirically this is well supported by benchmarks . Brody et al . ( 2022 ) prove that GAT models can be strictly more expressive than isotropic models . Bronstein et al . ( 2021 ) also discuss the relative expressivity of different classes of GNN layer , and argue that convolutional ( also known as isotropic ) models are well suited to problems leveraging homophily1 in the input graph . They further argue that attentional , or full message passing , models are suited to handling heterophilous problems , but they acknowledge the resource consumption and trainability of these architectures may be prohibitive—especially in the case of full message passing . Scaling and Deploying GNNs While GNNs have seen success across a range of domains , there remain challenges associated with scaling and deploying them . Graph sampling is one approach to scaling training for large graphs or models which will not fit in memory . Rather than training over the full graph , each iteration is run over a sampled sub-graph ; approaches vary in whether they sample node-wise ( Hamilton et al. , 2017 ) , layer-wise ( Chen et al. , 2018a ; Huang et al. , 2018 ) , or subgraphs ( Zeng et al. , 2019 ; Chiang et al. , 2019 ) . Alternatively , systems for distributed GNN training have been proposed ( Jia et al. , 2020 ) to scale training beyond the limits of a single accelerator . Some works have proposed architectures that are designed to accommodate scaling : graph-augmented MLPs , such as SIGN ( Rossi et al. , 2020 ) , are explicitly designed as a shallow architecture , as all the graph operations are done as a pre-processing step . Other work includes applying neural architecture search ( NAS ) to arrange existing GNN layers ( Zhao et al. , 2020 ) , or building quantization techniques for GNNs ( Tailor et al. , 2021 ) . Finally , a recent work has shown that using memoryefficient reversible residuals ( Gomez et al. , 2017 ) for GNNs ( Li et al. , 2021 ) enables us to train far deeper and larger GNN models than before , thereby progressing the state-of-the-art accuracy . Why Are Existing Approaches Not Sufficient ? It is worth noting that many of these approaches have significant limitations that we aim to address with our work . Sampling methods are often ineffective when applied to many problems which involve model generalization to unseen graphs—a common use-case for GNNs . We evaluated a variety of sampling approaches and observed that even modest sampling levels , which provide little benefit to memory or latency , cause model performance to decline noticeably . In addition , these methods do not accelerate the underlying GNN , hence they may not provide any overall benefit to inference latency . There is also no evidence that we are aware of that graph-augmented MLPs perform adequately when generalizing to unseen graphs ; indeed , they are known to be theoretically less expressive than standard GNNs ( Chen et al. , 2021 ) . We also investigated this setup , and found that these approaches do not offer competitive accuracy with state-of-the-art approaches . Experiment details and results , along with further discussion of the limitations of existing work , is provided in Appendix B . In summary , our work on efficient GNN architecture design is of interest to the community for two reasons : firstly , it raises questions about common assumptions , and how we design and evaluate GNN models ; secondly , our work may enable us to scale our models further , potentially yielding improvements in accuracy . In addition , for tasks where we need to generalize to unseen graphs , such as code analysis or point cloud processing , we reduce memory consumption and latency , thereby enabling us to deploy our models to more resource-constrained devices than before . We note that efficient architecture design can be usefully combined with other approaches including sampling , quantization , and pruning , where appropriate . 1Homophily means that if two nodes are connected , then they have high similarity 3 OUR ARCHITECTURE : EFFICIENT GRAPH CONVOLUTION ( EGC ) . In this section we describe our approach , and delay theoretical analysis to the next section . We present two versions : EGC-S ( ingle ) , using a single aggregator , and EGC-M ( ulti ) which generalizes our approach by incorporating multiple aggregators . Our approach is visualized in Figure 2 . 3.1 ARCHITECTURE DESCRIPTION . For a layer with in-dimension of F and out-dimension of F ′ we use B basis weights Θb ∈ RF ′×F . We compute the output for node i by calculating combination weighting coefficients w ( i ) ∈ RB per node , and weighting the results of each aggregation using the different basis weights Θb . We calculate w ( i ) = Φx ( i ) + b , where Φ ∈ RB×F and b ∈ RB are weight and bias parameters associated with calculating the combination weighting coefficients . The output for node i is computed in three steps . First , we perform the aggregation with each set of basis weights Θb . Second , we compute the weighting coefficients w ( i ) = Φx ( i ) +b ∈ RB for each node i , where Φ ∈ RB×F and b ∈ RB are weight and bias parameters for calculating the combination weighting coefficients . Third , the layer output for node i is the weighted combination of aggregation outputs : y ( i ) = B∑ b=1 w ( i ) b ∑ j∈N ( i ) α ( i , j ) Θbx ( j ) ( 1 ) where α ( i , j ) is some function of nodes i and j , andN ( i ) denotes the in-neighbours of i . A popular method pioneered by GAT ( Veličković et al. , 2018 ) to boost representational power is to represent α using a learned function of the two nodes ’ representations . While this enables anisotropic treatment of neighbors , and can boost performance , it necessarily results in memory consumption of O ( |E| ) due to messages needing to be explicitly materialized , and complicates hardware implementation for accelerators . If we choose a representation for α that is not a function of the node representations— such as α ( i , j ) = 1 to recover the add aggregator used by GIN ( Xu et al. , 2019 ) , or α ( i , j ) = 1/ √ deg ( i ) deg ( j ) to recover symmetric normalization used by GCN ( Kipf & Welling , 2017 ) — then we can implement our message propagation phase using sparse matrix multiplication ( SpMM ) , and avoid explicitly materializing each message , even for the backwards pass . In this work , we assume α ( i , j ) to be symmetric normalization as used by GCN unless otherwise stated ; we use this normalization as it is known to offer strong results across a variety of tasks ; more formal justification is provided in section 4.2 . Adding Heads as a Regularizer We can extend our layer through the addition of heads , as used in architectures such as GAT or Transformers ( Vaswani et al. , 2017 ) . These heads share the basis weights , but apply different weighting coefficients per head . We find that adding this degree of freedom aids regularization when the number of heads ( H ) is larger thanB , as bases are discouraged from specializing ( see section 5.3 ) , without requiring the integration of additional loss terms into the optimization—hence requiring no changes to code for downstream users . To normalize the output dimension , we change the basis weight matrices dimensions to F ′ H ×F . Using ‖ as the concatenation operator , and making the use of symmetric normalization explicit , we obtain the EGC-S layer : y ( i ) = H ‖ h=1 B∑ b=1 w ( i ) h , b ∑ j∈N ( i ) ∪ { i } 1√ deg ( i ) deg ( j ) Θbx ( j ) ( 2 ) EGC works by combining basis matrices . This idea was proposed in R-GCN ( Schlichtkrull et al. , 2018 ) to handle multiple edge types ; Xu et al . ( 2021 ) can be viewed as a generalization of this approach to point cloud analysis . In this work we are solving a different problem to these works : we are interested in designing efficient architectures , rather than new ways to handle edge information . | This paper claimed they designed a new GNN architecture that achieves state-of-the-art performance with lower memory consumption and latency. More specifically, the proposed model uses memory proportional to the number of vertices in the graph $O(V)$, in contrast to competing methods which require memory proportional to the number of edges $O(E)$. The paper claimed that the new architecture enabled each vertex to have its own weight matrix, thus following a novel adaptive filtering approach. The experiments found that the proposed efficient model could achieve higher accuracy than competing approaches across six large and varied datasets against strong baselines. Moreover, the experiments demonstrated that the proposed method achieves lower latency and memory consumption for the same accuracy compared to competing approaches. | SP:707e8ce06a2315ede25190c7e4f5fc5e663d200f |
Adaptive Filters for Low-Latency and Memory-Efficient Graph Neural Networks | 1 INTRODUCTION . Graph Neural Networks ( GNNs ) have emerged as an effective way to build models over arbitrarily structured data . For example , they have successfully been applied to computer vision tasks : GNNs can deliver high performance on point cloud data ( Qi et al. , 2017 ) and for feature matching across images ( Sarlin et al. , 2020 ) . Recent work has also shown that they can be applied to physical simulations ( Pfaff et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) . Code analysis is another application domain where GNNs have found success ( Guo et al. , 2020 ; Allamanis et al. , 2017 ) . In recent years , the research community has devoted significant attention to building more expressive , and better performing , models to process graphs . Efforts to benchmark GNN models , such as Open Graph Benchmark ( Hu et al. , 2020 ) , or the work by Dwivedi et al . ( 2020 ) , have attempted to more rigorously quantify the relative performance of different proposed architectures . One common conclusion—explicitly stated by Dwivedi et al . ( 2020 ) —is that anisotropic models , in which messages sent between nodes are a function of both the source and target node , are the best performing models . By comparison , isotropic models , where messages are a function of the source node only , achieve lower accuracy , even if they have efficiency benefits over comparable anisotropic models . Intuitively , this conclusion is satisfying : anisotropic models are inherently more expressive , hence we would expect them to perform better in most situations . Our work provides a surprising challenge to this wisdom by providing an isotropic model , called Efficient Graph Convolution ( EGC ) , ∗Corresponding author . Contact at sat62 @ cam.ac.uk that outperforms comparable anisotropic approaches , including the popular GAT ( Veličković et al. , 2018 ) and PNA ( Corso et al. , 2020 ) architectures . In addition to providing a surprising empirical result for the community , our work has significant practical implications for efficiency , as shown in Figure 1 . As EGC is an isotropic model achieving high accuracy , we can take advantage of the efficiency benefits offered by isotropic models without having to compromise on model accuracy . We have seen memory consumption and latency for state-of-the-art GNN architectures increase to O ( E ) in recent years , due to state-of-the-art models incorporating anisotropic mechanisms to boost accuracy . EGC reduces the complexity to O ( V ) , delivering substantial real-world benefits , albeit with the precise benefit being dependent on the topology of the graphs the model is applied to . The reader should note that our approach can also be combined with other approaches for improving the efficiency of GNNs . For example , common hardware-software co-design techniques include quantization and pruning ( Sze et al. , 2020 ) could be combined with this work , which proposes an orthogonal approach of improving model efficiency by improving the underlying architecture design . We also note that our approach can be combined with graph sampling techniques ( Zeng et al. , 2019 ; Hamilton et al. , 2017 ; Chen et al. , 2018a ) to improve scalability further when training on graphs with millions , or billions , of nodes . Contributions ( 1 ) We propose a new GNN architecture , Efficient Graph Convolution ( EGC ) , and provide both spatial and spectral interpretations for it . ( 2 ) We provide a rigorous evaluation of our architecture across 6 large graph datasets covering both transductive and inductive use-cases , and demonstrate that EGC consistently achieves better results than strong baselines . ( 3 ) We provide several ablation studies to motivate the selection of the hyperparameters in our model . ( 4 ) We demonstrate that our model simultaneously achieves better parameter efficiency , latency and memory consumption than competing approaches . Code and pre-trained models for our experiments ( including baselines ) can be found at https : //github.com/shyam196/egc . At time of publication , EGC has also been upstreamed to PyTorch Geometric ( Fey & Lenssen , 2019 ) . 2 BACKGROUND . 2.1 HARDWARE-SOFTWARE CO-DESIGN FOR DEEP LEARNING . Several of the popular approaches for co-design have already been described in the introduction : quantization , pruning , and careful architecture design are all common for CNNs and Transformers ( Vaswani et al. , 2017 ) . In addition to enabling better performance to be obtained from general purpose processors such as CPUs and GPUs , these techniques are also essential for maximizing the return from specialized accelerators ; while it may be possible to improve performance over time due to improvements in CMOS technology , further improvements plateau without innovation at the algorithmic level ( Fuchs & Wentzlaff , 2019 ) . As neural network architecture designers , we can not simply rely on improvements in hardware to make our proposals viable for real-world deployment . 2.2 GRAPH NEURAL NETWORKS . Many GNN architectures can be viewed as a generalization of CNN architectures to the irregular domain : as in CNNs , representations at each node are built based on the local neighborhood using parameters that are shared across the graph . GNNs differ as we can not make assumptions about the the size of the neighborhood , or the ordering . One common framework used to define GNNs is the message passing neural network ( MPNN ) paradigm ( Gilmer et al. , 2017 ) . A graph G = ( V , E ) has node features X ∈ RN×F , adjacency matrix A ∈ RN×N and optionally D-dimensional edge features E ∈ RE×D . We define a function φ that calculates messages from node u to node v , a differentiable and permutation-invariant aggregator ⊕ , and an update function γ to calculate representations at layer l + 1 : h ( i ) l+1 = γ ( h ( i ) l , ⊕j∈N ( i ) [ φ ( h ( i ) l , h ( j ) l , eij ) ] ) . Propagation rules for baseline architecture are provided in Table 1 , with further details supplied in Table 5 in the Appendix . Relative Expressivity of GNNs Common wisdom in the research community states that isotropic GNNs are less expressive than anisotropic GNNs ; empirically this is well supported by benchmarks . Brody et al . ( 2022 ) prove that GAT models can be strictly more expressive than isotropic models . Bronstein et al . ( 2021 ) also discuss the relative expressivity of different classes of GNN layer , and argue that convolutional ( also known as isotropic ) models are well suited to problems leveraging homophily1 in the input graph . They further argue that attentional , or full message passing , models are suited to handling heterophilous problems , but they acknowledge the resource consumption and trainability of these architectures may be prohibitive—especially in the case of full message passing . Scaling and Deploying GNNs While GNNs have seen success across a range of domains , there remain challenges associated with scaling and deploying them . Graph sampling is one approach to scaling training for large graphs or models which will not fit in memory . Rather than training over the full graph , each iteration is run over a sampled sub-graph ; approaches vary in whether they sample node-wise ( Hamilton et al. , 2017 ) , layer-wise ( Chen et al. , 2018a ; Huang et al. , 2018 ) , or subgraphs ( Zeng et al. , 2019 ; Chiang et al. , 2019 ) . Alternatively , systems for distributed GNN training have been proposed ( Jia et al. , 2020 ) to scale training beyond the limits of a single accelerator . Some works have proposed architectures that are designed to accommodate scaling : graph-augmented MLPs , such as SIGN ( Rossi et al. , 2020 ) , are explicitly designed as a shallow architecture , as all the graph operations are done as a pre-processing step . Other work includes applying neural architecture search ( NAS ) to arrange existing GNN layers ( Zhao et al. , 2020 ) , or building quantization techniques for GNNs ( Tailor et al. , 2021 ) . Finally , a recent work has shown that using memoryefficient reversible residuals ( Gomez et al. , 2017 ) for GNNs ( Li et al. , 2021 ) enables us to train far deeper and larger GNN models than before , thereby progressing the state-of-the-art accuracy . Why Are Existing Approaches Not Sufficient ? It is worth noting that many of these approaches have significant limitations that we aim to address with our work . Sampling methods are often ineffective when applied to many problems which involve model generalization to unseen graphs—a common use-case for GNNs . We evaluated a variety of sampling approaches and observed that even modest sampling levels , which provide little benefit to memory or latency , cause model performance to decline noticeably . In addition , these methods do not accelerate the underlying GNN , hence they may not provide any overall benefit to inference latency . There is also no evidence that we are aware of that graph-augmented MLPs perform adequately when generalizing to unseen graphs ; indeed , they are known to be theoretically less expressive than standard GNNs ( Chen et al. , 2021 ) . We also investigated this setup , and found that these approaches do not offer competitive accuracy with state-of-the-art approaches . Experiment details and results , along with further discussion of the limitations of existing work , is provided in Appendix B . In summary , our work on efficient GNN architecture design is of interest to the community for two reasons : firstly , it raises questions about common assumptions , and how we design and evaluate GNN models ; secondly , our work may enable us to scale our models further , potentially yielding improvements in accuracy . In addition , for tasks where we need to generalize to unseen graphs , such as code analysis or point cloud processing , we reduce memory consumption and latency , thereby enabling us to deploy our models to more resource-constrained devices than before . We note that efficient architecture design can be usefully combined with other approaches including sampling , quantization , and pruning , where appropriate . 1Homophily means that if two nodes are connected , then they have high similarity 3 OUR ARCHITECTURE : EFFICIENT GRAPH CONVOLUTION ( EGC ) . In this section we describe our approach , and delay theoretical analysis to the next section . We present two versions : EGC-S ( ingle ) , using a single aggregator , and EGC-M ( ulti ) which generalizes our approach by incorporating multiple aggregators . Our approach is visualized in Figure 2 . 3.1 ARCHITECTURE DESCRIPTION . For a layer with in-dimension of F and out-dimension of F ′ we use B basis weights Θb ∈ RF ′×F . We compute the output for node i by calculating combination weighting coefficients w ( i ) ∈ RB per node , and weighting the results of each aggregation using the different basis weights Θb . We calculate w ( i ) = Φx ( i ) + b , where Φ ∈ RB×F and b ∈ RB are weight and bias parameters associated with calculating the combination weighting coefficients . The output for node i is computed in three steps . First , we perform the aggregation with each set of basis weights Θb . Second , we compute the weighting coefficients w ( i ) = Φx ( i ) +b ∈ RB for each node i , where Φ ∈ RB×F and b ∈ RB are weight and bias parameters for calculating the combination weighting coefficients . Third , the layer output for node i is the weighted combination of aggregation outputs : y ( i ) = B∑ b=1 w ( i ) b ∑ j∈N ( i ) α ( i , j ) Θbx ( j ) ( 1 ) where α ( i , j ) is some function of nodes i and j , andN ( i ) denotes the in-neighbours of i . A popular method pioneered by GAT ( Veličković et al. , 2018 ) to boost representational power is to represent α using a learned function of the two nodes ’ representations . While this enables anisotropic treatment of neighbors , and can boost performance , it necessarily results in memory consumption of O ( |E| ) due to messages needing to be explicitly materialized , and complicates hardware implementation for accelerators . If we choose a representation for α that is not a function of the node representations— such as α ( i , j ) = 1 to recover the add aggregator used by GIN ( Xu et al. , 2019 ) , or α ( i , j ) = 1/ √ deg ( i ) deg ( j ) to recover symmetric normalization used by GCN ( Kipf & Welling , 2017 ) — then we can implement our message propagation phase using sparse matrix multiplication ( SpMM ) , and avoid explicitly materializing each message , even for the backwards pass . In this work , we assume α ( i , j ) to be symmetric normalization as used by GCN unless otherwise stated ; we use this normalization as it is known to offer strong results across a variety of tasks ; more formal justification is provided in section 4.2 . Adding Heads as a Regularizer We can extend our layer through the addition of heads , as used in architectures such as GAT or Transformers ( Vaswani et al. , 2017 ) . These heads share the basis weights , but apply different weighting coefficients per head . We find that adding this degree of freedom aids regularization when the number of heads ( H ) is larger thanB , as bases are discouraged from specializing ( see section 5.3 ) , without requiring the integration of additional loss terms into the optimization—hence requiring no changes to code for downstream users . To normalize the output dimension , we change the basis weight matrices dimensions to F ′ H ×F . Using ‖ as the concatenation operator , and making the use of symmetric normalization explicit , we obtain the EGC-S layer : y ( i ) = H ‖ h=1 B∑ b=1 w ( i ) h , b ∑ j∈N ( i ) ∪ { i } 1√ deg ( i ) deg ( j ) Θbx ( j ) ( 2 ) EGC works by combining basis matrices . This idea was proposed in R-GCN ( Schlichtkrull et al. , 2018 ) to handle multiple edge types ; Xu et al . ( 2021 ) can be viewed as a generalization of this approach to point cloud analysis . In this work we are solving a different problem to these works : we are interested in designing efficient architectures , rather than new ways to handle edge information . | This paper introduces Adaptive Filters that enable some of the benefits of Message Passing architectures, but while maintaining a memory consumption that scales with the number of nodes. The authors claim that this architecture is not only better performing, and use less memory, but more efficient for GPUs through the use of sparse matrix multiplication. The idea of the model is that you have a number of filters (MLPs or linear layers) applied to each sending node latent, a "filter". These are then weighted and summed by a weighting vector calculated as a function of the receiving node. Since there are no functions that take as input both sending, receiving or edge inputs, the memory will scale with the number of nodes. You, in essence, get an efficient pseudo-attention mechanism. | SP:707e8ce06a2315ede25190c7e4f5fc5e663d200f |
Graph Neural Networks with Learnable Structural and Positional Representations | 1 INTRODUCTION . GNNs have recently emerged as a powerful class of deep learning architectures to analyze datasets where information is present in the form of heteregeneous graphs that encode complex data connectivity . Experimentally , these architectures have shown great promises to be impactful in diverse domains such as drug design ( Stokes et al. , 2020 ; Gaudelet et al. , 2020 ) , social networks ( Monti et al. , 2019 ; Pal et al. , 2020 ) , traffic networks ( Derrow-Pinion et al. , 2021 ) , physics ( Cranmer et al. , 2019 ; Bapst et al. , 2020 ) , combinatorial optimization ( Bengio et al. , 2021 ; Cappart et al. , 2021 ) and medical diagnosis ( Li et al. , 2020c ) . Most GNNs ( such as Defferrard et al . ( 2016 ) ; Sukhbaatar et al . ( 2016 ) ; Kipf & Welling ( 2017 ) ; Hamilton et al . ( 2017 ) ; Monti et al . ( 2017 ) ; Bresson & Laurent ( 2017 ) ; Veličković et al . ( 2018 ) ; Xu et al . ( 2019 ) ) are designed with a message-passing mechanism ( Gilmer et al. , 2017 ) that builds node representation by aggregating local neighborhood information . It means that this class of GNNs is fundamentally structural , i.e . the node representation only depends on the local structure of the graph . As such , two atoms in a molecule with the same neighborhood are expected to have similar representation . However , it can be limiting to have the same representation for these two atoms as their positions in the molecule are distinct , and their role may be specifically separate ( Murphy et al. , 2019 ) . As a consequence , the popular message-passing GNNs ( MP-GNNs ) fail to differentiate two nodes with the same 1-hop local structure . This restriction is now properly understood in the context of the equivalence of MP-GNNs with Weisfeiler-Leman ( WL ) test ( Weisfeiler & Leman , 1968 ) for graph isomorphism ( Xu et al. , 2019 ; Morris et al. , 2019 ) . 1Code : https : //github.com/vijaydwivedi75/gnn-lspe The said limitation can be alleviated , to certain extents , by ( i ) stacking multiple layers , ( ii ) applying higher-order GNNs , or ( iii ) considering positional encoding ( PE ) of nodes ( and edges ) . Let us assume two structurally identical nodes in a graph with the same 1-hop neighborhood , but different with respect to 2-hop or higher-order neighborhoods . Then , stacking several layers ( Bresson & Laurent , 2017 ; Li et al. , 2019 ) can propagate the information from a node to multiple hops , and thus differentiate the representation of two far-away nodes . However , this solution can be deficient for long-distance nodes because of the over-squashing phenomenon ( Alon & Yahav , 2020 ) . Another approach is to compute higher-order node-tuple aggregations such as in WL-based GNNs ( Maron et al. , 2019 ; Chen et al. , 2019 ) ; though these models are computationally more expensive to scale than MP-GNNs , even for medium-sized graphs ( Dwivedi et al. , 2020 ) . An alternative technique is to consider a global positioning of the nodes in the graph that can encode a graph-based distance between the nodes ( You et al. , 2019 ; Dwivedi et al. , 2020 ; Li et al. , 2020b ; Dwivedi & Bresson , 2021 ) , or can inform about specific sub-structures ( Bouritsas et al. , 2020 ; Bodnar et al. , 2021 ) . Contribution . In this work , we turn to the idea of learning positional representation that can be combined with structural GNNs to generate more expressive node embedding . Our main intent is to alleviate the lack of canonical positioning of nodes in arbitrary graphs to improve the representation power of MP-GNNs , while keeping their linear complexity for large-scale applications . For this objective , we propose a novel framework , illustrated with Figure 1 , that enables GNNs to learn both structural and positional representations at the same time ( thus named MPGNNs-LSPE ) . Alongside , we present a random-walk diffusion based positional encoding scheme to initialize the positional representations of the nodes . We show that the proposed architecture with learnable PE can be used with any graph network that fits to the MP-GNNs framework , and improves its performance ( 1.79 % to 64.14 % ) . In our demonstrations , we formulate LSPE instances of both sparse GNNs , such as GatedGCNs ( Bresson & Laurent , 2017 ) and PNA ( Corso et al. , 2020 ) and fully-connected Transformers-based GNNs ( Kreuzer et al. , 2021 ; Mialon et al. , 2021 ) . Our numerical experiments on three standard molecular benchmarks show that different instantiations of MP-GNNs with LSPE surpass the previous state-of-the-art ( SOTA ) on one dataset by a considerable margin ( 26.23 % ) , while achieving SOTA-comparable score on the other two datasets . The architecture also shows consistent improvements on three non-molecular benchmarks . In addition , our evaluations find the sparse MP-GNNs to be outperforming fully-connected GNNs , hence suggesting greater potential towards the development of highly efficient , yet powerful architectures for graphs . 2 RELATED WORK . In this section , we review briefly the three research directions theoretical expressivity of GNNs , graph positional encoding , and Transformer-based GNNs . Theoretical expressivity and Weisfeiler-Leman GNNs . As the theoretical expressiveness of MPGNNs is bounded by the 1-WL test ( Xu et al. , 2019 ; Morris et al. , 2019 ) , they may perform poorly on graphs that exhibit several symmetries ( Murphy et al. , 2019 ) , and additionally some message-passing functions may not be discriminative enough ( Corso et al. , 2020 ) . To this end , k-order EquivariantGNNs were introduced in Maron et al . ( 2018 ) requiring O ( nk ) memory and speed complexities . Although the complexity was improved to O ( n2 ) memory and O ( n3 ) respectively ( Maron et al. , 2019 ; Chen et al. , 2019 ; Azizian & Lelarge , 2020 ) , it is still inefficient compared with the linear complexity of MP-GNNs . Graph Positional Encoding . The idea of positional encoding , i.e . the notion of global position of pixels in images , words in texts and nodes in graphs , plays a central role in the effectiveness of the most prominent neural networks with ConvNets ( LeCun et al. , 1998 ) , RNNs ( Hochreiter & Schmidhuber , 1997 ) , and Transformers ( Vaswani et al. , 2017 ) . For GNNs , the position of nodes is more challenging due to the fact that there does not exist a canonical positioning of nodes in arbitrary graphs . Despite these issues , graph positional encoding are as much critical for GNNs as they are for ConvNets , RNNs and Transformers , as demonstrated for prediction tasks on graphs ( Srinivasan & Ribeiro , 2019 ; Cui et al. , 2021 ) . Nodes in a graph can be assigned index positional encoding ( PE ) . However , such a model must be trained with the n ! possible index permutations or else sampling needs to be done ( Murphy et al. , 2019 ) . Another PE candidate for graphs can be Laplacian Eigenvectors ( Dwivedi et al. , 2020 ; Dwivedi & Bresson , 2021 ) as they form a meaningful local coordinate system , while preserving the global graph structure . However , there exists sign ambiguity in such PE as eigenvectors are defined up to ±1 , leading to 2k number of possible sign values when selecting k eigenvectors which a network needs to learn . Similarly , the eigenvectors may be unstable due to eigenvalue multiplicities . You et al . ( 2019 ) proposed learnable position-aware embeddings based on random anchor sets of nodes , where the random selection of anchors has its limitations , which makes their approach less generalizable on inductive tasks . There also exists methods that encode prior information about a class of graphs of interest such as rings for molecules ( Bouritsas et al. , 2020 ; Bodnar et al. , 2021 ) which make MP-GNNs more expressive . But the prior information regarding graph sub-structures needs to be pre-computed , and sub-graph matching and counting require O ( nk ) for k-tuple sub-structure . Transformer-based GNNs . Although sparse MP-GNNs are very efficient , they are susceptible to the information bottleneck limitation ( Alon & Yahav , 2020 ) in addition to vanishing gradient ( similar to RNNs ) on tasks when long-range interactions between far away nodes are critical . To overcome these limitations , there have been recent works that generalize Transformers to graphs ( Dwivedi & Bresson , 2021 ; Kreuzer et al. , 2021 ; Ying et al. , 2021 ; Mialon et al. , 2021 ) which alleviates the long-range issue as ‘ everything is connected to everything ’ . However , these methods either use non-learnable PEs to encode graph structure information ( Dwivedi & Bresson , 2021 ; Ying et al. , 2021 ; Mialon et al. , 2021 ) , or inject learned PEs to the Transformer network that relies on Laplacian eigenvectors ( Kreuzer et al. , 2021 ) , thus inheriting the sign ambiguity limitation . A detailed review of the above research directions is available in the supplementary Section B . We attempt to address some of the major limitations of GNNs by proposing a novel architecture with consistent performance gains . 3 PROPOSED ARCHITECTURE . In this work , we decouple structural and positional representations to make it easy for the network to learn these two critical characteristics . This is in contrast with most existing architectures s.a. Dwivedi & Bresson ( 2021 ) ; Beani et al . ( 2021 ) ; Kreuzer et al . ( 2021 ) that inject the positional information into the input layer of the GNNs , and You et al . ( 2019 ) that rely on distance-measured anchor sets of nodes limiting general , inductive usage . Given the recent theoretical results on the importance of informative graph PE for expressive GNNs ( Murphy et al. , 2019 ; Srinivasan & Ribeiro , 2019 ; Loukas , 2020 ) , we are interested in a generic framework that can enable GNNs to separate positional and structural representations to increase their expressivity . Section 3.1 will introduce our approach to augment GNNs with learnable graph PE . Our framework can be used with different GNN architectures . We illustrate this flexibility in Sections C.1 and C.2 where the decoupling of structural and positional information is applied to both sparse MP-GNNs and fully-connected GNNs . 3.1 GENERIC FORMULATION : MP-GNNS-LSPE Notation . Let G = ( V , E ) be a graph with V being the set of nodes and E the set of edges . The graph has n = |V| nodes and E = |E| edges . The connectivity of the graph is represented by the adjacency matrix A ∈ Rn×n where Aij = 1 if there exists an edge between the nodes i and j ; otherwise Aij = 0 . The degree matrix is denoted D ∈ Rn×n . The node features and positional features for node i is denoted by hi and pi respectively , while the features for an edge between nodes i and j is indicated by eij . A GNN model is composed of three main components ; an embedding layer for the input features , a stack of convolutional layers , and a final task-based layer , as in Figure 1 . The layers are indexed by ` and ` = 0 denotes the input layer . Standard MP-GNNs . Considering a graph which has available node and edge features , and these are transformed at each layer , the update equations for a conventional MP-GNN layer are defined as : MP-GNNs : h ` +1i = fh ( h ` i , { h ` j } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 1 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 2 ) where fh and fe are functions with learnable parameters , and Ni is the neighborhood of the node i . The design of functions fh and fe depends on the GNN architecture used , see Zhou et al . ( 2020 ) for a review . As Transformer neural networks ( Vaswani et al. , 2017 ) are a special case of MP-GNNs ( Joshi , 2020 ) , Eq . ( 1 ) can be simplified to encompass the original Transformers by dropping the edge features and making the graph fully connected . Input features and initialization . The node and edge features at layer ` = 0 are produced by a linear embedding of available input node and edge features denoted respectively by hini ∈ Rdv , einij ∈ Rde : h ` =0i = LLh ( h in i ) = A 0hini + a 0 ∈ Rd , e ` =0ij = LLe ( einij ) = B0einij + b0 ∈ Rd , where A0 ∈ Rd×dv , B0 ∈ Rd×de and a0 , b0 ∈ Rd are the learnable parameters of the linear layers . Positional Encoding . Existing MP-GNNs that integrate positional information usually propose to concatenate the PE with the input node features , similarly to Transformers ( Vaswani et al. , 2017 ) : MP-GNNs-PE : h ` +1i = fh ( h ` i , { h ` j } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 3 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 4 ) with initial h ` =0i = LLh ( [ hini pini ] ) = D0 [ hini pini ] + d0 ∈ Rd , ( 5 ) and e ` =0ij = LLe ( e in ij ) = B 0einij + b 0 ∈ Rd , ( 6 ) where pini ∈ Rk is the input PE of node i , D0 ∈ Rd× ( dv+k ) , d0 ∈ Rd are parameters for the linear transformation . Such architecture merges the positional and structural representations together . It has the advantage to keep the same linear complexity for learning , but it does not allow the positional representation to be changed and better adjusted to the task at hand . Decoupling position and structure in MP-GNNs . We decouple the positional information from the structural information such that both representations are learned separately resulting in an architecture with Learnable Structural and Positional Encodings , which we call MP-GNNs-LSPE . The layer update equations are defined as : MP-GNNs-LSPE : h ` +1i = fh ( [ h ` i p ` i ] , { [ h ` j p ` j ] } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 7 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 8 ) p ` +1i = fp ( p ` i , { p ` j } j∈Ni , e ` ij ) , p ` +1i , p ` i ∈ Rd , ( 9 ) The difference of this architecture with the standard MP-GNNs is the addition of the positional representation update Eq . ( 9 ) , along with the concatenation of these learnable PEs with the node structural features , Eq . ( 7 ) . As we will see in the next section , the design of the message-passing function fp follows the same analytical form of fh but with the use of the tanh activation function to allow positive and negative values for the positional coordinates . It should be noted that the inclusion of the edge features , e ` ij in the h or p update is optional as several MP-GNNs do not include edge features in their h updates . Nevertheless , the architecture we present is made as generic so as to be used for future extensions in a convenient way . Definition of initial PE . The choice of the initial PE is critical . In this work , we consider two PEs : Laplacian PE ( LapPE ) and Random Walk PE ( RWPE ) . LapPE are defined in Section B.2 as pLapPEi = [ Ui1 , Ui2 , · · · , Uik ] ∈ Rk . LapPE provide a unique node representation and are distancesensitive w.r.t . the Euclidean norm . However , they are limited by the sign ambiguity , which requires random sign flipping during training for the network to learn this invariance ( Dwivedi et al. , 2020 ) . Inspired by Li et al . ( 2020b ) , we propose RWPE , a PE based on the random walk ( RW ) diffusion process ( although other graph diffusions can be considered s.a. PageRank ( Mialon et al. , 2021 ) ) . Formally , RWPE are defined with k-steps of random walk as : pRWPEi = [ RWii , RW2ii , · · · , RWkii ] ∈ Rk , ( 10 ) where RW = AD−1 is the random walk operator . In contrast of Li et al . ( 2020b ) which uses the full matrix RWij for all pairwise nodes , we adopt a low-complexity usage of the random walk matrix by considering only the landing probability of a node i to itself , i.e . RWii . Note that these PE do not suffer from the sign ambiguity of LapPE , so the network is not required to learn additional invariance . RWPE provide a unique node representation under the condition that each node has a unique k-hop topological neighborhood for a sufficient large k. This assumption can be discussed . If we consider synthetic strongly regular graphs like the CSL graphs ( Murphy et al. , 2019 ) , then all nodes in a graph have the same RWPE for any k value , since they are isomorphic by construction . However , despite RWPE being the same for all nodes in a graph , these PE are unique for each class of isomorphic graphs , resulting in a perfect classification of the CSL dataset , see Section A.1 . For graphs such as Decalin and Bicyclopentyl ( Sato , 2020 ) , nodes which are not isomorphic receive different RWPE for k ≥ 5 , also in Section A.1 . Finally , for real-world graphs like ZINC molecules , most nodes receive a unique node representation for k ≥ 24 , see Figure 2 for an illustration , where the two molecules have 100 % and 71.43 % unique RWPEs respectively . Section A.3 presents a detailed study . Experimentally , we will show that RWPE outperform LapPE , suggesting that learning the sign invariance is more difficult ( as there exist 2k possible sign flips for each graph ) than not exactly having unique node representation for each node . As mentioned above for CSL , RWPE are related to the problem of graph isomorphism and higher-order node interactions . Precisely , iterating the random walk operator for a suitable number of steps allows coloring non-isomorphic nodes , thus distinguishing several cases of non-isomorphic graphs on which the 1-WL test , and equivalently MP-GNNs , fail s.a. the CSL , Decalin and Bicyclopentyl graphs . We refer to Section A.2 for a formal presentation of the iterative algorithm . Finally , the initial PE of the network is obtained by embedding the LapPE or RWPE into a d-dimensional feature vector : p ` =0i = LLp ( p PE i ) = C 0pPEi + c 0 ∈ Rd , where C0 ∈ Rd×k , c0 ∈ Rd . ( 11 ) Positional loss . As we separate the learning of the structual and positional representations , it is possible to consider a specific positional encoding loss along with the task loss . A natural candidate is the Laplacian eigenvector loss ( Belkin & Niyogi , 2003 ; Lai & Osher , 2014 ) that enforces the PE to form a coordinate system constrained by the graph topology . As such , the final loss function of MP-GNNs-LSPE is composed of two terms : Loss = LossTask ( [ h ` =L p ` =L ] ) + α LossLapEig ( p ` =L ) , ( 12 ) where h ` =L ∈ Rn×d , p ` =L ∈ Rn×k , k is the dimension of learned PE , ` = L is the final GNN layer , and α > 0 an hyper-parameter . Observe also that we enforce the final positional vectors p ` =L to have centered and unit norm with mean ( p ` =L· , k ) = 0 , ‖p ` =L· , k ‖ = 1 , ∀k to better approximate the Laplacian eigenvector loss defined by LossLapEig ( p ) = 1k trace ( pT∆p ) + λk ∥∥pT p − Ik∥∥2F with λ > 0 and ‖ · ‖2F being the Frobenius norm . 3.2 INSTANCES OF LSPE WITH MP-GNNS AND TRANSFORMER GNNS We instantiate two classes of GNN architectures , both sparse MP-GNNs and fully-connected Transformer GNNs using our proposed LSPE framework . For sparse MP-GNNs , we consider GatedGCN ( Bresson & Laurent , 2017 ) and PNA ( Corso et al. , 2020 ) , while we extend the recently developed SAN ( Kreuzer et al. , 2021 ) and GraphiT ( Mialon et al. , 2021 ) with LSPE to develop TransformerLSPE architectures . We briefly demonstrate here how a GNN can be instantiated using LSPE ( Eqs . ( 7-9 ) ) by developing GatedGCN-LSPE ( Eqs . ( 14-16 ) ) , while the complete equations for the four models are defined in Section C of the supplementary material , given the space constraint . GatedGCN-LSPE : Originally , GatedGCNs are sparse MP-GNNs equipped with a soft-attention mechanism that is able to learn adaptive edge gates to improve the message aggregation step of GCN networks ( Kipf & Welling , 2017 ) . Our proposed extension of this model with LSPE is defined as : h ` +1 , e ` +1 , p ` +1 = GatedGCN-LSPE ( h ` , e ` , p ` ) , h ∈ Rn×d , e ∈ RE×d , p ∈ Rn×d , ( 13 ) with h ` +1i = h ` i + ReLU ( BN ( A ` 1 [ h ` i p ` i ] + ∑ j∈N ( i ) η ` ij A ` 2 [ h ` j p ` j ] ) ) , ( 14 ) e ` +1ij = e ` ij + ReLU ( BN ( η̂ ` ij ) ) , ( 15 ) p ` +1i = p ` i + tanh ( C ` 1p ` i + ∑ j∈N ( i ) η ` ij C ` 2p ` j ) , ( 16 ) where η ` ij = σ ( η̂ ` ij ) / ( ∑ j′∈N ( i ) σ ( η̂ ` ij′ ) + ) , η̂ ` ij = B ` 1h ` i + B ` 2h ` j + B ` 3e ` ij , h ` i , e ` ij , p ` i , η ` ij , η̂ ` ij ∈ Rd , A ` 1 , A ` 2 ∈ Rd×2d and B ` 1 , B ` 2 , B ` 3 , C ` 1 , C ` 2 ∈ Rd×d . Notice the p-update in Eq . ( 16 ) follows the same analytical form as the h-update in Eq . ( 14 ) except for the difference in activation function , and omission of BN , which was not needed in our experiments . | This paper is concerning the Positional Encoding (PE) for GNNs. PE augments the typical GNNs to distinguish isomorphic nodes. However, existing PE models such as Laplacian eigenvectors require huge computational resources. This manuscript proposes LSPE that augments the input to the nodes AND the embedding vectors with PE elements. The LSPE models iteratively updates the embedding for PEs, in addition to the node feature embeddings. The update formula of the PE embedding is similar to those of the node feature embedding, thus the computational requirements of the LSPE does not . The manuscript tests two ways of PEs, one is based on the Laplacian, and the other is based on the random-walk. The manuscript also proposes the PE=only loss to foster the training. Experimental results shows that the propose LSPE can improve the graph regression of the ZINC dataset greatly, and also can achieve some improvements in graph classification tasks on the MOLTOX21 and the MOLPCBA datasets. | SP:b9cbdab6989220afcdf7c836d52119d93997c3a1 |
Graph Neural Networks with Learnable Structural and Positional Representations | 1 INTRODUCTION . GNNs have recently emerged as a powerful class of deep learning architectures to analyze datasets where information is present in the form of heteregeneous graphs that encode complex data connectivity . Experimentally , these architectures have shown great promises to be impactful in diverse domains such as drug design ( Stokes et al. , 2020 ; Gaudelet et al. , 2020 ) , social networks ( Monti et al. , 2019 ; Pal et al. , 2020 ) , traffic networks ( Derrow-Pinion et al. , 2021 ) , physics ( Cranmer et al. , 2019 ; Bapst et al. , 2020 ) , combinatorial optimization ( Bengio et al. , 2021 ; Cappart et al. , 2021 ) and medical diagnosis ( Li et al. , 2020c ) . Most GNNs ( such as Defferrard et al . ( 2016 ) ; Sukhbaatar et al . ( 2016 ) ; Kipf & Welling ( 2017 ) ; Hamilton et al . ( 2017 ) ; Monti et al . ( 2017 ) ; Bresson & Laurent ( 2017 ) ; Veličković et al . ( 2018 ) ; Xu et al . ( 2019 ) ) are designed with a message-passing mechanism ( Gilmer et al. , 2017 ) that builds node representation by aggregating local neighborhood information . It means that this class of GNNs is fundamentally structural , i.e . the node representation only depends on the local structure of the graph . As such , two atoms in a molecule with the same neighborhood are expected to have similar representation . However , it can be limiting to have the same representation for these two atoms as their positions in the molecule are distinct , and their role may be specifically separate ( Murphy et al. , 2019 ) . As a consequence , the popular message-passing GNNs ( MP-GNNs ) fail to differentiate two nodes with the same 1-hop local structure . This restriction is now properly understood in the context of the equivalence of MP-GNNs with Weisfeiler-Leman ( WL ) test ( Weisfeiler & Leman , 1968 ) for graph isomorphism ( Xu et al. , 2019 ; Morris et al. , 2019 ) . 1Code : https : //github.com/vijaydwivedi75/gnn-lspe The said limitation can be alleviated , to certain extents , by ( i ) stacking multiple layers , ( ii ) applying higher-order GNNs , or ( iii ) considering positional encoding ( PE ) of nodes ( and edges ) . Let us assume two structurally identical nodes in a graph with the same 1-hop neighborhood , but different with respect to 2-hop or higher-order neighborhoods . Then , stacking several layers ( Bresson & Laurent , 2017 ; Li et al. , 2019 ) can propagate the information from a node to multiple hops , and thus differentiate the representation of two far-away nodes . However , this solution can be deficient for long-distance nodes because of the over-squashing phenomenon ( Alon & Yahav , 2020 ) . Another approach is to compute higher-order node-tuple aggregations such as in WL-based GNNs ( Maron et al. , 2019 ; Chen et al. , 2019 ) ; though these models are computationally more expensive to scale than MP-GNNs , even for medium-sized graphs ( Dwivedi et al. , 2020 ) . An alternative technique is to consider a global positioning of the nodes in the graph that can encode a graph-based distance between the nodes ( You et al. , 2019 ; Dwivedi et al. , 2020 ; Li et al. , 2020b ; Dwivedi & Bresson , 2021 ) , or can inform about specific sub-structures ( Bouritsas et al. , 2020 ; Bodnar et al. , 2021 ) . Contribution . In this work , we turn to the idea of learning positional representation that can be combined with structural GNNs to generate more expressive node embedding . Our main intent is to alleviate the lack of canonical positioning of nodes in arbitrary graphs to improve the representation power of MP-GNNs , while keeping their linear complexity for large-scale applications . For this objective , we propose a novel framework , illustrated with Figure 1 , that enables GNNs to learn both structural and positional representations at the same time ( thus named MPGNNs-LSPE ) . Alongside , we present a random-walk diffusion based positional encoding scheme to initialize the positional representations of the nodes . We show that the proposed architecture with learnable PE can be used with any graph network that fits to the MP-GNNs framework , and improves its performance ( 1.79 % to 64.14 % ) . In our demonstrations , we formulate LSPE instances of both sparse GNNs , such as GatedGCNs ( Bresson & Laurent , 2017 ) and PNA ( Corso et al. , 2020 ) and fully-connected Transformers-based GNNs ( Kreuzer et al. , 2021 ; Mialon et al. , 2021 ) . Our numerical experiments on three standard molecular benchmarks show that different instantiations of MP-GNNs with LSPE surpass the previous state-of-the-art ( SOTA ) on one dataset by a considerable margin ( 26.23 % ) , while achieving SOTA-comparable score on the other two datasets . The architecture also shows consistent improvements on three non-molecular benchmarks . In addition , our evaluations find the sparse MP-GNNs to be outperforming fully-connected GNNs , hence suggesting greater potential towards the development of highly efficient , yet powerful architectures for graphs . 2 RELATED WORK . In this section , we review briefly the three research directions theoretical expressivity of GNNs , graph positional encoding , and Transformer-based GNNs . Theoretical expressivity and Weisfeiler-Leman GNNs . As the theoretical expressiveness of MPGNNs is bounded by the 1-WL test ( Xu et al. , 2019 ; Morris et al. , 2019 ) , they may perform poorly on graphs that exhibit several symmetries ( Murphy et al. , 2019 ) , and additionally some message-passing functions may not be discriminative enough ( Corso et al. , 2020 ) . To this end , k-order EquivariantGNNs were introduced in Maron et al . ( 2018 ) requiring O ( nk ) memory and speed complexities . Although the complexity was improved to O ( n2 ) memory and O ( n3 ) respectively ( Maron et al. , 2019 ; Chen et al. , 2019 ; Azizian & Lelarge , 2020 ) , it is still inefficient compared with the linear complexity of MP-GNNs . Graph Positional Encoding . The idea of positional encoding , i.e . the notion of global position of pixels in images , words in texts and nodes in graphs , plays a central role in the effectiveness of the most prominent neural networks with ConvNets ( LeCun et al. , 1998 ) , RNNs ( Hochreiter & Schmidhuber , 1997 ) , and Transformers ( Vaswani et al. , 2017 ) . For GNNs , the position of nodes is more challenging due to the fact that there does not exist a canonical positioning of nodes in arbitrary graphs . Despite these issues , graph positional encoding are as much critical for GNNs as they are for ConvNets , RNNs and Transformers , as demonstrated for prediction tasks on graphs ( Srinivasan & Ribeiro , 2019 ; Cui et al. , 2021 ) . Nodes in a graph can be assigned index positional encoding ( PE ) . However , such a model must be trained with the n ! possible index permutations or else sampling needs to be done ( Murphy et al. , 2019 ) . Another PE candidate for graphs can be Laplacian Eigenvectors ( Dwivedi et al. , 2020 ; Dwivedi & Bresson , 2021 ) as they form a meaningful local coordinate system , while preserving the global graph structure . However , there exists sign ambiguity in such PE as eigenvectors are defined up to ±1 , leading to 2k number of possible sign values when selecting k eigenvectors which a network needs to learn . Similarly , the eigenvectors may be unstable due to eigenvalue multiplicities . You et al . ( 2019 ) proposed learnable position-aware embeddings based on random anchor sets of nodes , where the random selection of anchors has its limitations , which makes their approach less generalizable on inductive tasks . There also exists methods that encode prior information about a class of graphs of interest such as rings for molecules ( Bouritsas et al. , 2020 ; Bodnar et al. , 2021 ) which make MP-GNNs more expressive . But the prior information regarding graph sub-structures needs to be pre-computed , and sub-graph matching and counting require O ( nk ) for k-tuple sub-structure . Transformer-based GNNs . Although sparse MP-GNNs are very efficient , they are susceptible to the information bottleneck limitation ( Alon & Yahav , 2020 ) in addition to vanishing gradient ( similar to RNNs ) on tasks when long-range interactions between far away nodes are critical . To overcome these limitations , there have been recent works that generalize Transformers to graphs ( Dwivedi & Bresson , 2021 ; Kreuzer et al. , 2021 ; Ying et al. , 2021 ; Mialon et al. , 2021 ) which alleviates the long-range issue as ‘ everything is connected to everything ’ . However , these methods either use non-learnable PEs to encode graph structure information ( Dwivedi & Bresson , 2021 ; Ying et al. , 2021 ; Mialon et al. , 2021 ) , or inject learned PEs to the Transformer network that relies on Laplacian eigenvectors ( Kreuzer et al. , 2021 ) , thus inheriting the sign ambiguity limitation . A detailed review of the above research directions is available in the supplementary Section B . We attempt to address some of the major limitations of GNNs by proposing a novel architecture with consistent performance gains . 3 PROPOSED ARCHITECTURE . In this work , we decouple structural and positional representations to make it easy for the network to learn these two critical characteristics . This is in contrast with most existing architectures s.a. Dwivedi & Bresson ( 2021 ) ; Beani et al . ( 2021 ) ; Kreuzer et al . ( 2021 ) that inject the positional information into the input layer of the GNNs , and You et al . ( 2019 ) that rely on distance-measured anchor sets of nodes limiting general , inductive usage . Given the recent theoretical results on the importance of informative graph PE for expressive GNNs ( Murphy et al. , 2019 ; Srinivasan & Ribeiro , 2019 ; Loukas , 2020 ) , we are interested in a generic framework that can enable GNNs to separate positional and structural representations to increase their expressivity . Section 3.1 will introduce our approach to augment GNNs with learnable graph PE . Our framework can be used with different GNN architectures . We illustrate this flexibility in Sections C.1 and C.2 where the decoupling of structural and positional information is applied to both sparse MP-GNNs and fully-connected GNNs . 3.1 GENERIC FORMULATION : MP-GNNS-LSPE Notation . Let G = ( V , E ) be a graph with V being the set of nodes and E the set of edges . The graph has n = |V| nodes and E = |E| edges . The connectivity of the graph is represented by the adjacency matrix A ∈ Rn×n where Aij = 1 if there exists an edge between the nodes i and j ; otherwise Aij = 0 . The degree matrix is denoted D ∈ Rn×n . The node features and positional features for node i is denoted by hi and pi respectively , while the features for an edge between nodes i and j is indicated by eij . A GNN model is composed of three main components ; an embedding layer for the input features , a stack of convolutional layers , and a final task-based layer , as in Figure 1 . The layers are indexed by ` and ` = 0 denotes the input layer . Standard MP-GNNs . Considering a graph which has available node and edge features , and these are transformed at each layer , the update equations for a conventional MP-GNN layer are defined as : MP-GNNs : h ` +1i = fh ( h ` i , { h ` j } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 1 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 2 ) where fh and fe are functions with learnable parameters , and Ni is the neighborhood of the node i . The design of functions fh and fe depends on the GNN architecture used , see Zhou et al . ( 2020 ) for a review . As Transformer neural networks ( Vaswani et al. , 2017 ) are a special case of MP-GNNs ( Joshi , 2020 ) , Eq . ( 1 ) can be simplified to encompass the original Transformers by dropping the edge features and making the graph fully connected . Input features and initialization . The node and edge features at layer ` = 0 are produced by a linear embedding of available input node and edge features denoted respectively by hini ∈ Rdv , einij ∈ Rde : h ` =0i = LLh ( h in i ) = A 0hini + a 0 ∈ Rd , e ` =0ij = LLe ( einij ) = B0einij + b0 ∈ Rd , where A0 ∈ Rd×dv , B0 ∈ Rd×de and a0 , b0 ∈ Rd are the learnable parameters of the linear layers . Positional Encoding . Existing MP-GNNs that integrate positional information usually propose to concatenate the PE with the input node features , similarly to Transformers ( Vaswani et al. , 2017 ) : MP-GNNs-PE : h ` +1i = fh ( h ` i , { h ` j } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 3 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 4 ) with initial h ` =0i = LLh ( [ hini pini ] ) = D0 [ hini pini ] + d0 ∈ Rd , ( 5 ) and e ` =0ij = LLe ( e in ij ) = B 0einij + b 0 ∈ Rd , ( 6 ) where pini ∈ Rk is the input PE of node i , D0 ∈ Rd× ( dv+k ) , d0 ∈ Rd are parameters for the linear transformation . Such architecture merges the positional and structural representations together . It has the advantage to keep the same linear complexity for learning , but it does not allow the positional representation to be changed and better adjusted to the task at hand . Decoupling position and structure in MP-GNNs . We decouple the positional information from the structural information such that both representations are learned separately resulting in an architecture with Learnable Structural and Positional Encodings , which we call MP-GNNs-LSPE . The layer update equations are defined as : MP-GNNs-LSPE : h ` +1i = fh ( [ h ` i p ` i ] , { [ h ` j p ` j ] } j∈Ni , e ` ij ) , h ` +1i , h ` i ∈ Rd , ( 7 ) e ` +1ij = fe ( h ` i , h ` j , e ` ij ) , e ` +1ij , e ` ij ∈ Rd , ( 8 ) p ` +1i = fp ( p ` i , { p ` j } j∈Ni , e ` ij ) , p ` +1i , p ` i ∈ Rd , ( 9 ) The difference of this architecture with the standard MP-GNNs is the addition of the positional representation update Eq . ( 9 ) , along with the concatenation of these learnable PEs with the node structural features , Eq . ( 7 ) . As we will see in the next section , the design of the message-passing function fp follows the same analytical form of fh but with the use of the tanh activation function to allow positive and negative values for the positional coordinates . It should be noted that the inclusion of the edge features , e ` ij in the h or p update is optional as several MP-GNNs do not include edge features in their h updates . Nevertheless , the architecture we present is made as generic so as to be used for future extensions in a convenient way . Definition of initial PE . The choice of the initial PE is critical . In this work , we consider two PEs : Laplacian PE ( LapPE ) and Random Walk PE ( RWPE ) . LapPE are defined in Section B.2 as pLapPEi = [ Ui1 , Ui2 , · · · , Uik ] ∈ Rk . LapPE provide a unique node representation and are distancesensitive w.r.t . the Euclidean norm . However , they are limited by the sign ambiguity , which requires random sign flipping during training for the network to learn this invariance ( Dwivedi et al. , 2020 ) . Inspired by Li et al . ( 2020b ) , we propose RWPE , a PE based on the random walk ( RW ) diffusion process ( although other graph diffusions can be considered s.a. PageRank ( Mialon et al. , 2021 ) ) . Formally , RWPE are defined with k-steps of random walk as : pRWPEi = [ RWii , RW2ii , · · · , RWkii ] ∈ Rk , ( 10 ) where RW = AD−1 is the random walk operator . In contrast of Li et al . ( 2020b ) which uses the full matrix RWij for all pairwise nodes , we adopt a low-complexity usage of the random walk matrix by considering only the landing probability of a node i to itself , i.e . RWii . Note that these PE do not suffer from the sign ambiguity of LapPE , so the network is not required to learn additional invariance . RWPE provide a unique node representation under the condition that each node has a unique k-hop topological neighborhood for a sufficient large k. This assumption can be discussed . If we consider synthetic strongly regular graphs like the CSL graphs ( Murphy et al. , 2019 ) , then all nodes in a graph have the same RWPE for any k value , since they are isomorphic by construction . However , despite RWPE being the same for all nodes in a graph , these PE are unique for each class of isomorphic graphs , resulting in a perfect classification of the CSL dataset , see Section A.1 . For graphs such as Decalin and Bicyclopentyl ( Sato , 2020 ) , nodes which are not isomorphic receive different RWPE for k ≥ 5 , also in Section A.1 . Finally , for real-world graphs like ZINC molecules , most nodes receive a unique node representation for k ≥ 24 , see Figure 2 for an illustration , where the two molecules have 100 % and 71.43 % unique RWPEs respectively . Section A.3 presents a detailed study . Experimentally , we will show that RWPE outperform LapPE , suggesting that learning the sign invariance is more difficult ( as there exist 2k possible sign flips for each graph ) than not exactly having unique node representation for each node . As mentioned above for CSL , RWPE are related to the problem of graph isomorphism and higher-order node interactions . Precisely , iterating the random walk operator for a suitable number of steps allows coloring non-isomorphic nodes , thus distinguishing several cases of non-isomorphic graphs on which the 1-WL test , and equivalently MP-GNNs , fail s.a. the CSL , Decalin and Bicyclopentyl graphs . We refer to Section A.2 for a formal presentation of the iterative algorithm . Finally , the initial PE of the network is obtained by embedding the LapPE or RWPE into a d-dimensional feature vector : p ` =0i = LLp ( p PE i ) = C 0pPEi + c 0 ∈ Rd , where C0 ∈ Rd×k , c0 ∈ Rd . ( 11 ) Positional loss . As we separate the learning of the structual and positional representations , it is possible to consider a specific positional encoding loss along with the task loss . A natural candidate is the Laplacian eigenvector loss ( Belkin & Niyogi , 2003 ; Lai & Osher , 2014 ) that enforces the PE to form a coordinate system constrained by the graph topology . As such , the final loss function of MP-GNNs-LSPE is composed of two terms : Loss = LossTask ( [ h ` =L p ` =L ] ) + α LossLapEig ( p ` =L ) , ( 12 ) where h ` =L ∈ Rn×d , p ` =L ∈ Rn×k , k is the dimension of learned PE , ` = L is the final GNN layer , and α > 0 an hyper-parameter . Observe also that we enforce the final positional vectors p ` =L to have centered and unit norm with mean ( p ` =L· , k ) = 0 , ‖p ` =L· , k ‖ = 1 , ∀k to better approximate the Laplacian eigenvector loss defined by LossLapEig ( p ) = 1k trace ( pT∆p ) + λk ∥∥pT p − Ik∥∥2F with λ > 0 and ‖ · ‖2F being the Frobenius norm . 3.2 INSTANCES OF LSPE WITH MP-GNNS AND TRANSFORMER GNNS We instantiate two classes of GNN architectures , both sparse MP-GNNs and fully-connected Transformer GNNs using our proposed LSPE framework . For sparse MP-GNNs , we consider GatedGCN ( Bresson & Laurent , 2017 ) and PNA ( Corso et al. , 2020 ) , while we extend the recently developed SAN ( Kreuzer et al. , 2021 ) and GraphiT ( Mialon et al. , 2021 ) with LSPE to develop TransformerLSPE architectures . We briefly demonstrate here how a GNN can be instantiated using LSPE ( Eqs . ( 7-9 ) ) by developing GatedGCN-LSPE ( Eqs . ( 14-16 ) ) , while the complete equations for the four models are defined in Section C of the supplementary material , given the space constraint . GatedGCN-LSPE : Originally , GatedGCNs are sparse MP-GNNs equipped with a soft-attention mechanism that is able to learn adaptive edge gates to improve the message aggregation step of GCN networks ( Kipf & Welling , 2017 ) . Our proposed extension of this model with LSPE is defined as : h ` +1 , e ` +1 , p ` +1 = GatedGCN-LSPE ( h ` , e ` , p ` ) , h ∈ Rn×d , e ∈ RE×d , p ∈ Rn×d , ( 13 ) with h ` +1i = h ` i + ReLU ( BN ( A ` 1 [ h ` i p ` i ] + ∑ j∈N ( i ) η ` ij A ` 2 [ h ` j p ` j ] ) ) , ( 14 ) e ` +1ij = e ` ij + ReLU ( BN ( η̂ ` ij ) ) , ( 15 ) p ` +1i = p ` i + tanh ( C ` 1p ` i + ∑ j∈N ( i ) η ` ij C ` 2p ` j ) , ( 16 ) where η ` ij = σ ( η̂ ` ij ) / ( ∑ j′∈N ( i ) σ ( η̂ ` ij′ ) + ) , η̂ ` ij = B ` 1h ` i + B ` 2h ` j + B ` 3e ` ij , h ` i , e ` ij , p ` i , η ` ij , η̂ ` ij ∈ Rd , A ` 1 , A ` 2 ∈ Rd×2d and B ` 1 , B ` 2 , B ` 3 , C ` 1 , C ` 2 ∈ Rd×d . Notice the p-update in Eq . ( 16 ) follows the same analytical form as the h-update in Eq . ( 14 ) except for the difference in activation function , and omission of BN , which was not needed in our experiments . | This paper proposes a framework that utilizes Random Walk Positional Embeddings (RWPE) as extra features to boost the performance of GNNs. In particular, positional embeddings are updated as a separate forward network in each layer. The framework has demonstrated improved quality by injecting its positional embeddings and feed-forward structures in several GNNs. | SP:b9cbdab6989220afcdf7c836d52119d93997c3a1 |
Understanding and Leveraging Overparameterization in Recursive Value Estimation | The theory of function approximation in reinforcement learning ( RL ) typically considers low capacity representations that incur a tradeoff between approximation error , stability and generalization . Current deep architectures , however , operate in an overparameterized regime where approximation error is not necessarily a bottleneck . To better understand the utility of deep models in RL we present an analysis of recursive value estimation using overparameterized linear representations that provides useful , transferable findings . First , we show that classical updates such as temporal difference ( TD ) learning or fitted-value-iteration ( FVI ) converge to different fixed points than residual minimization ( RM ) in the overparameterized linear case . We then develop a unified interpretation of overparameterized linear value estimation as minimizing the Euclidean norm of the weights subject to alternative constraints . A practical consequence is that RM can be modified by a simple alteration of the backup targets to obtain the same fixed points as FVI and TD ( when they converge ) , while universally ensuring stability . Further , we provide an analysis of the generalization error of these methods , demonstrating per iterate bounds on the value prediction error of FVI , and fixed point bounds for TD and RM . Given this understanding , we then develop new algorithmic tools for improving recursive value estimation with deep models . In particular , we extract two regularizers that penalize out-of-span top-layer weights and co-linearity in top-layer features respectively . Empirically we find that these regularizers dramatically improve the stability of TD and FVI , while allowing RM to match and even sometimes surpass their generalization performance with assured stability . 1 INTRODUCTION . Model-free value estimation remains a core method of reinforcement learning ( RL ) , lying at the heart of some of the most prominent achievements in this area ( Mnih et al. , 2015 ; Bellemare et al. , 2020 ) . Such success appears paradoxical however , given that value estimation is subject to the deadly triad : any value update that combines off-policy estimation with Bellman-bootstrapping and function approximation diverges in the worst case ( Sutton and Barto , 2018 ) . Without additional assumptions it is impossible to ensure the viability of iterative value estimation schemes , yet this remains a dominant method in RL—its popularity supported by empirical success in many applications . Such a sizable gap between theory and practice reflects limited understanding of such methods , how they behave in practice , and what accounts for their empirical success ( van Hasselt et al. , 2018 ; Achiam et al. , 2019 ) . Decomposing the deadly triad indicates that off-policy estimation and bootstrapping are difficult to forego : off-policy estimation is supported by the empirical effectiveness of action value maximization and replay buffers , while Bellman-bootstrapping provides significant advantages over Monte Carlo estimation ( Sutton , 1988 ) . On the other hand , our understanding of the third factor , the relationship between function representation and generalization , has evolved dramatically in recent years . Although it was once thought that restrictive function approximation—representations that lack capacity to fit all data constraints—might be essential for generalization , we now know that this view is oversimplified ( Belkin et al. , 2019 ) . The empirical success of deep learning ( Krizhevsky et al. , 2012 ) , extremely large models ( Brown et al. , 2020 ) and associated theoretical advances ( Jacot et al. , 2018 ) have made it clear that gradient-based training of overparameterized models embodies implicit biases that encourage generalization even after all data constraints are fit exactly . This success suggests a new opportunity for breaking the deadly triad : by leveraging overparameterized value representations one can avoid some of the most difficult tradeoffs in value-based RL ( Lu et al. , 2018 ) . The use of overparameterized deep models in value-based RL , however , still exhibits mysteries in stability and performance . Although one might expect larger capacity models to improve the stability of Bellman-bootstrapping , in fact the opposite appears to occur ( van Hasselt et al. , 2018 ) . Our own empirical experience indicates that classical value estimation with deep models always diverges eventually in non-toy problems . It has also been shown that value updating leads to premature rankcollapse in deep models ( Kumar et al. , 2021 ) , coinciding with instability and degrading generalization . In practice , some form of early-stopping is usually necessary to obtaining successful results , a fact that is not often emphasized in the literature ( Agarwal et al. , 2021 ) . Meanwhile , there is a long history of convergent methods being proposed in the RL literature—starting from residual gradient ( Baird , 1995 ) , to gradient-TD ( Sutton et al. , 2008 ; Maei et al. , 2009 ) , prox gradient TD ( Liu et al. , 2015 ; 2016 ) , and emphatic TD ( Yu , 2015 ; Sutton et al. , 2016 ) —yet none of these has demonstrated sufficient generalization quality to supplant unstable methods . The current state of development leaves an awkward tradeoff between stability and generalization . A stable recursive value estimation method that ensures generalization quality with overparametrization remains elusive . In this paper we investigate whether overparameterized value representations might allow the stabilitygeneralization tradeoff to be better managed , enabling stable estimation methods that break the deadly triad and generalize well . To this end , we first consider policy evaluation with overparameterized linear value representations , a simplified setting that still imposes the deadly triad ( Zhang et al. , 2021 ) . Here we first show that alternative updates , such as temporal differencing ( TD ) , fitted value iteration ( FVI ) and residual minimization ( RM ) converge to different fixed points in the overparameterized case ( when they converge ) , even though these updates share a common fixed point when the approximation error is zero and there are no extra degrees of freedom ( Dann et al. , 2014 ) . That is , these algorithms embody certain implicit biases that only become distinguishable in the overparameterized case . From this result , we observe that the fixed points lie in different bases , which we use to develop a unified view of iterative value estimation as minimizing the Euclidean norm of the weights subject to alternative constraint sets . This unification allows us to formulate alternative updates that share common fixed points with TD and FVI but guarantee stability without requiring regularization or prox constraints ( Zhang et al. , 2021 ) . Next , we analyze the generalization performance of these algorithms and provide a per-iterate bound on the value estimation error of FVI , and fixed point bounds on the value estimation error of TD . From these results , we identify two novel regularizers , one that closes the gap between RM and TD and another that quantifies the effect of the feature representation on the generalization bound . We deploy these regularizers in a realistic study of deep model training for optimal value estimation and observe systematic stability and generalization improvements . We also observe that the performance gap between RM and TD/FVI can be closed and in some cases eliminated . 2 RELATED WORK . Value estimation has a lengthy history throughout RL research . Our main focus is on off-policy value estimation with parametric function representations and iterative ( i.e. , gradient based ) updates . We do not consider exploration nor full planning problems ( i.e. , approximately solving an entire Markov decision process ( MDP ) ) in the theoretical development , but instead focus on offline value estimation ; however , we do apply the findings to policy improvement experiments in the empirical investigation . Dann et al . ( 2014 ) provide a comprehensive survey of value estimation with parametric function representations . Significant attention has been focused on underparameterized representations where backed up values are not necessarily expressible in the function class , however we focus on the overparameterized case where any backed up values can be assumed to be exactly representable with respect to finite data . This change fundamentally alters the conclusions one can draw about algorithm behavior , as we see below . One of the key consequences is that classical distinctions ( Scherrer , 2010 ; Dann et al. , 2014 ) between objectives—e.g. , mean squared Bellman error ( MSBE ) , mean squared projected Bellman error ( MSPBE ) , mean squared temporal difference error ( MSTDE ) , and the norm of the expected TD update ( NEU ) —all collapse when the Bellman errors can all be driven to zero . Despite this collapse , we find that algorithms targetting the different objectives—TD and LSTD for MSPBE ( Sutton , 1988 ; Bradtke and Barto , 1996 ) and RM without double sampling ( DS ) for MSTDE ( Maei et al. , 2009 ; Dann et al. , 2014 ) —converge to different fixed points given overparameterization , even when they ultimately satisfy the same set of temporal consistency constraints . It is well known that classical value updates can diverge given off-policy data and parametric function representations ( Baird , 1995 ; Tsitsiklis and Van Roy , 1996 ; 1997 ) . The stability of these methods has therefore been studied extensively with many mitigations proposed , including restricting the function representation ( Gordon , 1995 ; Szepesvári and Smart , 2004 ) or adjusting the representation to ensure contraction ( Kolter , 2011 ; Ghosh and Bellemare , 2020 ; Wang et al. , 2021b ) , or modifying the updates to achieve convergent variations , such as LSTD ( Bradtke and Barto , 1996 ; Yu , 2010 ) , FVI ( Ernst et al. , 2005 ; Munos and Szepesvári , 2005 ; Szepesvári and Munos , 2008 ; Lizotte , 2011 ) or the introduction of target networks ( Mnih et al. , 2015 ; Lillicrap et al. , 2016 ; Zhang et al. , 2021 ; Carvalho et al. , 2020 ) . Others have considered modified the updates to combat various statistical inefficiencies ( van Hasselt , 2010 ; Weng et al. , 2020 ; Konidaris et al. , 2011 ) . Another long running trend has been to consider two time-scale algorithms and analyses , reflected in gradient-TD methods ( Sutton et al. , 2008 ; Maei et al. , 2009 ) , prox gradient TD ( Liu et al. , 2015 ; 2016 ) , primal-dual TD ( Dai et al. , 2017 ; Du et al. , 2017 ) , and emphatic TD ( Yu , 2015 ; Sutton et al. , 2016 ) . Beyond mere convergence , however , we discover a greater diversity in fixed points among algorithms in the overparameterized case , which play a critical but previously unacknowledged role in generalization quality . The fact that minimizing MSPBE via TD methods still dominates practice appears surprising given the theoretical superiority of other objectives . It has been argued , for example , that direct policy gradient methods ( Sutton et al. , 1999 ) dominate minimizing Bellman error objectives ( Geist et al. , 2017 ) . Even among Bellman based approaches , it is known that MSBE can upper bound the value estimation error ( MSE ) whereas MSPBE can not ( Kolter , 2011 ; Dann et al. , 2014 ) , yet MSPBE minimization ( via TD based methods ) empirically dominates minimizing MSBE ( via residual methods ) . This dominance has been thought to be due to the double sampling bias of residual methods ( Baird , 1995 ; Dann et al. , 2014 ) , but we uncover a more interesting finding that their fixed points lie in different bases in the overparameterized setting , and that reducing this difference closes the performance gap . We analyze the convergence of classical updates given offline data and provide associated generalization bounds , with the primary goal of understanding the discrepancy between previous theory and the empirical success of TD/FVI versus RM . Although this theory sheds new light in exploitable ways , it can not overcome theoretical limits on offline value estimation , such as lower bounds on worst case error that are exponential in horizon length ( Wang et al. , 2021a ; b ; Zanette , 2021 ; Xiao et al. , 2021 ) . We analyze the convergence of the expected updates , extendible to the stochastic case using known techniques ( Yu , 2010 ; Bhandari et al. , 2018 ; Dalal et al. , 2018 ; Prashanth et al. , 2021 ; Patil et al. , 2021 ) . We expand the coverage of these earlier works by including alternative updates and focusing on the overparameterized case , uncovering previously unobserved differences in the fixed points . There is a growing body of work on linear value estimation and planning that leverages the insight of ( Parr et al. , 2008 ; Taylor and Parr , 2009 ) that linear value estimation is equivalent to linear model approximation . A number of works have strived to obtain provably efficient algorithms for approximating the optimal policy values in this setting , but these generally rely on exploration or strong assumptions about data coverage ( Song et al. , 2016 ; Yang and Wang , 2019 ; Duan et al. , 2020 ; Agarwal et al. , 2020 ; Jin et al. , 2020 ; Yang et al. , 2020 ; Hao et al. , 2021 ) that we do not make . Instead we study linear value estimation to gain insight , but rather than focus on linear planning we leverage the findings to improve the empirical performance of value estimation with deep models . | This paper studies the convergence properties of three classical value estimation algorithms (TD, FVI and RM) under over-parameterized linear case. The difference among convergence results are interpreted unifiedly through different constraints in an optimization problem. It also proposes an generalization bound for FVI. Furthermore, based on the results mentioned before, it proposes two regularizers to help convergence in deep reinforcement learning and experimentally evaluates their performance. | SP:39cb14ce95091715f262868c8eed6b52e653cb06 |
Understanding and Leveraging Overparameterization in Recursive Value Estimation | The theory of function approximation in reinforcement learning ( RL ) typically considers low capacity representations that incur a tradeoff between approximation error , stability and generalization . Current deep architectures , however , operate in an overparameterized regime where approximation error is not necessarily a bottleneck . To better understand the utility of deep models in RL we present an analysis of recursive value estimation using overparameterized linear representations that provides useful , transferable findings . First , we show that classical updates such as temporal difference ( TD ) learning or fitted-value-iteration ( FVI ) converge to different fixed points than residual minimization ( RM ) in the overparameterized linear case . We then develop a unified interpretation of overparameterized linear value estimation as minimizing the Euclidean norm of the weights subject to alternative constraints . A practical consequence is that RM can be modified by a simple alteration of the backup targets to obtain the same fixed points as FVI and TD ( when they converge ) , while universally ensuring stability . Further , we provide an analysis of the generalization error of these methods , demonstrating per iterate bounds on the value prediction error of FVI , and fixed point bounds for TD and RM . Given this understanding , we then develop new algorithmic tools for improving recursive value estimation with deep models . In particular , we extract two regularizers that penalize out-of-span top-layer weights and co-linearity in top-layer features respectively . Empirically we find that these regularizers dramatically improve the stability of TD and FVI , while allowing RM to match and even sometimes surpass their generalization performance with assured stability . 1 INTRODUCTION . Model-free value estimation remains a core method of reinforcement learning ( RL ) , lying at the heart of some of the most prominent achievements in this area ( Mnih et al. , 2015 ; Bellemare et al. , 2020 ) . Such success appears paradoxical however , given that value estimation is subject to the deadly triad : any value update that combines off-policy estimation with Bellman-bootstrapping and function approximation diverges in the worst case ( Sutton and Barto , 2018 ) . Without additional assumptions it is impossible to ensure the viability of iterative value estimation schemes , yet this remains a dominant method in RL—its popularity supported by empirical success in many applications . Such a sizable gap between theory and practice reflects limited understanding of such methods , how they behave in practice , and what accounts for their empirical success ( van Hasselt et al. , 2018 ; Achiam et al. , 2019 ) . Decomposing the deadly triad indicates that off-policy estimation and bootstrapping are difficult to forego : off-policy estimation is supported by the empirical effectiveness of action value maximization and replay buffers , while Bellman-bootstrapping provides significant advantages over Monte Carlo estimation ( Sutton , 1988 ) . On the other hand , our understanding of the third factor , the relationship between function representation and generalization , has evolved dramatically in recent years . Although it was once thought that restrictive function approximation—representations that lack capacity to fit all data constraints—might be essential for generalization , we now know that this view is oversimplified ( Belkin et al. , 2019 ) . The empirical success of deep learning ( Krizhevsky et al. , 2012 ) , extremely large models ( Brown et al. , 2020 ) and associated theoretical advances ( Jacot et al. , 2018 ) have made it clear that gradient-based training of overparameterized models embodies implicit biases that encourage generalization even after all data constraints are fit exactly . This success suggests a new opportunity for breaking the deadly triad : by leveraging overparameterized value representations one can avoid some of the most difficult tradeoffs in value-based RL ( Lu et al. , 2018 ) . The use of overparameterized deep models in value-based RL , however , still exhibits mysteries in stability and performance . Although one might expect larger capacity models to improve the stability of Bellman-bootstrapping , in fact the opposite appears to occur ( van Hasselt et al. , 2018 ) . Our own empirical experience indicates that classical value estimation with deep models always diverges eventually in non-toy problems . It has also been shown that value updating leads to premature rankcollapse in deep models ( Kumar et al. , 2021 ) , coinciding with instability and degrading generalization . In practice , some form of early-stopping is usually necessary to obtaining successful results , a fact that is not often emphasized in the literature ( Agarwal et al. , 2021 ) . Meanwhile , there is a long history of convergent methods being proposed in the RL literature—starting from residual gradient ( Baird , 1995 ) , to gradient-TD ( Sutton et al. , 2008 ; Maei et al. , 2009 ) , prox gradient TD ( Liu et al. , 2015 ; 2016 ) , and emphatic TD ( Yu , 2015 ; Sutton et al. , 2016 ) —yet none of these has demonstrated sufficient generalization quality to supplant unstable methods . The current state of development leaves an awkward tradeoff between stability and generalization . A stable recursive value estimation method that ensures generalization quality with overparametrization remains elusive . In this paper we investigate whether overparameterized value representations might allow the stabilitygeneralization tradeoff to be better managed , enabling stable estimation methods that break the deadly triad and generalize well . To this end , we first consider policy evaluation with overparameterized linear value representations , a simplified setting that still imposes the deadly triad ( Zhang et al. , 2021 ) . Here we first show that alternative updates , such as temporal differencing ( TD ) , fitted value iteration ( FVI ) and residual minimization ( RM ) converge to different fixed points in the overparameterized case ( when they converge ) , even though these updates share a common fixed point when the approximation error is zero and there are no extra degrees of freedom ( Dann et al. , 2014 ) . That is , these algorithms embody certain implicit biases that only become distinguishable in the overparameterized case . From this result , we observe that the fixed points lie in different bases , which we use to develop a unified view of iterative value estimation as minimizing the Euclidean norm of the weights subject to alternative constraint sets . This unification allows us to formulate alternative updates that share common fixed points with TD and FVI but guarantee stability without requiring regularization or prox constraints ( Zhang et al. , 2021 ) . Next , we analyze the generalization performance of these algorithms and provide a per-iterate bound on the value estimation error of FVI , and fixed point bounds on the value estimation error of TD . From these results , we identify two novel regularizers , one that closes the gap between RM and TD and another that quantifies the effect of the feature representation on the generalization bound . We deploy these regularizers in a realistic study of deep model training for optimal value estimation and observe systematic stability and generalization improvements . We also observe that the performance gap between RM and TD/FVI can be closed and in some cases eliminated . 2 RELATED WORK . Value estimation has a lengthy history throughout RL research . Our main focus is on off-policy value estimation with parametric function representations and iterative ( i.e. , gradient based ) updates . We do not consider exploration nor full planning problems ( i.e. , approximately solving an entire Markov decision process ( MDP ) ) in the theoretical development , but instead focus on offline value estimation ; however , we do apply the findings to policy improvement experiments in the empirical investigation . Dann et al . ( 2014 ) provide a comprehensive survey of value estimation with parametric function representations . Significant attention has been focused on underparameterized representations where backed up values are not necessarily expressible in the function class , however we focus on the overparameterized case where any backed up values can be assumed to be exactly representable with respect to finite data . This change fundamentally alters the conclusions one can draw about algorithm behavior , as we see below . One of the key consequences is that classical distinctions ( Scherrer , 2010 ; Dann et al. , 2014 ) between objectives—e.g. , mean squared Bellman error ( MSBE ) , mean squared projected Bellman error ( MSPBE ) , mean squared temporal difference error ( MSTDE ) , and the norm of the expected TD update ( NEU ) —all collapse when the Bellman errors can all be driven to zero . Despite this collapse , we find that algorithms targetting the different objectives—TD and LSTD for MSPBE ( Sutton , 1988 ; Bradtke and Barto , 1996 ) and RM without double sampling ( DS ) for MSTDE ( Maei et al. , 2009 ; Dann et al. , 2014 ) —converge to different fixed points given overparameterization , even when they ultimately satisfy the same set of temporal consistency constraints . It is well known that classical value updates can diverge given off-policy data and parametric function representations ( Baird , 1995 ; Tsitsiklis and Van Roy , 1996 ; 1997 ) . The stability of these methods has therefore been studied extensively with many mitigations proposed , including restricting the function representation ( Gordon , 1995 ; Szepesvári and Smart , 2004 ) or adjusting the representation to ensure contraction ( Kolter , 2011 ; Ghosh and Bellemare , 2020 ; Wang et al. , 2021b ) , or modifying the updates to achieve convergent variations , such as LSTD ( Bradtke and Barto , 1996 ; Yu , 2010 ) , FVI ( Ernst et al. , 2005 ; Munos and Szepesvári , 2005 ; Szepesvári and Munos , 2008 ; Lizotte , 2011 ) or the introduction of target networks ( Mnih et al. , 2015 ; Lillicrap et al. , 2016 ; Zhang et al. , 2021 ; Carvalho et al. , 2020 ) . Others have considered modified the updates to combat various statistical inefficiencies ( van Hasselt , 2010 ; Weng et al. , 2020 ; Konidaris et al. , 2011 ) . Another long running trend has been to consider two time-scale algorithms and analyses , reflected in gradient-TD methods ( Sutton et al. , 2008 ; Maei et al. , 2009 ) , prox gradient TD ( Liu et al. , 2015 ; 2016 ) , primal-dual TD ( Dai et al. , 2017 ; Du et al. , 2017 ) , and emphatic TD ( Yu , 2015 ; Sutton et al. , 2016 ) . Beyond mere convergence , however , we discover a greater diversity in fixed points among algorithms in the overparameterized case , which play a critical but previously unacknowledged role in generalization quality . The fact that minimizing MSPBE via TD methods still dominates practice appears surprising given the theoretical superiority of other objectives . It has been argued , for example , that direct policy gradient methods ( Sutton et al. , 1999 ) dominate minimizing Bellman error objectives ( Geist et al. , 2017 ) . Even among Bellman based approaches , it is known that MSBE can upper bound the value estimation error ( MSE ) whereas MSPBE can not ( Kolter , 2011 ; Dann et al. , 2014 ) , yet MSPBE minimization ( via TD based methods ) empirically dominates minimizing MSBE ( via residual methods ) . This dominance has been thought to be due to the double sampling bias of residual methods ( Baird , 1995 ; Dann et al. , 2014 ) , but we uncover a more interesting finding that their fixed points lie in different bases in the overparameterized setting , and that reducing this difference closes the performance gap . We analyze the convergence of classical updates given offline data and provide associated generalization bounds , with the primary goal of understanding the discrepancy between previous theory and the empirical success of TD/FVI versus RM . Although this theory sheds new light in exploitable ways , it can not overcome theoretical limits on offline value estimation , such as lower bounds on worst case error that are exponential in horizon length ( Wang et al. , 2021a ; b ; Zanette , 2021 ; Xiao et al. , 2021 ) . We analyze the convergence of the expected updates , extendible to the stochastic case using known techniques ( Yu , 2010 ; Bhandari et al. , 2018 ; Dalal et al. , 2018 ; Prashanth et al. , 2021 ; Patil et al. , 2021 ) . We expand the coverage of these earlier works by including alternative updates and focusing on the overparameterized case , uncovering previously unobserved differences in the fixed points . There is a growing body of work on linear value estimation and planning that leverages the insight of ( Parr et al. , 2008 ; Taylor and Parr , 2009 ) that linear value estimation is equivalent to linear model approximation . A number of works have strived to obtain provably efficient algorithms for approximating the optimal policy values in this setting , but these generally rely on exploration or strong assumptions about data coverage ( Song et al. , 2016 ; Yang and Wang , 2019 ; Duan et al. , 2020 ; Agarwal et al. , 2020 ; Jin et al. , 2020 ; Yang et al. , 2020 ; Hao et al. , 2021 ) that we do not make . Instead we study linear value estimation to gain insight , but rather than focus on linear planning we leverage the findings to improve the empirical performance of value estimation with deep models . | In this paper, the authors consider the overparameterized linear representations of TD, FVI, and RM. A unified interpretation of these algorithms of minimizing the Euclidean norm of the weights subject to alternative constraints is proposed. The paper is also supported by the empirical results. | SP:39cb14ce95091715f262868c8eed6b52e653cb06 |
R5: Rule Discovery with Reinforced and Recurrent Relational Reasoning | 1 INTRODUCTION . While deep learning has achieved great success in various applications , it was pointed out that there is a debate over the problem of systematicity in connectionist models ( Fodor & Pylyshyn , 1988 ; Fodor & McLaughlin , 1990 ; Hadley , 1994 ; Jansen & Watter , 2012 ; Dong et al. , 2018 ) . To concretely explain systematicity ( Hupkes et al. , 2020 ) , let us consider the kinship problem shown in Figure 1 . By training on the small-scale observed examples of family relationships where the rule paths are short ( in Figure 1a & b , both of the rule paths have the length of 2 ) , our objective is to extract the underlying rules as general principles and generalize to large-scale tasks where the rule paths are long ( in Figure 1c , the rule path has the length of 3 ) . The rules in the training examples are a ) Mother ( X , Y ) ←− Mother ( X , Z ) , Sister ( Z , Y ) , b ) Grandma ( X , Y ) ←− Mother ( X , Z ) , Father ( Z , Y ) . And the necessary rule in order to conclude the relation between Mary and Ann is c ) Grandma ( X , Y ) ←− Mother ( X , U ) , Sister ( U , Z ) , Father ( Z , Y ) , which does not explicitly show up in the training examples . Successfully giving prediction in c ) shows the ability of systematicity , i.e. , model ’ s ability to recombine known parts and rules to form new sequences . Some attempts on the graph relational data grounded in Graph Neural Networks ( Schlichtkrull et al. , 2018 ; Sinha et al. , 2020 ; Pan et al. , 2020 ) rely on learning embedding vectors of entities and relations , and have shown some capability of systematicity , However , since the rules are implicitly encapsulated in the neural networks , these models are lack of interpretability . Inductive Logic Programming ( ILP ) ( Muggleton , 1992 ; Muggleton et al. , 1996 ; Getoor , 2000 ; Yang et al. , 2017 ; Evans & Grefenstette , 2018 ) is a subfield of symbolic rule learning , which naturally learns symbolic rules and provides interpretable explanations for labels prediction as well as being able to generalize to other tasks . A traditional ILP system learns a set of rules from a collection of positive and negative examples , which entails all the positives and none of the negatives . However , these methods face the challenge that the search space of the compositional rules is exponentially large , making it hard to scale beyond small rule sets . Extending the idea of ILP , Neural-Symbolic Learning ( Garcez et al. , 2015 ; Besold et al. , 2017 ) seeks to integrate principles from neural networks learning and logical reasoning , among which Neural Logic Machines ( Dong et al. , 2018 ; Zimmer et al. , 2021 ) and Theorem Provers ( Rocktäschel & Riedel , 2017 ; Minervini et al. , 2020a ; b ) aim to overcome the problems of systematicity . On one hand , the Neural Logic Machines approximate the logic predicates using a probabilistic tensor representation , and the conclusion tensors are generated by applying the neural operators over the premise tensors . These approaches have done a great job in reasoning the decision-making tasks including sorting tasks , finding the shortest paths , and so on . However , in terms of the relational reasoning tasks on graphs , Neural Logic Machines reason only the single relation prediction tasks , i.e . determining whether a single relation exists between all the queried entities or entity pairs . On the other hand , Theorem Provers jointly learn representations and rules from data via backpropagation , given a pre-defined task-specific rule template and a set of possible rules following the template . Theorem Provers are able to solve and reason the relation prediction tasks instead of only determining the existence of a single relation . However , the performance is not satisfying . In this paper , we focus on model ’ s systematicity for relational reasoning over graph relational prediction tasks and present a new reasoning framework named R5 , i.e. , Rule discovery with Reinforced and Recurrent Relational Reasoning , for rule induction and reasoning on relational data with strong systematicity . R5 formulates the problem of relational reasoning from the perspective of sequential decision-making , and performs rule extraction and logical reasoning with deep reinforcement learning equipped with a dynamic rule memory . More concretely , R5 learns the short definite clauses that are in the form u ←− pi ∧ pj . Since long Horn clauses ( Horn , 1951 ) can be decomposed into short Horn clauses , a long definite clause outcome ←− p0 ∧ p1 ... pi ∧ pj ... pk used in prediction tasks is represented with a sequence of short definite clauses while performing decision-making , i.e . pi ∧ pj is replaced by u . Specifically , we make the following contributions : First , R5 performs explicit reasoning for relation prediction via composition and achieves explainability . Instead of learning embeddings for entities and relations , ( Hamilton et al. , 2017 ; Schlichtkrull et al. , 2018 ; Wang et al. , 2019 ; Pan et al. , 2020 ) and performing implicit reasoning , we perform explicit relational reasoning by modeling it as sequential decision-making . Specifically , given a query ( usually consists of two queried entities ) and the related relationship graph , the agent recurrently selects a relation pair ri , rj from the input graph to combine into a compound relation rk and updates the graph , until the target relation for the query is reached . Trained by reinforcement learning , the agent learns to take actions , i.e. , which pair of relations to combine , given the state representations of all possible pairs of relations . Second , we propose a dynamic rule memory module to maintain and score candidate rules during the training of the reasoning agent . Each item in the rule memory is a candidate rule in the format of rk ←− ri , rj . ri , rj serve as the key , and rk serves as the value . In each step of decisionmaking , the agent queries the rule memory to re-use already stored rules for reasoning , i.e. , deducing compound relations , or insert new candidate rules into it if no existing rule matches the agent ’ s action . Each rule is associated with a score that indicates the confidence for the rule . The rules and their scores in the memory are dynamically updated during training . Finally , a set of candidate rules with scores above a threshold are kept . By recurrently applying the learned rules , R5 demonstrates strong compositional generalization ability ( i.e . systematicity ) in relational reasoning tasks . Third , rather than only taking the observed relations into account , we introduce extra hidden ( or invented ) relations into the reasoning process . For example , R5 may learn to combine r1 and r2 by a rule r ← r1 , r2 , where r is an intentionally introduced unknown relation . The invented relations can appear on both the left or right side of a rule clause . Such a design enables our model to learn intermediate relations that do not explicitly appear in the training data to model underlying complex relations between entities , which are sometimes necessary to discover complex rules in the relational data . Furthermore , we design a backtrack rewriting mechanism that replaces an invented relation with an observed one when R5 finds they are actually equivalent . Our goal is to explain the observed data with rules that are as simple as possible . Backtrack rewriting merges redundant relations and rules to enforce the principle of Occam ’ s razor , which prevents overfitting and improves the robustness of our approach . We perform extensive evaluations based on two public relation prediction datasets , CLUTRR ( Sinha et al. , 2019 ) and GraphLog ( Sinha et al. , 2020 ) , and compare R5 with a variety of baseline methods . The experimental results demonstrate that our approach significantly outperforms state-of-the-art methods in terms of relation prediction accuracy and recall rate in rule discovery . Moreover , R5 exhibits a strong ability of compositional generalization and robustness to data noise . 2 PROPOSED APPROACH Table 1 : Notations M The set of known relations types N The set of invented relations types r a relation type qj a query L number of paths to sample for each query Lj actual number of paths for qj ai The ith action in in the sequence aB , i The ith relation in a ’ s body aH a ’ s head si The ith current state in in the sequence zi The ith reward in in the sequence Drl Dictionary of rules Drls Dictionary of rules scores c an entry in Drls Bunkn Buffer of unused invented relation types vi a score value In this section , we introduce our Rule Discovery with Reinforced and Recurrent Relational Reasoning framework , namely R5 , to solve the inductive relation prediction problem . We first formally define the relation prediction problem discussed in this paper . Let pdata ( G , q , a ) be a training data distribution , where G is the set of training graphs , q = ( X , Y ) is a query , and a = r is the answer . The graphs consist of nodes in a set N , which are connected by relations in a set R. X , Y ∈ N are nodes , and r ∈ R is a relation . Given G and the query q , the goal is to predict the correct answer a. Relational prediction task is actually program induction , which is a hard problem that has been studied for many years in the area of Inductive Logic Programming and Statistical Relational Learning , especially for large-scale tasks in noisy domains . Figure 2 shows an overview of R5 . Our framework takes a relational graph as input , and outputs the relationship between two queried entities based on extracted rules . R5 first transforms a relation graph into a set of paths connecting the queried node ( entity ) pair . After that , it recurrently applies learned rules to merge a relation pair in the paths to form a compound relation , until it outputs a final relation between the two queried nodes . The reasoning agent is trained with deep reinforcement learning and MCTS , while a dynamic rule memory module is utilized to extract rules from observations during training . The notations we used in this paper are summarized in Table 1 . Note that an action a : = aH ← ( aB,0 , aB,1 ) and a rule rl : = rlH ← ( rlB,0 , rlB,1 ) share the same structure , where different a and rl are all relations . aH and aB represent the head and body in a rule , respectively . Next we introduce R5 in detail . 2.1 RECURRENT RELATIONAL REASONING . Path sampling . To predict the relation between two entities in graphs , we preprocess the data by sampling paths that connect the two entities from the graph . When the total number of paths is small , we enumerate all the paths . Otherwise , we randomly sample L paths at maximum . Each path purely consists of relations . For instance , in Figure 2 , given the input graph , we can get 4 paths between query nodes X and Y , including r1-r2-r5-r3-r7-r6 and so on . Reasoning as sequential decision-making . Our method solves the problem of relational reasoning in terms of sequential decision-making . Specifically , we train a reasoning agent based on a policy value network combined with MCTS ( Silver et al. , 2017a ) to recurrently reason over the extracted relation paths . The policy value network fθ ( s ) is a neural network with parameters θ . It takes the current state s as input , and outputs the action probability distribution ρ and a state value ν. MCTS utilizes the policy network fθ ( s ) to guide its simulations , and outputs a vector π representing the improved search probabilities of the available actions . The policy network ( ρ , ν ) = fθ ( s ) is then trained to minimize the error between the predicted state value ν and the reward z received after an episode , as well as maximize the similarity between two probability distributions ρ and π . The loss function l is l = ( z − ν ) 2 − π⊺ logρ+ a ∥θ∥2 , where a is a hyper-parameter . Action . At each step of an episode , the MCTS outputs an action ( aB,0 , aB,1 ) , which is a relation pair denoted as aB . Furthermore , by looking up the dynamic rule memory , it obtains a : aH ← ( aB,0 , aB,1 ) that contains a head relation aH to be deducted to , which means that the relation pair ( aB,0 , aB,1 ) in the path will be substitute with aH . For example , in Figure 2 at step 1 , MCTS outputs an action a : r3 ← ( r1 , r2 ) , and the path r1-r2-r5-r3-r7-r6 is transformed into r3-r5-r3-r7-r6 . By recurrently applying different actions to a path between the query nodes , it will be transformed into a single relation at the end of an episode . State . Instead of encoding the walking paths between the query nodes as other RL-based rule induction methods ( Shen et al. , 2018 ; Das et al. , 2017 ; Xiong et al. , 2017 ) , we make use of the features of the possible relations pairs at the current state . As shown in Figure 2 , we define the state s ∈ R ( m+n ) × ( m+n ) ×k as the representation of all the possible relations pairs among the current paths , where m is the number of observed relations , n is the number of invented relations we assumed , and k is the dimension of features of each relation pair . As previously discussed , a relation pair may be deducted to an invented relation r∗ ∈ N . Besides , r∗ can be paired with another relation r , and maybe further deducted to another invented relation r′∗ ∈ N . Our state space design enables us to represent such complicated rules with the invented relations that serve as intermediate predicates , which is essential to model complex relational data . n invented relations are allowed in our design , where n depends on the complexity of input . An example is presented in Appendix A.4 . Even if sometimes the input data can be explained by rules without invented relation , the invented relations in our state design can actually help to speed up model training . For example , when we observe that a relation pair r1 and r2 shows up frequently in the training data , we can sample an invented relation r∗ as the head , and form a candidate rule r∗ ← ( r1 , r2 ) . In this way , our model learns to merge r1 and r2 quickly without the need to figure out what exactly r∗ is . The value of r∗ will be inferred by our model with Backtrack Rewriting mechanism , which we will introduce in more detail later . Without these invented relations , a reasoning agent has to infer what exactly r∗ is at an early state , otherwise it can not proceed to merge the relation pairs in a path correctly . Thus , the invented relations actually serve as a buffering mechanism to allow an agent to learn “ what to merge ” first , rather than inferring the exact rule at an early stage . The features we utilized to represent each relation pair can be summarized into two groups . The first group includes the general and statistical features of the pair , such as the number of occurrences , the index of the most viewed position among the paths , the number of occurrences at the most viewed position , and the types of the two relations consist the pair . The other group includes the rulesrelated features , such as whether the relation pair is in the obtained rules , whether the relation pair consists of two known relations , whether the rule head is a known relation if the pair is in the rules memory , and the score of the corresponding rule if the pair is in the rules memory . Reward . During an episode , actions are applied to a relation path recurrently , until the path is deducted to a single relation r , and a reward zT ∈ { −1 , 0 , +1 } will be assigned to all the states in this episode . If r is an known relation , but is not the target relation , zT = −1 . If r is an invented relation , zT = 0 . If r is the target relation , zT = 1 . | This paper presents a novel method for rule induction. The main idea is to apply reinforcement learning in the task of relational pathfinding within a finite Herbrand base. The reinforcement learner uses MCTS to find the best routes to establish the path in between the two arguments of training examples, while the useful actions (which are length-two relational paths) are maintained in a hash table as the induced ruleset. Experimental results has shown the effectiveness of the proposed method. | SP:81b19cb59aad98ed3845ab403a9468d9f7bb1445 |
R5: Rule Discovery with Reinforced and Recurrent Relational Reasoning | 1 INTRODUCTION . While deep learning has achieved great success in various applications , it was pointed out that there is a debate over the problem of systematicity in connectionist models ( Fodor & Pylyshyn , 1988 ; Fodor & McLaughlin , 1990 ; Hadley , 1994 ; Jansen & Watter , 2012 ; Dong et al. , 2018 ) . To concretely explain systematicity ( Hupkes et al. , 2020 ) , let us consider the kinship problem shown in Figure 1 . By training on the small-scale observed examples of family relationships where the rule paths are short ( in Figure 1a & b , both of the rule paths have the length of 2 ) , our objective is to extract the underlying rules as general principles and generalize to large-scale tasks where the rule paths are long ( in Figure 1c , the rule path has the length of 3 ) . The rules in the training examples are a ) Mother ( X , Y ) ←− Mother ( X , Z ) , Sister ( Z , Y ) , b ) Grandma ( X , Y ) ←− Mother ( X , Z ) , Father ( Z , Y ) . And the necessary rule in order to conclude the relation between Mary and Ann is c ) Grandma ( X , Y ) ←− Mother ( X , U ) , Sister ( U , Z ) , Father ( Z , Y ) , which does not explicitly show up in the training examples . Successfully giving prediction in c ) shows the ability of systematicity , i.e. , model ’ s ability to recombine known parts and rules to form new sequences . Some attempts on the graph relational data grounded in Graph Neural Networks ( Schlichtkrull et al. , 2018 ; Sinha et al. , 2020 ; Pan et al. , 2020 ) rely on learning embedding vectors of entities and relations , and have shown some capability of systematicity , However , since the rules are implicitly encapsulated in the neural networks , these models are lack of interpretability . Inductive Logic Programming ( ILP ) ( Muggleton , 1992 ; Muggleton et al. , 1996 ; Getoor , 2000 ; Yang et al. , 2017 ; Evans & Grefenstette , 2018 ) is a subfield of symbolic rule learning , which naturally learns symbolic rules and provides interpretable explanations for labels prediction as well as being able to generalize to other tasks . A traditional ILP system learns a set of rules from a collection of positive and negative examples , which entails all the positives and none of the negatives . However , these methods face the challenge that the search space of the compositional rules is exponentially large , making it hard to scale beyond small rule sets . Extending the idea of ILP , Neural-Symbolic Learning ( Garcez et al. , 2015 ; Besold et al. , 2017 ) seeks to integrate principles from neural networks learning and logical reasoning , among which Neural Logic Machines ( Dong et al. , 2018 ; Zimmer et al. , 2021 ) and Theorem Provers ( Rocktäschel & Riedel , 2017 ; Minervini et al. , 2020a ; b ) aim to overcome the problems of systematicity . On one hand , the Neural Logic Machines approximate the logic predicates using a probabilistic tensor representation , and the conclusion tensors are generated by applying the neural operators over the premise tensors . These approaches have done a great job in reasoning the decision-making tasks including sorting tasks , finding the shortest paths , and so on . However , in terms of the relational reasoning tasks on graphs , Neural Logic Machines reason only the single relation prediction tasks , i.e . determining whether a single relation exists between all the queried entities or entity pairs . On the other hand , Theorem Provers jointly learn representations and rules from data via backpropagation , given a pre-defined task-specific rule template and a set of possible rules following the template . Theorem Provers are able to solve and reason the relation prediction tasks instead of only determining the existence of a single relation . However , the performance is not satisfying . In this paper , we focus on model ’ s systematicity for relational reasoning over graph relational prediction tasks and present a new reasoning framework named R5 , i.e. , Rule discovery with Reinforced and Recurrent Relational Reasoning , for rule induction and reasoning on relational data with strong systematicity . R5 formulates the problem of relational reasoning from the perspective of sequential decision-making , and performs rule extraction and logical reasoning with deep reinforcement learning equipped with a dynamic rule memory . More concretely , R5 learns the short definite clauses that are in the form u ←− pi ∧ pj . Since long Horn clauses ( Horn , 1951 ) can be decomposed into short Horn clauses , a long definite clause outcome ←− p0 ∧ p1 ... pi ∧ pj ... pk used in prediction tasks is represented with a sequence of short definite clauses while performing decision-making , i.e . pi ∧ pj is replaced by u . Specifically , we make the following contributions : First , R5 performs explicit reasoning for relation prediction via composition and achieves explainability . Instead of learning embeddings for entities and relations , ( Hamilton et al. , 2017 ; Schlichtkrull et al. , 2018 ; Wang et al. , 2019 ; Pan et al. , 2020 ) and performing implicit reasoning , we perform explicit relational reasoning by modeling it as sequential decision-making . Specifically , given a query ( usually consists of two queried entities ) and the related relationship graph , the agent recurrently selects a relation pair ri , rj from the input graph to combine into a compound relation rk and updates the graph , until the target relation for the query is reached . Trained by reinforcement learning , the agent learns to take actions , i.e. , which pair of relations to combine , given the state representations of all possible pairs of relations . Second , we propose a dynamic rule memory module to maintain and score candidate rules during the training of the reasoning agent . Each item in the rule memory is a candidate rule in the format of rk ←− ri , rj . ri , rj serve as the key , and rk serves as the value . In each step of decisionmaking , the agent queries the rule memory to re-use already stored rules for reasoning , i.e. , deducing compound relations , or insert new candidate rules into it if no existing rule matches the agent ’ s action . Each rule is associated with a score that indicates the confidence for the rule . The rules and their scores in the memory are dynamically updated during training . Finally , a set of candidate rules with scores above a threshold are kept . By recurrently applying the learned rules , R5 demonstrates strong compositional generalization ability ( i.e . systematicity ) in relational reasoning tasks . Third , rather than only taking the observed relations into account , we introduce extra hidden ( or invented ) relations into the reasoning process . For example , R5 may learn to combine r1 and r2 by a rule r ← r1 , r2 , where r is an intentionally introduced unknown relation . The invented relations can appear on both the left or right side of a rule clause . Such a design enables our model to learn intermediate relations that do not explicitly appear in the training data to model underlying complex relations between entities , which are sometimes necessary to discover complex rules in the relational data . Furthermore , we design a backtrack rewriting mechanism that replaces an invented relation with an observed one when R5 finds they are actually equivalent . Our goal is to explain the observed data with rules that are as simple as possible . Backtrack rewriting merges redundant relations and rules to enforce the principle of Occam ’ s razor , which prevents overfitting and improves the robustness of our approach . We perform extensive evaluations based on two public relation prediction datasets , CLUTRR ( Sinha et al. , 2019 ) and GraphLog ( Sinha et al. , 2020 ) , and compare R5 with a variety of baseline methods . The experimental results demonstrate that our approach significantly outperforms state-of-the-art methods in terms of relation prediction accuracy and recall rate in rule discovery . Moreover , R5 exhibits a strong ability of compositional generalization and robustness to data noise . 2 PROPOSED APPROACH Table 1 : Notations M The set of known relations types N The set of invented relations types r a relation type qj a query L number of paths to sample for each query Lj actual number of paths for qj ai The ith action in in the sequence aB , i The ith relation in a ’ s body aH a ’ s head si The ith current state in in the sequence zi The ith reward in in the sequence Drl Dictionary of rules Drls Dictionary of rules scores c an entry in Drls Bunkn Buffer of unused invented relation types vi a score value In this section , we introduce our Rule Discovery with Reinforced and Recurrent Relational Reasoning framework , namely R5 , to solve the inductive relation prediction problem . We first formally define the relation prediction problem discussed in this paper . Let pdata ( G , q , a ) be a training data distribution , where G is the set of training graphs , q = ( X , Y ) is a query , and a = r is the answer . The graphs consist of nodes in a set N , which are connected by relations in a set R. X , Y ∈ N are nodes , and r ∈ R is a relation . Given G and the query q , the goal is to predict the correct answer a. Relational prediction task is actually program induction , which is a hard problem that has been studied for many years in the area of Inductive Logic Programming and Statistical Relational Learning , especially for large-scale tasks in noisy domains . Figure 2 shows an overview of R5 . Our framework takes a relational graph as input , and outputs the relationship between two queried entities based on extracted rules . R5 first transforms a relation graph into a set of paths connecting the queried node ( entity ) pair . After that , it recurrently applies learned rules to merge a relation pair in the paths to form a compound relation , until it outputs a final relation between the two queried nodes . The reasoning agent is trained with deep reinforcement learning and MCTS , while a dynamic rule memory module is utilized to extract rules from observations during training . The notations we used in this paper are summarized in Table 1 . Note that an action a : = aH ← ( aB,0 , aB,1 ) and a rule rl : = rlH ← ( rlB,0 , rlB,1 ) share the same structure , where different a and rl are all relations . aH and aB represent the head and body in a rule , respectively . Next we introduce R5 in detail . 2.1 RECURRENT RELATIONAL REASONING . Path sampling . To predict the relation between two entities in graphs , we preprocess the data by sampling paths that connect the two entities from the graph . When the total number of paths is small , we enumerate all the paths . Otherwise , we randomly sample L paths at maximum . Each path purely consists of relations . For instance , in Figure 2 , given the input graph , we can get 4 paths between query nodes X and Y , including r1-r2-r5-r3-r7-r6 and so on . Reasoning as sequential decision-making . Our method solves the problem of relational reasoning in terms of sequential decision-making . Specifically , we train a reasoning agent based on a policy value network combined with MCTS ( Silver et al. , 2017a ) to recurrently reason over the extracted relation paths . The policy value network fθ ( s ) is a neural network with parameters θ . It takes the current state s as input , and outputs the action probability distribution ρ and a state value ν. MCTS utilizes the policy network fθ ( s ) to guide its simulations , and outputs a vector π representing the improved search probabilities of the available actions . The policy network ( ρ , ν ) = fθ ( s ) is then trained to minimize the error between the predicted state value ν and the reward z received after an episode , as well as maximize the similarity between two probability distributions ρ and π . The loss function l is l = ( z − ν ) 2 − π⊺ logρ+ a ∥θ∥2 , where a is a hyper-parameter . Action . At each step of an episode , the MCTS outputs an action ( aB,0 , aB,1 ) , which is a relation pair denoted as aB . Furthermore , by looking up the dynamic rule memory , it obtains a : aH ← ( aB,0 , aB,1 ) that contains a head relation aH to be deducted to , which means that the relation pair ( aB,0 , aB,1 ) in the path will be substitute with aH . For example , in Figure 2 at step 1 , MCTS outputs an action a : r3 ← ( r1 , r2 ) , and the path r1-r2-r5-r3-r7-r6 is transformed into r3-r5-r3-r7-r6 . By recurrently applying different actions to a path between the query nodes , it will be transformed into a single relation at the end of an episode . State . Instead of encoding the walking paths between the query nodes as other RL-based rule induction methods ( Shen et al. , 2018 ; Das et al. , 2017 ; Xiong et al. , 2017 ) , we make use of the features of the possible relations pairs at the current state . As shown in Figure 2 , we define the state s ∈ R ( m+n ) × ( m+n ) ×k as the representation of all the possible relations pairs among the current paths , where m is the number of observed relations , n is the number of invented relations we assumed , and k is the dimension of features of each relation pair . As previously discussed , a relation pair may be deducted to an invented relation r∗ ∈ N . Besides , r∗ can be paired with another relation r , and maybe further deducted to another invented relation r′∗ ∈ N . Our state space design enables us to represent such complicated rules with the invented relations that serve as intermediate predicates , which is essential to model complex relational data . n invented relations are allowed in our design , where n depends on the complexity of input . An example is presented in Appendix A.4 . Even if sometimes the input data can be explained by rules without invented relation , the invented relations in our state design can actually help to speed up model training . For example , when we observe that a relation pair r1 and r2 shows up frequently in the training data , we can sample an invented relation r∗ as the head , and form a candidate rule r∗ ← ( r1 , r2 ) . In this way , our model learns to merge r1 and r2 quickly without the need to figure out what exactly r∗ is . The value of r∗ will be inferred by our model with Backtrack Rewriting mechanism , which we will introduce in more detail later . Without these invented relations , a reasoning agent has to infer what exactly r∗ is at an early state , otherwise it can not proceed to merge the relation pairs in a path correctly . Thus , the invented relations actually serve as a buffering mechanism to allow an agent to learn “ what to merge ” first , rather than inferring the exact rule at an early stage . The features we utilized to represent each relation pair can be summarized into two groups . The first group includes the general and statistical features of the pair , such as the number of occurrences , the index of the most viewed position among the paths , the number of occurrences at the most viewed position , and the types of the two relations consist the pair . The other group includes the rulesrelated features , such as whether the relation pair is in the obtained rules , whether the relation pair consists of two known relations , whether the rule head is a known relation if the pair is in the rules memory , and the score of the corresponding rule if the pair is in the rules memory . Reward . During an episode , actions are applied to a relation path recurrently , until the path is deducted to a single relation r , and a reward zT ∈ { −1 , 0 , +1 } will be assigned to all the states in this episode . If r is an known relation , but is not the target relation , zT = −1 . If r is an invented relation , zT = 0 . If r is the target relation , zT = 1 . | This work explores a rule learning approach (R5) for 2 relation prediction tasks (CLUTRR and GraphLog). The proposed approach starts by finding connecting paths between the two query entities. Then it recursively merge relation pairs until it consists of a single relation output. The merging process is controlled by a policy/value network trained with episodic rewards. The rules are induced whenever the output relation matches the gold relation -- in a fashion similar to that of curriculum learning. Experiments show that R5 generalizes better than previous approaches such as Graph Attention Networks (GAN) and Conditional Theorem Provers (CTPs) especially when generalizing to paths longer than those from the training set. | SP:81b19cb59aad98ed3845ab403a9468d9f7bb1445 |
Image Functions In Neural Networks: A Perspective On Generalization | In this work , we show that training with SGD on ReLU neural networks gives rise to a natural set of functions for each image that are not perfectly correlated until later in training . Furthermore , we show experimentally that the intersection of paths for different images also changes during the course of training . We hypothesize that this lack of correlation and changing intersection may be a factor in explaining generalization , because it encourages the model to use different features at different times , and pass the same image through different functions during training . This may improve generalization in two ways . 1 ) By encouraging the model to learn the same image in different ways , and learn different commonalities between images , comparable to model ensembling . 2 ) By improving algorithmic stability , as for a particular feature , the model is not always reliant on the same set of images , so the removal of an image may not adversely affect the loss . 1 INTRODUCTION . Determining why neural networks generalize remains an interesting open problem . Training often succeeds even without the use of explicit regularizers like Dropout Srivastava et al . ( 2014 ) , and even when the model is trained all the way to 100 % training accuracy , or in the presence of over-parametrization Zhang et al . ( 2021 ) . Existing bounds using capacity control Neyshabur et al . ( 2019 ) , e.g . Rademacher complexity or VC dimension are difficult to analyze when there is zero label noise and zero empirical risk Belkin et al . ( 2018 ) . Several interesting approaches have been explored to explain the generalization phenomenon . These include approaches based on applying algorithmic stability Bousquet & Elisseeff ( 2000 ) to SGD Hardt et al . ( 2016 ) Kuzborskij & Lampert ( 2018 ) , PAC Bayes based bounds Dziugaite & Roy ( 2017 ) approaches exploring properties of neural network functions like elasticity He & Su ( 2019 ) . It has also been hypothesized that neural networks have a spectral bias towards low frequency functions Rahaman et al . ( 2019 ) . While discovering neural networks generalize on small datasets , Olson et al . ( 2018 ) introduced an algorithm to decompose a neural network into a set of uncorrelated trees , possibly explaining their ability to perform variance reduction . For many machine learning models , boosting Schapire ( 2003 ) and bagging Breiman ( 1996 ) are employed to improve generalization performance by either averaging over different trained models , or resampling the dataset so it contains different distributions of data points . The underlying intuition is that different models are unlikely to make the same mistake . One can also train models on different subsets of features and take an average to reduce variance . Additionally , one promising line of investigation surrounding neural network generalization is that of algorithmic stability , as analyzed by Bousquet & Elisseeff ( 2000 ) and Hardt et al . ( 2016 ) for the case of SGD . In this work , we consider ReLU networks trained using SGD on image data . We show that training with SGD on ReLU neural networks gives rise to a natural set of functions for each image that are not perfectly correlated until later in training . Furthermore , we show experimentally that the intersection of paths for different images also changes during the course of training . We hypothesize that this lack of correlation and changing intersection may be a factor in explaining generalization , because it encourages the model to use different features at different times , and pass the same image through different functions during training . This may improve generalization in two ways . 1 ) By encouraging the model to learn the same image in different ways , and learn different commonalities between images , comparable to model ensembling . In particular , at time t , an image has access to a subset of features from image functions f tj , and this subset changes over time . Hence , f ti may not be too correlated with the end-to-end function f k j , k t on the training set , allowing for generalization . 2 ) By improving algorithmic stability , as for a particular feature , the model is not always reliant on the same set of images , so the removal of an image may not adversely affect the loss . 2 PRIOR WORK . Keskar et al . ( 2019 ) investigate the effect of sharpness and flatness of minima on generalization , and find that flat minima generalize better . Dinh et al . ( 2017 ) find that if the network is re-parametrized , sharp minima can also generalize well . Smith & Le ( 2018 ) give a bayesian perspective on generalization and SGD . Dziugaite & Roy ( 2017 ) reveal a way to compute non-vacuous generalization bounds using PAC-Bayes He & Su ( 2019 ) study the local elasticity of neural networks , where the prediction at x is not significantly perturbed if a gradient update is performed on another dissimilar point x0 . Deng et al . ( 2021 ) use local elasticity to compute a generalization bound.Poggio et al . ( 2020a ) show that neural networks can avoid the curse of dimensionality . Poggio et al . ( 2020b ) show that neural networks have complexity control by analyzing the normalized gradient . Veit et al . ( 2016 ) find that ResNets behave like ensembles of shallow networks by examining the paths the data travels through . Algorithmic stability Bousquet & Elisseeff ( 2000 ) use McDiarmid ’ s method to show that algorithmic stability implies good generalization error . Hardt et al . ( 2016 ) analyze the algorithmic stability of SGD . Studies on the gradient Sankararaman et al . ( 2020 ) study the impact of gradient confusion on the speed of neural network optimization concluding that SGD is fast when gradient confusion is low . Yin et al . ( 2018 ) Jain et al . ( 2018 ) study the effect of gradient diversity on the speed of optimization and show that greater gradient diversity leads to large mini-batches more effectively speeding up SGD . Fort et al . ( 2019 ) investigate the stiffness of neural networks and measure the cosine similarity between gradients as an approximation of how much one data point reduces loss on another . Chatterjee ( 2019 ) connects gradient averaging to algorithmic stability and generalization . Jacot et al . ( 2018 ) study generalization in the case that the network width reaches infinity , in which case dynamics are governed by the Neural Tangent Kernel . Arora et al . ( 2019 ) find that in practice , finite width CNTKs generalize better than infinite width models , indicating there may be some advantage to finite width . Novak et al . ( 2018 ) empirically study sensitivity measures such as the input output jacobian , and find that this correlates with generalization . Arpit et al . ( 2017 ) study memorization in neural networks . One quantity they consider is the gradient of the loss with respect to a particular input sample . Variance reduction A key idea in traditional machine learning is that of variance reduction . Boosting and bagging are employed as techniques to reduce variance by averaging over different ( uncorrelated ) models . SGD as noisy GD Mandt et al . ( 2016 ) show that SGD can be interpreted as an OrnsteinUhlenbeck process . Another line of work has investigated the anisotropic noise of SGD as compared to GD . Since the SGD update samples a minibatch to calculate the gradient instead of using the whole training set , they view the SGD update as a noisy version of the GD update . Zhu et al . ( 2019 ) explore the effectiveness of the anisotropic noise in SGD at escaping bad minima of the loss function . Assessing Layerwise Convergence Raghu et al . ( 2017 ) Morcos et al . ( 2018 ) use canonical correlation analysis to reveal insights into the convergence across different neural networks . They consider each neuron to be a vector , with each entry corresponding to the neuron value on a training data point , and each layer to be a subspace spanned by its neurons ’ vectors . Assessing Activation Patterns Hanin & Rolnick ( 2019 ) investigated activation patterns in ReLU networks and found that they use surprisingly few such patterns . Cogswell et al . ( 2016 ) improved generalization of neural networks by introducing a regularizer that de-correlated activations . Dropout Neural networks may be explicitly regularized using techniques such as dropout . Dropout imposes regularization by dropping nodes in a way that is typically sampled from a Bernoulli distribution . The resulting model can be considered an ensemble . Gao et al . ( 2019 ) investigate the effects of separating the forward from the backward pass . 3 ON FUNCTIONS . Mathematically , a function is a binary relation between two sets that associates each element of the first set with exactly one of the other set . ReLU functions clearly satisfy this definition , and all images pass through the same ReLU function . Yet , we will argue that each image is more accurately considered to have its own function , because the overall ReLU function is not particularly smooth , and does not , for example , satisfy the nice properties of polynomials use in function analysis . Although each image function is calculated on the same weights , we find that the varying ReLU paths make them sufficiently different . 4 GENERALIZATION . At the start of training , both the training data and test data are assumed to be drawn from some distribution D. However , during training , input data are sampled uniformly from T , the training set , call this distribution U . The key question behind generalization is why optimizing over EU results in low loss over ED . In this work , we show that neural networks learn different functions for the same image during training , and that this function diversity may contribute to generalization . 5 FULLY CONNECTED NETWORK GRADIENTS . We use [ N ] : = { 1 , 2 , ... , N } . SGD computes the following update on neural network parameters wt+1 = wt ⌘rwtL ( 1 ) where rwtL denotes the gradient of the loss with respect to the weight parameters , and ⌘ the learning rate . We focus on the case of minibatch SGD , where the gradient update is computed over a batch of data . For a particular node n evaluated on an image xi , it will have incoming backpropagated gradient at time t of z ( t , n ) i . Let N be the number of nodes in the network and L the number of layers . We assume each node has an index , n , in [ N ] , and furthermore for the sake of notation that all nodes in the first layer are indexed { 1 , ... ` 1 } , that the second layer is indexed { ` 1 , ... , ` 2 } etc . with ` L = N . We will also write { ` 1 , ... , ` 0 } to denote the coordinates of the input . Let ! ai ( t , ` j : ` k ) be the vector of activations for image xi at time t from nodes in layers j to k. We define a function pti : [ N ] ! { 0 , 1 } that takes the index of the neural network ’ s N nodes , and returns 1 if it is on for image i at time t according to the ReLU activation function and returns 0 otherwise . With some abuse of notation , if we omit the function argument and write pti , we define this as the vector of length N containing pti ( n ) as each entry . Let Bt be the minibatch sampled at time t. So the gradient update for a particular node n in layer ` k , k 2 [ L ] at time t is X i2Bt z ( t , n ) i · p t i ( n ) · ! ai ( t , ` k 2 : ` k 1 ) ( 2 ) for the weight parameter and P i2Bt z ( t , n ) i for the bias parameter . Let f ( t , n ) i ( x ) = ⇣ z ( t , n ) i · p t i ( n ) · ! ai ( t , ` k 2 : ` k 1 ) ⌘ · x+ z ( t , n ) i ( 3 ) Then the overall function a fully connected node n computes at time t for input x is f ( t , n ) ( x ) = X t X i2Bt f ( t , n ) i ( x ) ! · ptx ( n ) ( 4 ) where ptx ( n ) denotes the path function for image x ( not necessarily in the training set ) , and the layer activations are given by f ( t,1 : ` 1 ) ( x ) : = [ f ( t,1 ) ( x ) , f ( t,2 ) ( x ) , ... , f ( t , ` 1 ) ( x ) ] ( 5 ) where the square braces denote concatenation and the layer function for ` j may be defined recursively . F ( t , ` j ) ( x ) = f ( t , ` j 1 : ` j ) ⇣ · · ·f ( t,1 : ` 1 ) ( x ) ⌘ ( 6 ) We will define the history of the neural network as HT = { X i2B1 f ( 1 , [ N ] ) i , ... , X i2BT f ( T , [ N ] ) i } ( 7 ) The activations ! ai ( t , n ) for an input image xi are found by projecting the image onto the history of the network , e.g . ! ai ( t,1 : ` 1 ) = f ( t,1 : ` 1 ) ( xi ) ( 8 ) We will use the notation pti|Ht ( 9 ) to project the path pti onto the history , i.e . to run the forward pass for F ( t , ` L ) fixing ptx ( n ) in Equation 4 to be equal to pti for all n. Once enough updates have occurred , Equation 4 contains a term f ( t , n ) i for all i in the training set . It is therefore not obvious why continuing to update using only the i in the training set does not yield a function that is very correlated on the training set and only produces low values of the loss on those points ( and not on the test set ) . The gradient of neural networks is sometimes treated as a black-box in terms of generalization . However , we can exploit the fact that many neural networks use some form of dot product for each neuron to write the ai terms in Equation 4 . Experimentally , we will measure the normalized dot products of these activations , as well as path overlap . Evaluating the same point using different functions Let t be the current time , xi 2 Bt and xj /2 Bt . At time t , data point xi is evaluated using Equation 6 which contains f ( t , n ) j as in Equation 4 . One main observation is that f ( t , n ) j and f ( t k , n ) j for 1 k t 1 may have different p t x ( n ) terms in Equation 4 ( i.e . ptx ( n ) · pt kx ( n ) may not have high normalized dot product ) . That is to say , the same image at different times in training may follow a different evaluation path , i.e . the set of nodes activated for that image may be different . ) This also means that although each f ( t , n ) i may be correlated with the history Ht of the network , and hence be correlated with the other previous f ( t k , n ) j for 1 k t 1 , the ReLU activation causes pj to be new enough that the network may not already correlated with f ( t , n ) j at the current time t ( until xj next updates . ) This encourages generalization , as the network , despite having seen xj before , does not pass it through a function too correlated with xj . This means that although the network has seen image xj before , it learns it using a different function , encouraging generalization . In summary , we show experimentally that Neural networks learn differing functions for the same image during training Earlier functions are destroyed by subsequent ones In an ensemble , typically an average of functions is taken to be the final predictor of the form wigi . In the setup described above , although image xi may follow pti at time t , it may subsequently not be assigned that same path again . Hence , it can not use all of f ti in future rounds . We believe this also means that having extremely low correlation or independence is not as important as it is in ensembles . Rather , there is a tradeoff ; more similarity may mean easier optimization , while somewhat less similarity may lead to more algorithmic stability , due to not re-using the same set of features . Which functions are optimized We use pti|Ht to be the function found projecting the path pti onto the history Ht . Each data point xi at time t will have loss L ( pti|Ht ) where L is some loss function ( e.g . the cross entropy loss ) . Suppose xi is in the updating batch at time t , i.e . i 2 Bt , then rL ( pti|Ht ) is directly calculated , and a gradient step is taken to descend on this loss function . Furthermore , since the function pti|Ht depends on all previous images xj after the first epoch in training , it is not obvious why while descending on L ( pti|Ht ) , the functions L ( ptj |Ht ) are not also optimized for images xj in the training set only . We hypothesize that even if the network tries to optimize L ( pti|Ht ) in terms of prior pkj |Hk for k < t , this does not correspond to optimizing xj in terms of its current function ptj |Ht . From the last time xj updated , the network can not re-run the forward pass on xj , and ptj will be reassigned according to the ReLU function and the current history Ht . So the i 2 Bt do not have access to the end to end back-propagated gradient along the updated ptj and instead calculate gradients along their own paths pti for i 2 Bt . Each of these pti have some intersection with the previous pkj for k < t , typically pti · pkj > 0 . These paths pti serve to collectively update along ptj , but not by simple averaging or by linear combination of the whole paths . The sum of fi in Equation 4 do not correspond to a single back-propagated function , and are instead separate functions ( Equation 3 ) stitched together according to the ReLU gate . When re-assigning xj to its new path , the z ( t , n ) i in Equation 3 may not correspond to the evaluation path ahead in the network that xj will actually follow ( because ptj is unknown ) . The function xj follows at evaluation time is hence a sort of ’ franken-function ’ which is constructed on the fly and is not explicitly optimized . It also does not correspond to simply adding together the fi , as the px term in Equation 4 must be applied . Additionally , the previous path that xj was following is likely to be destroyed ; we find experimentally that the image does not follow pkj at a later time t. Also , either all gradient updates to a node are applied ( if it is on ) or none are ( if it is off ) , so data points may not selectively pick some functions to follow end-to-end . Additionally , we find that training images xi and xj intersect in different places ( along different paths ) at different times in training , and that xi has highest dot product with different images throughout training . We interpret this to mean that The ReLU gate encourages the use of different features at different times . We show experimentally that : • For a particular previous fki k < t , each current updating f tj have only partial path intersection with fki . ( They do not have complete access to all previous activations ) . Furthermore , they intersect on different nodes at different times . ( Indicating they may learn from each other in different ways at different times ) • The f ti at different times t for some fixed image index i are different . ( Self similarity is not perfect . ) • The overall layer function , Equation 6 is not too smooth , supporting the case for considering f ti for various i as different functions . • For a particular image i , the ranking of which functions f tj are most path similar , for various times t , changes , indicating that which images are most similar to each other changes . This is in contrast , e.g. , with K nearest neighbors , where the identity of the nearest neighbor remains fixed for fixed training data . CNN layers the update for CNN networks may be computed comparably , with Equation 3 modified to contain a sum over patches cj of the original image f ( t , n ) i ( x ) = 0 @ X j z ( t , n ) i · p t i ( n ) · ! cj ( t , ` k 2 : ` k 1 ) 1 A · x+ X j z ( t , n ) j ( 10 ) | This paper proposes a different look at why neural networks generalize despite optimizing to zero training error, over-parameterization, etc. The contribution is mostly experimental in the sense of computing various statistics of a model during training and correlating those statistics with generalization performance. The core idea is to define "image functions" which are determined by the training image and the current training iteration. Correlation statistics on these functions for different and same training images show patterns in the training dynamics, which may indicate generalization for example as training continues towards zero error the statistics still vary. The paper focuses on classification with CIFAR10 and ImageNet with AlexNet, VGG, and ResNet models. In particular the results are specialized for ReLU networks training with SGD. | SP:77e60bbe1d3357adcdbe9c340b2f081cbce95090 |
Image Functions In Neural Networks: A Perspective On Generalization | In this work , we show that training with SGD on ReLU neural networks gives rise to a natural set of functions for each image that are not perfectly correlated until later in training . Furthermore , we show experimentally that the intersection of paths for different images also changes during the course of training . We hypothesize that this lack of correlation and changing intersection may be a factor in explaining generalization , because it encourages the model to use different features at different times , and pass the same image through different functions during training . This may improve generalization in two ways . 1 ) By encouraging the model to learn the same image in different ways , and learn different commonalities between images , comparable to model ensembling . 2 ) By improving algorithmic stability , as for a particular feature , the model is not always reliant on the same set of images , so the removal of an image may not adversely affect the loss . 1 INTRODUCTION . Determining why neural networks generalize remains an interesting open problem . Training often succeeds even without the use of explicit regularizers like Dropout Srivastava et al . ( 2014 ) , and even when the model is trained all the way to 100 % training accuracy , or in the presence of over-parametrization Zhang et al . ( 2021 ) . Existing bounds using capacity control Neyshabur et al . ( 2019 ) , e.g . Rademacher complexity or VC dimension are difficult to analyze when there is zero label noise and zero empirical risk Belkin et al . ( 2018 ) . Several interesting approaches have been explored to explain the generalization phenomenon . These include approaches based on applying algorithmic stability Bousquet & Elisseeff ( 2000 ) to SGD Hardt et al . ( 2016 ) Kuzborskij & Lampert ( 2018 ) , PAC Bayes based bounds Dziugaite & Roy ( 2017 ) approaches exploring properties of neural network functions like elasticity He & Su ( 2019 ) . It has also been hypothesized that neural networks have a spectral bias towards low frequency functions Rahaman et al . ( 2019 ) . While discovering neural networks generalize on small datasets , Olson et al . ( 2018 ) introduced an algorithm to decompose a neural network into a set of uncorrelated trees , possibly explaining their ability to perform variance reduction . For many machine learning models , boosting Schapire ( 2003 ) and bagging Breiman ( 1996 ) are employed to improve generalization performance by either averaging over different trained models , or resampling the dataset so it contains different distributions of data points . The underlying intuition is that different models are unlikely to make the same mistake . One can also train models on different subsets of features and take an average to reduce variance . Additionally , one promising line of investigation surrounding neural network generalization is that of algorithmic stability , as analyzed by Bousquet & Elisseeff ( 2000 ) and Hardt et al . ( 2016 ) for the case of SGD . In this work , we consider ReLU networks trained using SGD on image data . We show that training with SGD on ReLU neural networks gives rise to a natural set of functions for each image that are not perfectly correlated until later in training . Furthermore , we show experimentally that the intersection of paths for different images also changes during the course of training . We hypothesize that this lack of correlation and changing intersection may be a factor in explaining generalization , because it encourages the model to use different features at different times , and pass the same image through different functions during training . This may improve generalization in two ways . 1 ) By encouraging the model to learn the same image in different ways , and learn different commonalities between images , comparable to model ensembling . In particular , at time t , an image has access to a subset of features from image functions f tj , and this subset changes over time . Hence , f ti may not be too correlated with the end-to-end function f k j , k t on the training set , allowing for generalization . 2 ) By improving algorithmic stability , as for a particular feature , the model is not always reliant on the same set of images , so the removal of an image may not adversely affect the loss . 2 PRIOR WORK . Keskar et al . ( 2019 ) investigate the effect of sharpness and flatness of minima on generalization , and find that flat minima generalize better . Dinh et al . ( 2017 ) find that if the network is re-parametrized , sharp minima can also generalize well . Smith & Le ( 2018 ) give a bayesian perspective on generalization and SGD . Dziugaite & Roy ( 2017 ) reveal a way to compute non-vacuous generalization bounds using PAC-Bayes He & Su ( 2019 ) study the local elasticity of neural networks , where the prediction at x is not significantly perturbed if a gradient update is performed on another dissimilar point x0 . Deng et al . ( 2021 ) use local elasticity to compute a generalization bound.Poggio et al . ( 2020a ) show that neural networks can avoid the curse of dimensionality . Poggio et al . ( 2020b ) show that neural networks have complexity control by analyzing the normalized gradient . Veit et al . ( 2016 ) find that ResNets behave like ensembles of shallow networks by examining the paths the data travels through . Algorithmic stability Bousquet & Elisseeff ( 2000 ) use McDiarmid ’ s method to show that algorithmic stability implies good generalization error . Hardt et al . ( 2016 ) analyze the algorithmic stability of SGD . Studies on the gradient Sankararaman et al . ( 2020 ) study the impact of gradient confusion on the speed of neural network optimization concluding that SGD is fast when gradient confusion is low . Yin et al . ( 2018 ) Jain et al . ( 2018 ) study the effect of gradient diversity on the speed of optimization and show that greater gradient diversity leads to large mini-batches more effectively speeding up SGD . Fort et al . ( 2019 ) investigate the stiffness of neural networks and measure the cosine similarity between gradients as an approximation of how much one data point reduces loss on another . Chatterjee ( 2019 ) connects gradient averaging to algorithmic stability and generalization . Jacot et al . ( 2018 ) study generalization in the case that the network width reaches infinity , in which case dynamics are governed by the Neural Tangent Kernel . Arora et al . ( 2019 ) find that in practice , finite width CNTKs generalize better than infinite width models , indicating there may be some advantage to finite width . Novak et al . ( 2018 ) empirically study sensitivity measures such as the input output jacobian , and find that this correlates with generalization . Arpit et al . ( 2017 ) study memorization in neural networks . One quantity they consider is the gradient of the loss with respect to a particular input sample . Variance reduction A key idea in traditional machine learning is that of variance reduction . Boosting and bagging are employed as techniques to reduce variance by averaging over different ( uncorrelated ) models . SGD as noisy GD Mandt et al . ( 2016 ) show that SGD can be interpreted as an OrnsteinUhlenbeck process . Another line of work has investigated the anisotropic noise of SGD as compared to GD . Since the SGD update samples a minibatch to calculate the gradient instead of using the whole training set , they view the SGD update as a noisy version of the GD update . Zhu et al . ( 2019 ) explore the effectiveness of the anisotropic noise in SGD at escaping bad minima of the loss function . Assessing Layerwise Convergence Raghu et al . ( 2017 ) Morcos et al . ( 2018 ) use canonical correlation analysis to reveal insights into the convergence across different neural networks . They consider each neuron to be a vector , with each entry corresponding to the neuron value on a training data point , and each layer to be a subspace spanned by its neurons ’ vectors . Assessing Activation Patterns Hanin & Rolnick ( 2019 ) investigated activation patterns in ReLU networks and found that they use surprisingly few such patterns . Cogswell et al . ( 2016 ) improved generalization of neural networks by introducing a regularizer that de-correlated activations . Dropout Neural networks may be explicitly regularized using techniques such as dropout . Dropout imposes regularization by dropping nodes in a way that is typically sampled from a Bernoulli distribution . The resulting model can be considered an ensemble . Gao et al . ( 2019 ) investigate the effects of separating the forward from the backward pass . 3 ON FUNCTIONS . Mathematically , a function is a binary relation between two sets that associates each element of the first set with exactly one of the other set . ReLU functions clearly satisfy this definition , and all images pass through the same ReLU function . Yet , we will argue that each image is more accurately considered to have its own function , because the overall ReLU function is not particularly smooth , and does not , for example , satisfy the nice properties of polynomials use in function analysis . Although each image function is calculated on the same weights , we find that the varying ReLU paths make them sufficiently different . 4 GENERALIZATION . At the start of training , both the training data and test data are assumed to be drawn from some distribution D. However , during training , input data are sampled uniformly from T , the training set , call this distribution U . The key question behind generalization is why optimizing over EU results in low loss over ED . In this work , we show that neural networks learn different functions for the same image during training , and that this function diversity may contribute to generalization . 5 FULLY CONNECTED NETWORK GRADIENTS . We use [ N ] : = { 1 , 2 , ... , N } . SGD computes the following update on neural network parameters wt+1 = wt ⌘rwtL ( 1 ) where rwtL denotes the gradient of the loss with respect to the weight parameters , and ⌘ the learning rate . We focus on the case of minibatch SGD , where the gradient update is computed over a batch of data . For a particular node n evaluated on an image xi , it will have incoming backpropagated gradient at time t of z ( t , n ) i . Let N be the number of nodes in the network and L the number of layers . We assume each node has an index , n , in [ N ] , and furthermore for the sake of notation that all nodes in the first layer are indexed { 1 , ... ` 1 } , that the second layer is indexed { ` 1 , ... , ` 2 } etc . with ` L = N . We will also write { ` 1 , ... , ` 0 } to denote the coordinates of the input . Let ! ai ( t , ` j : ` k ) be the vector of activations for image xi at time t from nodes in layers j to k. We define a function pti : [ N ] ! { 0 , 1 } that takes the index of the neural network ’ s N nodes , and returns 1 if it is on for image i at time t according to the ReLU activation function and returns 0 otherwise . With some abuse of notation , if we omit the function argument and write pti , we define this as the vector of length N containing pti ( n ) as each entry . Let Bt be the minibatch sampled at time t. So the gradient update for a particular node n in layer ` k , k 2 [ L ] at time t is X i2Bt z ( t , n ) i · p t i ( n ) · ! ai ( t , ` k 2 : ` k 1 ) ( 2 ) for the weight parameter and P i2Bt z ( t , n ) i for the bias parameter . Let f ( t , n ) i ( x ) = ⇣ z ( t , n ) i · p t i ( n ) · ! ai ( t , ` k 2 : ` k 1 ) ⌘ · x+ z ( t , n ) i ( 3 ) Then the overall function a fully connected node n computes at time t for input x is f ( t , n ) ( x ) = X t X i2Bt f ( t , n ) i ( x ) ! · ptx ( n ) ( 4 ) where ptx ( n ) denotes the path function for image x ( not necessarily in the training set ) , and the layer activations are given by f ( t,1 : ` 1 ) ( x ) : = [ f ( t,1 ) ( x ) , f ( t,2 ) ( x ) , ... , f ( t , ` 1 ) ( x ) ] ( 5 ) where the square braces denote concatenation and the layer function for ` j may be defined recursively . F ( t , ` j ) ( x ) = f ( t , ` j 1 : ` j ) ⇣ · · ·f ( t,1 : ` 1 ) ( x ) ⌘ ( 6 ) We will define the history of the neural network as HT = { X i2B1 f ( 1 , [ N ] ) i , ... , X i2BT f ( T , [ N ] ) i } ( 7 ) The activations ! ai ( t , n ) for an input image xi are found by projecting the image onto the history of the network , e.g . ! ai ( t,1 : ` 1 ) = f ( t,1 : ` 1 ) ( xi ) ( 8 ) We will use the notation pti|Ht ( 9 ) to project the path pti onto the history , i.e . to run the forward pass for F ( t , ` L ) fixing ptx ( n ) in Equation 4 to be equal to pti for all n. Once enough updates have occurred , Equation 4 contains a term f ( t , n ) i for all i in the training set . It is therefore not obvious why continuing to update using only the i in the training set does not yield a function that is very correlated on the training set and only produces low values of the loss on those points ( and not on the test set ) . The gradient of neural networks is sometimes treated as a black-box in terms of generalization . However , we can exploit the fact that many neural networks use some form of dot product for each neuron to write the ai terms in Equation 4 . Experimentally , we will measure the normalized dot products of these activations , as well as path overlap . Evaluating the same point using different functions Let t be the current time , xi 2 Bt and xj /2 Bt . At time t , data point xi is evaluated using Equation 6 which contains f ( t , n ) j as in Equation 4 . One main observation is that f ( t , n ) j and f ( t k , n ) j for 1 k t 1 may have different p t x ( n ) terms in Equation 4 ( i.e . ptx ( n ) · pt kx ( n ) may not have high normalized dot product ) . That is to say , the same image at different times in training may follow a different evaluation path , i.e . the set of nodes activated for that image may be different . ) This also means that although each f ( t , n ) i may be correlated with the history Ht of the network , and hence be correlated with the other previous f ( t k , n ) j for 1 k t 1 , the ReLU activation causes pj to be new enough that the network may not already correlated with f ( t , n ) j at the current time t ( until xj next updates . ) This encourages generalization , as the network , despite having seen xj before , does not pass it through a function too correlated with xj . This means that although the network has seen image xj before , it learns it using a different function , encouraging generalization . In summary , we show experimentally that Neural networks learn differing functions for the same image during training Earlier functions are destroyed by subsequent ones In an ensemble , typically an average of functions is taken to be the final predictor of the form wigi . In the setup described above , although image xi may follow pti at time t , it may subsequently not be assigned that same path again . Hence , it can not use all of f ti in future rounds . We believe this also means that having extremely low correlation or independence is not as important as it is in ensembles . Rather , there is a tradeoff ; more similarity may mean easier optimization , while somewhat less similarity may lead to more algorithmic stability , due to not re-using the same set of features . Which functions are optimized We use pti|Ht to be the function found projecting the path pti onto the history Ht . Each data point xi at time t will have loss L ( pti|Ht ) where L is some loss function ( e.g . the cross entropy loss ) . Suppose xi is in the updating batch at time t , i.e . i 2 Bt , then rL ( pti|Ht ) is directly calculated , and a gradient step is taken to descend on this loss function . Furthermore , since the function pti|Ht depends on all previous images xj after the first epoch in training , it is not obvious why while descending on L ( pti|Ht ) , the functions L ( ptj |Ht ) are not also optimized for images xj in the training set only . We hypothesize that even if the network tries to optimize L ( pti|Ht ) in terms of prior pkj |Hk for k < t , this does not correspond to optimizing xj in terms of its current function ptj |Ht . From the last time xj updated , the network can not re-run the forward pass on xj , and ptj will be reassigned according to the ReLU function and the current history Ht . So the i 2 Bt do not have access to the end to end back-propagated gradient along the updated ptj and instead calculate gradients along their own paths pti for i 2 Bt . Each of these pti have some intersection with the previous pkj for k < t , typically pti · pkj > 0 . These paths pti serve to collectively update along ptj , but not by simple averaging or by linear combination of the whole paths . The sum of fi in Equation 4 do not correspond to a single back-propagated function , and are instead separate functions ( Equation 3 ) stitched together according to the ReLU gate . When re-assigning xj to its new path , the z ( t , n ) i in Equation 3 may not correspond to the evaluation path ahead in the network that xj will actually follow ( because ptj is unknown ) . The function xj follows at evaluation time is hence a sort of ’ franken-function ’ which is constructed on the fly and is not explicitly optimized . It also does not correspond to simply adding together the fi , as the px term in Equation 4 must be applied . Additionally , the previous path that xj was following is likely to be destroyed ; we find experimentally that the image does not follow pkj at a later time t. Also , either all gradient updates to a node are applied ( if it is on ) or none are ( if it is off ) , so data points may not selectively pick some functions to follow end-to-end . Additionally , we find that training images xi and xj intersect in different places ( along different paths ) at different times in training , and that xi has highest dot product with different images throughout training . We interpret this to mean that The ReLU gate encourages the use of different features at different times . We show experimentally that : • For a particular previous fki k < t , each current updating f tj have only partial path intersection with fki . ( They do not have complete access to all previous activations ) . Furthermore , they intersect on different nodes at different times . ( Indicating they may learn from each other in different ways at different times ) • The f ti at different times t for some fixed image index i are different . ( Self similarity is not perfect . ) • The overall layer function , Equation 6 is not too smooth , supporting the case for considering f ti for various i as different functions . • For a particular image i , the ranking of which functions f tj are most path similar , for various times t , changes , indicating that which images are most similar to each other changes . This is in contrast , e.g. , with K nearest neighbors , where the identity of the nearest neighbor remains fixed for fixed training data . CNN layers the update for CNN networks may be computed comparably , with Equation 3 modified to contain a sum over patches cj of the original image f ( t , n ) i ( x ) = 0 @ X j z ( t , n ) i · p t i ( n ) · ! cj ( t , ` k 2 : ` k 1 ) 1 A · x+ X j z ( t , n ) j ( 10 ) | The authors present empirical results about the correlation between the activations in a neural network across time for a fixed pair of images. They show that for the same pair of images xi and xj, the activations change over time until they settle when the learning rate is sufficiently small. The authors claim that this provides insight into why neural networks generalize, by arguing that the network uses different features at different epochs during training. | SP:77e60bbe1d3357adcdbe9c340b2f081cbce95090 |
Inferring Offensiveness In Images From Natural Language Supervision | 1 INTRODUCTION . Deep learning models yielded many improvements in several fields . Particularly , transfer learning from models pre-trained on large-scale supervised data has become common practice in many tasks both with and without sufficient data to train deep learning models . Whereas approaches like semisupervised sequence learning ( Dai & Le , 2015 ) and datasets such as ImageNet ( Deng et al. , 2009 ) , especially the ImageNet-ILSVRC-2012 dataset with 1.2 million images , established pre-training approaches , in the following years , the training data size increased rapidly to billions of training examples ( Brown et al. , 2020 ; Jia et al. , 2021 ) , steadily improving the capabilities of deep models . Recently , autoregressive ( Radford et al. , 2019 ) , masked language modeling ( Devlin et al. , 2019 ) as well as natural language guided vision models ( Radford et al. , 2021 ) have enabled zero-shot transfer to downstream datasets removing the need for dataset-specific customization . Besides the parameter size of these models , the immense size of training data has enabled deep learning models to achieve high accuracy on specific benchmarks in natural language processing ( NLP ) and computer vision ( CV ) applications . However , in both application areas , the training data has been shown to have problematic characteristics resulting in models that encode e.g . stereotypical and derogatory associations ( Gebru et al. , 2018 ; Bender et al. , 2021 ) . Unfortunately , the curation of these large datasets is tedious and error-prone . Pre-trained models ( PM ) used for downstream tasks such as face detection propagate retained knowledge to the downstream module e.g . the classifier . To raise the awareness of such issues , Gebru et al . ( 2018 ) described how large , uncurated , Internetbased datasets encode e.g . dominant and hegemonic views , which further harms people at the margins . The authors urge researchers and dataset creators to invest significant resource allocation towards dataset curation and documentation practices . As a result , Birhane & Prabhu ( 2021 ) provided modules to detect faces and post-process them to provide privacy , as well as a pornographic content classifier to remove inappropriate images . Furthermore , Birhane & Prabhu ( 2021 ) conducted a hand surveyed image selection to identify misogynistic images in the ImageNet-ILSVRC-2012 dataset . Unfortunately , such a curation process is tedious and does not scale to current dataset sizes . Moreover , misogynistic images , as well as pornographic content , are only two subsets of offensive images . It remains an open question how to infer general offensiveness in images , including abusive , indecent , obscene , or menacing content , and how to identify them in an automated dataset curation process . Whereas large image datasets automatically scraped from the web may contain derogatory terms as categories and offensive images , which results in models with undesirable behavior , pre-trained models may also reflect desirable implicit knowledge and biases such as our social , ethical , and moral choices ( Jentzsch et al. , 2019 ; Schramowski et al. , 2020 ) reflected within the training data . In our study , we investigate modern vision PMs trained on large-scale datasets , in particular , the Contrastive Language-Image Pre-trained model ( CLIP ) ( Radford et al. , 2021 ) and argue that they themselves pave a way to mitigate the associated risks . Specifically , we show that they encode implicit knowledge to infer offensiveness in images overcoming previous issues , namely the lack of adequate and sufficient training data . Furthermore , we demonstrate that our approach can be utilized to annotate offensive images in vision datasets and , therefore , reliably assist the curation process of such datasets . We illustrate our approach on the popular ImageNet-ILSVRC-2012 dataset and show that large computer vision datasets contain additional inappropriate content , which previous documentations had not detected . With our proposed method this content can be automatically and reliably pre-selected . As an example , Fig . 1 ( left ) shows an exemplary image from the ImageNet-ILSVRC-2012 validation set identified as misogynistic content —categorized as “ beach voyeur ” — by a hand-surveyed image selection in ( Birhane & Prabhu , 2021 ) . Next to this human-selected image , Birhane & Prabhu ( 2021 ) applied different models to detect visible faces ( thus violating privacy rights ) and pornographic content . However , as we will show with our study , further inappropriate images , which we refer to as offensive , can be identified within the dataset . For instance , Fig . 1 ( right ) shows sixteen handpicked images from a set of automatically detected possibly offensive images , utilizing our proposed approach . Depending on the task and stakeholders , this ranges from offensive objects such as weapons ( second row , first and fifth image ) and dead animals ( first row , sixth image ) to immoral actions such as harming or even killing animals ( second row , second image ) and humans ( second row , seventh image ) , as well as offensive text and symbols ( first row , third image ) . With our study we therefore strongly advocate for curating and documenting a dataset by the categories and models provided by Birhane & Prabhu ( 2021 ) but also by taking the possible general offensiveness in images into account . To this end , we provide our models and the necessary data to reproduce our experiments and utilize our proposed method1 . We proceed as follows . We start with a brief overview of related work and required background introducing pre-trained models and their successes as well as concerns raised . Next , we describe the term offensiveness and show that common deep models can not reliably detect offensive image content due to the lack of sufficient data . We then continue by demonstrating that recent models , guided by natural language during the pre-training phase , can infer offensiveness in images based on their implicit knowledge . Before concluding , we present our automated dataset curation exemplary on the ImageNet-ILSVRC-2012 dataset . 1Anonymous link placeholder . Please see supplement . 2 BACKGROUND AND RELATED WORK . Concerns about large-scale data sets . Pre-training has become an essential approach in many vision and language tasks . In the vision domain , pre-training on large-scale supervised data such as ImageNet ( Deng et al. , 2009 ) has shown to be crucial for enhancing performance on downstream tasks via transfer learning . Since these datasets contain millions of data samples , curating such pre-training datasets requires heavy work on data gathering , sampling , and human annotation , making it error-prone and difficult to scale . Moreover , in the language domain , task-agnostic objectives such as autoregressive ( Radford et al. , 2019 ) and masked language modeling ( Devlin et al. , 2019 ) have scaled across many orders of magnitude , especially in model capacity and data , steadily increasing performance but also the capabilities of deep models . With their standardized input-output ( text-totext ) interface Radford et al . ( 2019 ) have enabled zero-shot transfer to downstream datasets . Recent systems like GPT-3 ( Brown et al. , 2020 ) are now competitive across many tasks with specialized models whereas requiring only a small amount to no task-specific training data . Based on these advances , more recently , Radford et al . ( 2021 ) and Jia et al . ( 2021 ) introduced models with similar capabilities in the vision domain . However , pre-training such models requires particularly large-scale training data , and the datasets ’ curation process is tedious and error-prone . To tackle this issue Gebru et al . ( 2018 ) suggest to provide dataset audit cards to document datasets . This provides stakeholders the ability to understand training data characteristics in order to alleviate known as well as unknown issues . The authors argue that whereas documentation allows for potential accountability , undocumented training data perpetuates harm without recourse . Birhane & Prabhu ( 2021 ) provided such a dataset card for the popular computer-vision ImageNetILSVRC-2012 dataset , including several metrics and the hand surveyed identification of images with misogynistic content . More importantly , the authors raised the awareness of polluted image datasets by the example of pornographic content inside several popular computer vision benchmark datasets . Although the authors raised criticism against ImageNet and identified several inappropriate images , the ImageNet-ILSVRC-2012 dataset —and the pre-trained models— are still under the most popular datasets in the ML community . In line with Gebru et al . ( 2018 ) , Birhane & Prabhu ( 2021 ) urge that ethics checks for future dataset curation endeavors become an integral part of the human-in-the-loop validation phase . ImageNet . The ImageNet ( Deng et al. , 2009 ) data collection is one of the most popular datasets in the computer vision domain and mostly refers to the subset ImageNet1k dataset with 1.2 million images across 1000 classes . This was introduced in 2012 for the classification challenge in the ImageNet Large Scale Visual Recognition Challenge ( ILSVRC ) . However , in total the collection ( ImageNet21k ) covers over 14 million images spread across 21,841 classes . As Birhane & Prabhu ( 2021 ) state , the ImageNet dataset remains one of the most influential and powerful image databases available today , although it was created over a decade ago . To apply transfer learning , the most popular deep learning frameworks provide downloadable pre-trained models for ImageNet1k . Recently , Ridnik et al . ( 2021 ) provided a novel scheme for high-quality , efficient pre-training on ImageNet21k and , along with it , the resulting pre-trained models . Pre-training vision models with natural language supervision . Pre-training methods that learn directly from raw data have revolutionized many tasks in natural language processing and computer vision over the last few years . Radford et al . ( 2021 ) propose visual representation learning via natural language supervision in a contrastive learning setting . The authors collected over 400M image-text pairs ( WebImageText dataset ) to show that the improvement with large-scale transformer models in NLP can be transferred to vision . More precisely , whereas typical vision models jointly train an image feature extractor and a linear classifier , CLIP jointly trains an image encoder and a text encoder to predict the correct pairings of a batch of ( image , text ) training examples . At test time the authors propose to synthesize the learned text encoder with a ( zero-shot ) linear classifier by embedding the names or descriptions of the target dataset ’ s classes , e.g . “ The image shows < label > . ” . For simplicity , we refer to a model trained in a contrastive language-image pre-training setting and fine-tuned or probed for a downstream task as CLIP model . Closely related to CLIP , the ALIGN ( Jia et al. , 2021 ) model is a family of multimodal dual encoders that learn to represent images and text in a shared embedding space . Instead of Vision-Transformers ( ViT ) or ResNet models ALIGN uses the EfficientNet ( Tan & Le , 2019 ) and BERT ( Devlin et al. , 2019 ) models as vision and text encoders . These encoders are trained from scratch on image-text pairs ( 1.8B pairs ) via contrastive learning . These models and their zero-shot capabilities display significant promise for widely-applicable tasks like image retrieval or search ( Radford et al. , 2021 ) . For instance , since image and text are encoded in the same representational space , these models can find relevant images in a database given text or relevant text given an image . More importantly , the relative ease of steering CLIP toward various applications with little or no additional data or training unlocks novel applications that were difficult to solve with previous methods , e.g. , as we show , inferring the offensiveness in images . Carried Knowledge of Pre-trained Large-Scale Models . As already described , with training on raw text , large-scale transformer-based language models revolutionized many NLP tasks . Recently , Radford et al . ( 2021 ) , Ramesh et al . ( 2021 ) and Jia et al . ( 2021 ) presented encouraging results that a similar breakthrough in computer vision will be possible . Besides the performance improvements in generation , regression , and classification tasks , these large-scale language models show surprisingly strong abilities to recall factual knowledge present in the training data ( Petroni et al. , 2019 ) . Further , Roberts et al . ( 2020 ) showed that large-scale pre-trained language models ’ capability to store and retrieve knowledge scales with model size . Since such models are often trained on unfiltered data , the kind of knowledge acquired is not controlled , leading to possibly undesirable behavior such as stereotypical and derogatory associations . However , Schick et al . ( 2021 ) demonstrated that these models can recognize , to a considerable degree , their undesirable retained knowledge and the toxicity of the content they produce . The authors further showed that a language model with this ability can perform self-debiasing to reduce its probability of generating offensive text . Furthermore , Jentzsch et al . ( 2019 ) and Schramowski et al . ( 2020 ) even showed that the retained knowledge of such models carries information about moral norms aligning with the human sense of “ right ” and “ wrong ” expressed in language . Similar to ( Schick et al. , 2021 ) , Schramowski et al . ( 2021 ) demonstrated how to utilize this knowledge to guide autoregressive language models ’ text generation to prevent their toxic degeneration . In this work , we investigate if we are able to utilize the carried knowledge of large-scale vision models in a similar way , i.e . detecting possible offensive images in large-scale vision datasets . | The paper constructs a classifier of whether or not an image is offensive. This is operationalized by finding a dataset from the psychology community of a few thousand images and ordinal judgements of 'morality' from a study. Prediction of these judgements is predictably hard, in no small part because the data is small. To combat these issues, the paper uses CLIP and soft-prompt tuning. Soft-prompt tuning appears to be very effective for CLIP in this context reaching accuracies of over 95%, where baseline fine tuning only gets about 85%. | SP:244188d1cd932f3a06ce09157bb1206b62becfb0 |
Inferring Offensiveness In Images From Natural Language Supervision | 1 INTRODUCTION . Deep learning models yielded many improvements in several fields . Particularly , transfer learning from models pre-trained on large-scale supervised data has become common practice in many tasks both with and without sufficient data to train deep learning models . Whereas approaches like semisupervised sequence learning ( Dai & Le , 2015 ) and datasets such as ImageNet ( Deng et al. , 2009 ) , especially the ImageNet-ILSVRC-2012 dataset with 1.2 million images , established pre-training approaches , in the following years , the training data size increased rapidly to billions of training examples ( Brown et al. , 2020 ; Jia et al. , 2021 ) , steadily improving the capabilities of deep models . Recently , autoregressive ( Radford et al. , 2019 ) , masked language modeling ( Devlin et al. , 2019 ) as well as natural language guided vision models ( Radford et al. , 2021 ) have enabled zero-shot transfer to downstream datasets removing the need for dataset-specific customization . Besides the parameter size of these models , the immense size of training data has enabled deep learning models to achieve high accuracy on specific benchmarks in natural language processing ( NLP ) and computer vision ( CV ) applications . However , in both application areas , the training data has been shown to have problematic characteristics resulting in models that encode e.g . stereotypical and derogatory associations ( Gebru et al. , 2018 ; Bender et al. , 2021 ) . Unfortunately , the curation of these large datasets is tedious and error-prone . Pre-trained models ( PM ) used for downstream tasks such as face detection propagate retained knowledge to the downstream module e.g . the classifier . To raise the awareness of such issues , Gebru et al . ( 2018 ) described how large , uncurated , Internetbased datasets encode e.g . dominant and hegemonic views , which further harms people at the margins . The authors urge researchers and dataset creators to invest significant resource allocation towards dataset curation and documentation practices . As a result , Birhane & Prabhu ( 2021 ) provided modules to detect faces and post-process them to provide privacy , as well as a pornographic content classifier to remove inappropriate images . Furthermore , Birhane & Prabhu ( 2021 ) conducted a hand surveyed image selection to identify misogynistic images in the ImageNet-ILSVRC-2012 dataset . Unfortunately , such a curation process is tedious and does not scale to current dataset sizes . Moreover , misogynistic images , as well as pornographic content , are only two subsets of offensive images . It remains an open question how to infer general offensiveness in images , including abusive , indecent , obscene , or menacing content , and how to identify them in an automated dataset curation process . Whereas large image datasets automatically scraped from the web may contain derogatory terms as categories and offensive images , which results in models with undesirable behavior , pre-trained models may also reflect desirable implicit knowledge and biases such as our social , ethical , and moral choices ( Jentzsch et al. , 2019 ; Schramowski et al. , 2020 ) reflected within the training data . In our study , we investigate modern vision PMs trained on large-scale datasets , in particular , the Contrastive Language-Image Pre-trained model ( CLIP ) ( Radford et al. , 2021 ) and argue that they themselves pave a way to mitigate the associated risks . Specifically , we show that they encode implicit knowledge to infer offensiveness in images overcoming previous issues , namely the lack of adequate and sufficient training data . Furthermore , we demonstrate that our approach can be utilized to annotate offensive images in vision datasets and , therefore , reliably assist the curation process of such datasets . We illustrate our approach on the popular ImageNet-ILSVRC-2012 dataset and show that large computer vision datasets contain additional inappropriate content , which previous documentations had not detected . With our proposed method this content can be automatically and reliably pre-selected . As an example , Fig . 1 ( left ) shows an exemplary image from the ImageNet-ILSVRC-2012 validation set identified as misogynistic content —categorized as “ beach voyeur ” — by a hand-surveyed image selection in ( Birhane & Prabhu , 2021 ) . Next to this human-selected image , Birhane & Prabhu ( 2021 ) applied different models to detect visible faces ( thus violating privacy rights ) and pornographic content . However , as we will show with our study , further inappropriate images , which we refer to as offensive , can be identified within the dataset . For instance , Fig . 1 ( right ) shows sixteen handpicked images from a set of automatically detected possibly offensive images , utilizing our proposed approach . Depending on the task and stakeholders , this ranges from offensive objects such as weapons ( second row , first and fifth image ) and dead animals ( first row , sixth image ) to immoral actions such as harming or even killing animals ( second row , second image ) and humans ( second row , seventh image ) , as well as offensive text and symbols ( first row , third image ) . With our study we therefore strongly advocate for curating and documenting a dataset by the categories and models provided by Birhane & Prabhu ( 2021 ) but also by taking the possible general offensiveness in images into account . To this end , we provide our models and the necessary data to reproduce our experiments and utilize our proposed method1 . We proceed as follows . We start with a brief overview of related work and required background introducing pre-trained models and their successes as well as concerns raised . Next , we describe the term offensiveness and show that common deep models can not reliably detect offensive image content due to the lack of sufficient data . We then continue by demonstrating that recent models , guided by natural language during the pre-training phase , can infer offensiveness in images based on their implicit knowledge . Before concluding , we present our automated dataset curation exemplary on the ImageNet-ILSVRC-2012 dataset . 1Anonymous link placeholder . Please see supplement . 2 BACKGROUND AND RELATED WORK . Concerns about large-scale data sets . Pre-training has become an essential approach in many vision and language tasks . In the vision domain , pre-training on large-scale supervised data such as ImageNet ( Deng et al. , 2009 ) has shown to be crucial for enhancing performance on downstream tasks via transfer learning . Since these datasets contain millions of data samples , curating such pre-training datasets requires heavy work on data gathering , sampling , and human annotation , making it error-prone and difficult to scale . Moreover , in the language domain , task-agnostic objectives such as autoregressive ( Radford et al. , 2019 ) and masked language modeling ( Devlin et al. , 2019 ) have scaled across many orders of magnitude , especially in model capacity and data , steadily increasing performance but also the capabilities of deep models . With their standardized input-output ( text-totext ) interface Radford et al . ( 2019 ) have enabled zero-shot transfer to downstream datasets . Recent systems like GPT-3 ( Brown et al. , 2020 ) are now competitive across many tasks with specialized models whereas requiring only a small amount to no task-specific training data . Based on these advances , more recently , Radford et al . ( 2021 ) and Jia et al . ( 2021 ) introduced models with similar capabilities in the vision domain . However , pre-training such models requires particularly large-scale training data , and the datasets ’ curation process is tedious and error-prone . To tackle this issue Gebru et al . ( 2018 ) suggest to provide dataset audit cards to document datasets . This provides stakeholders the ability to understand training data characteristics in order to alleviate known as well as unknown issues . The authors argue that whereas documentation allows for potential accountability , undocumented training data perpetuates harm without recourse . Birhane & Prabhu ( 2021 ) provided such a dataset card for the popular computer-vision ImageNetILSVRC-2012 dataset , including several metrics and the hand surveyed identification of images with misogynistic content . More importantly , the authors raised the awareness of polluted image datasets by the example of pornographic content inside several popular computer vision benchmark datasets . Although the authors raised criticism against ImageNet and identified several inappropriate images , the ImageNet-ILSVRC-2012 dataset —and the pre-trained models— are still under the most popular datasets in the ML community . In line with Gebru et al . ( 2018 ) , Birhane & Prabhu ( 2021 ) urge that ethics checks for future dataset curation endeavors become an integral part of the human-in-the-loop validation phase . ImageNet . The ImageNet ( Deng et al. , 2009 ) data collection is one of the most popular datasets in the computer vision domain and mostly refers to the subset ImageNet1k dataset with 1.2 million images across 1000 classes . This was introduced in 2012 for the classification challenge in the ImageNet Large Scale Visual Recognition Challenge ( ILSVRC ) . However , in total the collection ( ImageNet21k ) covers over 14 million images spread across 21,841 classes . As Birhane & Prabhu ( 2021 ) state , the ImageNet dataset remains one of the most influential and powerful image databases available today , although it was created over a decade ago . To apply transfer learning , the most popular deep learning frameworks provide downloadable pre-trained models for ImageNet1k . Recently , Ridnik et al . ( 2021 ) provided a novel scheme for high-quality , efficient pre-training on ImageNet21k and , along with it , the resulting pre-trained models . Pre-training vision models with natural language supervision . Pre-training methods that learn directly from raw data have revolutionized many tasks in natural language processing and computer vision over the last few years . Radford et al . ( 2021 ) propose visual representation learning via natural language supervision in a contrastive learning setting . The authors collected over 400M image-text pairs ( WebImageText dataset ) to show that the improvement with large-scale transformer models in NLP can be transferred to vision . More precisely , whereas typical vision models jointly train an image feature extractor and a linear classifier , CLIP jointly trains an image encoder and a text encoder to predict the correct pairings of a batch of ( image , text ) training examples . At test time the authors propose to synthesize the learned text encoder with a ( zero-shot ) linear classifier by embedding the names or descriptions of the target dataset ’ s classes , e.g . “ The image shows < label > . ” . For simplicity , we refer to a model trained in a contrastive language-image pre-training setting and fine-tuned or probed for a downstream task as CLIP model . Closely related to CLIP , the ALIGN ( Jia et al. , 2021 ) model is a family of multimodal dual encoders that learn to represent images and text in a shared embedding space . Instead of Vision-Transformers ( ViT ) or ResNet models ALIGN uses the EfficientNet ( Tan & Le , 2019 ) and BERT ( Devlin et al. , 2019 ) models as vision and text encoders . These encoders are trained from scratch on image-text pairs ( 1.8B pairs ) via contrastive learning . These models and their zero-shot capabilities display significant promise for widely-applicable tasks like image retrieval or search ( Radford et al. , 2021 ) . For instance , since image and text are encoded in the same representational space , these models can find relevant images in a database given text or relevant text given an image . More importantly , the relative ease of steering CLIP toward various applications with little or no additional data or training unlocks novel applications that were difficult to solve with previous methods , e.g. , as we show , inferring the offensiveness in images . Carried Knowledge of Pre-trained Large-Scale Models . As already described , with training on raw text , large-scale transformer-based language models revolutionized many NLP tasks . Recently , Radford et al . ( 2021 ) , Ramesh et al . ( 2021 ) and Jia et al . ( 2021 ) presented encouraging results that a similar breakthrough in computer vision will be possible . Besides the performance improvements in generation , regression , and classification tasks , these large-scale language models show surprisingly strong abilities to recall factual knowledge present in the training data ( Petroni et al. , 2019 ) . Further , Roberts et al . ( 2020 ) showed that large-scale pre-trained language models ’ capability to store and retrieve knowledge scales with model size . Since such models are often trained on unfiltered data , the kind of knowledge acquired is not controlled , leading to possibly undesirable behavior such as stereotypical and derogatory associations . However , Schick et al . ( 2021 ) demonstrated that these models can recognize , to a considerable degree , their undesirable retained knowledge and the toxicity of the content they produce . The authors further showed that a language model with this ability can perform self-debiasing to reduce its probability of generating offensive text . Furthermore , Jentzsch et al . ( 2019 ) and Schramowski et al . ( 2020 ) even showed that the retained knowledge of such models carries information about moral norms aligning with the human sense of “ right ” and “ wrong ” expressed in language . Similar to ( Schick et al. , 2021 ) , Schramowski et al . ( 2021 ) demonstrated how to utilize this knowledge to guide autoregressive language models ’ text generation to prevent their toxic degeneration . In this work , we investigate if we are able to utilize the carried knowledge of large-scale vision models in a similar way , i.e . detecting possible offensive images in large-scale vision datasets . | This paper described an interesting idea to leverage massively pre-trained models (specifically CLIP-based models) to infer offensiveness in images. The authors first gave detailed literature review regarding a recently raising concern about inappropriate images in computer vision datasets, and also performed several finetuning/probing baseline experiments to illustrate the feasibility to detect such inappropriate contents. Next the authors explored the possibility to mitigate the potential risk by utilizing the implicit knowledge learned by CLIP-based pre- trained models. Lastly the authors choose ImageNet for a proof-of-concept validation and show that the proposed approach can discover previously neglected offensive images. | SP:244188d1cd932f3a06ce09157bb1206b62becfb0 |
Domain Invariant Adversarial Learning | 1 INTRODUCTION . Deep learning models have achieved impressive success on a wide range of challenging tasks . However , their performance was shown to be brittle to adversarial examples : small , imperceptible perturbations in the input that drastically alter the classification ( Carlini & Wagner , 2017a ; b ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016b ; Moosavi-Dezfooli et al. , 2016 ; Szegedy et al. , 2013 ; Tramèr et al. , 2017 ; Dong et al. , 2018 ; Tabacof & Valle , 2016 ; Xie et al. , 2019b ; Rony et al. , 2019 ) . Designing reliable robust models has gained significant attention in the arms race against adversarial examples . Adversarial training ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Madry et al. , 2017 ; Zhang et al. , 2019b ) has been suggested as one of the most effective approaches to defend against such examples , and can be described as solving the following min-max optimization problem : min θ E ( x , y ) ∼D [ max x′ : ‖x′−x‖p≤ ` ( x′ , y ; θ ) ] , where x′ is the -bounded perturbation in the ` p norm and ` is the loss function . Different unrestricted attacks methods were also suggested , such as adversarial deformation , rotations , translation and more ( Brown et al. , 2018 ; Engstrom et al. , 2018 ; Xiao et al. , 2018 ; Alaifari et al. , 2018 ; Gilmer et al. , 2018 ) . The resulting min-max optimization problem can be hard to solve in general . Nevertheless , in the context of -bounded perturbations , the problem is often tractable in practice . The inner maximization is usually approximated by generating adversarial examples using projected gradient descent ( PGD ) ( Kurakin et al. , 2016a ; Madry et al. , 2017 ) . A PGD adversary starts with randomly initialized perturbation and iteratively adjust the perturbation while projecting it back into the -ball : xt+1 = ΠB ( x0 ) ( xt + α · sign ( ∇xt ` ( G ( xt ) , y ) ) ) , where x0 is the natural example ( with or without random noise ) , and ΠB ( x ) is the projection operator onto the -ball , G is the network , and α is the perturbation step size . As was shown by Athalye et al . ( 2018 ) , PGD-based adversarial training was one of the few defenses that were not broken under strong attacks . That said , the gap between robust and natural accuracy remains large for many tasks such as CIFAR10 ( Krizhevsky et al. , 2009 ) and ImageNet ( Deng et al. , 2009 ) . Generally speaking , Tsipras et al . ( 2018 ) suggested that robustness may be at odds with natural accuracy , and usually the trade-off is inherent . Nevertheless , a growing body of work aimed to improve the standard PGD-based adversarial training introduced by Madry et al . ( 2017 ) in various ways such as improved adversarial loss functions and regularization techniques ( Kannan et al. , 2018 ; Wang et al. , 2019b ; Zhang et al. , 2019b ) , semi-supervised approaches ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , adversarial perturbations on model weights ( Wu et al. , 2020 ) , utilizing out of distribution data ( Lee et al. , 2021 ) and many others . See related work for more details . Our contribution . In this work , we propose a novel approach to regulating the tradeoff between robustness and natural accuracy . In contrast to the aforementioned works , our method enhances adversarial training by enforcing a feature representation that is invariant across the natural and adversarial domains . We incorporate the idea of Domain-Adversarial Neural Networks ( DANN ) ( Ganin & Lempitsky , 2015 ; Ganin et al. , 2016 ) directly into the adversarial training process . DANN is a representation learning approach for domain adaptation , designed to ensure that predictions are made based on invariant feature representation that can not discriminate between source and target domains . Intuitively , the tasks of adversarial training and of domain-invariant representation have a similar goal : given a source ( natural ) domainX and a the target ( adversarial ) domainX ′ , we hope to achieve g ( X ) ≈ g ( X ′ ) , where g a feature representation function ( i.e. , neural network ) . Achieving such a dual representation intuitively yields a more general feature representation . In a comprehensive battery of experiments on MNIST ( LeCun et al. , 1998 ) , SVHN ( Netzer et al. , 2011 ) , CIFAR-10 ( Krizhevsky et al. , 2009 ) and CIFAR-100 ( Krizhevsky et al. , 2009 ) datasets , we demonstrate that by enforcing domain-invariant representation learning using DANN simultaneously with adversarial training , we gain a significant and consistent improvement in both robustness and natural accuracy compared to other state-of-the-art adversarial training methods , under AutoAttack ( Croce & Hein , 2020 ) and various strong PGD ( Madry et al. , 2017 ) , CW ( Carlini & Wagner , 2017b ) adversaries in white-box and black-box settings . Additionally , we evaluate our method using unforeseen `` natural '' corruptions ( Hendrycks & Dietterich , 2018 ) , unforeseen adversaries ( e.g. , ` 1 , ` 2 ) , transfer learning , and perform ablation studies . Finally , we offer a novel score function for quantifying the robust-natural accuracy tradeoff . 2 RELATED WORK . 2.1 DEFENSE METHODS . A variety of theoretically principled ( Cohen et al. , 2019 ; Raghunathan et al. , 2018a ; Sinha et al. , 2017 ; Raghunathan et al. , 2018b ; Wong et al. , 2018 ; Wong & Kolter , 2018 ; Gowal et al. , 2018 ) and empirical defense approaches ( Bai et al. , 2021 ) were proposed to enhance robustness since the discovery of adversarial examples . Among the empirical defence techniques we can find adversarial regularization ( Kurakin et al. , 2016a ; Madry et al. , 2017 ; Zhang et al. , 2019b ; Wang et al. , 2019b ; Kannan et al. , 2018 ) , curriculum-based adversarial training ( Cai et al. , 2018 ; Zhang et al. , 2020 ; Wang et al. , 2019a ) , ensemble adversarial training ( Tramèr et al. , 2017 ; Pang et al. , 2019 ; Yang et al. , 2020 ) , adversarial training with adaptive attack budget ( Ding et al. , 2018 ; Cheng et al. , 2020 ) , semi-supervised and unsupervised adversarial training ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , robust self/pre-training ( Jiang et al. , 2020 ; Chen et al. , 2020 ) , efficient adversarial training ( Shafahi et al. , 2019 ; Wong et al. , 2020 ; Andriushchenko & Flammarion , 2020 ; Zhang et al. , 2019a ) , and many other techniques ( Zhang & Wang , 2019 ; Goldblum et al. , 2020 ; Pang et al. , 2020b ; Lee et al. , 2020 ) . In an additional research direction , researchers suggested to add new dedicated building blocks to the network architecture for improved robustness ( Xie & Yuille , 2019 ; Xie et al. , 2019a ; Liu et al. , 2020 ) . Liu et al . ( 2020 ) hypothesised that different adversaries belong to different domains , and suggested gated batch normalization which is trained with multiple perturbation types . Others focused on searching robust architectures against adversarial examples ( Guo et al. , 2020 ) . Our work belongs to the the family of adversarial regularization techniques , for which we elaborate on common and best performing methods , and highlight the differences compared to our method . Madry et al . ( 2017 ) proposed a technique , commonly referred to as Adversarial Training ( AT ) , to minimize the cross entropy loss on adversarial examples generated by PGD . Zhang et al . ( 2019b ) suggested to decompose the prediction error for adversarial examples as the sum of the natural error and boundary error , and provided a differentiable upper bounds on both terms . Motivated by this decomposition , they suggested a technique called TRADES that uses the Kullback-Leibler ( KL ) divergence as a regularization term that will push the decision boundary away from the data . Wang et al . ( 2019b ) suggested that misclassified examples have a significant impact on final robustness , and proposed a technique called MART that differentiate between correctly classified and missclassified examples during training . Another area of research aims at revealing the connection between the loss weight landscape and adversarial training ( Prabhu et al. , 2019 ; Yu et al. , 2018 ; Wu et al. , 2020 ) . Specifically , Wu et al . ( 2020 ) identified a correlation between the flatness of weight loss landscape and robust generalization gap . They proposed the Adversarial Weight Perturbation ( AWP ) mechanism that is integrated into existing adversarial training methods . More recently , this approach was formalized from a theoretical standpoint by Tsai et al . ( 2021 ) . However , this method forms a double-perturbation mechanism that perturbs both inputs and weights , which may incur a significant increase in calculation overhead . Nevertheless , we show that DIAL still improves state-of-the-art results when combined with AWP . A related approach to ours , called ATDA , was presented by Song et al . ( 2018 ) . They proposed to add several constrains to the loss function in order to enforce domain adaptation : correlation alignment and maximum mean discrepancy ( Borgwardt et al. , 2006 ; Sun & Saenko , 2016 ) . While the objective is similar , using ideas from domain adaptation for learning better representation , we address it in two different ways . Our method fundamentally differs from Song et al . ( 2018 ) since we do not enforce domain adaptation by adding specific constrains to the loss function . Instead , we let the network learn the domain invariant representation directly during the optimization process , as suggested by Ganin & Lempitsky ( 2015 ) ; Ganin et al . ( 2016 ) . Moreover , Song et al . ( 2018 ) focused mainly of FGSM . We empirically demonstrate the superiority of our method in Section 4 . In a concurrent work , Qian et al . ( 2021 ) utilized the idea of exploiting local and global data information , and suggested to generate the adversarial examples by attacking an additional domain classifier . 2.2 ROBUST GENERALIZATION . Several works investigated the sample complexity requires the ensure adversarial generalization compared to the non-adversarial counterpart . Schmidt et al . ( 2018 ) has shown that there exists a distribution ( mixture of Gaussians ) where ensuring robust generalization necessarily requires more data than standard learning . This has been furthered investigated in a distribution-free models via the Rademacher Complexity , VC-dimension ( Yin et al. , 2019 ; Attias et al. , 2019 ; Khim & Loh , 2018 ; Awasthi et al. , 2020 ; Cullina et al. , 2018 ; Montasser et al. , 2019 ; Tsai et al. , 2021 ) and additional settings ( Diochnos et al. , 2018 ; Carmon et al. , 2019 ) . | The paper describes an adversarial training approach that, in addition to the commonly used robustness loss, requires the network to extract similar representation distributions for clean and attacked data. The proposed method is inspired by domain adaptation approaches that require a model to extract domain invariant/agnostic features from two domains. In the context of this paper, the two domains are the clean and adversarially perturbed images, and the network is required to extract domain invariant representation. To achieve domain invariance, the authors propose a domain classifier ( i.e., an adversarial network) that discriminates the representations from clean and attacked images. The feature extractor is then required to generate features that fool the domain classifier. The authors then provide extensive experiments on small-scale benchmark datasets (SVHN, CIFAR10, CIFAR 100, and MNIST in the supplementary material ) to show the robustness of their proposed approach against the state-of-the-art robustness methods under white-box and black-box attacks. The authors show that their proposed method provides: 1) higher accuracy on attacked data (more robustness), and 2) higher accuracy on clean data, closing the gap between the performance on clean and attacked data. In addition, the paper provides insightful experiments on robustness to unforeseen adversaries, robustness to unforeseen corruptions, transfer learning, and ablation studies. | SP:064409e33595c152d0f0185b80eb9d533c2d85ce |
Domain Invariant Adversarial Learning | 1 INTRODUCTION . Deep learning models have achieved impressive success on a wide range of challenging tasks . However , their performance was shown to be brittle to adversarial examples : small , imperceptible perturbations in the input that drastically alter the classification ( Carlini & Wagner , 2017a ; b ; Goodfellow et al. , 2014 ; Kurakin et al. , 2016b ; Moosavi-Dezfooli et al. , 2016 ; Szegedy et al. , 2013 ; Tramèr et al. , 2017 ; Dong et al. , 2018 ; Tabacof & Valle , 2016 ; Xie et al. , 2019b ; Rony et al. , 2019 ) . Designing reliable robust models has gained significant attention in the arms race against adversarial examples . Adversarial training ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ; Madry et al. , 2017 ; Zhang et al. , 2019b ) has been suggested as one of the most effective approaches to defend against such examples , and can be described as solving the following min-max optimization problem : min θ E ( x , y ) ∼D [ max x′ : ‖x′−x‖p≤ ` ( x′ , y ; θ ) ] , where x′ is the -bounded perturbation in the ` p norm and ` is the loss function . Different unrestricted attacks methods were also suggested , such as adversarial deformation , rotations , translation and more ( Brown et al. , 2018 ; Engstrom et al. , 2018 ; Xiao et al. , 2018 ; Alaifari et al. , 2018 ; Gilmer et al. , 2018 ) . The resulting min-max optimization problem can be hard to solve in general . Nevertheless , in the context of -bounded perturbations , the problem is often tractable in practice . The inner maximization is usually approximated by generating adversarial examples using projected gradient descent ( PGD ) ( Kurakin et al. , 2016a ; Madry et al. , 2017 ) . A PGD adversary starts with randomly initialized perturbation and iteratively adjust the perturbation while projecting it back into the -ball : xt+1 = ΠB ( x0 ) ( xt + α · sign ( ∇xt ` ( G ( xt ) , y ) ) ) , where x0 is the natural example ( with or without random noise ) , and ΠB ( x ) is the projection operator onto the -ball , G is the network , and α is the perturbation step size . As was shown by Athalye et al . ( 2018 ) , PGD-based adversarial training was one of the few defenses that were not broken under strong attacks . That said , the gap between robust and natural accuracy remains large for many tasks such as CIFAR10 ( Krizhevsky et al. , 2009 ) and ImageNet ( Deng et al. , 2009 ) . Generally speaking , Tsipras et al . ( 2018 ) suggested that robustness may be at odds with natural accuracy , and usually the trade-off is inherent . Nevertheless , a growing body of work aimed to improve the standard PGD-based adversarial training introduced by Madry et al . ( 2017 ) in various ways such as improved adversarial loss functions and regularization techniques ( Kannan et al. , 2018 ; Wang et al. , 2019b ; Zhang et al. , 2019b ) , semi-supervised approaches ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , adversarial perturbations on model weights ( Wu et al. , 2020 ) , utilizing out of distribution data ( Lee et al. , 2021 ) and many others . See related work for more details . Our contribution . In this work , we propose a novel approach to regulating the tradeoff between robustness and natural accuracy . In contrast to the aforementioned works , our method enhances adversarial training by enforcing a feature representation that is invariant across the natural and adversarial domains . We incorporate the idea of Domain-Adversarial Neural Networks ( DANN ) ( Ganin & Lempitsky , 2015 ; Ganin et al. , 2016 ) directly into the adversarial training process . DANN is a representation learning approach for domain adaptation , designed to ensure that predictions are made based on invariant feature representation that can not discriminate between source and target domains . Intuitively , the tasks of adversarial training and of domain-invariant representation have a similar goal : given a source ( natural ) domainX and a the target ( adversarial ) domainX ′ , we hope to achieve g ( X ) ≈ g ( X ′ ) , where g a feature representation function ( i.e. , neural network ) . Achieving such a dual representation intuitively yields a more general feature representation . In a comprehensive battery of experiments on MNIST ( LeCun et al. , 1998 ) , SVHN ( Netzer et al. , 2011 ) , CIFAR-10 ( Krizhevsky et al. , 2009 ) and CIFAR-100 ( Krizhevsky et al. , 2009 ) datasets , we demonstrate that by enforcing domain-invariant representation learning using DANN simultaneously with adversarial training , we gain a significant and consistent improvement in both robustness and natural accuracy compared to other state-of-the-art adversarial training methods , under AutoAttack ( Croce & Hein , 2020 ) and various strong PGD ( Madry et al. , 2017 ) , CW ( Carlini & Wagner , 2017b ) adversaries in white-box and black-box settings . Additionally , we evaluate our method using unforeseen `` natural '' corruptions ( Hendrycks & Dietterich , 2018 ) , unforeseen adversaries ( e.g. , ` 1 , ` 2 ) , transfer learning , and perform ablation studies . Finally , we offer a novel score function for quantifying the robust-natural accuracy tradeoff . 2 RELATED WORK . 2.1 DEFENSE METHODS . A variety of theoretically principled ( Cohen et al. , 2019 ; Raghunathan et al. , 2018a ; Sinha et al. , 2017 ; Raghunathan et al. , 2018b ; Wong et al. , 2018 ; Wong & Kolter , 2018 ; Gowal et al. , 2018 ) and empirical defense approaches ( Bai et al. , 2021 ) were proposed to enhance robustness since the discovery of adversarial examples . Among the empirical defence techniques we can find adversarial regularization ( Kurakin et al. , 2016a ; Madry et al. , 2017 ; Zhang et al. , 2019b ; Wang et al. , 2019b ; Kannan et al. , 2018 ) , curriculum-based adversarial training ( Cai et al. , 2018 ; Zhang et al. , 2020 ; Wang et al. , 2019a ) , ensemble adversarial training ( Tramèr et al. , 2017 ; Pang et al. , 2019 ; Yang et al. , 2020 ) , adversarial training with adaptive attack budget ( Ding et al. , 2018 ; Cheng et al. , 2020 ) , semi-supervised and unsupervised adversarial training ( Carmon et al. , 2019 ; Uesato et al. , 2019 ; Zhai et al. , 2019 ) , robust self/pre-training ( Jiang et al. , 2020 ; Chen et al. , 2020 ) , efficient adversarial training ( Shafahi et al. , 2019 ; Wong et al. , 2020 ; Andriushchenko & Flammarion , 2020 ; Zhang et al. , 2019a ) , and many other techniques ( Zhang & Wang , 2019 ; Goldblum et al. , 2020 ; Pang et al. , 2020b ; Lee et al. , 2020 ) . In an additional research direction , researchers suggested to add new dedicated building blocks to the network architecture for improved robustness ( Xie & Yuille , 2019 ; Xie et al. , 2019a ; Liu et al. , 2020 ) . Liu et al . ( 2020 ) hypothesised that different adversaries belong to different domains , and suggested gated batch normalization which is trained with multiple perturbation types . Others focused on searching robust architectures against adversarial examples ( Guo et al. , 2020 ) . Our work belongs to the the family of adversarial regularization techniques , for which we elaborate on common and best performing methods , and highlight the differences compared to our method . Madry et al . ( 2017 ) proposed a technique , commonly referred to as Adversarial Training ( AT ) , to minimize the cross entropy loss on adversarial examples generated by PGD . Zhang et al . ( 2019b ) suggested to decompose the prediction error for adversarial examples as the sum of the natural error and boundary error , and provided a differentiable upper bounds on both terms . Motivated by this decomposition , they suggested a technique called TRADES that uses the Kullback-Leibler ( KL ) divergence as a regularization term that will push the decision boundary away from the data . Wang et al . ( 2019b ) suggested that misclassified examples have a significant impact on final robustness , and proposed a technique called MART that differentiate between correctly classified and missclassified examples during training . Another area of research aims at revealing the connection between the loss weight landscape and adversarial training ( Prabhu et al. , 2019 ; Yu et al. , 2018 ; Wu et al. , 2020 ) . Specifically , Wu et al . ( 2020 ) identified a correlation between the flatness of weight loss landscape and robust generalization gap . They proposed the Adversarial Weight Perturbation ( AWP ) mechanism that is integrated into existing adversarial training methods . More recently , this approach was formalized from a theoretical standpoint by Tsai et al . ( 2021 ) . However , this method forms a double-perturbation mechanism that perturbs both inputs and weights , which may incur a significant increase in calculation overhead . Nevertheless , we show that DIAL still improves state-of-the-art results when combined with AWP . A related approach to ours , called ATDA , was presented by Song et al . ( 2018 ) . They proposed to add several constrains to the loss function in order to enforce domain adaptation : correlation alignment and maximum mean discrepancy ( Borgwardt et al. , 2006 ; Sun & Saenko , 2016 ) . While the objective is similar , using ideas from domain adaptation for learning better representation , we address it in two different ways . Our method fundamentally differs from Song et al . ( 2018 ) since we do not enforce domain adaptation by adding specific constrains to the loss function . Instead , we let the network learn the domain invariant representation directly during the optimization process , as suggested by Ganin & Lempitsky ( 2015 ) ; Ganin et al . ( 2016 ) . Moreover , Song et al . ( 2018 ) focused mainly of FGSM . We empirically demonstrate the superiority of our method in Section 4 . In a concurrent work , Qian et al . ( 2021 ) utilized the idea of exploiting local and global data information , and suggested to generate the adversarial examples by attacking an additional domain classifier . 2.2 ROBUST GENERALIZATION . Several works investigated the sample complexity requires the ensure adversarial generalization compared to the non-adversarial counterpart . Schmidt et al . ( 2018 ) has shown that there exists a distribution ( mixture of Gaussians ) where ensuring robust generalization necessarily requires more data than standard learning . This has been furthered investigated in a distribution-free models via the Rademacher Complexity , VC-dimension ( Yin et al. , 2019 ; Attias et al. , 2019 ; Khim & Loh , 2018 ; Awasthi et al. , 2020 ; Cullina et al. , 2018 ; Montasser et al. , 2019 ; Tsai et al. , 2021 ) and additional settings ( Diochnos et al. , 2018 ; Carmon et al. , 2019 ) . | This paper proposes a domain invariant adversarial training (DIAL) method, which learns the feature representation that is both robust and domain invariant. Apart from the label classifier, the model is equipped with a domain classifier that constrains the model not to discriminate between natural examples and adversarial examples, thus achieving a more robust feature representation. Extensive experiments on image classification benchmark the robustness compared to other state-of-the-art methods. | SP:064409e33595c152d0f0185b80eb9d533c2d85ce |
On Lottery Tickets and Minimal Task Representations in Deep Reinforcement Learning | The lottery ticket hypothesis questions the role of overparameterization in supervised deep learning . But how is the performance of winning lottery tickets affected by the distributional shift inherent to reinforcement learning problems ? In this work , we address this question by comparing sparse agents who have to address the non-stationarity of the exploration-exploitation problem with supervised agents trained to imitate an expert . We show that feed-forward networks trained with behavioural cloning compared to reinforcement learning can be pruned to higher levels of sparsity without performance degradation . This suggests that in order to solve the RL problem agents require more degrees of freedom . Using a set of carefully designed baseline conditions , we find that the majority of the lottery ticket effect in both learning paradigms can be attributed to the identified mask rather than the weight initialization . The input layer mask selectively prunes entire input dimensions that turn out to be irrelevant for the task at hand . At a moderate level of sparsity the mask identified by iterative magnitude pruning yields minimal task-relevant representations , i.e. , an interpretable inductive bias . Finally , we propose a simple initialization rescaling which promotes the robust identification of sparse task representations in low-dimensional control tasks . 1 INTRODUCTION . Recent research on the lottery ticket hypothesis ( LTH , Frankle & Carbin , 2019 ; Frankle et al. , 2019 ) in deep learning has demonstrated the existence of very sparse neural networks that train to performance levels comparable to those of their dense counterparts . These results challenge the role of overparameterization in supervised learning and provide a new perspective on the emergence of stable learning dynamics ( Frankle et al. , 2020a ; b ) . Recently these results have been extended to various domains beyond supervised image classification . These include self-supervised learning ( Chen et al. , 2020a ) , natural language processing ( Yu et al. , 2019 ; Chen et al. , 2020b ) and semantic segmentation ( Girish et al. , 2020 ) . But how does the lottery ticket ticket phenomenon transfer to reinforcement learning agents ? One key challenge may be the inherent non-stationarity of the optimization problem in deep reinforcement learning ( DRL ) : The data-generation process is not static , but depends on the changing state of the neural network . Furthermore , a weight may serve different roles at different stages of learning ( e.g . during exploration and exploitation ) . It is not obvious how a simple weight magnitude-based pruning heuristic acting on a well-performing policy shapes the learning process of the agent . In this work , we therefore investigate winning tickets in reinforcement learning and their underlying contributing factors . We compare supervised behavioral cloning with DRL , putting a special emphasis on the resulting input representations used for prediction and control . Thereby , we connect the statistical perspective of sparse structure discovery ( e.g . Hastie et al. , 2019 ) with the iterative magnitude pruning ( IMP , Han et al. , 2015 ) procedure in the context of Markov decision processes ( MDPs ) . The contributions of this work are summarized as follows : 1 . We show that winning tickets exist in both high-dimensional visual and control tasks ( continuous/discrete ) . A positive lottery ticket effect is robustly observed for both off-policy DRL algorithms , including Deep-Q-Networks ( DQN , Mnih et al. , 2015 ) and on-policy policy-gradient methods ( PPO , Schulman et al. , 2015 ; 2017 ) , providing evidence that the lottery ticket effect is a universal phenomenon across optimization formulations in DRL . 2 . By comparing RL to supervised behavioral cloning ( BC ) , we show that networks trained with explicit supervision can be pruned to higher sparsity levels before performance starts to degrade , indicating that the RL problem requires a larger amount of parameters to address exploration , distribution shift & quality of the credit assignment signal ( section 3.1 ) . 3 . By introducing a set of lottery ticket baselines ( section 3 ; figure 1 , middle column ) , we disentangle the contributions of the mask , weight initialization and layer-wise pruning ratio . We demonstrate that the mask explains most of the ticket effect in behavioral cloning and reinforcement learning for MLP-based agents , whereas the associated weight initialization is less important ( section 3.2 and 3.3 ) . For CNN-based agents the weight initialization contributes more . 4 . By visualizing the sparsified weights for each layer , we find that early network layers are pruned more . Entire input dimensions can be rendered invisible to MLP-based agents by the pruning procedure . By this mechanism , IMP compresses the input representation of the MDP ( e.g . figure 1 , left column , bottom row ) and reveals a minimal task representation for the underlying control problems ( section 4 ) . 5 . The IMP input layer mask not only eliminates obviously redundant dimensions , but also identifies complex relationships between input features and the task of the agent ( section 4.1 ) , e.g . the proximity of an enemy or the speed of an approaching object . We show that the input masking can be transferred to train dense agents with sparse inputs at lower costs . 6 . We show that the weight initialization scheme is important for discovering minimal representations . Depending on the input size of different layers of the network , global magnitude-based pruning can introduce a strong layer-specific pruning bias . We compare initializations and show that a suitable initialization scheme enables the removal of task-irrelevant dimensions ( section 4.2 ) . 2 BACKGROUND AND RELATED WORK . Iterative Magnitude Pruning . We use the iterative pruning procedure outlined in Frankle & Carbin ( 2019 ) to identify winning tickets . We train DRL agents for a previously calibrated number of transitions and track the best performing network checkpoint throughout . Performance is measured by the average return on a set of evaluation episodes . Afterwards , we prune 20 % of the weights with smallest magnitude globally ( across all layers ) . The remaining weights are reset to their initial values and we iterate this procedure ( train→ prune→ reset ) .1 The lottery ticket effect refers to the performance gap between the sparse network obtained via IMP and a randomly initialized network with sparsity-matched random pruning mask . Lottery Tickets in Deep Reinforcement Learning . Yu et al . ( 2019 ) previously demonstrated the existence of tickets in DRL that outperform parameter-matched random initializations . They obtained tickets for a distributed on-policy actor-critic agent on a subset of environments in the ALE benchmark ( Bellemare et al. , 2013 ) as well as a set of discrete control tasks . While they provide empirical evidence for the existence of lottery tickets in DRL , they did not investigate the underlying mechanisms . Here , we aim to unravel these mechanisms . To this end , we focus on a diverse set of environments and provide a detailed comparison between supervised behavioral cloning and on-/offpolicy Deep RL with a set of carefully designed ticket baselines . We analyze the resulting masked representations that the agent learns to act upon and the impact of specific weight initializations on the resulting sparse networks . Lottery Tickets with Non-Stationary Data Distributions . Desai et al . ( 2019 ) investigated whether trained lottery tickets overfit the training data distribution under which they were obtained . Using transfer learning tasks on natural language data , they showed that lottery tickets provide general inductive biases . Similar ticket transfer results were reported by Morcos et al . ( 2019 ) and Mehta ( 2019 ) in the context of optimizers and vision datasets . Unlike our work , these studies do not investigate within-training covariate shift , but instead focus on transferring ticket initializations after a full IMP run . Chen et al . ( 2021 ) , on the other hand , investigate the ticket phenomenon in the context of lifelong learning and class-incremental image classification . They propose new pruning strategies to overcome the sequential nature of tasks and need for increased model capacity . Compared to the DRL setting , the covariate shift is here determined by the curriculum schedule of tasks and not the exploration behaviour of the network-parameterized agent . Deep Reinforcement Learning Background . In our off-policy DRL experiments , we train DeepQ-Networks ( DQN , Mnih et al. , 2015 ) with double Q-learning loss ( Van Hasselt et al. , 2016 ) and prioritized experience replay ( Schaul et al. , 2015 ) . As a representative on-policy algorithm , we chose Proximal Policy Optimization ( PPO , Schulman et al. , 2015 ; 2017 ) . PPO is a baseline-corrected policy gradient algorithm which uses a clipping strategy to approximate a computationally expensive trust-region optimization method . For illustrative purposes , we train DQN agents on a visual navigation task , in which an agent has to collect coins in a grid while avoiding poison and two patrollers that are moving in restricted parts of the grid ( figure 1 , left column , bottom row ; SI B ) . We scale our results to four PyBullet ( Ellenberger , 2018 ) continuous control and a subset of ALE benchmark ( Bellemare et al. , 2013 ) environments . Due to computational considerations we limit each individual IMP iteration for the ATARI environments to 2.5 million frames . All other tasks were trained for a pre-calibrated generous amount of transitions . We focus on feedforward value estimators and policies ( MLP & CNN ) and used default hyperparameters with little tuning ( SI C ) . Supervised Behavioral Cloning . While most supervised learning relies on a stationary data distribution provided by a static dataset , reinforcement learning agents have to acquire their training data in an action-perception loop . Since the agent ’ s behavioural policy is learned over time , the data distribution used in optimization undergoes covariate shift . To study how the covariate shift , additional exploration problem and different credit assignment signal influence winning tickets , we mimic the supervised learning case by training agents via supervised policy distillation ( Rusu et al. , 2015 ; Schmitt et al. , 2018 ) . We roll out a pre-trained expert policy and train the student agent by minimizing the KL divergence between the student ’ s and teacher ’ s policies . 1In supervised learning , the pruning mask is often constructed based on an early stopping criterion and the final network . We instead track the best performing agent . Thereby , we reduce noise introduced by unstable learning dynamics and exploit that the agent is trained and evaluated on the same environment . We found that late rewinding to a later checkpoint ( Frankle et al. , 2019 ) is not necessary for obtaining tickets ( SI figure 14 ) . 3 DISENTANGLING TICKET CONTRIBUTIONS IN BC AND DEEP RL . There are two contributing factors to the lottery ticket effect : The IMP-identified binary mask and the preserved initialized weights that remain after pruning ( mask/weights ) . We aim to disentangle the contributions by introducing a set of counterfactual baselines , which modify the original IMP procedure ( figure 1 , middle column ; table 1 ) . A first baseline estimates how much of the performance of the ticket can be attributed to the initial weights , by means of a layer-specific permutation of the weights that remain after masking ( mask/permuted ) . A second , weaker baseline estimates the contribution of the mask , by also permuting the layer-specific masks ( permuted/permuted ) . Finally , we consider the standard random/re-init baseline , which samples random binary masks – discarding layer-specific pruning ratios – and re-initializes all weights at each IMP iteration . Throughout the next sections we use these baselines to analyze and compare the factors that give rise to the lottery ticket effect in different control settings . | **Update after reading the other reviews and authors' responses:** Some valid criticism has been raised and addressed by the authors to a reasonable degree (given e.g. the limitations of a conference-format paper). Given all current information I remain in favor of accepting the paper (my score and confidence remains unchanged). **Summary:** The paper investigates the lottery-ticket effect in detail in reinforcement learning tasks. While it has been shown before that lottery-tickets also exist in deep reinforcement learning, this paper performs a thorough analysis using (i) both discrete and continuous action- and observation-spaces, (ii) an on- and an off-policy RL algorithm (as well as a behavioral cloning baseline), and (iii) careful ablations to distinguish the importance of the binary mask and the initial weight values which together form a winning ticket. Various controls and ablations are performed, leading to a plethora of experimental results. The main result is that winning tickets can be found efficiently via iterative magnitude-based pruning in RL tasks, and that in many tasks the binary mask contributes more to performance than the initial weight values. Compared to the supervised (behavioral cloning) baseline, RL performance degrades more rapidly with increasing sparsity levels which is attributed to the distributional shift introduced by exploration in RL. Finally, the paper also investigates the effect of pruning (in winning tickets) of the first-layer weights, and shows that in many cases multiple input dimensions (or regions, which are often semantically meaningful) can be pruned without loss in task performance. This observation could be an interesting approach to producing sparse input representations in RL. **Main contributions** 1) Investigation of the lottery ticket effect in RL. Significance: though it has been reported before that winning tickets can be found in RL, the paper performs an impressive amount of empirical investigations, including many baselines and ablations across a range of continuous and discrete tasks and an on- and off-policy RL algorithm as well as a supervised baseline. Naturally, results vary somewhat between settings and variations, but the sheer number of results allows to extract trends that hold across many variations. This significantly increases the reliability of the findings. 2) Disentangling the lottery ticket effect through control experiments that allow to attribute the effect strength to (i) the binary mask, (ii) the initial weight-values, or (iii) the layer-specific pruning ratios, which are all combined in a winning ticket. Significance: these control experiments shed some important light on the role of the three components. Interestingly, the binary mask seems to play the most important role in RL tasks, whereas initial weight-values seem to matter more in the supervised setting. This is an interesting, and very consistent insight which might spawn further investigation into the topological structure induced by the winning mask. 3) Investigation of first-layer weights of winning tickets. In many cases whole input dimensions (in continuous tasks) or input regions (in discrete tasks) that are irrelevant to the problem are pruned. This reflects an important (implicit?) regularizing effect - the corresponding weights remain at low magnitudes and can be safely pruned. Investigation of the pruning patterns or pruned dimensions also provides semantic insight which allows for interesting hypotheses regarding how the network solves the task and which information it ignores. Significance: this is an interesting artifact of the analysis of winning tickets in RL. Results are promising and ask for further investigation and perhaps even formulation of a method for sparse/compressed input representations for RL (the identified irrelevant dimensions also transfer to non-pruned architectures). | SP:f0163ce76f64a095d124ea46dce4fb2337125157 |
On Lottery Tickets and Minimal Task Representations in Deep Reinforcement Learning | The lottery ticket hypothesis questions the role of overparameterization in supervised deep learning . But how is the performance of winning lottery tickets affected by the distributional shift inherent to reinforcement learning problems ? In this work , we address this question by comparing sparse agents who have to address the non-stationarity of the exploration-exploitation problem with supervised agents trained to imitate an expert . We show that feed-forward networks trained with behavioural cloning compared to reinforcement learning can be pruned to higher levels of sparsity without performance degradation . This suggests that in order to solve the RL problem agents require more degrees of freedom . Using a set of carefully designed baseline conditions , we find that the majority of the lottery ticket effect in both learning paradigms can be attributed to the identified mask rather than the weight initialization . The input layer mask selectively prunes entire input dimensions that turn out to be irrelevant for the task at hand . At a moderate level of sparsity the mask identified by iterative magnitude pruning yields minimal task-relevant representations , i.e. , an interpretable inductive bias . Finally , we propose a simple initialization rescaling which promotes the robust identification of sparse task representations in low-dimensional control tasks . 1 INTRODUCTION . Recent research on the lottery ticket hypothesis ( LTH , Frankle & Carbin , 2019 ; Frankle et al. , 2019 ) in deep learning has demonstrated the existence of very sparse neural networks that train to performance levels comparable to those of their dense counterparts . These results challenge the role of overparameterization in supervised learning and provide a new perspective on the emergence of stable learning dynamics ( Frankle et al. , 2020a ; b ) . Recently these results have been extended to various domains beyond supervised image classification . These include self-supervised learning ( Chen et al. , 2020a ) , natural language processing ( Yu et al. , 2019 ; Chen et al. , 2020b ) and semantic segmentation ( Girish et al. , 2020 ) . But how does the lottery ticket ticket phenomenon transfer to reinforcement learning agents ? One key challenge may be the inherent non-stationarity of the optimization problem in deep reinforcement learning ( DRL ) : The data-generation process is not static , but depends on the changing state of the neural network . Furthermore , a weight may serve different roles at different stages of learning ( e.g . during exploration and exploitation ) . It is not obvious how a simple weight magnitude-based pruning heuristic acting on a well-performing policy shapes the learning process of the agent . In this work , we therefore investigate winning tickets in reinforcement learning and their underlying contributing factors . We compare supervised behavioral cloning with DRL , putting a special emphasis on the resulting input representations used for prediction and control . Thereby , we connect the statistical perspective of sparse structure discovery ( e.g . Hastie et al. , 2019 ) with the iterative magnitude pruning ( IMP , Han et al. , 2015 ) procedure in the context of Markov decision processes ( MDPs ) . The contributions of this work are summarized as follows : 1 . We show that winning tickets exist in both high-dimensional visual and control tasks ( continuous/discrete ) . A positive lottery ticket effect is robustly observed for both off-policy DRL algorithms , including Deep-Q-Networks ( DQN , Mnih et al. , 2015 ) and on-policy policy-gradient methods ( PPO , Schulman et al. , 2015 ; 2017 ) , providing evidence that the lottery ticket effect is a universal phenomenon across optimization formulations in DRL . 2 . By comparing RL to supervised behavioral cloning ( BC ) , we show that networks trained with explicit supervision can be pruned to higher sparsity levels before performance starts to degrade , indicating that the RL problem requires a larger amount of parameters to address exploration , distribution shift & quality of the credit assignment signal ( section 3.1 ) . 3 . By introducing a set of lottery ticket baselines ( section 3 ; figure 1 , middle column ) , we disentangle the contributions of the mask , weight initialization and layer-wise pruning ratio . We demonstrate that the mask explains most of the ticket effect in behavioral cloning and reinforcement learning for MLP-based agents , whereas the associated weight initialization is less important ( section 3.2 and 3.3 ) . For CNN-based agents the weight initialization contributes more . 4 . By visualizing the sparsified weights for each layer , we find that early network layers are pruned more . Entire input dimensions can be rendered invisible to MLP-based agents by the pruning procedure . By this mechanism , IMP compresses the input representation of the MDP ( e.g . figure 1 , left column , bottom row ) and reveals a minimal task representation for the underlying control problems ( section 4 ) . 5 . The IMP input layer mask not only eliminates obviously redundant dimensions , but also identifies complex relationships between input features and the task of the agent ( section 4.1 ) , e.g . the proximity of an enemy or the speed of an approaching object . We show that the input masking can be transferred to train dense agents with sparse inputs at lower costs . 6 . We show that the weight initialization scheme is important for discovering minimal representations . Depending on the input size of different layers of the network , global magnitude-based pruning can introduce a strong layer-specific pruning bias . We compare initializations and show that a suitable initialization scheme enables the removal of task-irrelevant dimensions ( section 4.2 ) . 2 BACKGROUND AND RELATED WORK . Iterative Magnitude Pruning . We use the iterative pruning procedure outlined in Frankle & Carbin ( 2019 ) to identify winning tickets . We train DRL agents for a previously calibrated number of transitions and track the best performing network checkpoint throughout . Performance is measured by the average return on a set of evaluation episodes . Afterwards , we prune 20 % of the weights with smallest magnitude globally ( across all layers ) . The remaining weights are reset to their initial values and we iterate this procedure ( train→ prune→ reset ) .1 The lottery ticket effect refers to the performance gap between the sparse network obtained via IMP and a randomly initialized network with sparsity-matched random pruning mask . Lottery Tickets in Deep Reinforcement Learning . Yu et al . ( 2019 ) previously demonstrated the existence of tickets in DRL that outperform parameter-matched random initializations . They obtained tickets for a distributed on-policy actor-critic agent on a subset of environments in the ALE benchmark ( Bellemare et al. , 2013 ) as well as a set of discrete control tasks . While they provide empirical evidence for the existence of lottery tickets in DRL , they did not investigate the underlying mechanisms . Here , we aim to unravel these mechanisms . To this end , we focus on a diverse set of environments and provide a detailed comparison between supervised behavioral cloning and on-/offpolicy Deep RL with a set of carefully designed ticket baselines . We analyze the resulting masked representations that the agent learns to act upon and the impact of specific weight initializations on the resulting sparse networks . Lottery Tickets with Non-Stationary Data Distributions . Desai et al . ( 2019 ) investigated whether trained lottery tickets overfit the training data distribution under which they were obtained . Using transfer learning tasks on natural language data , they showed that lottery tickets provide general inductive biases . Similar ticket transfer results were reported by Morcos et al . ( 2019 ) and Mehta ( 2019 ) in the context of optimizers and vision datasets . Unlike our work , these studies do not investigate within-training covariate shift , but instead focus on transferring ticket initializations after a full IMP run . Chen et al . ( 2021 ) , on the other hand , investigate the ticket phenomenon in the context of lifelong learning and class-incremental image classification . They propose new pruning strategies to overcome the sequential nature of tasks and need for increased model capacity . Compared to the DRL setting , the covariate shift is here determined by the curriculum schedule of tasks and not the exploration behaviour of the network-parameterized agent . Deep Reinforcement Learning Background . In our off-policy DRL experiments , we train DeepQ-Networks ( DQN , Mnih et al. , 2015 ) with double Q-learning loss ( Van Hasselt et al. , 2016 ) and prioritized experience replay ( Schaul et al. , 2015 ) . As a representative on-policy algorithm , we chose Proximal Policy Optimization ( PPO , Schulman et al. , 2015 ; 2017 ) . PPO is a baseline-corrected policy gradient algorithm which uses a clipping strategy to approximate a computationally expensive trust-region optimization method . For illustrative purposes , we train DQN agents on a visual navigation task , in which an agent has to collect coins in a grid while avoiding poison and two patrollers that are moving in restricted parts of the grid ( figure 1 , left column , bottom row ; SI B ) . We scale our results to four PyBullet ( Ellenberger , 2018 ) continuous control and a subset of ALE benchmark ( Bellemare et al. , 2013 ) environments . Due to computational considerations we limit each individual IMP iteration for the ATARI environments to 2.5 million frames . All other tasks were trained for a pre-calibrated generous amount of transitions . We focus on feedforward value estimators and policies ( MLP & CNN ) and used default hyperparameters with little tuning ( SI C ) . Supervised Behavioral Cloning . While most supervised learning relies on a stationary data distribution provided by a static dataset , reinforcement learning agents have to acquire their training data in an action-perception loop . Since the agent ’ s behavioural policy is learned over time , the data distribution used in optimization undergoes covariate shift . To study how the covariate shift , additional exploration problem and different credit assignment signal influence winning tickets , we mimic the supervised learning case by training agents via supervised policy distillation ( Rusu et al. , 2015 ; Schmitt et al. , 2018 ) . We roll out a pre-trained expert policy and train the student agent by minimizing the KL divergence between the student ’ s and teacher ’ s policies . 1In supervised learning , the pruning mask is often constructed based on an early stopping criterion and the final network . We instead track the best performing agent . Thereby , we reduce noise introduced by unstable learning dynamics and exploit that the agent is trained and evaluated on the same environment . We found that late rewinding to a later checkpoint ( Frankle et al. , 2019 ) is not necessary for obtaining tickets ( SI figure 14 ) . 3 DISENTANGLING TICKET CONTRIBUTIONS IN BC AND DEEP RL . There are two contributing factors to the lottery ticket effect : The IMP-identified binary mask and the preserved initialized weights that remain after pruning ( mask/weights ) . We aim to disentangle the contributions by introducing a set of counterfactual baselines , which modify the original IMP procedure ( figure 1 , middle column ; table 1 ) . A first baseline estimates how much of the performance of the ticket can be attributed to the initial weights , by means of a layer-specific permutation of the weights that remain after masking ( mask/permuted ) . A second , weaker baseline estimates the contribution of the mask , by also permuting the layer-specific masks ( permuted/permuted ) . Finally , we consider the standard random/re-init baseline , which samples random binary masks – discarding layer-specific pruning ratios – and re-initializes all weights at each IMP iteration . Throughout the next sections we use these baselines to analyze and compare the factors that give rise to the lottery ticket effect in different control settings . | This paper investigates the Lottery Ticket hypothesis in the context of deep RL for identification of sparse task representation in low-dimensional control tasks. This is primarily an empirical investigation where several experiments and consequent analysis reveal what a "winning ticket" means in case of policy models or Q function approximators given that Deep RL is prone to gradual distribution shift. The experiments also help to identify how standard magnitude pruning will behave under different environment updates, feedback schedules or initialization dynamics. | SP:f0163ce76f64a095d124ea46dce4fb2337125157 |
Marginal Tail-Adaptive Normalizing Flows | 1 INTRODUCTION . Heavy-tailed distributions are known to occur in various applications in biology , finance , social sciences , and more . Examples for such observations include the length of protein sequences in genomes ( Koonin et al. , 2006 ) , returns of stocks ( Gabaix et al. , 2003 ) , or the size of cities ( Gabaix , 1999 ) . Applications that are tightly connected to typical deep learning applications include the frequency of class examples in image classification ( Horn & Perona , 2017 ) and the frequency of words ( Zipf , 1949 ) in natural language processing . From a theoretical point of view , this is not surprising since heavy-tailed distributions emerge from several circumstances , including the limiting distribution in the generalized central limit theorem , of a multiplicative process , or as the limit of an extremal process ( Nair et al. , 2013 ) . Given the frequency of occurrence , developing generative models that allow to learn heavy-tailed distributions is essential . Normalizing Flows ( NFs ( Rippel & Adams , 2013 ; Tabak & Turner , 2013 ; Dinh et al. , 2015 ; Rezende & Mohamed , 2015 ) ) are a popular class of deep generative models . Despite their success in learning tractable distributions where both sampling and density evaluation can be efficient and exact , their ability to model heavy tailed distributions is known to be limited . Jaini et al . ( 2020 ) identified the problem that a range of NFs ( e.g . vanilla triangular flows with a Gaussian base distribution ) are unable to map a light-tailed distribution to a heavy-tailed distribution . They propose to solve this issue by replacing the Gaussian base distribution by a multivariate t-distribution with one learnable degree of freedom . While this allows to model distributions with a heavy-tailed euclidean norm , we show that modeling multivariate distributions , where some of the marginals are heavy- and some are light-tailed , still poses a problem . Contributions Our contributions in this work , that extend the results of Jaini et al . ( 2020 ) , are the following . First , we prove that a triangular affine NF using a base distribution with solely heavytailed marginals is only able to provide a target distribution with just heavy-tailed marginals as well . Consequently , such a NF is not capable of learning distributions with mixed marginal tail behavior . Second , we derive a result that states conditions under which the marginal tailedness of the base distribution can be preserved . Third , based on these theoretical findings , we propose a novel kind of triangular NF that allows to learn distributions with heavy- and light-tailed marginals . The new model is called marginally Tail-Adaptive Flows ( mTAFs ) , and as illustrated in Figure 1 , combines • estimators from extreme value theory ( Hill , 1975 ; Dekkers et al. , 1989 ; Csorgo et al. , 1985 ) to initially assess heavy-tailedness of the target ’ s marginals ; • a flexible and trainable base distribution based on the estimated tail behavior of the target distribution ; • a new permutation-scheme between flow-layers that ensures the correct tail behavior of the estimated target distribution . Finally , we conduct an experimental analysis demonstrating the superior performance of the proposed mTAFs in comparison to other flow models . Furthermore , we present a new sample generation scheme , motivated by our theory , which successfully generates joint samples that are from the tails of a specified marginal . Notational Conventions In the following , we will denote random variables by bold letters , such as x , and its realisations by non-bold letters , x . We use this notation for multivariate and for univariate random variables . Further , we denote the jth component of x by xj , and x≤j or x < j are the first j or j − 1 components of x , respectively . We denote the random variable representing the base distribution by z and the random variable representing the target distribution by x . Further , for notational convenience , we denote the probability density functions ( PDFs ) of x and z by p and q , whereas marginal PDFs are denoted by pj and qj , respectively . Finally , we assume that both random variables x and z have continuous and positive density on RD , i.e p ( x ) , q ( z ) > 0 for all x , z ∈ RD , where D is the dimensionality of x and z . 2 BACKGROUND . In this section , we give a brief introduction to heavy-tailed distributions and present needed background knowledge about normalizing flows . 2.1 HEAVY-TAILED DISTRIBUTIONS . Heavy-tailed distributions are distributions that have heavier tails ( i.e . decay slower ) than the exponential distribution . Loosely speaking , slowly decaying tails allow to model distributions that generate samples , which differ by a large magnitude from the rest of the samples . For a univariate random variable x we define heavy-tailedness via its moment-generating function1 : Definition 1 ( Heavy-Tailed Random Variables ) . Consider a random variable x ∈ R with PDF p. Then , we say that x is heavy-tailed if and only if ∀λ > 0 : Ex [ eλx ] =∞ . The function mp ( λ ) : = Ex [ exp ( λx ) ] is known as the moment-generating function of x . Random variables that are not heavy-tailed are said to be light-tailed . Note that this definition is , strictly speaking , merely a definition for heavy right tails . We say a random variable x ∈ R has heavy left tails if −x has heavy tails according to Definition 1 . For simplicity of derivations and w.l.o.g. , we proceed with this definition but the derived results can analogously be applied to left tails . We can assess the degree of tailedness of a distribution . While there are many equivalent notions of the so called tail index , the most straight-forward definition is via the existence of moments : Definition 2 ( Tail Index ) . A random variable x ∈ R with PDF p is said to have tail index2 α if it holds that Ex [ |x|β ] { < ∞ , if β < α , =∞ , if β > α . Since the tail index is tightly related to the decay rate of the PDF , it enables us to assess the degree of heavy-tailedness of a random variable . Therefore , estimation of the tail index became an important objective in extreme value theory and statistical risk assessment ( see e.g . Embrechts et al. , 2013 ) . Since the existence of the moment does not depend on the “ body ” of x but only on the tails of x ( see Proposition 3 in Section A.1 in the Appendix ) , estimating the tail index by fitting a full parametric model to all data e.g . via likelihood maximization leads to a biased estimator . Instead , semi-parametric estimators have been developed , which aim to fit a distribution only on the tails . Popular methods for tail estimation include the Hill estimator ( Hill , 1975 ) , the moment estimator ( Dekkers et al. , 1989 ) , and kernel-based estimators ( Csorgo et al. , 1985 ) . In Section B.1 of the Appendix , we discuss these tail estimators and review some practical issues with these . An example of a heavy tailed distribution is the standardized t-distribution , which has parameter ν > 0 referred to as the degree of freedom and a density function given by p ( x ) : = Γ ( ν+1 2 ) √ νπΓ ( ν 2 ) ( 1 + x2 ν ) − ν+12 , x ∈ R , where Γ is the Gamma function . It is known that the t-distribution has tail index ν ( see e.g . Kirkby et al . ( 2019 ) for a detailed reference ) . In the multivariate setting , there exist various definitions of heavy-tailedness . For instance Resnick ( 2004 ) make use of a definition based on multivariate regular variation . Jaini et al . ( 2020 ) define a multivariate random variable x to be heavy-tailed if the ` 2-norm is heavy-tailed , a property which we refer to as ` 2-heavy tailed , and which is formally defined as follows : 1One can readily show that this definition is equivalent to the definition , which compares the tails of x to the tails of an exponential distribution . See Section 1 in Nair et al . ( 2013 ) . 2Notice that the notion of a tail index is only valid for regularly-varying random variables , which are a subclass of heavy-tailed random variables . For the purpose of this work , it is sufficient to consider regularly varying random variables . More details can be found in Nair et al . ( 2013 ) . Definition 3 ( ` 2-Heavy-Tailed ) . Let x ∈ RD be a multivariate random variable . Then , we call x ` 2-heavy-tailed if it holds that ‖x‖ is univariately heavy-tailed according to Definition 1 , where ‖ · ‖ denotes the ` 2-norm . Otherwise , we call x ` 2-light-tailed . 2.2 NORMALIZING FLOWS . The fundamental idea behind NFs is based on the change-of-variables formula for probability density functions ( PDFs ) given in the following theorem . Theorem 1 ( Change-of-Variables ) . Consider random variables x , z ∈ RD and a diffeomorphic map T : RD → RD such that x = T ( z ) . Then , it holds that the PDF of x satisfies p ( x ) = q ( T−1 ( x ) ) ∣∣det JT−1 ( x ) ∣∣ ∀x ∈ RD , ( 1 ) where JT−1 ( x ) is the Jacobian of T−1 evaluated at x ∈ RD . This formula allows us to evaluate the possibly intractable PDF of x if we can evaluate both , the PDF of z and T−1 ( x ) , and efficiently calculate the Jacobian-determinant det JT−1 ( x ) . As T maps z to x , we denote the distribution of z and x as the base and the target distribution , respectively . To model the PDF of x using NFs , it is common to set the base distribution to a standard normal distribution ( i.e. , z ∼ N ( 0 , I ) ) and to employ likelihood maximization to learn a parameterized transformation Tθ : = T ( L ) θ ◦ · · · ◦ T ( 1 ) θ , which , yet , remains tractable and diffeomorphic . Masked autoregressive flows ( MAFs ( Papamakarios et al. , 2017 ) ) are one popular architecture , which employ transformations T = ( T1 , . . . , TD ) > of the form Tj ( z ) : = µj ( z < j ) + exp ( σj ( z < j ) ) zj for j ∈ { 1 , . . . , D } , ( 2 ) where µj and σj are neural networks , which obtain the first j−1 components of z as input and output a scalar . Composing several transformations of the form ( 2 ) , we obtain the MAF . The autoregressive form in ( 2 ) allows us to efficiently evaluate the Jacobian-Determinant due to the diagonal form of JT ( x ) . A crucial issue of such autoregressive models is that a component xj only depends on the previous outputs x < j and , therefore , they can not model a causal relationship in which xj causes xi if i < j . This issue can be solved by applying a permutation before each transformation T ( 1 ) θ , . . . , T ( L ) θ . This is usually a random permutation or the one that reverses the ordering of the components . Therefore , in summary a MAF consists of multiple consecutive layers T ( l ) θ ◦ P ( l ) , where P ( l ) ∈ RD×D is a permutation . MAFs belong to the class of triangular flows , which are defined as flows that consist of diffeomorphisms whose jth output only depends on z≤j . Other examples for triangular flows include RealNVP ( Dinh et al. , 2017 ) , NAF ( Huang et al. , 2018 ) , and SOS ( Jaini et al. , 2019 ) . If the triangular maps are affine linear ( such as in ( 2 ) ) , we call the resulting flow a triangular affine flow . Further types of NFs include invertible ResNets ( Jacobsen et al. , 2018 ; Behrmann et al. , 2019 ; Chen et al. , 2019 ) , continuous flows ( Chen et al. , 2018 ; Grathwohl et al. , 2019 ) , and many more ( Kobyzev et al. , 2020 ) . Tail-Adaptive Flows . Jaini et al . ( 2020 ) investigated the ability of triangular flows to learn heavytailed distributions . The authors have shown that if a triangular affine flow transforms a ` 2-lighttailed distribution , such as the multivariate Gaussian distribution , to a ` 2-heavy-tailed target distribution , then Tθ can not be Lipschitz continuous . And more explicitly , it holds the following . Theorem 2 . ( Jaini et al. , 2020 ) Let z be a ` 2-light-tailed random variable and T be an affine triangular flow such that Tj ( z≤j ) = µj ( z < j ) + σj ( z < j ) zj for all j . If σj is bounded above and µj is Lipschitz for all j , then the transformed variable x is also ` 2-light-tailed . Furthermore , the authors prove that any triangular mapping from an elliptical distribution to a heavier-tailed elliptical distribution must have an unbounded Jacobian-determinant . Clearly , these results illuminate that learning a heavy-tailed distribution using NFs leads to non-Lipschitz transformations and unbounded Jacobians , which inevitably affects training robustness ( Behrmann et al. , 2021 ) . Motivated by these result , Jaini et al . ( 2020 ) propose Tail-Adaptive Flows ( TAF ) , which replace the Gaussian base distribution by a multivariate t-distribution with one learnable degree of freedom . | This paper focuses on understanding the tail behavior of normalizing flows through a mathematical and statistical way. Motivated by Jaini et al 2020's work on learning long-tailed distribution via triangular flows, this work proves that the marginal tailedness can be controlled by the tailedness of the marginals of the base distribution in flow-based models. Based on this theoretical insight, the authors propose a new algorithm by leveraging a data-driven permutation scheme to enable a correct tail behavior of the target distribution. | SP:863551f0ff2b3fc2b24a545a18b9fb4f5e513a9f |
Marginal Tail-Adaptive Normalizing Flows | 1 INTRODUCTION . Heavy-tailed distributions are known to occur in various applications in biology , finance , social sciences , and more . Examples for such observations include the length of protein sequences in genomes ( Koonin et al. , 2006 ) , returns of stocks ( Gabaix et al. , 2003 ) , or the size of cities ( Gabaix , 1999 ) . Applications that are tightly connected to typical deep learning applications include the frequency of class examples in image classification ( Horn & Perona , 2017 ) and the frequency of words ( Zipf , 1949 ) in natural language processing . From a theoretical point of view , this is not surprising since heavy-tailed distributions emerge from several circumstances , including the limiting distribution in the generalized central limit theorem , of a multiplicative process , or as the limit of an extremal process ( Nair et al. , 2013 ) . Given the frequency of occurrence , developing generative models that allow to learn heavy-tailed distributions is essential . Normalizing Flows ( NFs ( Rippel & Adams , 2013 ; Tabak & Turner , 2013 ; Dinh et al. , 2015 ; Rezende & Mohamed , 2015 ) ) are a popular class of deep generative models . Despite their success in learning tractable distributions where both sampling and density evaluation can be efficient and exact , their ability to model heavy tailed distributions is known to be limited . Jaini et al . ( 2020 ) identified the problem that a range of NFs ( e.g . vanilla triangular flows with a Gaussian base distribution ) are unable to map a light-tailed distribution to a heavy-tailed distribution . They propose to solve this issue by replacing the Gaussian base distribution by a multivariate t-distribution with one learnable degree of freedom . While this allows to model distributions with a heavy-tailed euclidean norm , we show that modeling multivariate distributions , where some of the marginals are heavy- and some are light-tailed , still poses a problem . Contributions Our contributions in this work , that extend the results of Jaini et al . ( 2020 ) , are the following . First , we prove that a triangular affine NF using a base distribution with solely heavytailed marginals is only able to provide a target distribution with just heavy-tailed marginals as well . Consequently , such a NF is not capable of learning distributions with mixed marginal tail behavior . Second , we derive a result that states conditions under which the marginal tailedness of the base distribution can be preserved . Third , based on these theoretical findings , we propose a novel kind of triangular NF that allows to learn distributions with heavy- and light-tailed marginals . The new model is called marginally Tail-Adaptive Flows ( mTAFs ) , and as illustrated in Figure 1 , combines • estimators from extreme value theory ( Hill , 1975 ; Dekkers et al. , 1989 ; Csorgo et al. , 1985 ) to initially assess heavy-tailedness of the target ’ s marginals ; • a flexible and trainable base distribution based on the estimated tail behavior of the target distribution ; • a new permutation-scheme between flow-layers that ensures the correct tail behavior of the estimated target distribution . Finally , we conduct an experimental analysis demonstrating the superior performance of the proposed mTAFs in comparison to other flow models . Furthermore , we present a new sample generation scheme , motivated by our theory , which successfully generates joint samples that are from the tails of a specified marginal . Notational Conventions In the following , we will denote random variables by bold letters , such as x , and its realisations by non-bold letters , x . We use this notation for multivariate and for univariate random variables . Further , we denote the jth component of x by xj , and x≤j or x < j are the first j or j − 1 components of x , respectively . We denote the random variable representing the base distribution by z and the random variable representing the target distribution by x . Further , for notational convenience , we denote the probability density functions ( PDFs ) of x and z by p and q , whereas marginal PDFs are denoted by pj and qj , respectively . Finally , we assume that both random variables x and z have continuous and positive density on RD , i.e p ( x ) , q ( z ) > 0 for all x , z ∈ RD , where D is the dimensionality of x and z . 2 BACKGROUND . In this section , we give a brief introduction to heavy-tailed distributions and present needed background knowledge about normalizing flows . 2.1 HEAVY-TAILED DISTRIBUTIONS . Heavy-tailed distributions are distributions that have heavier tails ( i.e . decay slower ) than the exponential distribution . Loosely speaking , slowly decaying tails allow to model distributions that generate samples , which differ by a large magnitude from the rest of the samples . For a univariate random variable x we define heavy-tailedness via its moment-generating function1 : Definition 1 ( Heavy-Tailed Random Variables ) . Consider a random variable x ∈ R with PDF p. Then , we say that x is heavy-tailed if and only if ∀λ > 0 : Ex [ eλx ] =∞ . The function mp ( λ ) : = Ex [ exp ( λx ) ] is known as the moment-generating function of x . Random variables that are not heavy-tailed are said to be light-tailed . Note that this definition is , strictly speaking , merely a definition for heavy right tails . We say a random variable x ∈ R has heavy left tails if −x has heavy tails according to Definition 1 . For simplicity of derivations and w.l.o.g. , we proceed with this definition but the derived results can analogously be applied to left tails . We can assess the degree of tailedness of a distribution . While there are many equivalent notions of the so called tail index , the most straight-forward definition is via the existence of moments : Definition 2 ( Tail Index ) . A random variable x ∈ R with PDF p is said to have tail index2 α if it holds that Ex [ |x|β ] { < ∞ , if β < α , =∞ , if β > α . Since the tail index is tightly related to the decay rate of the PDF , it enables us to assess the degree of heavy-tailedness of a random variable . Therefore , estimation of the tail index became an important objective in extreme value theory and statistical risk assessment ( see e.g . Embrechts et al. , 2013 ) . Since the existence of the moment does not depend on the “ body ” of x but only on the tails of x ( see Proposition 3 in Section A.1 in the Appendix ) , estimating the tail index by fitting a full parametric model to all data e.g . via likelihood maximization leads to a biased estimator . Instead , semi-parametric estimators have been developed , which aim to fit a distribution only on the tails . Popular methods for tail estimation include the Hill estimator ( Hill , 1975 ) , the moment estimator ( Dekkers et al. , 1989 ) , and kernel-based estimators ( Csorgo et al. , 1985 ) . In Section B.1 of the Appendix , we discuss these tail estimators and review some practical issues with these . An example of a heavy tailed distribution is the standardized t-distribution , which has parameter ν > 0 referred to as the degree of freedom and a density function given by p ( x ) : = Γ ( ν+1 2 ) √ νπΓ ( ν 2 ) ( 1 + x2 ν ) − ν+12 , x ∈ R , where Γ is the Gamma function . It is known that the t-distribution has tail index ν ( see e.g . Kirkby et al . ( 2019 ) for a detailed reference ) . In the multivariate setting , there exist various definitions of heavy-tailedness . For instance Resnick ( 2004 ) make use of a definition based on multivariate regular variation . Jaini et al . ( 2020 ) define a multivariate random variable x to be heavy-tailed if the ` 2-norm is heavy-tailed , a property which we refer to as ` 2-heavy tailed , and which is formally defined as follows : 1One can readily show that this definition is equivalent to the definition , which compares the tails of x to the tails of an exponential distribution . See Section 1 in Nair et al . ( 2013 ) . 2Notice that the notion of a tail index is only valid for regularly-varying random variables , which are a subclass of heavy-tailed random variables . For the purpose of this work , it is sufficient to consider regularly varying random variables . More details can be found in Nair et al . ( 2013 ) . Definition 3 ( ` 2-Heavy-Tailed ) . Let x ∈ RD be a multivariate random variable . Then , we call x ` 2-heavy-tailed if it holds that ‖x‖ is univariately heavy-tailed according to Definition 1 , where ‖ · ‖ denotes the ` 2-norm . Otherwise , we call x ` 2-light-tailed . 2.2 NORMALIZING FLOWS . The fundamental idea behind NFs is based on the change-of-variables formula for probability density functions ( PDFs ) given in the following theorem . Theorem 1 ( Change-of-Variables ) . Consider random variables x , z ∈ RD and a diffeomorphic map T : RD → RD such that x = T ( z ) . Then , it holds that the PDF of x satisfies p ( x ) = q ( T−1 ( x ) ) ∣∣det JT−1 ( x ) ∣∣ ∀x ∈ RD , ( 1 ) where JT−1 ( x ) is the Jacobian of T−1 evaluated at x ∈ RD . This formula allows us to evaluate the possibly intractable PDF of x if we can evaluate both , the PDF of z and T−1 ( x ) , and efficiently calculate the Jacobian-determinant det JT−1 ( x ) . As T maps z to x , we denote the distribution of z and x as the base and the target distribution , respectively . To model the PDF of x using NFs , it is common to set the base distribution to a standard normal distribution ( i.e. , z ∼ N ( 0 , I ) ) and to employ likelihood maximization to learn a parameterized transformation Tθ : = T ( L ) θ ◦ · · · ◦ T ( 1 ) θ , which , yet , remains tractable and diffeomorphic . Masked autoregressive flows ( MAFs ( Papamakarios et al. , 2017 ) ) are one popular architecture , which employ transformations T = ( T1 , . . . , TD ) > of the form Tj ( z ) : = µj ( z < j ) + exp ( σj ( z < j ) ) zj for j ∈ { 1 , . . . , D } , ( 2 ) where µj and σj are neural networks , which obtain the first j−1 components of z as input and output a scalar . Composing several transformations of the form ( 2 ) , we obtain the MAF . The autoregressive form in ( 2 ) allows us to efficiently evaluate the Jacobian-Determinant due to the diagonal form of JT ( x ) . A crucial issue of such autoregressive models is that a component xj only depends on the previous outputs x < j and , therefore , they can not model a causal relationship in which xj causes xi if i < j . This issue can be solved by applying a permutation before each transformation T ( 1 ) θ , . . . , T ( L ) θ . This is usually a random permutation or the one that reverses the ordering of the components . Therefore , in summary a MAF consists of multiple consecutive layers T ( l ) θ ◦ P ( l ) , where P ( l ) ∈ RD×D is a permutation . MAFs belong to the class of triangular flows , which are defined as flows that consist of diffeomorphisms whose jth output only depends on z≤j . Other examples for triangular flows include RealNVP ( Dinh et al. , 2017 ) , NAF ( Huang et al. , 2018 ) , and SOS ( Jaini et al. , 2019 ) . If the triangular maps are affine linear ( such as in ( 2 ) ) , we call the resulting flow a triangular affine flow . Further types of NFs include invertible ResNets ( Jacobsen et al. , 2018 ; Behrmann et al. , 2019 ; Chen et al. , 2019 ) , continuous flows ( Chen et al. , 2018 ; Grathwohl et al. , 2019 ) , and many more ( Kobyzev et al. , 2020 ) . Tail-Adaptive Flows . Jaini et al . ( 2020 ) investigated the ability of triangular flows to learn heavytailed distributions . The authors have shown that if a triangular affine flow transforms a ` 2-lighttailed distribution , such as the multivariate Gaussian distribution , to a ` 2-heavy-tailed target distribution , then Tθ can not be Lipschitz continuous . And more explicitly , it holds the following . Theorem 2 . ( Jaini et al. , 2020 ) Let z be a ` 2-light-tailed random variable and T be an affine triangular flow such that Tj ( z≤j ) = µj ( z < j ) + σj ( z < j ) zj for all j . If σj is bounded above and µj is Lipschitz for all j , then the transformed variable x is also ` 2-light-tailed . Furthermore , the authors prove that any triangular mapping from an elliptical distribution to a heavier-tailed elliptical distribution must have an unbounded Jacobian-determinant . Clearly , these results illuminate that learning a heavy-tailed distribution using NFs leads to non-Lipschitz transformations and unbounded Jacobians , which inevitably affects training robustness ( Behrmann et al. , 2021 ) . Motivated by these result , Jaini et al . ( 2020 ) propose Tail-Adaptive Flows ( TAF ) , which replace the Gaussian base distribution by a multivariate t-distribution with one learnable degree of freedom . | The paper proposes an extension to Tail-adaptive flows for learning the tail behavior of target distributions using normalizing flows. The authors propose to learn the tail behavior by learning flows that match the tail properties of the marginal distributions. They achieve this by using a source distribution consisting of marginal distributions with tail properties matching the target distribution. The tail coefficient of the source distribution is set in a data-driven manner using estimators that can estimate this tail coefficient. | SP:863551f0ff2b3fc2b24a545a18b9fb4f5e513a9f |
Shift-tolerant Perceptual Similarity Metric | 1 INTRODUCTION . Image similarity measurement is a common task for many computer vision and computer graphics applications . General similarity metrics like PSNR and RMSE , however , do not match the human visual perception well when assessing the similarity between two images . Therefore , many dedicated image similarity metrics , such as Structural Similarity ( SSIM ) and its variations ( Wang et al. , 2004 ; 2003 ; Zhang et al. , 2011 ; Wang & Simoncelli , 2005 ) , were developed in order to more closely reflect the human perception . However , manually crafting a perceptual similarity metric remains a challenging task as it involves the complex human cognitive judgement ( Medin et al. , 1993 ; Tversky , 1977 ; Wang et al. , 2004 ; Zhang et al. , 2018 ) . I0 Iref I1 Recently , learning-based image similarity metrics have been developed . These metrics learn from a large set of labelled data and predict the similarity between images that correlates well with human perception ( Bhardwaj et al. , 2020 ; Ding et al. , 2020 ; Kettunen et al. , 2019 ; Prashnani et al. , 2018 ; Zhang et al. , 2018 ; Czolbe et al. , 2020 ) . Among them , the Learned Perceptual Image Patch Similarity metric ( LPIPS ) by Zhang et al . ( 2018 ) is now widely adopted as a perceptual similarity metric and used in computer graphics and vision literature . This paper studies how image similarity metrics work on a pair of images that are not perfectly aligned . For instance , a tiny misalignment in the image pair such as a one-pixel translation between them , is imperceptible to the human eyes . But , will such a visually imperceptible misalignment compromise any existing similarity metrics ? For PSNR and RMSE , since they assume pixel-wise registration , naturally they are sensitive to as small as a one-pixel misalignment . As we will detail in this paper , our study found that the learned perceptual similarity metrics , such as LPIPS , are also sensitive to a small misalignment . Figure 1 shows such an example through a two-alternative forced choice test . In this test , viewers were asked “ which of the two distorted images , I0 or I1 , is more similar to the reference image Iref ? ” Then , we shifted I0 and I1 by one pixel and obtained their opinions again . None of 1We will make our code and data publicly available . the participants flipped their opinions from I0 to I1 or vice versa , which is intuitive as a one-pixel shift is imperceptible to viewers . But existing metrics , such as MS-SSIM and LPIPS , flipped their judgments after the one-pixel shift . Our problem is related to the recent work on making deep neural networks shift invariant ( Islam et al. , 2020 ; Kayhan & Gemert , 2020 ; Vasconcelos et al. , 2021 ; Zhang , 2019 ; Zou et al. , 2020 ; Lee et al. , 2020 ) . In a recent study , Azulay & Weiss ( 2019 ) found that an image classifier can change its top-1 prediction if the image is translated by only one pixel . Their results showed that after translating an image by one pixel , the classifier made a different top-1 prediction for 30 % of the 1000 validation images . Zhang ( 2019 ) introduced anti-aliasing filters into a deep neural network to make the feature extraction network shift-equivariant , which in term makes the whole network shift-invariant for the down streaming tasks . Compared to these works , our problem is different in that 1 ) a perceptual similarity metric takes two images as input instead of working on a single input image , and 2 ) only one of the two images is shifted , thus introducing imperceptible misalignment instead of shifting the two images simultaneously . This paper aims to develop a shift-tolerant perceptual similarity metric that correlates well with the human judgement on the similarity between images while being robust against imperceptible misalignment between them . We build our metric upon LPIPS , a deep neural network-based metric that is now widely adopted for its close correlation with the human perception . We investigate a variety of elements that can be incorporated into a deep neural network to make it resistant to an imperceptible misalignment . These elements include anti-aliasing filters , striding , pooling , padding , placement of anti aliasing , etc . Based on our findings on these elements , we develop a shift-tolerant perceptual similarity metric that not only is more consistent with human perception but also is significantly more resistant to imperceptible misalignment between a pair of images than existing metrics . In the remainder of this paper , we first report our study that verifies that viewers are not sensitive to small amount of shifts between two images when comparing them , in Section 3 . We then benchmark existing visual similarity metrics and show that these metrics are sensitive to imperceptible shifts between a pair of images in Section 4 . We then study several important elements that make a deep neural network-based similarity metric both tolerant to imperceptible shifts and consistent with the human perception of visual similarity in Section 5 . We finally report our experiments that thoroughly evaluate our new perceptual similarity metric by comparing it to state of the art metrics and through detailed ablation studies in Section 6 . 2 RELATED WORK . Visual similarity metrics are commonly used to compare two images or evaluate the performance of many image and video processing , editing and synthesis algorithms . While there are already many established metrics for these tasks , such as PSNR , MSE , SSIM and its variations ( Wang et al. , 2004 ; 2003 ; Wang & Simoncelli , 2005 ) , there is still a gap between their prediction and the human ’ s judgement . This section provides a brief overview of the recent advances in learned perceptual similarity metrics that aim to bridge the gap mentioned above . In their influential work , Zhang et al . ( 2018 ) reported that features from a deep neural network can be used to measure the similarity between two images that is more consistent with the human perception than other commonly used metrics . Accordingly , they developed LPIPS , a perceptual metric learned from a large collection of labelled data . Specifically , LPIPS uses a pre-trained network for image classification tasks or learns a neural network to compute the features for each of the two images or patches , and also learns to aggregate the feature distances into a similarity score . Since its debut , LPIPS has been widely used as a perceptual quality metric . On a related note , the computer vision and graphics community also calculate the difference between the deep features of two images as a loss function to train deep neural networks for image enhancement and synthesis . Such a loss function , often called perceptual loss , enables the neural networks to learn to generate perceptually pleasing images ( Dosovitskiy & Brox , 2016 ; Johnson et al. , 2016 ; Ledig et al. , 2016 ; Niklaus et al. , 2017 ; Sajjadi et al. , 2016 ; Zhu et al. , 2016 ) . Kettunen et al . ( 2019 ) developed the E-LPIPS metric that adopts the LPIPS network and uses randomly transformed samples to calculate expected LPIPS distance over them . They showed that ELPIPS is robust against the Expectation Over Transformation attack ( Athalye et al. , 2018 ) . Different from LPIPS , Prashnani et al . ( 2018 ) use the differences between features to generate patch-wise errors and corresponding weights , via two different fully-connected networks . Their final similarity score is a weighted average of the patch-wise distances . Czolbe et al . ( 2020 ) developed a similarity metric based on Watson ’ s perceptual model ( Watson , 1993 ) , by replacing discrete cosine transform with discrete fourier transform ( DFT ) . They posit that their metric is robust against small translations and is sensitive to large translations . Czolbe et al . ( 2020 ) used Watson-DFT as a differentiable loss function for image generation via variational autoencoders ( Kingma & Welling , 2013 ) . In earlier work , Wang & Simoncelli ( 2005 ) improved SSIM ( Wang et al. , 2004 ) by replacing the spatial correlation measures with phase correlations in wavelet subbands which made the metric less sensitive to geometric transformations . Ma et al . ( 2018 ) developed a geometric transformation invariant method ( GTI-CNN ) . Our work is closely related to theirs , as GTI-CNN is a similarity metric that is invariant to the misalignment between a pair of images . In their method , Ma et al . ( 2018 ) train a fully convolutional neural network to extract deep features from each image and calculate the mean squared error between them as their final similarity . They showed that training the fully convolutional neural network directly on aligned samples leads to a metric that is sensitive to the misalignment , which is consistent with what we found in our study . They reported that augmenting the training samples with small misalignment can make the learned metric significantly more resistant to the misalignment . Compared to this method , our work focuses on designing a deep neural network architecture that is robust to misalignment without any data augmentation . Bhardwaj et al . ( 2020 ) followed the understanding of the physiology of the human visual system and developed a fully convolutional neural network that generates a multi-scale probabilistic representation of an input image and then calculates the symmetric Kullback–Leibler divergences between such representations of two images to measure their similarity . They found that such a similarity metric is robust against small shifts between a pair of images . While benchmarking existing metrics , our study also finds that their metric is most robust against small shifts among all the metrics we tested . We posit that the robustness of their method partially comes from training their metric on neighboring video frames that might already have small shifts among them , thus effectively serving as data augmentation , as done by Ma et al . ( 2018 ) . We consider these as orthogonal efforts in developing a robust similarity metric . Also , as shown in our study , our metric is more consistent with the human judgement and more robust against imperceptible misalignment than these methods , even though our metric is trained on aligned samples directly without any data augmentation . Our work is most related to deep image structure and texture similarity ( DISTS ) metric by Ding et al . ( 2020 ) . They used global feature aggregation to make DISTS robust against mild geometric transformations . They also replaced the max pooling layers with l2 pooling layers ( Hénaff & Simoncelli , 2016 ) in their VGG backbone network for anti-aliasing and found that blurring the input with l2 pooling makes their network more robust against small shifts . Gu et al . ( 2020 ) found that existing metrics like LPIPS do not perform well with images generated by GAN-based restoration algorithms . They attributed it to the small misalignment between the GAN results and the ground truth . Therefore , they used l2 pooling ( Ding et al. , 2020 ; Hénaff & Simoncelli , 2016 ) and BlurPool ( Zhang , 2019 ) to improve LPIPS . They found that both can improve LPIPS while BlurPool performs better . Compared to these two recent papers , our paper systematically investigates a broad range of neural network elements besides BlurPool . By integrating these elements together , we develop a perceptual similarity metric that is both robust against small shifts and is consistent with the human visual similarity judgement . Our method outperforms existing metrics , and a variety of recently developed learned metrics . Integrating multiple network elements together makes our metric better than individual ones , including BlurPool . | The paper proposes a few modifications to the existing archiectures for perceptual image similarity that would be robust to the tiny shifts in the image. Specifically, the authors conduct an experiemnt that shows that humans mostly are not sensetive to small shifts of 1 or 2 pixels (Table 1), but most state of the art perceptual image similarity networks are sensetive to such shifts (Table 1 and Table 2). The authors discuss what parts of the network architecture might yield such sensetivity and offer a few modifications (Section 5). In Section 6, the authors perform extensive experiments to check the effectiveness of their suggestions. Finally the authors conclude that using anti-aliasing strided convolutions and pooling operators and reducing stride size are helpful to make a learned similarity metric shift-invariant. Their experiments show that by integrating these elements into a neural network, the learned metric is more robust against imperceptible shifts and more consistent with the human visual similarity judgment (Table 1,2,3) . | SP:a4f1727f7c84e23cf683786fc4e3be3f066c76d9 |
Shift-tolerant Perceptual Similarity Metric | 1 INTRODUCTION . Image similarity measurement is a common task for many computer vision and computer graphics applications . General similarity metrics like PSNR and RMSE , however , do not match the human visual perception well when assessing the similarity between two images . Therefore , many dedicated image similarity metrics , such as Structural Similarity ( SSIM ) and its variations ( Wang et al. , 2004 ; 2003 ; Zhang et al. , 2011 ; Wang & Simoncelli , 2005 ) , were developed in order to more closely reflect the human perception . However , manually crafting a perceptual similarity metric remains a challenging task as it involves the complex human cognitive judgement ( Medin et al. , 1993 ; Tversky , 1977 ; Wang et al. , 2004 ; Zhang et al. , 2018 ) . I0 Iref I1 Recently , learning-based image similarity metrics have been developed . These metrics learn from a large set of labelled data and predict the similarity between images that correlates well with human perception ( Bhardwaj et al. , 2020 ; Ding et al. , 2020 ; Kettunen et al. , 2019 ; Prashnani et al. , 2018 ; Zhang et al. , 2018 ; Czolbe et al. , 2020 ) . Among them , the Learned Perceptual Image Patch Similarity metric ( LPIPS ) by Zhang et al . ( 2018 ) is now widely adopted as a perceptual similarity metric and used in computer graphics and vision literature . This paper studies how image similarity metrics work on a pair of images that are not perfectly aligned . For instance , a tiny misalignment in the image pair such as a one-pixel translation between them , is imperceptible to the human eyes . But , will such a visually imperceptible misalignment compromise any existing similarity metrics ? For PSNR and RMSE , since they assume pixel-wise registration , naturally they are sensitive to as small as a one-pixel misalignment . As we will detail in this paper , our study found that the learned perceptual similarity metrics , such as LPIPS , are also sensitive to a small misalignment . Figure 1 shows such an example through a two-alternative forced choice test . In this test , viewers were asked “ which of the two distorted images , I0 or I1 , is more similar to the reference image Iref ? ” Then , we shifted I0 and I1 by one pixel and obtained their opinions again . None of 1We will make our code and data publicly available . the participants flipped their opinions from I0 to I1 or vice versa , which is intuitive as a one-pixel shift is imperceptible to viewers . But existing metrics , such as MS-SSIM and LPIPS , flipped their judgments after the one-pixel shift . Our problem is related to the recent work on making deep neural networks shift invariant ( Islam et al. , 2020 ; Kayhan & Gemert , 2020 ; Vasconcelos et al. , 2021 ; Zhang , 2019 ; Zou et al. , 2020 ; Lee et al. , 2020 ) . In a recent study , Azulay & Weiss ( 2019 ) found that an image classifier can change its top-1 prediction if the image is translated by only one pixel . Their results showed that after translating an image by one pixel , the classifier made a different top-1 prediction for 30 % of the 1000 validation images . Zhang ( 2019 ) introduced anti-aliasing filters into a deep neural network to make the feature extraction network shift-equivariant , which in term makes the whole network shift-invariant for the down streaming tasks . Compared to these works , our problem is different in that 1 ) a perceptual similarity metric takes two images as input instead of working on a single input image , and 2 ) only one of the two images is shifted , thus introducing imperceptible misalignment instead of shifting the two images simultaneously . This paper aims to develop a shift-tolerant perceptual similarity metric that correlates well with the human judgement on the similarity between images while being robust against imperceptible misalignment between them . We build our metric upon LPIPS , a deep neural network-based metric that is now widely adopted for its close correlation with the human perception . We investigate a variety of elements that can be incorporated into a deep neural network to make it resistant to an imperceptible misalignment . These elements include anti-aliasing filters , striding , pooling , padding , placement of anti aliasing , etc . Based on our findings on these elements , we develop a shift-tolerant perceptual similarity metric that not only is more consistent with human perception but also is significantly more resistant to imperceptible misalignment between a pair of images than existing metrics . In the remainder of this paper , we first report our study that verifies that viewers are not sensitive to small amount of shifts between two images when comparing them , in Section 3 . We then benchmark existing visual similarity metrics and show that these metrics are sensitive to imperceptible shifts between a pair of images in Section 4 . We then study several important elements that make a deep neural network-based similarity metric both tolerant to imperceptible shifts and consistent with the human perception of visual similarity in Section 5 . We finally report our experiments that thoroughly evaluate our new perceptual similarity metric by comparing it to state of the art metrics and through detailed ablation studies in Section 6 . 2 RELATED WORK . Visual similarity metrics are commonly used to compare two images or evaluate the performance of many image and video processing , editing and synthesis algorithms . While there are already many established metrics for these tasks , such as PSNR , MSE , SSIM and its variations ( Wang et al. , 2004 ; 2003 ; Wang & Simoncelli , 2005 ) , there is still a gap between their prediction and the human ’ s judgement . This section provides a brief overview of the recent advances in learned perceptual similarity metrics that aim to bridge the gap mentioned above . In their influential work , Zhang et al . ( 2018 ) reported that features from a deep neural network can be used to measure the similarity between two images that is more consistent with the human perception than other commonly used metrics . Accordingly , they developed LPIPS , a perceptual metric learned from a large collection of labelled data . Specifically , LPIPS uses a pre-trained network for image classification tasks or learns a neural network to compute the features for each of the two images or patches , and also learns to aggregate the feature distances into a similarity score . Since its debut , LPIPS has been widely used as a perceptual quality metric . On a related note , the computer vision and graphics community also calculate the difference between the deep features of two images as a loss function to train deep neural networks for image enhancement and synthesis . Such a loss function , often called perceptual loss , enables the neural networks to learn to generate perceptually pleasing images ( Dosovitskiy & Brox , 2016 ; Johnson et al. , 2016 ; Ledig et al. , 2016 ; Niklaus et al. , 2017 ; Sajjadi et al. , 2016 ; Zhu et al. , 2016 ) . Kettunen et al . ( 2019 ) developed the E-LPIPS metric that adopts the LPIPS network and uses randomly transformed samples to calculate expected LPIPS distance over them . They showed that ELPIPS is robust against the Expectation Over Transformation attack ( Athalye et al. , 2018 ) . Different from LPIPS , Prashnani et al . ( 2018 ) use the differences between features to generate patch-wise errors and corresponding weights , via two different fully-connected networks . Their final similarity score is a weighted average of the patch-wise distances . Czolbe et al . ( 2020 ) developed a similarity metric based on Watson ’ s perceptual model ( Watson , 1993 ) , by replacing discrete cosine transform with discrete fourier transform ( DFT ) . They posit that their metric is robust against small translations and is sensitive to large translations . Czolbe et al . ( 2020 ) used Watson-DFT as a differentiable loss function for image generation via variational autoencoders ( Kingma & Welling , 2013 ) . In earlier work , Wang & Simoncelli ( 2005 ) improved SSIM ( Wang et al. , 2004 ) by replacing the spatial correlation measures with phase correlations in wavelet subbands which made the metric less sensitive to geometric transformations . Ma et al . ( 2018 ) developed a geometric transformation invariant method ( GTI-CNN ) . Our work is closely related to theirs , as GTI-CNN is a similarity metric that is invariant to the misalignment between a pair of images . In their method , Ma et al . ( 2018 ) train a fully convolutional neural network to extract deep features from each image and calculate the mean squared error between them as their final similarity . They showed that training the fully convolutional neural network directly on aligned samples leads to a metric that is sensitive to the misalignment , which is consistent with what we found in our study . They reported that augmenting the training samples with small misalignment can make the learned metric significantly more resistant to the misalignment . Compared to this method , our work focuses on designing a deep neural network architecture that is robust to misalignment without any data augmentation . Bhardwaj et al . ( 2020 ) followed the understanding of the physiology of the human visual system and developed a fully convolutional neural network that generates a multi-scale probabilistic representation of an input image and then calculates the symmetric Kullback–Leibler divergences between such representations of two images to measure their similarity . They found that such a similarity metric is robust against small shifts between a pair of images . While benchmarking existing metrics , our study also finds that their metric is most robust against small shifts among all the metrics we tested . We posit that the robustness of their method partially comes from training their metric on neighboring video frames that might already have small shifts among them , thus effectively serving as data augmentation , as done by Ma et al . ( 2018 ) . We consider these as orthogonal efforts in developing a robust similarity metric . Also , as shown in our study , our metric is more consistent with the human judgement and more robust against imperceptible misalignment than these methods , even though our metric is trained on aligned samples directly without any data augmentation . Our work is most related to deep image structure and texture similarity ( DISTS ) metric by Ding et al . ( 2020 ) . They used global feature aggregation to make DISTS robust against mild geometric transformations . They also replaced the max pooling layers with l2 pooling layers ( Hénaff & Simoncelli , 2016 ) in their VGG backbone network for anti-aliasing and found that blurring the input with l2 pooling makes their network more robust against small shifts . Gu et al . ( 2020 ) found that existing metrics like LPIPS do not perform well with images generated by GAN-based restoration algorithms . They attributed it to the small misalignment between the GAN results and the ground truth . Therefore , they used l2 pooling ( Ding et al. , 2020 ; Hénaff & Simoncelli , 2016 ) and BlurPool ( Zhang , 2019 ) to improve LPIPS . They found that both can improve LPIPS while BlurPool performs better . Compared to these two recent papers , our paper systematically investigates a broad range of neural network elements besides BlurPool . By integrating these elements together , we develop a perceptual similarity metric that is both robust against small shifts and is consistent with the human visual similarity judgement . Our method outperforms existing metrics , and a variety of recently developed learned metrics . Integrating multiple network elements together makes our metric better than individual ones , including BlurPool . | The authors propose to make perceptual similarity metrics (PSM) invariant to small-shifts (few pixels translation) and still consistent with human judgement. To this end, they use an approach based on network architectures to evaluate which elements (anti-aliasing, pooling, striding, padding, skip connection) can achieve shift-invariance. The paper have multiple contributions: 1. A study on the human perception of small shift estimating their sensitivity 2. A study of the sensitivity of PSMs to small shift 3. A systematic study of neural network architecture elements in relation to shift-invariance 4. A updated/shift-invariant version of the LPIPS metric 5. An ablation study to evaluate which elements contribute or to shift-invariance | SP:a4f1727f7c84e23cf683786fc4e3be3f066c76d9 |
An Effective GCN-based Hierarchical Multi-label classification for Protein Function Prediction | 1 INTRODUCTION . Protein Function Prediction ( PFP ) is one of the key challenges in the post-genomic era ( Zhou et al. , 2019 ; Li et al. , 2018 ) . With large numbers of genomes being sequenced every year , the number of novel proteins being discovered is expanding as well ( Spalević et al. , 2020 ) . On the other side , protein functions are reliably determined in wet-lab experiments which are cumbersome and highcost . As a result , the number of novel protein sequences without function annotations is rapidly expanding . In fact , UniRef100 ( Consortium , 2019 ) contains over 220M ( million ) protein sequences of which less than 1M have function annotations proved by experiments ( Littmann et al. , 2021 ) . Fast and accurate PFP is especially important in biomedical and pharmaceutical applications which are associated with specific protein functions . Protein functions are defined by Gene Ontology ( GO ) composed of a directed acyclic graph ( DAG ) ( Ashburner et al. , 2000 ) . There are three GO domains : Molecular Function Ontology ( MFO ) , Biological Process Ontology ( BPO ) , and Cellular Component Ontology ( CCO ) , where each node represents one function called GO term , and each edge represents a hierarchical relation between two GO terms , such as ’ is a ’ , ’ part of ’ , and etc . Since one protein is usually represented by multiple function annotations , PFP can be regarded as hierarchical multi-label classification ( HMC ) . There are two groups of existing approaches for PFP : local approaches and global approaches . Local approaches usually constructed a classifier for each label ( GO term ) or for a few labels of the same hierarchy level ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ; Rifaioglu et al. , 2019 ) . On the other hand , global approaches constructed a single classifier for multiple labels . The initial global approaches considered PFP to flat multi-label classification , ignoring the hierarchical structure of GO , and considering each label independently ( Kulmanov & Hoehndorf , 2020 ) . Recent global approaches have constructed a structure encoder to learn the correlation among labels ( Zhou et al. , 2020 ; Cao & Shen , 2021 ) . However , these results showed that existing global approach-based models had limitations in representing correlations between GO terms by learning a large-scale hierarchical graph of GO . One of the structure encoders in global approach-based models used Graph Convolutional Network ( GCN ) . GCN has been applied in learning representation of node features . Nevertheless , in the case of applying GCN to a large-scale hierarchical graph , it was difficult to obtain information among long-distance ( Chen et al. , 2019 ; Zeng et al. , 2021 ) and unable to obtain adequate structure information since adjacent nodes did not contain any hierarchical features ( Hu et al. , 2019 ) . To overcome these shortcomings , we build node-wise representations containing the whole hierarchical information , which is involved relationship between long-distance nodes and structure information . In this paper , we propose a novel PFP model that combines a pre-trained Language Model ( LM ) and GCN-based model including new node-wise representations . A pre-trained LM as a sequence encoder ( Littmann et al. , 2021 ) extracts general ad helpful sequence features . GCN-based model as a structure encoder blends hierarchical information into a graph representation to improve GCN performance in a large-scale hierarchical graph of GO . To predict the probability of each GO term representing target protein functions , the prediction layer is constructed as a dot product of outputs of two encoders . The experimental results show that our method achieves performance improvement compared to the-state-of-the art models , especially in the most difficult BPO . 2 RELATED WORK . 2.1 PROTEIN SEQUENCE FEATURE EXTRACTION . Protein sequences contain multiple biophysical features related to function and structure . Initially , protein biophysical features such as motifs , sequence profiles , and secondary structures were calculated from a suite of programs and then utilized as protein sequence feature vectors by combining them ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ; Rifaioglu et al. , 2019 ) . While these methods intuitively utilized the relationship between protein features and its biological functions , it required deep knowledge of proteomics and had high-cost . Various deep learning architectures that extract high-level biophysical features of protein sequences have been proposed . Convolutional Neural Network ( CNN ) is one of the architectures as a sequence encoder to learn sequence patterns or motifs that are related to functions ( Xu et al. , 2020 ) . Therefore , 1D CNN was utilized as effective sequence encoder in previous researches ( Kulmanov & Hoehndorf , 2020 ; Zhou et al. , 2020 ; Kulmanov et al. , 2018 ) . With the advent of transformers ( Vaswani et al. , 2017 ) , which is attention-based model , in Natural Language Processing ( NLP ) , various attention-based LMs were applied to protein sequence embedding ( Rao et al. , 2019 ; Vig et al. , 2020 ; Rives et al. , 2021 ; Heinzinger et al. , 2019 ; Elnaggar et al. , 2020 ) . As protein sequences can be considered as sentences , these learned the relationship between amino acids constituting the sequence and learned contextual information . SeqVec ( Heinzinger et al. , 2019 ) and ProtBert ( Elnaggar et al. , 2020 ) , which were learned protein sequences using ElMo ( Peters et al. , 2018 ) and BERT ( Devlin et al. , 2018 ) , showed that these mostly extracted biophysical features of protein structures and functions , such as secondary structures , binding sites , and homology detections . 2.2 PROTEIN FUNCTION PREDICTION ( PFP ) . PFP methods can be categorized into two different approaches which are local and global . Local approaches commonly employed single or few multi-label classifiers to each or few GO terms . These approaches included FFpred ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ) and DEEPred ( Rifaioglu et al. , 2019 ) . FFpred predicted one GO term by multiple Support Vector Machines ( SVMs ) trained with radial basis function kernels to recognize protein sequence patterns associated with the GO term ( Cozzetto et al. , 2016 ) . DEEPred created a multi-label classification model using deep neural network for each GO hierarchical level ( Rifaioglu et al. , 2019 ) . Each model could carry out five GO terms in most labels . Even though this procedure generated 1,101 different models concerning all GO domains , this still needed numerous models for PFP ( Rifaioglu et al. , 2019 ) . Ultimately , local approaches required expensive costs by training numerous models . On the other hand , global approaches respectively constructed one classifier model for MFO , BPO , and CCO . The initial global approaches considered PFP as flat multi-label classification . They focused on extracting function-related features from the protein sequence . One of the function-related features is motifs , called sequence patterns . DeepGoPlus ( Kulmanov & Hoehndorf , 2020 ) encoded sequence to extract motifs using 1D CNN and then predicted the probability of annotating each GO term using one fully connected layer . Compared to local approach-based previous methods , DeepGoPlus achieved improved performance in PFP , despite its simple model architecture . This model resulted in poor performance when the number of GO terms increases . The recent global approaches expanded that built a structure encoder to improve performance . In DeepGOA ( Zhou et al. , 2020 ) , all GO terms were regarded as correlated labels contrary to DeepGoPlus where they were regarded as independent labels . This enabled GCN to learn more effectively GO terms . They showed improved performance compared to DeepGoPlus , although the same protein sequence encoding was used . They extracted patterns using 1D CNN , but could not extract various features related to functions other than patterns . TALE ( Cao & Shen , 2021 ) implied transformer encoder ( Vaswani et al. , 2017 ) for sequence encoder and embedded GO with hierarchical information of each GO term . They learned various and specific features related to function as the transformer encoder . However , this indirectly learned the correlation among GO terms since they did not learn GO itself and just use hierarchical information of each GO term . One of the common problems of global approaches is that they partially used GO terms . In general , a cut-off criterion in each GO domain was a number of annotations such as 25 , 50 , and 150 . Global approaches , which had the cut-off criterion , utilized about 13 % of the total GO terms . Although TALE ( Cao & Shen , 2021 ) , which is the latest model , had the cut-off criterion to 1 , this still utilized only about 60 % GO terms for their model . In this paper , we propose a method that effectively learns the relation between GO terms in an extended data using over 85 % GO terms . This model results in similar or higher performance to the latest models used fewer GO terms . 3 PROPOSED METHOD . In this section , we describe the details of our model . The overall architecture is shown in Figure 1 . This model has two inputs : a protein sequence and the hierarchical graph of GO . A protein sequence is encoded by pre-trained LM and is reduced dimension to the feature vector size of GO respectively . A GO graph is represented to a large-scale adjacency matrix and node-wise feature matrix . These matrices are inputs to GCN for learning the hierarchical representation of GO terms . The prediction layer is built as a dot product of a protein feature vector and a GO terms vector to predict the probability of annotated GO term of each protein sequence . We explain the technicality of these process in this subsection . 3.1 PROTEIN SEQUENCE ENCODING . We employ pre-trained LM as a sequence encoder . As we mentioned in related work , pre-trained LM , such as SeqVec ( Heinzinger et al. , 2019 ) and ProtBert ( Elnaggar et al. , 2020 ) , already proved their performance to capture rudimentary features of proteins such as secondary structures , biological activities , and functions ( Rives et al. , 2021 ; Vig et al. , 2020 ) . Especially , it was showed that SeqVec ( Heinzinger et al. , 2019 ) is better than ProtBert ( Elnaggar et al. , 2020 ) to extract high-level features related functions for PFP ( Littmann et al. , 2021 ) . Seqvec ( Heinzinger et al. , 2019 ) is utilized as a protein sequence encoder . This makes the various lengths of protein sequences to 1×1024 representation vectors with high-level biophysical features . Protein sequence representations are converted to P ∈ R1×d low-dimensional representation vectors by fully connected layer to combine GO term vectors . 3.2 HIERARCHICAL REPRESENTATION OF GO TERM . Initial node features H0 ∈ RN×N are represented as a one-hot encoding matrix where the i th row GO term and its ancestors are 1 . The GO term Embedding layer reduces dimension by converting sparse matrix to H0 ∈ RN×d0 dense matrix for preventing overfitting and reducing training time in GCN . It indicate that node features contain its physical location and conceptual information in a hierarchical graph . N is a number of GO terms ( node ) and d0 is a scale of dimension , which is the maximum depth in each domain for containing hierarchical information in the dense matrix . The adjacency matrix A ∈ RN×N contains the relationship between GO terms . When a parent node is t and the children node is s , the adjacency matrix is combined prior probability P ( Us|Ut ) with Information Content ( IC ) ( Song et al. , 2013 ) that measures semantic similarity between t and s. The existing adjacency matrix is usually built by one-hot encoding or the prior probability . The one-hot encoding can not involve any additional information other than connection information between GO terms . The prior probability can involve relational information . Nevertheless , it apply the inveterate label imbalanced problem in the PFP dataset to the adjacency matrix due to being highly dependent on the training dataset . We solve this problem that adding IC , which is less affected by the training dataset ( Zhou et al. , 2020 ) . The adjacency matrix is defined as follows : A = P ( Us|Ut ) + IC ( s ) ∑ i∈child ( t ) IC ( i ) ( 1 ) Prior probability P ( Us|Ut ) is calculated as follows : P ( Us|Ut ) = P ( Us ⋂ Ut ) P ( Ut ) = P ( Us ) P ( Ut ) = Ns Nt ( 2 ) Where Ut means a number of annotations in the training dataset , P ( Us|Ut ) means the conditional probability that t and s are annotated in the same protein sequence . IC is calculated as follows : IC ( k ) = −logp ( k ) p ( k ) = freq ( k ) freq ( root ) freq ( k ) = Uk + ∑ i∈child ( k ) freq ( i ) ( 3 ) Where p ( k ) is probability of each GO term k in the GO dataset , freq ( k ) is frequency of t and child ( k ) is every children of k. Initial node features H0 are updated H l ∈ RN×d with node features of adjacent nodes through lth GCN layer ( 1 ≤ l ≤M ) . GCN layer is represented as follows : H l+1 = ReLU ( ÂH lW l ) ( 4 ) | This paper presents a model to predict Gene Ontology (GO) term annotations for protein function. The model uses an existing method, SeqVec [2], to encode the protein sequence and a GCN on the Gene Ontology (GO) DAGs to encode the structure of term relationships. Like in DeepGOA[1], the graph is weighted by functions of term frequencies. Sequence embedding is reduced via FC layers to dimension d, where d is equal to the DAG depth for the ontology being predicted. The final prediction is a dot product between the GCN encoding and the reduced sequence embedding. The model largely combines these two existing models. [1] Zhou, Guangjie, et al. "Predicting functions of maize proteins using graph convolutional network." BMC bioinformatics 21.16 (2020): 1-16. [2] Heinzinger, Michael, et al. "Modeling aspects of the language of life through transfer-learning protein sequences." BMC bioinformatics 20.1 (2019): 1-17. [3] Cao, Yue, and Yang Shen. "TALE: Transformer-based protein function Annotation with joint sequence–Label Embedding." Bioinformatics 37.18 (2021): 2825-2833. | SP:9f1c2067aa3da35a6ab9946ab3bb143b36213da1 |
An Effective GCN-based Hierarchical Multi-label classification for Protein Function Prediction | 1 INTRODUCTION . Protein Function Prediction ( PFP ) is one of the key challenges in the post-genomic era ( Zhou et al. , 2019 ; Li et al. , 2018 ) . With large numbers of genomes being sequenced every year , the number of novel proteins being discovered is expanding as well ( Spalević et al. , 2020 ) . On the other side , protein functions are reliably determined in wet-lab experiments which are cumbersome and highcost . As a result , the number of novel protein sequences without function annotations is rapidly expanding . In fact , UniRef100 ( Consortium , 2019 ) contains over 220M ( million ) protein sequences of which less than 1M have function annotations proved by experiments ( Littmann et al. , 2021 ) . Fast and accurate PFP is especially important in biomedical and pharmaceutical applications which are associated with specific protein functions . Protein functions are defined by Gene Ontology ( GO ) composed of a directed acyclic graph ( DAG ) ( Ashburner et al. , 2000 ) . There are three GO domains : Molecular Function Ontology ( MFO ) , Biological Process Ontology ( BPO ) , and Cellular Component Ontology ( CCO ) , where each node represents one function called GO term , and each edge represents a hierarchical relation between two GO terms , such as ’ is a ’ , ’ part of ’ , and etc . Since one protein is usually represented by multiple function annotations , PFP can be regarded as hierarchical multi-label classification ( HMC ) . There are two groups of existing approaches for PFP : local approaches and global approaches . Local approaches usually constructed a classifier for each label ( GO term ) or for a few labels of the same hierarchy level ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ; Rifaioglu et al. , 2019 ) . On the other hand , global approaches constructed a single classifier for multiple labels . The initial global approaches considered PFP to flat multi-label classification , ignoring the hierarchical structure of GO , and considering each label independently ( Kulmanov & Hoehndorf , 2020 ) . Recent global approaches have constructed a structure encoder to learn the correlation among labels ( Zhou et al. , 2020 ; Cao & Shen , 2021 ) . However , these results showed that existing global approach-based models had limitations in representing correlations between GO terms by learning a large-scale hierarchical graph of GO . One of the structure encoders in global approach-based models used Graph Convolutional Network ( GCN ) . GCN has been applied in learning representation of node features . Nevertheless , in the case of applying GCN to a large-scale hierarchical graph , it was difficult to obtain information among long-distance ( Chen et al. , 2019 ; Zeng et al. , 2021 ) and unable to obtain adequate structure information since adjacent nodes did not contain any hierarchical features ( Hu et al. , 2019 ) . To overcome these shortcomings , we build node-wise representations containing the whole hierarchical information , which is involved relationship between long-distance nodes and structure information . In this paper , we propose a novel PFP model that combines a pre-trained Language Model ( LM ) and GCN-based model including new node-wise representations . A pre-trained LM as a sequence encoder ( Littmann et al. , 2021 ) extracts general ad helpful sequence features . GCN-based model as a structure encoder blends hierarchical information into a graph representation to improve GCN performance in a large-scale hierarchical graph of GO . To predict the probability of each GO term representing target protein functions , the prediction layer is constructed as a dot product of outputs of two encoders . The experimental results show that our method achieves performance improvement compared to the-state-of-the art models , especially in the most difficult BPO . 2 RELATED WORK . 2.1 PROTEIN SEQUENCE FEATURE EXTRACTION . Protein sequences contain multiple biophysical features related to function and structure . Initially , protein biophysical features such as motifs , sequence profiles , and secondary structures were calculated from a suite of programs and then utilized as protein sequence feature vectors by combining them ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ; Rifaioglu et al. , 2019 ) . While these methods intuitively utilized the relationship between protein features and its biological functions , it required deep knowledge of proteomics and had high-cost . Various deep learning architectures that extract high-level biophysical features of protein sequences have been proposed . Convolutional Neural Network ( CNN ) is one of the architectures as a sequence encoder to learn sequence patterns or motifs that are related to functions ( Xu et al. , 2020 ) . Therefore , 1D CNN was utilized as effective sequence encoder in previous researches ( Kulmanov & Hoehndorf , 2020 ; Zhou et al. , 2020 ; Kulmanov et al. , 2018 ) . With the advent of transformers ( Vaswani et al. , 2017 ) , which is attention-based model , in Natural Language Processing ( NLP ) , various attention-based LMs were applied to protein sequence embedding ( Rao et al. , 2019 ; Vig et al. , 2020 ; Rives et al. , 2021 ; Heinzinger et al. , 2019 ; Elnaggar et al. , 2020 ) . As protein sequences can be considered as sentences , these learned the relationship between amino acids constituting the sequence and learned contextual information . SeqVec ( Heinzinger et al. , 2019 ) and ProtBert ( Elnaggar et al. , 2020 ) , which were learned protein sequences using ElMo ( Peters et al. , 2018 ) and BERT ( Devlin et al. , 2018 ) , showed that these mostly extracted biophysical features of protein structures and functions , such as secondary structures , binding sites , and homology detections . 2.2 PROTEIN FUNCTION PREDICTION ( PFP ) . PFP methods can be categorized into two different approaches which are local and global . Local approaches commonly employed single or few multi-label classifiers to each or few GO terms . These approaches included FFpred ( Lobley et al. , 2008 ; Minneci et al. , 2013 ; Cozzetto et al. , 2016 ) and DEEPred ( Rifaioglu et al. , 2019 ) . FFpred predicted one GO term by multiple Support Vector Machines ( SVMs ) trained with radial basis function kernels to recognize protein sequence patterns associated with the GO term ( Cozzetto et al. , 2016 ) . DEEPred created a multi-label classification model using deep neural network for each GO hierarchical level ( Rifaioglu et al. , 2019 ) . Each model could carry out five GO terms in most labels . Even though this procedure generated 1,101 different models concerning all GO domains , this still needed numerous models for PFP ( Rifaioglu et al. , 2019 ) . Ultimately , local approaches required expensive costs by training numerous models . On the other hand , global approaches respectively constructed one classifier model for MFO , BPO , and CCO . The initial global approaches considered PFP as flat multi-label classification . They focused on extracting function-related features from the protein sequence . One of the function-related features is motifs , called sequence patterns . DeepGoPlus ( Kulmanov & Hoehndorf , 2020 ) encoded sequence to extract motifs using 1D CNN and then predicted the probability of annotating each GO term using one fully connected layer . Compared to local approach-based previous methods , DeepGoPlus achieved improved performance in PFP , despite its simple model architecture . This model resulted in poor performance when the number of GO terms increases . The recent global approaches expanded that built a structure encoder to improve performance . In DeepGOA ( Zhou et al. , 2020 ) , all GO terms were regarded as correlated labels contrary to DeepGoPlus where they were regarded as independent labels . This enabled GCN to learn more effectively GO terms . They showed improved performance compared to DeepGoPlus , although the same protein sequence encoding was used . They extracted patterns using 1D CNN , but could not extract various features related to functions other than patterns . TALE ( Cao & Shen , 2021 ) implied transformer encoder ( Vaswani et al. , 2017 ) for sequence encoder and embedded GO with hierarchical information of each GO term . They learned various and specific features related to function as the transformer encoder . However , this indirectly learned the correlation among GO terms since they did not learn GO itself and just use hierarchical information of each GO term . One of the common problems of global approaches is that they partially used GO terms . In general , a cut-off criterion in each GO domain was a number of annotations such as 25 , 50 , and 150 . Global approaches , which had the cut-off criterion , utilized about 13 % of the total GO terms . Although TALE ( Cao & Shen , 2021 ) , which is the latest model , had the cut-off criterion to 1 , this still utilized only about 60 % GO terms for their model . In this paper , we propose a method that effectively learns the relation between GO terms in an extended data using over 85 % GO terms . This model results in similar or higher performance to the latest models used fewer GO terms . 3 PROPOSED METHOD . In this section , we describe the details of our model . The overall architecture is shown in Figure 1 . This model has two inputs : a protein sequence and the hierarchical graph of GO . A protein sequence is encoded by pre-trained LM and is reduced dimension to the feature vector size of GO respectively . A GO graph is represented to a large-scale adjacency matrix and node-wise feature matrix . These matrices are inputs to GCN for learning the hierarchical representation of GO terms . The prediction layer is built as a dot product of a protein feature vector and a GO terms vector to predict the probability of annotated GO term of each protein sequence . We explain the technicality of these process in this subsection . 3.1 PROTEIN SEQUENCE ENCODING . We employ pre-trained LM as a sequence encoder . As we mentioned in related work , pre-trained LM , such as SeqVec ( Heinzinger et al. , 2019 ) and ProtBert ( Elnaggar et al. , 2020 ) , already proved their performance to capture rudimentary features of proteins such as secondary structures , biological activities , and functions ( Rives et al. , 2021 ; Vig et al. , 2020 ) . Especially , it was showed that SeqVec ( Heinzinger et al. , 2019 ) is better than ProtBert ( Elnaggar et al. , 2020 ) to extract high-level features related functions for PFP ( Littmann et al. , 2021 ) . Seqvec ( Heinzinger et al. , 2019 ) is utilized as a protein sequence encoder . This makes the various lengths of protein sequences to 1×1024 representation vectors with high-level biophysical features . Protein sequence representations are converted to P ∈ R1×d low-dimensional representation vectors by fully connected layer to combine GO term vectors . 3.2 HIERARCHICAL REPRESENTATION OF GO TERM . Initial node features H0 ∈ RN×N are represented as a one-hot encoding matrix where the i th row GO term and its ancestors are 1 . The GO term Embedding layer reduces dimension by converting sparse matrix to H0 ∈ RN×d0 dense matrix for preventing overfitting and reducing training time in GCN . It indicate that node features contain its physical location and conceptual information in a hierarchical graph . N is a number of GO terms ( node ) and d0 is a scale of dimension , which is the maximum depth in each domain for containing hierarchical information in the dense matrix . The adjacency matrix A ∈ RN×N contains the relationship between GO terms . When a parent node is t and the children node is s , the adjacency matrix is combined prior probability P ( Us|Ut ) with Information Content ( IC ) ( Song et al. , 2013 ) that measures semantic similarity between t and s. The existing adjacency matrix is usually built by one-hot encoding or the prior probability . The one-hot encoding can not involve any additional information other than connection information between GO terms . The prior probability can involve relational information . Nevertheless , it apply the inveterate label imbalanced problem in the PFP dataset to the adjacency matrix due to being highly dependent on the training dataset . We solve this problem that adding IC , which is less affected by the training dataset ( Zhou et al. , 2020 ) . The adjacency matrix is defined as follows : A = P ( Us|Ut ) + IC ( s ) ∑ i∈child ( t ) IC ( i ) ( 1 ) Prior probability P ( Us|Ut ) is calculated as follows : P ( Us|Ut ) = P ( Us ⋂ Ut ) P ( Ut ) = P ( Us ) P ( Ut ) = Ns Nt ( 2 ) Where Ut means a number of annotations in the training dataset , P ( Us|Ut ) means the conditional probability that t and s are annotated in the same protein sequence . IC is calculated as follows : IC ( k ) = −logp ( k ) p ( k ) = freq ( k ) freq ( root ) freq ( k ) = Uk + ∑ i∈child ( k ) freq ( i ) ( 3 ) Where p ( k ) is probability of each GO term k in the GO dataset , freq ( k ) is frequency of t and child ( k ) is every children of k. Initial node features H0 are updated H l ∈ RN×d with node features of adjacent nodes through lth GCN layer ( 1 ≤ l ≤M ) . GCN layer is represented as follows : H l+1 = ReLU ( ÂH lW l ) ( 4 ) | The paper proposes a method to predict protein functions from Gene Ontology (GO) and protein sequences. The protein sequences are embedded with a pretrained protein language model (SeqVec) and the GO network is modelled with a graph convolutional neural network. The method was benchmarked using CAFA3 competition datasets. Improved model performance was shown against a Naive baseline, DIAMONDScore, DeepGoCNN, and TALE. | SP:9f1c2067aa3da35a6ab9946ab3bb143b36213da1 |
On Locality in Graph Learning via Graph Neural Network | 1 INTRODUCTION . Graph Neural Network ( GNN ) is a family of machine learning ( ML ) models tailored for learning from graph-structured data ( Duvenaud et al. , 2015 ; Li et al. , 2017b ; Gilmer et al. , 2017 ; You et al. , 2019 ) . Recently , great success has been shown using models such as GCN ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2018 ) and GAT ( Veličković et al. , 2017 ) on tackling various graphrelated problems in domains such as chemistry ( Gilmer et al. , 2017 ) , biology ( Duvenaud et al. , 2015 ) , social networking ( Hamilton et al. , 2018 ; Chen et al. , 2018 ; 2017b ) and traffic networks ( Li et al. , 2017a ) . Despite their practicality and potential , theoretical understanding of the learning process of GNNs is still underexplored , especially given their difference in data dependency from other ML families . In most ML settings , data samples are assumed to be created independently and identically ( I.I.D . ) from a certain distribution . Because of this , uniform sampling is effective in many data selection processes such as training/validation/test set partition , batch sampling and initial labelling set selection ( Settles , 2009 ; Ren et al. , 2020 ) . For learning from graph-structured data , inherent dependencies exist among data samples , as captured by the graph structure . Taking training/validation/test set partition for example , different random partitions of the labelled nodes significantly impact the performance of the GNN model ( Shchur et al. , 2019 ) , especially when the size of the training set is small relative to the data population . Fig . 1 illustrates this phenomenon on the Cora data set ( Sen et al. , 2008 ) . This calls for a better understanding of the relation between the dependence among data samples and the learning process of GNN . Network homophily ( McPherson et al. , 2001 ) is a fundamental principle that describes the dependence among data samples in many real-world networks . Network homophily implies that nodes close by in ( graph ) distance tend to have similar features and labels . Most existing GNN designs assume strong homophily in the graph data ( Zhu et al. , 2020 ) and exploit it by propagating features and aggregating them within various graph neighbourhoods using different mechanisms ( Hamilton et al. , 2018 ; Veličković et al. , 2017 ; Kipf & Welling , 2017 ) . The capability to capture topological information from the underlying graph structure is the key to contribute to the success of GNN . The following question is raised : can we combine this network principle and topology awareness of GNN to derive useful insights for more effective graph learning via GNN ? Most existing efforts focus on the ( vertex ) sampling strategy to accelerate GNN training ( Chen et al. , 2018 ) or to conserve memory during GNN training ( Ying et al. , 2018 ) . There is little understanding or work on the underlying principle between the dependency of the data samples and the performance of GNN models Ma et al . ( 2021 ) . To address this question , we theoretically and experimentally investigate how and why different random partitions of training sets affect the learning outcome ( test performance ) of GNN in node-level tasks . We focus on graph data sets where the network homophily property holds . We formally show the spatial locality in the inference ability of GNN ( under certain conditions ) , i.e. , GNN predicts better on vertexes close to the training set . Our main contributions are summarized as follows . 1 . We prove that GNN predicts better on vertexes that are closer to the training set under certain assumptions . This implies that better coverage of the training set over the rest of the graph ( in terms of neighbourhoods of a small radius ) can translate into better generalization performance of the GNN model in the semi-supervised setting . 2 . We experimentally validate our theory and assumptions on Cora , Citeseer and PubMed data sets with prevailing GNN models such as GCN , GAT and GraphSAGE . 3 . Using the observation and theory as guidance , we formulate two optimization problems for studying ( 1 ) the “ cold start ” problem in active learning ( Grimova et al. , 2018 ) , and ( 2 ) minimal size of the labelled data set with respect to the model performance . The first optimization provides a strategy for selecting the most “ economic ” initial data set to be labelled and the other gives insights on how many vertexes should be labelled initially for the desired learning outcome of a GNN model . This work represents our first attempt to unwrap a better understanding of the learning process of GNN . It is novel to combine the network principle of the dependence among data samples and topology awareness of GNN to formally infer useful insights ( based on graph structure ) for GNN learning . The results suggest that the topology awareness of GNN is not only an important property to improve GNN performance , as shown in ( Li et al. , 2020 ; You et al. , 2019 ; Xu et al. , 2018 ; Nishad et al. , 2021 ) , but also useful guidance for making informed decisions in the learning process of GNN . 2 RELATED WORK . Expressive Power of GNN . Modern GNN architectures are inspired by the Weisfeiler–Lehman ( WL ) isomorphism test ( Leman & Weisfeiler , 1968 ) which uses the graph structure to propagate information ( Kipf & Welling , 2017 ) . One idea in characterizing the power of GNN is to measure its ability in differentiating different graph structures , referred to as the expressive power of GNN ( we refer to Sato ( 2020 ) for a survey on this line of works ) . In particular , Xu et al . ( 2018 ) proved that the expressive power of GNNs is no more than the WL test . This has inspired a number of studies on improving the expressive power of GNN by enabling it to differentiate graph structures that can not be distinguished by the WL-test ( Morris et al. , 2020 ) . The studies in ( You et al. , 2019 ; Li et al. , 2020 ; Nishad et al. , 2021 ; Zhou et al. , 2020 ) show that combining graph topology information ( distance ) into the learning process of GNN ( e.g. , for feature encoding , aggregation , normalization ) can improve the performance of GNN on various tasks . Generalization of GNN . Studies aiming to understand generalization performance of GNNs on node-level tasks are rather limited ( Ma et al. , 2021 ) . To our best knowledge , there are two very recent studies that investigate/demonstrate similar observations as ours . Zhu et al . ( 2021 ) studied the problem in GNN learning that the test set and the training set are generated from different distributions . They found the test error of GNNs is inversely related to their defined metric ( distance ) between test set and training set , which is similar to our discovery here . However , their work focused on designing a regularization mechanism to allow the learnt distribution to approximate the distribution in the test set . Ma et al . ( 2021 ) studied a similar problem as ours by extending the PACBayesian analysis for I.I.D . data to analyzing the generalization performance of GNNs . They prove that given a fixed training set , GNN generalization performance varies among different subgroups of the test population defined by a feature distance . Our study complements their study in the case that graph distance metric is used . Our analysis provides a different and more direct perspective for understanding how graph structure information influences GNN learning performance . 3 PRELIMINARIES . 3.1 GRAPH AND NOTATION . Let G = ( V , E ) be the input graph with node feature vector Xv for all v ∈ V . In this paper , we assume G is connected and focus our analysis on the node classification task where a label yv is associated with vertex v , and the objective is to learn a representation vector hv of v such that v ’ s label can be predicted as yv = f ( hv ) , where f is the prediction function . We use d ( x , y ) to denote the distance between x and y : ( 1 ) d ( . , . ) is defined to be the shortest path distance if x and y are vertexes in the graph ; ( 2 ) d ( . , . ) is the Euclidean distance if x and y are representations in the embedding space ; ( 3 ) d ( . , . ) is the distance between x and the closest element in Y , if Y is a set . For example , let u be a vertex and D be a set of vertexes , and then d ( u , D ) : = minv∈D { d ( u , v ) } . Let N and R denote the set of natural numbers and real numbers , respectively . R+ is the set of non-negative real numbers . 3.2 GRAPH NEURAL NETWORK . GNN combines the graph structure and node features Xv to learn a representation vector hv of node v. Modern GNNs adopt a neighborhood aggregation scheme , where the representation of a node is updated iteratively by aggregating representations of its neighbors . After k iterations of aggregation , a node ’ s representation captures the structural information within its k-hop neighborhood in the graph . LetH ⊆ Rm be the embedding space of the learnt representations of vertexes and m ∈ N is the dimension . Mθ : V 7→ H denotes the GNN model with parameter θ that maps a vertex v ∈ V into a representation vector hv in the embedding space H , following a neighborhood aggregation scheme . Let f : H 7→ Rc be the prediction function that maps an embedding vector hv to a vector in Rc , in which c ∈ N is the number of classes and each entry represents the probability of belonging to the respective class . The GNN prediction process can be viewed as composition of f ◦Mθ : V 7→ Rc . Let L : Rc 7→ R+ denote the loss function which evaluates how accurate the prediction is . As the graph structure ( topology ) among vertexes provides important information , it is important for GNN to preserve as much topological information as possible for embedding . Indeed , it has been formally and experimentally shown in ( Li et al. , 2020 ; You et al. , 2019 ; Nishad et al. , 2021 ) that improving the ability of GNN to preserve topological information such as shortest path distance can improve the expressive power of GNN . Here , we explore how to combine the topology awareness of GNN with the network homophily principle to derive useful insight for GNN learning . In particular , we focus on the ability of GNN to preserve distances information among vertexes , i.e. , to have a low distortion between graph distance and embedding distance . The distortion of a function between two metric spaces is defined as follows . Definition 1 ( distortion ) . Given two metric spaces ( E , d ) and ( E ′ , d′ ) and a mapping f : E 7→ E ′ , f is said to have distortion α , if there exists a constant r > 0 such that ∀u , v ∈ E , rd ( u , v ) ≤ d′ ( f ( u ) , f ( v ) ) ≤ αrd ( u , v ) You et al . ( 2019 ) ; Li et al . ( 2020 ) ; Nishad et al . ( 2021 ) have presented effective ways to increase the awareness of GNNs to vertex distances , i.e , to decrease the distortion rate α . For example , one can encode the shortest path distance ( SPD ) or other graph structure information to be part of the node feature for each vertex ( Li et al. , 2020 ) . Based on Bourgains ’ theorem ( Bourgain , 1985 ) , You et al . ( 2019 ) propose a vertex-distance-aware mechanism by selecting a set of anchor vertexes to provide positional information , and use the positional information to adjust the intermediate activation in GNN learning process . It is also discussed in ( You et al. , 2019 ) that the commonly used GNNs are a local version of the vertex-distance-aware mechanism they proposed , as the commonly used GNNs aggregate information for the training node from its neighbourhood . This neighbourhood aggregation mimics the existence of anchor vertexes and can provide local position information . This implies that common GNNs are already equipped with some ability to capture vertex distances ( low distortion ) , at least between neighbours whose representations are aggregated . We conduct experiments in Sec . 4.3 to further validate this . | This paper draws connection between performance of GNN and training set coverage in the graph. Specifically, it proposes theoretical study towards structural relation between them in terms of graph distance and empirical classification loss. A set of experiments are designed to validate the theory and assumption on three graph dataset. Further, the proposed idea is used in active learning as guidance. | SP:ddea48ce0c858d47e27f5ab2d31db225b2396479 |
On Locality in Graph Learning via Graph Neural Network | 1 INTRODUCTION . Graph Neural Network ( GNN ) is a family of machine learning ( ML ) models tailored for learning from graph-structured data ( Duvenaud et al. , 2015 ; Li et al. , 2017b ; Gilmer et al. , 2017 ; You et al. , 2019 ) . Recently , great success has been shown using models such as GCN ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2018 ) and GAT ( Veličković et al. , 2017 ) on tackling various graphrelated problems in domains such as chemistry ( Gilmer et al. , 2017 ) , biology ( Duvenaud et al. , 2015 ) , social networking ( Hamilton et al. , 2018 ; Chen et al. , 2018 ; 2017b ) and traffic networks ( Li et al. , 2017a ) . Despite their practicality and potential , theoretical understanding of the learning process of GNNs is still underexplored , especially given their difference in data dependency from other ML families . In most ML settings , data samples are assumed to be created independently and identically ( I.I.D . ) from a certain distribution . Because of this , uniform sampling is effective in many data selection processes such as training/validation/test set partition , batch sampling and initial labelling set selection ( Settles , 2009 ; Ren et al. , 2020 ) . For learning from graph-structured data , inherent dependencies exist among data samples , as captured by the graph structure . Taking training/validation/test set partition for example , different random partitions of the labelled nodes significantly impact the performance of the GNN model ( Shchur et al. , 2019 ) , especially when the size of the training set is small relative to the data population . Fig . 1 illustrates this phenomenon on the Cora data set ( Sen et al. , 2008 ) . This calls for a better understanding of the relation between the dependence among data samples and the learning process of GNN . Network homophily ( McPherson et al. , 2001 ) is a fundamental principle that describes the dependence among data samples in many real-world networks . Network homophily implies that nodes close by in ( graph ) distance tend to have similar features and labels . Most existing GNN designs assume strong homophily in the graph data ( Zhu et al. , 2020 ) and exploit it by propagating features and aggregating them within various graph neighbourhoods using different mechanisms ( Hamilton et al. , 2018 ; Veličković et al. , 2017 ; Kipf & Welling , 2017 ) . The capability to capture topological information from the underlying graph structure is the key to contribute to the success of GNN . The following question is raised : can we combine this network principle and topology awareness of GNN to derive useful insights for more effective graph learning via GNN ? Most existing efforts focus on the ( vertex ) sampling strategy to accelerate GNN training ( Chen et al. , 2018 ) or to conserve memory during GNN training ( Ying et al. , 2018 ) . There is little understanding or work on the underlying principle between the dependency of the data samples and the performance of GNN models Ma et al . ( 2021 ) . To address this question , we theoretically and experimentally investigate how and why different random partitions of training sets affect the learning outcome ( test performance ) of GNN in node-level tasks . We focus on graph data sets where the network homophily property holds . We formally show the spatial locality in the inference ability of GNN ( under certain conditions ) , i.e. , GNN predicts better on vertexes close to the training set . Our main contributions are summarized as follows . 1 . We prove that GNN predicts better on vertexes that are closer to the training set under certain assumptions . This implies that better coverage of the training set over the rest of the graph ( in terms of neighbourhoods of a small radius ) can translate into better generalization performance of the GNN model in the semi-supervised setting . 2 . We experimentally validate our theory and assumptions on Cora , Citeseer and PubMed data sets with prevailing GNN models such as GCN , GAT and GraphSAGE . 3 . Using the observation and theory as guidance , we formulate two optimization problems for studying ( 1 ) the “ cold start ” problem in active learning ( Grimova et al. , 2018 ) , and ( 2 ) minimal size of the labelled data set with respect to the model performance . The first optimization provides a strategy for selecting the most “ economic ” initial data set to be labelled and the other gives insights on how many vertexes should be labelled initially for the desired learning outcome of a GNN model . This work represents our first attempt to unwrap a better understanding of the learning process of GNN . It is novel to combine the network principle of the dependence among data samples and topology awareness of GNN to formally infer useful insights ( based on graph structure ) for GNN learning . The results suggest that the topology awareness of GNN is not only an important property to improve GNN performance , as shown in ( Li et al. , 2020 ; You et al. , 2019 ; Xu et al. , 2018 ; Nishad et al. , 2021 ) , but also useful guidance for making informed decisions in the learning process of GNN . 2 RELATED WORK . Expressive Power of GNN . Modern GNN architectures are inspired by the Weisfeiler–Lehman ( WL ) isomorphism test ( Leman & Weisfeiler , 1968 ) which uses the graph structure to propagate information ( Kipf & Welling , 2017 ) . One idea in characterizing the power of GNN is to measure its ability in differentiating different graph structures , referred to as the expressive power of GNN ( we refer to Sato ( 2020 ) for a survey on this line of works ) . In particular , Xu et al . ( 2018 ) proved that the expressive power of GNNs is no more than the WL test . This has inspired a number of studies on improving the expressive power of GNN by enabling it to differentiate graph structures that can not be distinguished by the WL-test ( Morris et al. , 2020 ) . The studies in ( You et al. , 2019 ; Li et al. , 2020 ; Nishad et al. , 2021 ; Zhou et al. , 2020 ) show that combining graph topology information ( distance ) into the learning process of GNN ( e.g. , for feature encoding , aggregation , normalization ) can improve the performance of GNN on various tasks . Generalization of GNN . Studies aiming to understand generalization performance of GNNs on node-level tasks are rather limited ( Ma et al. , 2021 ) . To our best knowledge , there are two very recent studies that investigate/demonstrate similar observations as ours . Zhu et al . ( 2021 ) studied the problem in GNN learning that the test set and the training set are generated from different distributions . They found the test error of GNNs is inversely related to their defined metric ( distance ) between test set and training set , which is similar to our discovery here . However , their work focused on designing a regularization mechanism to allow the learnt distribution to approximate the distribution in the test set . Ma et al . ( 2021 ) studied a similar problem as ours by extending the PACBayesian analysis for I.I.D . data to analyzing the generalization performance of GNNs . They prove that given a fixed training set , GNN generalization performance varies among different subgroups of the test population defined by a feature distance . Our study complements their study in the case that graph distance metric is used . Our analysis provides a different and more direct perspective for understanding how graph structure information influences GNN learning performance . 3 PRELIMINARIES . 3.1 GRAPH AND NOTATION . Let G = ( V , E ) be the input graph with node feature vector Xv for all v ∈ V . In this paper , we assume G is connected and focus our analysis on the node classification task where a label yv is associated with vertex v , and the objective is to learn a representation vector hv of v such that v ’ s label can be predicted as yv = f ( hv ) , where f is the prediction function . We use d ( x , y ) to denote the distance between x and y : ( 1 ) d ( . , . ) is defined to be the shortest path distance if x and y are vertexes in the graph ; ( 2 ) d ( . , . ) is the Euclidean distance if x and y are representations in the embedding space ; ( 3 ) d ( . , . ) is the distance between x and the closest element in Y , if Y is a set . For example , let u be a vertex and D be a set of vertexes , and then d ( u , D ) : = minv∈D { d ( u , v ) } . Let N and R denote the set of natural numbers and real numbers , respectively . R+ is the set of non-negative real numbers . 3.2 GRAPH NEURAL NETWORK . GNN combines the graph structure and node features Xv to learn a representation vector hv of node v. Modern GNNs adopt a neighborhood aggregation scheme , where the representation of a node is updated iteratively by aggregating representations of its neighbors . After k iterations of aggregation , a node ’ s representation captures the structural information within its k-hop neighborhood in the graph . LetH ⊆ Rm be the embedding space of the learnt representations of vertexes and m ∈ N is the dimension . Mθ : V 7→ H denotes the GNN model with parameter θ that maps a vertex v ∈ V into a representation vector hv in the embedding space H , following a neighborhood aggregation scheme . Let f : H 7→ Rc be the prediction function that maps an embedding vector hv to a vector in Rc , in which c ∈ N is the number of classes and each entry represents the probability of belonging to the respective class . The GNN prediction process can be viewed as composition of f ◦Mθ : V 7→ Rc . Let L : Rc 7→ R+ denote the loss function which evaluates how accurate the prediction is . As the graph structure ( topology ) among vertexes provides important information , it is important for GNN to preserve as much topological information as possible for embedding . Indeed , it has been formally and experimentally shown in ( Li et al. , 2020 ; You et al. , 2019 ; Nishad et al. , 2021 ) that improving the ability of GNN to preserve topological information such as shortest path distance can improve the expressive power of GNN . Here , we explore how to combine the topology awareness of GNN with the network homophily principle to derive useful insight for GNN learning . In particular , we focus on the ability of GNN to preserve distances information among vertexes , i.e. , to have a low distortion between graph distance and embedding distance . The distortion of a function between two metric spaces is defined as follows . Definition 1 ( distortion ) . Given two metric spaces ( E , d ) and ( E ′ , d′ ) and a mapping f : E 7→ E ′ , f is said to have distortion α , if there exists a constant r > 0 such that ∀u , v ∈ E , rd ( u , v ) ≤ d′ ( f ( u ) , f ( v ) ) ≤ αrd ( u , v ) You et al . ( 2019 ) ; Li et al . ( 2020 ) ; Nishad et al . ( 2021 ) have presented effective ways to increase the awareness of GNNs to vertex distances , i.e , to decrease the distortion rate α . For example , one can encode the shortest path distance ( SPD ) or other graph structure information to be part of the node feature for each vertex ( Li et al. , 2020 ) . Based on Bourgains ’ theorem ( Bourgain , 1985 ) , You et al . ( 2019 ) propose a vertex-distance-aware mechanism by selecting a set of anchor vertexes to provide positional information , and use the positional information to adjust the intermediate activation in GNN learning process . It is also discussed in ( You et al. , 2019 ) that the commonly used GNNs are a local version of the vertex-distance-aware mechanism they proposed , as the commonly used GNNs aggregate information for the training node from its neighbourhood . This neighbourhood aggregation mimics the existence of anchor vertexes and can provide local position information . This implies that common GNNs are already equipped with some ability to capture vertex distances ( low distortion ) , at least between neighbours whose representations are aggregated . We conduct experiments in Sec . 4.3 to further validate this . | This paper considers the problem of training set selection for graph neural network training. It shows that the generalization from the training to the test set in a well-trained graph neural network is closely tied to the shortest path distance in the graph, which motivates training strategies that "cover" the graph in this sense. The authors apply these ideas in a subset selection program, and verify their results with numerical experiments. | SP:ddea48ce0c858d47e27f5ab2d31db225b2396479 |
Towards Understanding Data Values: Empirical Results on Synthetic Data | 1 INTRODUCTION . Machine learning algorithms stand and fall with the training data . Although the process of data collection and labeling is highly time consuming , the creation of quality training data sets is of paramount importance . However , it turns out that not all data points contribute equally to the quality of the trained models . Recently , several works have addressed the problem of measuring the value of individual data points for the performance of the algorithm such as data Shapley ( Ghorbani & Zou , 2019 ) , catastrophic forgetting ( Toneva et al. , 2018 ) , influence functions ( Koh & Liang , 2017 ) , and data valuation using reinforcement learning ( DVRL , ( Yoon et al. , 2019 ) ) . In this paper we address the question : what distinguishes a high value data point from a low value one according to the state of the art works listed above ? Accordingly , our goals are to support a better understanding of the models and a more efficient data collection . Our contributions can be summarized as follows : We propose a framework to describe data values as the resulting change of a model ’ s decision boundary with respect to added data points . Subsequently , we probe the above data evaluation methods using the introduced framework on a synthetic 2D data set and visualize the resulting data values . Finally , we discuss the implications of our findings and place them in the recent literature . 1.1 BACKGROUND . There are several directions of research that can be interpreted as being related to estimating the value of data . Active Learning ( Settles , 2010 ) and core-set estimation ( Mirzasoleiman et al. , 2020 ; Sener & Savarese , 2018 ) historically belong to the earlier approaches . Points chosen for labeling in active learning and core-sets should intuitively have high data values . On top of that , recent methods such as influence functions ( Koh & Liang , 2017 ) , DVRL ( Yoon et al. , 2019 ) and data Shapley ( Ghorbani & Zou , 2019 ) directly aim at estimating the value of data . Finally , several other works are related or can be applied to the estimation of data values . These works include forgetting events discovered by Toneva et al . ( 2018 ) and memorization effects described by Feldman ( 2020b ) and Jiang et al . ( 2020 ) . Another related work by Paul & Dziugaite ( 2021 ) deals with estimating important samples early in training . In this paper , we empirically compare four of these methods on a synthetic data set in order to develop an intuition of how they work and to understand what makes a point important . To measure the importance of data points we consider two definitions . An important point either causes a large absolute change in the model ’ s estimated decision boundary , or reduces the relative distance between the estimated decision boundary and the ground-truth decision boundary . The reason to consider both is that some points could result in a large change of the decision boundary while increasing the error on the test set ( e.g. , a miss-labelled point ) . However , access to the groundtruth decision boundary is rarely available in practice . As our results on noise-free data show , there is no big difference between these two definitions , provided that the train data set is free of label noise . 1.2 RELATED WORK . In this section , we briefly outline a few research fields related to data valuation and revisit the four different data valuation methods from our experiments more closely . We use the standard notation to refer to the data set D = { ( xi , yi ) } ni=0 and sometimes the shorter form D = { X , y } . Core-Set Estimation Historically , core-set estimation is one of the first approaches that indirectly address data values ( Feldman , 2020a ) . The goal in core-set estimation is the selection of a small core-set DC ∈ D resulting in the same or similar performance of the model as if it was trained on the entire training set D. Many core-set-selection methods are model dependent . A recent work by Sener & Savarese ( 2018 ) applies core-sets to active learning and convolutional neural networks . As mentioned before , the connection between core-sets and data values is that one would expect points in the core-set to be of high data value . Active Learning Another related field is active learning ( Settles , 2010 ) . Given a labeled data set { X , y } , and a large set of unlabeled points XU , the algorithm can query an oracle for the label of a number of unlabeled data points xUi ∈ XU up to some budget b . An easy baseline for active learning is to select data points predicted with low confidence score . We , therefore , evaluate some out-ofdistribution methods ( Lakshminarayanan et al. , 2017 ; Gal & Ghahramani , 2016 ) on the task of data valuation in Appendix A.2 . A link between active learning and data valuation can be established quite naturally : the points chosen by active learning methods should also have a high data value . Leave-One-Out Valuation ( LOO ) A straight forward way of estimating the impact of data points is cancelling individual data points iteratively and comparing model performances after training . Let fX refer to the model trained on the entire train set X and fX\xi on the train set without xi . The data value of xi is then directly given by the performance difference of fX and fX\xi on the test set . Influence Function Influence Functions were proposed by Koh & Liang ( 2017 ) as a way of measuring the influence a data point will have on the model without retraining . As Koh & Liang ( 2017 ) propose , influence functions should be an approximation for leave-one-out retraining . The influence is estimated by the change in the model parameters θ . That is , the influence of data point zi = ( xi , yi ) is given by θ̂−zi − θ̂ , where θ̂−zi refers to the model parameters if the point zi was not part of the training data . Since our synthetic data set is small , we can afford retraining and do not consider influence functions . Data Shapley Ghorbani & Zou ( 2019 ) criticize that leave-one-out valuation does not capture interdependence between points . They propose data Shapley as a way of tackling this . The value of a data point xi is measured by its average contribution to the model performance when trained on all subsets of the remaining points X \ xi . Since this means exponential complexity , Ghorbani & Zou ( 2019 ) propose a truncated Monte Carlo scheme to estimate the value . Sample Forgetting Toneva et al . ( 2018 ) found that data points frequently forgotten during training are also important for training performance . A point is considered as forgotten if it was correctly classified at some time step t during training but again miss-classified later . They also report that this scheme of finding important points works between different model architectures . Memorization is another related line of work . Feldman ( 2020b ) and Jiang et al . ( 2020 ) independently use it for two different approaches . A training instance xi is referred to as singleton or rare if removing xi from the train set reduces the probability for xi to be classified correctly . That is , xi is only memorized if it is part of the train data . Formally , P ( fX ( xi ) = yi ) P ( fX\xi ( xi ) = yi ) . Feldman uses it to support the long-tail theory in Feldman ( 2020b ) and provides empirical evidence for the theory in Feldman & Zhang ( 2020 ) . In short , long tail refers to the fact that most data sets contain a long tail with many atypical instances . According to the theory , these examples are important for the generalization of the algorithm . Jiang et al . ( 2020 ) use memorization as a measure to characterize the regularities of a data set . They find that removing examples with the highest irregularity can improve training performance . These examples typically are the miss-labeled ones . DVRL Yoon et al . ( 2019 ) propose reinforcement learning as a way of estimating the value of data points . They train a data valuator to output values for each instance ( xi , yi ) in the training set , and use the resulting data values to sample training batches . Each points ’ probability to be in the batch is proportional to this data value . A predictor model fB is trained on the selected batch B and the resulting performance of the predictor is evaluated on a separate target set . The performance of the predictor model serves in turn as reward for the reinforcement learning of the data valuator . The valuator thereby learns to estimate important samples in the training set for the target distribution represented by the target set { XV , yV } . The data valuator ( DVRL ) is a function of dvrl ( xi , yi , ( fX ( xi ) − yi ) ) → R. In some initial experiments we were interested in whether we can remove the true labels yi from the DVRL while retaining the benefits to some extend but were not successful . Nevertheless , we provide results without labels in our experiments . 2 CONTRIBUTIONS . In this paper we use a synthetic 2D data set to visualize the importance of data points on the model performance . We span a mesh grid over the relevant feature plane and empirically compare the estimated data values of some of the methods introduced above . A comprehensible metric is then implemented to measure the difference between two decision boundaries . In the following section we first introduce the data set , describe how we estimate data values and , finally , explain our experimental setup . 2.1 DATA SET . The synthetic data set D = { ( xi , yi ) } ni=0 is two dimensional ( xi ∈ R2 ) and binary labeled ( yi ∈ { 0 , 1 } ) . We randomly divided it into train and test split . It is sampled from a mixture of Gaussians for each label class and ground-truth labels are assigned by means of one-nearestneighbor classification . We will refer to this ground-truth decision boundary as g. The data is not centered around the origin in order to have a non-linear decision boundary learned from the model and , thus , to make the graphs more comprehensible . On data centered in the origin a multi-layer perceptron learns linear decision boundaries as visible in the appendix in Figure 14 . A detailed description of the data can be found in Appendix A.1 . Furthermore , the data set DM = { XM , yM } = { ( xMi , yMi ) } m 2 i=0 is a 2D mesh grid used for plotting and estimating data values . For values { a1 , ... , am } and { b1 , ... , bm } on the x and y axes , the mesh grid contains all pairs of values : XM = { ( a1 , b1 ) , ( a1 , b2 ) , ... , ( am , bm ) } with corresponding labels yM ∈ { 0 , 1 } m 2 . Labels are computed with the ground-truth decision boundary g. In all experiments , the mesh grid is evenly spaced . The model will be referred to as fT , where T = { ( xTi , yTi ) } nt i=0 is the data set it was trained on . Hence , fT = fT ( x , θ ) = arg minθ 1 nt ∑nt i=0 L ( f ( x T i ) , y T i ) , where L ( . ) is the loss function . | This paper uses a synthetic two-dimensional dataset to visualize the importance of different data points on machine learning model performance. In particular, they used a multi-layer perceptron as the model, and they used four different schemes by which to measure the importance of individual data points. Not surprisingly, they show that regions of data that are misclassified tend to have relatively high importance in determining model performance. However, there are notable differences among the different schemes in their performances. This paper discusses the nature of those differences. | SP:9b43409b72248a99e5271fe974f39077767bd50a |
Towards Understanding Data Values: Empirical Results on Synthetic Data | 1 INTRODUCTION . Machine learning algorithms stand and fall with the training data . Although the process of data collection and labeling is highly time consuming , the creation of quality training data sets is of paramount importance . However , it turns out that not all data points contribute equally to the quality of the trained models . Recently , several works have addressed the problem of measuring the value of individual data points for the performance of the algorithm such as data Shapley ( Ghorbani & Zou , 2019 ) , catastrophic forgetting ( Toneva et al. , 2018 ) , influence functions ( Koh & Liang , 2017 ) , and data valuation using reinforcement learning ( DVRL , ( Yoon et al. , 2019 ) ) . In this paper we address the question : what distinguishes a high value data point from a low value one according to the state of the art works listed above ? Accordingly , our goals are to support a better understanding of the models and a more efficient data collection . Our contributions can be summarized as follows : We propose a framework to describe data values as the resulting change of a model ’ s decision boundary with respect to added data points . Subsequently , we probe the above data evaluation methods using the introduced framework on a synthetic 2D data set and visualize the resulting data values . Finally , we discuss the implications of our findings and place them in the recent literature . 1.1 BACKGROUND . There are several directions of research that can be interpreted as being related to estimating the value of data . Active Learning ( Settles , 2010 ) and core-set estimation ( Mirzasoleiman et al. , 2020 ; Sener & Savarese , 2018 ) historically belong to the earlier approaches . Points chosen for labeling in active learning and core-sets should intuitively have high data values . On top of that , recent methods such as influence functions ( Koh & Liang , 2017 ) , DVRL ( Yoon et al. , 2019 ) and data Shapley ( Ghorbani & Zou , 2019 ) directly aim at estimating the value of data . Finally , several other works are related or can be applied to the estimation of data values . These works include forgetting events discovered by Toneva et al . ( 2018 ) and memorization effects described by Feldman ( 2020b ) and Jiang et al . ( 2020 ) . Another related work by Paul & Dziugaite ( 2021 ) deals with estimating important samples early in training . In this paper , we empirically compare four of these methods on a synthetic data set in order to develop an intuition of how they work and to understand what makes a point important . To measure the importance of data points we consider two definitions . An important point either causes a large absolute change in the model ’ s estimated decision boundary , or reduces the relative distance between the estimated decision boundary and the ground-truth decision boundary . The reason to consider both is that some points could result in a large change of the decision boundary while increasing the error on the test set ( e.g. , a miss-labelled point ) . However , access to the groundtruth decision boundary is rarely available in practice . As our results on noise-free data show , there is no big difference between these two definitions , provided that the train data set is free of label noise . 1.2 RELATED WORK . In this section , we briefly outline a few research fields related to data valuation and revisit the four different data valuation methods from our experiments more closely . We use the standard notation to refer to the data set D = { ( xi , yi ) } ni=0 and sometimes the shorter form D = { X , y } . Core-Set Estimation Historically , core-set estimation is one of the first approaches that indirectly address data values ( Feldman , 2020a ) . The goal in core-set estimation is the selection of a small core-set DC ∈ D resulting in the same or similar performance of the model as if it was trained on the entire training set D. Many core-set-selection methods are model dependent . A recent work by Sener & Savarese ( 2018 ) applies core-sets to active learning and convolutional neural networks . As mentioned before , the connection between core-sets and data values is that one would expect points in the core-set to be of high data value . Active Learning Another related field is active learning ( Settles , 2010 ) . Given a labeled data set { X , y } , and a large set of unlabeled points XU , the algorithm can query an oracle for the label of a number of unlabeled data points xUi ∈ XU up to some budget b . An easy baseline for active learning is to select data points predicted with low confidence score . We , therefore , evaluate some out-ofdistribution methods ( Lakshminarayanan et al. , 2017 ; Gal & Ghahramani , 2016 ) on the task of data valuation in Appendix A.2 . A link between active learning and data valuation can be established quite naturally : the points chosen by active learning methods should also have a high data value . Leave-One-Out Valuation ( LOO ) A straight forward way of estimating the impact of data points is cancelling individual data points iteratively and comparing model performances after training . Let fX refer to the model trained on the entire train set X and fX\xi on the train set without xi . The data value of xi is then directly given by the performance difference of fX and fX\xi on the test set . Influence Function Influence Functions were proposed by Koh & Liang ( 2017 ) as a way of measuring the influence a data point will have on the model without retraining . As Koh & Liang ( 2017 ) propose , influence functions should be an approximation for leave-one-out retraining . The influence is estimated by the change in the model parameters θ . That is , the influence of data point zi = ( xi , yi ) is given by θ̂−zi − θ̂ , where θ̂−zi refers to the model parameters if the point zi was not part of the training data . Since our synthetic data set is small , we can afford retraining and do not consider influence functions . Data Shapley Ghorbani & Zou ( 2019 ) criticize that leave-one-out valuation does not capture interdependence between points . They propose data Shapley as a way of tackling this . The value of a data point xi is measured by its average contribution to the model performance when trained on all subsets of the remaining points X \ xi . Since this means exponential complexity , Ghorbani & Zou ( 2019 ) propose a truncated Monte Carlo scheme to estimate the value . Sample Forgetting Toneva et al . ( 2018 ) found that data points frequently forgotten during training are also important for training performance . A point is considered as forgotten if it was correctly classified at some time step t during training but again miss-classified later . They also report that this scheme of finding important points works between different model architectures . Memorization is another related line of work . Feldman ( 2020b ) and Jiang et al . ( 2020 ) independently use it for two different approaches . A training instance xi is referred to as singleton or rare if removing xi from the train set reduces the probability for xi to be classified correctly . That is , xi is only memorized if it is part of the train data . Formally , P ( fX ( xi ) = yi ) P ( fX\xi ( xi ) = yi ) . Feldman uses it to support the long-tail theory in Feldman ( 2020b ) and provides empirical evidence for the theory in Feldman & Zhang ( 2020 ) . In short , long tail refers to the fact that most data sets contain a long tail with many atypical instances . According to the theory , these examples are important for the generalization of the algorithm . Jiang et al . ( 2020 ) use memorization as a measure to characterize the regularities of a data set . They find that removing examples with the highest irregularity can improve training performance . These examples typically are the miss-labeled ones . DVRL Yoon et al . ( 2019 ) propose reinforcement learning as a way of estimating the value of data points . They train a data valuator to output values for each instance ( xi , yi ) in the training set , and use the resulting data values to sample training batches . Each points ’ probability to be in the batch is proportional to this data value . A predictor model fB is trained on the selected batch B and the resulting performance of the predictor is evaluated on a separate target set . The performance of the predictor model serves in turn as reward for the reinforcement learning of the data valuator . The valuator thereby learns to estimate important samples in the training set for the target distribution represented by the target set { XV , yV } . The data valuator ( DVRL ) is a function of dvrl ( xi , yi , ( fX ( xi ) − yi ) ) → R. In some initial experiments we were interested in whether we can remove the true labels yi from the DVRL while retaining the benefits to some extend but were not successful . Nevertheless , we provide results without labels in our experiments . 2 CONTRIBUTIONS . In this paper we use a synthetic 2D data set to visualize the importance of data points on the model performance . We span a mesh grid over the relevant feature plane and empirically compare the estimated data values of some of the methods introduced above . A comprehensible metric is then implemented to measure the difference between two decision boundaries . In the following section we first introduce the data set , describe how we estimate data values and , finally , explain our experimental setup . 2.1 DATA SET . The synthetic data set D = { ( xi , yi ) } ni=0 is two dimensional ( xi ∈ R2 ) and binary labeled ( yi ∈ { 0 , 1 } ) . We randomly divided it into train and test split . It is sampled from a mixture of Gaussians for each label class and ground-truth labels are assigned by means of one-nearestneighbor classification . We will refer to this ground-truth decision boundary as g. The data is not centered around the origin in order to have a non-linear decision boundary learned from the model and , thus , to make the graphs more comprehensible . On data centered in the origin a multi-layer perceptron learns linear decision boundaries as visible in the appendix in Figure 14 . A detailed description of the data can be found in Appendix A.1 . Furthermore , the data set DM = { XM , yM } = { ( xMi , yMi ) } m 2 i=0 is a 2D mesh grid used for plotting and estimating data values . For values { a1 , ... , am } and { b1 , ... , bm } on the x and y axes , the mesh grid contains all pairs of values : XM = { ( a1 , b1 ) , ( a1 , b2 ) , ... , ( am , bm ) } with corresponding labels yM ∈ { 0 , 1 } m 2 . Labels are computed with the ground-truth decision boundary g. In all experiments , the mesh grid is evenly spaced . The model will be referred to as fT , where T = { ( xTi , yTi ) } nt i=0 is the data set it was trained on . Hence , fT = fT ( x , θ ) = arg minθ 1 nt ∑nt i=0 L ( f ( x T i ) , y T i ) , where L ( . ) is the loss function . | The paper proposes a new method for identifying important points in a dataset given the task of classification. The paper introduces a new valuation function. The paper takes into consideration other methods that deal with the same problem and reevaluated them using the new scoring function. The scoring function focuses on the effect points have on the decision boundary. The results show that the most valuable points are not the ones close to the boundary but the misclassified ones. The result is interesting but not surprising. | SP:9b43409b72248a99e5271fe974f39077767bd50a |
Patches Are All You Need? | 1 Introduction For many years , convolutional neural networks have been the dominant architecture for deep learning systems applied to computer vision tasks . But recently , architectures based upon Transformermodels , e.g. , the so-called Vision Transformer architecture ( Dosovitskiy et al. , 2020 ) , have demonstrated compelling performance in many of these tasks , often outperforming classical convolutional architectures , especially for large data sets . An understandable assumption , then , is that it is only a matter of time before Transformers become the dominant architecture for vision domains , just as they have for language processing . In order to apply Transformers to images , however , the representation had to be changed : because the computational cost of the self-attention layers used in Transformers would scale quadratically with the number of pixels per image if applied naively at the per-pixel level , the compromise was to first split the image intomultiple “ patches ” , linearly embed them , and then apply the transformer directly to this collection of patches . In this work , we explore the question of whether , fundamentally , the strong performance of vision transformers may result more from this patch-based representation than from the Transformer architecture itself . We develop a very simple convolutional architecture which we dub the “ ConvMixer ” due to its similarity to the recently-proposed MLP-Mixer ( Tolstikhin et al. , 2021 ) . This architecture is similar to the Vision Transformer ( and MLP-Mixer ) in many respects : it directly operates on patches , it maintains an equal-resolution-and-size representation throughout all layers , it does no downsampling of the representation at successive layers , and it separates “ channel-wise mixing ” from the “ spatial mixing ” of information . But unlike the Vision Transformer and MLP-Mixer , our architecture does all these operations via only standard convolutions . The chief result we show in this paper is that this ConvMixer architecture , despite its extreme simplicity ( it can be implemented in ≈ 6 lines of dense PyTorch code ) , outperforms both “ standard ” computer vision models such as ResNets of similar parameter counts and some corresponding Vision Transformer andMLP-Mixer variants , even with a slate of additions intended to make those architectures more performant on smaller data sets . Importantly , this is despite the fact that we did not design our experiments to maximize accuracy nor speed , in contrast to the models we compared against . Our results suggest that , at least to some extent , the patch representation itself may be a critical component to the “ superior ” performance of newer architectures like Vision Transformers . While these results are naturally just a snapshot , and more experiments are required to exactly disentangle the effect of patch embeddings from other factors , we believe that this provides a strong “ convolutionalbut-patch-based ” baseline to compare against for more advanced architectures in the future . 2 A Simple Model : ConvMixer . Ourmodel , dubbedConvMixer , consists of a patch embedding layer followed by repeated applications of a simple fully-convolutional block . We maintain the spatial structure of the patch embeddings , as illustrated in Fig . 2 . Patch embeddings with patch size p and embedding dimension h can be implemented as convolution with cin input channels , h output channels , kernel size p , and stride p : z0 = BN ( σ { Convcin→h ( X , stride=p , kernel_size=p ) } ) ( 1 ) The ConvMixer block itself consists of depthwise convolution ( i.e. , grouped convolution with groups equal to the number of channels , h ) followed by pointwise ( i.e. , kernel size 1 × 1 ) convolution . As we will explain in Sec . 3 , ConvMixers work best with unusually large kernel sizes for the depthwise convolution . Each of the convolutions is followed by an activation and post-activation BatchNorm : z′l = BN ( σ { ConvDepthwise ( zl−1 ) } ) + zl−1 ( 2 ) zl+1 = BN ( σ { ConvPointwise ( z′l ) } ) ( 3 ) After many applications of this block , we perform global pooling to get a feature vector of size h , which we pass to a softmax classifier . See Fig . 3 for an implementation of ConvMixer in PyTorch . Design parameters . An instantiation of ConvMixer depends on four parameters : ( 1 ) the “ width ” or hidden dimension h ( i.e. , the dimension of the patch embeddings ) , ( 2 ) the depth d , or the number of repetitions of the ConvMixer layer , ( 3 ) the patch size p which controls the internal resolution of the model , ( 4 ) the kernel size k of the depthwise convolutional layer . We name ConvMixers after their hidden dimension and depth , like ConvMixer-h/d . We refer to the original input size n divided by the patch size p as the internal resolution ; note , however , that ConvMixers support variable-sized inputs . Motivation . Our architecture is based on the idea of mixing , as in Tolstikhin et al . ( 2021 ) . In particular , we chose depthwise convolution to mix spatial locations and pointwise convolution to mix channel locations . A key idea from previous work is that MLPs and self-attention can mix distant spatial locations , i.e. , they can have an arbitrarily large receptive field . Consequently , we used convolutions with an unusually large kernel size to mix distant spatial locations . While self-attention and MLPs are theoretically more flexible , allowing for large receptive fields and content-aware behavior , the inductive bias of convolution is well-suited to vision tasks and leads to high data efficiency . By using such a standard operation , we also get a glimpse into the effect of the patch representation itself in contrast to the conventional pyramid-shaped , progressivelydownsampling design of convolutional networks . 3 Experiments . Training setup . We primarily evaluate ConvMixers on ImageNet-1k classification without any pretraining or additional data . We added ConvMixer to the timm framework ( Wightman , 2019 ) and trained it with nearly-standard settings : we used RandAugment ( Cubuk et al. , 2020 ) , mixup ( Zhang et al. , 2017 ) , CutMix ( Yun et al. , 2019 ) , random erasing ( Zhong et al. , 2020 ) , and gradient norm clipping in addition to default timm augmentation . We used the AdamW ( Loshchilov & Hutter , 2018 ) optimizer and a simple triangular learning rate schedule . Due to limited compute , we did absolutely no hyperparameter tuning on ImageNet and trained for fewer epochs than competitors . Consequently , our models could be over- or under-regularized , and the accuracies we report likely underestimate the capabilities of our model . Results . A ConvMixer-1536/20 with 52M parameters can achieve 81.4 % top-1 accuracy on ImageNet , and a ConvMixer-768/32 with 21M parameters 80.2 % ( see Table 1 ) . Wider ConvMixers seem to converge in fewer epochs , but are memory- and compute-hungry . They also work best with large kernel sizes : ConvMixer-1536/20 lost ≈ 1 % accuracy when reducing the kernel size from k = 9 to k = 3 ( we discuss kernel sizes more in Appendix A & B ) . ConvMixers with smaller patches are substantially better in our experiments , similarly to Sandler et al . ( 2019 ) ; we believe larger patches require deeper ConvMixers . With everything held equal except increasing the patch size from 7 to 14 , ConvMixer-1536/20 achieves 78.9 % top-1 accuracy but is around 4× faster . We trained one model with ReLU to demonstrate that GELU ( Hendrycks & Gimpel , 2016 ) , which is popular in recent isotropic models , isn ’ t necessary . Comparisons . Our model and ImageNet1k-only training setup closely resemble that of recent patchbasedmodels likeDeiT ( Touvron et al. , 2020 ) . Due toConvMixer ’ s simplicity , we focus on comparing to only the most basic isotropic patch-based architectures adapted to the ImageNet-1k setting , namely DeiT and ResMLP . Attempting a fair comparison with a standard baseline , we trained ResNets using exactly the same parameters asConvMixers ; while this choice of parameters is suboptimal ( Wightman et al. , 2021 ) , it is likely also suboptimal for ConvMixers , since we did no hyperparameter tuning . Looking at Table 1 and Fig . 1 , ConvMixers achieve competitive accuracies for a given parameter budget : ConvMixer-1536/20 outperforms both ResNet-152 and ResMLP-B24 despite having substantially fewer parameters and is competitive with DeiT-B . ConvMixer-768/32 uses just a third of the parameters of ResNet-152 , but is similarly accurate . Note that unlike ConvMixer , the DeiT and ResMLP results involved hyperparameter tuning , andwhen substantial resources are dedicated to tuning ResNets , including training for twice as many epochs , they only outperform an equivalently-sized ConvMixer by ≈ 0.2 % ( Wightman et al. , 2021 ) . However , ConvMixers are substantially slower at inference than the competitors , likely due to their smaller patch size ; hyperparameter tuning and optimizations could narrow this gap . For more discussion and comparisons , see Table 2 and Appendix A. CIFAR-10 Experiments . We also performed smaller-scale experiments on CIFAR-10 , where ConvMixers achieve over 96 % accuracywith as few as 0.7Mparameters , demonstrating the data efficiency of the convolutional inductive bias . Details of these experiments are presented in Appendix B . 4 Related Work . Isotropic architectures . Vision transformers have inspired a new paradigm of “ isotropic ” architectures , i.e. , those with equal size and shape throughout the network , which use patch embeddings for the first layer . These models look similar to repeated transformer-encoder blocks ( Vaswani et al. , 2017 ) with different operations replacing the self-attention and MLP operations . For example , MLP-Mixer ( Tolstikhin et al. , 2021 ) replaces them both with MLPs applied across different dimensions ( i.e. , spatial and channel location mixing ) ; ResMLP ( Touvron et al. , 2021a ) is a data-efficient variation on this theme . CycleMLP ( Chen et al. , 2021 ) , gMLP ( Liu et al. , 2021a ) , and vision permutator ( Hou et al. , 2021 ) , replace one or both blocks with various novel operations . These are all quite performant , which is typically attributed to the novel choice of operations . In contrast , Melas-Kyriazi ( 2021 ) proposed an MLP-based isotropic vision model , and also hypothesized patch embeddings could be behind its performance . ResMLP tried replacing its linear interaction layer with ( small-kernel ) convolution and achieved good performance , but kept its MLP-based cross-channel layer and did not explore convolutions further . As our investigation of ConvMixers suggests , these works may conflate the effect of the new operations ( like self-attention and MLPs ) with the effect of the use of patch embeddings and the resulting isotropic architecture . A study predating vision transformers investigates isotropic ( or “ isometric ” ) MobileNets ( Sandler et al. , 2019 ) , and even implements patch embeddings under another name . Their architecture simply repeats an isotropicMobileNetv3 block . They identify a tradeoff between patch size and accuracy that matches our experience , and train similarly performant models ( see Appendix A , Table 2 ) . However , their block is substantially more complex than ours ; simplicity and motivation sets our work apart . Patches aren ’ t all you need . Several papers have increased vision transformer performance by replacing standard patch embeddings with a different stem : Xiao et al . ( 2021 ) and Yuan et al . ( 2021a ) use a standard convolutional stem , while Yuan et al . ( 2021b ) repeatedly combines nearby patch embeddings . However , this conflates the effect of using patch embeddings with the effect of adding convolution or similar inductive biases e.g. , locality . We attempt to focus on the use of patches . CNNs meet ViTs . Many efforts have been made to incorporate features of convolutional networks into vision transformers and vice versa . Self-attention can emulate convolution ( Cordonnier et al. , 2019 ) and can be initialized or regularized to be like it ( d ’ Ascoli et al. , 2021 ) ; other works simply add convolution operations to transformers ( Dai et al. , 2021 ; Guo et al. , 2021 ) , or include downsampling to be more like traditional pyramid-shaped convolutional networks ( Wang et al. , 2021 ) . Conversely , self-attention or attention-like operations can supplement or replace convolution in ResNet-style models ( Bello et al. , 2019 ; Ramachandran et al. , 2019 ; Bello , 2021 ) . While all of these attempts have been successful in one way or another , they are orthogonal to this work , which aims to emphasize the effect of the architecture common to most ViTs by showcasing it with a less-expressive operation . | This work proposed a new design for the image classification task named ConvMixer, which brings the idea from CNN to Visual Transformer. Unlike previous ConvNets, Transformer-based models, and MLP-based models, ConvMixer simply applies depth-wise (with skip connection) and point-wise convolutions on the patches. The key point authors claimed is that using patch embeddings is a powerful and important takeaway besides the architecture design. Experiments on ImageNet demonstrate the effectiveness of the proposed model. | SP:9328554224b618b5c1ab3190a51c86a35e2c7bfd |
Patches Are All You Need? | 1 Introduction For many years , convolutional neural networks have been the dominant architecture for deep learning systems applied to computer vision tasks . But recently , architectures based upon Transformermodels , e.g. , the so-called Vision Transformer architecture ( Dosovitskiy et al. , 2020 ) , have demonstrated compelling performance in many of these tasks , often outperforming classical convolutional architectures , especially for large data sets . An understandable assumption , then , is that it is only a matter of time before Transformers become the dominant architecture for vision domains , just as they have for language processing . In order to apply Transformers to images , however , the representation had to be changed : because the computational cost of the self-attention layers used in Transformers would scale quadratically with the number of pixels per image if applied naively at the per-pixel level , the compromise was to first split the image intomultiple “ patches ” , linearly embed them , and then apply the transformer directly to this collection of patches . In this work , we explore the question of whether , fundamentally , the strong performance of vision transformers may result more from this patch-based representation than from the Transformer architecture itself . We develop a very simple convolutional architecture which we dub the “ ConvMixer ” due to its similarity to the recently-proposed MLP-Mixer ( Tolstikhin et al. , 2021 ) . This architecture is similar to the Vision Transformer ( and MLP-Mixer ) in many respects : it directly operates on patches , it maintains an equal-resolution-and-size representation throughout all layers , it does no downsampling of the representation at successive layers , and it separates “ channel-wise mixing ” from the “ spatial mixing ” of information . But unlike the Vision Transformer and MLP-Mixer , our architecture does all these operations via only standard convolutions . The chief result we show in this paper is that this ConvMixer architecture , despite its extreme simplicity ( it can be implemented in ≈ 6 lines of dense PyTorch code ) , outperforms both “ standard ” computer vision models such as ResNets of similar parameter counts and some corresponding Vision Transformer andMLP-Mixer variants , even with a slate of additions intended to make those architectures more performant on smaller data sets . Importantly , this is despite the fact that we did not design our experiments to maximize accuracy nor speed , in contrast to the models we compared against . Our results suggest that , at least to some extent , the patch representation itself may be a critical component to the “ superior ” performance of newer architectures like Vision Transformers . While these results are naturally just a snapshot , and more experiments are required to exactly disentangle the effect of patch embeddings from other factors , we believe that this provides a strong “ convolutionalbut-patch-based ” baseline to compare against for more advanced architectures in the future . 2 A Simple Model : ConvMixer . Ourmodel , dubbedConvMixer , consists of a patch embedding layer followed by repeated applications of a simple fully-convolutional block . We maintain the spatial structure of the patch embeddings , as illustrated in Fig . 2 . Patch embeddings with patch size p and embedding dimension h can be implemented as convolution with cin input channels , h output channels , kernel size p , and stride p : z0 = BN ( σ { Convcin→h ( X , stride=p , kernel_size=p ) } ) ( 1 ) The ConvMixer block itself consists of depthwise convolution ( i.e. , grouped convolution with groups equal to the number of channels , h ) followed by pointwise ( i.e. , kernel size 1 × 1 ) convolution . As we will explain in Sec . 3 , ConvMixers work best with unusually large kernel sizes for the depthwise convolution . Each of the convolutions is followed by an activation and post-activation BatchNorm : z′l = BN ( σ { ConvDepthwise ( zl−1 ) } ) + zl−1 ( 2 ) zl+1 = BN ( σ { ConvPointwise ( z′l ) } ) ( 3 ) After many applications of this block , we perform global pooling to get a feature vector of size h , which we pass to a softmax classifier . See Fig . 3 for an implementation of ConvMixer in PyTorch . Design parameters . An instantiation of ConvMixer depends on four parameters : ( 1 ) the “ width ” or hidden dimension h ( i.e. , the dimension of the patch embeddings ) , ( 2 ) the depth d , or the number of repetitions of the ConvMixer layer , ( 3 ) the patch size p which controls the internal resolution of the model , ( 4 ) the kernel size k of the depthwise convolutional layer . We name ConvMixers after their hidden dimension and depth , like ConvMixer-h/d . We refer to the original input size n divided by the patch size p as the internal resolution ; note , however , that ConvMixers support variable-sized inputs . Motivation . Our architecture is based on the idea of mixing , as in Tolstikhin et al . ( 2021 ) . In particular , we chose depthwise convolution to mix spatial locations and pointwise convolution to mix channel locations . A key idea from previous work is that MLPs and self-attention can mix distant spatial locations , i.e. , they can have an arbitrarily large receptive field . Consequently , we used convolutions with an unusually large kernel size to mix distant spatial locations . While self-attention and MLPs are theoretically more flexible , allowing for large receptive fields and content-aware behavior , the inductive bias of convolution is well-suited to vision tasks and leads to high data efficiency . By using such a standard operation , we also get a glimpse into the effect of the patch representation itself in contrast to the conventional pyramid-shaped , progressivelydownsampling design of convolutional networks . 3 Experiments . Training setup . We primarily evaluate ConvMixers on ImageNet-1k classification without any pretraining or additional data . We added ConvMixer to the timm framework ( Wightman , 2019 ) and trained it with nearly-standard settings : we used RandAugment ( Cubuk et al. , 2020 ) , mixup ( Zhang et al. , 2017 ) , CutMix ( Yun et al. , 2019 ) , random erasing ( Zhong et al. , 2020 ) , and gradient norm clipping in addition to default timm augmentation . We used the AdamW ( Loshchilov & Hutter , 2018 ) optimizer and a simple triangular learning rate schedule . Due to limited compute , we did absolutely no hyperparameter tuning on ImageNet and trained for fewer epochs than competitors . Consequently , our models could be over- or under-regularized , and the accuracies we report likely underestimate the capabilities of our model . Results . A ConvMixer-1536/20 with 52M parameters can achieve 81.4 % top-1 accuracy on ImageNet , and a ConvMixer-768/32 with 21M parameters 80.2 % ( see Table 1 ) . Wider ConvMixers seem to converge in fewer epochs , but are memory- and compute-hungry . They also work best with large kernel sizes : ConvMixer-1536/20 lost ≈ 1 % accuracy when reducing the kernel size from k = 9 to k = 3 ( we discuss kernel sizes more in Appendix A & B ) . ConvMixers with smaller patches are substantially better in our experiments , similarly to Sandler et al . ( 2019 ) ; we believe larger patches require deeper ConvMixers . With everything held equal except increasing the patch size from 7 to 14 , ConvMixer-1536/20 achieves 78.9 % top-1 accuracy but is around 4× faster . We trained one model with ReLU to demonstrate that GELU ( Hendrycks & Gimpel , 2016 ) , which is popular in recent isotropic models , isn ’ t necessary . Comparisons . Our model and ImageNet1k-only training setup closely resemble that of recent patchbasedmodels likeDeiT ( Touvron et al. , 2020 ) . Due toConvMixer ’ s simplicity , we focus on comparing to only the most basic isotropic patch-based architectures adapted to the ImageNet-1k setting , namely DeiT and ResMLP . Attempting a fair comparison with a standard baseline , we trained ResNets using exactly the same parameters asConvMixers ; while this choice of parameters is suboptimal ( Wightman et al. , 2021 ) , it is likely also suboptimal for ConvMixers , since we did no hyperparameter tuning . Looking at Table 1 and Fig . 1 , ConvMixers achieve competitive accuracies for a given parameter budget : ConvMixer-1536/20 outperforms both ResNet-152 and ResMLP-B24 despite having substantially fewer parameters and is competitive with DeiT-B . ConvMixer-768/32 uses just a third of the parameters of ResNet-152 , but is similarly accurate . Note that unlike ConvMixer , the DeiT and ResMLP results involved hyperparameter tuning , andwhen substantial resources are dedicated to tuning ResNets , including training for twice as many epochs , they only outperform an equivalently-sized ConvMixer by ≈ 0.2 % ( Wightman et al. , 2021 ) . However , ConvMixers are substantially slower at inference than the competitors , likely due to their smaller patch size ; hyperparameter tuning and optimizations could narrow this gap . For more discussion and comparisons , see Table 2 and Appendix A. CIFAR-10 Experiments . We also performed smaller-scale experiments on CIFAR-10 , where ConvMixers achieve over 96 % accuracywith as few as 0.7Mparameters , demonstrating the data efficiency of the convolutional inductive bias . Details of these experiments are presented in Appendix B . 4 Related Work . Isotropic architectures . Vision transformers have inspired a new paradigm of “ isotropic ” architectures , i.e. , those with equal size and shape throughout the network , which use patch embeddings for the first layer . These models look similar to repeated transformer-encoder blocks ( Vaswani et al. , 2017 ) with different operations replacing the self-attention and MLP operations . For example , MLP-Mixer ( Tolstikhin et al. , 2021 ) replaces them both with MLPs applied across different dimensions ( i.e. , spatial and channel location mixing ) ; ResMLP ( Touvron et al. , 2021a ) is a data-efficient variation on this theme . CycleMLP ( Chen et al. , 2021 ) , gMLP ( Liu et al. , 2021a ) , and vision permutator ( Hou et al. , 2021 ) , replace one or both blocks with various novel operations . These are all quite performant , which is typically attributed to the novel choice of operations . In contrast , Melas-Kyriazi ( 2021 ) proposed an MLP-based isotropic vision model , and also hypothesized patch embeddings could be behind its performance . ResMLP tried replacing its linear interaction layer with ( small-kernel ) convolution and achieved good performance , but kept its MLP-based cross-channel layer and did not explore convolutions further . As our investigation of ConvMixers suggests , these works may conflate the effect of the new operations ( like self-attention and MLPs ) with the effect of the use of patch embeddings and the resulting isotropic architecture . A study predating vision transformers investigates isotropic ( or “ isometric ” ) MobileNets ( Sandler et al. , 2019 ) , and even implements patch embeddings under another name . Their architecture simply repeats an isotropicMobileNetv3 block . They identify a tradeoff between patch size and accuracy that matches our experience , and train similarly performant models ( see Appendix A , Table 2 ) . However , their block is substantially more complex than ours ; simplicity and motivation sets our work apart . Patches aren ’ t all you need . Several papers have increased vision transformer performance by replacing standard patch embeddings with a different stem : Xiao et al . ( 2021 ) and Yuan et al . ( 2021a ) use a standard convolutional stem , while Yuan et al . ( 2021b ) repeatedly combines nearby patch embeddings . However , this conflates the effect of using patch embeddings with the effect of adding convolution or similar inductive biases e.g. , locality . We attempt to focus on the use of patches . CNNs meet ViTs . Many efforts have been made to incorporate features of convolutional networks into vision transformers and vice versa . Self-attention can emulate convolution ( Cordonnier et al. , 2019 ) and can be initialized or regularized to be like it ( d ’ Ascoli et al. , 2021 ) ; other works simply add convolution operations to transformers ( Dai et al. , 2021 ; Guo et al. , 2021 ) , or include downsampling to be more like traditional pyramid-shaped convolutional networks ( Wang et al. , 2021 ) . Conversely , self-attention or attention-like operations can supplement or replace convolution in ResNet-style models ( Bello et al. , 2019 ; Ramachandran et al. , 2019 ; Bello , 2021 ) . While all of these attempts have been successful in one way or another , they are orthogonal to this work , which aims to emphasize the effect of the architecture common to most ViTs by showcasing it with a less-expressive operation . | The paper presents a very simple architecture which consist of patching the input image and then applying a combination of depth-wise and point-wise convolutions. In the paper, authors evaluate the performance of this model when used for image classification. In their main experiment, they train the architecture using only the ImageNet-1k dataset. On that experiment, they show how their simple architecture is competitive with state-of-the-art architectures. | SP:9328554224b618b5c1ab3190a51c86a35e2c7bfd |
Chemical-Reaction-Aware Molecule Representation Learning | 1 INTRODUCTION . How to represent molecules is a fundamental and crucial problem in chemistry . Chemists usually use IUPAC nomenclature , molecular formula , structural formula , skeletal formula , etc. , to represent molecules in chemistry literature.1 However , such representations are initially designed for human readers rather than computers . To facilitate machine learning algorithms understanding and making use of molecules , molecule representation learning ( MRL ) is proposed to map molecules into a lowdimensional real space and represent them as dense vectors . The learned vectors ( a.k.a . embeddings ) of molecules can benefit a wide range of downstream tasks , such as chemical reaction prediction ( Jin et al. , 2017 ; Segler & Waller , 2017 ) , molecule property prediction ( Zhang et al. , 2021 ) , molecule generation ( Mahmood et al. , 2021 ) , drug discovery ( Rathi et al. , 2019 ) , retrosynthesis planning ( Segler et al. , 2018 ) , chemical text mining ( Krallinger et al. , 2017 ) , and chemical knowledge graph modeling ( Bean et al. , 2017 ) . Researchers have proposed a great many MRL methods . A large portion of them , including MolBERT ( Fabian et al. , 2020 ) , ChemBERTa ( Chithrananda et al. , 2020 ) , SMILES-Transformer ( Honda et al. , 2019 ) , SMILES-BERT ( Wang et al. , 2019 ) , Molecule-Transformer ( Shin et al. , 2019 ) , and SABiLSTM ( Zheng et al. , 2019b ) , take SMILES2 strings as input and utilize natural language models , for example , Transformers ( Vaswani et al. , 2017 ) or BERT ( Devlin et al. , 2018 ) , as their base model . Despite the great power of such language models , they have difficulty dealing with SMILES input , 1For example , for glycerol , its IUPAC name , molecular formula , structural formula , and skeletal formula are propane-1,2,3-triol , C3H8O3 , CH2 OH CH OH CH2 OH , and OH OH OH , respectively . 2The Simplified Molecular-Input Line-Entry System ( SMILES ) is a specification in the form of a line notation for describing the structure of chemical species using short ASCII strings . For example , the SMILES string for glycerol is “ OCC ( O ) CO ” . because SMILES is 1D linearization of molecular structure , which makes it hard for language models to learn the original structural information of molecules simply based on “ slender ” strings ( see Section 4 for more discussion ) . Another line of MRL methods , instead , use graph neural networks ( GNNs ) ( Kipf & Welling , 2017 ) to process molecular graphs ( Merkwirth & Lengauer , 2005 ; Jin et al. , 2017 ; Gilmer et al. , 2017 ; Ishida et al. , 2021 ) . Though GNN-based methods are theoretically superior to SMILES-based methods in learning molecule structure , they are limited to designing fresh and delicate GNN architectures while ignoring the essence of MRL , which is generalization ability . Actually , we will show later that , there is no specific GNN that performs universally best in all downstream tasks of MRL , which inspires us to explore beyond GNN architectures . To address the limitations of existing work , in this paper , we propose using chemical reactions to assist learning molecule representations and improving their generalization ability . A chemical reaction is usually represented as a chemical equation in the form of symbols and formulae , wherein the reactant entities are given on the left-hand side and the product entities on the right-hand side . For example , the chemical equation of Fischer esterification of acetic acid and ethanol can be written as CH3COOH + C2H5OH → CH3COOC2H5 + H2O . A chemical reaction usually indicates a particular relation of equivalence between its reactants and products ( e.g. , in terms of conservation of mass and conservation of charge ) , and our idea is to preserve this equivalence in the molecule embedding space . Specifically , given the chemical reaction of Fischer esterification above , we hope that the equation hCH3COOH + hC2H5OH = hCH3COOC2H5 + hH2O also holds , where h ( · ) represents molecule embedding function . This simple constraint endows molecule embeddings with very nice properties : ( 1 ) Molecule embeddings are composable with respect to chemical reactions , which make the embedding space well-organized ( see Proposition 1 ) ; ( 2 ) More importantly , we will show later that , when the molecule encoder is a GNN with summation as the readout function , our model can automatically and implicitly learn reaction templates that summarize a group of chemical reactions within the same category ( see Proposition 2 ) . The ability of learning reaction templates is the key to improving the generalization ability of molecule representation , since the model can easily generalize its learned knowledge to a molecule that is unseen but belongs to the same category as or shares the similar structure with a known molecule . We show that the molecule embeddings learned by our proposed model , namely MolR ( chemicalreaction-aware molecule embeddings ) , is able to benefit a variety of downstream tasks , which makes it significantly distinct from all existing methods that are designed for only one downstream task . For example , MolR achieves 17.4 % absolute Hit @ 1 gain in reaction product prediction , 2.3 % absolute AUC gain on BBBP dataset in molecule property prediction , and 18.5 % relative RMSE gain in graph-edit-distance prediction , respectively , over the best baseline method . We also visualize the learned molecule embeddings and show that they are able to encode reaction templates as well as several key molecule attributes , e.g. , molecule size and the number of smallest rings . 2 THE PROPOSED METHOD . 2.1 STRUCTURAL MOLECULE ENCODER . A molecular graph is represented as G = ( V , E ) , where V = { a1 , · · · } is the set of non-hydrogen atoms and E = { b1 , · · · } is the set of bonds . Each atom ai has an initial feature vector xi encoding its properties . In this work , we use four types of atom properties : element type , charge , whether the atom is an aromatic ring , and the count of attached hydrogen atom ( s ) . Each type of atom properties is represented as a one-hot vector , and we add an additional “ unknown ” entry for each one-hot vector to handle unknown values during inference . The four one-hot vectors are concatenated as the initial atom feature . In addition , each bond bi has a bond type ( e.g. , single , double ) . Since the bond type can usually be inferred by the features of its two associated atoms and does not consistently improve the model performance according to our experiments , we do not explicitly take bond type as input . To learn structural representation of molecules , we choose GNNs , which utilize molecule structure and atom features to learn a representation vector for each atom and the entire molecule , as our base model . Typical GNNs follow a neighborhood aggregation strategy , which iteratively updates the representation of an atom by aggregating representations of its neighbors and itself . Formally , the k-th layer of a GNN is : hki = AGGREGATE ( { hk−1j } j∈N ( i ) ∪ { i } ) , k = 1 , · · · , K , ( 1 ) where hki is atom ai ’ s representation vector at the k-th layer ( h 0 i is initialized as ai ’ s initial feature xi ) , N ( i ) is the set of atoms directly connected to ai , and K is the number of GNN layers . The choice of AGGREGATE function is essential to designing GNNs , and a number of GNN architectures have been proposed . See Appendix A for a detailed introduction on GNN architectures . Finally , a readout function is used to aggregate all node representations output by the last GNN layer to obtain the entire molecule ’ s representation hG : hG = READOUT ( { hKi } ai∈V ) . ( 2 ) The READOUT function can be a simple permutation invariant function such as summation and mean , or a more sophisticated graph-level pooling algorithm ( Ying et al. , 2018 ; Zhang et al. , 2018 ) . An illustrative example of GNN encoder is shown in Figure 1a . 2.2 PRESERVING CHEMICAL REACTION EQUIVALENCE . A chemical reaction defines a particular relation “ → ” between reactant set R = { r1 , r2 , · · · } and product set P = { p1 , p2 , · · · } : r1 + r2 + · · · → p1 + p2 + · · · . ( 3 ) A chemical reaction usually represents a closed system where several physical quantities of the system retain constant before and after the reaction , such as mass , energy , charge , etc . Therefore , it describes a certain kind of equivalence between its reactants and products in the chemical reaction space . Our key idea is to preserve such equivalence in the molecule embedding space : ∑ r∈R hr = ∑ p∈P hp . ( 4 ) The above simple constraint is crucial to improving the quality of molecule embeddings . We first show , through the following proposition , that the chemical reaction relation “ → ” is an equivalence relation under the constraint of Eq . ( 4 ) : Proposition 1 Let M be the set of molecules , R ⊆M and P ⊆M be the reactant set and product set of a chemical reaction , respectively . If R → P ⇔ ∑ r∈R hr = ∑ p∈P hp for all chemical reactions , then “ → ” is an equivalence relation on 2M that satisfies the following three properties : ( 1 ) Reflexivity : A→ A , for all A ∈ 2M ; ( 2 ) Symmetry : A→ B ⇔ B → A , for all A , B ∈ 2M ; ( 3 ) Transitivity : If A→ B and B → C , then A→ C , for all A , B , C ∈ 2M . The proof of Proposition 1 is in Appendix B . One important corollary of Proposition 1 is that , the set of all subsets of M , i.e . 2M , is naturally split into equivalence classes based on the equivalence relation “ → ” . For all molecule sets within one equivalent class , the sum of embeddings of all molecules they consist of should be equal . For example , in organic synthesis , a target compound t may be made from three different sets of starting materials A , B , and C. Then the sets A , B , C as well as { t } belong to one equivalence class , and we have ∑ m∈A hm = ∑ m∈B hm = ∑ m∈C hm = ht . Note that the starting materials are usually small and basic molecules that frequently appear in a number of synthesis routes . Therefore , Eq . ( 4 ) forms a system of linear equations , wherein the chemical reaction equivalence imposes strong constraint on the embeddings of base molecules . As a result , the feasible solutions of molecule embeddings will be more robust , and the whole embedding space will be more organized . See the visualized result on molecule embedding space in Section 3.5 for more details . We can further show that , the constraint in Eq . ( 4 ) is also able to improve the generalization ability of molecule embeddings . To see this , we first define reaction center for a chemical reaction . The reaction center of R → P is defined as a subgraph of R consisting of atoms whose bonds have changed after reaction . For example , for the reaction in the upper part of Figure 1b , its reaction center is the two oxygen atoms marked in dark orange , since they are the only two atoms whose bonds have changed . Given the concept of reaction center , we have the following proposition : Proposition 2 Let R→ P be a chemical reaction where R is the reactant set and P is the product set , and C be its reaction center . Suppose that we use the GNN ( whose number of layers is K ) shown in Eqs . ( 1 ) and ( 2 ) as the molecule encoder , and set the READOUT function in Eq . ( 2 ) as summation . Then for an arbitrary atom a in one of the reactant whose final representation is hKa , the residual term ∑ r∈R hr − ∑ p∈P hp is a function of h K a if and only if the distance between atom a and reaction center C is less than K. The proof of Proposition 2 is in Appendix C. Proposition 2 indicates that the residual between reactant embedding and product embedding will fully and only depend on atoms that are less than K hops away from the reaction center . For example , as shown in Figure 1b , suppose that we use a 3- layer GNN to process Fischer esterification of propionic acid and propanol , then the residual between reactant embedding and product embedding will totally depend on the reaction center ( colored in orange ) as well as atoms whose distance from the reaction center is 1 or 2 ( colored in light orange ) . This implies that , if the GNN encoder has been well-optimized on this chemical equation and outputs perfect embeddings , i.e. , hCH3CH2COOH + hCH3CH2CH2OH = hCH3CH2COOCH2CH2CH3 + hH2O , then the equation hR1−CH2COOH + hR2−CH2CH2OH = hR1−CH2COOCH2CH2−R2 + hH2O will also hold for any functional group R1 and R2 , since the residual between the two sides of the equation does not depend on R1 or R2 that are more than 2 hops away from the reaction center . The induced general chemical reaction R1-CH2COOH + R2-CH2CH2OH→ R1-CH2COOCH2CH2-R2 + H2O is called a reaction template , which abstracts a group of chemical reactions within the same category . The learned reaction templates are essential to improving the generalization ability of our model , as the model can easily apply this knowledge to reactions that are unseen in training data but comply with a known reaction template ( e.g. , acetic acid plus propanol , butyric acid plus butanol ) . We will further show in Section 3.5 how reaction templates are encoded in molecule embeddings . Remarks . Below are some of our remarks to provide further understanding on the proposed model : First , compared with ( Jin et al. , 2017 ) that also learns reaction templates , our model does not need a complicated network to calculate attention scores , nor requires additional atom mapping information between reactants and products as input . Moreover , our model is theoretically able to learn a reaction template based on even only one reaction instance , which makes it particularly useful in few-shot learning ( Wang et al. , 2020 ) scenario . See Section 3.1 for the experimental result . Second , organic reactions are usually imbalanced and omit small and inorganic molecules to highlight the product of interest ( e.g. , H2O is usually omitted from Fischer esterification ) . Nonetheless , our model can still learn meaningful reaction templates as long as chemical reactions are written in a consistent manner ( e.g. , H2O is omitted for all Fischer esterification ) . Third , the number of GNN layers K can greatly impact the learned reaction templates according to Proposition 2 : A small K may not be enough to represent a meaningful reaction template ( e.g. , in Fischer esterification , the necessary carbonyl group “ C=O ” in carboxylic acid will not appear in the reaction template ifK < 3 ) , while a largeK may include unnecessary atoms for a reaction template and thus reduces its coverage ( e.g. , the Fischer esterification of formic acid HCOOH and methanol CH3OH is not covered by the reaction template shown in Figure 1b ) . The empirical impact of K is shown in Appendix D . | The paper proposes a molecule representation learning method which is guided by chemical reactions. In particular, it leverages chemical reaction equations by forcing the sum of reactant embeddings and the sum of product embed- dings to be equal for each chemical equation. This idea is simple and useful, sharing the spirit of Word2Vec and TransE. | SP:70fa69d4e05f33ab8386117417c229a60e55b658 |
Chemical-Reaction-Aware Molecule Representation Learning | 1 INTRODUCTION . How to represent molecules is a fundamental and crucial problem in chemistry . Chemists usually use IUPAC nomenclature , molecular formula , structural formula , skeletal formula , etc. , to represent molecules in chemistry literature.1 However , such representations are initially designed for human readers rather than computers . To facilitate machine learning algorithms understanding and making use of molecules , molecule representation learning ( MRL ) is proposed to map molecules into a lowdimensional real space and represent them as dense vectors . The learned vectors ( a.k.a . embeddings ) of molecules can benefit a wide range of downstream tasks , such as chemical reaction prediction ( Jin et al. , 2017 ; Segler & Waller , 2017 ) , molecule property prediction ( Zhang et al. , 2021 ) , molecule generation ( Mahmood et al. , 2021 ) , drug discovery ( Rathi et al. , 2019 ) , retrosynthesis planning ( Segler et al. , 2018 ) , chemical text mining ( Krallinger et al. , 2017 ) , and chemical knowledge graph modeling ( Bean et al. , 2017 ) . Researchers have proposed a great many MRL methods . A large portion of them , including MolBERT ( Fabian et al. , 2020 ) , ChemBERTa ( Chithrananda et al. , 2020 ) , SMILES-Transformer ( Honda et al. , 2019 ) , SMILES-BERT ( Wang et al. , 2019 ) , Molecule-Transformer ( Shin et al. , 2019 ) , and SABiLSTM ( Zheng et al. , 2019b ) , take SMILES2 strings as input and utilize natural language models , for example , Transformers ( Vaswani et al. , 2017 ) or BERT ( Devlin et al. , 2018 ) , as their base model . Despite the great power of such language models , they have difficulty dealing with SMILES input , 1For example , for glycerol , its IUPAC name , molecular formula , structural formula , and skeletal formula are propane-1,2,3-triol , C3H8O3 , CH2 OH CH OH CH2 OH , and OH OH OH , respectively . 2The Simplified Molecular-Input Line-Entry System ( SMILES ) is a specification in the form of a line notation for describing the structure of chemical species using short ASCII strings . For example , the SMILES string for glycerol is “ OCC ( O ) CO ” . because SMILES is 1D linearization of molecular structure , which makes it hard for language models to learn the original structural information of molecules simply based on “ slender ” strings ( see Section 4 for more discussion ) . Another line of MRL methods , instead , use graph neural networks ( GNNs ) ( Kipf & Welling , 2017 ) to process molecular graphs ( Merkwirth & Lengauer , 2005 ; Jin et al. , 2017 ; Gilmer et al. , 2017 ; Ishida et al. , 2021 ) . Though GNN-based methods are theoretically superior to SMILES-based methods in learning molecule structure , they are limited to designing fresh and delicate GNN architectures while ignoring the essence of MRL , which is generalization ability . Actually , we will show later that , there is no specific GNN that performs universally best in all downstream tasks of MRL , which inspires us to explore beyond GNN architectures . To address the limitations of existing work , in this paper , we propose using chemical reactions to assist learning molecule representations and improving their generalization ability . A chemical reaction is usually represented as a chemical equation in the form of symbols and formulae , wherein the reactant entities are given on the left-hand side and the product entities on the right-hand side . For example , the chemical equation of Fischer esterification of acetic acid and ethanol can be written as CH3COOH + C2H5OH → CH3COOC2H5 + H2O . A chemical reaction usually indicates a particular relation of equivalence between its reactants and products ( e.g. , in terms of conservation of mass and conservation of charge ) , and our idea is to preserve this equivalence in the molecule embedding space . Specifically , given the chemical reaction of Fischer esterification above , we hope that the equation hCH3COOH + hC2H5OH = hCH3COOC2H5 + hH2O also holds , where h ( · ) represents molecule embedding function . This simple constraint endows molecule embeddings with very nice properties : ( 1 ) Molecule embeddings are composable with respect to chemical reactions , which make the embedding space well-organized ( see Proposition 1 ) ; ( 2 ) More importantly , we will show later that , when the molecule encoder is a GNN with summation as the readout function , our model can automatically and implicitly learn reaction templates that summarize a group of chemical reactions within the same category ( see Proposition 2 ) . The ability of learning reaction templates is the key to improving the generalization ability of molecule representation , since the model can easily generalize its learned knowledge to a molecule that is unseen but belongs to the same category as or shares the similar structure with a known molecule . We show that the molecule embeddings learned by our proposed model , namely MolR ( chemicalreaction-aware molecule embeddings ) , is able to benefit a variety of downstream tasks , which makes it significantly distinct from all existing methods that are designed for only one downstream task . For example , MolR achieves 17.4 % absolute Hit @ 1 gain in reaction product prediction , 2.3 % absolute AUC gain on BBBP dataset in molecule property prediction , and 18.5 % relative RMSE gain in graph-edit-distance prediction , respectively , over the best baseline method . We also visualize the learned molecule embeddings and show that they are able to encode reaction templates as well as several key molecule attributes , e.g. , molecule size and the number of smallest rings . 2 THE PROPOSED METHOD . 2.1 STRUCTURAL MOLECULE ENCODER . A molecular graph is represented as G = ( V , E ) , where V = { a1 , · · · } is the set of non-hydrogen atoms and E = { b1 , · · · } is the set of bonds . Each atom ai has an initial feature vector xi encoding its properties . In this work , we use four types of atom properties : element type , charge , whether the atom is an aromatic ring , and the count of attached hydrogen atom ( s ) . Each type of atom properties is represented as a one-hot vector , and we add an additional “ unknown ” entry for each one-hot vector to handle unknown values during inference . The four one-hot vectors are concatenated as the initial atom feature . In addition , each bond bi has a bond type ( e.g. , single , double ) . Since the bond type can usually be inferred by the features of its two associated atoms and does not consistently improve the model performance according to our experiments , we do not explicitly take bond type as input . To learn structural representation of molecules , we choose GNNs , which utilize molecule structure and atom features to learn a representation vector for each atom and the entire molecule , as our base model . Typical GNNs follow a neighborhood aggregation strategy , which iteratively updates the representation of an atom by aggregating representations of its neighbors and itself . Formally , the k-th layer of a GNN is : hki = AGGREGATE ( { hk−1j } j∈N ( i ) ∪ { i } ) , k = 1 , · · · , K , ( 1 ) where hki is atom ai ’ s representation vector at the k-th layer ( h 0 i is initialized as ai ’ s initial feature xi ) , N ( i ) is the set of atoms directly connected to ai , and K is the number of GNN layers . The choice of AGGREGATE function is essential to designing GNNs , and a number of GNN architectures have been proposed . See Appendix A for a detailed introduction on GNN architectures . Finally , a readout function is used to aggregate all node representations output by the last GNN layer to obtain the entire molecule ’ s representation hG : hG = READOUT ( { hKi } ai∈V ) . ( 2 ) The READOUT function can be a simple permutation invariant function such as summation and mean , or a more sophisticated graph-level pooling algorithm ( Ying et al. , 2018 ; Zhang et al. , 2018 ) . An illustrative example of GNN encoder is shown in Figure 1a . 2.2 PRESERVING CHEMICAL REACTION EQUIVALENCE . A chemical reaction defines a particular relation “ → ” between reactant set R = { r1 , r2 , · · · } and product set P = { p1 , p2 , · · · } : r1 + r2 + · · · → p1 + p2 + · · · . ( 3 ) A chemical reaction usually represents a closed system where several physical quantities of the system retain constant before and after the reaction , such as mass , energy , charge , etc . Therefore , it describes a certain kind of equivalence between its reactants and products in the chemical reaction space . Our key idea is to preserve such equivalence in the molecule embedding space : ∑ r∈R hr = ∑ p∈P hp . ( 4 ) The above simple constraint is crucial to improving the quality of molecule embeddings . We first show , through the following proposition , that the chemical reaction relation “ → ” is an equivalence relation under the constraint of Eq . ( 4 ) : Proposition 1 Let M be the set of molecules , R ⊆M and P ⊆M be the reactant set and product set of a chemical reaction , respectively . If R → P ⇔ ∑ r∈R hr = ∑ p∈P hp for all chemical reactions , then “ → ” is an equivalence relation on 2M that satisfies the following three properties : ( 1 ) Reflexivity : A→ A , for all A ∈ 2M ; ( 2 ) Symmetry : A→ B ⇔ B → A , for all A , B ∈ 2M ; ( 3 ) Transitivity : If A→ B and B → C , then A→ C , for all A , B , C ∈ 2M . The proof of Proposition 1 is in Appendix B . One important corollary of Proposition 1 is that , the set of all subsets of M , i.e . 2M , is naturally split into equivalence classes based on the equivalence relation “ → ” . For all molecule sets within one equivalent class , the sum of embeddings of all molecules they consist of should be equal . For example , in organic synthesis , a target compound t may be made from three different sets of starting materials A , B , and C. Then the sets A , B , C as well as { t } belong to one equivalence class , and we have ∑ m∈A hm = ∑ m∈B hm = ∑ m∈C hm = ht . Note that the starting materials are usually small and basic molecules that frequently appear in a number of synthesis routes . Therefore , Eq . ( 4 ) forms a system of linear equations , wherein the chemical reaction equivalence imposes strong constraint on the embeddings of base molecules . As a result , the feasible solutions of molecule embeddings will be more robust , and the whole embedding space will be more organized . See the visualized result on molecule embedding space in Section 3.5 for more details . We can further show that , the constraint in Eq . ( 4 ) is also able to improve the generalization ability of molecule embeddings . To see this , we first define reaction center for a chemical reaction . The reaction center of R → P is defined as a subgraph of R consisting of atoms whose bonds have changed after reaction . For example , for the reaction in the upper part of Figure 1b , its reaction center is the two oxygen atoms marked in dark orange , since they are the only two atoms whose bonds have changed . Given the concept of reaction center , we have the following proposition : Proposition 2 Let R→ P be a chemical reaction where R is the reactant set and P is the product set , and C be its reaction center . Suppose that we use the GNN ( whose number of layers is K ) shown in Eqs . ( 1 ) and ( 2 ) as the molecule encoder , and set the READOUT function in Eq . ( 2 ) as summation . Then for an arbitrary atom a in one of the reactant whose final representation is hKa , the residual term ∑ r∈R hr − ∑ p∈P hp is a function of h K a if and only if the distance between atom a and reaction center C is less than K. The proof of Proposition 2 is in Appendix C. Proposition 2 indicates that the residual between reactant embedding and product embedding will fully and only depend on atoms that are less than K hops away from the reaction center . For example , as shown in Figure 1b , suppose that we use a 3- layer GNN to process Fischer esterification of propionic acid and propanol , then the residual between reactant embedding and product embedding will totally depend on the reaction center ( colored in orange ) as well as atoms whose distance from the reaction center is 1 or 2 ( colored in light orange ) . This implies that , if the GNN encoder has been well-optimized on this chemical equation and outputs perfect embeddings , i.e. , hCH3CH2COOH + hCH3CH2CH2OH = hCH3CH2COOCH2CH2CH3 + hH2O , then the equation hR1−CH2COOH + hR2−CH2CH2OH = hR1−CH2COOCH2CH2−R2 + hH2O will also hold for any functional group R1 and R2 , since the residual between the two sides of the equation does not depend on R1 or R2 that are more than 2 hops away from the reaction center . The induced general chemical reaction R1-CH2COOH + R2-CH2CH2OH→ R1-CH2COOCH2CH2-R2 + H2O is called a reaction template , which abstracts a group of chemical reactions within the same category . The learned reaction templates are essential to improving the generalization ability of our model , as the model can easily apply this knowledge to reactions that are unseen in training data but comply with a known reaction template ( e.g. , acetic acid plus propanol , butyric acid plus butanol ) . We will further show in Section 3.5 how reaction templates are encoded in molecule embeddings . Remarks . Below are some of our remarks to provide further understanding on the proposed model : First , compared with ( Jin et al. , 2017 ) that also learns reaction templates , our model does not need a complicated network to calculate attention scores , nor requires additional atom mapping information between reactants and products as input . Moreover , our model is theoretically able to learn a reaction template based on even only one reaction instance , which makes it particularly useful in few-shot learning ( Wang et al. , 2020 ) scenario . See Section 3.1 for the experimental result . Second , organic reactions are usually imbalanced and omit small and inorganic molecules to highlight the product of interest ( e.g. , H2O is usually omitted from Fischer esterification ) . Nonetheless , our model can still learn meaningful reaction templates as long as chemical reactions are written in a consistent manner ( e.g. , H2O is omitted for all Fischer esterification ) . Third , the number of GNN layers K can greatly impact the learned reaction templates according to Proposition 2 : A small K may not be enough to represent a meaningful reaction template ( e.g. , in Fischer esterification , the necessary carbonyl group “ C=O ” in carboxylic acid will not appear in the reaction template ifK < 3 ) , while a largeK may include unnecessary atoms for a reaction template and thus reduces its coverage ( e.g. , the Fischer esterification of formic acid HCOOH and methanol CH3OH is not covered by the reaction template shown in Figure 1b ) . The empirical impact of K is shown in Appendix D . | The paper is about learning a vector representation of molecules in a way that the learned representation preserves the equivalence of molecules with respect to chemical reactions. They do so by forcing the sum of reactant embeddings and the sum of product embeddings to be equal for each chemical equation. They have also shown experimentally that such embeddings can improve the performance of downstream tasks such as chemical reaction prediction, molecule property prediction, and graph edit distance prediction problems. | SP:70fa69d4e05f33ab8386117417c229a60e55b658 |
Monotonicity as a requirement and as a regularizer: efficient methods and applications | 1 INTRODUCTION . Highly expressive model classes such as artificial neural networks have achieved impressive prediction performance across a broad range of supervised learning tasks and domains ( Krizhevsky et al. , 2012 ; Graves & Jaitly , 2014 ; Bahdanau et al. , 2014 ) . However , finding predictors attaining low risk on unseen data is often not enough to enable the use of such models in practice . In fact , practical applications usually have more requirements other than prediction accuracy . Hence , devising approaches that search risk minimizers satisfying practical needs led to several research threads seeking to enable the use of neural networks in real-life scenarios . Examples of such requirements include : ( 1 ) Robustness , where low risk is expected even if the model is evaluated under distribution shifts , ( 2 ) Fairness , where the performance of the model is expected to not significantly change across different sub-populations of the data , and ( 3 ) Explainability/Interpretability , where models are expected to indicate how the features of the data affect their predictions . In addition to the requirements mentioned above , a property commonly expected in trained models in certain applications is monotonicity with respect to some subset of the input dimensions , i.e. , an increase ( or decrease ) along some particular dimensions strictly imply the function value will not decrease ( or will not increase ) , provided that all other dimensions are kept fixed . As a result , the behavior of monotonic models will be more aligned with the properties that the data under consideration is believed to satisfy . For example , in the models used to accept/reject job applications , we expect acceptance scores to be monotonically non-decreasing with respect to features such as past years of experience of a candidate . Thus , given two applicants with exactly the same features except their years of experience , the more experienced candidate should be assigned an equal or higher chance of getting accepted . For applications where monotonicity is expected , having a predictor failing to satisfy this requirement would damage the user ’ s confidence . As such , different strategies have been devised in order to enable training monotonic predictors . These approaches can be divided into two main categories . The first one is monotonicity by construction , where the focus lies on defining a model class that guarantees monotonicity in all of its elements Bakst et al . ( 2021 ) ; Wehenkel & Louppe ( 2019 ) ; Nguyen & Martı́nez ( 2019 ) ; You et al . ( 2017 ) ; Garcia & Gupta ( 2009 ) ; Archer & Wang ( 1993 ) . However , this approach can not be used with general architectures in the case of neural networks . Additionally , the model class might be so constrained that it might affect the prediction performance . Alternatively , a second approach is based on encouraging monotonicity during training , i.e. , searching for monotonic candidates within a general class of models ( Liu et al. , 2020 ; Sivaraman et al. , 2020 ; Gupta et al. , 2019 ) . Such a group of methods is more generally applicable and can be used , for instance , with any neural network architecture . However , they are not guaranteed to yield monotonic predictors unless extra verification/certification steps are performed , which can be computationally very expensive . In addition to being a requirement as in the examples discussed above , monotonicity has also been observed to be a useful feature in certain cases . For example , it can define an effective inductive bias and improve generalization in cases where prior knowledge indicates the data generation process satisfies such a property ( Dugas et al. , 2001 ) . In such cases , however , it is not necessary to satisfy the property everywhere , since it is enforced simply as a desirable feature of trained models rather than a design specification . In this work , we tackle the problem of performing empirical risk minimization over rich classes of models such as neural networks , while simultaneously searching for monotonic predictors within the set of risk minimizing solutions . In summary , our contributions are two-fold : 1. monotonicity as a requirement : We show that previous methods can only satisfy monotonicity either near the training data or near the boundaries of the input domain . Then , we propose an efficient algorithm that tackles this problem . In short , we apply Mixup ( Zhang et al. , 2018 ) between the data and random points to populate the input space , which is shown to enforce monotonicity in a larger volume relative to previous methods in literature . To the best of our knowledge , this is the first work that studies the effect of the sample points used in calculating the monotonicity constraints . 2. monotonicity as a regularizer : We define a new notion of monotonicity which is shown to be useful when enforced for applications such as object recognition or generative modeling of images . In these cases , it is not necessarily required to enforce the property everywhere and , as such , the constraints that focus only on the actual data points are discussed ( i.e. , mixup is not needed ) . Models satisfying the property are compared with standard predictors across three applications , where it is shown the property is beneficial without compromising the original performance . 2 BACKGROUND AND RELATED WORK . We start by defining the notion of partial monotonicity used throughout the paper . Consider the standard supervised learning setting where data instances are observed in pairs x , y ∼ X ×Y , where X ⊂ Rd and Y ⊂ R correspond to the input and output spaces , respectively . Further , consider the function f : X 7→ Y , and let M indicate some subset of the input dimensions , i.e. , M ⊂ { 1 , ... d } , such that x = concat ( xM , xM̄ ) , where M̄ = { 1 , ... , d } \M . We further overload the notation of function calls to f such that f ( x ) = f ( xM , xM̄ ) . Definition 1 Partially monotonic functions relative to M : We say f is monotonically nondecreasing relative to M 1 , denoted fM , if f ( xM , xM̄ ) ≤ f ( x′M , xM̄ ) , ∀ xM ≤ x′M , ∀ xM̄ , where the comparison xM ≤ x′M is performed for every dimension . This definition covers functions that do not decrease in value given increasing changes along a subset of the input dimensions , provided that all other dimensions are kept unchanged . Several approaches were introduced for defining model classes that have such a property . The simplest approach restricts the weights of the network to be non-negative ( Archer & Wang , 1993 ) . However , doing so affects the prediction performance . Another approach corresponds to using lattice regression models proposed by Garcia & Gupta ( 2009 ) ; You et al . ( 2017 ) . In this case , models are given by interpolations in a grid defined by training data . Such a class of models can be made monotonic via the choice of the interpolation strategy and recently introduced variations ( Bakst et al. , 2021 ) scale efficiently with the dimension of the input space , but downstream applications might still require different classes of models to satisfy this type of property . For neural networks , approaches such as ( Nguyen & Martı́nez , 2019 ) reparameterize fully connected layers such that the gradients with respect to parameters can only be non-negative . Wehenkel & Louppe ( 2019 ) , on the other hand , 1Monotonically non-increasing f can be defined analogously . consider the class of predictors H : X 7→ Y of the form H ( x ) = ∫ x 0 h ( t ) dt + H ( 0 ) , where h ( t ) is a strictly positive mapping parameterized by a neural network . While such approaches guarantee monotonicity by design , they can be too restrictive or give overly complicated learning procedures . For example , the approach in ( Wehenkel & Louppe , 2019 ) requires backpropagating through the integral . An alternative approach is based on searching over general classes of models while assigning higher importance to predictors observed to be monotonic . Similar to the case of adversarial training ( Goodfellow et al. , 2014 ) , Sivaraman et al . ( 2020 ) proposed an approach to find counterexamples , i.e. , pairs of points where the monotonicity constraint is violated , which are included in the training data to enforce monotonicity conditions in the next iterations of the model . However , this approach only supports fully-connected ReLU networks . Moreover , the procedure for finding the counterexamples is costly . Alternatively , Liu et al . ( 2020 ) ; Gupta et al . ( 2019 ) introduced point-wise regularization penalties for enforcing monotonicity , where the penalties are estimated via sampling . While Liu et al . ( 2020 ) use uniform random draws , Gupta et al . ( 2019 ) apply the regularization penalty over the training instances . Both approaches have shortcomings that we seek to address . 3 MONOTONICITY AS A REQUIREMENT . Given the standard supervised learning setting where ` : Y2 7→ R+ is a loss function indicating the goodness of the predictions relative to ground truth targets , the goal is to find a predictor h ∈ H such that its expected loss – or the so-called risk – over the input space is minimized . Such an approach yields the empirical risk minimization framework once a finite sample is used to estimate the risk . However , given the extra monotonicity requirement , we consider an augmented framework where such a property is further enforced . We seek the optimal monotonic predictors relative to M , h∗M : h∗M ∈ arg minh∈H Ex , y∼X×Y [ ` ( h ( x ) , y ) ] + γΩ ( h , M ) , ( 1 ) where γ is a hyperparameter weighing the importance of the penalty Ω ( h , M ) which , in turn , is a measure of how monotonic the predictor h is relative to the dimensions indicated by M . Ω ( h , M ) can be defined by the following gradient penalty ( Gupta et al. , 2019 ; Liu et al. , 2020 ) : Ω ( h , M ) = Ex∼D [ ∑ i∈M max ( 0 , −∂h ( x ) ∂xi ) 2 ] , ( 2 ) where ∂h ( x ) ∂xi indicates the gradients of h relative to the input dimensions i ∈ M , which are constrained to be non-negative , rendering h monotonically non-decreasing relative to M . At this point , the only missing ingredient to define algorithms to estimate h∗M is how to define the distribution D over which the expectation in Eq . 2 is computed , discussed in the following sections . 3.1 CHOOSING DISTRIBUTIONS OVER WHICH TO COMPUTE THE MONOTONICITY PENALTY . In the following , we present and discuss two past choices for D : 1 ) Define D as the empirical distribution of the training sample : In ( Gupta et al. , 2019 ) , given a training dataset of size N , in addition to using the observed data to estimate the risk , the same data is used to compute the monotonicity penalty so that : Ωtrain ( h , M ) = 1 N N∑ k=1 ∑ i∈M max ( 0 , −∂h ( x k ) ∂xki ) 2 , where xk indicates the k-th instance within the training sample . While this choice seems natural and can be easily implemented , it only enforces monotonicity in the region where the training samples lie , which can be problematic . For example , in case of covariate-shift , the test data might lie in parts of the space different from that of the training data so monotonicity can not be guaranteed . We thus argue that one needs to enforce the monotonicity property in a region larger than what is defined by the training data . In Appendix B , we conduct an evaluation under domain shift and show the issue to become more and more relevant with the increase in the dimension d of the input space X . 2 ) Define D = Uniform ( X ) : In ( Liu et al. , 2020 ) , a simple strategy is defined so that Ω is computed over the random points drawn uniformly across the entire input space X ; i.e . : Ωrandom ( h , M ) = Ex∼Uniform ( X ) [ ∑ i∈M max ( 0 , −∂h ( x ) ∂xi ) 2 ] . Despite its simplicity and ease of use , this approach has some flaws . In high-dimensional spaces , random draws from any distribution of bounded variance will likely lie in the boundaries of the space , hence far from the regions where data actually lie . Moreover , it is commonly observed that naturally occurring high-dimensional data is structured in lower-dimensional manifolds ( c.f . ( Fefferman et al. , 2016 ) for an in-depth discussion on the manifold hypothesis ) . It is thus likely that random draws from the uniform distribution will lie nowhere near regions of space where training/testing data will be observed . We further illustrate the issue with examples in Appendix A , which can be summarized as follows : consider the cases of uniform distributions over the unit n-sphere . In such a case , the probability of a random draw lying closer to the sphere ’ s surface than to its center is P ( ||x||2 > 12 ) = 2n−1 2n , as given by the volume ratio of the two regions of interest . Note that P ( ||x||2 > 12 ) → 1 as n → ∞ , which suggests the approach in ( Liu et al. , 2020 ) will only enforce monotonicity at the boundaries of the space . In summary , the previous approaches are either too focused on enforcing monotonicity where the training data lie , or too loose such that the monotonicity property is uniformly enforced across a large space , and the actual data manifold may be neglected . We thus propose an alternative approach where we can have some control over the volume of the input space where the monotonicity property will be enforced . Our approach uses the idea of data mixup ( Zhang et al. , 2018 ; Verma et al. , 2019 ; Chuang & Mroueh , 2021 ) , where auxiliary data is created via interpolations of pairs of data points , to populate areas of the space that are otherwise disregarded . Mixup was introduced by Zhang et al . ( 2018 ) with the goal of training classifiers with smooth outputs across trajectories in the input space from instances of different classes . Given a pair of data points ( x′ , y′ ) , ( x′′ , y′′ ) , the method augments the training data using interpolations given by ( λx′+ ( 1−λ ) x′′ , λy′+ ( 1−λ ) y′′ ) , where λ ∼ Uniform ( [ 0 , 1 ] ) . We propose using mixup to generate points where the monotonicity penalty Ω can be computed and highlight the following motivations for doing so : ( 1 ) Interpolation of data points more densely populates the convex hull of the training data . ( 2 ) Extrapolation cases where mixup is performed between data points and instances obtained at random results in points that lie anywhere between the data manifold and the boundaries of the space . We thus claim that performing mixup enables the computation of Ω on parts of the space that are disregarded if one focus only on either observed data or random draws from uninformed choices of distributions such as the uniform . | This paper proposes an incremental improvement to existing methods that encourage monotonicity through a regularization term. The contribution of the paper is about how to sample the data to compute this regularization term, which is an expectation w.r.t. a data distribution. So instead of purely sampling from existing training data or performing uniform sampling in potentially high-dimensional feature space, this paper proposes to use mixup, which essentially involves creating synthetic examples by interpolating between existing training examples. The authors also extend this regularization term to the case where the prediction function outputs a vector, e.g., multi-class classification), and the case of VAE. The authors provide some experiment evidence that the proposed change can reach better performance for some data sets. | SP:615886c264f4481f18aa1a34098c946664a55324 |
Monotonicity as a requirement and as a regularizer: efficient methods and applications | 1 INTRODUCTION . Highly expressive model classes such as artificial neural networks have achieved impressive prediction performance across a broad range of supervised learning tasks and domains ( Krizhevsky et al. , 2012 ; Graves & Jaitly , 2014 ; Bahdanau et al. , 2014 ) . However , finding predictors attaining low risk on unseen data is often not enough to enable the use of such models in practice . In fact , practical applications usually have more requirements other than prediction accuracy . Hence , devising approaches that search risk minimizers satisfying practical needs led to several research threads seeking to enable the use of neural networks in real-life scenarios . Examples of such requirements include : ( 1 ) Robustness , where low risk is expected even if the model is evaluated under distribution shifts , ( 2 ) Fairness , where the performance of the model is expected to not significantly change across different sub-populations of the data , and ( 3 ) Explainability/Interpretability , where models are expected to indicate how the features of the data affect their predictions . In addition to the requirements mentioned above , a property commonly expected in trained models in certain applications is monotonicity with respect to some subset of the input dimensions , i.e. , an increase ( or decrease ) along some particular dimensions strictly imply the function value will not decrease ( or will not increase ) , provided that all other dimensions are kept fixed . As a result , the behavior of monotonic models will be more aligned with the properties that the data under consideration is believed to satisfy . For example , in the models used to accept/reject job applications , we expect acceptance scores to be monotonically non-decreasing with respect to features such as past years of experience of a candidate . Thus , given two applicants with exactly the same features except their years of experience , the more experienced candidate should be assigned an equal or higher chance of getting accepted . For applications where monotonicity is expected , having a predictor failing to satisfy this requirement would damage the user ’ s confidence . As such , different strategies have been devised in order to enable training monotonic predictors . These approaches can be divided into two main categories . The first one is monotonicity by construction , where the focus lies on defining a model class that guarantees monotonicity in all of its elements Bakst et al . ( 2021 ) ; Wehenkel & Louppe ( 2019 ) ; Nguyen & Martı́nez ( 2019 ) ; You et al . ( 2017 ) ; Garcia & Gupta ( 2009 ) ; Archer & Wang ( 1993 ) . However , this approach can not be used with general architectures in the case of neural networks . Additionally , the model class might be so constrained that it might affect the prediction performance . Alternatively , a second approach is based on encouraging monotonicity during training , i.e. , searching for monotonic candidates within a general class of models ( Liu et al. , 2020 ; Sivaraman et al. , 2020 ; Gupta et al. , 2019 ) . Such a group of methods is more generally applicable and can be used , for instance , with any neural network architecture . However , they are not guaranteed to yield monotonic predictors unless extra verification/certification steps are performed , which can be computationally very expensive . In addition to being a requirement as in the examples discussed above , monotonicity has also been observed to be a useful feature in certain cases . For example , it can define an effective inductive bias and improve generalization in cases where prior knowledge indicates the data generation process satisfies such a property ( Dugas et al. , 2001 ) . In such cases , however , it is not necessary to satisfy the property everywhere , since it is enforced simply as a desirable feature of trained models rather than a design specification . In this work , we tackle the problem of performing empirical risk minimization over rich classes of models such as neural networks , while simultaneously searching for monotonic predictors within the set of risk minimizing solutions . In summary , our contributions are two-fold : 1. monotonicity as a requirement : We show that previous methods can only satisfy monotonicity either near the training data or near the boundaries of the input domain . Then , we propose an efficient algorithm that tackles this problem . In short , we apply Mixup ( Zhang et al. , 2018 ) between the data and random points to populate the input space , which is shown to enforce monotonicity in a larger volume relative to previous methods in literature . To the best of our knowledge , this is the first work that studies the effect of the sample points used in calculating the monotonicity constraints . 2. monotonicity as a regularizer : We define a new notion of monotonicity which is shown to be useful when enforced for applications such as object recognition or generative modeling of images . In these cases , it is not necessarily required to enforce the property everywhere and , as such , the constraints that focus only on the actual data points are discussed ( i.e. , mixup is not needed ) . Models satisfying the property are compared with standard predictors across three applications , where it is shown the property is beneficial without compromising the original performance . 2 BACKGROUND AND RELATED WORK . We start by defining the notion of partial monotonicity used throughout the paper . Consider the standard supervised learning setting where data instances are observed in pairs x , y ∼ X ×Y , where X ⊂ Rd and Y ⊂ R correspond to the input and output spaces , respectively . Further , consider the function f : X 7→ Y , and let M indicate some subset of the input dimensions , i.e. , M ⊂ { 1 , ... d } , such that x = concat ( xM , xM̄ ) , where M̄ = { 1 , ... , d } \M . We further overload the notation of function calls to f such that f ( x ) = f ( xM , xM̄ ) . Definition 1 Partially monotonic functions relative to M : We say f is monotonically nondecreasing relative to M 1 , denoted fM , if f ( xM , xM̄ ) ≤ f ( x′M , xM̄ ) , ∀ xM ≤ x′M , ∀ xM̄ , where the comparison xM ≤ x′M is performed for every dimension . This definition covers functions that do not decrease in value given increasing changes along a subset of the input dimensions , provided that all other dimensions are kept unchanged . Several approaches were introduced for defining model classes that have such a property . The simplest approach restricts the weights of the network to be non-negative ( Archer & Wang , 1993 ) . However , doing so affects the prediction performance . Another approach corresponds to using lattice regression models proposed by Garcia & Gupta ( 2009 ) ; You et al . ( 2017 ) . In this case , models are given by interpolations in a grid defined by training data . Such a class of models can be made monotonic via the choice of the interpolation strategy and recently introduced variations ( Bakst et al. , 2021 ) scale efficiently with the dimension of the input space , but downstream applications might still require different classes of models to satisfy this type of property . For neural networks , approaches such as ( Nguyen & Martı́nez , 2019 ) reparameterize fully connected layers such that the gradients with respect to parameters can only be non-negative . Wehenkel & Louppe ( 2019 ) , on the other hand , 1Monotonically non-increasing f can be defined analogously . consider the class of predictors H : X 7→ Y of the form H ( x ) = ∫ x 0 h ( t ) dt + H ( 0 ) , where h ( t ) is a strictly positive mapping parameterized by a neural network . While such approaches guarantee monotonicity by design , they can be too restrictive or give overly complicated learning procedures . For example , the approach in ( Wehenkel & Louppe , 2019 ) requires backpropagating through the integral . An alternative approach is based on searching over general classes of models while assigning higher importance to predictors observed to be monotonic . Similar to the case of adversarial training ( Goodfellow et al. , 2014 ) , Sivaraman et al . ( 2020 ) proposed an approach to find counterexamples , i.e. , pairs of points where the monotonicity constraint is violated , which are included in the training data to enforce monotonicity conditions in the next iterations of the model . However , this approach only supports fully-connected ReLU networks . Moreover , the procedure for finding the counterexamples is costly . Alternatively , Liu et al . ( 2020 ) ; Gupta et al . ( 2019 ) introduced point-wise regularization penalties for enforcing monotonicity , where the penalties are estimated via sampling . While Liu et al . ( 2020 ) use uniform random draws , Gupta et al . ( 2019 ) apply the regularization penalty over the training instances . Both approaches have shortcomings that we seek to address . 3 MONOTONICITY AS A REQUIREMENT . Given the standard supervised learning setting where ` : Y2 7→ R+ is a loss function indicating the goodness of the predictions relative to ground truth targets , the goal is to find a predictor h ∈ H such that its expected loss – or the so-called risk – over the input space is minimized . Such an approach yields the empirical risk minimization framework once a finite sample is used to estimate the risk . However , given the extra monotonicity requirement , we consider an augmented framework where such a property is further enforced . We seek the optimal monotonic predictors relative to M , h∗M : h∗M ∈ arg minh∈H Ex , y∼X×Y [ ` ( h ( x ) , y ) ] + γΩ ( h , M ) , ( 1 ) where γ is a hyperparameter weighing the importance of the penalty Ω ( h , M ) which , in turn , is a measure of how monotonic the predictor h is relative to the dimensions indicated by M . Ω ( h , M ) can be defined by the following gradient penalty ( Gupta et al. , 2019 ; Liu et al. , 2020 ) : Ω ( h , M ) = Ex∼D [ ∑ i∈M max ( 0 , −∂h ( x ) ∂xi ) 2 ] , ( 2 ) where ∂h ( x ) ∂xi indicates the gradients of h relative to the input dimensions i ∈ M , which are constrained to be non-negative , rendering h monotonically non-decreasing relative to M . At this point , the only missing ingredient to define algorithms to estimate h∗M is how to define the distribution D over which the expectation in Eq . 2 is computed , discussed in the following sections . 3.1 CHOOSING DISTRIBUTIONS OVER WHICH TO COMPUTE THE MONOTONICITY PENALTY . In the following , we present and discuss two past choices for D : 1 ) Define D as the empirical distribution of the training sample : In ( Gupta et al. , 2019 ) , given a training dataset of size N , in addition to using the observed data to estimate the risk , the same data is used to compute the monotonicity penalty so that : Ωtrain ( h , M ) = 1 N N∑ k=1 ∑ i∈M max ( 0 , −∂h ( x k ) ∂xki ) 2 , where xk indicates the k-th instance within the training sample . While this choice seems natural and can be easily implemented , it only enforces monotonicity in the region where the training samples lie , which can be problematic . For example , in case of covariate-shift , the test data might lie in parts of the space different from that of the training data so monotonicity can not be guaranteed . We thus argue that one needs to enforce the monotonicity property in a region larger than what is defined by the training data . In Appendix B , we conduct an evaluation under domain shift and show the issue to become more and more relevant with the increase in the dimension d of the input space X . 2 ) Define D = Uniform ( X ) : In ( Liu et al. , 2020 ) , a simple strategy is defined so that Ω is computed over the random points drawn uniformly across the entire input space X ; i.e . : Ωrandom ( h , M ) = Ex∼Uniform ( X ) [ ∑ i∈M max ( 0 , −∂h ( x ) ∂xi ) 2 ] . Despite its simplicity and ease of use , this approach has some flaws . In high-dimensional spaces , random draws from any distribution of bounded variance will likely lie in the boundaries of the space , hence far from the regions where data actually lie . Moreover , it is commonly observed that naturally occurring high-dimensional data is structured in lower-dimensional manifolds ( c.f . ( Fefferman et al. , 2016 ) for an in-depth discussion on the manifold hypothesis ) . It is thus likely that random draws from the uniform distribution will lie nowhere near regions of space where training/testing data will be observed . We further illustrate the issue with examples in Appendix A , which can be summarized as follows : consider the cases of uniform distributions over the unit n-sphere . In such a case , the probability of a random draw lying closer to the sphere ’ s surface than to its center is P ( ||x||2 > 12 ) = 2n−1 2n , as given by the volume ratio of the two regions of interest . Note that P ( ||x||2 > 12 ) → 1 as n → ∞ , which suggests the approach in ( Liu et al. , 2020 ) will only enforce monotonicity at the boundaries of the space . In summary , the previous approaches are either too focused on enforcing monotonicity where the training data lie , or too loose such that the monotonicity property is uniformly enforced across a large space , and the actual data manifold may be neglected . We thus propose an alternative approach where we can have some control over the volume of the input space where the monotonicity property will be enforced . Our approach uses the idea of data mixup ( Zhang et al. , 2018 ; Verma et al. , 2019 ; Chuang & Mroueh , 2021 ) , where auxiliary data is created via interpolations of pairs of data points , to populate areas of the space that are otherwise disregarded . Mixup was introduced by Zhang et al . ( 2018 ) with the goal of training classifiers with smooth outputs across trajectories in the input space from instances of different classes . Given a pair of data points ( x′ , y′ ) , ( x′′ , y′′ ) , the method augments the training data using interpolations given by ( λx′+ ( 1−λ ) x′′ , λy′+ ( 1−λ ) y′′ ) , where λ ∼ Uniform ( [ 0 , 1 ] ) . We propose using mixup to generate points where the monotonicity penalty Ω can be computed and highlight the following motivations for doing so : ( 1 ) Interpolation of data points more densely populates the convex hull of the training data . ( 2 ) Extrapolation cases where mixup is performed between data points and instances obtained at random results in points that lie anywhere between the data manifold and the boundaries of the space . We thus claim that performing mixup enables the computation of Ω on parts of the space that are disregarded if one focus only on either observed data or random draws from uninformed choices of distributions such as the uniform . | The paper has two main contributions: 1. It takes a known monotonicity regularizer and trains with it using a new distribution that is roughly a mixing of uniform and the training distribution. It shows empirically that using this method increases the "size" of the input region in which the model is monotonic. 2. It defines several regularizers that are meant to encourage "monotonic behavior" of the model's output w.r.t the outputs of an intermediate layer or latent variable. It provides experiments that show how using these regularizers does not hurt the model's performance and two applications of the added structure: 1) detecting noisey/adverserial examples and 2) more controllable generation in generative models. | SP:615886c264f4481f18aa1a34098c946664a55324 |
On Transportation of Mini-batches: A Hierarchical Approach | 1 INTRODUCTION . Optimal transport ( OT ) ( Villani , 2021 ; 2008 ; Peyré et al. , 2019 ) has emerged as an efficient tool in dealing with problems involving probability measures . Under the name of Wasserstein distance , OT has been widely utilized to solve problems such as generative modeling ( Arjovsky et al. , 2017 ; Tolstikhin et al. , 2018 ; Salimans et al. , 2018 ; Genevay et al. , 2018 ; Liutkus et al. , 2019 ) , barycenter problem ( Ho et al. , 2017 ; Li et al. , 2020 ) , and approximate Bayesian computation ( Bernton et al. , 2019a ; Nadjahi et al. , 2020 ) . Furthermore , OT can also provide the most economical map of moving masses between probability measures , which is very useful in various tasks such as color transfer ( Ferradans et al. , 2014 ; Perrot et al. , 2016 ) , natural language procesing ( Alvarez-Melis & Jaakkola , 2018 ) , and domain adaptation ( alignment ) ( Courty et al. , 2016 ; Lee et al. , 2019a ; Xu et al. , 2020 ) , and graph processing ( Titouan et al. , 2019 ; Xu et al. , 2019 ; Chen et al. , 2020 ) . Although OT has attracted growing attention in recent years , a major barrier that prevents OT from being ubiquitous is its heavy computational cost . When the two probability measures are discrete with n supports , solving the Wasserstein distance via the interior point methods has the complexity of O ( n3 log n ) ( Pele & Werman , 2009 ) , which is extremely expensive when n is large . There are two main lines of works that focus on easing this computational burden . The first approach is to find a good enough approximation of the solution by adding an entropic regularized term on the objective function ( Cuturi , 2013 ) . Several works ( Altschuler et al. , 2017 ; Lin et al. , 2019 ) show that the entropic approach can produce a ε-approximated solution at the same time reduces the computational complexity to O ( n2/ε2 ) . The second line of works named the “ slicing '' approach is based on the closed-form of Wasserstein distance in one-dimensional space , which has the computational complexity of order O ( n log n ) . There are various variants in this directions ; i.e. , ( Bonneel et al. , 2015 ; Deshpande et al. , 2019 ; Kolouri et al. , 2019 ; Nguyen et al. , 2021a ; b ) , these all belong to the family of sliced Wasserstein distances . Recently , some methods are proposed to combine the dimensional reduction approach with the entropic solver of Wasserstein distance to inherit advantages from both directions ( Paty & Cuturi , 2019 ; Muzellec & Cuturi , 2019 ; Lin et al. , 2020a ; b ) . Although those works have reduced the computational cost of OT considerably , computing OT is nearly impossible in the big data settings where n could be as large as few millions . In particular , solving OT requires to compute and store a n × n cost matrix that is impractical with current computational devices . Especially in deep learning applications , both supports of empirical measures and the cost matrix must be stored in a same device ( e.g . a GPU ) for automatic differentiation . This problem exists in all variants of OT including Wasserstein distance , entropic Wasserstein , and sliced Wasserstein distance . Therefore , it leads to the development of the mini-batches method for OT ( Genevay et al. , 2018 ; Sommerfeld et al. , 2019 ) , which we refer to as mini-batch OT loss . The main idea of the mini-batch method is to divide the original samples into multiple subsets ( mini-batches ) , in the hope that each pair of subsets ( mini-batches ) could capture some structures of the two probability measures , meanwhile , the computing OT cost between two mini-batches is cheap due to a very small size of mini-batches . Then the overall loss is defined as the average of distances between pairs of mini-batches . This scheme was applied for many forms of Wasserstein distances ( Deshpande et al. , 2018 ; Bhushan Damodaran et al. , 2018 ; Kolouri et al. , 2018 ; Salimans et al. , 2018 ) , and was theoretically studied in the works of ( Bellemare et al. , 2017 ; Bernton et al. , 2019b ; Nadjahi et al. , 2019 ) . Recently , Fatras et al . ( Fatras et al. , 2020 ; 2021b ) formulated this approach by giving a formal definition of the mini-batch OT loss , studying its asymptotic behavior , and investigating its gradient estimation properties . Despite being applied successfully , the current mini-batch OT loss does not consider the relationship between mini-batches and treats every pair of mini-batches the same . This causes undesirable effects in measuring the discrepancy between probability measures . First , the m-OT loss is shown to be an approximation of a discrepancy ( the population m-OT ) that does not preserve the metricity property , namely , this discrepancy is always positive even when two probability measures are identical . Second , it is also unclear whether this discrepancy achieves the minimum value when the two probability measures are the same . That naturally raises the question if we could propose a better mini-batching scheme to sort out these issues in order to improve the performance of the OT in practical applications . Contribution : In this paper , we propose a novel mini-batching scheme for optimal transport , which is named as Batch of Mini-batches Optimal Transport ( BoMb-OT ) . In particular , the BoMb-OT views every mini-batch as a point in the product space , then a set of mini-batches could be considered as an empirical measure . We now could employ the Kantorovich formulation between these two empirical measures in the product space as a discrepancy between two sets of mini-batches . In summary , our main contributions are two-fold : 1 . First , the BoMb-OT could provide a more similar transportation plan to the original OT than the m-OT , which leads to a more meaningful discrepancy using mini-batches . In particular , we prove that the BoMb-OT approximates a well-defined metric on the space of probability measures , named population BoMb-OT . Furthermore , the entropic regularization version of population BoMb-OT could be employed as a generalized version of the population m-OT . Specifically , when the regularization parameter in the entropic population BoMb-OT goes to infinity , its value approaches the value of the population m-OT . 2 . Second , we present the implementation strategy of the BoMb-OT and detailed algorithms in various applications in Appendix C. We then demonstrate the favorable performance of the BoMb-OT over the m-OT in two main applications that using optimal transport losses , namely , deep generative models and deep domain adaptation . Moreover , we also compare BoMb-OT to m-OT in other applications , such as sample matching , approximate Bayesian computation , color transfer , and gradient flow . In all applications , we also provide a careful investigation of the effects of two hyper-parameters of the mini-batching scheme , which are the number of mini-batches and the size of mini-batches , on the performance of the BoMb-OT and the m-OT . Organization : The remainder of the paper is organized as follows . In Section 2 , we provide backgrounds for optimal transport distances and the conventional mini-batching scheme ( m-OT ) . In Section 3 , we define the new mini-batching scheme for optimal transport distances , Batch of mini-batches Optimal Transport , and derive some of its theoretical properties . Section 4 benchmarks the proposed mini-batch scheme by extensive experiments on large-scale datasets , and followed by discussions in Section 5 . Finally , proofs of key results and extra materials are in the supplementary . Notation : For any probability measure µ on the Polish measurable space ( X , Σ ) , we denote ⊗m µ ( m ≥ 2 ) as the product measure on the product measurable space ( Xm , Σm ) . For any p ≥ 1 , we define Pp ( RN ) as the set of Borel probability measures with finite p-th moment defined on a given metric space ( RN , ‖.‖ ) . To simplify the presentation , we abuse the notation by using both the notation Xm for both the random vector ( x1 , . . . , xm ) ∈ Xm and the set { x1 , . . . , xm } , and we define by PXm : = 1m ∑m i=1 δxi the empirical measure ( the mini-batch measure ) associated with X m. For any set Xn : = { x1 , . . . , xn } and m ≥ 1 , we denote by [ Xn ] m the product set of Xn taken m times and ( Xn m ) the set of all m-element subsets of Xn . 2 BACKGROUND ON MINI-BATCH OPTIMAL TRANSPORT . In this section , we first review the definitions of the Wasserstein distance , the entropic Wasserstein , and the sliced Wasserstein . We then review the definition of the mini-batch optimal transport ( m-OT ) . 2.1 WASSERSTEIN DISTANCE AND ITS VARIANTS . We first start with the definition of Wasserstein distance and its variants . Let µ and ν be two probability measures on Pp ( RN ) . The Wasserstein p-distance between µ and ν is defined as follows : Wp ( µ , ν ) : = minπ∈Π ( µ , ν ) [ Eπ ( x , y ) ‖x− y‖p ] 1 p , where Π ( µ , ν ) : = { π : ∫ πdx = ν , ∫ πdy = µ } is the set of transportation plans between µ and ν . The entropic regularized Wasserstein to approximate the OT solution ( Altschuler et al. , 2017 ; Lin et al. , 2019 ) between µ and ν is defined as follows ( Cuturi , 2013 ) : W τp ( µ , ν ) : = minπ∈Π ( µ , ν ) { [ Eπ ( x , y ) ‖x − y‖p ] 1 p + τKL ( π|µ ⊗ ν ) } , where τ > 0 is a chosen regularized parameter and KL denotes the Kullback-Leibler divergence . Finally , the sliced Wasserstein ( SW ) ( Bonnotte , 2013 ; Bonneel et al. , 2015 ) is motivated by the closed-form of the Wasserstein distance in one-dimensional space . The formal definition of SW is : SWp ( µ , ν ) : = [ Eθ∼U ( SN−1 ) W pp ( θ ] µ , θ ] ν ) ] 1 p , where U ( SN−1 ) denotes the uniform measure over the ( N − 1 ) -dimensional unit hypersphere and θ ] is the orthogonal projection operator on direction θ . 2.2 MINI-BATCH OPTIMAL TRANSPORT . In this section , we first discuss the memory issue of large-scale optimal transport and challenges of dual solver . Then , we revisit the mini-batch OT loss that has been used in training deep generative models , domain adaptations , color transfer , and approximate Bayesian computation ( Bhushan Damodaran et al. , 2018 ; Genevay et al. , 2018 ; Tolstikhin et al. , 2018 ; Fatras et al. , 2020 ; Bernton et al. , 2019a ) . To ease the presentation , we are given Xn : = { x1 , . . . , xn } , Y n : = { y1 , . . . , yn } i.i.d . samples from µ and ν in turn . Let µn : = 1n ∑n i=1 δxi and νn : = 1 n ∑n i=1 δyi be two corresponding empirical measures from the whole data set . Here , n is usually large ( e.g. , millions ) and each support in Xn , Y n can be a high dimensional data point ( e.g . a high resolution image , video , etc ) . Memory issue of optimal transport : Using an OT loss between µn and νn needs to compute and store a n × n cost matrix which has one trillion float entries ( about 4 terabytes ) when n is about millions . Moreover , when dealing with deep neural networks , both support points and the cost matrix are required to be stored in the same memory ( e.g. , a GPU with 8 gigabytes memory ) as a part of the computational graph for automatic differentiation . This issue applies to all variants of OT losses , such as Wasserstein distance , entropic Wasserstein , sliced Wasserstein distance . Therefore , it is nearly impossible to compute OT and its variants in large-scale applications . Challenges of stochastic dual solver : Using stochastic optimization to solve the Kantorovich dual form is a possible approach to deal with large-scale OT , i.e . Wasserstein GAN ( Arjovsky et al. , 2017 ; Leygonie et al. , 2019 ) . However , the obtained distance has been shown to be very different from the original Wasserstein distance ( Mallasto et al. , 2019 ; Stanczuk et al. , 2021 ) . Using input convex neural networks is another choice to approximate the Brenier potential ( Makkuva et al. , 2020 ) . Nevertheless , recent work ( Korotin et al. , 2021 ) has indicated that input convex neural networks are not sufficient ( have limited power ) in approximating the Brenier potential . Furthermore , both mentioned approaches are restricted in the choice of ground metric . In particular , L1 norm is used in Wasserstein GAN to make the constraint of dual form into the Lipchitz constraint and L2 norm is for the existence of the Brenier potential . Mini-batch solution : As a popular alternative approach for stable large-scale OT with flexible choices of the ground metric , the mini-batch optimal transport is proposed ( Genevay et al. , 2018 ; Sommerfeld et al. , 2019 ) and has been widely used in various applications ( Arjovsky et al. , 2017 ; Deshpande et al. , 2018 ; Sommerfeld et al. , 2019 ; Bhushan Damodaran et al. , 2018 ) . In this approach , the original n samples are divided into subsets ( mini-batches ) of size m , where m is often the largest number that the computer can process , then an alternative solution of the original OT problem is formed by aggregating these smaller OT solutions from mini-batches . We now state an adapted definition of mini-batch OT ( m-OT ) scheme that was formulated in ( Fatras et al. , 2020 ) , including its two key parts : its transportation cost and its transportation plan . Definition 1 ( Empirical m-OT ) . For p ≥ 1 and integers m ≥ 1 , and k ≥ 1 , let d : Pp ( X ) × Pp ( X ) → [ 0 , ∞ ) be a function , i.e. , { Wp , W τp , SWp } . Then , the mini-batch OT ( m-OT ) loss and the transportation plan , a n× n matrix , between µn and νn are defined as follows : Ûk , md ( µn , νn ) : = 1 k2 k∑ i=1 k∑ j=1 d ( PXmi , PYmj ) ; π̂ m k ( µn , νn ) : = 1 k2 k∑ i=1 k∑ j=1 πXmi , Ymj , ( 1 ) whereXmi is sampled i.i.d from ( Xn m ) , Y mi is sampled i.i.d from ( Y n m ) , and the transport plan πXmi , Ymj , where its entries equal zero except those indexed of samples Xmi × Y mj , is the transportation plan when d ( PXmi , PYmj ) is an optimal transport metric . The above definition was generalized to the two original measures as follows in ( Fatras et al. , 2020 ) : Definition 2 ( Population m-OT ) . Assume that µ and ν are two probability measures on Pp ( X ) for given positive integers p ≥ 1 , m ≥ 1 , and d : Pp ( X ) × Pp ( X ) → [ 0 , ∞ ) be a given function . Then , the population mini-batch OT ( m-OT ) discrepancy between µ and ν is defined as follows : Umd ( µ , ν ) : = E ( Xm , Ym ) ∼⊗mµ ⊗⊗mν d ( PXm , PYm ) . ( 2 ) Issues of the m-OT : From Definition 1 , the m-OT treats every pair of mini-batches the same by taking the average of the m-OT loss between any pair of them for both transportation loss and transportation plan . This treatment has some issues . First , a mini-batch is a sparse representation of the true distribution and two sparse representations of the same distribution could be very different from each other . Hence , a mini-batch from Xm would prefer to match to certain mini-batches of Y m , rather than treating every mini-batch of Y m equally . For example , each mini-batch has one datum , then each term in the population m-OT now is the ground metric of the OT cost , the population m-OT degenerates to E [ d ( Xm , Y m ) ] for independent Xm and Y m. This treatment also leads to an uninformative transportation plan shown in Figure 15 , which is followed by a less meaningful transportation cost . Second , although it has been proved that the population m-OT is symmetric and positive ( Fatras et al. , 2020 ) , for the same reason it does not vanish when two measures are identical . | Goals: This paper introduces a new optimal transport loss based on a minibatch computation in order to alleviate some weaknesses from the original minibatch OT formulation. The formulation treats minibatches as data and seek to transport the minibatches from the source distribution to the minibatches from the target distribution. By doing so, their method prevents some undesirable connections between data. | SP:2c14eabf1f6b4c828ab8c59c608421860fc9e7e0 |
On Transportation of Mini-batches: A Hierarchical Approach | 1 INTRODUCTION . Optimal transport ( OT ) ( Villani , 2021 ; 2008 ; Peyré et al. , 2019 ) has emerged as an efficient tool in dealing with problems involving probability measures . Under the name of Wasserstein distance , OT has been widely utilized to solve problems such as generative modeling ( Arjovsky et al. , 2017 ; Tolstikhin et al. , 2018 ; Salimans et al. , 2018 ; Genevay et al. , 2018 ; Liutkus et al. , 2019 ) , barycenter problem ( Ho et al. , 2017 ; Li et al. , 2020 ) , and approximate Bayesian computation ( Bernton et al. , 2019a ; Nadjahi et al. , 2020 ) . Furthermore , OT can also provide the most economical map of moving masses between probability measures , which is very useful in various tasks such as color transfer ( Ferradans et al. , 2014 ; Perrot et al. , 2016 ) , natural language procesing ( Alvarez-Melis & Jaakkola , 2018 ) , and domain adaptation ( alignment ) ( Courty et al. , 2016 ; Lee et al. , 2019a ; Xu et al. , 2020 ) , and graph processing ( Titouan et al. , 2019 ; Xu et al. , 2019 ; Chen et al. , 2020 ) . Although OT has attracted growing attention in recent years , a major barrier that prevents OT from being ubiquitous is its heavy computational cost . When the two probability measures are discrete with n supports , solving the Wasserstein distance via the interior point methods has the complexity of O ( n3 log n ) ( Pele & Werman , 2009 ) , which is extremely expensive when n is large . There are two main lines of works that focus on easing this computational burden . The first approach is to find a good enough approximation of the solution by adding an entropic regularized term on the objective function ( Cuturi , 2013 ) . Several works ( Altschuler et al. , 2017 ; Lin et al. , 2019 ) show that the entropic approach can produce a ε-approximated solution at the same time reduces the computational complexity to O ( n2/ε2 ) . The second line of works named the “ slicing '' approach is based on the closed-form of Wasserstein distance in one-dimensional space , which has the computational complexity of order O ( n log n ) . There are various variants in this directions ; i.e. , ( Bonneel et al. , 2015 ; Deshpande et al. , 2019 ; Kolouri et al. , 2019 ; Nguyen et al. , 2021a ; b ) , these all belong to the family of sliced Wasserstein distances . Recently , some methods are proposed to combine the dimensional reduction approach with the entropic solver of Wasserstein distance to inherit advantages from both directions ( Paty & Cuturi , 2019 ; Muzellec & Cuturi , 2019 ; Lin et al. , 2020a ; b ) . Although those works have reduced the computational cost of OT considerably , computing OT is nearly impossible in the big data settings where n could be as large as few millions . In particular , solving OT requires to compute and store a n × n cost matrix that is impractical with current computational devices . Especially in deep learning applications , both supports of empirical measures and the cost matrix must be stored in a same device ( e.g . a GPU ) for automatic differentiation . This problem exists in all variants of OT including Wasserstein distance , entropic Wasserstein , and sliced Wasserstein distance . Therefore , it leads to the development of the mini-batches method for OT ( Genevay et al. , 2018 ; Sommerfeld et al. , 2019 ) , which we refer to as mini-batch OT loss . The main idea of the mini-batch method is to divide the original samples into multiple subsets ( mini-batches ) , in the hope that each pair of subsets ( mini-batches ) could capture some structures of the two probability measures , meanwhile , the computing OT cost between two mini-batches is cheap due to a very small size of mini-batches . Then the overall loss is defined as the average of distances between pairs of mini-batches . This scheme was applied for many forms of Wasserstein distances ( Deshpande et al. , 2018 ; Bhushan Damodaran et al. , 2018 ; Kolouri et al. , 2018 ; Salimans et al. , 2018 ) , and was theoretically studied in the works of ( Bellemare et al. , 2017 ; Bernton et al. , 2019b ; Nadjahi et al. , 2019 ) . Recently , Fatras et al . ( Fatras et al. , 2020 ; 2021b ) formulated this approach by giving a formal definition of the mini-batch OT loss , studying its asymptotic behavior , and investigating its gradient estimation properties . Despite being applied successfully , the current mini-batch OT loss does not consider the relationship between mini-batches and treats every pair of mini-batches the same . This causes undesirable effects in measuring the discrepancy between probability measures . First , the m-OT loss is shown to be an approximation of a discrepancy ( the population m-OT ) that does not preserve the metricity property , namely , this discrepancy is always positive even when two probability measures are identical . Second , it is also unclear whether this discrepancy achieves the minimum value when the two probability measures are the same . That naturally raises the question if we could propose a better mini-batching scheme to sort out these issues in order to improve the performance of the OT in practical applications . Contribution : In this paper , we propose a novel mini-batching scheme for optimal transport , which is named as Batch of Mini-batches Optimal Transport ( BoMb-OT ) . In particular , the BoMb-OT views every mini-batch as a point in the product space , then a set of mini-batches could be considered as an empirical measure . We now could employ the Kantorovich formulation between these two empirical measures in the product space as a discrepancy between two sets of mini-batches . In summary , our main contributions are two-fold : 1 . First , the BoMb-OT could provide a more similar transportation plan to the original OT than the m-OT , which leads to a more meaningful discrepancy using mini-batches . In particular , we prove that the BoMb-OT approximates a well-defined metric on the space of probability measures , named population BoMb-OT . Furthermore , the entropic regularization version of population BoMb-OT could be employed as a generalized version of the population m-OT . Specifically , when the regularization parameter in the entropic population BoMb-OT goes to infinity , its value approaches the value of the population m-OT . 2 . Second , we present the implementation strategy of the BoMb-OT and detailed algorithms in various applications in Appendix C. We then demonstrate the favorable performance of the BoMb-OT over the m-OT in two main applications that using optimal transport losses , namely , deep generative models and deep domain adaptation . Moreover , we also compare BoMb-OT to m-OT in other applications , such as sample matching , approximate Bayesian computation , color transfer , and gradient flow . In all applications , we also provide a careful investigation of the effects of two hyper-parameters of the mini-batching scheme , which are the number of mini-batches and the size of mini-batches , on the performance of the BoMb-OT and the m-OT . Organization : The remainder of the paper is organized as follows . In Section 2 , we provide backgrounds for optimal transport distances and the conventional mini-batching scheme ( m-OT ) . In Section 3 , we define the new mini-batching scheme for optimal transport distances , Batch of mini-batches Optimal Transport , and derive some of its theoretical properties . Section 4 benchmarks the proposed mini-batch scheme by extensive experiments on large-scale datasets , and followed by discussions in Section 5 . Finally , proofs of key results and extra materials are in the supplementary . Notation : For any probability measure µ on the Polish measurable space ( X , Σ ) , we denote ⊗m µ ( m ≥ 2 ) as the product measure on the product measurable space ( Xm , Σm ) . For any p ≥ 1 , we define Pp ( RN ) as the set of Borel probability measures with finite p-th moment defined on a given metric space ( RN , ‖.‖ ) . To simplify the presentation , we abuse the notation by using both the notation Xm for both the random vector ( x1 , . . . , xm ) ∈ Xm and the set { x1 , . . . , xm } , and we define by PXm : = 1m ∑m i=1 δxi the empirical measure ( the mini-batch measure ) associated with X m. For any set Xn : = { x1 , . . . , xn } and m ≥ 1 , we denote by [ Xn ] m the product set of Xn taken m times and ( Xn m ) the set of all m-element subsets of Xn . 2 BACKGROUND ON MINI-BATCH OPTIMAL TRANSPORT . In this section , we first review the definitions of the Wasserstein distance , the entropic Wasserstein , and the sliced Wasserstein . We then review the definition of the mini-batch optimal transport ( m-OT ) . 2.1 WASSERSTEIN DISTANCE AND ITS VARIANTS . We first start with the definition of Wasserstein distance and its variants . Let µ and ν be two probability measures on Pp ( RN ) . The Wasserstein p-distance between µ and ν is defined as follows : Wp ( µ , ν ) : = minπ∈Π ( µ , ν ) [ Eπ ( x , y ) ‖x− y‖p ] 1 p , where Π ( µ , ν ) : = { π : ∫ πdx = ν , ∫ πdy = µ } is the set of transportation plans between µ and ν . The entropic regularized Wasserstein to approximate the OT solution ( Altschuler et al. , 2017 ; Lin et al. , 2019 ) between µ and ν is defined as follows ( Cuturi , 2013 ) : W τp ( µ , ν ) : = minπ∈Π ( µ , ν ) { [ Eπ ( x , y ) ‖x − y‖p ] 1 p + τKL ( π|µ ⊗ ν ) } , where τ > 0 is a chosen regularized parameter and KL denotes the Kullback-Leibler divergence . Finally , the sliced Wasserstein ( SW ) ( Bonnotte , 2013 ; Bonneel et al. , 2015 ) is motivated by the closed-form of the Wasserstein distance in one-dimensional space . The formal definition of SW is : SWp ( µ , ν ) : = [ Eθ∼U ( SN−1 ) W pp ( θ ] µ , θ ] ν ) ] 1 p , where U ( SN−1 ) denotes the uniform measure over the ( N − 1 ) -dimensional unit hypersphere and θ ] is the orthogonal projection operator on direction θ . 2.2 MINI-BATCH OPTIMAL TRANSPORT . In this section , we first discuss the memory issue of large-scale optimal transport and challenges of dual solver . Then , we revisit the mini-batch OT loss that has been used in training deep generative models , domain adaptations , color transfer , and approximate Bayesian computation ( Bhushan Damodaran et al. , 2018 ; Genevay et al. , 2018 ; Tolstikhin et al. , 2018 ; Fatras et al. , 2020 ; Bernton et al. , 2019a ) . To ease the presentation , we are given Xn : = { x1 , . . . , xn } , Y n : = { y1 , . . . , yn } i.i.d . samples from µ and ν in turn . Let µn : = 1n ∑n i=1 δxi and νn : = 1 n ∑n i=1 δyi be two corresponding empirical measures from the whole data set . Here , n is usually large ( e.g. , millions ) and each support in Xn , Y n can be a high dimensional data point ( e.g . a high resolution image , video , etc ) . Memory issue of optimal transport : Using an OT loss between µn and νn needs to compute and store a n × n cost matrix which has one trillion float entries ( about 4 terabytes ) when n is about millions . Moreover , when dealing with deep neural networks , both support points and the cost matrix are required to be stored in the same memory ( e.g. , a GPU with 8 gigabytes memory ) as a part of the computational graph for automatic differentiation . This issue applies to all variants of OT losses , such as Wasserstein distance , entropic Wasserstein , sliced Wasserstein distance . Therefore , it is nearly impossible to compute OT and its variants in large-scale applications . Challenges of stochastic dual solver : Using stochastic optimization to solve the Kantorovich dual form is a possible approach to deal with large-scale OT , i.e . Wasserstein GAN ( Arjovsky et al. , 2017 ; Leygonie et al. , 2019 ) . However , the obtained distance has been shown to be very different from the original Wasserstein distance ( Mallasto et al. , 2019 ; Stanczuk et al. , 2021 ) . Using input convex neural networks is another choice to approximate the Brenier potential ( Makkuva et al. , 2020 ) . Nevertheless , recent work ( Korotin et al. , 2021 ) has indicated that input convex neural networks are not sufficient ( have limited power ) in approximating the Brenier potential . Furthermore , both mentioned approaches are restricted in the choice of ground metric . In particular , L1 norm is used in Wasserstein GAN to make the constraint of dual form into the Lipchitz constraint and L2 norm is for the existence of the Brenier potential . Mini-batch solution : As a popular alternative approach for stable large-scale OT with flexible choices of the ground metric , the mini-batch optimal transport is proposed ( Genevay et al. , 2018 ; Sommerfeld et al. , 2019 ) and has been widely used in various applications ( Arjovsky et al. , 2017 ; Deshpande et al. , 2018 ; Sommerfeld et al. , 2019 ; Bhushan Damodaran et al. , 2018 ) . In this approach , the original n samples are divided into subsets ( mini-batches ) of size m , where m is often the largest number that the computer can process , then an alternative solution of the original OT problem is formed by aggregating these smaller OT solutions from mini-batches . We now state an adapted definition of mini-batch OT ( m-OT ) scheme that was formulated in ( Fatras et al. , 2020 ) , including its two key parts : its transportation cost and its transportation plan . Definition 1 ( Empirical m-OT ) . For p ≥ 1 and integers m ≥ 1 , and k ≥ 1 , let d : Pp ( X ) × Pp ( X ) → [ 0 , ∞ ) be a function , i.e. , { Wp , W τp , SWp } . Then , the mini-batch OT ( m-OT ) loss and the transportation plan , a n× n matrix , between µn and νn are defined as follows : Ûk , md ( µn , νn ) : = 1 k2 k∑ i=1 k∑ j=1 d ( PXmi , PYmj ) ; π̂ m k ( µn , νn ) : = 1 k2 k∑ i=1 k∑ j=1 πXmi , Ymj , ( 1 ) whereXmi is sampled i.i.d from ( Xn m ) , Y mi is sampled i.i.d from ( Y n m ) , and the transport plan πXmi , Ymj , where its entries equal zero except those indexed of samples Xmi × Y mj , is the transportation plan when d ( PXmi , PYmj ) is an optimal transport metric . The above definition was generalized to the two original measures as follows in ( Fatras et al. , 2020 ) : Definition 2 ( Population m-OT ) . Assume that µ and ν are two probability measures on Pp ( X ) for given positive integers p ≥ 1 , m ≥ 1 , and d : Pp ( X ) × Pp ( X ) → [ 0 , ∞ ) be a given function . Then , the population mini-batch OT ( m-OT ) discrepancy between µ and ν is defined as follows : Umd ( µ , ν ) : = E ( Xm , Ym ) ∼⊗mµ ⊗⊗mν d ( PXm , PYm ) . ( 2 ) Issues of the m-OT : From Definition 1 , the m-OT treats every pair of mini-batches the same by taking the average of the m-OT loss between any pair of them for both transportation loss and transportation plan . This treatment has some issues . First , a mini-batch is a sparse representation of the true distribution and two sparse representations of the same distribution could be very different from each other . Hence , a mini-batch from Xm would prefer to match to certain mini-batches of Y m , rather than treating every mini-batch of Y m equally . For example , each mini-batch has one datum , then each term in the population m-OT now is the ground metric of the OT cost , the population m-OT degenerates to E [ d ( Xm , Y m ) ] for independent Xm and Y m. This treatment also leads to an uninformative transportation plan shown in Figure 15 , which is followed by a less meaningful transportation cost . Second , although it has been proved that the population m-OT is symmetric and positive ( Fatras et al. , 2020 ) , for the same reason it does not vanish when two measures are identical . | This paper proposed Batch of Mini-batches Optimal Transport (BoMb-OT) method, which finds the optimal coupling between mini-batches in mini-batch optimal transport (m-OT), which is achieved by solving another OT problem over the mini-batches. The authors claimed that doing this will capture the relation between different mini-batches better. They firstly proved that BoMb-OT approximates the population BoMb-OT metric in probability measure space with and without entropic regularization. The authors then implemented the proposed BoMb-OT method and applied it on deep generative models and deep domain adaptation, showing that BoMb-OT has favourable performance over m-OT. | SP:2c14eabf1f6b4c828ab8c59c608421860fc9e7e0 |
FedDrop: Trajectory-weighted Dropout for Efficient Federated Learning | 1 INTRODUCTION . In the light of the importance of personal data and the recent strict privacy regulations , e.g . the General Data Protection Regulation ( GDPR ) of the European Union ( Voigt & Von dem Bussche , 2017 ; Wolters , 2017 ; Politou et al. , 2018 ) , there is now a great amount of risk , responsibility ( Edwards et al. , 2016 ; Culnan & Williams , 2009 ) and technical challenges for securing private data centrally ( Sun et al. , 2014 ) ; it is often impractical to upload , store and use data on central servers . To this end , federated learning ( FL ) ( McMahan et al. , 2017 ; Li et al. , 2019a ) enables multiple edge compute devices to learn a global shared model collaboratively in a communication-efficient way without collecting their local training data . When compared against naïve decentralized SGD , Federated averaging ( FedAvg ) ( McMahan et al. , 2017 ) and subsequent FL algorithms ( Li et al. , 2020 ; Karimireddy et al. , 2020 ) reduce the burden of data transmission by many orders of magnitude . While these communication-efficient methods can notably alleviate the difficulties of using FL in scenarios with limited bandwidth or data-quota , they , however , entail a drastic increase in computation cost , which has rarely been addressed by previous literature on FL . It has been argued that communication is several orders of magnitude more expensive than computation on edge devices ( Li et al. , 2019a ; Huang et al. , 2013 ) . Yet existing FL methods optimize for communication so aggressively that an iPhone 12 Pro running as a FedAvg client in our test1 would spend at least 16 minutes on training , before even transmitting 180 MB of data , which only takes fraction of a second under the modern 5G infrastructure . The savings in communication thus are completely dwarfed by the expensive computation . In a FL setup , models trained by the clients may disagree on the gradient direction to update the same neurons if the user data distributions are non-IID . In Figure 1 , we demonstrate this effect with an initial round of FedAvg training . It turns out that clients sharing similar data distributions tend to produce similar update trajectories to the same channel , and different distributions observe disparate trajectories . From this example , it can be observed that the consequence of non-IID data is two-fold . First , a naïve averaging of client parameters may cause these conflicting signals to cancel out each other , resulting in a slow convergence of the global model . Second , neurons in a layer tend to learn distinct features , and yet they can not learn meaningfully if these features are absent in the client ’ s training data . Since neuron training is heavily dependent on the client ’ s local data , it presents us an 1See Appendix F.6 for the setup . opportunity : can we concentrate training effort to neurons that are correlated to the current data distribution of the client , while paying less attention to neurons that are less relevant to the client ? To leverage this , we introduce FedDrop , which introduces SyncDrop layers to structurally sparsify client models , and on the server-side an inter-client trajectory-based optimization of the dropout probabilities used by SyncDrop to speed up model training . FedDrop brings two-fold advantages : dropped neurons can simply be skipped , and thus reduce the training FLOPs required per step ; and dropout probabilities of each neuron can be tuned individually to minimize the impact on the global averaged model updates to assist convergence . Overall , as evinced by our experiments , FedDrop enables a much improved communication/computation trade-off relationship than traditional FL approaches . Our contributions in this paper are as follows : • We present SyncDrop layers , which are synchronous structural dropouts with adaptive keep probabilities , to reduce the computational cost required by FL . • With SyncDrop , we formally derive the FedDrop objective that adjusts each neuron ’ s dropout probability to improve convergence by minimizing the disparities among inter-client update trajectories . We further introduce FLOPs-based constraints to enforce sparsity per FL round , allowing the trade-off between FLOPs and communication to be tuned easily . • Empirical results reveal that the combined method , FedDrop , attains a substantially better communication/computation trade-off in comparison to other FL methods . 2 RELATED WORK . Federated learning . Distributed machine learning has a long history of progress and success ( PeteiroBarral & Guijarro-Berdiñas , 2013 ; Li et al. , 2014 ) , yet it mainly focuses on training with IID data . The Federated Learning ( FL ) paradigm and the Federated Averaging algorithm ( FedAvg ) initially introduced by McMahan et al . ( 2017 ) allow clients to train collaboratively without sharing the private data in a communication-efficient manner , To further tackle data heterogeneity , FedProx ( Li et al. , 2020 ) introduces new regularizations , and SCAFFOLD ( Karimireddy et al. , 2020 ) presents control variates to account for client drifts and reduce the inter-client variance . While being effective at reducing communication , the above methods neglected the computational costs associated with the training process . Computation vs. communication during training . There are a few precursory methods that focus on the joint optimization of computation and communication costs during training . Caldas et al . ( 2018a ) introduced federated dropout , which prunes parameters following a uniform random distribution , whereas PruneFL ( Jiang et al. , 2019 ) proposes a greedy gradient-magnitude-based unstructured pruning . In each FL round , both methods produce a shared pruned model with fine-grained sparsity for all clients . Such unstructured sparsity is difficult to utilize for training acceleration , and a shared global model can not exploit the data distribution of individual clients . Adaptive federated dropout ( Bouacida et al. , 2020 ) partially addresses the latter issue by allowing each client to select a sub-model to join training . FjORD ( Horvath et al. , 2021 ) introduces ordered dropout to tackle the problem of system heterogeneity in FL with sub-model training that dynamically changes model capabilities using uniform sampling . FedGKT ( He et al. , 2020 ) transmits shallow layer activations to offload training of subsequent layers to the server . However , the privacy implications were not well explored , and the trained models were substantially larger , which may limit their inference speed on edge devices . It is noteworthy that FedDrop differs from these approaches as it takes into account the non-IID client data distributions in a FL setting , and computes inter-client channel selection decisions that would minimize the impact on convergence . Dropout algorithms in centralized training . Dropout ( Hinton et al. , 2012 ; Srivastava et al. , 2014 ) may improve neural network training by reducing the overfitting effect and allow it to generalize better . It is done by randomly setting parts of the connections or weights to zero in a network , and scaling the remaining values accordingly . Since its advent , there have been an increasing interest in applying dropout in a structural fashion ( Huang et al. , 2015 ; Ghiasi et al. , 2018 ; Hou & Wang , 2019 ) . Nonetheless , the above methods missed the opportunity to explore the implications of a structural dropout on the FLOPs consumed by training or inference . Structural pruning . A closely related topic is structural neuron pruning/selection for accelerated inference . These work propose new ways to extract a smaller accurate network from the original ( He et al. , 2018 ; Wu et al. , 2019 ; Li et al. , 2019b ; Herrmann et al. , 2020 ) , and can even do so dynamically with an input-dependent policy ( Gao et al. , 2019 ; Hua et al. , 2019 ; Wang et al. , 2020c ) . 3 THE FEDDROP METHOD 3.1 HIGH-LEVEL OVERVIEW FedDrop complements existing FL methods by adding new client- and server-side components . During client training , convolutional layers are sparsified by interleaving them with channel-wise dropout layers , namely the SyncDrop layers . Section 3.3 discusses in depth how SyncDrop layers compute dropout decisions . Additional optimization stages during server aggregation are added to encourage collaboration between sparse clients . Figure 2 shows how FedDrop extends traditional FedAvg ( McMahan et al. , 2017 ) . After each round of client training , the server begins by identifying parameter update directions of each client from the previous round , and computes a cross-client trajectory similarity matrix for each channel neuron . This is then followed by an optimization stage that iteratively minimizes the trajectory disparities by tuning dropout keep probabilities for each channel neuron on each client for the next training round ( Section 3.6 ) . This process also takes into consideration the FLOPs budget constraints to sparsify client models ( Section 3.4 ) . Finally , following FedAvg , the server broadcasts the weighted-average model parameters to all training clients in the new round , and finally sends the optimized probabilities to the respective clients . 3.2 PRELIMINARIES AND DEFINITIONS . FedDrop complements most FL algorithms . In this paper , we focus on its use on FedAvg ( McMahan et al. , 2017 ) . We assume the training loss function of a client c ∈ C to be ` c ( θc ) , where θc comprises the parameters { θ [ l ] c : l ∈ L } of all layers in the model of client c. In each FedAvg training round r , clients begin by training on the loss function , with initial parameters θ ( r ) received from the server for this round : θ ( r+1 ) c = SGDc ( ` c , θ ( r ) , η , E ) . ( 1 ) Here SGDc indicates that client c carries out stochastic gradient descent ( SGD ) on ` c ( θ ( r ) c ) locally , and it uses a learning rate η forE epochs . The FedAvg server then aggregates client model parameters after the rth training round , by taking the weighted average of them : θ ( r+1 ) = ∑ c∈C λcθ ( r+1 ) c , ( 2 ) where λc is the weight of client c and is proportional to the size of its training set |Dc| with∑ c∈C λc = 1 . Finally , the ( r + 1 ) th training round starts by repeating the above procedure . 3.3 SYNCHRONIZED DROPOUT . To induce sparsity in a stochastic manner , and subsequently introduce training correlation across clients , we designed a threshold-based dropout layer , SyncDrop , to synchronize dropout decisions across multiple clients . Initially for all sampled clients c ∈ C ⊆ C , the server provides them with their corresponding dropout keep probabilities pc ∈ [ 0 , 1 ] N , and we assume p ∈ [ 0 , 1 ] C×N to be the concatenated probabilites from all sampled clients . Each element pnc in p denotes the keep probability of the channel neuron n ∈ N in client c ∈ C. We additionally use p [ l ] c , a slice of pc , to indicate the probabilities of all channels in the lth layer . During training , the lth layer samples t [ l ] n from a uniform distribution U ( 0 , 1 ) for all channel neurons n in the layer , where t [ l ] n is shared across clients by using the same random seed . If pnc < t [ l ] n , a channel n in client c is dropped , i.e . we set the entire channel map to zero ; otherwise , the channel values are scaled by 1/pnc during training 2 . Formally , for each client c , the lth dropout layer computes for the input x [ l ] : drop ( x [ l ] , p [ l ] c ) , d [ l ] c ◦ x [ l ] ◦ p [ l ] c ◦−1 , where d [ l ] c , 1 [ t [ l ] < p [ l ] c ] . ( 3 ) Here , 1 [ z ] is the ( element-wise ) indicator function , which is equal to 1 when the condition z is met and 0 otherwise , ◦ refers to the element-wise product , the term p [ l ] c ◦−1 represents the element-wise inverse of p [ l ] c , and finally all elements of t [ l ] are independently sampled from U ( 0 , 1 ) and shared across clients . Figure 3a provides a high-level overview of the procedure described above . From the local perspective of a client c , the dropout decision d [ l ] c is equivalent to the Bernoulli distributions B ( p [ l ] c ) . An important distinction from independent Bernoulli distributions is that the distribution of d [ l ] c is correlated across clients c ∈ C. Given a pair of clients ( i , j ) for channel n : Et∼U ( 0,1 ) [ dni d n j ] = ∫ 1 0 1 [ t < pni ] · 1 [ t < pnj ] dt = min ( pni , p n j ) . ( 4 ) This enables us to adjust the correlation of the same channel neurons between any pairs of clients , and Section 3.6 makes use of this property to minimize the model update disparities across all clients . 2This is known as “ inverted dropout ” and implemented by PyTorch ( 2021 ) and TensorFlow ( 2021 ) . Figure 7 provides ablation results on scaling for dropout to justify the design choice . We define f̂ to be the sparsified variant of the original model f , where SyncDrop layers are placed immediately after each convolutional layer with ReLU activation ( Figure 3b ) . This enables convolutional layers to be doubly accelerated by taking advantage of sparsities at both ends and skipping dropped channels in input/output feature maps . Recalling the client model loss function ` c , we additionally use ˆ̀c to denote the accelerated variant of the sparse model f̂ with probabilities pc . It is noteworthy that active channels are sampled for each local training mini-batch . In addition , the synchronization of dropout decisions is carried out with identical random seeds for all clients , and thus it eliminates the need to communicate between clients . Finally , for inference , one may choose to enable the SyncDrop layers for speed , or skip these layers entirely . In our evaluations , SyncDrop layers are disabled for improved test accuracies . | The paper proposes a new method where local workers will drop part of their model using a shared dropout probability received from the server at each communication round. The dropout probabilities are computed by solving an optimization to promote similarity across agent's update. Compared with popular baselines in federated learning, the proposed method demonstrates better performance in terms of number of FLOPs. | SP:48c5c18dac59913411633150b5f40fbcd1647d1e |
FedDrop: Trajectory-weighted Dropout for Efficient Federated Learning | 1 INTRODUCTION . In the light of the importance of personal data and the recent strict privacy regulations , e.g . the General Data Protection Regulation ( GDPR ) of the European Union ( Voigt & Von dem Bussche , 2017 ; Wolters , 2017 ; Politou et al. , 2018 ) , there is now a great amount of risk , responsibility ( Edwards et al. , 2016 ; Culnan & Williams , 2009 ) and technical challenges for securing private data centrally ( Sun et al. , 2014 ) ; it is often impractical to upload , store and use data on central servers . To this end , federated learning ( FL ) ( McMahan et al. , 2017 ; Li et al. , 2019a ) enables multiple edge compute devices to learn a global shared model collaboratively in a communication-efficient way without collecting their local training data . When compared against naïve decentralized SGD , Federated averaging ( FedAvg ) ( McMahan et al. , 2017 ) and subsequent FL algorithms ( Li et al. , 2020 ; Karimireddy et al. , 2020 ) reduce the burden of data transmission by many orders of magnitude . While these communication-efficient methods can notably alleviate the difficulties of using FL in scenarios with limited bandwidth or data-quota , they , however , entail a drastic increase in computation cost , which has rarely been addressed by previous literature on FL . It has been argued that communication is several orders of magnitude more expensive than computation on edge devices ( Li et al. , 2019a ; Huang et al. , 2013 ) . Yet existing FL methods optimize for communication so aggressively that an iPhone 12 Pro running as a FedAvg client in our test1 would spend at least 16 minutes on training , before even transmitting 180 MB of data , which only takes fraction of a second under the modern 5G infrastructure . The savings in communication thus are completely dwarfed by the expensive computation . In a FL setup , models trained by the clients may disagree on the gradient direction to update the same neurons if the user data distributions are non-IID . In Figure 1 , we demonstrate this effect with an initial round of FedAvg training . It turns out that clients sharing similar data distributions tend to produce similar update trajectories to the same channel , and different distributions observe disparate trajectories . From this example , it can be observed that the consequence of non-IID data is two-fold . First , a naïve averaging of client parameters may cause these conflicting signals to cancel out each other , resulting in a slow convergence of the global model . Second , neurons in a layer tend to learn distinct features , and yet they can not learn meaningfully if these features are absent in the client ’ s training data . Since neuron training is heavily dependent on the client ’ s local data , it presents us an 1See Appendix F.6 for the setup . opportunity : can we concentrate training effort to neurons that are correlated to the current data distribution of the client , while paying less attention to neurons that are less relevant to the client ? To leverage this , we introduce FedDrop , which introduces SyncDrop layers to structurally sparsify client models , and on the server-side an inter-client trajectory-based optimization of the dropout probabilities used by SyncDrop to speed up model training . FedDrop brings two-fold advantages : dropped neurons can simply be skipped , and thus reduce the training FLOPs required per step ; and dropout probabilities of each neuron can be tuned individually to minimize the impact on the global averaged model updates to assist convergence . Overall , as evinced by our experiments , FedDrop enables a much improved communication/computation trade-off relationship than traditional FL approaches . Our contributions in this paper are as follows : • We present SyncDrop layers , which are synchronous structural dropouts with adaptive keep probabilities , to reduce the computational cost required by FL . • With SyncDrop , we formally derive the FedDrop objective that adjusts each neuron ’ s dropout probability to improve convergence by minimizing the disparities among inter-client update trajectories . We further introduce FLOPs-based constraints to enforce sparsity per FL round , allowing the trade-off between FLOPs and communication to be tuned easily . • Empirical results reveal that the combined method , FedDrop , attains a substantially better communication/computation trade-off in comparison to other FL methods . 2 RELATED WORK . Federated learning . Distributed machine learning has a long history of progress and success ( PeteiroBarral & Guijarro-Berdiñas , 2013 ; Li et al. , 2014 ) , yet it mainly focuses on training with IID data . The Federated Learning ( FL ) paradigm and the Federated Averaging algorithm ( FedAvg ) initially introduced by McMahan et al . ( 2017 ) allow clients to train collaboratively without sharing the private data in a communication-efficient manner , To further tackle data heterogeneity , FedProx ( Li et al. , 2020 ) introduces new regularizations , and SCAFFOLD ( Karimireddy et al. , 2020 ) presents control variates to account for client drifts and reduce the inter-client variance . While being effective at reducing communication , the above methods neglected the computational costs associated with the training process . Computation vs. communication during training . There are a few precursory methods that focus on the joint optimization of computation and communication costs during training . Caldas et al . ( 2018a ) introduced federated dropout , which prunes parameters following a uniform random distribution , whereas PruneFL ( Jiang et al. , 2019 ) proposes a greedy gradient-magnitude-based unstructured pruning . In each FL round , both methods produce a shared pruned model with fine-grained sparsity for all clients . Such unstructured sparsity is difficult to utilize for training acceleration , and a shared global model can not exploit the data distribution of individual clients . Adaptive federated dropout ( Bouacida et al. , 2020 ) partially addresses the latter issue by allowing each client to select a sub-model to join training . FjORD ( Horvath et al. , 2021 ) introduces ordered dropout to tackle the problem of system heterogeneity in FL with sub-model training that dynamically changes model capabilities using uniform sampling . FedGKT ( He et al. , 2020 ) transmits shallow layer activations to offload training of subsequent layers to the server . However , the privacy implications were not well explored , and the trained models were substantially larger , which may limit their inference speed on edge devices . It is noteworthy that FedDrop differs from these approaches as it takes into account the non-IID client data distributions in a FL setting , and computes inter-client channel selection decisions that would minimize the impact on convergence . Dropout algorithms in centralized training . Dropout ( Hinton et al. , 2012 ; Srivastava et al. , 2014 ) may improve neural network training by reducing the overfitting effect and allow it to generalize better . It is done by randomly setting parts of the connections or weights to zero in a network , and scaling the remaining values accordingly . Since its advent , there have been an increasing interest in applying dropout in a structural fashion ( Huang et al. , 2015 ; Ghiasi et al. , 2018 ; Hou & Wang , 2019 ) . Nonetheless , the above methods missed the opportunity to explore the implications of a structural dropout on the FLOPs consumed by training or inference . Structural pruning . A closely related topic is structural neuron pruning/selection for accelerated inference . These work propose new ways to extract a smaller accurate network from the original ( He et al. , 2018 ; Wu et al. , 2019 ; Li et al. , 2019b ; Herrmann et al. , 2020 ) , and can even do so dynamically with an input-dependent policy ( Gao et al. , 2019 ; Hua et al. , 2019 ; Wang et al. , 2020c ) . 3 THE FEDDROP METHOD 3.1 HIGH-LEVEL OVERVIEW FedDrop complements existing FL methods by adding new client- and server-side components . During client training , convolutional layers are sparsified by interleaving them with channel-wise dropout layers , namely the SyncDrop layers . Section 3.3 discusses in depth how SyncDrop layers compute dropout decisions . Additional optimization stages during server aggregation are added to encourage collaboration between sparse clients . Figure 2 shows how FedDrop extends traditional FedAvg ( McMahan et al. , 2017 ) . After each round of client training , the server begins by identifying parameter update directions of each client from the previous round , and computes a cross-client trajectory similarity matrix for each channel neuron . This is then followed by an optimization stage that iteratively minimizes the trajectory disparities by tuning dropout keep probabilities for each channel neuron on each client for the next training round ( Section 3.6 ) . This process also takes into consideration the FLOPs budget constraints to sparsify client models ( Section 3.4 ) . Finally , following FedAvg , the server broadcasts the weighted-average model parameters to all training clients in the new round , and finally sends the optimized probabilities to the respective clients . 3.2 PRELIMINARIES AND DEFINITIONS . FedDrop complements most FL algorithms . In this paper , we focus on its use on FedAvg ( McMahan et al. , 2017 ) . We assume the training loss function of a client c ∈ C to be ` c ( θc ) , where θc comprises the parameters { θ [ l ] c : l ∈ L } of all layers in the model of client c. In each FedAvg training round r , clients begin by training on the loss function , with initial parameters θ ( r ) received from the server for this round : θ ( r+1 ) c = SGDc ( ` c , θ ( r ) , η , E ) . ( 1 ) Here SGDc indicates that client c carries out stochastic gradient descent ( SGD ) on ` c ( θ ( r ) c ) locally , and it uses a learning rate η forE epochs . The FedAvg server then aggregates client model parameters after the rth training round , by taking the weighted average of them : θ ( r+1 ) = ∑ c∈C λcθ ( r+1 ) c , ( 2 ) where λc is the weight of client c and is proportional to the size of its training set |Dc| with∑ c∈C λc = 1 . Finally , the ( r + 1 ) th training round starts by repeating the above procedure . 3.3 SYNCHRONIZED DROPOUT . To induce sparsity in a stochastic manner , and subsequently introduce training correlation across clients , we designed a threshold-based dropout layer , SyncDrop , to synchronize dropout decisions across multiple clients . Initially for all sampled clients c ∈ C ⊆ C , the server provides them with their corresponding dropout keep probabilities pc ∈ [ 0 , 1 ] N , and we assume p ∈ [ 0 , 1 ] C×N to be the concatenated probabilites from all sampled clients . Each element pnc in p denotes the keep probability of the channel neuron n ∈ N in client c ∈ C. We additionally use p [ l ] c , a slice of pc , to indicate the probabilities of all channels in the lth layer . During training , the lth layer samples t [ l ] n from a uniform distribution U ( 0 , 1 ) for all channel neurons n in the layer , where t [ l ] n is shared across clients by using the same random seed . If pnc < t [ l ] n , a channel n in client c is dropped , i.e . we set the entire channel map to zero ; otherwise , the channel values are scaled by 1/pnc during training 2 . Formally , for each client c , the lth dropout layer computes for the input x [ l ] : drop ( x [ l ] , p [ l ] c ) , d [ l ] c ◦ x [ l ] ◦ p [ l ] c ◦−1 , where d [ l ] c , 1 [ t [ l ] < p [ l ] c ] . ( 3 ) Here , 1 [ z ] is the ( element-wise ) indicator function , which is equal to 1 when the condition z is met and 0 otherwise , ◦ refers to the element-wise product , the term p [ l ] c ◦−1 represents the element-wise inverse of p [ l ] c , and finally all elements of t [ l ] are independently sampled from U ( 0 , 1 ) and shared across clients . Figure 3a provides a high-level overview of the procedure described above . From the local perspective of a client c , the dropout decision d [ l ] c is equivalent to the Bernoulli distributions B ( p [ l ] c ) . An important distinction from independent Bernoulli distributions is that the distribution of d [ l ] c is correlated across clients c ∈ C. Given a pair of clients ( i , j ) for channel n : Et∼U ( 0,1 ) [ dni d n j ] = ∫ 1 0 1 [ t < pni ] · 1 [ t < pnj ] dt = min ( pni , p n j ) . ( 4 ) This enables us to adjust the correlation of the same channel neurons between any pairs of clients , and Section 3.6 makes use of this property to minimize the model update disparities across all clients . 2This is known as “ inverted dropout ” and implemented by PyTorch ( 2021 ) and TensorFlow ( 2021 ) . Figure 7 provides ablation results on scaling for dropout to justify the design choice . We define f̂ to be the sparsified variant of the original model f , where SyncDrop layers are placed immediately after each convolutional layer with ReLU activation ( Figure 3b ) . This enables convolutional layers to be doubly accelerated by taking advantage of sparsities at both ends and skipping dropped channels in input/output feature maps . Recalling the client model loss function ` c , we additionally use ˆ̀c to denote the accelerated variant of the sparse model f̂ with probabilities pc . It is noteworthy that active channels are sampled for each local training mini-batch . In addition , the synchronization of dropout decisions is carried out with identical random seeds for all clients , and thus it eliminates the need to communicate between clients . Finally , for inference , one may choose to enable the SyncDrop layers for speed , or skip these layers entirely . In our evaluations , SyncDrop layers are disabled for improved test accuracies . | The authors propose a new method of coordinated, per client and weight dropout for federated learning. The intuition behind the method is to increase the dropout probability (probability of having a weight set to zero) for weights where different clients often have opposite parity gradients (as when those gradients are summed together are likely to cancel each other out). The authors show that doing this can reduce the computational cost on clients of FL by up to 3x. | SP:48c5c18dac59913411633150b5f40fbcd1647d1e |
Programmatic Reinforcement Learning without Oracles | 1 INTRODUCTION . A growing body of research has explored programs in a domain-specific programming language as a new RL policy representation that intentionally encourages policy interpretability . Yet , learning a policy as a high-level program in structured representations is challenging . This is because algorithms must jointly identify a reasonable program architecture to allow for sufficient expressiveness while optimizing the parameters of a program ’ s modules . For example , depending on the shape of a maze , walking a robot to different goals on the maze by a program may require various if-then-else conditions to travel along different paths , the number of which might not be known to the agent before training . Existing programmatic policy synthesis algorithms either learn from a pretrained program embedding space that must support smooth interpolation ( Trivedi et al. , 2021 ) , or must be guided by the supervision of a pretrained oracle ( e.g . a neural network policy trained by RL ) via a teacher-student learning paradigm ( Bastani et al. , 2018 ; Silver et al. , 2020 ; Inala et al. , 2020 ; Verma et al. , 2018 ; 2019 ) . The task of imitating an oracle is , intuitively , significantly simpler than the full RL problem . However , since the policy spaces of neural networks and that of programmatic policies are significantly different , a significant performance gap exists between an imitating program and its RL oracle ( Verma et al. , 2018 ) . The first contribution of our paper is a framework to instead synthesize interpretable and differentiable programmatic policies solely from reward signals by policy gradient methods , without needing any oracles and pretraining . A conceivable way of synthesizing program architectures would be to enumerate all possible architectures induced by the grammar of a domain-specific policy language , run standard RL for each to find the optimal values of its unknown parameters , and return the best program . However , doing so is computationally expensive as each RL trial may explore millions of environment steps . Inspired by recent advances in differentiable neural architecture search e.g . DARTs ( Liu et al. , 2019b ) , we relax the discrete program architecture search space to be continuous . Specifically , we encode program architecture synthesis as learning the probability distribution over all possible architecture derivations ( up to a certain bound on program abstract syntax tree depth ) induced by a policy language grammar . This enables our RL algorithm to jointly optimize program architectures and the parameters of program modules via policy-gradient methods . Our second contribution is improving programmatic policies to support compositionality — the integration of primitive functions trained to grasp basic , task-agnostic skills ( e.g . running forward or jumping ) into a new complex function as a composite model to solve novel RL problems ( e.g . jumping over multiple hurdles to reach a target ) . As opposed to policy ensemble models based on neural networks ( Qureshi et al. , 2019 ) , our programmatically composite models interpret how primitive functions are composed under different environment conditions based on an RL agent ’ s perceptions , and naturally generalize to novel scenarios . We further apply programmatic policies to address challenging hierarchical RL problems . Our solution leverages the specifications of primitive functions to create an optimal high-level control plan via a satisfiability constraint solver and implements the high-level plans by learned composition of primitive functions . Finally , we benchmark our method against the state-of-the-art RL methods . Our results demonstrate that the programmatic RL framework is able to solve extremely hard RL-problems using highly interpretable policies with improved task performance . 2 PROBLEM MOTIVATION AND FORMULATION . We study how to express RL policies as differentiable programs , which use symbolic language constructs to compose a set of parameterized primitive modules . To control an agent , a programmatic policy takes an environment state as input and computes an action as return for the agent to execute . We view a programmatic policy as a pair ( E , θ ) , where E is a discrete program architecture and θ is a vector of real-valued parameters of the program . A program architecture E is structured based on the context-free grammar ( Hopcroft et al. , 2007 ) of a policy DSL . In this paper , we consider the context-free grammar depicted in the standard Backus-Naur form ( Winskel , 1993 ) in Fig . 1 . A vertical bar “ | ” indicates choice . Such a grammar consists of a set of production rules X : := σ1 σ2 · · · σj where X is a nonterminal and σ1 , · · · , σj are either terminals or nonter- minals . For example , we may expand the nonteriminal E1 in a partial program if B1 then C1 else E1 to if B1 then C1 else ( if B2 then C2 else E2 ) . The nonterminals E and B stand for program expressions that evaluate to action values in Rm and Booleans , respectively , where m is the action dimension size . We represent a state input to a programmatic policy as s = { x1 : ν1 , x2 : ν2 , . . . , xn } where n is the state dimension size and νi = s [ xi ] is the value of xi in s. As usual , the unbounded variables in X = [ x1 , x2 , . . . , xn ] are assumed to be input variables ( state variables in our context ) . A terminal in this grammar is a symbol that can appear in a program ’ s code , e.g . the if symbol and xi . The semantics of a program in E is mostly standard and given by a function JEK ( s ) , defined for each DSL construct . For example , JxiK ( s ) = s [ xi ] reads the value of a variable xi in a state input s. A policy may use an if-then-else branching construct . To avoid discontinuities for differentiability , we interpret its semantics in terms of a smooth approximation where σ is the sigmoid function : Jif B then C else EK ( s ) = σ ( JBK ( s ) ) · JCK ( s ) + ( 1− σ ( JBK ( s ) ) · JEK ( s ) ( 1 ) Thus , any policy programmed in this grammar becomes a differentiable program . C is a controller used by a programmatic policy . During execution , the policy can invoke a set of controllers under different environment conditions , according to the activation of B conditions in the program . We consider three DSLs depending on how C is structured for affine , ensemble , and PID policies . Affine Policies . The DSL for affine policies allows C to be expanded as an affine transformation : CAffine : := θc + θ · X | θc where θ ∈ Rm·|X | , θc ∈ Rm are control parameters . Particularly , CAffine can be as simple as some ( learned ) constants θc . An example affine policy is given in Appendix K.1 . if θ1c + θ T 1 · X > 0 then ( 95 % · πUP ( s ) + 5 % · πLEFT ( s ) ) ←− Branch 1 else if θ2c + θ T 2 · X > 0 then ( 95 % · πLEFT ( s ) + 5 % · πRIGHT ( s ) ) ←− Branch 2 else ( 13 % · πDOWN ( s ) + 87 % · πRIGHT ( s ) ) ←− Branch 3 X = [ x , y , Gx , Gy , arctan yx , ‖x , y‖2 ] θ1 = [ − 2.052 , 0.049 , 0.440 , 0.181 , 0.241 , 1.443 ] , θ1c = −0.202 θ2 = [ 1.333 , 2.204 , −2.2171 , 2.132 , 1.878 , 0.331 ] , θ2c = −0.416 Figure 3 : An Ant Cross Maze program Pcross with three branches . A program input X includes current Ant position x , y along with the target location Gx , Gy ( sampled from one of the three goals in Fig . 2 ) . arctan yx and ‖x , y‖2 are functions of x and y . Each branch composes primitive functions : πUP , πDOWN , πLEFT , and πRIGHT . Composition weights are shown in percentage . Ensemble Policies . The most important feature of our programmatic model is compositionality — composing and reusing task-agnostic primitives in new programs to solve novel problems . The DSL for ensemble policies includes pre-acquired primitives π1 , · · · , πN as callable library functions : Cπ : := θ1 · π1 ( s ) + θ2 · π2 ( s ) + · · ·+ θN · πN ( s ) Cπ explicitly compose primitive functions ( e.g . running forward or jumping ) hierarchically into a complex program ( e.g . jumping over multiple hurdles to reach a target ) where θ1 , · · · , θN ∈ R1 parameterize a primitive combination . The input space of a primitive function can be different than that of the composite program ( formally defined below ) . Its semantics is captured as follows : JCπK ( s ) = N∑ i=0 qi · πi ( s ) where qi = exp ( θi/T ) ∑N j=0 exp ( θj/T ) Here the composition weights { qi } Ni=0 for primitive ensemble are computed using gumbel-softmax , where T is the temperature term ( Jang et al. , 2017 ) . PID Policies . Suppose we know a priori that PID control is suitable for stabilising of an RL system . We can express this knowledge using the DSL for PID functions that allows C to be expanded as discretized , multivariable PID controllers ( Zheng et al. , 2002 ) . We leave the details in Appendix K.2 . Program Interpretability . Our RL algorithm searches over a DSL to synthesize a programmatic policy . Thanks to the structured and symbolic representations , it learns highly interpretable policies . For example , consider an Ant Cross Maze environment depicted in Fig . 2 . The cross-maze contains three possible goal positions and one would be randomly selected at each time . In this environment , the task for a quadruped MuJoCo Ant is to reach the selected location by navigating through the maze staring from an initial position on the bottom and without collision or crash . We consider the DSL for this task using ensemble policies Cπ . It includes four basic primitive functions for moving the Ant up πup , down πdown , left πleft , and right πright ( pretrained as neural network policies using standard RL algorithms with details left in App . F.2 ) . Fig . 3 depicts a synthesized program Pcross with three branches for solving the Ant Cross Maze environment . As specified in Equation 1 , our semantics of a branching construct is approximated by the sigmoid function σ . The value of the predicate in a Boolean condition determines the activation of the controller guarded by the Boolean condition . At each state , branch activation determines the strength of each of the controllers in the program . For example , the activation of branch 1 is σ ( θ1c + θ T 1 · X ) , and the activation of branch 2 is ( 1− σ ( θ1c + θT1 · X ) ) · σ ( θ2c + θT2 · X ) . Fig . 4a depicts the activation of branch 1 as a function of ( x , y ) when the goal to reach is sampled at Gx = 12 , Gy = 0 . The degree of activation ( yellow ) is close to 1 on all states under ( 12 , 0 ) indicating that the ensemble policy at branch 1 is used to drive the Ant up to the goal . Indeed , according to the distribution of each primitive function at branch 1 , the effect of πUP dominates . Fig . 4b , Fig . 4c , and Fig . 4d depict the activation of all three branches when the goal is at Gx = 6 , Gy = −6 . The program can be interpreted as branch 1 ( where πUP dominates ) and branch 3 ( where πRIGHT dominates ) are activated in the yellow areas of Fig . 4b and Fig . 4d respectively . This allows the Ant to make a curved up and right move to the goal ( branch 2 is not activated during execution for this goal ) . Problem Formulation . We frame programmatic RL as a Markov Decision Process ( MDP ) defined by a tuple { S , A , T , R } where S and A represent the environment state space and action space , T : S × A × S → [ 0 , 1 ] captures the set of transition probabilities , and R : S × A → R denotes the reward function . We assume S ⊇ R|X∪V| where X is the set of input variables of a composite program ( defined by a DSL ) and V is the set of input variables of primitive functions . For a noncomposite affine policy , V = ∅ . At time t ≥ 0 , an RL agent receives an environment state st ∈ S and performs an action at ∈ A selected by its policy π ( at|st ) : S → A . Based on st and at , the agent transits to receive the next state according to the transition model T ( st+1|st , at ) , and receives the reward R ( st , at ) . We aim to learn a programmatic policy π in the DSL in Fig . 1 by jointly synthesizing the program ’ s architecture E and optimizing the program ’ s parameters θ to maximize the cumulative discounted reward Es0 , a0 , s1···∼π [ ∑∞ 0 γ t ·R ( st , at ) ] where γ ∈ ( 0 , 1 ] . | This paper addresses the problem of the low efficiency of program search guided by a pre-trained oracle or on discrete and non-differentiable architecture space. To this end, the paper proposes a framework that performs program architecture search on top of a differentiable relaxation of the architecture space. This allows the program architectures and parameters to be learned via policy-gradient methods without RL oracle. The proposed method also exploits compositionality by allowing an ensemble of primitive functions that perform task-agnostic skills. The experimental results on navigation and manipulation domains show that the proposed method can reliably obtain task-solving programs and outperforms or performs competitively compared to RL baselines including SAC, PPO, TRPO. I believe this work studies an interesting and promising research direction and proposes a convincing framework to tackle this problem with solid technical contributions. Yet, I am mainly concerned with some missing baselines, relevant works, and ablations. | SP:633cf2b404a8d76c5f4fc2e2c88546b9a35a7688 |
Programmatic Reinforcement Learning without Oracles | 1 INTRODUCTION . A growing body of research has explored programs in a domain-specific programming language as a new RL policy representation that intentionally encourages policy interpretability . Yet , learning a policy as a high-level program in structured representations is challenging . This is because algorithms must jointly identify a reasonable program architecture to allow for sufficient expressiveness while optimizing the parameters of a program ’ s modules . For example , depending on the shape of a maze , walking a robot to different goals on the maze by a program may require various if-then-else conditions to travel along different paths , the number of which might not be known to the agent before training . Existing programmatic policy synthesis algorithms either learn from a pretrained program embedding space that must support smooth interpolation ( Trivedi et al. , 2021 ) , or must be guided by the supervision of a pretrained oracle ( e.g . a neural network policy trained by RL ) via a teacher-student learning paradigm ( Bastani et al. , 2018 ; Silver et al. , 2020 ; Inala et al. , 2020 ; Verma et al. , 2018 ; 2019 ) . The task of imitating an oracle is , intuitively , significantly simpler than the full RL problem . However , since the policy spaces of neural networks and that of programmatic policies are significantly different , a significant performance gap exists between an imitating program and its RL oracle ( Verma et al. , 2018 ) . The first contribution of our paper is a framework to instead synthesize interpretable and differentiable programmatic policies solely from reward signals by policy gradient methods , without needing any oracles and pretraining . A conceivable way of synthesizing program architectures would be to enumerate all possible architectures induced by the grammar of a domain-specific policy language , run standard RL for each to find the optimal values of its unknown parameters , and return the best program . However , doing so is computationally expensive as each RL trial may explore millions of environment steps . Inspired by recent advances in differentiable neural architecture search e.g . DARTs ( Liu et al. , 2019b ) , we relax the discrete program architecture search space to be continuous . Specifically , we encode program architecture synthesis as learning the probability distribution over all possible architecture derivations ( up to a certain bound on program abstract syntax tree depth ) induced by a policy language grammar . This enables our RL algorithm to jointly optimize program architectures and the parameters of program modules via policy-gradient methods . Our second contribution is improving programmatic policies to support compositionality — the integration of primitive functions trained to grasp basic , task-agnostic skills ( e.g . running forward or jumping ) into a new complex function as a composite model to solve novel RL problems ( e.g . jumping over multiple hurdles to reach a target ) . As opposed to policy ensemble models based on neural networks ( Qureshi et al. , 2019 ) , our programmatically composite models interpret how primitive functions are composed under different environment conditions based on an RL agent ’ s perceptions , and naturally generalize to novel scenarios . We further apply programmatic policies to address challenging hierarchical RL problems . Our solution leverages the specifications of primitive functions to create an optimal high-level control plan via a satisfiability constraint solver and implements the high-level plans by learned composition of primitive functions . Finally , we benchmark our method against the state-of-the-art RL methods . Our results demonstrate that the programmatic RL framework is able to solve extremely hard RL-problems using highly interpretable policies with improved task performance . 2 PROBLEM MOTIVATION AND FORMULATION . We study how to express RL policies as differentiable programs , which use symbolic language constructs to compose a set of parameterized primitive modules . To control an agent , a programmatic policy takes an environment state as input and computes an action as return for the agent to execute . We view a programmatic policy as a pair ( E , θ ) , where E is a discrete program architecture and θ is a vector of real-valued parameters of the program . A program architecture E is structured based on the context-free grammar ( Hopcroft et al. , 2007 ) of a policy DSL . In this paper , we consider the context-free grammar depicted in the standard Backus-Naur form ( Winskel , 1993 ) in Fig . 1 . A vertical bar “ | ” indicates choice . Such a grammar consists of a set of production rules X : := σ1 σ2 · · · σj where X is a nonterminal and σ1 , · · · , σj are either terminals or nonter- minals . For example , we may expand the nonteriminal E1 in a partial program if B1 then C1 else E1 to if B1 then C1 else ( if B2 then C2 else E2 ) . The nonterminals E and B stand for program expressions that evaluate to action values in Rm and Booleans , respectively , where m is the action dimension size . We represent a state input to a programmatic policy as s = { x1 : ν1 , x2 : ν2 , . . . , xn } where n is the state dimension size and νi = s [ xi ] is the value of xi in s. As usual , the unbounded variables in X = [ x1 , x2 , . . . , xn ] are assumed to be input variables ( state variables in our context ) . A terminal in this grammar is a symbol that can appear in a program ’ s code , e.g . the if symbol and xi . The semantics of a program in E is mostly standard and given by a function JEK ( s ) , defined for each DSL construct . For example , JxiK ( s ) = s [ xi ] reads the value of a variable xi in a state input s. A policy may use an if-then-else branching construct . To avoid discontinuities for differentiability , we interpret its semantics in terms of a smooth approximation where σ is the sigmoid function : Jif B then C else EK ( s ) = σ ( JBK ( s ) ) · JCK ( s ) + ( 1− σ ( JBK ( s ) ) · JEK ( s ) ( 1 ) Thus , any policy programmed in this grammar becomes a differentiable program . C is a controller used by a programmatic policy . During execution , the policy can invoke a set of controllers under different environment conditions , according to the activation of B conditions in the program . We consider three DSLs depending on how C is structured for affine , ensemble , and PID policies . Affine Policies . The DSL for affine policies allows C to be expanded as an affine transformation : CAffine : := θc + θ · X | θc where θ ∈ Rm·|X | , θc ∈ Rm are control parameters . Particularly , CAffine can be as simple as some ( learned ) constants θc . An example affine policy is given in Appendix K.1 . if θ1c + θ T 1 · X > 0 then ( 95 % · πUP ( s ) + 5 % · πLEFT ( s ) ) ←− Branch 1 else if θ2c + θ T 2 · X > 0 then ( 95 % · πLEFT ( s ) + 5 % · πRIGHT ( s ) ) ←− Branch 2 else ( 13 % · πDOWN ( s ) + 87 % · πRIGHT ( s ) ) ←− Branch 3 X = [ x , y , Gx , Gy , arctan yx , ‖x , y‖2 ] θ1 = [ − 2.052 , 0.049 , 0.440 , 0.181 , 0.241 , 1.443 ] , θ1c = −0.202 θ2 = [ 1.333 , 2.204 , −2.2171 , 2.132 , 1.878 , 0.331 ] , θ2c = −0.416 Figure 3 : An Ant Cross Maze program Pcross with three branches . A program input X includes current Ant position x , y along with the target location Gx , Gy ( sampled from one of the three goals in Fig . 2 ) . arctan yx and ‖x , y‖2 are functions of x and y . Each branch composes primitive functions : πUP , πDOWN , πLEFT , and πRIGHT . Composition weights are shown in percentage . Ensemble Policies . The most important feature of our programmatic model is compositionality — composing and reusing task-agnostic primitives in new programs to solve novel problems . The DSL for ensemble policies includes pre-acquired primitives π1 , · · · , πN as callable library functions : Cπ : := θ1 · π1 ( s ) + θ2 · π2 ( s ) + · · ·+ θN · πN ( s ) Cπ explicitly compose primitive functions ( e.g . running forward or jumping ) hierarchically into a complex program ( e.g . jumping over multiple hurdles to reach a target ) where θ1 , · · · , θN ∈ R1 parameterize a primitive combination . The input space of a primitive function can be different than that of the composite program ( formally defined below ) . Its semantics is captured as follows : JCπK ( s ) = N∑ i=0 qi · πi ( s ) where qi = exp ( θi/T ) ∑N j=0 exp ( θj/T ) Here the composition weights { qi } Ni=0 for primitive ensemble are computed using gumbel-softmax , where T is the temperature term ( Jang et al. , 2017 ) . PID Policies . Suppose we know a priori that PID control is suitable for stabilising of an RL system . We can express this knowledge using the DSL for PID functions that allows C to be expanded as discretized , multivariable PID controllers ( Zheng et al. , 2002 ) . We leave the details in Appendix K.2 . Program Interpretability . Our RL algorithm searches over a DSL to synthesize a programmatic policy . Thanks to the structured and symbolic representations , it learns highly interpretable policies . For example , consider an Ant Cross Maze environment depicted in Fig . 2 . The cross-maze contains three possible goal positions and one would be randomly selected at each time . In this environment , the task for a quadruped MuJoCo Ant is to reach the selected location by navigating through the maze staring from an initial position on the bottom and without collision or crash . We consider the DSL for this task using ensemble policies Cπ . It includes four basic primitive functions for moving the Ant up πup , down πdown , left πleft , and right πright ( pretrained as neural network policies using standard RL algorithms with details left in App . F.2 ) . Fig . 3 depicts a synthesized program Pcross with three branches for solving the Ant Cross Maze environment . As specified in Equation 1 , our semantics of a branching construct is approximated by the sigmoid function σ . The value of the predicate in a Boolean condition determines the activation of the controller guarded by the Boolean condition . At each state , branch activation determines the strength of each of the controllers in the program . For example , the activation of branch 1 is σ ( θ1c + θ T 1 · X ) , and the activation of branch 2 is ( 1− σ ( θ1c + θT1 · X ) ) · σ ( θ2c + θT2 · X ) . Fig . 4a depicts the activation of branch 1 as a function of ( x , y ) when the goal to reach is sampled at Gx = 12 , Gy = 0 . The degree of activation ( yellow ) is close to 1 on all states under ( 12 , 0 ) indicating that the ensemble policy at branch 1 is used to drive the Ant up to the goal . Indeed , according to the distribution of each primitive function at branch 1 , the effect of πUP dominates . Fig . 4b , Fig . 4c , and Fig . 4d depict the activation of all three branches when the goal is at Gx = 6 , Gy = −6 . The program can be interpreted as branch 1 ( where πUP dominates ) and branch 3 ( where πRIGHT dominates ) are activated in the yellow areas of Fig . 4b and Fig . 4d respectively . This allows the Ant to make a curved up and right move to the goal ( branch 2 is not activated during execution for this goal ) . Problem Formulation . We frame programmatic RL as a Markov Decision Process ( MDP ) defined by a tuple { S , A , T , R } where S and A represent the environment state space and action space , T : S × A × S → [ 0 , 1 ] captures the set of transition probabilities , and R : S × A → R denotes the reward function . We assume S ⊇ R|X∪V| where X is the set of input variables of a composite program ( defined by a DSL ) and V is the set of input variables of primitive functions . For a noncomposite affine policy , V = ∅ . At time t ≥ 0 , an RL agent receives an environment state st ∈ S and performs an action at ∈ A selected by its policy π ( at|st ) : S → A . Based on st and at , the agent transits to receive the next state according to the transition model T ( st+1|st , at ) , and receives the reward R ( st , at ) . We aim to learn a programmatic policy π in the DSL in Fig . 1 by jointly synthesizing the program ’ s architecture E and optimizing the program ’ s parameters θ to maximize the cumulative discounted reward Es0 , a0 , s1···∼π [ ∑∞ 0 γ t ·R ( st , at ) ] where γ ∈ ( 0 , 1 ] . | This paper presents a novel method for synthesizing programmatic policies. The code idea of the method is to define a relaxed and differentiable version of the domain-specific language (DSL) used to encode the programmatic policies. The program space the DSL induces can be described as a program of the DSL itself. Since the program defines a differentiable space, one can use policy gradient methods to search in the space of programs by assigning higher probabilities to production rules that maximize the expected rewards. The search for programmatic policies happens in two steps. The first step applies a policy gradient method to optimize the probabilities defining the program space. Then, one can extract the most likely program structure from the search space by greedily choosing the production rules with higher probabilities. The resulting program is further optimized with reinforcement learning. Empirical results on continuous control problems show the advantages of the method. | SP:633cf2b404a8d76c5f4fc2e2c88546b9a35a7688 |
Divisive Feature Normalization Improves Image Recognition Performance in AlexNet | 1 INTRODUCTION . Neural networks ( NN ’ s ) in general and convolutional NN ’ s ( CNN ’ s ) in particular were originally inspired by the brain . However , only the barest sketch of brain function has been incorporated into NN ’ s . Conversely , studies of brain-like function in NN ’ s have only begun to impact neuroscience . Here we consider a biological form of “ divisive normalization '' ( DN ) , which is postulated to be a canonical computation of at least sensory cortex ( Carandini & Heeger , 2012 ) . We show that it can enhance the image classification performance of AlexNet ( Krizhevsky et al. , 2012 ) , and study how it alters representations in the context of this architecture and task . Divisive normalization is a phenomenological description ( Geisler & Albrecht , 1992 ; Heeger , 1992 ) of nonlinear neuronal response properties observed throughout sensory cortex : when multiple stimuli are simultaneously presented , either within a neuron ’ s receptive field ( RF ; the region of sensory space in which appropriate stimuli drive a given neuron ’ s response ) or both inside the RF ( in the “ center ” ) and outside of it ( “ surround ” ) , then ( 1 ) responses tend to be less than the sum of the responses to the stimuli shown individually , that is , summation is sublinear ; but ( 2 ) when stimuli are weak , summation becomes more linear or even supralinear ( more than the sum of the responses to the individual stimuli ) . The phenomenological description posits that a neuron ’ s response is its unnormalized response , divided by a function of a constant plus a sum over the unnormalized responses ( perhaps raised to a power ) of all the other surrounding neurons in a “ normalization pool ” . Thus , anything that adds to the collective response of the population also suppresses ( effectively inhibits ) each individual neuron ’ s response . However , the divisive function reduces to the constant for weak unnormalized responses , thus removing the effects of normalization for weak stimuli . The unnormalized response is often modeled as an expansive function , e.g . a rectified quadratic ; then the response to multiple weak stimuli can show supralinear summation . There are other standard forms of normalization being used in neural networks ( Ren et al. , 2016 ) , which we will call `` canonical '' . These include ( but are not limited to ) batch ( Ioffe & Szegedy , 2015 ) , layer ( Ba et al. , 2016 ) , instance ( Ulyanov et al. , 2016 ) , and group ( Wu & He , 2018 ) normalization . These all standardize ( zero mean , unit variance ) and then affinely transform sets of activations in a given layer ; they differ in the sets of channels and images over which standardization is performed ( for all , the sets include all of space ) . These normalizations prevent or reduce covariate shifts and can have other advantages . The set includes one image for all but batch normalization , which uses all images in a batch . The first three do not lead to competition between channels , as the set either includes a single channel ( batch or instance ) or all channels ( layer ) , and the same operations are being applied to all channels in the set . However , in group normalization , the channels are divided into non-overlapping groups , with standardization performed separately over each group . Thus there is competition within the group – one channel ’ s strong activity can suppress the activity of other channels in the group , relative to the activities of channels in other groups . This is closest to DN , which is competitive . In our formulation of DN , the group with which a neuron is competing changes continuously with the neuron , constituting some local region around each neuron . We take this local region to be a single point of space and a learnable span of channels about a given channel ( more precisely , the channels are topologically arranged on a line ; the contribution of nearby channels is weighted according to the distance between it and the channel being normalized , by a decaying exponential with a learnable length constant ) . DN does not prevent covariate shifts , so we will find it useful to combine DN with one of the other normalizations . Our contributions in this paper are , for the first time ( to our knowledge ) , characterizing how a canonical biological operation , DN , learned along with the CNN filters , affects ImageNet and CIFAR100 performance and learned representations in a CNN ( AlexNet ) with and without `` canonical '' normalizations . In particular , we show : • Addition of DN improves performance for image recognition in AlexNet models with or without canonical normalizations , and the best performance is found by combining both types of normalization ; • DN increases the large or medium ( depending on presence and type of canonical normalization ) wavelength Fourier modes in the first layer receptive fields . • Both canonical and divisive normalizations reduce the network ’ s manifold capacity and correspondingly change associated geometric measures at interior layers , leading to improved manifold capacity and associated changes in geometric measures at the final level , corresponding well to improvements in performance . • DN consistently increases the sparsity of activations ( Gini index ) at each normalization step and in the output layer . We also find preliminary evidence suggesting that DN can improve out-of-distribution ( OOD ) performance . This work should be of interest both to the ML and neuroscience communities , and warrants further study , for example , to understand why DN produces the associated changes in representations , whether and how these changes are related to the improvements in performance , and how performance with DN can be optimized . 2 RELATED WORK . In recent work a neural circuit model was found that produces the neural responses that had been phenomenologically described by DN , along with a number of other biological response properties ( Ahmadian et al. , 2013 ; Rubin et al. , 2015 ) . This has raised interest in understanding the possible functions of this normalization , for which there are many hypotheses , of which we mention only a few . It has been postulated to keep activations within an appropriate dynamic range for the neurons ( Carandini & Heeger , 2012 ) . It has been shown to remove higher-order statistical dependencies in responses to auditory or visual stimuli ( Schwartz & Simoncelli , 2001 ) , and more generally to minimize redundancy , maximize information , or efficiently or optimally encode ( Malo & Laparra , 2010 ; Gomez-Villa et al. , 2020 ; Malo , 2020 ; Ballé et al. , 2016 ) . It has also been shown to arise from statistical inference of the reflectances underlying a model of the statistics of natural scenes , the Gaussian scale mixture model ( GSM ) ( Coen-Cagli et al. , 2012 ; 2015 ; Echeveste et al. , 2020 ) . The original AlexNet ( Krizhevsky et al. , 2012 ) included local response normalization ( LRN ) , much like ours ( Eq . 1 ) but with a linear numerator and the sum in the denominator over ±2 neighbors without exponential weighting . Parameter values were hyperparameters set using a validation set ; the equivalent of our parameter kα/λ was 10−4 , with k = 2 , making it difficult to understand how LRN could have had much impact . Nonetheless it improved performance , though this was disputed by Simonyan & Zisserman ( 2015 ) , but in our hands by less than DN ( see Table 1 ) . Ren et al . ( 2016 ) developed a unified mathematical framework for slightly modified batch , layer , and DN , combined it with an L1 regularizer , and showed that various forms of this ( learned ) regularized normalizer improved performance on CIFAR-10 and CIFAR-100 in a network with 3 convolutional and 2 fully connected layers , with the best performance by a modified batch norm . Their DN included in a unit ’ s normalization pool all channels in a local spatial region about the unit . Giraldo & Schwartz ( 2019 ) explored a flexible , stimulus-dependent form of DN across space , based on the GSM , with learned parameters , that was added to the 2nd layer of a pretrained Alexnet to model contextual modulation in V1 . Others have examined effects of DN on tasks in various biologically-motivated architectures ( Coen-Cagli & Schwartz , 2013 ; Bertalmío et al. , 2020 ) . Burg et al . ( 2021 ) implemented a learnable form of DN in a model trained end-to-end to replicate spike counts of V1 neurons . The model included a single convolutional layer of 32 filters with batch normalization , followed by DN and a readout layer . The filters developed with no topology , that is , normalization weights were learned between each directed pair of channels . The work most similar to our own was done independently by Pan et al . ( 2021 ) . They considered a form of DN in which channels were partitioned into groups of 8 , which normalized one another , followed by an affine transformation . They also considered adding a spatially local normalization pool restricted to a unit ’ s own channel . For every unit , the affine transformations and the weights from every member of its normalization pool were learned . They also considered the DN Ren et al . ( 2016 ) . They found that , compared to canonical normalizations , their channel normalization , but not the additional spatial normalization nor DN , improved performance on CIFAR-10 in shallow convolutional nets but not in deeper ones ( 4-5 or more layers ) . They attributed the improved performance on shallow networks to their channel normalization making activity distributions in early layers more Gaussian , Their channel normalization also showed some improvement over canonical normalizations for AlexNet on ImageNet . Our normalization pool size is learned ( determined by the space constant of an exponential kernel ) , we examine pairings of divisive and canonical normalization which we find important to avoid failures to learn and improve performance relative to divisive alone , and we examine several properties – receptive fields and their Fourier power , manifold capacity , sparsity – that characterize ways in which the normalizations change representations . 3 METHODS . Architecture . We studied 8 models , each a variant of AlexNet ( 5 convolutional layers and 3 fully connected layers ; Krizhevsky et al. , 2012 ) with different normalization layers , with a Kaiming He initialization ( He et al. , 2015 ) and without pytorch local response normalization ( LRN ) . The filters are 11x11 for ImageNet and 3x3 for CIFAR-100 in the first layer , 3x3 in all subsequent layers . The order of operations in each convolutional layer is ReLU , then DN if used , then canonical normalization if used ( Divisive , Batch , Group , Layer ) . Normalization Formalisms . For DN , the channels in a given layer develop topologically arranged on a line . Given n channels in a layer , numbered from 1 to n , we let ac ( x ) be the rectified output of the convolution with the filter of channel c at 2D spatial position x . We take the unnormalized activation of this channel to be ac ( x ) 2 . We then divisively normalize , using as a “ normalization pool '' an exponentially weighted sum of the unnormalized activations of nearby channels at the same spatial position , to yield the unit ’ s normalized activity bc ( x ) : bc ( x ) = ac ( x ) 2 ( k ( 1 + αλ ∑4λ j=−4λ ac+j ( x ) 2e−|j|/λ ) ) β ( 1 ) Here , β , α , k and λ are all learnable parameters , learned independently for each convolutional layer . We also considered models in which each divisive normalization was followed by a `` canonical '' normalization : either batch , group , or layer . In all three , the normalization is of the form : z̃n , j = γ zn , j−E [ zn ] √ V ar [ zn ] + + β . Here γ and β are learnable parameters . The subscript n denotes the set that is normalized together . For example , in batch normalization , for an input of dimension N × c × H ×W , in which c is the number of features , H and W the spatial dimensions and N the number of images in a batch . The mean and variance in this equation are calculated for a given feature across all of space and the whole batch . For layer normalization , the mean and variance are calculated across the spatial and feature dimensions for each image . For group normalization , the feature dimension is divided into 4 equal-sized groups in each layer , and the normalization is done within each group across space for each image . Hyperparameters . Unless otherwise specified , the learning rate used in the models was .01 . Batch sizes were 128 . The initial normalization parameters were λ = 10. , α = .1 , β = 1. , k = 10 , except for the Divisive model with no other normalizations , for which initial λ = 1. and k = 0.5 to make learning reliable ( further discussed in Results ) . The Weight initialization method followed that of He et al . ( 2015 ) in which weights are initialized with the same statistics for differing seeds . Specifically , the He formulation for ReLU activation functions is meant to keep the expected activation variances constant across layers . We used the same principle for our networks with ReLU plus DN and arrived at the same weight initialization . We then used the same initialization for combined divisive/canonical models . See Appendix A and B for more information . The CIFAR training and validation images were resized to 32 × 32 × 3 and horizontally flipped ; Imagenet training images resized to 224 × 224 × 3 and horizontally flipped ; Imagenet validation images resized to 256 × 256 × 3 and center cropped . In both data sets , each color channel was standardized . | The authors study the role of the biologically realistic divisive normalization computation in the context of deep learning models trained to perform image classification tasks. The authors compare divisive normalization (scaling neuronal response by exponentially weighted sum of its neighbors) with those normalization techniques commonly used in machine learning models (such as batch normalization, layer normalization etc) and find that their implementation of divisive normalization provides improved image recognition performance. The authors perform a range of analyses to representationally understand why divisive normalization provides the above-mentioned increase in classification accuracy. | SP:0f44e739c4536b6b955b11f47a2d16b2326926ce |
Divisive Feature Normalization Improves Image Recognition Performance in AlexNet | 1 INTRODUCTION . Neural networks ( NN ’ s ) in general and convolutional NN ’ s ( CNN ’ s ) in particular were originally inspired by the brain . However , only the barest sketch of brain function has been incorporated into NN ’ s . Conversely , studies of brain-like function in NN ’ s have only begun to impact neuroscience . Here we consider a biological form of “ divisive normalization '' ( DN ) , which is postulated to be a canonical computation of at least sensory cortex ( Carandini & Heeger , 2012 ) . We show that it can enhance the image classification performance of AlexNet ( Krizhevsky et al. , 2012 ) , and study how it alters representations in the context of this architecture and task . Divisive normalization is a phenomenological description ( Geisler & Albrecht , 1992 ; Heeger , 1992 ) of nonlinear neuronal response properties observed throughout sensory cortex : when multiple stimuli are simultaneously presented , either within a neuron ’ s receptive field ( RF ; the region of sensory space in which appropriate stimuli drive a given neuron ’ s response ) or both inside the RF ( in the “ center ” ) and outside of it ( “ surround ” ) , then ( 1 ) responses tend to be less than the sum of the responses to the stimuli shown individually , that is , summation is sublinear ; but ( 2 ) when stimuli are weak , summation becomes more linear or even supralinear ( more than the sum of the responses to the individual stimuli ) . The phenomenological description posits that a neuron ’ s response is its unnormalized response , divided by a function of a constant plus a sum over the unnormalized responses ( perhaps raised to a power ) of all the other surrounding neurons in a “ normalization pool ” . Thus , anything that adds to the collective response of the population also suppresses ( effectively inhibits ) each individual neuron ’ s response . However , the divisive function reduces to the constant for weak unnormalized responses , thus removing the effects of normalization for weak stimuli . The unnormalized response is often modeled as an expansive function , e.g . a rectified quadratic ; then the response to multiple weak stimuli can show supralinear summation . There are other standard forms of normalization being used in neural networks ( Ren et al. , 2016 ) , which we will call `` canonical '' . These include ( but are not limited to ) batch ( Ioffe & Szegedy , 2015 ) , layer ( Ba et al. , 2016 ) , instance ( Ulyanov et al. , 2016 ) , and group ( Wu & He , 2018 ) normalization . These all standardize ( zero mean , unit variance ) and then affinely transform sets of activations in a given layer ; they differ in the sets of channels and images over which standardization is performed ( for all , the sets include all of space ) . These normalizations prevent or reduce covariate shifts and can have other advantages . The set includes one image for all but batch normalization , which uses all images in a batch . The first three do not lead to competition between channels , as the set either includes a single channel ( batch or instance ) or all channels ( layer ) , and the same operations are being applied to all channels in the set . However , in group normalization , the channels are divided into non-overlapping groups , with standardization performed separately over each group . Thus there is competition within the group – one channel ’ s strong activity can suppress the activity of other channels in the group , relative to the activities of channels in other groups . This is closest to DN , which is competitive . In our formulation of DN , the group with which a neuron is competing changes continuously with the neuron , constituting some local region around each neuron . We take this local region to be a single point of space and a learnable span of channels about a given channel ( more precisely , the channels are topologically arranged on a line ; the contribution of nearby channels is weighted according to the distance between it and the channel being normalized , by a decaying exponential with a learnable length constant ) . DN does not prevent covariate shifts , so we will find it useful to combine DN with one of the other normalizations . Our contributions in this paper are , for the first time ( to our knowledge ) , characterizing how a canonical biological operation , DN , learned along with the CNN filters , affects ImageNet and CIFAR100 performance and learned representations in a CNN ( AlexNet ) with and without `` canonical '' normalizations . In particular , we show : • Addition of DN improves performance for image recognition in AlexNet models with or without canonical normalizations , and the best performance is found by combining both types of normalization ; • DN increases the large or medium ( depending on presence and type of canonical normalization ) wavelength Fourier modes in the first layer receptive fields . • Both canonical and divisive normalizations reduce the network ’ s manifold capacity and correspondingly change associated geometric measures at interior layers , leading to improved manifold capacity and associated changes in geometric measures at the final level , corresponding well to improvements in performance . • DN consistently increases the sparsity of activations ( Gini index ) at each normalization step and in the output layer . We also find preliminary evidence suggesting that DN can improve out-of-distribution ( OOD ) performance . This work should be of interest both to the ML and neuroscience communities , and warrants further study , for example , to understand why DN produces the associated changes in representations , whether and how these changes are related to the improvements in performance , and how performance with DN can be optimized . 2 RELATED WORK . In recent work a neural circuit model was found that produces the neural responses that had been phenomenologically described by DN , along with a number of other biological response properties ( Ahmadian et al. , 2013 ; Rubin et al. , 2015 ) . This has raised interest in understanding the possible functions of this normalization , for which there are many hypotheses , of which we mention only a few . It has been postulated to keep activations within an appropriate dynamic range for the neurons ( Carandini & Heeger , 2012 ) . It has been shown to remove higher-order statistical dependencies in responses to auditory or visual stimuli ( Schwartz & Simoncelli , 2001 ) , and more generally to minimize redundancy , maximize information , or efficiently or optimally encode ( Malo & Laparra , 2010 ; Gomez-Villa et al. , 2020 ; Malo , 2020 ; Ballé et al. , 2016 ) . It has also been shown to arise from statistical inference of the reflectances underlying a model of the statistics of natural scenes , the Gaussian scale mixture model ( GSM ) ( Coen-Cagli et al. , 2012 ; 2015 ; Echeveste et al. , 2020 ) . The original AlexNet ( Krizhevsky et al. , 2012 ) included local response normalization ( LRN ) , much like ours ( Eq . 1 ) but with a linear numerator and the sum in the denominator over ±2 neighbors without exponential weighting . Parameter values were hyperparameters set using a validation set ; the equivalent of our parameter kα/λ was 10−4 , with k = 2 , making it difficult to understand how LRN could have had much impact . Nonetheless it improved performance , though this was disputed by Simonyan & Zisserman ( 2015 ) , but in our hands by less than DN ( see Table 1 ) . Ren et al . ( 2016 ) developed a unified mathematical framework for slightly modified batch , layer , and DN , combined it with an L1 regularizer , and showed that various forms of this ( learned ) regularized normalizer improved performance on CIFAR-10 and CIFAR-100 in a network with 3 convolutional and 2 fully connected layers , with the best performance by a modified batch norm . Their DN included in a unit ’ s normalization pool all channels in a local spatial region about the unit . Giraldo & Schwartz ( 2019 ) explored a flexible , stimulus-dependent form of DN across space , based on the GSM , with learned parameters , that was added to the 2nd layer of a pretrained Alexnet to model contextual modulation in V1 . Others have examined effects of DN on tasks in various biologically-motivated architectures ( Coen-Cagli & Schwartz , 2013 ; Bertalmío et al. , 2020 ) . Burg et al . ( 2021 ) implemented a learnable form of DN in a model trained end-to-end to replicate spike counts of V1 neurons . The model included a single convolutional layer of 32 filters with batch normalization , followed by DN and a readout layer . The filters developed with no topology , that is , normalization weights were learned between each directed pair of channels . The work most similar to our own was done independently by Pan et al . ( 2021 ) . They considered a form of DN in which channels were partitioned into groups of 8 , which normalized one another , followed by an affine transformation . They also considered adding a spatially local normalization pool restricted to a unit ’ s own channel . For every unit , the affine transformations and the weights from every member of its normalization pool were learned . They also considered the DN Ren et al . ( 2016 ) . They found that , compared to canonical normalizations , their channel normalization , but not the additional spatial normalization nor DN , improved performance on CIFAR-10 in shallow convolutional nets but not in deeper ones ( 4-5 or more layers ) . They attributed the improved performance on shallow networks to their channel normalization making activity distributions in early layers more Gaussian , Their channel normalization also showed some improvement over canonical normalizations for AlexNet on ImageNet . Our normalization pool size is learned ( determined by the space constant of an exponential kernel ) , we examine pairings of divisive and canonical normalization which we find important to avoid failures to learn and improve performance relative to divisive alone , and we examine several properties – receptive fields and their Fourier power , manifold capacity , sparsity – that characterize ways in which the normalizations change representations . 3 METHODS . Architecture . We studied 8 models , each a variant of AlexNet ( 5 convolutional layers and 3 fully connected layers ; Krizhevsky et al. , 2012 ) with different normalization layers , with a Kaiming He initialization ( He et al. , 2015 ) and without pytorch local response normalization ( LRN ) . The filters are 11x11 for ImageNet and 3x3 for CIFAR-100 in the first layer , 3x3 in all subsequent layers . The order of operations in each convolutional layer is ReLU , then DN if used , then canonical normalization if used ( Divisive , Batch , Group , Layer ) . Normalization Formalisms . For DN , the channels in a given layer develop topologically arranged on a line . Given n channels in a layer , numbered from 1 to n , we let ac ( x ) be the rectified output of the convolution with the filter of channel c at 2D spatial position x . We take the unnormalized activation of this channel to be ac ( x ) 2 . We then divisively normalize , using as a “ normalization pool '' an exponentially weighted sum of the unnormalized activations of nearby channels at the same spatial position , to yield the unit ’ s normalized activity bc ( x ) : bc ( x ) = ac ( x ) 2 ( k ( 1 + αλ ∑4λ j=−4λ ac+j ( x ) 2e−|j|/λ ) ) β ( 1 ) Here , β , α , k and λ are all learnable parameters , learned independently for each convolutional layer . We also considered models in which each divisive normalization was followed by a `` canonical '' normalization : either batch , group , or layer . In all three , the normalization is of the form : z̃n , j = γ zn , j−E [ zn ] √ V ar [ zn ] + + β . Here γ and β are learnable parameters . The subscript n denotes the set that is normalized together . For example , in batch normalization , for an input of dimension N × c × H ×W , in which c is the number of features , H and W the spatial dimensions and N the number of images in a batch . The mean and variance in this equation are calculated for a given feature across all of space and the whole batch . For layer normalization , the mean and variance are calculated across the spatial and feature dimensions for each image . For group normalization , the feature dimension is divided into 4 equal-sized groups in each layer , and the normalization is done within each group across space for each image . Hyperparameters . Unless otherwise specified , the learning rate used in the models was .01 . Batch sizes were 128 . The initial normalization parameters were λ = 10. , α = .1 , β = 1. , k = 10 , except for the Divisive model with no other normalizations , for which initial λ = 1. and k = 0.5 to make learning reliable ( further discussed in Results ) . The Weight initialization method followed that of He et al . ( 2015 ) in which weights are initialized with the same statistics for differing seeds . Specifically , the He formulation for ReLU activation functions is meant to keep the expected activation variances constant across layers . We used the same principle for our networks with ReLU plus DN and arrived at the same weight initialization . We then used the same initialization for combined divisive/canonical models . See Appendix A and B for more information . The CIFAR training and validation images were resized to 32 × 32 × 3 and horizontally flipped ; Imagenet training images resized to 224 × 224 × 3 and horizontally flipped ; Imagenet validation images resized to 256 × 256 × 3 and center cropped . In both data sets , each color channel was standardized . | The authors study the effect of divisive normalization on AlexNet. They show that, when combined with standard normalization schemes, it increases performance. They also investigate the filter shapes, manifold capacity and (adversarial) robustness of the learned representations. Following the authors' response I have increased my score form 5 to 6. | SP:0f44e739c4536b6b955b11f47a2d16b2326926ce |
Transferable Adversarial Attack based on Integrated Gradients | 1 INTRODUCTION . Adversarial example , which can mislead deep networks is one of the major obstacles for applying deep learning on security-sensitive applications ( Szegedy et al. , 2014 ) . Researchers found that some adversarial examples co-exist in models with different architectures and parameters ( Papernot et al. , 2016b ; 2017 ) . By exploiting this property , an adversary can derive adversarial examples through a surrogate model and attack other models ( Liu et al. , 2017 ) . Seeking these co-existing adversarial examples would benefit many aspects , including evaluating network robustness , developing defense schemes , and understanding deep learning ( Goodfellow et al. , 2015 ) . Adversarial examples are commonly studied under two threat models , white-box and black-box attacks ( Kurakin et al. , 2018 ) . In the white-box setting , adversaries have full knowledge of victim models , including model structures , weights of the parameters , and loss functions used to train the models . Accordingly , they can directly obtain the gradients of the victim models and seek adversarial examples ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ; Carlini & Wagner , 2017 ) . Whitebox attacks are important for evaluating and developing robust models ( Goodfellow et al. , 2015 ) . In the black-box setting , adversaries have no knowledge of victim models . Two types of approaches , query-based approach and transfer-based approach , are commonly studied for black-box attacks . The query-based approach estimates the gradients of victim models through the outputs of query images ( Guo et al. , 2019 ; Ilyas et al. , 2018 ; 2019 ; Tu et al. , 2019 ) . Due to the huge number of queries , it can be easily defended . The transfer-based approach , using surrogate models to estimate the gradients , is a more practical way in black-box attacks . Some researchers have joined these two approaches together to reduce the number of queries ( Cheng et al. , 2019 ; Guo et al. , 2019 ; Huang & Zhang , 2020 ) . This paper focuses on the transfer-based approach because of its practicality and its use in the combined methods . There are three approaches , standard objective optimization , attention modification , and smoothing to craft adversarial examples . In general , combining methods based on different approaches together yields stronger black-box attacks . Along this line , we propose a new and simple algorithm named Transferable Attack based on Integrated Gradients ( TAIG ) to generate highly transferable adversarial examples in this paper . The fundamental difference from the previous methods is that TAIG uses one single term to carry out all the three approaches simultaneously . Two versions of TAIG , TAIG-S and TAIG-R are studied . TAIG-S uses the original integrated gradients ( Sundararajan et al. , 2017 ) computed on a straight-line path , while TAIG-R calculates the integrated gradients on a random piecewise linear path . TAIG can also be applied with other methods together to further increase its transferability . The rest of the paper is organized as follows . Section 2 summarizes the related works . Section 3 describes TAIG and discusses it from the three perspectives . Section 4 reports the experimental results and comparisons . Section 5 gives some conclusive remarks . 2 RELATED WORKS . Optimization approach mainly uses the gradients of a surrogate model to optimize a standard objective function , such as maximizing a training loss or minimizing the score or logit output of a benign image . Examples are Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) , Fast Gradient Sign Method ( FGSM ) ( Goodfellow et al. , 2015 ) , Basic Iterative Method ( BIM ) ( Kurakin et al. , 2016 ) , Momentum Iterative FGSM ( MIFGSM ) ( Dong et al. , 2018 ) and Carlini-Wagner ’ s ( C & W ) ( Carlini & Wagner , 2017 ) attacks . They are commonly referred to as gradient-based attacks . These methods were originally designed for white-box attacks , but are commonly used as a back-end component in other methods for black-box attacks . Attention modification approach assumes that different deep networks classify the same image based on similar features . Therefore , adversarial examples generated by modifying the features in benign images are expected to be more transferable . Examples are Jacobian based Saliency Map Attack ( JSMA ) ( Papernot et al. , 2016a ) , Attack on Attention ( AoA ) ( Chen et al. , 2020 ) and Attentionguided Transfer Attack ( ATA ) ( Wu et al. , 2020b ) , which use attention maps to identify potential common features for attacks . JSMA uses the Jacobian matrix to compute its attention map , but its objective function is unclear . AoA utilizes SGLRP ( Iwana et al. , 2019 ) to compute the attention map , while ATA uses the gradients of an objective function with respect to neuron outputs to derive an attention map . Both AoA and ATA seek adversarial example that maximizes the difference between its attention map and the attention map of the corresponding benign sample . In addition to the attention terms , AoA and ATA also include the typical attack losses , e.g. , logit output in their objective functions , and use a hyperparameter to balance the two terms . Adversarial Perturbations ( TAP ) ( Zhou et al. , 2018 ) , Activation attack ( AA ) ( Inkawhich et al. , 2019 ) and Intermediate Level Attack ( ILA ) ( Huang et al. , 2019 ) , which all directly maximize the distance between feature maps of benign images and adversarial examples , also belong to this category . TAP and AA generate adversarial examples by employing multi-layer and single-layer feature maps respectively . ILA fine-tunes existing adversarial examples by increasing the perturbation on a specific hidden layer for higher black-box transferability . Smoothing approach aims at avoiding over-fitting the decision surface of surrogate model . The methods based on the smoothing approach can be divided into two branches . One branch uses smoothed gradients derived from multiple points of the decision surface . Examples are Diverse Inputs Iterative method ( DI ) ( Xie et al. , 2019 ) , Scale Invariance Attack ( SI ) ( Lin et al. , 2020 ) , Translation-invariant Attack ( TI ) ( Dong et al. , 2019 ) , Smoothed Gradient Attack ( SG ) ( Wu & Zhu , 2020 ) , Admix Attack ( Admix ) ( Wang et al. , 2021 ) and Variance Tuning ( VT ) ( Wang & He , 2021 ) . Most of these methods smooth the gradients by calculating the average gradients of augmented images . The other branch modifies the gradient calculations in order to estimate the gradients of a smoother surface . Examples are Skip Gradient Method ( SGM ) ( Wu et al. , 2020a ) and Linear backpropagation Attack ( LinBP ) ( Guo et al. , 2020 ) . SGM is specifically designed for models with skip connections , such as ResNet . It forces backpropagating using skip connections more than the routes with non-linear functions . LinBP takes a similar approach , which computes forward loss as normal and skips some non-linear activations in backpropagating . By diminishing non-linear paths in a surrogate model , gradients are computed from a smoother surface . 3 PRELIMINARIES AND TAIG . 3.1 NOTATIONS AND INTEGRATED GRADIENTS . For the sake of clear presentation , a set of notations is given first . Let F : RN → RK be a classification network that maps input x to a vector whose k-th element represents the value of the k-th output node in the logit layer , and fk : RN → R be the network mapping x to the output value of the k-th class , i.e. , F ( x ) = [ f1 ( x ) · · · fk ( x ) · · · fK ( x ) ] T , where T is a transpose operator . To simplify the notations , the subscript k is omitted i.e. , f = fk , when k represents arbitrary class in K or the class label is clear . x and x̃ represent a benign image and an adversarial example respectively , and xi and x̃i represent their i-th pixels . The class label of x is denoted as y . The bold symbols e.g. , x , are used to indicate images , matrices and vectors , and non-bold symbols e.g. , xi , are used to indicate scalars . Integrated gradients ( Sundararajan et al. , 2017 ) is a method attributing the prediction of a deep network to its input features . The attributes computed by it indicate the importance of each pixel to the network output and can be regarded as attention and saliency values . Integrated gradients is developed based on two axioms — Sensitivity and Implementation Invariance , and satisfies another two axioms — Linearity and Completeness . To discuss the proposed TAIG , the completeness axiom is needed . Thus , we briefly introduce integrated gradients and the completeness axiom below . Integrated gradients is a line integral of the gradients from a reference image r to an input image x . An integrated gradient of the i-th pixel of the input x is defined as IGi ( f , x , r ) = ( xi − ri ) × ∫ 1 η=0 ∂f ( r + η × ( x− r ) ) ∂xi dη , ( 1 ) where ri is the i-th pixel of r. In this work , a black image is selected as the reference r. The completeness axiom states that the difference between f ( x ) and f ( r ) is equal to the sum of IGi ( f , x , r ) , i.e. , f ( x ) − f ( r ) = N∑ i=1 IGi ( f , x , r ) . ( 2 ) To simplify the notations , both IGi ( x ) and IGi ( f , x ) are used to represent IGi ( f , x , r ) , and IG ( x ) and IG ( f , x ) are used to represent [ IG1 ( f , x , r ) · · · IGN ( f , x , r ) ] T , when f and r are clear . The details of the other axioms and the properties of integrated gradients can be found in Sundararajan et al . ( 2017 ) . 3.2 THE TWO VERSIONS — TAIG-S AND TAIG-R. We propose two versions of TAIG for untargeted attack . The first one based on the original integrated gradients performs the integration on a straight-line path . This version is named Transferable Attack based on Integrated Gradients on Straight-line Path ( TAIG-S ) and its attack equation is defined as x̃ = x− α× sign ( IG ( fy , x ) ) , ( 3 ) where the integrated gradients are computed from the label of x , i.e. , y , and α > 0 controls the step size . The second version is named Transferable Attack based on Integrated Gradients on Random Piecewise Linear Path ( TAIG-R ) . Let P be a random piecewise linear path and x0 , · · · , xE be its E + 1 turning points , including the starting point x0 and the endpoint xE . The line segment from xe to xe+1 is defined as xe + η × ( xe+1 − xe ) , where 0 ≤ η ≤ 1 . When computing integrated gradients of the line segment , xe is used as a reference and the corresponding integrated gradients can be computed by equation 1 . The integrated gradients of the entire path are defined , RIGi ( f , xE , x0 ) = E−1∑ e=0 IGi ( f , xe+1 , xe ) . ( 4 ) The integrated gradients computed from the random piecewise linear path is called random path integrated gradients ( RIG ) . Note that RIG still fulfills the completeness axiom : N∑ i=1 E−1∑ e=0 IGi ( f , xe+1 , xe ) = E−1∑ e=0 ( f ( xe+1 ) − f ( xe ) ) = f ( xE ) − f ( x0 ) . ( 5 ) It should be highlighted that the integrated gradients computed from other paths also fulfill the completeness axiom ( Sundararajan et al. , 2017 ) . In this paper , the turning points , xe in the random path are generated by xe = x0 + e E ( xE − x0 ) + v , ( 6 ) where e ∈ ( 0 , 1 , · · · , E ) and v is a random vector following a uniform distribution with support from ( −τ , τ ) . The attack equation of TAIG-R is x̃ = x− α× sign ( RIG ( fy , x ) ) , ( 7 ) which is the same as TAIG-S , except that IG ( fy , x ) in TAIG-S is replaced by RIG ( fy , x ) . As with PGD and BIM , TAIG can be applied iteratively . The sign function is used in TAIG because the distance between x̃ and x is measured by l∞ norm in this study . | In practice, adversarial examples are generated in three ways, i) solving a standard optimisation problem, ii) leveraging the salient regions of an image, or iii) smoothing the decision surfaces. The authors propose a simple technique named Transferable Attack based on Integrated Gradients (TAIG) that combines all these three approaches. Unlike the existing systems, which leverages other methods by adding additional terms to the objective function, TAIG integrates them into a single objective. | SP:163b6f1e8787eb5d48bf477b3ef3c0a00d41a937 |
Transferable Adversarial Attack based on Integrated Gradients | 1 INTRODUCTION . Adversarial example , which can mislead deep networks is one of the major obstacles for applying deep learning on security-sensitive applications ( Szegedy et al. , 2014 ) . Researchers found that some adversarial examples co-exist in models with different architectures and parameters ( Papernot et al. , 2016b ; 2017 ) . By exploiting this property , an adversary can derive adversarial examples through a surrogate model and attack other models ( Liu et al. , 2017 ) . Seeking these co-existing adversarial examples would benefit many aspects , including evaluating network robustness , developing defense schemes , and understanding deep learning ( Goodfellow et al. , 2015 ) . Adversarial examples are commonly studied under two threat models , white-box and black-box attacks ( Kurakin et al. , 2018 ) . In the white-box setting , adversaries have full knowledge of victim models , including model structures , weights of the parameters , and loss functions used to train the models . Accordingly , they can directly obtain the gradients of the victim models and seek adversarial examples ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ; Carlini & Wagner , 2017 ) . Whitebox attacks are important for evaluating and developing robust models ( Goodfellow et al. , 2015 ) . In the black-box setting , adversaries have no knowledge of victim models . Two types of approaches , query-based approach and transfer-based approach , are commonly studied for black-box attacks . The query-based approach estimates the gradients of victim models through the outputs of query images ( Guo et al. , 2019 ; Ilyas et al. , 2018 ; 2019 ; Tu et al. , 2019 ) . Due to the huge number of queries , it can be easily defended . The transfer-based approach , using surrogate models to estimate the gradients , is a more practical way in black-box attacks . Some researchers have joined these two approaches together to reduce the number of queries ( Cheng et al. , 2019 ; Guo et al. , 2019 ; Huang & Zhang , 2020 ) . This paper focuses on the transfer-based approach because of its practicality and its use in the combined methods . There are three approaches , standard objective optimization , attention modification , and smoothing to craft adversarial examples . In general , combining methods based on different approaches together yields stronger black-box attacks . Along this line , we propose a new and simple algorithm named Transferable Attack based on Integrated Gradients ( TAIG ) to generate highly transferable adversarial examples in this paper . The fundamental difference from the previous methods is that TAIG uses one single term to carry out all the three approaches simultaneously . Two versions of TAIG , TAIG-S and TAIG-R are studied . TAIG-S uses the original integrated gradients ( Sundararajan et al. , 2017 ) computed on a straight-line path , while TAIG-R calculates the integrated gradients on a random piecewise linear path . TAIG can also be applied with other methods together to further increase its transferability . The rest of the paper is organized as follows . Section 2 summarizes the related works . Section 3 describes TAIG and discusses it from the three perspectives . Section 4 reports the experimental results and comparisons . Section 5 gives some conclusive remarks . 2 RELATED WORKS . Optimization approach mainly uses the gradients of a surrogate model to optimize a standard objective function , such as maximizing a training loss or minimizing the score or logit output of a benign image . Examples are Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) , Fast Gradient Sign Method ( FGSM ) ( Goodfellow et al. , 2015 ) , Basic Iterative Method ( BIM ) ( Kurakin et al. , 2016 ) , Momentum Iterative FGSM ( MIFGSM ) ( Dong et al. , 2018 ) and Carlini-Wagner ’ s ( C & W ) ( Carlini & Wagner , 2017 ) attacks . They are commonly referred to as gradient-based attacks . These methods were originally designed for white-box attacks , but are commonly used as a back-end component in other methods for black-box attacks . Attention modification approach assumes that different deep networks classify the same image based on similar features . Therefore , adversarial examples generated by modifying the features in benign images are expected to be more transferable . Examples are Jacobian based Saliency Map Attack ( JSMA ) ( Papernot et al. , 2016a ) , Attack on Attention ( AoA ) ( Chen et al. , 2020 ) and Attentionguided Transfer Attack ( ATA ) ( Wu et al. , 2020b ) , which use attention maps to identify potential common features for attacks . JSMA uses the Jacobian matrix to compute its attention map , but its objective function is unclear . AoA utilizes SGLRP ( Iwana et al. , 2019 ) to compute the attention map , while ATA uses the gradients of an objective function with respect to neuron outputs to derive an attention map . Both AoA and ATA seek adversarial example that maximizes the difference between its attention map and the attention map of the corresponding benign sample . In addition to the attention terms , AoA and ATA also include the typical attack losses , e.g. , logit output in their objective functions , and use a hyperparameter to balance the two terms . Adversarial Perturbations ( TAP ) ( Zhou et al. , 2018 ) , Activation attack ( AA ) ( Inkawhich et al. , 2019 ) and Intermediate Level Attack ( ILA ) ( Huang et al. , 2019 ) , which all directly maximize the distance between feature maps of benign images and adversarial examples , also belong to this category . TAP and AA generate adversarial examples by employing multi-layer and single-layer feature maps respectively . ILA fine-tunes existing adversarial examples by increasing the perturbation on a specific hidden layer for higher black-box transferability . Smoothing approach aims at avoiding over-fitting the decision surface of surrogate model . The methods based on the smoothing approach can be divided into two branches . One branch uses smoothed gradients derived from multiple points of the decision surface . Examples are Diverse Inputs Iterative method ( DI ) ( Xie et al. , 2019 ) , Scale Invariance Attack ( SI ) ( Lin et al. , 2020 ) , Translation-invariant Attack ( TI ) ( Dong et al. , 2019 ) , Smoothed Gradient Attack ( SG ) ( Wu & Zhu , 2020 ) , Admix Attack ( Admix ) ( Wang et al. , 2021 ) and Variance Tuning ( VT ) ( Wang & He , 2021 ) . Most of these methods smooth the gradients by calculating the average gradients of augmented images . The other branch modifies the gradient calculations in order to estimate the gradients of a smoother surface . Examples are Skip Gradient Method ( SGM ) ( Wu et al. , 2020a ) and Linear backpropagation Attack ( LinBP ) ( Guo et al. , 2020 ) . SGM is specifically designed for models with skip connections , such as ResNet . It forces backpropagating using skip connections more than the routes with non-linear functions . LinBP takes a similar approach , which computes forward loss as normal and skips some non-linear activations in backpropagating . By diminishing non-linear paths in a surrogate model , gradients are computed from a smoother surface . 3 PRELIMINARIES AND TAIG . 3.1 NOTATIONS AND INTEGRATED GRADIENTS . For the sake of clear presentation , a set of notations is given first . Let F : RN → RK be a classification network that maps input x to a vector whose k-th element represents the value of the k-th output node in the logit layer , and fk : RN → R be the network mapping x to the output value of the k-th class , i.e. , F ( x ) = [ f1 ( x ) · · · fk ( x ) · · · fK ( x ) ] T , where T is a transpose operator . To simplify the notations , the subscript k is omitted i.e. , f = fk , when k represents arbitrary class in K or the class label is clear . x and x̃ represent a benign image and an adversarial example respectively , and xi and x̃i represent their i-th pixels . The class label of x is denoted as y . The bold symbols e.g. , x , are used to indicate images , matrices and vectors , and non-bold symbols e.g. , xi , are used to indicate scalars . Integrated gradients ( Sundararajan et al. , 2017 ) is a method attributing the prediction of a deep network to its input features . The attributes computed by it indicate the importance of each pixel to the network output and can be regarded as attention and saliency values . Integrated gradients is developed based on two axioms — Sensitivity and Implementation Invariance , and satisfies another two axioms — Linearity and Completeness . To discuss the proposed TAIG , the completeness axiom is needed . Thus , we briefly introduce integrated gradients and the completeness axiom below . Integrated gradients is a line integral of the gradients from a reference image r to an input image x . An integrated gradient of the i-th pixel of the input x is defined as IGi ( f , x , r ) = ( xi − ri ) × ∫ 1 η=0 ∂f ( r + η × ( x− r ) ) ∂xi dη , ( 1 ) where ri is the i-th pixel of r. In this work , a black image is selected as the reference r. The completeness axiom states that the difference between f ( x ) and f ( r ) is equal to the sum of IGi ( f , x , r ) , i.e. , f ( x ) − f ( r ) = N∑ i=1 IGi ( f , x , r ) . ( 2 ) To simplify the notations , both IGi ( x ) and IGi ( f , x ) are used to represent IGi ( f , x , r ) , and IG ( x ) and IG ( f , x ) are used to represent [ IG1 ( f , x , r ) · · · IGN ( f , x , r ) ] T , when f and r are clear . The details of the other axioms and the properties of integrated gradients can be found in Sundararajan et al . ( 2017 ) . 3.2 THE TWO VERSIONS — TAIG-S AND TAIG-R. We propose two versions of TAIG for untargeted attack . The first one based on the original integrated gradients performs the integration on a straight-line path . This version is named Transferable Attack based on Integrated Gradients on Straight-line Path ( TAIG-S ) and its attack equation is defined as x̃ = x− α× sign ( IG ( fy , x ) ) , ( 3 ) where the integrated gradients are computed from the label of x , i.e. , y , and α > 0 controls the step size . The second version is named Transferable Attack based on Integrated Gradients on Random Piecewise Linear Path ( TAIG-R ) . Let P be a random piecewise linear path and x0 , · · · , xE be its E + 1 turning points , including the starting point x0 and the endpoint xE . The line segment from xe to xe+1 is defined as xe + η × ( xe+1 − xe ) , where 0 ≤ η ≤ 1 . When computing integrated gradients of the line segment , xe is used as a reference and the corresponding integrated gradients can be computed by equation 1 . The integrated gradients of the entire path are defined , RIGi ( f , xE , x0 ) = E−1∑ e=0 IGi ( f , xe+1 , xe ) . ( 4 ) The integrated gradients computed from the random piecewise linear path is called random path integrated gradients ( RIG ) . Note that RIG still fulfills the completeness axiom : N∑ i=1 E−1∑ e=0 IGi ( f , xe+1 , xe ) = E−1∑ e=0 ( f ( xe+1 ) − f ( xe ) ) = f ( xE ) − f ( x0 ) . ( 5 ) It should be highlighted that the integrated gradients computed from other paths also fulfill the completeness axiom ( Sundararajan et al. , 2017 ) . In this paper , the turning points , xe in the random path are generated by xe = x0 + e E ( xE − x0 ) + v , ( 6 ) where e ∈ ( 0 , 1 , · · · , E ) and v is a random vector following a uniform distribution with support from ( −τ , τ ) . The attack equation of TAIG-R is x̃ = x− α× sign ( RIG ( fy , x ) ) , ( 7 ) which is the same as TAIG-S , except that IG ( fy , x ) in TAIG-S is replaced by RIG ( fy , x ) . As with PGD and BIM , TAIG can be applied iteratively . The sign function is used in TAIG because the distance between x̃ and x is measured by l∞ norm in this study . | Two methods are proposed in this paper. They are Transferable Attack using Integrated Gradients on Straight-line Path (TAIG-S) and Transferable Attack using Integrated Gradients on Random Piecewise Linear Path (TAIG-R). Compared with typical gradient-based attack methods, the TAIG-S uses integrated gradients to update adversarial examples, and TAIG-R uses random path integrated gradients to update adversarial examples. Experiments on ImageNet can prove the effectiveness of these methods. | SP:163b6f1e8787eb5d48bf477b3ef3c0a00d41a937 |
The Information Geometry of Unsupervised Reinforcement Learning | 1 INTRODUCTION . The high sample complexity of reinforcement learning ( RL ) algorithms has prompted a large body of prior work to study pretraining of RL agents . During the pretraining stage , the agent collects unsupervised experience from the environment that is not labeled with any rewards . Prior methods have used this pretraining stage to learn representations of the environment that might assist the learning of downstream tasks . For example , some methods learn representations of the observations ( Laskin et al. , 2020 ; Schwarzer et al. , 2021 ) or representations of the dynamics model ( Ebert et al. , 2018 ; Ha & Schmidhuber , 2018 ; Sekar et al. , 2020 ) . In this work , we focus on methods that learn a set of potentially-useful policies , often known as skills ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Gregor et al. , 2016 ; Achiam et al. , 2018 ; Eysenbach et al. , 2018 ) . That is , the learned representation corresponds to a reparametrization of policies . The aim of this unsupervised pretraining is to learn skills that , when a reward function is given , can quickly be combined or composed to maximize this reward . Prior work has demonstrated that this general approach does accelerate learning downstream RL ( Gregor et al. , 2016 ; Eysenbach et al. , 2018 ; Achiam et al. , 2018 ) . However , prior work offers little analysis about when and where such methods are provably effective . Even simple questions , such as what it means for a set of skills to be optimal , remain unanswered . Algorithms for unsupervised skill learning are conceptually related to the representation learning methods used to improve supervised learning ( Gutmann & Hyvärinen , 2010 ; Belghazi et al. , 2018 ; Wu et al. , 2018 ; Oord et al. , 2018 ; Hjelm et al. , 2018 ; He et al. , 2020 ) . Both typically maximize a lower bound on mutual information , and the learned representations are often combined linearly to solve downstream tasks ( Hjelm et al. , 2018 ; Oord et al. , 2018 ) . However , whereas prior work in supervised learning has provided thorough analysis of when and where these representation learning methods produce useful features ( Kraskov et al. , 2004 ; Song & Ermon , 2019 ; McAllester & Stratos , 2020 ) , there has been comparatively little analysis into when unsupervised skill learning methods produce skills that are useful for solving downstream RL tasks . In this paper , we analyze when and where existing skill learning methods based on mutual information maximization are ( or are not ) optimal for preparing to solve unknown , downstream tasks . On the one hand , we show that the skills learned by these methods are not complete , in that they can not be used to represent the solution to every RL problem . This result implies that using the learned skills for hierarchical RL may result in suboptimal performance , and suggests new opportunities for better skill learning algorithms . One the other hand , we show that existing methods acquire a policy initialization that is optimal for learning downstream tasks , if that adaptation is performed using an idealized adaptation procedure . To the best of our knowledge , this is the first result showing that unsupervised skill learning methods are optimal in any sense . Our analysis also illuminates a number of properties of these methods . For example , we show that every skill is optimal for some reward function , and we provide a nontrivial upper bound on the number of unique skills learned . This result implies that these methods can not learn an infinite number of unique skills , and instead will learn duplicate copies of some skills . The key to our analysis is to view RL algorithms and skill learning algorithms as geometric operations ( see Fig . 1 ) . Points correspond to distributions over states , and the set of all possible distributions is a convex polytope that lies on a probability simplex . We show that all reward-maximizing policies lie at vertices of this polytope and that maximizing mutual information corresponds to solving a facility assignment problem on the simplex . The main contribution of this paper is a proof that skill learning algorithms based on mutual information are optimal for minimizing regret against unknown reward functions , assuming that adaptation is performed using a certain procedure . Our proof of optimality relies on certain problem assumptions , leaving the door open for future skill learning algorithms to perform better under different problem assumptions . This contribution provides a rigorous notion of what it means for an unsupervised RL algorithm to be optimal , and also answers additional questions about unsupervised skill learning algorithms , such as whether the skills correspond to reward-maximizing policies and how many unique skills will be learned . 2 PRIOR WORK . In the unsupervised RL setting , an agent interacts with the environment without access to a reward function , with the aim of learning some representation of the environment that will assist in learning downstream tasks . Prior work has proposed many approaches for this problem , including learning a dynamics model ( Ebert et al. , 2018 ; Ha & Schmidhuber , 2018 ; Sekar et al. , 2020 ) , learning compact representations of observations ( Laskin et al. , 2020 ; Schwarzer et al. , 2021 ) , performing goal-conditioned RL without hand-specified rewards ( Chebotar et al. , 2021 ; Schwarzer et al. , 2021 ) , doing pure exploration ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Pathak et al. , 2017 ; Lee et al. , 2019b ; Hazan et al. , 2019 ; Seo et al. , 2021 ) or learning collections of skills ( Gregor et al. , 2016 ; Eysenbach et al. , 2018 ; Achiam et al. , 2018 ; Warde-Farley et al. , 2018 ; Sharma et al. , 2019 ; Hansen et al. , 2020 ; Campos et al. , 2020 ) . These prior methods are similar in that they all learn representations , with different methods learning representation of observations , dynamics , or policies . While each approach works well in some setting ( see Laskin et al . ( 2021 ) for a recent benchmark ) , the precise connection between these pretraining methods and success on downstream tasks remains unclear . We will focus on unsupervised skill learning methods . The problem of unsupervised pretraining for RL has also been studied in the RL theory community ( Agarwal et al. , 2020 ; Misra et al. , 2020 ; Modi et al. , 2021 ) , where it is referred to as the reward-free setting . The algorithms proposed in these prior works use a version of goal-conditioned RL for pretraining . However , the aim of these methods is different from ours : these methods aim to collect a sufficient breadth of data , whereas we focus on learning good representations . Our paper is similar to prior work that uses a geometric perspective to analyze RL algorithms ( Dadashi et al. , 2019 ; Bellemare et al. , 2019 ) . For example , Dadashi et al . ( 2019 ) visualize the value function as a point in a high-dimensional space , where each coordinate indicates the value of one state . In contrast , our analysis will visualize policies as points , where each coordinate indicates the probability of visiting that state . This difference allows us to analyze the unsupervised RL setting , where we can not define a value function because the reward function is unknown . Our analysis uses ideas from the field of information geometry ( Amari & Nagaoka , 2000 ) . Prior work has parametrized the RL problem in terms of the state distribution ( Puterman , 1990 , Eq . 6.9.2 ) , and proposed RL algorithms that solve for the optimal state distribution ( Ng et al. , 1999 ; Wang et al. , 2007 ; Nachum & Dai , 2020 ) . Our analysis uses a similar procedure for adapting to new reward functions after the unsupervised learning stage . 3 PRELIMINARIES . We focus on infinite-horizon MDPs with discrete states S and actions A , initial state distribution p0 ( s0 ) , dynamics p ( st+1 | st , at ) , and discount factor γ ∈ ( 0 , 1 ) . We assume a Markovian policy π ( a | s ) , and define the discounted state occupancy measure of this policy as ρπ ( s ) = ( 1− γ ) ∑∞ t=0 γ tPπt ( s ) , where P π t ( s ) is the probability that policy π visits state s at time t. We define C to be the set of state marginal distributions that are feasible under the environment dynamics . The RL objective can be expressed using the reward function r ( s ) and the state marginal distribution : ( 1− γ ) Eπ [ ∞∑ t=0 γtr ( st ) ] = Eρπ ( s ) [ r ( s ) ] . The factor of 1− γ accounts for the fact that the sum of discount factors 1 + γ + γ2 + · · · = 11−γ . Without loss of generality , we focus on state-dependent reward functions ; action-dependent reward functions can be handled by modifying the state to include the previous action . While our analysis will ignore function approximation error , it applies to any MDP , including MDPs where observations correspond to features ( e.g. , activations of a frozen neural network ) rather than original states . 3.1 UNSUPERVISED SKILL LEARNING ALGORITHMS . Prior skill learning algorithms learn a policy πθ ( a | s , zinput ) with parameters θ and conditioned on an additional input zinput ∼ p ( zinput ) . Let ρπθ ( s | zinput ) denote the state marginal distribution of policy πθ ( a | s , zinput ) . We will focus on methods ( Eysenbach et al. , 2018 ; Florensa et al. , 2017 ) that maximize the mutual information between the representation zinput and the states s visited by policy πθ ( a | s , zinput ) : max θ , p ( zinput ) I ( s ; zinput ) , Ep ( zinput ) Eρπθ ( s|zinput ) [ log ρ πθ ( s | zinput ) − log ρπθ ( s ) ] . ( 1 ) We will refer to such methods as mutual information skill learning ( MISL ) , noting that our analysis might be extended to other mutual information objectives ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Achiam et al. , 2018 ; Sharma et al. , 2019 ) . Because these methods have two learnable components , θ and p ( zinput ) , analyzing them directly can be challenging . Instead , we will use a simplified abstract model of skill learning where both the policy parameters θ and the latent variable zinput are part of a single representation , z = ( θ , zθ ) . Then , we can define a skill learning algorithm as learning a single distribution p ( z ) : max p ( z ) I ( s ; z ) , Ep ( z ) Eρ ( s|z ) [ log ρ ( s | z ) − log ρ ( s ) ] . ( 2 ) We can recover Eq . 1 by choosing a distribution ( z ) that factors as p ( z = ( θ , zinput ) = δ ( θ ) p ( zinput ) . Whereas skills learning algorithms are often viewed as optimizing individual skills , this simplified abstract model lets us think about these algorithms as assigning different probabilities to different policies a probability of zero to almost every skill . We will refer to the small number of policies that are given non-zero probability as the “ skills. ” We will show that , in general , the learned skills fail to cover all possible optimal policies . However , we show that the distribution over skills that maximizes mutual information , when converted into a distribution over states , provides the best state distribution for optimizing an adversarially-chosen reward function using an idealized optimizer . In general , this idealized optimizer is infeasible to implement , suggesting that existing skill learning methods do not provide the best initialization for practical optimization methods . | This paper is trying to analyze whether unsupervised skill discovery is useful for more easily solving any possible downstream tasks in an MDP. It does so by adapting the idea of the value function polytope to a state visitation distribution polytope. It also specifies possible reward functions in this geometric setting and analyzes the connection between points on this polytope and returns with respect to the reward function. Next, it casts the mutual information based skill discovery problem in this geometric space and tries to analyze the skills learned. From their analysis, the paper suggests ways to infer how many skills can be learned, and whether those skills are optimal with respect to some downstream tasks. It seems that these skills can be guaranteed to be the vertex of the above polytope, but not to be optimal with respect to all downstream reward functions. They then suggest that the skills learned might be useful for an adaptation procedure that ignores the dynamics of the environment. | SP:cd0d3d64c3bfae598cd59fc7597531d30251dd54 |
The Information Geometry of Unsupervised Reinforcement Learning | 1 INTRODUCTION . The high sample complexity of reinforcement learning ( RL ) algorithms has prompted a large body of prior work to study pretraining of RL agents . During the pretraining stage , the agent collects unsupervised experience from the environment that is not labeled with any rewards . Prior methods have used this pretraining stage to learn representations of the environment that might assist the learning of downstream tasks . For example , some methods learn representations of the observations ( Laskin et al. , 2020 ; Schwarzer et al. , 2021 ) or representations of the dynamics model ( Ebert et al. , 2018 ; Ha & Schmidhuber , 2018 ; Sekar et al. , 2020 ) . In this work , we focus on methods that learn a set of potentially-useful policies , often known as skills ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Gregor et al. , 2016 ; Achiam et al. , 2018 ; Eysenbach et al. , 2018 ) . That is , the learned representation corresponds to a reparametrization of policies . The aim of this unsupervised pretraining is to learn skills that , when a reward function is given , can quickly be combined or composed to maximize this reward . Prior work has demonstrated that this general approach does accelerate learning downstream RL ( Gregor et al. , 2016 ; Eysenbach et al. , 2018 ; Achiam et al. , 2018 ) . However , prior work offers little analysis about when and where such methods are provably effective . Even simple questions , such as what it means for a set of skills to be optimal , remain unanswered . Algorithms for unsupervised skill learning are conceptually related to the representation learning methods used to improve supervised learning ( Gutmann & Hyvärinen , 2010 ; Belghazi et al. , 2018 ; Wu et al. , 2018 ; Oord et al. , 2018 ; Hjelm et al. , 2018 ; He et al. , 2020 ) . Both typically maximize a lower bound on mutual information , and the learned representations are often combined linearly to solve downstream tasks ( Hjelm et al. , 2018 ; Oord et al. , 2018 ) . However , whereas prior work in supervised learning has provided thorough analysis of when and where these representation learning methods produce useful features ( Kraskov et al. , 2004 ; Song & Ermon , 2019 ; McAllester & Stratos , 2020 ) , there has been comparatively little analysis into when unsupervised skill learning methods produce skills that are useful for solving downstream RL tasks . In this paper , we analyze when and where existing skill learning methods based on mutual information maximization are ( or are not ) optimal for preparing to solve unknown , downstream tasks . On the one hand , we show that the skills learned by these methods are not complete , in that they can not be used to represent the solution to every RL problem . This result implies that using the learned skills for hierarchical RL may result in suboptimal performance , and suggests new opportunities for better skill learning algorithms . One the other hand , we show that existing methods acquire a policy initialization that is optimal for learning downstream tasks , if that adaptation is performed using an idealized adaptation procedure . To the best of our knowledge , this is the first result showing that unsupervised skill learning methods are optimal in any sense . Our analysis also illuminates a number of properties of these methods . For example , we show that every skill is optimal for some reward function , and we provide a nontrivial upper bound on the number of unique skills learned . This result implies that these methods can not learn an infinite number of unique skills , and instead will learn duplicate copies of some skills . The key to our analysis is to view RL algorithms and skill learning algorithms as geometric operations ( see Fig . 1 ) . Points correspond to distributions over states , and the set of all possible distributions is a convex polytope that lies on a probability simplex . We show that all reward-maximizing policies lie at vertices of this polytope and that maximizing mutual information corresponds to solving a facility assignment problem on the simplex . The main contribution of this paper is a proof that skill learning algorithms based on mutual information are optimal for minimizing regret against unknown reward functions , assuming that adaptation is performed using a certain procedure . Our proof of optimality relies on certain problem assumptions , leaving the door open for future skill learning algorithms to perform better under different problem assumptions . This contribution provides a rigorous notion of what it means for an unsupervised RL algorithm to be optimal , and also answers additional questions about unsupervised skill learning algorithms , such as whether the skills correspond to reward-maximizing policies and how many unique skills will be learned . 2 PRIOR WORK . In the unsupervised RL setting , an agent interacts with the environment without access to a reward function , with the aim of learning some representation of the environment that will assist in learning downstream tasks . Prior work has proposed many approaches for this problem , including learning a dynamics model ( Ebert et al. , 2018 ; Ha & Schmidhuber , 2018 ; Sekar et al. , 2020 ) , learning compact representations of observations ( Laskin et al. , 2020 ; Schwarzer et al. , 2021 ) , performing goal-conditioned RL without hand-specified rewards ( Chebotar et al. , 2021 ; Schwarzer et al. , 2021 ) , doing pure exploration ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Pathak et al. , 2017 ; Lee et al. , 2019b ; Hazan et al. , 2019 ; Seo et al. , 2021 ) or learning collections of skills ( Gregor et al. , 2016 ; Eysenbach et al. , 2018 ; Achiam et al. , 2018 ; Warde-Farley et al. , 2018 ; Sharma et al. , 2019 ; Hansen et al. , 2020 ; Campos et al. , 2020 ) . These prior methods are similar in that they all learn representations , with different methods learning representation of observations , dynamics , or policies . While each approach works well in some setting ( see Laskin et al . ( 2021 ) for a recent benchmark ) , the precise connection between these pretraining methods and success on downstream tasks remains unclear . We will focus on unsupervised skill learning methods . The problem of unsupervised pretraining for RL has also been studied in the RL theory community ( Agarwal et al. , 2020 ; Misra et al. , 2020 ; Modi et al. , 2021 ) , where it is referred to as the reward-free setting . The algorithms proposed in these prior works use a version of goal-conditioned RL for pretraining . However , the aim of these methods is different from ours : these methods aim to collect a sufficient breadth of data , whereas we focus on learning good representations . Our paper is similar to prior work that uses a geometric perspective to analyze RL algorithms ( Dadashi et al. , 2019 ; Bellemare et al. , 2019 ) . For example , Dadashi et al . ( 2019 ) visualize the value function as a point in a high-dimensional space , where each coordinate indicates the value of one state . In contrast , our analysis will visualize policies as points , where each coordinate indicates the probability of visiting that state . This difference allows us to analyze the unsupervised RL setting , where we can not define a value function because the reward function is unknown . Our analysis uses ideas from the field of information geometry ( Amari & Nagaoka , 2000 ) . Prior work has parametrized the RL problem in terms of the state distribution ( Puterman , 1990 , Eq . 6.9.2 ) , and proposed RL algorithms that solve for the optimal state distribution ( Ng et al. , 1999 ; Wang et al. , 2007 ; Nachum & Dai , 2020 ) . Our analysis uses a similar procedure for adapting to new reward functions after the unsupervised learning stage . 3 PRELIMINARIES . We focus on infinite-horizon MDPs with discrete states S and actions A , initial state distribution p0 ( s0 ) , dynamics p ( st+1 | st , at ) , and discount factor γ ∈ ( 0 , 1 ) . We assume a Markovian policy π ( a | s ) , and define the discounted state occupancy measure of this policy as ρπ ( s ) = ( 1− γ ) ∑∞ t=0 γ tPπt ( s ) , where P π t ( s ) is the probability that policy π visits state s at time t. We define C to be the set of state marginal distributions that are feasible under the environment dynamics . The RL objective can be expressed using the reward function r ( s ) and the state marginal distribution : ( 1− γ ) Eπ [ ∞∑ t=0 γtr ( st ) ] = Eρπ ( s ) [ r ( s ) ] . The factor of 1− γ accounts for the fact that the sum of discount factors 1 + γ + γ2 + · · · = 11−γ . Without loss of generality , we focus on state-dependent reward functions ; action-dependent reward functions can be handled by modifying the state to include the previous action . While our analysis will ignore function approximation error , it applies to any MDP , including MDPs where observations correspond to features ( e.g. , activations of a frozen neural network ) rather than original states . 3.1 UNSUPERVISED SKILL LEARNING ALGORITHMS . Prior skill learning algorithms learn a policy πθ ( a | s , zinput ) with parameters θ and conditioned on an additional input zinput ∼ p ( zinput ) . Let ρπθ ( s | zinput ) denote the state marginal distribution of policy πθ ( a | s , zinput ) . We will focus on methods ( Eysenbach et al. , 2018 ; Florensa et al. , 2017 ) that maximize the mutual information between the representation zinput and the states s visited by policy πθ ( a | s , zinput ) : max θ , p ( zinput ) I ( s ; zinput ) , Ep ( zinput ) Eρπθ ( s|zinput ) [ log ρ πθ ( s | zinput ) − log ρπθ ( s ) ] . ( 1 ) We will refer to such methods as mutual information skill learning ( MISL ) , noting that our analysis might be extended to other mutual information objectives ( Salge et al. , 2014 ; Mohamed & Rezende , 2015 ; Achiam et al. , 2018 ; Sharma et al. , 2019 ) . Because these methods have two learnable components , θ and p ( zinput ) , analyzing them directly can be challenging . Instead , we will use a simplified abstract model of skill learning where both the policy parameters θ and the latent variable zinput are part of a single representation , z = ( θ , zθ ) . Then , we can define a skill learning algorithm as learning a single distribution p ( z ) : max p ( z ) I ( s ; z ) , Ep ( z ) Eρ ( s|z ) [ log ρ ( s | z ) − log ρ ( s ) ] . ( 2 ) We can recover Eq . 1 by choosing a distribution ( z ) that factors as p ( z = ( θ , zinput ) = δ ( θ ) p ( zinput ) . Whereas skills learning algorithms are often viewed as optimizing individual skills , this simplified abstract model lets us think about these algorithms as assigning different probabilities to different policies a probability of zero to almost every skill . We will refer to the small number of policies that are given non-zero probability as the “ skills. ” We will show that , in general , the learned skills fail to cover all possible optimal policies . However , we show that the distribution over skills that maximizes mutual information , when converted into a distribution over states , provides the best state distribution for optimizing an adversarially-chosen reward function using an idealized optimizer . In general , this idealized optimizer is infeasible to implement , suggesting that existing skill learning methods do not provide the best initialization for practical optimization methods . | The paper treats the problem of unsupervised RL, which it defines as the problem of pretraining a system, without having access to a reward function, to learn a collection of policies, that are labeled skills. The idea is that when the reward function is presented, the target policy can be assembled as a combination or composition of these skills. Such policies had been previously proposed to be learned using mutual information maximization approaches. The primary contribution of this paper that it analyzes the space of policies/skills that are learnable using mutual information based approaches. The authors present this analysis through a geometric lens on the probability simplex of the possible states of the system. A given policy or skill can be associated to a point in this space by associating with a skill or policy its discounted state probability distribution. Using these analytical tools, the authors prove several interesting results. For instance, they show that by maximizing mutual information alone, one cannot learn sufficient skills to cover all the set of optimal policies - the number of unique skills learned through this approach is bounded by the dimensionality of the state space. | SP:cd0d3d64c3bfae598cd59fc7597531d30251dd54 |
Neural Relational Inference with Node-Specific Information | 1 INTRODUCTION . Our world includes many different types of systems that involve multiple entities interacting with each other , from biology to sports , from social media to driving situations . Modelling the behaviour of such dynamical systems is a challenging task , which requires uncovering different types of interactions among the entities and how they affect each other . Recent approaches in machine learning learn the interactions among the entities through graph-based models and attention-based models , in which the representation of an entity is updated through its relationship with other entities . Such relationships are usually either predefined or uncovered by learning . Kipf et al . ( 2018 ) proposed neural relational inference ( NRI ) for relationship uncovering in the framework of variational inference ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . NRI has an encoder-decoder structure in which the latent codes represent different types of interactions among the entities . The distributions over the latent variables are inferred based on the input features of the entities and a graph structure is formed by sampling from these distributions . The decoder of the model is a GNN-based algorithm that runs over the uncovered graph to update the features of entities . The model shows prominent performance over many synthetic and real-world datasets . Uncovering the interaction among entities in NRI and other models in the GNN literature is studied in problems where the features of the entities are completely observable and the GNN-based algorithm is also run on the observable features . However , in many real-world problems there is a set of hidden features that affect the way entities interact with each other . For example consider the problem of predicting the future position of vehicles in a driving scenario . In order to uncover the relation of a target vehicle with other vehicles not only should we consider the features extracted from the observations from vehicles , e.g . their trajectories up to the current time , but also we should take into account the intention of the target vehicle . In fact , intention , which can be an immediate action or a longer term goal , forms a set of features that is only accessible by the target vehicle and other vehicle can not know it . In this paper we call such feature the individualized features or Node-Specific Information ( NSI ) in a graph representation of the system . Formally , NSI is a set of features that is ∗Work was done prior to joining Amazon . only accessible by one node in a graph structure but affects the interactions of that node with other nodes . Our goal is to efficiently exploit NSI to build more accurate graph structures and consequently achieve better performance in the downstream tasks . Towards this goal , the first step is to find a proper representation for NSI in our graph structure . We propose introducing a new set of nodes in the graph that carry NSI and call them private nodes . Observable features of the entities are then denoted by public nodes . Therefore each entity can be represented by a public and private node . We introduce our model in the framework of NRI , i.e . a variational inference model that uncovers different types of interaction among the entities . We carefully design the encoder and decoder part of our model to ensure that NSI remains an individual feature for one entity and does not affect the interaction modelling of the other entities . At the same time , through experiment we show that such modelling of NSI is very efficient and can result in significant improvement on the performance on downstream tasks . The main contributions of this work are the followings : • To the best of our knowledge the problem of having individualized features for each entity has not been previously studied in the framework of relational inference . We tackle this problem by introducing a new set of nodes in a graph structure that represents the individualized information . These nodes are used during the process of relational inference as well as performing the downstream task , i.e . trajectory prediction in our case . • We show that our proposed model can exploit NSI efficiently by introducing minimum additional computational complexity compared to the original NRI model and its variants . • The results of our experiments on real-world datasets show that our model can outperform the baselines and achieve the state-of-the-art results on the defined tasks . 2 RELATED WORK . Interaction modelling : Relational learning is a popular approach for the problems with dependency structure among the data points . Such dependency can be predefined in some domains . But in many domains it has to be learned . For example approaches like locally linear embedding ( LLE ) ( Roweis & Saul , 2000 ) and Isomap ( Tenenbaum et al. , 2000 ) use kNN for forming such relationships based on different measures of similarities among the data points . More recently , neural networks have become the dominant tools for learning these dependencies based on different architectures and paradigms ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Garcia Duran & Niepert , 2017 ; Monti et al. , 2017 ; Veličković et al. , 2017 ; Franceschi et al. , 2019 ) . The most relevant works to our proposed model are NRI ( Kipf et al. , 2018 ) and dynamic NRI ( dNRI ) ( Graber & Schwing , 2020 ) , which are discussed in more details in the next section . Recently , Li et al . ( 2020 ) introduced similar ideas for multi-modal trajectories prediction . Extensions of NRI in other directions than ours also appeared in the literature . For example , Li et al . ( 2019 ) tries to uncover interactions by imposing some structural constraints on the prior and Webb et al . ( 2019 ) introduces the idea of factorized graph for NRI . The other common approach for uncovering relationships among the entities is based on the idea of attention . This idea has been used in Narasimhan et al . ( 2018 ) ; Hoshen ( 2017 ) ; Van Steenkiste et al . ( 2017 ) ; Garcia & Bruna ( 2017 ) ; Monti et al . ( 2017 ) ; Veličković et al . ( 2017 ) , where the attention mechanism is the main tool for interaction uncovering , however , it is also used as a building block for GNNs . Future trajectory prediction as evaluation metric : We define our problem as uncovering the interactions of entities in a multi-agent dynamical system , where the evaluation is based on the accuracy of future trajectory prediction . Trajectory prediction is in fact an important problem in many multi-agent systems , including the ever growing area of autonomous driving . In fact , our approach falls into the category of multivariate time-series prediction ( Yu et al. , 2018 ; Wu et al. , 2019 ; Sen et al. , 2019 ; Salinas et al. , 2020 ; Rangapuram et al. , 2018 ; Li et al. , 2018 ; Bai et al. , 2018 ) , in which the prediction is based on the relationship among the series . Specifically we use the relationship of the entities in the GNNs framework . GNN has been widely used in the trajectory prediction , especially in the application of autonomous driving and significantly improved the performance in this area . For example , Salzmann et al . ( 2020 ) uses GNN to capture the relationship among different road users ( vehicles and pedestrian ) , Gao et al . ( 2020 ) uses graph attention networks ( GATs ) to learn the relationship among agents and different components of map data , and Liang et al . ( 2020 ) uses graph convolutional networks ( GCNs ) to learn the interaction among lanes and vehicles . In our experiment we consider scenarios in which the goal ( final ) position of the entities is given as the individualized information . In the context of goal-aware prediction , there have been some effort in the area of autonomous driving that are not based on explicit relational learning ( Rhinehart et al. , 2019 ; 2018 ) . In these papers , the prediction is based on an autoregressive flow-based model that considers a collective observation of all entities to make prediction for each of them . The goal is then added at the inference time and the latent codes are optimized in a way that the target entity reaches its goal . 3 BACKGROUND : NEURAL RELATIONAL INFERENCE ( NRI ) . NRI is an unsupervised model that learns to infer the interaction types among entities in a multi-agent systems in order to model the dynamics of the system . The model is defined as the problem of predicting the future trajectory of entities given the past trajectories . Formally , the trajectories of N entities are given for T time steps . Entity i is denoted by xi = ( x1i , x 2 i , ... , x T i ) . The set of all trajectories at time t is denoted by xt = { xt1 , xt2 , ... , xtN } and x = ( x1 , x2 , ... , xT ) denotes the whole trajectories for all agents . NRI tries to model the system by maximizing the log-likelihood of the observations , log p ( x ) , in the framework of variational inference , i.e . maximizes the evidence lower-bound ( ELBO ) : L ( θ , φ ) = Eqφ ( z|x ) [ log pθ ( x|z ) ] − KL [ qφ ( z|x ) ||p ( z ) ] , ( 1 ) where latent variable z has a categorical distribution and represents the interaction among entities . More specifically , zij is a K-dimensional vector that denotes the type of interaction between entities xi and xj . The entities in the NRI model are represented using nodes of a graph1 and therefore the interactions are directed edges on this graph . Parameters of p ( . ) and q ( . ) models are denoted by θ and φ , respectively . The three probability distributions in Eq . 1 are : • The variational posterior , qφ ( z|x ) , is implemented using amortized inference parameterized by a neural network , namely the encoder network . Given the input trajectories , the encoder network predicts the type of edges on the graph . The latent variable z is assumed to have a categorical distribution . Samples from this distribution form the edges of the graph . In order to backpropagate the error signals to the encoder layers , we need to make the sampling process differentiable . In NRI this is done by approximating the posterior distribution and reparamterezation of Gumbel distribution ( Jang et al. , 2017 ; Maddison et al. , 2017 ) : zij = softmax ( ( h2 ( i , j ) + g ) /τ ) ( 2 ) where h2 ( i , j ) is the last output of the encoder before the softmax layer and g ∈ R K shows i.i.d . samples drawn from Gumbel ( 0 , 1 ) and τ is a hyperparameter that controls the smoothness of the distribution . • The prior , p ( z ) = ∏ i 6=j p ( zij ) , is assumed to be a factorized uniform categorical distribu- tion over the edges . • The likelihood , pθ ( x|z ) , is implemented by the decoder network and predicts the future trajectories given the uncovered structure of the graph . The prediction in NRI is done in an autoregressive fashion . However , the ground truth trajectory is fed to the model for few steps during the training to improve the performance of the decoder ( teacher forcing ) . NRI in its original form has two main shortcomings : 1 . The latent variable z , which defines the edge types , is fixed for the whole prediction horizon . That is , the uncovered interactions among the agents are assumed to be fixed over the next time steps . This is not necessarily a valid assumption as the agents can dynamically change their interactions in the system . 1Throughout the paper , entities and nodes as well as interactions and edges are used interchangeably , based on the context . 2 . The prior distribution is assumed to be uniform and not conditioned on the previous observations . Both of these assumptions can degrade the performance of the model in longer prediction horizons since samples from the prior provides minimum information about the input . More recently , Graber & Schwing ( 2020 ) pointed out the above issues and addressed them in dynamic neural relation inference ( dNRI ) model . The conditional prior distribution in dNRI is defined as : p ( z|x ) : = T∏ t=1 p ( zt|x1 : t , z1 : t−1 ) , ( 3 ) which is implemented by another set of MLP and LSTM layers that form the encoder of the pθ ( . ) model . The experiments show that , by resolving those issues , dNRI achieves better prediction performance than NRI . | The paper introduces the concept of node-specific information (NSI) to model that nodes in a graph may have private information that other nodes cannot have access to. The paper uses Neural Relation Inference (NRI), a framework published in 2018 based on variational inference, to uncover the hidden relations of nodes in the graph. For instance, in a driving scenario, different cars can be nodes in a graph with their publicly visible trajectory and their private information about the intention (e.g. desired destination), which is not shared with other nodes. The encoder and decoder in NRI are modified such that NSI stays private and is not shared with other nodes. The paper considers problems that require uncovering the interactions of entities in a multi-agent dynamical system. The evaluation is based on the accuracy of future trajectory prediction. The paper demonstrates the effectiveness of the idea on three different datasets, one action-conditional dataset and two goal-conditional datasets. | SP:7f6ac27e9ec6db3f4860406263b59f88c2cfeacc |
Neural Relational Inference with Node-Specific Information | 1 INTRODUCTION . Our world includes many different types of systems that involve multiple entities interacting with each other , from biology to sports , from social media to driving situations . Modelling the behaviour of such dynamical systems is a challenging task , which requires uncovering different types of interactions among the entities and how they affect each other . Recent approaches in machine learning learn the interactions among the entities through graph-based models and attention-based models , in which the representation of an entity is updated through its relationship with other entities . Such relationships are usually either predefined or uncovered by learning . Kipf et al . ( 2018 ) proposed neural relational inference ( NRI ) for relationship uncovering in the framework of variational inference ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . NRI has an encoder-decoder structure in which the latent codes represent different types of interactions among the entities . The distributions over the latent variables are inferred based on the input features of the entities and a graph structure is formed by sampling from these distributions . The decoder of the model is a GNN-based algorithm that runs over the uncovered graph to update the features of entities . The model shows prominent performance over many synthetic and real-world datasets . Uncovering the interaction among entities in NRI and other models in the GNN literature is studied in problems where the features of the entities are completely observable and the GNN-based algorithm is also run on the observable features . However , in many real-world problems there is a set of hidden features that affect the way entities interact with each other . For example consider the problem of predicting the future position of vehicles in a driving scenario . In order to uncover the relation of a target vehicle with other vehicles not only should we consider the features extracted from the observations from vehicles , e.g . their trajectories up to the current time , but also we should take into account the intention of the target vehicle . In fact , intention , which can be an immediate action or a longer term goal , forms a set of features that is only accessible by the target vehicle and other vehicle can not know it . In this paper we call such feature the individualized features or Node-Specific Information ( NSI ) in a graph representation of the system . Formally , NSI is a set of features that is ∗Work was done prior to joining Amazon . only accessible by one node in a graph structure but affects the interactions of that node with other nodes . Our goal is to efficiently exploit NSI to build more accurate graph structures and consequently achieve better performance in the downstream tasks . Towards this goal , the first step is to find a proper representation for NSI in our graph structure . We propose introducing a new set of nodes in the graph that carry NSI and call them private nodes . Observable features of the entities are then denoted by public nodes . Therefore each entity can be represented by a public and private node . We introduce our model in the framework of NRI , i.e . a variational inference model that uncovers different types of interaction among the entities . We carefully design the encoder and decoder part of our model to ensure that NSI remains an individual feature for one entity and does not affect the interaction modelling of the other entities . At the same time , through experiment we show that such modelling of NSI is very efficient and can result in significant improvement on the performance on downstream tasks . The main contributions of this work are the followings : • To the best of our knowledge the problem of having individualized features for each entity has not been previously studied in the framework of relational inference . We tackle this problem by introducing a new set of nodes in a graph structure that represents the individualized information . These nodes are used during the process of relational inference as well as performing the downstream task , i.e . trajectory prediction in our case . • We show that our proposed model can exploit NSI efficiently by introducing minimum additional computational complexity compared to the original NRI model and its variants . • The results of our experiments on real-world datasets show that our model can outperform the baselines and achieve the state-of-the-art results on the defined tasks . 2 RELATED WORK . Interaction modelling : Relational learning is a popular approach for the problems with dependency structure among the data points . Such dependency can be predefined in some domains . But in many domains it has to be learned . For example approaches like locally linear embedding ( LLE ) ( Roweis & Saul , 2000 ) and Isomap ( Tenenbaum et al. , 2000 ) use kNN for forming such relationships based on different measures of similarities among the data points . More recently , neural networks have become the dominant tools for learning these dependencies based on different architectures and paradigms ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Garcia Duran & Niepert , 2017 ; Monti et al. , 2017 ; Veličković et al. , 2017 ; Franceschi et al. , 2019 ) . The most relevant works to our proposed model are NRI ( Kipf et al. , 2018 ) and dynamic NRI ( dNRI ) ( Graber & Schwing , 2020 ) , which are discussed in more details in the next section . Recently , Li et al . ( 2020 ) introduced similar ideas for multi-modal trajectories prediction . Extensions of NRI in other directions than ours also appeared in the literature . For example , Li et al . ( 2019 ) tries to uncover interactions by imposing some structural constraints on the prior and Webb et al . ( 2019 ) introduces the idea of factorized graph for NRI . The other common approach for uncovering relationships among the entities is based on the idea of attention . This idea has been used in Narasimhan et al . ( 2018 ) ; Hoshen ( 2017 ) ; Van Steenkiste et al . ( 2017 ) ; Garcia & Bruna ( 2017 ) ; Monti et al . ( 2017 ) ; Veličković et al . ( 2017 ) , where the attention mechanism is the main tool for interaction uncovering , however , it is also used as a building block for GNNs . Future trajectory prediction as evaluation metric : We define our problem as uncovering the interactions of entities in a multi-agent dynamical system , where the evaluation is based on the accuracy of future trajectory prediction . Trajectory prediction is in fact an important problem in many multi-agent systems , including the ever growing area of autonomous driving . In fact , our approach falls into the category of multivariate time-series prediction ( Yu et al. , 2018 ; Wu et al. , 2019 ; Sen et al. , 2019 ; Salinas et al. , 2020 ; Rangapuram et al. , 2018 ; Li et al. , 2018 ; Bai et al. , 2018 ) , in which the prediction is based on the relationship among the series . Specifically we use the relationship of the entities in the GNNs framework . GNN has been widely used in the trajectory prediction , especially in the application of autonomous driving and significantly improved the performance in this area . For example , Salzmann et al . ( 2020 ) uses GNN to capture the relationship among different road users ( vehicles and pedestrian ) , Gao et al . ( 2020 ) uses graph attention networks ( GATs ) to learn the relationship among agents and different components of map data , and Liang et al . ( 2020 ) uses graph convolutional networks ( GCNs ) to learn the interaction among lanes and vehicles . In our experiment we consider scenarios in which the goal ( final ) position of the entities is given as the individualized information . In the context of goal-aware prediction , there have been some effort in the area of autonomous driving that are not based on explicit relational learning ( Rhinehart et al. , 2019 ; 2018 ) . In these papers , the prediction is based on an autoregressive flow-based model that considers a collective observation of all entities to make prediction for each of them . The goal is then added at the inference time and the latent codes are optimized in a way that the target entity reaches its goal . 3 BACKGROUND : NEURAL RELATIONAL INFERENCE ( NRI ) . NRI is an unsupervised model that learns to infer the interaction types among entities in a multi-agent systems in order to model the dynamics of the system . The model is defined as the problem of predicting the future trajectory of entities given the past trajectories . Formally , the trajectories of N entities are given for T time steps . Entity i is denoted by xi = ( x1i , x 2 i , ... , x T i ) . The set of all trajectories at time t is denoted by xt = { xt1 , xt2 , ... , xtN } and x = ( x1 , x2 , ... , xT ) denotes the whole trajectories for all agents . NRI tries to model the system by maximizing the log-likelihood of the observations , log p ( x ) , in the framework of variational inference , i.e . maximizes the evidence lower-bound ( ELBO ) : L ( θ , φ ) = Eqφ ( z|x ) [ log pθ ( x|z ) ] − KL [ qφ ( z|x ) ||p ( z ) ] , ( 1 ) where latent variable z has a categorical distribution and represents the interaction among entities . More specifically , zij is a K-dimensional vector that denotes the type of interaction between entities xi and xj . The entities in the NRI model are represented using nodes of a graph1 and therefore the interactions are directed edges on this graph . Parameters of p ( . ) and q ( . ) models are denoted by θ and φ , respectively . The three probability distributions in Eq . 1 are : • The variational posterior , qφ ( z|x ) , is implemented using amortized inference parameterized by a neural network , namely the encoder network . Given the input trajectories , the encoder network predicts the type of edges on the graph . The latent variable z is assumed to have a categorical distribution . Samples from this distribution form the edges of the graph . In order to backpropagate the error signals to the encoder layers , we need to make the sampling process differentiable . In NRI this is done by approximating the posterior distribution and reparamterezation of Gumbel distribution ( Jang et al. , 2017 ; Maddison et al. , 2017 ) : zij = softmax ( ( h2 ( i , j ) + g ) /τ ) ( 2 ) where h2 ( i , j ) is the last output of the encoder before the softmax layer and g ∈ R K shows i.i.d . samples drawn from Gumbel ( 0 , 1 ) and τ is a hyperparameter that controls the smoothness of the distribution . • The prior , p ( z ) = ∏ i 6=j p ( zij ) , is assumed to be a factorized uniform categorical distribu- tion over the edges . • The likelihood , pθ ( x|z ) , is implemented by the decoder network and predicts the future trajectories given the uncovered structure of the graph . The prediction in NRI is done in an autoregressive fashion . However , the ground truth trajectory is fed to the model for few steps during the training to improve the performance of the decoder ( teacher forcing ) . NRI in its original form has two main shortcomings : 1 . The latent variable z , which defines the edge types , is fixed for the whole prediction horizon . That is , the uncovered interactions among the agents are assumed to be fixed over the next time steps . This is not necessarily a valid assumption as the agents can dynamically change their interactions in the system . 1Throughout the paper , entities and nodes as well as interactions and edges are used interchangeably , based on the context . 2 . The prior distribution is assumed to be uniform and not conditioned on the previous observations . Both of these assumptions can degrade the performance of the model in longer prediction horizons since samples from the prior provides minimum information about the input . More recently , Graber & Schwing ( 2020 ) pointed out the above issues and addressed them in dynamic neural relation inference ( dNRI ) model . The conditional prior distribution in dNRI is defined as : p ( z|x ) : = T∏ t=1 p ( zt|x1 : t , z1 : t−1 ) , ( 3 ) which is implemented by another set of MLP and LSTM layers that form the encoder of the pθ ( . ) model . The experiments show that , by resolving those issues , dNRI achieves better prediction performance than NRI . | **Summary**: This paper introduces a neural relational inference model that makes use of the hidden features of each node in a variational inference framework. Specifically, the hidden/individual information is modeled as private node in the graph. Importantly, the task assumption made by the authors is that these individualized features cannot be observed by other entities. **Contributions**: 1. The authors claim be to the first to study the use of individualized information for each entity in this direction. 2. The proposed approach achieve state-of-the-art results while only introducing minimum additional computational complexity. | SP:7f6ac27e9ec6db3f4860406263b59f88c2cfeacc |
SCformer: Segment Correlation Transformer for Long Sequence Time Series Forecasting | 1 INTRODUCTION . Time series forecasting has always been a classic machine learning problem . It is widely used in various fields that are closely related to our lives , e.g. , production planning , financial investment , traffic management , and electricity management . In many cases , we need to predict the future value of the time series for a long time , which involves long sequence time-series forecasting ( LSTF ) ( Zhou et al. , 2021 ) . Classical mathematical forecasting models ( Lütkepohl , 2005 ; Box et al. , 2015 ; Cao & Tay , 2003 ; Roberts et al. , 2013 ) rely on strong assumptions on the time series and can only handle simple linear relationships . For example , the ARIMA model ( Box et al. , 2015 ) requires the original time series to be stable at least after the differentiation operation . Gaussian Process ( Roberts et al. , 2013 ) utilizes all the features to make predictions and fails in high-dimensional data space . Due to the ability of modeling long-term and nonlinear relationships for large-scale and complicated sequential data , deep learning models have achieved better performance than these classical methods . Existing time series forecasting methods based on deep learning can be divided into three categories , i.e. , RNN-based models ( Lai et al. , 2018 ; Salinas et al. , 2020 ; Qin et al. , 2017 ; Song et al. , 2018 ) , TCN-based models ( Borovykh et al. , 2017 ; Sen et al. , 2019 ) and Transformer-based models ( Vaswani et al. , 2017 ; Wu et al. , 2020a ) . RNN-based methods suffer from the problem of gradient vanishing , gradient exploding , and lack of parallelism . TCN-based methods need deeper layers to achieve larger local receptive fields . For both categories of methods , signals must pass through a long path between two far-away temporal locations , hence the number of operations required to associate two elements increases with their temporal distance . Differently , transformer-based methods directly model the relationships between any element pairs and can better capture long-term dependencies , which is crucial for LSTF . On the other hand , the self-attention mechanism of Transformer calculates all similarities between any element pairs . The computational and space complexities increase quadratically with the length of the time series . Directly applying Transformer to LSTF is not only inefficient but also difficult to capture truly effective attention . Recent works ( Zhou et al. , 2021 ; Li et al. , 2019 ; Kitaev et al. , 2019 ) explore different sparse attention mechanisms to suppress the contribution of irrelevant time steps and ease the computational pressure to a certain extent . These models still perform dot-product attention to time steps individually and utilize the point-wise connections to capture temporal dependencies . However , for LSTF , there is a strong correlation between neighboring points . A single point may have limited influence on predicting the future . Autoformer ( Wu et al. , 2021 ) conducts the series-wise dependencies discovery by performing auto-correlation of the time series to the top-k time delayed series . All points in the whole delayed series must share the same weight for aggregating the prediction and complicated fast Fourier transforms are required for auto-correlation . These methods perform the correlation either at the point level or at the overall series level , which not only require high computational redundancy to intensively tackle point pairs or perform timefrequency domain transformations , but also do not directly reflect the true dependencies within the time series . For instance , in traffic flow prediction , to predict the flow of the future period , the flows of a single previous time point and the shifted whole time series may have limited contribution . There may be stronger correlations at the segment level , e.g. , the flow of the peak time period today should be more related to the flow of the peak time period yesterday than the flow of the off-peak time period any day and the flow of a period that has passed a long time ago . In this paper , we propose a novel sparse attention mechanism called segment correlation attention ( SCAttention ) . Different from Auto-Correlation in Autoformer , SCAttention segments the time series based on implicit period and regards every segment as one unit to compute the correlation between segments . We extend the point-wise dot product in conventional transformer-based attention mechanism to the segment-wise correlation , where segments do not need to be transformed into the frequency domain . Segment-wise correlation not only reduces the amount of calculation since the number of segments is much smaller than the number of points , but also can be combined with other sparse attention mechanisms . We derive our prediction model for LSTF , namely Segment Correlation Transformer ( SCformer ) , via simply replacing the canonical attention in the original Transformer model with SCAttention . A stable predictor should generate consistent predictions , i.e. , for any given historical time series , if the predicted future series is reversed as the input , the output of the predictor should be consistent with the reverse of the historical time series . Motivated by this idea , we design a dual task as a regularization to train our SCformer model in order to achieve more robust predictions . Different from AST ( Wu et al. , 2020b ) which introduces adversarial loss to alleviate the error accumulation with an additional discriminator , our dual task-based regularization term only needs to reverse the predicted time series as the input to SCformer without introducing additional network structures and parameters . The main contributions of this paper are summarized as follows : • We propose a segment correlation attention ( SCAttention ) mechanism to replace the canonical point-wise attention mechanism . In addition to increasing efficiency , SCAttention also extracts more relevant information from the sequence . Besides , it can be easily combined with other sparse attention mechanisms for further improvement . • We design a dual task as a regularization term in the training phase . The dual reverse prediction task restores the past by the future . By encouraging the forward and backward predictions to be consistent , the learned SCformer generates more stable predictions . Ablation studies demonstrate the effect of the dual task . • Extensive experiments show that our SCformer model achieves better forecasting performance than other Transformer-based prediction models . 2 RELATED WORK . Time Series Forecasting . Early works on the TSF problem are based on classical mathematical models such as vector autoregression ( VAR ) ( Lütkepohl , 2005 ) and auto regressive intergrated moving average ( ARIMA ) ( Box et al. , 2015 ) . Support vector regression ( SVR ) ( Cao & Tay , 2003 ) introduces a traditional machine learning method to regress the future . Gaussian Process ( Roberts et al. , 2013 ) predicts the distribution of future values without assuming any certain form of the prediction function . However , all these classical models can not handle complicated and unknown data distributions or high-dimensional data . With the development of deep learning , neural networks have shown stronger modeling ability than classical models . Recurrent Neural Network ( RNN ) ( Connor et al. , 1992 ) and Temporal Convolution Network ( TCN ) ( Oord et al. , 2016 ; Bai et al. , 2018 ) are two common types of deep models for modeling sequence data . LSTNet ( Lai et al. , 2018 ) combines convolutional layers and recurrent layers to capture both long-term and short-term dependencies . DeepAR ( Salinas et al. , 2020 ) predicts the parameters of future distributions in an auto-regressive fashion . There are also some works ( Qin et al. , 2017 ; Song et al. , 2018 ) that introduce additional attention mechanism to RNN to achieve better performance in forecasting . However , RNN-based models suffer from the gradient vanishing and gradient exploding problem . Popular variants of RNN such as LSTM ( Hochreiter & Schmidhuber , 1997 ) and GRU ( Chung et al. , 2014 ) can not solve this problem fundamentally . The lack of parallelizability is another main limitation of RNN-based models . Benefiting from the good parallelism of convolution operations , TCN-based models have also been used in time series tasks and achieved good results ( Borovykh et al. , 2017 ; Sen et al. , 2019 ) . Both RNN-based and TCNbased models do not explicitly model the dependencies between two far-away temporal locations , but the information exchange between them must go through a long path . Transfomer-based models . Transformer ( Vaswani et al. , 2017 ) was originally proposed as a sequence-to-sequence model in natural language processing ( NLP ) to deal with machine translation . Due to its powerful and flexible modeling capabilities , it has even been widely applied in processing non-sequential data such as images in computer vision ( CV ) tasks ( Dosovitskiy et al. , 2020 ; Carion et al. , 2020 ) . Because of its huge success in NLP and CV , efforts have been made to adopt Transformer to solve the TSF problem ( Li et al. , 2019 ; Zhou et al. , 2021 ; Wu et al. , 2021 ; 2020b ; a ) . Self-attention ( Vaswani et al. , 2017 ) plays an important role in Transformer for explicitly discovering the dependencies between any element pairs , but both the time and space complexities increase quadratically with the length of the sequence , which limits the application of Transformer in LSTF ( Zhou et al. , 2021 ) . Therefore , various spare self-attention mechanisms for improving the efficiency of Transformer have been proposed in recent years . Logfomer ( Li et al. , 2019 ) proposes LogSparse self-attention which selects elements in exponentially increasing intervals to break the memory bottleneck . Informer ( Zhou et al. , 2021 ) defines a sparsity measurement for queries and selects dominant queries based on this measurement to obtain ProbSparse self-attention . Reformer ( Kitaev et al. , 2019 ) reduces the time and memory complexity by locally sensitive hashing self-attention . Most works use point-wise dot product to compute attention score , and differ in the way of selecting point pairs . AutoFomer ( Wu et al. , 2021 ) develops an Auto-Correlation mechanism to replace selfattention , which utilizes series-wise correlation instead of point-wise dot product . In this work , we introduce a new segment correlation attention mechanism to explore the context information within neighboring points and capture the segment-wise correlation in the sequence . Our method differs from the Auto-Correlation mechanism ( Wu et al. , 2021 ) in the way of correlation computation and aggregation . Instead of the complicated Fast Fourier Transforms calculation in Auto-Correlation , we directly segment the time series based on implicit period and compute the correlation between segments . Besides , we aggregate the segments by inter-segmentation correlation . AST ( Wu et al. , 2020b ) regards the predictor as a generator and utilizes adversarial training as the regularization for the sequence-level forecasting of time series . The adversarial training requires another discrimination network to distinguish the predicted sequences and the ground-truth sequences . Differently , to make the forecasting process more stable , we design a dual task for regularization without introducing additional parameters . 3 METHOD . 3.1 PROBLEM DEFINITION . We follow the comprehensive problem definition and setting about multi-horizon forecasting provided in ( Lim et al. , 2021 ) . Typically , given the previous time series X1 : t0 = { x1 , x2 , . . . , xt0 } , where xt ∈ Rdx and dx is the dimensionality of the variable , we aim to predict the future values Yt0+1 : t0+τ = { yt0+1 , yt0+2 , . . . , yt0+τ } , where yt ∈ Rdy is the prediction at every time step t and dy is the dimension of the output variable . The prediction model f can be formulated as : Ŷt0+1 : t0+τ = f ( X1 : t0 ; Ω ) , ( 1 ) where Ŷt0+1 : t0+τ is the predicted time series and Ω is the learnable parameters of the model . For LSTF , the prediction range τ , i.e. , the future time duration to be predicted , is longer . The problem can be categorized into two types based on whether the dimension of the output variable dy is larger than one : univariate LSTF and multivariate LSTF . | This paper presents a Transformer-based model called SCformer to perform long sequence time series forecasting. The key idea is to replace the canonical self-attention with efficient segment correlation attention (SCAttention) mechanism to capture long short-term dependencies. Experiment results on several datasets showed the effectiveness of the proposed method. | SP:955ba7c70fa3640478b5ae1bb562025a1cb14a04 |
SCformer: Segment Correlation Transformer for Long Sequence Time Series Forecasting | 1 INTRODUCTION . Time series forecasting has always been a classic machine learning problem . It is widely used in various fields that are closely related to our lives , e.g. , production planning , financial investment , traffic management , and electricity management . In many cases , we need to predict the future value of the time series for a long time , which involves long sequence time-series forecasting ( LSTF ) ( Zhou et al. , 2021 ) . Classical mathematical forecasting models ( Lütkepohl , 2005 ; Box et al. , 2015 ; Cao & Tay , 2003 ; Roberts et al. , 2013 ) rely on strong assumptions on the time series and can only handle simple linear relationships . For example , the ARIMA model ( Box et al. , 2015 ) requires the original time series to be stable at least after the differentiation operation . Gaussian Process ( Roberts et al. , 2013 ) utilizes all the features to make predictions and fails in high-dimensional data space . Due to the ability of modeling long-term and nonlinear relationships for large-scale and complicated sequential data , deep learning models have achieved better performance than these classical methods . Existing time series forecasting methods based on deep learning can be divided into three categories , i.e. , RNN-based models ( Lai et al. , 2018 ; Salinas et al. , 2020 ; Qin et al. , 2017 ; Song et al. , 2018 ) , TCN-based models ( Borovykh et al. , 2017 ; Sen et al. , 2019 ) and Transformer-based models ( Vaswani et al. , 2017 ; Wu et al. , 2020a ) . RNN-based methods suffer from the problem of gradient vanishing , gradient exploding , and lack of parallelism . TCN-based methods need deeper layers to achieve larger local receptive fields . For both categories of methods , signals must pass through a long path between two far-away temporal locations , hence the number of operations required to associate two elements increases with their temporal distance . Differently , transformer-based methods directly model the relationships between any element pairs and can better capture long-term dependencies , which is crucial for LSTF . On the other hand , the self-attention mechanism of Transformer calculates all similarities between any element pairs . The computational and space complexities increase quadratically with the length of the time series . Directly applying Transformer to LSTF is not only inefficient but also difficult to capture truly effective attention . Recent works ( Zhou et al. , 2021 ; Li et al. , 2019 ; Kitaev et al. , 2019 ) explore different sparse attention mechanisms to suppress the contribution of irrelevant time steps and ease the computational pressure to a certain extent . These models still perform dot-product attention to time steps individually and utilize the point-wise connections to capture temporal dependencies . However , for LSTF , there is a strong correlation between neighboring points . A single point may have limited influence on predicting the future . Autoformer ( Wu et al. , 2021 ) conducts the series-wise dependencies discovery by performing auto-correlation of the time series to the top-k time delayed series . All points in the whole delayed series must share the same weight for aggregating the prediction and complicated fast Fourier transforms are required for auto-correlation . These methods perform the correlation either at the point level or at the overall series level , which not only require high computational redundancy to intensively tackle point pairs or perform timefrequency domain transformations , but also do not directly reflect the true dependencies within the time series . For instance , in traffic flow prediction , to predict the flow of the future period , the flows of a single previous time point and the shifted whole time series may have limited contribution . There may be stronger correlations at the segment level , e.g. , the flow of the peak time period today should be more related to the flow of the peak time period yesterday than the flow of the off-peak time period any day and the flow of a period that has passed a long time ago . In this paper , we propose a novel sparse attention mechanism called segment correlation attention ( SCAttention ) . Different from Auto-Correlation in Autoformer , SCAttention segments the time series based on implicit period and regards every segment as one unit to compute the correlation between segments . We extend the point-wise dot product in conventional transformer-based attention mechanism to the segment-wise correlation , where segments do not need to be transformed into the frequency domain . Segment-wise correlation not only reduces the amount of calculation since the number of segments is much smaller than the number of points , but also can be combined with other sparse attention mechanisms . We derive our prediction model for LSTF , namely Segment Correlation Transformer ( SCformer ) , via simply replacing the canonical attention in the original Transformer model with SCAttention . A stable predictor should generate consistent predictions , i.e. , for any given historical time series , if the predicted future series is reversed as the input , the output of the predictor should be consistent with the reverse of the historical time series . Motivated by this idea , we design a dual task as a regularization to train our SCformer model in order to achieve more robust predictions . Different from AST ( Wu et al. , 2020b ) which introduces adversarial loss to alleviate the error accumulation with an additional discriminator , our dual task-based regularization term only needs to reverse the predicted time series as the input to SCformer without introducing additional network structures and parameters . The main contributions of this paper are summarized as follows : • We propose a segment correlation attention ( SCAttention ) mechanism to replace the canonical point-wise attention mechanism . In addition to increasing efficiency , SCAttention also extracts more relevant information from the sequence . Besides , it can be easily combined with other sparse attention mechanisms for further improvement . • We design a dual task as a regularization term in the training phase . The dual reverse prediction task restores the past by the future . By encouraging the forward and backward predictions to be consistent , the learned SCformer generates more stable predictions . Ablation studies demonstrate the effect of the dual task . • Extensive experiments show that our SCformer model achieves better forecasting performance than other Transformer-based prediction models . 2 RELATED WORK . Time Series Forecasting . Early works on the TSF problem are based on classical mathematical models such as vector autoregression ( VAR ) ( Lütkepohl , 2005 ) and auto regressive intergrated moving average ( ARIMA ) ( Box et al. , 2015 ) . Support vector regression ( SVR ) ( Cao & Tay , 2003 ) introduces a traditional machine learning method to regress the future . Gaussian Process ( Roberts et al. , 2013 ) predicts the distribution of future values without assuming any certain form of the prediction function . However , all these classical models can not handle complicated and unknown data distributions or high-dimensional data . With the development of deep learning , neural networks have shown stronger modeling ability than classical models . Recurrent Neural Network ( RNN ) ( Connor et al. , 1992 ) and Temporal Convolution Network ( TCN ) ( Oord et al. , 2016 ; Bai et al. , 2018 ) are two common types of deep models for modeling sequence data . LSTNet ( Lai et al. , 2018 ) combines convolutional layers and recurrent layers to capture both long-term and short-term dependencies . DeepAR ( Salinas et al. , 2020 ) predicts the parameters of future distributions in an auto-regressive fashion . There are also some works ( Qin et al. , 2017 ; Song et al. , 2018 ) that introduce additional attention mechanism to RNN to achieve better performance in forecasting . However , RNN-based models suffer from the gradient vanishing and gradient exploding problem . Popular variants of RNN such as LSTM ( Hochreiter & Schmidhuber , 1997 ) and GRU ( Chung et al. , 2014 ) can not solve this problem fundamentally . The lack of parallelizability is another main limitation of RNN-based models . Benefiting from the good parallelism of convolution operations , TCN-based models have also been used in time series tasks and achieved good results ( Borovykh et al. , 2017 ; Sen et al. , 2019 ) . Both RNN-based and TCNbased models do not explicitly model the dependencies between two far-away temporal locations , but the information exchange between them must go through a long path . Transfomer-based models . Transformer ( Vaswani et al. , 2017 ) was originally proposed as a sequence-to-sequence model in natural language processing ( NLP ) to deal with machine translation . Due to its powerful and flexible modeling capabilities , it has even been widely applied in processing non-sequential data such as images in computer vision ( CV ) tasks ( Dosovitskiy et al. , 2020 ; Carion et al. , 2020 ) . Because of its huge success in NLP and CV , efforts have been made to adopt Transformer to solve the TSF problem ( Li et al. , 2019 ; Zhou et al. , 2021 ; Wu et al. , 2021 ; 2020b ; a ) . Self-attention ( Vaswani et al. , 2017 ) plays an important role in Transformer for explicitly discovering the dependencies between any element pairs , but both the time and space complexities increase quadratically with the length of the sequence , which limits the application of Transformer in LSTF ( Zhou et al. , 2021 ) . Therefore , various spare self-attention mechanisms for improving the efficiency of Transformer have been proposed in recent years . Logfomer ( Li et al. , 2019 ) proposes LogSparse self-attention which selects elements in exponentially increasing intervals to break the memory bottleneck . Informer ( Zhou et al. , 2021 ) defines a sparsity measurement for queries and selects dominant queries based on this measurement to obtain ProbSparse self-attention . Reformer ( Kitaev et al. , 2019 ) reduces the time and memory complexity by locally sensitive hashing self-attention . Most works use point-wise dot product to compute attention score , and differ in the way of selecting point pairs . AutoFomer ( Wu et al. , 2021 ) develops an Auto-Correlation mechanism to replace selfattention , which utilizes series-wise correlation instead of point-wise dot product . In this work , we introduce a new segment correlation attention mechanism to explore the context information within neighboring points and capture the segment-wise correlation in the sequence . Our method differs from the Auto-Correlation mechanism ( Wu et al. , 2021 ) in the way of correlation computation and aggregation . Instead of the complicated Fast Fourier Transforms calculation in Auto-Correlation , we directly segment the time series based on implicit period and compute the correlation between segments . Besides , we aggregate the segments by inter-segmentation correlation . AST ( Wu et al. , 2020b ) regards the predictor as a generator and utilizes adversarial training as the regularization for the sequence-level forecasting of time series . The adversarial training requires another discrimination network to distinguish the predicted sequences and the ground-truth sequences . Differently , to make the forecasting process more stable , we design a dual task for regularization without introducing additional parameters . 3 METHOD . 3.1 PROBLEM DEFINITION . We follow the comprehensive problem definition and setting about multi-horizon forecasting provided in ( Lim et al. , 2021 ) . Typically , given the previous time series X1 : t0 = { x1 , x2 , . . . , xt0 } , where xt ∈ Rdx and dx is the dimensionality of the variable , we aim to predict the future values Yt0+1 : t0+τ = { yt0+1 , yt0+2 , . . . , yt0+τ } , where yt ∈ Rdy is the prediction at every time step t and dy is the dimension of the output variable . The prediction model f can be formulated as : Ŷt0+1 : t0+τ = f ( X1 : t0 ; Ω ) , ( 1 ) where Ŷt0+1 : t0+τ is the predicted time series and Ω is the learnable parameters of the model . For LSTF , the prediction range τ , i.e. , the future time duration to be predicted , is longer . The problem can be categorized into two types based on whether the dimension of the output variable dy is larger than one : univariate LSTF and multivariate LSTF . | This paper introduces a SCFORMER, which replaces the canonical attention in the Transformer with the segment correlation attention. The motivation of using the segment correlation is to reduce the memory usage of the scale-dot product attention of the Transformer. To further improve the performance, the paper proposes a dual task, which use the current time series to predict the past time series. | SP:955ba7c70fa3640478b5ae1bb562025a1cb14a04 |
Pruning Compact ConvNets For Efficient Inference | 1 INTRODUCTION . Neural networks frequently suffer from the problem of over-parameterization , such that the model can be compressed by a large factor to drastically reduce memory footprint , computation as well as energy consumption while maintaining similar performance . This is especially pronounced for models for computer vision ( Simonyan & Zisserman , 2014 ) , speech recognition ( Pratap et al. , 2020 ) and large text understanding models such as BERT ( Devlin et al. , 2018 ) . The improvements obtained from intelligently reducing the number of model parameters has several benefits , such as reduction in datacenter power consumption , faster inference and reduced memory footprint on edge devices such as mobile phones which also enable decentralized techniques ex . federated learning ( Kairouz et al. , 2019 ) . There are several techniques to reduce model size while maintaining similar generalization performance , such as model quantization ( Polino et al. , 2018 ) , NAS ( Neural Architecture Search ) ( Elsken et al. , 2019 ) and model distillation through teacher-student networks ( Gou et al. , 2021 ) . For the scope of this paper , we consider pruning as a technique to remove trainable weights in the network , and save on computation costs for the FBNet family of models . The motivations for this are two-fold . Firstly , state-of-the-art models such as FBNet ( Wu et al. , 2019 ) already adopt the best practices in the area of efficient hardware-aware design of convolutional neural network based models , and are widely used across different vision tasks . This makes them suitable baselines to understand whether pruning can offer any performance gain over their already optimized behavior . While there has been limited work on pruning for efficient convolution network models they investigate older architectures such as EfficientNet and MobileNet ( Aflalo et al. , 2020 ) or integrate pruning into expensive techniques such as joint prune-and-architecture search ( Wang et al. , 2020 ) . For each of the constituent models of the FBNetV3 family ( FBNetV3A , FBNetV3B , ... , FBNetV3G ) we reduce the number of parameters using two pruning based approaches : ( 1 ) Global magnitudebased pruning : Starting with the pre-trained model , we prune all weights whose magnitude is below a threshold chosen in order to achieve a target number of FLOPs for the pruned model ; ( 2 ) Uniform magnitude-based pruning : Starting with the pre-trained model , we prune weights in each layer whose magnitude is below a level-specific threshold in order to yield a pruned model achieving a target number of FLOPs with the same sparsity in each layer . After either pruning method is applied , we fine-tune the pruned model for a certain number of epochs until convergence is reached . Within the scope of our study in this paper , we are mostly interested in the following research questions : • RQ1 : Pruning to improve computation vs. performance tradeoff . Can a model obtained by pruning a larger FBNetV3 model M1 ( optimized using NAS ) achieve higher generalization performance than a smaller FBNetV3 model M2 when the pruned model has the same number of FLOPs as M2 ? • RQ2 : Pruning as an efficient paradigm . When a larger FBNetV3 model M1 is available and computational resources are limited , is pruning a faster and less computationally expensive approach to obtain a model with higher accuracy at a desired computation level ( FLOPs ) than running a full-fledged architecture search ? Pruning to improve computation vs. performance tradeoff ( RQ1 ) . There have been recent research advances in the area of building hardware-aware efficient models ( Deng et al. , 2020 ) . These can provide good generalization performance while adhering to constraints on memory , inference latency and battery power , which are often dictated by the hardware environment where inference happens . Experiments described in existing work on efficient vision models such as ChamNet ( Dai et al. , 2019 ) , MobileNet ( Howard et al. , 2017 ) , EfficientNet ( Tan & Le , 2019 ) and FBNetV2 ( Wan et al. , 2020 ) have shown that it is possible to achieve even higher performances on standard image recognition tasks such as ImageNet ( Deng et al. , 2009 ) at a certain level of FLOPs . However the efficient design of these models does not solve the over-parameterization problem completely , and none of these approaches study how model pruning can be performed to obtain even better trade-offs between computation and model accuracy . This paper is the first of its kind to understand how we can improve on the state-of-the-art in this problem space . Pruning as an efficient paradigm ( RQ2 ) . In addition to achieving state-of-the-art performance with reduced FLOPs , we are also interested in understanding how such pruned models can be obtained inexpensively with limited resources that are generally available to a machine learning practitioner who has access to existing optimized models but limited computing resources . For example , the FBNetV3 models are freely available through Facebook ’ s Mobile Model Zoo1 , while EfficientNet models can be obtained at GitHub2 . While the techniques needed to obtain computation- and latencyfriendly models have been democratized through open-sourcing the source code as well as the models themselves , fully applying these techniques necessitates costly operations such as finding an optimal network topology through meta-learning approaches ( You et al. , 2020 ) and search algorithms such as Genetic Algorithms ( GAs ) ( Goldberg & Deb , 1991 ) . Given the high-degree of intractability of this problem , expensive computational resources are often needed in this case , easily exceeding the budget available to a university research laboratory or an angel-stage startup ( Zoph & Le , 2016 ) . When a starting model is already available , for example through open-sourcing , the best option would be to perform a cheap modification of the model to fit a certain target FLOPs/latency requirement . In this paper we have compared the NAS approaches for training FBNetV3 models with our pruning techniques on a computational complexity metric ( GPU-hours ) to effectively answer RQ2 . Benchmark results . In addition to experimental outcomes for answering RQ1 and RQ2 , we also benchmark pruned FBNetV3 models using available open-sourced quantized sparse kernels and conduct ablation studies to obtain additional insights into pruning performance . These results augment our main observations and demonstrate that with existing hardware support , it is possible to deploy pruned cutting-edge computer vision models with practical latency reductions and improve further beyond the performance vs. FLOPs trade-off . We conduct our experiments on ImageNet , which is an object-recognition task on a large training dataset of 1.2 million images . We show that computationally less intensive techniques such as uniform and global magnitude-based pruning of larger FBNetV3 models can yield higher test accuracies than small models while having the same number of FLOPs . Given a target computation budget for an efficient model , we show that it is more practically advantageous ( both in terms of performance and running time ) to simply prune the larger model than run a neural architecture search to find the target model from scratch . 1FBNetV3 models available here http : //https : //github.com/facebookresearch/ mobile_cv/model_zoo/models/model_info/fbnet_v2/model_info_fbnet_v3.json 2EfficientNet models available here https : //github.com/mingxingtan/efficientnet The technique we have employed for pruning ( unstructured sparsity ) is already tried and tested , however our novelty lies in studying whether efficient image recognition models such as FBNetV3 can be optimized further to improve on the FLOPs-accuracy curve , and the contributions are two fold : ( 1 ) FBNets are themselves state-of-the-art in efficient vision models and we achieve better accuracy-FLOPs tradeoff over these models and ( 2 ) from the standpoint of computational overhead , we significantly reduce the amount of GPU hours required to obtain such models . Pruning a publicly available NAS optimized model incurs ≈4x less GPU hours to achieve a target FLOPs level , compared to training a full-fledged NAS to obtain a model which has less accuracy at the same FLOPs level . Paper organization . The remainder of this paper is organized as follows . In Section 2 , we describe related work in the area of efficient vision model design and also provide an introduction to different pruning techniques . In Section 3 , we discuss our experimental setup , including a description of the baseline models and the global and uniform pruning approaches we have employed . Section 4 describes our main findings and we conclude the paper in Section 5 . 2 RELATED WORK . We discuss related literature in the areas of computationally efficient vision models and model pruning . Within the scope of our work , we mainly focus on inference efficiency of models in contrast to training efficiency . Computationally efficient vision models : Neural networks for computer vision are generally characterized by convolutional layers and fully-connected layers , along with blocks such as residual or skip connections . This makes such networks resource intensive in terms of FLOPs , which affects the memory storage and power consumed , and also leads to increased latency . It is of paramount importance to design more efficient networks which can provide higher performance for the same FLOPs or latency level , or even to optimize them appropriately to provide the same performance at reduced FLOPs/latency . This can be performed either through the design of new simplified layers , for example in deep residual learning ( He et al. , 2016 ) or though explicit model compression as in weight quantization ( Polino et al. , 2018 ) . Extremely deep networks for image recognition often suffer from not only high complexity and inference latency , but also from the issue of vanishing gradients ( Pascanu et al. , 2013 ) . This was addressed through deep residual networks which effectively simplified network design through skip-connections . MobileNets ( Howard et al. , 2017 ) are one of the earlier approaches to building small low-latency networks by using depthwise separable convolutions with two parameters , width and resolution multipliers . They demonstrate the effectiveness of MobileNets across different vision tasks , such as face embeddings and object detection . MobileNetV2 ( Sandler et al. , 2018 ) extends MobileNets by utilizing inverted residual filter structures and linear bottlenecks , obtaining improvements on state-of-the-art models both in terms of accuracy and computational complexity . ShuffleNets ( Zhang et al. , 2018 ) propose dedicated residual units where 1×1 convolutions are replaced with pointwise group convolutions and channel shuffling reducing FLOPs computations . More recently , the focus on building efficient neural network models has shifted to techniques that treat the design of efficient networks as a search problem , falling under the umbrella of Neural Architecture Search ( NAS ) . EfficientNets ( Tan & Le , 2019 ) propose a novel scaling method which adjusts the network ’ s length , width , and resolution to optimize performance subject to target memory and FLOPs constraints . They also define a novel baseline that is optimized by a multi-objective neural architecture search . The FBNet collections of models—FBNet ( Wu et al. , 2019 ) , FBNetV2 ( Wan et al. , 2020 ) and FBNetV3 ( Dai et al. , 2021 ) —employ neural architecture search to obtain highly-optimized models that improve on the state-of-the-art for different visual understanding tasks . FBNet frames the architecture search as a differentiable meta-learning problem with gradient based techniques , namely DNAS—Differentiable Neural Architecture Search—by Wu et al . ( 2019 ) , and avoids selecting the optimized model over a discrete set . The subsequent entry in this collection , FBNetV2 , expands the search space over conventional DNAS , and employs a masking scheme to maintain the same level of computational complexity while searching over this expanded space . FBNetV3 further improves on the state-of-the-art by employing Neural Architecture Recipe Search ( NARS ) and searching over the space of not only architectures , but also corresponding recipes ( which are generally hyper-parameters ) . In this paper , we consider FBNetV3 models as our baselines as they are state-of-the-art . We are interested in understanding if they are overparameterized and evaluate how much model pruning can improve performance at a certain FLOPs level over the state-of-the-art in this family of models . Model Pruning : Modern neural networks , particularly those processing complex sensory inputs ( such as speech , vision and language ) for perception applications , are often over-parameterized . It is only to be expected that we should be able to compress such networks significantly to maintain the same level of performance at decreased level of computation ( fewer weights and reduced FLOPs ) , memory footprint and power consumption . Foundational efforts in this space include the Optimal Brain Surgeon ( Hassibi & Stork , 1993 ) and Optimal Brain Damage ( LeCun et al. , 1990 ) . Recently the idea of network pruning has been formalized through the lottery ticket hypothesis ( Frankle & Carbin , 2018 ) , which claims that randomly initialized , feed-forward networks have winning sub-networks that perform just as well as the original network on an unseen test dataset . Model pruning is generally of two types : unstructured and structured pruning . Unstructured pruning , as the name suggests , doesn ’ t adhere to any structure and prunes neurons based on chosen criteria ( such as magnitude ) . This has the advantage of providing higher performance , but is difficult to implement in hardware , as it needs dedicated support for efficient sparse matrix multiplications . Meanwhile , structured pruning is the practice of removing entire groups of neurons ( e.g. , blocks within the weight matrix , or channels in convolutional neural networks ) . This is easy to implement without dedicated hardware support , but has the issue of lower generalization performance than unstructured pruning ( Yao et al. , 2019 ) . In the literature , there have also been several studies , for example investigating whether rewinding ( training from scratch with a fixed mask ) can perform just as well as the fine-tuning on top of the original unpruned network ( Renda et al. , 2020 ) . Blalock et al . ( 2020 ) provide an overview survey of recent advances and open problems in neural network pruning . In the research area of designing efficient networks for computer vision , there has not been much focus on understanding how pruning can be applied to the current generation of models . Most literature on pruning is based on older networks such as VGGNet , ResNet ( He et al. , 2016 ) , and MobileNet ( Sandler et al. , 2018 ) . Our work improves upon these existing studies by understanding how pruning can improve the FLOPs-accuracy tradeoff over existing state-of-the-art networks . | This paper applies conventional pruning-and-finetuning techniques to further compress the networks searched by NAS. The experiments and evaluations are based on the family of FBNetV3. The authors show that by pruning large FBNetV3 model to small one, the accuracy of pruned model may be slightly better than the original target (small) model, achieving better tradeoff between computational complexity and accuracy. Also, the authors show that pruning is more training-efficient than searching by NAS to achieve a compact FBNetV3 model. | SP:070b00b3bd28545b1bbdf3f6884e748756fb3101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.