paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Improving Zero-Shot Voice Style Transfer via Disentangled Representation Learning
1 INTRODUCTION . Style transfer , which automatically converts a data instance into a target style , while preserving its content information , has attracted considerable attention in various machine learning domains , including computer vision ( Gatys et al. , 2016 ; Luan et al. , 2017 ; Huang & Belongie , 2017 ) , video processing ( Huang et al. , 2017 ; Chen et al. , 2017 ) , and natural language processing ( Shen et al. , 2017 ; Yang et al. , 2018 ; Lample et al. , 2019 ; Cheng et al. , 2020b ) . In speech processing , style transfer was earlier recognized as voice conversion ( VC ) ( Muda et al. , 2010 ) , which converts one speaker ’ s utterance , as if it was from another speaker but with the same semantic meaning . Voice style transfer ( VST ) has received long-term research interest , due to its potential for applications in security ( Sisman et al. , 2018 ) , medicine ( Nakamura et al. , 2006 ) , entertainment ( Villavicencio & Bonada , 2010 ) and education ( Mohammadi & Kain , 2017 ) , among others . Although widely investigated , VST remains challenging when applied to more general application scenarios . Most of the traditional VST methods require parallel training data , i.e. , paired voices from two speakers uttering the same sentence . This constraint limits the application of such models in the real world , where data are often not pair-wise available . Among the few existing models that address non-parallel data ( Hsu et al. , 2016 ; Lee & Wu , 2006 ; Godoy et al. , 2011 ) , most methods can not handle many-to-many transfer ( Saito et al. , 2018 ; Kaneko & Kameoka , 2018 ; Kameoka et al. , 2018 ) , which prevents them from converting multiple source voices to multiple target speaker styles . Even among the few non-parallel many-to-many transfer models , to the best of our knowledge , only two models ( Qian et al. , 2019 ; Chou & Lee , 2019 ) allow zero-shot transfer , i.e. , conversion from/to newly-coming speakers ( unseen during training ) without re-training the model . The only two zero-shot VST models ( AUTOVC ( Qian et al. , 2019 ) and AdaIN-VC ( Chou & Lee , 2019 ) ) share a common weakness . Both methods construct encoder-decoder frameworks , which extract the style and the content information into style and content embeddings , and generate a voice sample by combining a style embedding and a content embedding through the decoder . With the combination of the source content embedding and the target style embedding , the models generate ∗Equal contribution . the transferred voice , based only on source and target voice samples . AUTOVC ( Qian et al. , 2019 ) uses a GE2E ( Wan et al. , 2018 ) pre-trained style encoder to ensure rich speaker-related information in style embeddings . However , AUTOVC has no regularizer to guarantee that the content encoder does not encode any style information . AdaIN-VC ( Chou & Lee , 2019 ) applies instance normalization ( Ulyanov et al. , 2016 ) to the feature map of content representations , which helps to eliminate the style information from content embeddings . However , AdaIN-VC fails to prevent content information from being revealed in the style embeddings . Both methods can not assure that the style and content embeddings are disentangled without information revealed from each other . With information-theoretic guidance , we propose a disentangled-representation-learning method to enhance the encoder-decoder zero-shot VST framework , for both style and content information preservation . We call the proposed method Information-theoretic Disentangled Embedding for Voice Conversion ( IDE-VC ) . Our model successfully induces the style and content of voices into independent representation spaces by minimizing the mutual information between style and content embeddings . We also derive two new multi-group mutual information lower bounds , to further improve the representativeness of the latent embeddings . Experiments demonstrate that our method outperforms previous works under both many-to-many and zero-shot transfer setups on two objective metrics and two subjective metrics . 2 BACKGROUND . In information theory , mutual information ( MI ) is a crucial concept that measures the dependence between two random variables . Mathematically , the MI between two variables x and y is I ( x ; y ) : = Ep ( x , y ) [ log p ( x , y ) p ( x ) p ( y ) ] , ( 1 ) where p ( x ) and p ( y ) are marginal distributions of x and y , and p ( x , y ) is the joint distribution . Recently , MI has attracted considerable interest in machine learning as a criterion to minimize or maximize the dependence between different parts of a model ( Chen et al. , 2016 ; Alemi et al. , 2016 ; Hjelm et al. , 2018 ; Veličković et al. , 2018 ; Song et al. , 2019 ) . However , the calculation of exact MI values is challenging in practice , since the closed form of joint distribution p ( x , y ) in equation ( 1 ) is generally unknown . To solve this problem , several MI estimators have been proposed . For MI maximization tasks , Nguyen , Wainwright and Jordan ( NWJ ) ( Nguyen et al. , 2010 ) propose a lower bound by representing ( 1 ) as an f -divergence ( Moon & Hero , 2014 ) : INWJ : = Ep ( x , y ) [ f ( x , y ) ] − e−1Ep ( x ) p ( y ) [ ef ( x , y ) ] , ( 2 ) with a score function f ( x , y ) . Another widely-used sample-based MI lower bound is InfoNCE ( Oord et al. , 2018 ) , which is derived with Noise Contrastive Estimation ( NCE ) ( Gutmann & Hyvärinen , 2010 ) . With sample pairs { ( xi , yi ) } Ni=1 drawn from the joint distribution p ( x , y ) , the InfoNCE lower bound is defined as INCE : = E [ 1 N N∑ i=1 log ef ( xi , yi ) 1 N ∑N j=1 e f ( xi , yj ) ] . ( 3 ) For MI minimization tasks , Cheng et al . ( 2020a ) proposed a contrastively learned upper bound that requires the conditional distribution p ( x|y ) : I ( x ; y ) ≤ E [ 1 N N∑ i=1 [ log p ( xi|yi ) − 1 N N∑ j=1 log p ( xj |yi ) ] ] . ( 4 ) where the MI is bounded by the log-ratio of conditional distribution p ( x|y ) between positive and negative sample pairs . In the following , we derive our information-theoretic disentangled representation learning framework for voice style transfer based on the MI estimators described above . 3 PROPOSED MODEL . We assume access to N audio ( voice ) recordings from M speakers , where speaker u has Nu voice samples Xu = { xui } Nui=1 . The proposed approach encodes each voice input x ∈ X = ∪Mu=1Xu into a speaker-related ( style ) embedding s = Es ( x ) and a content-related embedding c = Ec ( x ) , using respectively a style encoder Es ( · ) and a content encoder Ec ( · ) . To transfer a source xui from speaker u to the target style of the voice of speaker v , xvj , we combine the content embedding cui = Ec ( xui ) and the style embedding svj = Es ( xvj ) to generate the transferred voice x̂u→v , i = D ( svj , cui ) with a decoder D ( s , c ) . To implement this two-step transfer process , we introduce a novel mutual information ( MI ) -based learning objective , that induces the style embedding s and content embedding c into independent representation spaces ( i.e. , ideally , s contains rich style information of xwith no content information , and vice versa ) . In the following , we first describe our MI-based training objective in Section 3.1 , and then discuss the practical estimation of the objective in Sections 3.2 and 3.3 . 3.1 MI-BASED DISENTANGLING OBJECTIVE . From an information-theoretic perspective , to learn representative latent embedding ( s , c ) , it is desirable to maximize the mutual information between the embedding pair ( s , c ) and the input x . Meanwhile , the style embedding s and the content c are desired to be independent , so that we can control the style transfer process with different style and content attributes . Therefore , we minimize the mutual information I ( s ; c ) to disentangle the style embedding and content embedding spaces . Consequently , our overall disentangled-representation-learning objective seeks to minimize L = I ( s ; c ) − I ( x ; s , c ) = I ( s ; c ) − I ( x ; c|s ) − I ( x ; s ) . ( 5 ) As discussed in Locatello et al . ( Locatello et al. , 2019 ) , without inductive bias for supervision , the learned representation can be meaningless . To address this problem , we use the speaker identity u as a variable with values { 1 , . . . , M } to learn representative style embedding s for speaker-related attributes . Noting that the process from speaker u to his/her voice xui to the style embedding sui ( as u → x → s ) is a Markov Chain , we conclude I ( s ; x ) ≥ I ( s ; u ) based on the MI data-processing inequality ( Cover & Thomas , 2012 ) ( as stated in the Supplementary Material ) . Therefore , we replace I ( s ; x ) in L with I ( s ; u ) and minimize an upper bound instead : L̄ = I ( s ; c ) − I ( x ; c|s ) − I ( u ; s ) ≥ I ( s ; c ) − I ( x ; c|s ) − I ( x ; s ) , ( 6 ) In practice , calculating the MI is challenging , as we typically only have access to samples , and lack the required distributions ( Chen et al. , 2016 ) . To solve this problem , below we provide several MI estimates to the objective terms I ( s ; c ) , I ( x ; c|s ) and I ( u ; s ) . 3.2 MI LOWER BOUND ESTIMATION . To maximize I ( u ; s ) , we derive the following multi-group MI lower bound ( Theorem 3.1 ) based on the NWJ bound developed in Nguyen et al . ( Nguyen et al. , 2010 ) . The detailed proof is provided in the Supplementary Material . Let µ ( −ui ) v = µv represent the mean of all style embeddings in group Xv , constituting the style centroid of speaker v ; µ ( −ui ) u is the mean of all style embeddings in group Xu except data point xui , representing a leave-xui-out style centroid of speaker u . Intuitively , we minimize ‖sui − µ ( −ui ) u ‖ to encourage the style embedding of voice xui to be more similar to the style centroid of speaker u , while maximizing ‖sui − µ ( −ui ) v ‖ to enlarge the margin between sui and the other speakers ’ style centroids µv . We denote the right-hand side of ( 7 ) as Î1 . Theorem 3.1 . Let µ ( −ui ) v = 1Nv ∑Nv k=1 svk if u 6= v ; and µ ( −ui ) u = 1 Nu−1 ∑ j 6=i suj . Then , I ( u ; s ) ≥ E [ 1 N M∑ u=1 Nu∑ i=1 [ − ‖sui − µ ( −ui ) u ‖2 − e−1 N M∑ v=1 Nv exp { −‖sui − µ ( −ui ) v ‖2 } ] ] . ( 7 ) To maximize I ( x ; c|s ) , we derive a conditional mutual information lower bound below : Theorem 3.2 . Assume that given s = su , samples { ( xui , cui ) } Nui=1 are observed . With a variational distribution qφ ( x|s , c ) , we have I ( x ; c|s ) ≥ E [ Î ] , where Î = 1 N M∑ u=1 Nu∑ i=1 [ log qφ ( xui|cui , su ) − log ( 1 Nu Nu∑ j=1 qφ ( xuj |cui , su ) ) ] . ( 8 ) Based on the criterion for s in equation ( 7 ) , a well-learned style encoder Es pulls all style embeddings sui from speaker u together . Suppose su is representative of the style embeddings of set Xu . If we parameterize the distribution qφ ( x|s , c ) ∝ exp ( −‖x−D ( s , c ) ‖2 ) with decoder D ( s , c ) , then based on Theorem 3.2 , we can estimate the lower bound of I ( x ; c|s ) with the following objective : Î2 : = 1 N M∑ u=1 Nu∑ i=1 [ − ‖xui −D ( cui , su ) ‖2 − log ( 1 Nu Nu∑ j=1 exp { −‖xuj −D ( cui , su ) ‖2 } ) ] . When maximizing Î2 , for speaker u with his/her given voice style su , we encourage the content embedding cui to well reconstruct the original voice xui , with small ‖xui − D ( cui , su ) ‖ . Additionally , the distance ‖xuj −D ( cui , su ) ‖ is minimized , ensuring cui does not contain information to reconstruct other voices xuj from speaker u . With Î2 , the correlation between xui and cui is amplified , which improves cui in preserving the content information .
This submission proposes a training approach for voice style transfer using encoder-decoder framework and content and style representations. The approach combines multiple mutual-information (MI) based terms into a single objective function. One of the MI based terms is the MI between content and style representations. By minimising mutual information between these representations, the training approach yields models where these representations are disentangled. Experimental results show that this approach leads to improved performance in speaker verification and speech similarity tasks. Experimental results in challenging zero-shot conditions also demonstrate improved performance in speaker verification, speech naturalness and speech similarity tasks.
SP:86d37b08b4c0ab21d139c57bbe3b9e5535eeb3f9
Learning Lagrangian Fluid Dynamics with Graph Neural Networks
1 INTRODUCTION . For many science and engineering problems , fluids are an essential integral part . How to simulate fluid dynamics accurately has long been studied by researchers and a large class of numerical models have been developed . However , computing high-quality fluid simulation is still computationally expensive despite the advances in computing power . Also , the time of calculation usually increases drastically when the resolution of the simulating scene scales up . A common way to alleviate computing costs is using a data-driven model . Recent progress in the machine learning domain opens up the possibility of employing learning algorithms to learn and model fluid dynamics . In this paper , we propose a graph-based data-driven fluid dynamics model ( Fluid Graph Networks , FGN ) , which consists of simple multi-layer perceptron and graph inductive architectures . Our model predicts and integrates forward the movement of incompressible fluids based on observations . Compared to previous works in this domain ( Ummenhofer et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) , our model enjoys traceability of physical properties of the system , like low velocity-divergence and constant particle density , and it can predict reasonable pressure distribution . Experiments demonstrate that our model can remain stable and accurate in long-term simulation . Although our model is entailed and customized for fluid simulation , it can be extended to simulation of other dynamics under the Lagrangian framework , as it takes universal features ( positions , velocities , particle density ) under the Lagrangian framework as input . 2 RELATED WORKS . Our model is built upon the Lagrangian representation of fluid , where continuous fluids are discretized and approximated by a set of particles . The most prominent advantage of the Lagrangian method is that the particle boundary is the material interface , which makes boundary conditions easy to impose , especially when the material interface is large and changing violently . A well-known Lagrangian method is Smooth Particle Hydrodynamics ( SPH ) ( Monaghan , 1988 ) . SPH and its variants are widely used in the numerical physic simulation , especially fluid dynamics under various environments . Particle-based fluid simulation ( Müller et al. , 2003 ) introduces SPH model to simulate fluids and generate realistic visual effects . Moving particle semi-implicit method ( MPS ) ( Koshizuka and Oka , 1996 ) markedly improves the accuracy and stability of incompressible fluid simulation by introducing a pressure projection procedure that emulates Eulerian grid-based methods . Weakly compressible SPH ( WSPH ) ( Becker and Teschner , 2007 ) introduces equation of state to model the pressure during the simulation . Predictive-corrective incompressible SPH ( Solenthaler and Pajarola , 2009 ) and divergence-free SPH ( Bender and Koschier , 2015 ) use iterative method to improve the accuracy of pressure calculation in incompressible flow simulation . Modeling fluid dynamics in a data-driven way has been explored and studied by many researchers . With advances in machine learning algorithms , many data-driven models employing machine learning algorithms have been built . Ladický et al . ( 2015 ) reformulate the Navier-Stokes equation as a regression problem and build a regressor using random forest , which significantly improves the calculation efficiency . Tompson et al . ( 2016 ) , Xiao et al . ( 2020 ) learn the pressure projection under the Eulerian framework with a convolutional neural network , which accelerates the fluid simulation . Wiewel et al . ( 2018 ) bring significant speed-up by learning a reduced-order representation and predicting the pressure field with an LSTM-based model . Morton et al . ( 2018 ) learn the dynamics of airflow around a cylinder based on Koopman theory . de Avila Belbute-Peres et al . ( 2020 ) predict fluid flow by combining grid-based method with graph convolutional neural networks . Learning and reasoning particle dynamics under graph representation has the following benefits and conveniences . First , particle-based methods model physics phenomena as interactions between particles within a local area . This imposes an inductive bias for learning under the Lagrangian framework : dynamics have a strong locality . The locality of unstructured data under Lagrangian representation can be captured by aggregation operation on graphs , such as GCN and other variants ( Kipf and Welling , 2016 ; Hamilton et al. , 2017 ) . Second , unlike Eulerian grid-based methods , Lagrangian particle-based methods do not have explicit and structured grid , which makes standard Convolutional Neural Network ( CNN ) can not be directly applied to particles without feature processing ( Wang et al. , 2018 ; Ummenhofer et al. , 2020 ) . Third , many dynamics are based on pairwise relation between particles , like collision , which can be easily interpreted as edge attributes of a graph . Given these factors , recently there have been a rich class of works that use graph neural networks ( Scarselli et al. , 2009 ) to learn and reason about underlying physics of interacting objects and particles . ( Battaglia et al. , 2016 ; Chang et al. , 2016 ; Sanchez-Gonzalez et al. , 2018 ; Li et al. , 2018 ; Mrowca et al. , 2018 ) 3 MODEL . 3.1 FLUID DYNAMICS . The governing equation for incompressible fluids is the Navier-Stokes equation and the continuity equation as follows ( Batchelor , 2000 ) : Du Dt = −∇p ρ + ν∇2u + g , ( 1 ) ∇ · u = 0 . ( 2 ) To describe the fluid field , there are two kinds of systems , Eulerian and Lagrangian ones . In this work , we adopt a Lagrangian system . A common method to solve the Navier-Stokes equation and discretize fluids under the Lagrangian framework is Smooth Particle Hydrodynamics ( SPH ) method ( Monaghan , 1988 ) , where physical quantities at an arbitrary point in the space are approximated by the states of nearby particles . In SPH , an arbitrary scalar ( or vector ) field A ( r ) at location r can be represented by a convolution : A ( r ) = ∫ A ( r′ ) W ( |r− r′| , h ) dV ( r′ ) , ( 3 ) where W is weighting function or smooth kernel as defined in SPH , h is the smoothing length , which defines the range of particles to be considered and V ( r′ ) is the volume at r. Numerically , the interpolation can be approximated by replacing the integration with a summation . Based on this model , equation equation 1 and equation 2 can be discretized . The discrete equation system is usually solved under a predictor-corrector scheme , prediction based on advection and correction based on physical properties ( such as divergence-free constraint ) . 3.2 MODEL . Fluids are time-dependent dynamical systems , where location of particles , r , is described by equation of form : dr/dt = f ( r ) . When building a data-driven model to learn and solve this system , we assume the system is Markovian , that is , the state of the system at time step n+ 1 depends only on the state of the previous time step n. The update mechanism in our model can be represented as : { xn+1 , vn+1 } = Gθ ( { xn , vn } ) . ( 4 ) Here { xn , vn } denotes the positional information and velocity of fluid field at time step n. Datadriven model Gθ , parameterized by θ , maps the state of time step n to time step n+ 1 . In order to build a robust and accurate data-driven model , the structure of our model is physicinformed , which enables the model to give interpretable output without losing many physical properties of the system . In general , our model mimics the predictor-corrector scheme and includes three parts , advection net , collision net , and pressure net . They can be divided into two types of graph networks ( GN ) according to the network structure ( Battaglia et al. , 2018 ) . Specifically , advection net and pressure net are node-focused graph networks , while collision net is edge-focused networks . As each of these networks has a specific task and different output , they are trained on different data separately . Node-focused Graph Network Advection net is responsible for the prediction of advection effect and pressure net is responsible for pressure projection . Considering a particle i , the node-focused graph network first aggregates node features from neighbor particles { vj |∀j ∈ N ( i ) } and output node embedding fi . The embedding fi will then be passed to a processor gR . gR will predict the desirable physical quantities oi ( i.e . acceleration a in advection net and pressure p in pressure net ) . The whole message passing procedure can be defined as : oi = gR ( gA ( Vi ) ) , Vi = { vj } ∀j∈N ( i ) . ( 5 ) Edge-focused Graph Network To prevent particle penetration and increase model stability , we propose a graph network model that is responsible for predicting the effect of collision . As the relative position and relative velocity will have different signs with different observation perspective ( i.e . relative velocity vij = −vji ) , thus the graph in collision net is directed . In collision net , relative features , eij ( relative positions , relative velocities between particle i and j ) , are passed to processor fR as edge features . The processor will output the edge embedding rij between each pair of nodes . Lastly , edge embedding rij is aggregated via aggregator fA , to gather the influence from all nearby particles and predict an overall effect oi on the center particle i . The whole process is defined as : oi = fA ( fR ( Ei ) ) , Ei = { eij } ∀j∈N ( i ) . ( 6 ) The advantage of using relative position and velocity instead of global ones as input features is that this explicitly imposes a spatial invariance to the network , given that collision between two particles is invariant to the global positions they are at . 4 IMPLEMENTATION . We adopt the numerical model in SPH to evaluate the physical quantities like particle density and differential operators like gradient . To construct graph representation for particles , we establish edges between particles within the control radius . 4.1 UPDATE SCHEME . In general , given the state ( position xn and velocity vn ) of the current time step n , we derive the state of next time step n + 1 by passing the state information through advection net , collision net , and pressure net sequentially . The input features to advection net are positions and velocities of particles , [ xn , vn ] , along with g , which indicates the external body force per mass of fluid , and viscosity parameter ν , which denotes the magnitude of fluid viscosity . The advection net predicts acceleration of particles : aadv = Gadv ( x n , vn , g , ν ) , ( 7 ) and updates the state of fluid particles to an intermediate state [ x∗ , v∗ ] . v∗ = vn + aadv∆t , ( 8 ) x∗ = xn + v∗∆t . ( 9 ) Where aadv = [ aadv1 , ... , a adv N ] , x n = [ xn1 , ... , v n N ] , v n = [ vn1 , ... , v n N ] for particles i ∈ { 1 , .. , N } . We will use the same notation throughout illustration . The collision net takes relative positions and velocities between particles , [ x∗i −x∗j , v∗i −v∗j ] as input , and predicts correction to the velocity , ∆v = Gcol ( x ∗ r , v ∗ r ) , ( 10 ) where [ x∗r , v ∗ r ] denotes the relative position and velocity in intermediate state . The velocity is then updated with predicted correction : v∗∗ = v∗ + ∆v . ( 11 ) The updated intermediate position and velocity are taken as input by the pressure net , along with particle number density ρ. p̂ = Gpres ( x ∗ , v∗∗ , ρ ) . ( 12 ) The state of fluid field is then updated to next time step n+ 1 , vn+1 = v∗∗ − ∇p̂ ρc ∆t , ( 13 ) xn+1 = x∗ + vn+1∆t . ( 14 ) Where p̂ = [ p̂1 , ... , p̂N ] , ρ = [ ρ1 , ... , ρN ] , ρc is the density parameter of fluid . Predicting pressure of fluid field using particle density and velocity is based on the observation that advection will incur a temporary compression on fluid body , which means fluid density has changed . Therefore the goal of pressure net is to impose a pressure projection to mitigate these deviations . During the above calculation , the global positional information is only used to construct graph on fluid particles and will not be passed into aggregator and processor as features . The relative position and particle density are normalized before input .
The authors propose a learned model specialized on learning Lagrangian fluid dynamics for incompressible fluids. The model is a hybrid between a simulator with explicit advection, collision and pressure correction stages, and a learned model, trained by supervising each of those stages. The authors demonstrate improved stability/conservation of physical properties for a model, and some flexibility to the time-step being changed at test time.
SP:92bb35142d496d7afaa07a298a3bffabd00ec352
Learning Lagrangian Fluid Dynamics with Graph Neural Networks
1 INTRODUCTION . For many science and engineering problems , fluids are an essential integral part . How to simulate fluid dynamics accurately has long been studied by researchers and a large class of numerical models have been developed . However , computing high-quality fluid simulation is still computationally expensive despite the advances in computing power . Also , the time of calculation usually increases drastically when the resolution of the simulating scene scales up . A common way to alleviate computing costs is using a data-driven model . Recent progress in the machine learning domain opens up the possibility of employing learning algorithms to learn and model fluid dynamics . In this paper , we propose a graph-based data-driven fluid dynamics model ( Fluid Graph Networks , FGN ) , which consists of simple multi-layer perceptron and graph inductive architectures . Our model predicts and integrates forward the movement of incompressible fluids based on observations . Compared to previous works in this domain ( Ummenhofer et al. , 2020 ; Sanchez-Gonzalez et al. , 2020 ) , our model enjoys traceability of physical properties of the system , like low velocity-divergence and constant particle density , and it can predict reasonable pressure distribution . Experiments demonstrate that our model can remain stable and accurate in long-term simulation . Although our model is entailed and customized for fluid simulation , it can be extended to simulation of other dynamics under the Lagrangian framework , as it takes universal features ( positions , velocities , particle density ) under the Lagrangian framework as input . 2 RELATED WORKS . Our model is built upon the Lagrangian representation of fluid , where continuous fluids are discretized and approximated by a set of particles . The most prominent advantage of the Lagrangian method is that the particle boundary is the material interface , which makes boundary conditions easy to impose , especially when the material interface is large and changing violently . A well-known Lagrangian method is Smooth Particle Hydrodynamics ( SPH ) ( Monaghan , 1988 ) . SPH and its variants are widely used in the numerical physic simulation , especially fluid dynamics under various environments . Particle-based fluid simulation ( Müller et al. , 2003 ) introduces SPH model to simulate fluids and generate realistic visual effects . Moving particle semi-implicit method ( MPS ) ( Koshizuka and Oka , 1996 ) markedly improves the accuracy and stability of incompressible fluid simulation by introducing a pressure projection procedure that emulates Eulerian grid-based methods . Weakly compressible SPH ( WSPH ) ( Becker and Teschner , 2007 ) introduces equation of state to model the pressure during the simulation . Predictive-corrective incompressible SPH ( Solenthaler and Pajarola , 2009 ) and divergence-free SPH ( Bender and Koschier , 2015 ) use iterative method to improve the accuracy of pressure calculation in incompressible flow simulation . Modeling fluid dynamics in a data-driven way has been explored and studied by many researchers . With advances in machine learning algorithms , many data-driven models employing machine learning algorithms have been built . Ladický et al . ( 2015 ) reformulate the Navier-Stokes equation as a regression problem and build a regressor using random forest , which significantly improves the calculation efficiency . Tompson et al . ( 2016 ) , Xiao et al . ( 2020 ) learn the pressure projection under the Eulerian framework with a convolutional neural network , which accelerates the fluid simulation . Wiewel et al . ( 2018 ) bring significant speed-up by learning a reduced-order representation and predicting the pressure field with an LSTM-based model . Morton et al . ( 2018 ) learn the dynamics of airflow around a cylinder based on Koopman theory . de Avila Belbute-Peres et al . ( 2020 ) predict fluid flow by combining grid-based method with graph convolutional neural networks . Learning and reasoning particle dynamics under graph representation has the following benefits and conveniences . First , particle-based methods model physics phenomena as interactions between particles within a local area . This imposes an inductive bias for learning under the Lagrangian framework : dynamics have a strong locality . The locality of unstructured data under Lagrangian representation can be captured by aggregation operation on graphs , such as GCN and other variants ( Kipf and Welling , 2016 ; Hamilton et al. , 2017 ) . Second , unlike Eulerian grid-based methods , Lagrangian particle-based methods do not have explicit and structured grid , which makes standard Convolutional Neural Network ( CNN ) can not be directly applied to particles without feature processing ( Wang et al. , 2018 ; Ummenhofer et al. , 2020 ) . Third , many dynamics are based on pairwise relation between particles , like collision , which can be easily interpreted as edge attributes of a graph . Given these factors , recently there have been a rich class of works that use graph neural networks ( Scarselli et al. , 2009 ) to learn and reason about underlying physics of interacting objects and particles . ( Battaglia et al. , 2016 ; Chang et al. , 2016 ; Sanchez-Gonzalez et al. , 2018 ; Li et al. , 2018 ; Mrowca et al. , 2018 ) 3 MODEL . 3.1 FLUID DYNAMICS . The governing equation for incompressible fluids is the Navier-Stokes equation and the continuity equation as follows ( Batchelor , 2000 ) : Du Dt = −∇p ρ + ν∇2u + g , ( 1 ) ∇ · u = 0 . ( 2 ) To describe the fluid field , there are two kinds of systems , Eulerian and Lagrangian ones . In this work , we adopt a Lagrangian system . A common method to solve the Navier-Stokes equation and discretize fluids under the Lagrangian framework is Smooth Particle Hydrodynamics ( SPH ) method ( Monaghan , 1988 ) , where physical quantities at an arbitrary point in the space are approximated by the states of nearby particles . In SPH , an arbitrary scalar ( or vector ) field A ( r ) at location r can be represented by a convolution : A ( r ) = ∫ A ( r′ ) W ( |r− r′| , h ) dV ( r′ ) , ( 3 ) where W is weighting function or smooth kernel as defined in SPH , h is the smoothing length , which defines the range of particles to be considered and V ( r′ ) is the volume at r. Numerically , the interpolation can be approximated by replacing the integration with a summation . Based on this model , equation equation 1 and equation 2 can be discretized . The discrete equation system is usually solved under a predictor-corrector scheme , prediction based on advection and correction based on physical properties ( such as divergence-free constraint ) . 3.2 MODEL . Fluids are time-dependent dynamical systems , where location of particles , r , is described by equation of form : dr/dt = f ( r ) . When building a data-driven model to learn and solve this system , we assume the system is Markovian , that is , the state of the system at time step n+ 1 depends only on the state of the previous time step n. The update mechanism in our model can be represented as : { xn+1 , vn+1 } = Gθ ( { xn , vn } ) . ( 4 ) Here { xn , vn } denotes the positional information and velocity of fluid field at time step n. Datadriven model Gθ , parameterized by θ , maps the state of time step n to time step n+ 1 . In order to build a robust and accurate data-driven model , the structure of our model is physicinformed , which enables the model to give interpretable output without losing many physical properties of the system . In general , our model mimics the predictor-corrector scheme and includes three parts , advection net , collision net , and pressure net . They can be divided into two types of graph networks ( GN ) according to the network structure ( Battaglia et al. , 2018 ) . Specifically , advection net and pressure net are node-focused graph networks , while collision net is edge-focused networks . As each of these networks has a specific task and different output , they are trained on different data separately . Node-focused Graph Network Advection net is responsible for the prediction of advection effect and pressure net is responsible for pressure projection . Considering a particle i , the node-focused graph network first aggregates node features from neighbor particles { vj |∀j ∈ N ( i ) } and output node embedding fi . The embedding fi will then be passed to a processor gR . gR will predict the desirable physical quantities oi ( i.e . acceleration a in advection net and pressure p in pressure net ) . The whole message passing procedure can be defined as : oi = gR ( gA ( Vi ) ) , Vi = { vj } ∀j∈N ( i ) . ( 5 ) Edge-focused Graph Network To prevent particle penetration and increase model stability , we propose a graph network model that is responsible for predicting the effect of collision . As the relative position and relative velocity will have different signs with different observation perspective ( i.e . relative velocity vij = −vji ) , thus the graph in collision net is directed . In collision net , relative features , eij ( relative positions , relative velocities between particle i and j ) , are passed to processor fR as edge features . The processor will output the edge embedding rij between each pair of nodes . Lastly , edge embedding rij is aggregated via aggregator fA , to gather the influence from all nearby particles and predict an overall effect oi on the center particle i . The whole process is defined as : oi = fA ( fR ( Ei ) ) , Ei = { eij } ∀j∈N ( i ) . ( 6 ) The advantage of using relative position and velocity instead of global ones as input features is that this explicitly imposes a spatial invariance to the network , given that collision between two particles is invariant to the global positions they are at . 4 IMPLEMENTATION . We adopt the numerical model in SPH to evaluate the physical quantities like particle density and differential operators like gradient . To construct graph representation for particles , we establish edges between particles within the control radius . 4.1 UPDATE SCHEME . In general , given the state ( position xn and velocity vn ) of the current time step n , we derive the state of next time step n + 1 by passing the state information through advection net , collision net , and pressure net sequentially . The input features to advection net are positions and velocities of particles , [ xn , vn ] , along with g , which indicates the external body force per mass of fluid , and viscosity parameter ν , which denotes the magnitude of fluid viscosity . The advection net predicts acceleration of particles : aadv = Gadv ( x n , vn , g , ν ) , ( 7 ) and updates the state of fluid particles to an intermediate state [ x∗ , v∗ ] . v∗ = vn + aadv∆t , ( 8 ) x∗ = xn + v∗∆t . ( 9 ) Where aadv = [ aadv1 , ... , a adv N ] , x n = [ xn1 , ... , v n N ] , v n = [ vn1 , ... , v n N ] for particles i ∈ { 1 , .. , N } . We will use the same notation throughout illustration . The collision net takes relative positions and velocities between particles , [ x∗i −x∗j , v∗i −v∗j ] as input , and predicts correction to the velocity , ∆v = Gcol ( x ∗ r , v ∗ r ) , ( 10 ) where [ x∗r , v ∗ r ] denotes the relative position and velocity in intermediate state . The velocity is then updated with predicted correction : v∗∗ = v∗ + ∆v . ( 11 ) The updated intermediate position and velocity are taken as input by the pressure net , along with particle number density ρ. p̂ = Gpres ( x ∗ , v∗∗ , ρ ) . ( 12 ) The state of fluid field is then updated to next time step n+ 1 , vn+1 = v∗∗ − ∇p̂ ρc ∆t , ( 13 ) xn+1 = x∗ + vn+1∆t . ( 14 ) Where p̂ = [ p̂1 , ... , p̂N ] , ρ = [ ρ1 , ... , ρN ] , ρc is the density parameter of fluid . Predicting pressure of fluid field using particle density and velocity is based on the observation that advection will incur a temporary compression on fluid body , which means fluid density has changed . Therefore the goal of pressure net is to impose a pressure projection to mitigate these deviations . During the above calculation , the global positional information is only used to construct graph on fluid particles and will not be passed into aggregator and processor as features . The relative position and particle density are normalized before input .
The paper deals with the prediction of 3D Lagrangian Fluid Simulations. Therefore the problem is divided into 3 subproblems, oriented on numerical simulations. An advection part, where the acceleration of the particles is calculated, a collision step, where the boundary effects are included, and a pressure prediction part, where the pressure for maintaining the volume is determined. A graph-based network is used for each part, which is either node or edge-based according to the requirements.
SP:92bb35142d496d7afaa07a298a3bffabd00ec352
Multimodal Attention for Layout Synthesis in Diverse Domains
We address the problem of scene layout generation for diverse domains such as images , mobile applications , documents and 3D objects . Most complex scenes , natural or human-designed , can be expressed as a meaningful arrangement of simpler compositional graphical primitives . Generating a new layout or extending an existing layout requires understanding the relationships between these primitives . To do this , we propose a multimodal attention framework , MMA , that leverages self-attention to learn contextual relationships between layout elements and generate novel layouts in a given domain . Our framework allows us to generate a new layout either from an empty set or from an initial seed set of primitives , and can easily scale to support an arbitrary of primitives per layout . Further , our analyses show that the model is able to automatically capture the semantic properties of the primitives . We propose simple improvements in both representation of layout primitives , as well as training methods to demonstrate competitive performance in very diverse data domains such as object bounding boxes in natural images ( COCO bounding boxes ) , documents ( PubLayNet ) , mobile applications ( RICO dataset ) as well as 3D shapes ( PartNet ) . 1 INTRODUCTION . In the real world , there exists a strong relationship between different objects that are found in the same environment ( Torralba & Sinha , 2001 ; Shrivastava & Gupta , 2016 ) . For example , a dining table usually has chairs around it , a surfboard is found near the sea , horses do not ride cars , etc .. Biederman ( 2017 ) provided strong evidence in cognitive neuroscience that perceiving and understanding a scene involves two related processes : perception and comprehension . Perception deals with processing the visual signal or the appearance of a scene . Comprehension deals with understanding the schema of a scene , where this schema ( or layout ) can be characterized by contextual relationships ( e.g. , support , occlusion , and relative likelihood , position , and size ) between objects . For generative models that synthesize scenes , this evidence underpins the importance of two factors that contribute to the realism or plausibility of a generated scene : layout , i.e. , the arrangement of different objects , and their appearance ( in terms of pixels ) . Therefore , generating a realistic scene necessitates both these factors to be plausible . The advancements in the generative models for image synthesis have primarily targeted plausibility of the appearance signal by generating incredibly realistic images often with a single entity such as faces ( Karras et al. , 2019 ; 2017 ) , or animals ( Brock et al. , 2018 ; Zhang et al. , 2018 ) . In the case of large and complex scenes , with a lot of strong non-local relationships between different elements , most methods require proxy representations for layouts to be provided as inputs ( e.g. , scene graph , segmentation mask , sentence ) . We argue that to plausibly generate large and complex scenes without such proxies , it is necessary to understand and generate the layout of a scene , in terms of contextual relationships between various objects present in the scene . The layout of a scene , capturing what primitives occupy what parts of the scene , is an incredibly rich representation . Learning to generate layouts itself is a challenging problem due to the variability of real-world or human-designed layouts . Each layout is composed of a small fraction of possible objects , objects can be present in a wide range of locations , the number of objects varies for each scene and so do the contextual relationships between objects . Formally , a scene layout can be represented as an unordered set of graphical primitives . The primitive itself can be discrete or continuous depending on the data domain . For example , in the case of layout of documents , primitives can be bounding boxes from discrete classes such as ‘ text ’ , ‘ image ’ , or ‘ caption ’ , and in case of 3D objects , primitives can be 3D occupancy grids of parts of the object such as ‘ arm ’ , ‘ leg ’ , or ‘ back ’ in case of chairs . Additionally , in order to make the primitives compositional , we represent each primitive by a location vector with respect to the origin , and a scale vector that defines the bounding box enclosing the primitive . Again , based on the domain , these location and scale vectors can be 2D or 3D . A generative model for layouts should be able to look at all existing primitives and propose the placement and attributes of a new one . We propose a novel Multimodal Attention framework ( MMA ) that first maps the different parameters of the primitive independently to a fixed-length continuous latent vector , followed by a masked Transformer decoder to look at representations of existing primitives in layout and predict the next parameter . Our generative framework can start from an empty set , or a set of primitives , and can iteratively generate a new primitive one parameter at a time . Moreover , by predicting either to stop or to generate the next primitive , our sequential approach can generate variable length layouts . Our approach can be readily plugged into scene generation frameworks ( e.g. , Layout2Image ( Zhao et al. , 2019 ) , GauGAN ( Park et al. , 2019b ) ) or stand-alone applications that require generating layouts or templates with/without user interaction . For instance , in the UI design of mobile apps and websites , an automated model for generating plausible layouts can significantly decrease the manual effort and cost of building such apps and websites . Finally , a model to create layouts can potentially help generate synthetic data for various tasks tasks ( Yang et al. , 2017 ; Capobianco & Marinai , 2017 ; Chang et al. , 2015 ; Wu et al. , 2017b ; a ) . To the best of our knowledge , MMA is the first framework to perform competitively with the stateof-the-art approaches in 4 diverse data domains . We evaluate our model using existing metrics proposed for different domains such as Jensen-Shannon Divergence , Minimum matching distance , and Coverage in case of 3D objects , Inception Score and Fréchet Inception Distance for COCO , and Negative Log-likelihood of the test set in case of app wireframes and documents . Qualitative analysis of the framework also demonstrates that our model captures the semantic relationships between objects automatically ( without explicitly using semantic embeddings like word2vec Mikolov et al . ( 2013 ) ) . 2 RELATED WORK . Generative models . Deep generative models based on CNNs such as variational auto-encoders ( VAEs ) ( Kingma & Welling , 2013 ) , and generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have recently shown a great promise in terms of faithfully learning a given data distribution and sampling from it . There has also been research on generating data sequentially ( Oord et al. , 2016 ; Chen et al. , 2020 ) even when the data has no natural order ( Vinyals et al. , 2015 ) . Many of these approaches often rely on low-level information ( Gupta et al. , 2020b ) such as pixels while generating images ( Brock et al. , 2018 ; Karras et al. , 2019 ) , videos ( Vondrick et al. , 2016 ) , or 3D objects ( Wu et al. , 2016 ; Yang et al. , 2019 ; Park et al. , 2019a ; Gupta et al. , 2020a ) and not on semantic and geometric structure in the data . Scene generation . Generating 2D or 3D scenes conditioned on sentence ( Li et al. , 2019d ; Zhang et al. , 2017 ; Reed et al. , 2016 ) , a scene graph ( Johnson et al. , 2018 ; Li et al. , 2019a ; Ashual & Wolf , 2019 ) , a layout ( Dong et al. , 2017 ; Hinz et al. , 2019 ; Isola et al. , 2016 ; Wang et al. , 2018b ) or an existing image ( Lee et al. , 2018 ) has drawn a great interest in vision community . Given the input , some works generate a fixed layout and diverse scenes ( Zhao et al. , 2019 ) , while other works generate diverse layouts and scenes ( Johnson et al. , 2018 ; Li et al. , 2019d ) . These methods involve pipelines often trained and evaluated end-to-end , and surprisingly little work has been done to evaluate the layout generation component itself . Layout generation serves as a complementary task to these works and can be combined with these methods . In this work , we evaluate the layout modeling Under review as a conference paper at ICLR 2021 Text capabilities of two of the recent works ( Johnson et al. , 2018 ; Li et al. , 2019d ) that have layout generation as an intermediate step . We also demonstrate the results of our model with Layout2Im ( Zhao et al. , 2019 ) for image generation . Layout generation . The automatic generation of layouts is an important problem in graphic design . Many of the recent data-driven approaches use data specific constraints in order to model the layouts . For example , Wang et al . ( 2018a ; 2019 ) ; Li et al . ( 2019c ) ; Ritchie et al . ( 2019 ) generates topdown view indoor rooms layouts but make several assumptions regarding the presence of walls , roof etc. , and can not be easily extended to other datasets . In this paper , we focus on approaches that have fewer domain-specific constraints . LayoutGAN ( Li et al. , 2019b ) uses a GAN framework to generate semantic and geometric properties of a fixed number of scene elements . LayoutVAE ( Jyothi et al. , 2019 ) starts with a label set , i.e. , categories of all the elements present in the layout , and then generates a feasible layout of the scene . Zheng et al . ( 2019 ) attempt to generate document layouts given the images , keywords , and category of the document . Patil et al . ( 2019 ) proposes a method to construct hierarchies of document layouts using a recursive variational autoencoder and sample new hierarchies to generate new document layouts . Manandhar et al . ( 2020 ) develops an auto-encoding framework for layouts using Graph Networks . 3D-PRNN ( Zou et al. , 2017 ) , PQNet ( Wu et al. , 2020 ) and ComplementMe Sung et al . ( 2017 ) , generates 3D shapes via sequential part assembly . While 3D-PRNN generates only bounding boxes , PQ-Net and ComplementMe can synthesize complete 3D shapes starting with a partial or no input shape . Our approach offers several advantages over current layout generation approaches without sacrificing their benefits . By factorizing primitives into structural parameters and compositional geometric parameters , we can generate high-resolution primitives using distributed representations and consequently , complete scenes . The autoregressive nature of the model allows us to generate layouts of arbitrary lengths as well as start with partial layouts . Further , modeling the position and size of primitives as discrete values ( as discussed in §3.1 ) helps us realize better performance on datasets , such as documents and app wireframes , where bounding boxes of layouts are typically axis-aligned . We evaluate our method both quantitatively and qualitatively with state-of-the-art methods specific to each dataset and show competitive results in very diverse domains .
This work proposes a model to generate scene layouts by treating the scene as a composition of primitives, such as instance class, coordinates or scales. The model is a Transformer architecture, that attends on all previously predicted or given instance primitives. The probability of a scene layout is defined with a joint distribution, modeled as the product of conditional distributions using the chain rule. The model predicts an end of sequence token, that allows the generated layouts to have variable size. Moreover, the model allows to either complete an existing incomplete layout or to generate one from scratch. The paper presents experiments in four datasets, spanning different data domains, including 2D and 3D data.
SP:821ad1017b8aa20f5b6bc3fcc56844ae87d983e2
Multimodal Attention for Layout Synthesis in Diverse Domains
We address the problem of scene layout generation for diverse domains such as images , mobile applications , documents and 3D objects . Most complex scenes , natural or human-designed , can be expressed as a meaningful arrangement of simpler compositional graphical primitives . Generating a new layout or extending an existing layout requires understanding the relationships between these primitives . To do this , we propose a multimodal attention framework , MMA , that leverages self-attention to learn contextual relationships between layout elements and generate novel layouts in a given domain . Our framework allows us to generate a new layout either from an empty set or from an initial seed set of primitives , and can easily scale to support an arbitrary of primitives per layout . Further , our analyses show that the model is able to automatically capture the semantic properties of the primitives . We propose simple improvements in both representation of layout primitives , as well as training methods to demonstrate competitive performance in very diverse data domains such as object bounding boxes in natural images ( COCO bounding boxes ) , documents ( PubLayNet ) , mobile applications ( RICO dataset ) as well as 3D shapes ( PartNet ) . 1 INTRODUCTION . In the real world , there exists a strong relationship between different objects that are found in the same environment ( Torralba & Sinha , 2001 ; Shrivastava & Gupta , 2016 ) . For example , a dining table usually has chairs around it , a surfboard is found near the sea , horses do not ride cars , etc .. Biederman ( 2017 ) provided strong evidence in cognitive neuroscience that perceiving and understanding a scene involves two related processes : perception and comprehension . Perception deals with processing the visual signal or the appearance of a scene . Comprehension deals with understanding the schema of a scene , where this schema ( or layout ) can be characterized by contextual relationships ( e.g. , support , occlusion , and relative likelihood , position , and size ) between objects . For generative models that synthesize scenes , this evidence underpins the importance of two factors that contribute to the realism or plausibility of a generated scene : layout , i.e. , the arrangement of different objects , and their appearance ( in terms of pixels ) . Therefore , generating a realistic scene necessitates both these factors to be plausible . The advancements in the generative models for image synthesis have primarily targeted plausibility of the appearance signal by generating incredibly realistic images often with a single entity such as faces ( Karras et al. , 2019 ; 2017 ) , or animals ( Brock et al. , 2018 ; Zhang et al. , 2018 ) . In the case of large and complex scenes , with a lot of strong non-local relationships between different elements , most methods require proxy representations for layouts to be provided as inputs ( e.g. , scene graph , segmentation mask , sentence ) . We argue that to plausibly generate large and complex scenes without such proxies , it is necessary to understand and generate the layout of a scene , in terms of contextual relationships between various objects present in the scene . The layout of a scene , capturing what primitives occupy what parts of the scene , is an incredibly rich representation . Learning to generate layouts itself is a challenging problem due to the variability of real-world or human-designed layouts . Each layout is composed of a small fraction of possible objects , objects can be present in a wide range of locations , the number of objects varies for each scene and so do the contextual relationships between objects . Formally , a scene layout can be represented as an unordered set of graphical primitives . The primitive itself can be discrete or continuous depending on the data domain . For example , in the case of layout of documents , primitives can be bounding boxes from discrete classes such as ‘ text ’ , ‘ image ’ , or ‘ caption ’ , and in case of 3D objects , primitives can be 3D occupancy grids of parts of the object such as ‘ arm ’ , ‘ leg ’ , or ‘ back ’ in case of chairs . Additionally , in order to make the primitives compositional , we represent each primitive by a location vector with respect to the origin , and a scale vector that defines the bounding box enclosing the primitive . Again , based on the domain , these location and scale vectors can be 2D or 3D . A generative model for layouts should be able to look at all existing primitives and propose the placement and attributes of a new one . We propose a novel Multimodal Attention framework ( MMA ) that first maps the different parameters of the primitive independently to a fixed-length continuous latent vector , followed by a masked Transformer decoder to look at representations of existing primitives in layout and predict the next parameter . Our generative framework can start from an empty set , or a set of primitives , and can iteratively generate a new primitive one parameter at a time . Moreover , by predicting either to stop or to generate the next primitive , our sequential approach can generate variable length layouts . Our approach can be readily plugged into scene generation frameworks ( e.g. , Layout2Image ( Zhao et al. , 2019 ) , GauGAN ( Park et al. , 2019b ) ) or stand-alone applications that require generating layouts or templates with/without user interaction . For instance , in the UI design of mobile apps and websites , an automated model for generating plausible layouts can significantly decrease the manual effort and cost of building such apps and websites . Finally , a model to create layouts can potentially help generate synthetic data for various tasks tasks ( Yang et al. , 2017 ; Capobianco & Marinai , 2017 ; Chang et al. , 2015 ; Wu et al. , 2017b ; a ) . To the best of our knowledge , MMA is the first framework to perform competitively with the stateof-the-art approaches in 4 diverse data domains . We evaluate our model using existing metrics proposed for different domains such as Jensen-Shannon Divergence , Minimum matching distance , and Coverage in case of 3D objects , Inception Score and Fréchet Inception Distance for COCO , and Negative Log-likelihood of the test set in case of app wireframes and documents . Qualitative analysis of the framework also demonstrates that our model captures the semantic relationships between objects automatically ( without explicitly using semantic embeddings like word2vec Mikolov et al . ( 2013 ) ) . 2 RELATED WORK . Generative models . Deep generative models based on CNNs such as variational auto-encoders ( VAEs ) ( Kingma & Welling , 2013 ) , and generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have recently shown a great promise in terms of faithfully learning a given data distribution and sampling from it . There has also been research on generating data sequentially ( Oord et al. , 2016 ; Chen et al. , 2020 ) even when the data has no natural order ( Vinyals et al. , 2015 ) . Many of these approaches often rely on low-level information ( Gupta et al. , 2020b ) such as pixels while generating images ( Brock et al. , 2018 ; Karras et al. , 2019 ) , videos ( Vondrick et al. , 2016 ) , or 3D objects ( Wu et al. , 2016 ; Yang et al. , 2019 ; Park et al. , 2019a ; Gupta et al. , 2020a ) and not on semantic and geometric structure in the data . Scene generation . Generating 2D or 3D scenes conditioned on sentence ( Li et al. , 2019d ; Zhang et al. , 2017 ; Reed et al. , 2016 ) , a scene graph ( Johnson et al. , 2018 ; Li et al. , 2019a ; Ashual & Wolf , 2019 ) , a layout ( Dong et al. , 2017 ; Hinz et al. , 2019 ; Isola et al. , 2016 ; Wang et al. , 2018b ) or an existing image ( Lee et al. , 2018 ) has drawn a great interest in vision community . Given the input , some works generate a fixed layout and diverse scenes ( Zhao et al. , 2019 ) , while other works generate diverse layouts and scenes ( Johnson et al. , 2018 ; Li et al. , 2019d ) . These methods involve pipelines often trained and evaluated end-to-end , and surprisingly little work has been done to evaluate the layout generation component itself . Layout generation serves as a complementary task to these works and can be combined with these methods . In this work , we evaluate the layout modeling Under review as a conference paper at ICLR 2021 Text capabilities of two of the recent works ( Johnson et al. , 2018 ; Li et al. , 2019d ) that have layout generation as an intermediate step . We also demonstrate the results of our model with Layout2Im ( Zhao et al. , 2019 ) for image generation . Layout generation . The automatic generation of layouts is an important problem in graphic design . Many of the recent data-driven approaches use data specific constraints in order to model the layouts . For example , Wang et al . ( 2018a ; 2019 ) ; Li et al . ( 2019c ) ; Ritchie et al . ( 2019 ) generates topdown view indoor rooms layouts but make several assumptions regarding the presence of walls , roof etc. , and can not be easily extended to other datasets . In this paper , we focus on approaches that have fewer domain-specific constraints . LayoutGAN ( Li et al. , 2019b ) uses a GAN framework to generate semantic and geometric properties of a fixed number of scene elements . LayoutVAE ( Jyothi et al. , 2019 ) starts with a label set , i.e. , categories of all the elements present in the layout , and then generates a feasible layout of the scene . Zheng et al . ( 2019 ) attempt to generate document layouts given the images , keywords , and category of the document . Patil et al . ( 2019 ) proposes a method to construct hierarchies of document layouts using a recursive variational autoencoder and sample new hierarchies to generate new document layouts . Manandhar et al . ( 2020 ) develops an auto-encoding framework for layouts using Graph Networks . 3D-PRNN ( Zou et al. , 2017 ) , PQNet ( Wu et al. , 2020 ) and ComplementMe Sung et al . ( 2017 ) , generates 3D shapes via sequential part assembly . While 3D-PRNN generates only bounding boxes , PQ-Net and ComplementMe can synthesize complete 3D shapes starting with a partial or no input shape . Our approach offers several advantages over current layout generation approaches without sacrificing their benefits . By factorizing primitives into structural parameters and compositional geometric parameters , we can generate high-resolution primitives using distributed representations and consequently , complete scenes . The autoregressive nature of the model allows us to generate layouts of arbitrary lengths as well as start with partial layouts . Further , modeling the position and size of primitives as discrete values ( as discussed in §3.1 ) helps us realize better performance on datasets , such as documents and app wireframes , where bounding boxes of layouts are typically axis-aligned . We evaluate our method both quantitatively and qualitatively with state-of-the-art methods specific to each dataset and show competitive results in very diverse domains .
This paper presents an auto-regressive method for generating layouts by sequentially synthesizing new elements. The architecture is not dramatically new, but it is well-justified and analyzed, and there are some interesting tweaks. The results are strongest in that they show good performance of essentially the same architecture and hyperpameters across quite different domains: to my knowledge such variety has not really been demonstrated for any of the assembly-based generative models I'm familiar with.
SP:821ad1017b8aa20f5b6bc3fcc56844ae87d983e2
SGD on Neural Networks learns Robust Features before Non-Robust
1 INTRODUCTION . Neural networks have achieved state of the art performance on tasks spanning an array of domains like computer vision , translation , speech recognition , robotics , and playing board games ( Krizhevsky et al . ( 2012 ) ; Vaswani et al . ( 2017 ) ; Graves et al . ( 2013 ) ; Silver et al . ( 2016 ) ) . However in recent years , their vulnerability to adversarial attacks - small , targeted input perturbations , has come under sharp focus ( Szegedy et al . ( 2013 ) ; Papernot et al . ( 2017 ) ; Carlini & Wagner ( 2017 ) ; Athalye et al . ( 2018 ) ; Schmidt et al . ( 2018 ) ) . Ilyas et al . ( 2019 ) propose that neural network vulnerability is at least partly due to neural networks learning well-generalizing but brittle features that are properties of the data distribution . From this point of view , an adversarial example would be constructed by modifying an input of one class slightly such that it takes on the non-robust features of another class . They provide empirical evidence for their theory by training a model on adversarially perturbed examples labeled as the target class , and showing that this model generalizes well to the original , unperturbed distribution . Another unrelated line of work ( Brutzkus et al . ( 2018 ) ; Ji & Telgarsky ( 2019 ) ; Li & Liang ( 2018 ) ) aims to study the properties of the functions learned by gradient descent over the course of training . Nakkiran et al . ( 2019 ) and Mangalam & Prabhu ( 2019 ) independently showed that Stochastic Gradient Descent ( SGD ) learns simple , almost linear functions to start out , but then learns more complex functions as training progresses . Li et al . ( 2019 ) showed that models trained with a low learning rate learn easy-to-generalize but hard-to-fit features first , and thus perform poorly on easy-to-fit patterns . In this paper , we study gradient descent on neural networks from the perspective of robust and nonrobust features . Our main thesis is that based on choices of hyperparameters , neural network training follows one of two pathways , : • Pathway 1 ( Informal ) : The neural network first learns predictive robust features and weakly predictive non-robust features . As training progresses , it learns predictive nonrobust features , and having learned both robust and non-robust predictive features , achieves good performance on held-out data . This is the pathway that Ilyas et al . ( 2019 ) used to prove their theory . • Pathway 2 ( Informal ) : The neural network learns predictive robust features and weakly predictive non-robust features ( as in Pathway 1 ) . But thereafter , it begins to fit the noise in the training set , and quickly achieves zero training error . In this scenario , the network learns only the robust predictive features and shows modest generalization on held-out data . Through a series of experiments , we validate our two-pathway hypothesis , investigate the specific circumstances under which Pathway 1 and Pathway 2 occur , and analyze some properties of the two pathways . We will also develop a closer understanding of the relationship between adversarial transfer and predictive non-robust features , which will aid our analysis of the two pathways . The rest of this paper is organized as follows . Section 2 sets up the notation and definitions we use . In Section 3 , we investigate the link between adversarial features and transferability . In Section 4 we provide empirical evidence for the two-pathway hypothesis and analyze some characteristics of each pathway . Section 5 presents a theoretical analysis of gradient descent on a toy linear model . We show that for different choices of initial parameters , the linear model exhibits properties of the first and second pathways . We digress to explore whether non-robust features can occur across datasets in Section 6 , and discuss future research directions in Section 7 . 2 DEFINITIONS AND PRELIMINARIES . Consider the binary classification setting , where D is a joint distribution over the input space X and the labels { −1 , 1 } 1 . In this setting , Ilyas et al . ( 2019 ) define a feature as any function f : X → R , scaled such that E ( x , y ) ∈D [ f ( x ) ] = 0 and E ( x , y ) ∈D [ f ( x ) 2 ] = 1 . A feature is said to be ρ-useful if E ( x , y ) ∈D [ y · f ( x ) ] > ρ ( 1 ) for some ρ > 0 , and γ-robust if E ( x , y ) ∈D [ inf δ∈∆ ( x ) y · f ( x+ δ ) ] > γ ( 2 ) 1This framework can easily be adapted to the multi-class setting for some γ > 0 and some family of perturbations ∆ . For brevity , we sometimes refer to a ρ-useful , γ-robust feature ( ρ , γ > 0 ) simply as a robust feature . Let ρD ( f ) be the largest ρ for which f is ρ-useful . A feature f is said to be ( highly ) predictive or weakly predictive if ρD ( f ) is high or low respectively . A useful , non-robust feature as defined by Ilyas et al . ( 2019 ) is one that is ρ-useful for some ρ > 0 , but is not γ-robust for any γ > 0 . They propose the following experiment to demonstrate the existence of these features . Let C be a classifier trained with Empirical Risk Minimization ( ERM ) on an empirical distribution D̂ . We operate under the following assumption . Assumption 1 . If a distribution D contains a useful feature , then a classifier C trained with ERM on an empirical distribution D̂ drawn from D will learn this feature , provided that we avoid finite sample overfitting through appropriate measures such as regularization and cross-validation . Let LC ( x , t ) denote the loss of C on input x , for a target label t. Construct adversarial examples by solving the following optimization problem : xadv = arg min ‖x−x′‖≤ LC ( x ′ , t ) ( 3 ) In particular , construct a distribution called D̂det comprised of ( xadv , t ) pairs by using Equation 3 with t chosen deterministically according to y for each ( x , y ) ∈ D̂ . In the binary classification setting , t must be −y , so E ( xadv , t ) ∈D̂det [ t · f ( xadv ) ] > 0 , if f is non-robustly useful under D ( 4 ) E ( xadv , t ) ∈D̂det [ −t · f ( xadv ) ] > 0 , if f is robustly useful under D ( 5 ) It is observed that a neural network trained on D̂det achieves non-trivial generalization to the original test set , that is D. From this , we can conclude that non-robust features exist and are useful for classification in the normal setting . Remark : Goh ( 2019b ) showed that the D̂rand dataset constructed by choosing t randomly in the above procedure , suffers from a sort of “ robust feature leakage ” . PGD introduces faint robust cues in the generated adversarial example that can be learned by the model . But on the Ddet dataset , the robust features are correlated with a deterministic label which is different from t. Hence we use the D̂det dataset in preference to the D̂rand for all our experiments . Two kinds of non-robust features : Goh ( 2019a ) points out a subtle flaw with the above definition of a non-robust feature - highly predictive non-robust features can arise from “ contamination ” of a robust feature with a non-robust feature , instead of something meaningful . To see how this can happen , consider a highly predictive robust feature fR and a weakly predictive non-robust feature fNR . Let fC be a “ contaminated ” feature that is a simple sum of fR and fNR ( appropriately normalized ) . Then it is possible to construct a scenario in which E [ y · fR ( x ) ] > 0 E [ inf δ∈∆ ( x ) y · fR ( x+ δ ) ] > 0 ( 6 ) E [ y · fNR ( x ) ] & 0 E [ inf δ∈∆ ( x ) y · fNR ( x+ δ ) ] 0 ( 7 ) E [ y · fC ( x ) ] > 0 E [ inf δ∈∆ ( x ) y · fC ( x+ δ ) ] < 0 ( 8 ) fC is thus a highly predictive non-robust feature . Now when you train a model on ( x + δ , −y ) pairs , fC = fR + fNR is still correlated with −y . But fC′ = −fR + fNR is more correlated , so the model will learn this combination in preference to fC and will not generalize on the original distribution . In fact , thanks to learning−fR , it will generalize to the distribution with flipped labels , i.e. , y → −y . In our analysis and experiments , when we refer to non-robust features , we will exclude such contaminated features . Illustrative Example : Consider a dataset of dog and cat images , where most dog images have snouts and most cats do not have snouts . Most cats have slightly lighter eyes than dogs , and making the eyes slightly darker or lighter is part of the set of valid adversarial perturbations . Suppose that a very small majority of the dog images start with a pixel that has an odd numbered value . Then the different types of features in this dataset are enumerated in Table 1 . For f2 , ( x + δ , −y ) pairs would be dogs with lighter eyes , labeled as cats . The network trained on these examples will learn Snout =⇒ Cat , Light Eyes =⇒ Cat . Since the eye-color is predictive of the true label , the second feature will ensure that the neural network has non-trivial performance on the original distribution . This is what Ilyas et al . ( 2019 ) observed in their experiments . f2 is thus a true non-robust feature . For f4 , ( x+δ , −y ) pairs would be dog images with the first pixel value converted to an even number , labeled as cats . The network trained on these examples will learn Snout =⇒ Cat , Dark Eyes =⇒ Cat , and Even Pixel =⇒ Cat . None of these will be particularly helpful on the true distribution , but the first two will be useful on the flipped distribution , i.e. , where dogs are relabeled as cats . f4 is thus a contaminated robust feature , and not a non-robust feature . Remark : A network that learns only robust features but with contaminants can still be very vulnerable to adversarial attacks , as the above example shows . The weakly predictive non-robust feature f3 can be manipulated to consistently cause misclassification on out-of-distribution inputs . 3 NON-ROBUST FEATURES AND TRANSFERABILITY . The phenomenon of adversarial transferability ( Papernot et al. , 2016 ) , where a non-trivial fraction of the adversarial examples generated for one neural network are still adversarial to other neural networks trained independently on the same data , can be readily explained in terms of non-robust features . By Assumption 1 , different neural networks trained using ERM on a distribution would learn the predictive non-robust features ( like Dark Eyes =⇒ Dog ) present in the distribution . One would then construct an adversarial example by modifying an input such that the predictive non-robust features flip ( modify all dog images to have lighter eyes ) . Then this adversarial example would transfer to all the different networks that have learned to rely on the non-robust features . A natural question to ask is , does all adversarial transferability arise from predictive non-robust features ? Nakkiran ( 2019 ) showed that by explicitly penalizing transferability during PGD , one can construct adversarial examples that do not transfer , and from which it is not possible to learn a generalizing model . This establishes that adversarial examples that do not transfer , do not contain predictive non-robust features . Here we provide a simpler experiment that constructs non-transferable adversarial examples without explicitly penalizing transferability . This experiment also establishes a stronger claim , that adversarial examples transfer if and only if they exploit predictive non-robust features . Let the CIFAR-10 dataset form the data distributionD . Train two Resnet50 models ( He et al. , 2016 ) on D̂ and ensure by Assumption 1 that both networks have learned the predictive non-robust features of the distribution by using regularization and cross-validation across a grid of hyperparameters . Construct a D̂det dataset for the first network using Equation 3 where t is chosen deterministically according to y using the transformation t = ( y+1 ) % 10 . We use Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) to solve the optimization problem in Equation 3 . Split the adversarial examples into two categories - those that transfer to the second network with their target labels , and those that do not . Relabel all adversarial examples xadv with their target label t , and train a Resnet50 model on ( xadv , t ) pairs from each category . As Equations 4 and 5 suggest , for ( xadv , t ) ∼ D̂det , the non-robust features ofD are predictive of t , but the robust features of D are predictive of ( t− 1 ) % 10 . So if a neural network trained on a subset of D̂det learns predictive nonrobust features , it will generalize to D , and if it learns predictive robust features , it will generalize to the shifted distribution Dshift : Dshift = { ( x , ( y + 1 ) % 10 ) : ( x , y ) ∼ D } ( 9 ) Figure 2 shows the performance of these two networks on D and Dshift . We can see that the network trained on the examples that transfer generalizes well to D , but the network trained on the examples that do not transfer generalizes to Dshift . The configuration in the figure is as a result of a thorough grid search over hyperparameters with the metric for success being performance on D. Along with Assumption 1 , our experiment establishes that the examples that transfer contain predictive non-robust features , and the examples that don ’ t transfer don ’ t contain predictive non-robust features . In particular , we claim the following : Claim 1 . Train two networks N1 and N2 on a common dataset such that both networks learn the predictive non-robust features present in the dataset . Then an adversarial example generated forN1 transfers to the second network if and only if this example contains predictive non-robust features . Further , if a neural network C has learned predictive non-robust features , then PGD will construct some adversarial examples with predictive non-robust features ( see Equation 4 ) , and vice-versa . This allows us to infer the following property , which we will use in our analysis in the next section : Claim 2 . If a neural network N2 has learned the predictive non-robust features in a dataset , then adversarial examples generated for another network N1 using PGD will transfer to N2 if and only if N1 has also learned predictive non-robust features .
This work studies the learning dynamics of neural networks in terms of robust and non-robust features. In particular, the authors argue that depending on various factors (e.g. learning rate, data augmentation), neural networks will have learning dynamics according to 1 of 2 pathways. Neural networks will either (1) first learn predictive robust features and weakly predictive non-robust features, followed by predictive non-robust features; or (2) only learn robust features, then overfit the training set, thereby not learning non-robust features. The paper has a good discussion expanding upon the robust/non-robust features model of Ilyas et. al. 2019, interesting experiments measuring what features the models is learning, and a digression that presents further results on non-robust features in different datasets.
SP:f26a952abe712256ad3046d86187c08c6eb2e395
SGD on Neural Networks learns Robust Features before Non-Robust
1 INTRODUCTION . Neural networks have achieved state of the art performance on tasks spanning an array of domains like computer vision , translation , speech recognition , robotics , and playing board games ( Krizhevsky et al . ( 2012 ) ; Vaswani et al . ( 2017 ) ; Graves et al . ( 2013 ) ; Silver et al . ( 2016 ) ) . However in recent years , their vulnerability to adversarial attacks - small , targeted input perturbations , has come under sharp focus ( Szegedy et al . ( 2013 ) ; Papernot et al . ( 2017 ) ; Carlini & Wagner ( 2017 ) ; Athalye et al . ( 2018 ) ; Schmidt et al . ( 2018 ) ) . Ilyas et al . ( 2019 ) propose that neural network vulnerability is at least partly due to neural networks learning well-generalizing but brittle features that are properties of the data distribution . From this point of view , an adversarial example would be constructed by modifying an input of one class slightly such that it takes on the non-robust features of another class . They provide empirical evidence for their theory by training a model on adversarially perturbed examples labeled as the target class , and showing that this model generalizes well to the original , unperturbed distribution . Another unrelated line of work ( Brutzkus et al . ( 2018 ) ; Ji & Telgarsky ( 2019 ) ; Li & Liang ( 2018 ) ) aims to study the properties of the functions learned by gradient descent over the course of training . Nakkiran et al . ( 2019 ) and Mangalam & Prabhu ( 2019 ) independently showed that Stochastic Gradient Descent ( SGD ) learns simple , almost linear functions to start out , but then learns more complex functions as training progresses . Li et al . ( 2019 ) showed that models trained with a low learning rate learn easy-to-generalize but hard-to-fit features first , and thus perform poorly on easy-to-fit patterns . In this paper , we study gradient descent on neural networks from the perspective of robust and nonrobust features . Our main thesis is that based on choices of hyperparameters , neural network training follows one of two pathways , : • Pathway 1 ( Informal ) : The neural network first learns predictive robust features and weakly predictive non-robust features . As training progresses , it learns predictive nonrobust features , and having learned both robust and non-robust predictive features , achieves good performance on held-out data . This is the pathway that Ilyas et al . ( 2019 ) used to prove their theory . • Pathway 2 ( Informal ) : The neural network learns predictive robust features and weakly predictive non-robust features ( as in Pathway 1 ) . But thereafter , it begins to fit the noise in the training set , and quickly achieves zero training error . In this scenario , the network learns only the robust predictive features and shows modest generalization on held-out data . Through a series of experiments , we validate our two-pathway hypothesis , investigate the specific circumstances under which Pathway 1 and Pathway 2 occur , and analyze some properties of the two pathways . We will also develop a closer understanding of the relationship between adversarial transfer and predictive non-robust features , which will aid our analysis of the two pathways . The rest of this paper is organized as follows . Section 2 sets up the notation and definitions we use . In Section 3 , we investigate the link between adversarial features and transferability . In Section 4 we provide empirical evidence for the two-pathway hypothesis and analyze some characteristics of each pathway . Section 5 presents a theoretical analysis of gradient descent on a toy linear model . We show that for different choices of initial parameters , the linear model exhibits properties of the first and second pathways . We digress to explore whether non-robust features can occur across datasets in Section 6 , and discuss future research directions in Section 7 . 2 DEFINITIONS AND PRELIMINARIES . Consider the binary classification setting , where D is a joint distribution over the input space X and the labels { −1 , 1 } 1 . In this setting , Ilyas et al . ( 2019 ) define a feature as any function f : X → R , scaled such that E ( x , y ) ∈D [ f ( x ) ] = 0 and E ( x , y ) ∈D [ f ( x ) 2 ] = 1 . A feature is said to be ρ-useful if E ( x , y ) ∈D [ y · f ( x ) ] > ρ ( 1 ) for some ρ > 0 , and γ-robust if E ( x , y ) ∈D [ inf δ∈∆ ( x ) y · f ( x+ δ ) ] > γ ( 2 ) 1This framework can easily be adapted to the multi-class setting for some γ > 0 and some family of perturbations ∆ . For brevity , we sometimes refer to a ρ-useful , γ-robust feature ( ρ , γ > 0 ) simply as a robust feature . Let ρD ( f ) be the largest ρ for which f is ρ-useful . A feature f is said to be ( highly ) predictive or weakly predictive if ρD ( f ) is high or low respectively . A useful , non-robust feature as defined by Ilyas et al . ( 2019 ) is one that is ρ-useful for some ρ > 0 , but is not γ-robust for any γ > 0 . They propose the following experiment to demonstrate the existence of these features . Let C be a classifier trained with Empirical Risk Minimization ( ERM ) on an empirical distribution D̂ . We operate under the following assumption . Assumption 1 . If a distribution D contains a useful feature , then a classifier C trained with ERM on an empirical distribution D̂ drawn from D will learn this feature , provided that we avoid finite sample overfitting through appropriate measures such as regularization and cross-validation . Let LC ( x , t ) denote the loss of C on input x , for a target label t. Construct adversarial examples by solving the following optimization problem : xadv = arg min ‖x−x′‖≤ LC ( x ′ , t ) ( 3 ) In particular , construct a distribution called D̂det comprised of ( xadv , t ) pairs by using Equation 3 with t chosen deterministically according to y for each ( x , y ) ∈ D̂ . In the binary classification setting , t must be −y , so E ( xadv , t ) ∈D̂det [ t · f ( xadv ) ] > 0 , if f is non-robustly useful under D ( 4 ) E ( xadv , t ) ∈D̂det [ −t · f ( xadv ) ] > 0 , if f is robustly useful under D ( 5 ) It is observed that a neural network trained on D̂det achieves non-trivial generalization to the original test set , that is D. From this , we can conclude that non-robust features exist and are useful for classification in the normal setting . Remark : Goh ( 2019b ) showed that the D̂rand dataset constructed by choosing t randomly in the above procedure , suffers from a sort of “ robust feature leakage ” . PGD introduces faint robust cues in the generated adversarial example that can be learned by the model . But on the Ddet dataset , the robust features are correlated with a deterministic label which is different from t. Hence we use the D̂det dataset in preference to the D̂rand for all our experiments . Two kinds of non-robust features : Goh ( 2019a ) points out a subtle flaw with the above definition of a non-robust feature - highly predictive non-robust features can arise from “ contamination ” of a robust feature with a non-robust feature , instead of something meaningful . To see how this can happen , consider a highly predictive robust feature fR and a weakly predictive non-robust feature fNR . Let fC be a “ contaminated ” feature that is a simple sum of fR and fNR ( appropriately normalized ) . Then it is possible to construct a scenario in which E [ y · fR ( x ) ] > 0 E [ inf δ∈∆ ( x ) y · fR ( x+ δ ) ] > 0 ( 6 ) E [ y · fNR ( x ) ] & 0 E [ inf δ∈∆ ( x ) y · fNR ( x+ δ ) ] 0 ( 7 ) E [ y · fC ( x ) ] > 0 E [ inf δ∈∆ ( x ) y · fC ( x+ δ ) ] < 0 ( 8 ) fC is thus a highly predictive non-robust feature . Now when you train a model on ( x + δ , −y ) pairs , fC = fR + fNR is still correlated with −y . But fC′ = −fR + fNR is more correlated , so the model will learn this combination in preference to fC and will not generalize on the original distribution . In fact , thanks to learning−fR , it will generalize to the distribution with flipped labels , i.e. , y → −y . In our analysis and experiments , when we refer to non-robust features , we will exclude such contaminated features . Illustrative Example : Consider a dataset of dog and cat images , where most dog images have snouts and most cats do not have snouts . Most cats have slightly lighter eyes than dogs , and making the eyes slightly darker or lighter is part of the set of valid adversarial perturbations . Suppose that a very small majority of the dog images start with a pixel that has an odd numbered value . Then the different types of features in this dataset are enumerated in Table 1 . For f2 , ( x + δ , −y ) pairs would be dogs with lighter eyes , labeled as cats . The network trained on these examples will learn Snout =⇒ Cat , Light Eyes =⇒ Cat . Since the eye-color is predictive of the true label , the second feature will ensure that the neural network has non-trivial performance on the original distribution . This is what Ilyas et al . ( 2019 ) observed in their experiments . f2 is thus a true non-robust feature . For f4 , ( x+δ , −y ) pairs would be dog images with the first pixel value converted to an even number , labeled as cats . The network trained on these examples will learn Snout =⇒ Cat , Dark Eyes =⇒ Cat , and Even Pixel =⇒ Cat . None of these will be particularly helpful on the true distribution , but the first two will be useful on the flipped distribution , i.e. , where dogs are relabeled as cats . f4 is thus a contaminated robust feature , and not a non-robust feature . Remark : A network that learns only robust features but with contaminants can still be very vulnerable to adversarial attacks , as the above example shows . The weakly predictive non-robust feature f3 can be manipulated to consistently cause misclassification on out-of-distribution inputs . 3 NON-ROBUST FEATURES AND TRANSFERABILITY . The phenomenon of adversarial transferability ( Papernot et al. , 2016 ) , where a non-trivial fraction of the adversarial examples generated for one neural network are still adversarial to other neural networks trained independently on the same data , can be readily explained in terms of non-robust features . By Assumption 1 , different neural networks trained using ERM on a distribution would learn the predictive non-robust features ( like Dark Eyes =⇒ Dog ) present in the distribution . One would then construct an adversarial example by modifying an input such that the predictive non-robust features flip ( modify all dog images to have lighter eyes ) . Then this adversarial example would transfer to all the different networks that have learned to rely on the non-robust features . A natural question to ask is , does all adversarial transferability arise from predictive non-robust features ? Nakkiran ( 2019 ) showed that by explicitly penalizing transferability during PGD , one can construct adversarial examples that do not transfer , and from which it is not possible to learn a generalizing model . This establishes that adversarial examples that do not transfer , do not contain predictive non-robust features . Here we provide a simpler experiment that constructs non-transferable adversarial examples without explicitly penalizing transferability . This experiment also establishes a stronger claim , that adversarial examples transfer if and only if they exploit predictive non-robust features . Let the CIFAR-10 dataset form the data distributionD . Train two Resnet50 models ( He et al. , 2016 ) on D̂ and ensure by Assumption 1 that both networks have learned the predictive non-robust features of the distribution by using regularization and cross-validation across a grid of hyperparameters . Construct a D̂det dataset for the first network using Equation 3 where t is chosen deterministically according to y using the transformation t = ( y+1 ) % 10 . We use Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) to solve the optimization problem in Equation 3 . Split the adversarial examples into two categories - those that transfer to the second network with their target labels , and those that do not . Relabel all adversarial examples xadv with their target label t , and train a Resnet50 model on ( xadv , t ) pairs from each category . As Equations 4 and 5 suggest , for ( xadv , t ) ∼ D̂det , the non-robust features ofD are predictive of t , but the robust features of D are predictive of ( t− 1 ) % 10 . So if a neural network trained on a subset of D̂det learns predictive nonrobust features , it will generalize to D , and if it learns predictive robust features , it will generalize to the shifted distribution Dshift : Dshift = { ( x , ( y + 1 ) % 10 ) : ( x , y ) ∼ D } ( 9 ) Figure 2 shows the performance of these two networks on D and Dshift . We can see that the network trained on the examples that transfer generalizes well to D , but the network trained on the examples that do not transfer generalizes to Dshift . The configuration in the figure is as a result of a thorough grid search over hyperparameters with the metric for success being performance on D. Along with Assumption 1 , our experiment establishes that the examples that transfer contain predictive non-robust features , and the examples that don ’ t transfer don ’ t contain predictive non-robust features . In particular , we claim the following : Claim 1 . Train two networks N1 and N2 on a common dataset such that both networks learn the predictive non-robust features present in the dataset . Then an adversarial example generated forN1 transfers to the second network if and only if this example contains predictive non-robust features . Further , if a neural network C has learned predictive non-robust features , then PGD will construct some adversarial examples with predictive non-robust features ( see Equation 4 ) , and vice-versa . This allows us to infer the following property , which we will use in our analysis in the next section : Claim 2 . If a neural network N2 has learned the predictive non-robust features in a dataset , then adversarial examples generated for another network N1 using PGD will transfer to N2 if and only if N1 has also learned predictive non-robust features .
The paper posits some phenomena on neural network training: 1. With some proper regularizing effect, NN training tends to learn predictive robust features (and weakly predictive non-robust features) first and non-robust features next. 2. Without regularization, NN training does a similar thing as case 1 first but does not learn predictive non-robust features and overfits the training examples.
SP:f26a952abe712256ad3046d86187c08c6eb2e395
Neural Bayes: A Generic Parameterization Method for Unsupervised Learning
1 INTRODUCTION . We introduce a generic parameterization called Neural Bayes that facilitates unsupervised learning from unlabeled data by categorizing them . Specifically , our parameterization implicitly maps samples from an observed random variable x to a latent discrete space z where the distribution p ( x ) gets segmented into a finite number of arbitrary conditional distributions . Imposing different conditions on the latent space z through different objective functions will result in learning qualitatively different representations . Our parameterization may be used to compute statistical quantities involving observed variables and latent variables that are in general difficult to compute ( thanks to the discrete latent space ) , thus providing a flexible framework for unsupervised learning . To illustrate this aspect , we develop two independent use cases for this parameterization– disjoint manifold separation ( DMS ) and mutual information maximization ( Linsker , 1988 ) , as described in the abstract . For the manifold separation task , we show experiments on 2D datasets and their high-dimensional counter-parts designed as per the problem formulation , and show that the proposed objective can optimally label disjoint manifolds . For the MIM task , we experiment with benchmark image datasets and show that the unsupervised representation learned by the network achieves performance on downstream classification tasks comparable with a closely related MIM method Deep InfoMax ( DIM , ( Hjelm et al. , 2019 ) ) . For both objectives we design regularizations necessary to achieve the desired behavior in practice . All the proofs can be found in the appendix . 2 RELATED WORK . Neural Bayes-DMS : Numerous recent papers have proposed clustering algorithm for unsupervised representation learning such as Deep Clustering ( Caron et al. , 2018 ) , information based clustering ( Ji et al. , 2019 ) , Spectral Clustering ( Shaham et al. , 2018 ) , Assosiative Deep Clustering ( Haeusser et al. , 2018 ) etc . Our goal in regards to clustering in Neural Bayes-DMS is in general different from such methods . Our objective is aimed at finding disjoint manifolds in the support of a distribution . It is therefore a generalization of traditional subspace clustering methods ( where the goal is to find disjoint affine subspaces ) ( Ma et al. , 2008 ; Liu et al. , 2010 ) , to arbitrary manifolds . Another class of clustering algorithms include mixture models ( such as kNNs ) . Our clustering proposal ( DMS ) is novel compared to this class in two ways : 1. we formulate the clustering problem as that of identifying disjoint manifold in the support of a distribution . This is different from assuming K ground truth clusters , where the notion of cluster is ill-defined ; 2. the DMS objective in proposition 1 is itself novel and we prove its optimality towards labeling disjoint manifolds in theorem 1 . Neural Bayes-MIM : Self-supervised representation learning has attracted a lot of attention in recent years . Currently contrastive learning methods and similar variants ( such as MoCo ( He et al. , 2020 ) , SimCLR ( Chen et al. , 2020 ) , BYOL Grill et al . ( 2020 ) ) produce state-of-the-art ( SOTA ) performance on downstream classification tasks . These methods make use of handcrafted image augmentation methods that exploit priors such as class information is typically associated with object shape and is location invariant . However , since we specifically develop an easier alternative to DIM ( which also maximizes the mutual information between the input and the latent representations ) , for a fair comparison , we compare the performance of our Neural Bayes-MIM algorithm for representation learning only with DIM . We leave the extension of Neural Bayes MIM algorithm with data augmentation techniques and other advanced regularizations similar to Bachman et al . ( 2019 ) as future work . Our experiments show that our proposal performs comparably or slightly better compared with DIM . The main advantage of our proposal over DIM is that it offers a closed form estimation of MI due to discrete latent variables . We note that the principle of mutual information maximization for representation learning was introduced in Linsker ( 1988 ) and Bell & Sejnowski ( 1995 ) , and since then , a number of self-supervised methods involving MIM have been proposed . Vincent et al . ( 2010 ) showed that auto-encoder based methods achieve this goal implicitly by minimizing the reconstruction error of the input samples under isotropic Gaussian assumption . Deep infomax ( DIM , Hjelm et al . ( 2019 ) ) uses estimators like MINE Belghazi et al . ( 2018 ) and noise-contrastive estimation ( NCE , Gutmann & Hyvärinen ( 2010 ) ) to estimate MI and maximize it for both both local and global features in convolutional networks . Contrastive Predictive Coding ( Oord et al. , 2018 ) is another approach that maximizes MI by predicting the activations of a layer from the layer above using NCE . We also point out that the estimation of mutual information due to Neural Bayes parameterization in the Neural Bayes-MIM-v1 objective ( Eq 8 ) turns out to be identical to the one proposed in IMSAT ( Hu et al. , 2017 ) . However , there are important differences : 1. we introduce regularizations which significantly improve the performance of representations on downstream tasks compared to IMSAT ( cf table 3 in ( Hu et al. , 2017 ) ) ; 2. we provide theoretical justifications for the parameterization used ( lemma 1 ) and show in theorem 2 why it is feasible to compute high fidelity gradients using this objective in the mini-batch setting even though it contains the term Ex [ Lk ( x ) ] . On the other hand , the justification used in IMSAT is that optimizing using mini-batches is equivalent to optimizing an upper bound of the original objective ; 3. we perform extensive ablation studies exposing the importance of the introduced regularizations . 3 NEURAL BAYES . Consider a data distribution p ( x ) from which we have access to i.i.d . samples x ∈ Rn . We assume that this marginal distribution is a union of K conditionals where the kth conditional ’ s density is denoted by p ( x|z = k ) ∈ R+ and the corresponding probability mass denoted by p ( z = k ) ∈ R+ . Here z is a discrete random variable with K states . We now introduce the parameterization that allows us to implicitly factorize any marginal distribution into conditionals as described above . Aside from the technical details , the key idea behind this parameterization is the Bayes ’ rule . Lemma 1 . Let p ( x|z = k ) and p ( z ) be any conditional and marginal distribution defined for continuous random variable x and discrete random variable z . If Ex∼p ( x ) [ Lk ( x ) ] 6= 0 ∀k ∈ [ K ] , then there exists a non-parametric function L ( x ) : Rn → R+K for any given input x ∈ Rn with the property ∑K k=1 Lk ( x ) = 1 ∀x such that , p ( x|z = k ) = Lk ( x ) · p ( x ) Ex∼p ( x ) [ Lk ( x ) ] , p ( z = k ) = Ex [ Lk ( x ) ] , p ( z = k|x ) = Lk ( x ) ( 1 ) Thus the function L can be seen as a form of soft categorization of input samples . In practice , we use a neural network with sufficient capacity and softmax output to realize this function L. We name our parameterization method Neural Bayes and replace L with Lθ to denote the parameters of the network . By imposing different conditions on the structure of z by formulating meaningful objectives , we will get qualitatively different kinds of factorization of the marginal p ( x ) , and therefore the function Lθ will encode the posterior for that factorization . In summary , if one formulates any objective that involves the terms p ( x|z ) , p ( z ) or p ( z|x ) , where x is an observed random variable and z is a discrete latent random variable , then they can be substituted with Lk ( x ) ·p ( x ) Ex [ Lk ( x ) ] , Ex [ Lk ( x ) ] and Lk ( x ) respectively . On an important note , Neural Bayes parameterization requires using the term Ex [ Lk ( x ) ] , through which computing gradient is infeasible in general . A general discussion around this can be found in the appendix D. Nonetheless , we show that mini-batch gradients can have good fidelity for one of the objectives we propose using our parameterization . In the next two sections , we explore two different ways of factorizing p ( x ) resulting in qualitatively different goals of unsupervised representation learning . 4 DISJOINT MANIFOLD SEPARATION ( DMS ) . In many cases , the support of a distribution may be a set of disjoint manifolds . In this task , our goal is to label samples from each disjoint manifold with a distinct value . This formulation can be seen as a generalization of subspace clustering ( Ma et al. , 2008 ) where the goal is to identify disjoint affine subspaces . To make the problem concrete , we first formalize the definition of a disjoint manifold . Definition 1 . ( Connected Set ) We say that a set S ⊂ Rn is a connected set ( disjoint manifold ) if for any x , y ∈ S , there exists a continuous path between x and y such that all the points on the path also belong to S. To identify such disjoint manifolds in a distribution , we exploit the observation that only partitions that separate one disjoint manifold from others have high divergence between the respective conditional distributions while partitions that cut through a disjoint manifold result in conditional distributions with low divergence between them . Therefore , the objective we propose for this task is to partition the unlabeled data distribution p ( x ) into conditional distributions qi ( x ) ’ s such that a divergence between them is maximized . By doing so we recover the conditional distributions defined over the disjoint manifolds ( we prove its optimality in theorem 1 ) . We begin with two disjoint manifolds and extend this idea to multiple disjoint manifolds in the appendix B . Let J be a symmetric divergence ( Eg . Jensen-Shannon divergence , Wasserstein divergence , etc ) , and q0 and q1 be the disjoint conditional distributions that we want to learn . Then the aforementioned objective can be written formally as follows : max q0 , q1 π∈ ( 0,1 ) J ( q0 ( x ) ||q1 ( x ) ) ( 2 ) s.t . ∫ x q0 ( x ) = 1 , ∫ x q1 ( x ) = 1 , q1 ( x ) · π + q0 ( x ) · ( 1− π ) = p ( x ) . Since our goal is to simply assign labels to data samples x corresponding to which manifold they belong instead of learning conditional distributions as achieved by Eq . ( 2 ) , we would like to learn a function L ( x ) which maps samples from disjoint manifolds to distinct labels . To do so , below we derive an objective equivalent to Eq . ( 2 ) that learns such a function L ( x ) . Proposition 1 . ( Neural Bayes-DMS ) Let L ( x ) : Rn → [ 0 , 1 ] be a non-parametric function for any given input x ∈ Rn , and let J be the Jensen-Shannon divergence . Define scalars f1 ( x ) : = L ( x ) Ex [ L ( x ) ] and f0 ( x ) : = 1−L ( x ) 1−Ex [ L ( x ) ] . Then the objective in Eq . ( 2 ) is equivalent to , max L 1 2 · Ex [ f1 ( x ) · log ( f1 ( x ) f1 ( x ) + f0 ( x ) ) ] + 1 2 · Ex [ f0 ( x ) · log ( f0 ( x ) f1 ( x ) + f0 ( x ) ) ] + log 2 s.t . Ex [ L ( x ) ] /∈ { 0 , 1 } . ( 3 ) Optimality : We now prove the optimality of the proposed objective towards discovering disjoint manifolds present in the support of a probability density function p ( x ) . Theorem 1 . ( optimality ) Let p ( x ) be a probability density function over Rn whose support is the union of two non-empty connected sets ( definition 1 ) S1 and S2 that are disjoint , i.e . S1 ∩ S2 = ∅ . Let L ( x ) ∈ [ 0 , 1 ] belong to the class of continuous functions which is learned by solving the objective in Eq . ( 3 ) . Then the objective in Eq . ( 3 ) is maximized if and only if one of the following is true : L ( x ) = { 0 ∀x ∈ S1 1 ∀x ∈ S2 or L ( x ) = { 1 ∀x ∈ S1 0 ∀x ∈ S2 . The above theorem proves that optimizing the derived objective over the space of functions L implicitly partitions the data distribution into maximally separated conditionals by assigning a distinct label to points in each manifold . Most importantly , the theorem shows that the continuity condition on the function L ( x ) plays an important role . Without this condition , the network can not identify disjoint manifolds . Extension to multiple disjoint manifold case can be found in section B in appendix .
The paper introduces a new function $L(x)$ so that, when optimised under certain objectives defined over continuous observation $x$ and discrete latent $z$, learns the correct clustering probability $p(z|x)$. The loss functions considered are the Jensen-Fisher divergence and muture information. The authors introduces modifications to the principled objectives in practice and demonstrate performance on toy and real image datasets.
SP:5b4768c8d71e9b044c50d77fb68d545370ca8329
Neural Bayes: A Generic Parameterization Method for Unsupervised Learning
1 INTRODUCTION . We introduce a generic parameterization called Neural Bayes that facilitates unsupervised learning from unlabeled data by categorizing them . Specifically , our parameterization implicitly maps samples from an observed random variable x to a latent discrete space z where the distribution p ( x ) gets segmented into a finite number of arbitrary conditional distributions . Imposing different conditions on the latent space z through different objective functions will result in learning qualitatively different representations . Our parameterization may be used to compute statistical quantities involving observed variables and latent variables that are in general difficult to compute ( thanks to the discrete latent space ) , thus providing a flexible framework for unsupervised learning . To illustrate this aspect , we develop two independent use cases for this parameterization– disjoint manifold separation ( DMS ) and mutual information maximization ( Linsker , 1988 ) , as described in the abstract . For the manifold separation task , we show experiments on 2D datasets and their high-dimensional counter-parts designed as per the problem formulation , and show that the proposed objective can optimally label disjoint manifolds . For the MIM task , we experiment with benchmark image datasets and show that the unsupervised representation learned by the network achieves performance on downstream classification tasks comparable with a closely related MIM method Deep InfoMax ( DIM , ( Hjelm et al. , 2019 ) ) . For both objectives we design regularizations necessary to achieve the desired behavior in practice . All the proofs can be found in the appendix . 2 RELATED WORK . Neural Bayes-DMS : Numerous recent papers have proposed clustering algorithm for unsupervised representation learning such as Deep Clustering ( Caron et al. , 2018 ) , information based clustering ( Ji et al. , 2019 ) , Spectral Clustering ( Shaham et al. , 2018 ) , Assosiative Deep Clustering ( Haeusser et al. , 2018 ) etc . Our goal in regards to clustering in Neural Bayes-DMS is in general different from such methods . Our objective is aimed at finding disjoint manifolds in the support of a distribution . It is therefore a generalization of traditional subspace clustering methods ( where the goal is to find disjoint affine subspaces ) ( Ma et al. , 2008 ; Liu et al. , 2010 ) , to arbitrary manifolds . Another class of clustering algorithms include mixture models ( such as kNNs ) . Our clustering proposal ( DMS ) is novel compared to this class in two ways : 1. we formulate the clustering problem as that of identifying disjoint manifold in the support of a distribution . This is different from assuming K ground truth clusters , where the notion of cluster is ill-defined ; 2. the DMS objective in proposition 1 is itself novel and we prove its optimality towards labeling disjoint manifolds in theorem 1 . Neural Bayes-MIM : Self-supervised representation learning has attracted a lot of attention in recent years . Currently contrastive learning methods and similar variants ( such as MoCo ( He et al. , 2020 ) , SimCLR ( Chen et al. , 2020 ) , BYOL Grill et al . ( 2020 ) ) produce state-of-the-art ( SOTA ) performance on downstream classification tasks . These methods make use of handcrafted image augmentation methods that exploit priors such as class information is typically associated with object shape and is location invariant . However , since we specifically develop an easier alternative to DIM ( which also maximizes the mutual information between the input and the latent representations ) , for a fair comparison , we compare the performance of our Neural Bayes-MIM algorithm for representation learning only with DIM . We leave the extension of Neural Bayes MIM algorithm with data augmentation techniques and other advanced regularizations similar to Bachman et al . ( 2019 ) as future work . Our experiments show that our proposal performs comparably or slightly better compared with DIM . The main advantage of our proposal over DIM is that it offers a closed form estimation of MI due to discrete latent variables . We note that the principle of mutual information maximization for representation learning was introduced in Linsker ( 1988 ) and Bell & Sejnowski ( 1995 ) , and since then , a number of self-supervised methods involving MIM have been proposed . Vincent et al . ( 2010 ) showed that auto-encoder based methods achieve this goal implicitly by minimizing the reconstruction error of the input samples under isotropic Gaussian assumption . Deep infomax ( DIM , Hjelm et al . ( 2019 ) ) uses estimators like MINE Belghazi et al . ( 2018 ) and noise-contrastive estimation ( NCE , Gutmann & Hyvärinen ( 2010 ) ) to estimate MI and maximize it for both both local and global features in convolutional networks . Contrastive Predictive Coding ( Oord et al. , 2018 ) is another approach that maximizes MI by predicting the activations of a layer from the layer above using NCE . We also point out that the estimation of mutual information due to Neural Bayes parameterization in the Neural Bayes-MIM-v1 objective ( Eq 8 ) turns out to be identical to the one proposed in IMSAT ( Hu et al. , 2017 ) . However , there are important differences : 1. we introduce regularizations which significantly improve the performance of representations on downstream tasks compared to IMSAT ( cf table 3 in ( Hu et al. , 2017 ) ) ; 2. we provide theoretical justifications for the parameterization used ( lemma 1 ) and show in theorem 2 why it is feasible to compute high fidelity gradients using this objective in the mini-batch setting even though it contains the term Ex [ Lk ( x ) ] . On the other hand , the justification used in IMSAT is that optimizing using mini-batches is equivalent to optimizing an upper bound of the original objective ; 3. we perform extensive ablation studies exposing the importance of the introduced regularizations . 3 NEURAL BAYES . Consider a data distribution p ( x ) from which we have access to i.i.d . samples x ∈ Rn . We assume that this marginal distribution is a union of K conditionals where the kth conditional ’ s density is denoted by p ( x|z = k ) ∈ R+ and the corresponding probability mass denoted by p ( z = k ) ∈ R+ . Here z is a discrete random variable with K states . We now introduce the parameterization that allows us to implicitly factorize any marginal distribution into conditionals as described above . Aside from the technical details , the key idea behind this parameterization is the Bayes ’ rule . Lemma 1 . Let p ( x|z = k ) and p ( z ) be any conditional and marginal distribution defined for continuous random variable x and discrete random variable z . If Ex∼p ( x ) [ Lk ( x ) ] 6= 0 ∀k ∈ [ K ] , then there exists a non-parametric function L ( x ) : Rn → R+K for any given input x ∈ Rn with the property ∑K k=1 Lk ( x ) = 1 ∀x such that , p ( x|z = k ) = Lk ( x ) · p ( x ) Ex∼p ( x ) [ Lk ( x ) ] , p ( z = k ) = Ex [ Lk ( x ) ] , p ( z = k|x ) = Lk ( x ) ( 1 ) Thus the function L can be seen as a form of soft categorization of input samples . In practice , we use a neural network with sufficient capacity and softmax output to realize this function L. We name our parameterization method Neural Bayes and replace L with Lθ to denote the parameters of the network . By imposing different conditions on the structure of z by formulating meaningful objectives , we will get qualitatively different kinds of factorization of the marginal p ( x ) , and therefore the function Lθ will encode the posterior for that factorization . In summary , if one formulates any objective that involves the terms p ( x|z ) , p ( z ) or p ( z|x ) , where x is an observed random variable and z is a discrete latent random variable , then they can be substituted with Lk ( x ) ·p ( x ) Ex [ Lk ( x ) ] , Ex [ Lk ( x ) ] and Lk ( x ) respectively . On an important note , Neural Bayes parameterization requires using the term Ex [ Lk ( x ) ] , through which computing gradient is infeasible in general . A general discussion around this can be found in the appendix D. Nonetheless , we show that mini-batch gradients can have good fidelity for one of the objectives we propose using our parameterization . In the next two sections , we explore two different ways of factorizing p ( x ) resulting in qualitatively different goals of unsupervised representation learning . 4 DISJOINT MANIFOLD SEPARATION ( DMS ) . In many cases , the support of a distribution may be a set of disjoint manifolds . In this task , our goal is to label samples from each disjoint manifold with a distinct value . This formulation can be seen as a generalization of subspace clustering ( Ma et al. , 2008 ) where the goal is to identify disjoint affine subspaces . To make the problem concrete , we first formalize the definition of a disjoint manifold . Definition 1 . ( Connected Set ) We say that a set S ⊂ Rn is a connected set ( disjoint manifold ) if for any x , y ∈ S , there exists a continuous path between x and y such that all the points on the path also belong to S. To identify such disjoint manifolds in a distribution , we exploit the observation that only partitions that separate one disjoint manifold from others have high divergence between the respective conditional distributions while partitions that cut through a disjoint manifold result in conditional distributions with low divergence between them . Therefore , the objective we propose for this task is to partition the unlabeled data distribution p ( x ) into conditional distributions qi ( x ) ’ s such that a divergence between them is maximized . By doing so we recover the conditional distributions defined over the disjoint manifolds ( we prove its optimality in theorem 1 ) . We begin with two disjoint manifolds and extend this idea to multiple disjoint manifolds in the appendix B . Let J be a symmetric divergence ( Eg . Jensen-Shannon divergence , Wasserstein divergence , etc ) , and q0 and q1 be the disjoint conditional distributions that we want to learn . Then the aforementioned objective can be written formally as follows : max q0 , q1 π∈ ( 0,1 ) J ( q0 ( x ) ||q1 ( x ) ) ( 2 ) s.t . ∫ x q0 ( x ) = 1 , ∫ x q1 ( x ) = 1 , q1 ( x ) · π + q0 ( x ) · ( 1− π ) = p ( x ) . Since our goal is to simply assign labels to data samples x corresponding to which manifold they belong instead of learning conditional distributions as achieved by Eq . ( 2 ) , we would like to learn a function L ( x ) which maps samples from disjoint manifolds to distinct labels . To do so , below we derive an objective equivalent to Eq . ( 2 ) that learns such a function L ( x ) . Proposition 1 . ( Neural Bayes-DMS ) Let L ( x ) : Rn → [ 0 , 1 ] be a non-parametric function for any given input x ∈ Rn , and let J be the Jensen-Shannon divergence . Define scalars f1 ( x ) : = L ( x ) Ex [ L ( x ) ] and f0 ( x ) : = 1−L ( x ) 1−Ex [ L ( x ) ] . Then the objective in Eq . ( 2 ) is equivalent to , max L 1 2 · Ex [ f1 ( x ) · log ( f1 ( x ) f1 ( x ) + f0 ( x ) ) ] + 1 2 · Ex [ f0 ( x ) · log ( f0 ( x ) f1 ( x ) + f0 ( x ) ) ] + log 2 s.t . Ex [ L ( x ) ] /∈ { 0 , 1 } . ( 3 ) Optimality : We now prove the optimality of the proposed objective towards discovering disjoint manifolds present in the support of a probability density function p ( x ) . Theorem 1 . ( optimality ) Let p ( x ) be a probability density function over Rn whose support is the union of two non-empty connected sets ( definition 1 ) S1 and S2 that are disjoint , i.e . S1 ∩ S2 = ∅ . Let L ( x ) ∈ [ 0 , 1 ] belong to the class of continuous functions which is learned by solving the objective in Eq . ( 3 ) . Then the objective in Eq . ( 3 ) is maximized if and only if one of the following is true : L ( x ) = { 0 ∀x ∈ S1 1 ∀x ∈ S2 or L ( x ) = { 1 ∀x ∈ S1 0 ∀x ∈ S2 . The above theorem proves that optimizing the derived objective over the space of functions L implicitly partitions the data distribution into maximally separated conditionals by assigning a distinct label to points in each manifold . Most importantly , the theorem shows that the continuity condition on the function L ( x ) plays an important role . Without this condition , the network can not identify disjoint manifolds . Extension to multiple disjoint manifold case can be found in section B in appendix .
This work introduces a parameterization called Neural Bayes that facilitates learning representations from unlabeled data by categorizing them, where each data point x is mapped to a latent discrete variable z such that the distribution p(x) is segmented into a finite number of conditional distributions. Imposing different constraints on the latent discrete space will result in learning representations manifesting various properties. Two use cases of the proposed parameterization are studied: disjoint manifold separation and mutual information maximization.
SP:5b4768c8d71e9b044c50d77fb68d545370ca8329
Don't stack layers in graph neural networks, wire them randomly
1 INTRODUCTION . Data defined over the nodes of graphs are ubiquitous . Social network profiles ( Hamilton et al. , 2017 ) , molecular interactions ( Duvenaud et al. , 2015 ) , citation networks ( Sen et al. , 2008 ) , 3D point clouds ( Simonovsky & Komodakis , 2017 ) are just examples of a wide variety of data types where describing the domain as a graph allows to encode constraints and patterns among the data points . Exploiting the graph structure is crucial in order to extract powerful representations of the data . However , this is not a trivial task and only recently graph neural networks ( GNNs ) have started showing promising approaches to the problem . GNNs ( Wu et al. , 2020 ) extend the deep learning toolbox to deal with the irregularity of the graph domain . Much of the work has been focused on defining a graph convolution operation ( Bronstein et al. , 2017 ) , i.e. , a layer that is well-defined over the graph domain but also retains some of the key properties of convolution such as weight reuse and locality . A wide variety of such graph convolution operators has been defined over the years , mostly based on neighborhood aggregation schemes where the features of a node are transformed by processing the features of its neighbors . Such schemes have been shown to be as powerful as the Weisfeiler-Lehman graph isomorphism test ( Weisfeiler & Lehman , 1968 ; Xu et al. , 2019 ) , enabling them to simultaneuosly learn data features and graph topology . However , contrary to classic literature on CNNs , few works ( Li et al. , 2019a ; Dehmamy et al. , 2019 ; Xu et al. , 2018 ; Dwivedi et al. , 2020 ) addressed GNNs architectures and their role in extracting powerful representations . Several works , starting with the early GCN ( Kipf & Welling , 2017 ) , noticed an inability to build deep GNNs , often resulting in worse performance than that of methods that disregard the graph domain , when trying to build anything but very shallow networks . This calls for exploring whether advances on CNN architectures can be translated to the GNN space , while understanding the potentially different needs of graph representation learning . Li et al . ( 2019b ) suggest that GCNs suffer from oversmoothing as several layers are stacked , resulting in the extraction of mostly low-frequency features . This is related to the lack of self-loop information in this specific graph convolution . It is suggested that ResNet-like architectures mitigate the problem as the skip connections supply high frequency contributions . Xu et al . ( 2018 ) point out that the size of the receptive field of a node , i.e. , which nodes contribute to the features of the node under consideration , plays a crucial role , but it can vary widely depending on the graph and too large receptive fields may actually harm performance . They conclude that for graph-based problems it would be optimal to learn how to adaptively merge contributions from receptive fields of multiple size . For this reason they propose an architecture where each layer has a skip connection to the output so that contributions at multiple depths ( hence sizes of receptive fields ) can be merged . Nonetheless , the problem of finding methods for effectively increasing the capacity of graph neural networks is still standing , since stacking many layers has been proven to provide limited improvements ( Li et al. , 2019b ; Oono & Suzuki , 2019 ; Alon & Yahav , 2020 ; NT & Maehara , 2019 ) . In this paper , we argue that the recently proposed randomly wired architectures ( Xie et al. , 2019 ) are ideal for GNNs . In a randomly wired architecture , “ layers ” are arranged according to a random directed acyclic graph and data are propagated through the paths towards the output . Such architecture is ideal for GNNs because it realizes the intuition of Xu et al . ( 2018 ) of being able of merging receptive fields of varied size . Indeed , the randomly wired network can be seen as an extreme generalization of their jumping network approach where layer outputs can not only jump to the network output but to other layers as well , continuously merging receptive fields . Hence , randomly wired architectures provide a way of effectively scaling up GNNs , mitigating the depth problem and creating richer representations . Fig . 1 shows a graphical representation of this concept by highlighting the six layers directly contributing to the output , having different receptive fields induced by the distribution of paths from the input . Our novel contributions can be summarized as follows : i ) we are the first to analyze randomly wired architectures and show that they are generalizations of ResNets when looked at as ensembles of paths ( Veit et al. , 2016 ) ; ii ) we show that path ensembling allows to merge receptive fields of varied size and that it can do so adaptively , i.e. , trainable weights on the architecture edges can tune the desired size of the receptive fields to be merged to achieve an optimal configuration for the problem ; iii ) we introduce improvements to the basic design of randomly wired architectures by optionally embedding a path that sequentially goes through all layers in order to promote larger receptive fields when needed , and by presenting MonteCarlo DropPath , which decorrelates path contributions by randomly dropping architecture edges ; iv ) we provide extensive experimental evidence , using a recently introduced benchmarking framework ( Dwivedi et al. , 2020 ) to ensure significance and reproducibility , that randomly wired architectures consistently outperform ResNets , often by large margins , for five of the most popular graph convolution definitions on three different tasks . 2 BACKGROUND . 2.1 GRAPH NEURAL NETWORKS . A major shortcoming of CNNs is that they are unable to process data defined on irregular domains . In particular , one case that is drawing attention is when the data structure can be described by a graph and the data are defined as vectors on the graph nodes . This setting can be found in many applications , including 3D point clouds ( Wang et al. , 2019 ; Valsesia et al. , 2019 ) , computational biology ( Alipanahi et al. , 2015 ; Duvenaud et al. , 2015 ) , and social networks ( Kipf & Welling , 2017 ) . However , extending CNNs from data with a regular structure , such as images and video , to graph-structured data is not straightforward if one wants to preserve useful properties such as locality and weight reuse . GNNs redefine the convolution operation so that the new layer definition can be used on domains described by graphs . The most widely adopted graph convolutions in the literature rely on message passing , where a weighted aggregation of the feature vectors in a neighborhood is computed . The GCN ( Kipf & Welling , 2017 ) is arguably the simplest definition , applying the same linear transformation to all the node features , followed by neighborhood aggregation and non-linear activation : h ( l+1 ) i = σ 1 |Ni| ∑ j∈Ni Wh ( l ) j . Variants of this definition have been developed , e.g. , GraphSage ( Hamilton et al. , 2017 ) concatenates the feature vector of node i to the feature vectors of its neighbors , so that self-information can also be exploited ; GIN ( Xu et al. , 2019 ) uses a multilayer perceptron instead of a linear transform , replaces average with sum to ensure injectivity and proposes a different way of computing the output by using all the feature vectors produced by the intermediate layers . These definitions are all isotropic because they treat every edge in the same way . It has been observed that better representation capacity can be achieved using anistropic definitions , where every edge can have a different transformation , at the cost of increased computational complexity . The Gated GCN ( Bresson & Laurent , 2017 ) and GAT ( Veličković et al. , 2017 ) definitions fall in this category . 2.2 RANDOMLY WIRED ARCHITECTURES . In recent work , Xie et al . ( 2019 ) explore whether it is possible to avoid handcrafted design of neural network architectures and , at the same time , avoid expensive neural architecture search methods ( Elsken et al. , 2019 ) , by designing random architecture generators . They show that “ layers ” performing convolution , normalization and non-linear activation can be connected in a random architecture graph . Strong performance is observed on the traditional image classification task by outperforming state-of-the-art architectures . The authors conjecture that random architectures generalize ResNets and similar constructions , but the underlying principles of their excellent performance are unclear , as well as whether the performance translates to tasks other than image recognition or to operations other than convolution on grids . 3 RANDOMLY WIRED GNNS . In this section , we first introduce randomly wired architectures and the notation we are going to use . We then analyze their behavior when viewed as ensembles of paths . ∑ RELU GCONV BN 𝜎 ( wia ) 𝜎 ( wib ) 𝜎 ( wic ) h ( i ) h ( a ) h ( b ) h ( c ) Figure 2 : An architecture node is equivalent to a GNN layer . A randomly wired architecture consists of a directed acyclic graph ( DAG ) connecting a source architecture node , which is fed with the input data , to a sink architecture node . One should not confuse the architecture DAG with the graph representing the GNN domain : to avoid any source of confusion we will use the terms architecture nodes ( edges ) and domain nodes ( edges ) , respectively . A domain node is a node of the graph that is fed as input to the GNN . An architecture node is effectively a GNN layer performing the following operations ( Fig . 2 ) : i ) aggregation of the inputs from other architecture nodes via a weighted sum as in ( Xie et al. , 2019 ) : h ( i ) = ∑ j∈Ai ωijh ( j ) = ∑ j∈Ai σ ( wij ) h ( j ) , i = 1 , ... , L− 1 ( 1 ) 3 being σ a sigmoid function , Ai the set of direct predecessors of the architecture node i , and wij a scalar trainable weight ; ii ) a non-linear activation ; iii ) a graph-convolution operation ( without output activation ) ; iv ) batch normalization . The architecture DAG is generated using a random graph generator . In this paper , we will focus on the Erdős-Renyi model where the adjacency matrix of the DAG is a strictly upper triangular matrix with entries being realizations of a Bernoulli random variable with probability p. If multiple input architecture nodes are randomly generated , they are all wired to a single global input . Multiple output architecture nodes are averaged to obtain a global output . Other random generators may be used , e.g. , small-world and scale-free random networks have been studied in ( Xie et al. , 2019 ) . However , a different generator will display a different behavior concerning the properties we study in Sec . 3.1 . 3.1 RANDOMLY WIRED ARCHITECTURES BEHAVE LIKE PATH ENSEMBLES . It has already been shown that ResNets behave like ensembles of relatively shallow networks , where one can see the ResNet architecture as a collection of paths of varied lengths ( Veit et al. , 2016 ) . More specifically , in a ResNet with n layers , where all layers have a skip connection except the first one and the last one , there are exactly 2L−2 paths , whose lengths follow a Binomial distribution ( i.e. , the number of paths of length l from layer k to the last layer is ( L−k−1 l−2 ) ) , and the average path length is L 2 + 1 ( Veit et al. , 2016 ) . In this section , we show that a randomly wired neural network can also be considered as an ensemble of networks with varied depth . However , in this case , the distribution of the path length is different from the one obtained with the ResNet , as shown in the following lemma ( proof in the supplementary material ) . Lemma 3.1 . Let us consider a randomly wired network with L architecture nodes , where the architecture DAG is generated according to a Erdős-Renyi graph generator with probability p. The average number of paths of length l from node k to the sink , where k < L , is E [ N ( k ) l ] = ( L−k−1 l−2 ) pl−1 and the average total number of paths from node k to the sink is E [ N ( k ) ] = p ( 1 + p ) L−k−1 . We can observe that if p = 1 , the randomly wired network converges to the ResNet architecture . This allows to think of randomly wired architectures as generalizations of ResNets as they enable increased flexibility in the number and distribution of paths instead of enforcing the use of all 2L−2 .
This paper utilizes Randomly Wired architectures to boost deep GNNs. Theoretical analyses verify that randomly wired architectures behave like path ensemble and it enables adaptive receptive field. Experimental results on three non-popular datasets demonstrate the strength of the proposed model. Overall, the idea is interesting. Yet this paper can be made better through the following aspects:
SP:9d58dff3946cc3ebd5f5272deab9c5ccddd48efc
Don't stack layers in graph neural networks, wire them randomly
1 INTRODUCTION . Data defined over the nodes of graphs are ubiquitous . Social network profiles ( Hamilton et al. , 2017 ) , molecular interactions ( Duvenaud et al. , 2015 ) , citation networks ( Sen et al. , 2008 ) , 3D point clouds ( Simonovsky & Komodakis , 2017 ) are just examples of a wide variety of data types where describing the domain as a graph allows to encode constraints and patterns among the data points . Exploiting the graph structure is crucial in order to extract powerful representations of the data . However , this is not a trivial task and only recently graph neural networks ( GNNs ) have started showing promising approaches to the problem . GNNs ( Wu et al. , 2020 ) extend the deep learning toolbox to deal with the irregularity of the graph domain . Much of the work has been focused on defining a graph convolution operation ( Bronstein et al. , 2017 ) , i.e. , a layer that is well-defined over the graph domain but also retains some of the key properties of convolution such as weight reuse and locality . A wide variety of such graph convolution operators has been defined over the years , mostly based on neighborhood aggregation schemes where the features of a node are transformed by processing the features of its neighbors . Such schemes have been shown to be as powerful as the Weisfeiler-Lehman graph isomorphism test ( Weisfeiler & Lehman , 1968 ; Xu et al. , 2019 ) , enabling them to simultaneuosly learn data features and graph topology . However , contrary to classic literature on CNNs , few works ( Li et al. , 2019a ; Dehmamy et al. , 2019 ; Xu et al. , 2018 ; Dwivedi et al. , 2020 ) addressed GNNs architectures and their role in extracting powerful representations . Several works , starting with the early GCN ( Kipf & Welling , 2017 ) , noticed an inability to build deep GNNs , often resulting in worse performance than that of methods that disregard the graph domain , when trying to build anything but very shallow networks . This calls for exploring whether advances on CNN architectures can be translated to the GNN space , while understanding the potentially different needs of graph representation learning . Li et al . ( 2019b ) suggest that GCNs suffer from oversmoothing as several layers are stacked , resulting in the extraction of mostly low-frequency features . This is related to the lack of self-loop information in this specific graph convolution . It is suggested that ResNet-like architectures mitigate the problem as the skip connections supply high frequency contributions . Xu et al . ( 2018 ) point out that the size of the receptive field of a node , i.e. , which nodes contribute to the features of the node under consideration , plays a crucial role , but it can vary widely depending on the graph and too large receptive fields may actually harm performance . They conclude that for graph-based problems it would be optimal to learn how to adaptively merge contributions from receptive fields of multiple size . For this reason they propose an architecture where each layer has a skip connection to the output so that contributions at multiple depths ( hence sizes of receptive fields ) can be merged . Nonetheless , the problem of finding methods for effectively increasing the capacity of graph neural networks is still standing , since stacking many layers has been proven to provide limited improvements ( Li et al. , 2019b ; Oono & Suzuki , 2019 ; Alon & Yahav , 2020 ; NT & Maehara , 2019 ) . In this paper , we argue that the recently proposed randomly wired architectures ( Xie et al. , 2019 ) are ideal for GNNs . In a randomly wired architecture , “ layers ” are arranged according to a random directed acyclic graph and data are propagated through the paths towards the output . Such architecture is ideal for GNNs because it realizes the intuition of Xu et al . ( 2018 ) of being able of merging receptive fields of varied size . Indeed , the randomly wired network can be seen as an extreme generalization of their jumping network approach where layer outputs can not only jump to the network output but to other layers as well , continuously merging receptive fields . Hence , randomly wired architectures provide a way of effectively scaling up GNNs , mitigating the depth problem and creating richer representations . Fig . 1 shows a graphical representation of this concept by highlighting the six layers directly contributing to the output , having different receptive fields induced by the distribution of paths from the input . Our novel contributions can be summarized as follows : i ) we are the first to analyze randomly wired architectures and show that they are generalizations of ResNets when looked at as ensembles of paths ( Veit et al. , 2016 ) ; ii ) we show that path ensembling allows to merge receptive fields of varied size and that it can do so adaptively , i.e. , trainable weights on the architecture edges can tune the desired size of the receptive fields to be merged to achieve an optimal configuration for the problem ; iii ) we introduce improvements to the basic design of randomly wired architectures by optionally embedding a path that sequentially goes through all layers in order to promote larger receptive fields when needed , and by presenting MonteCarlo DropPath , which decorrelates path contributions by randomly dropping architecture edges ; iv ) we provide extensive experimental evidence , using a recently introduced benchmarking framework ( Dwivedi et al. , 2020 ) to ensure significance and reproducibility , that randomly wired architectures consistently outperform ResNets , often by large margins , for five of the most popular graph convolution definitions on three different tasks . 2 BACKGROUND . 2.1 GRAPH NEURAL NETWORKS . A major shortcoming of CNNs is that they are unable to process data defined on irregular domains . In particular , one case that is drawing attention is when the data structure can be described by a graph and the data are defined as vectors on the graph nodes . This setting can be found in many applications , including 3D point clouds ( Wang et al. , 2019 ; Valsesia et al. , 2019 ) , computational biology ( Alipanahi et al. , 2015 ; Duvenaud et al. , 2015 ) , and social networks ( Kipf & Welling , 2017 ) . However , extending CNNs from data with a regular structure , such as images and video , to graph-structured data is not straightforward if one wants to preserve useful properties such as locality and weight reuse . GNNs redefine the convolution operation so that the new layer definition can be used on domains described by graphs . The most widely adopted graph convolutions in the literature rely on message passing , where a weighted aggregation of the feature vectors in a neighborhood is computed . The GCN ( Kipf & Welling , 2017 ) is arguably the simplest definition , applying the same linear transformation to all the node features , followed by neighborhood aggregation and non-linear activation : h ( l+1 ) i = σ 1 |Ni| ∑ j∈Ni Wh ( l ) j . Variants of this definition have been developed , e.g. , GraphSage ( Hamilton et al. , 2017 ) concatenates the feature vector of node i to the feature vectors of its neighbors , so that self-information can also be exploited ; GIN ( Xu et al. , 2019 ) uses a multilayer perceptron instead of a linear transform , replaces average with sum to ensure injectivity and proposes a different way of computing the output by using all the feature vectors produced by the intermediate layers . These definitions are all isotropic because they treat every edge in the same way . It has been observed that better representation capacity can be achieved using anistropic definitions , where every edge can have a different transformation , at the cost of increased computational complexity . The Gated GCN ( Bresson & Laurent , 2017 ) and GAT ( Veličković et al. , 2017 ) definitions fall in this category . 2.2 RANDOMLY WIRED ARCHITECTURES . In recent work , Xie et al . ( 2019 ) explore whether it is possible to avoid handcrafted design of neural network architectures and , at the same time , avoid expensive neural architecture search methods ( Elsken et al. , 2019 ) , by designing random architecture generators . They show that “ layers ” performing convolution , normalization and non-linear activation can be connected in a random architecture graph . Strong performance is observed on the traditional image classification task by outperforming state-of-the-art architectures . The authors conjecture that random architectures generalize ResNets and similar constructions , but the underlying principles of their excellent performance are unclear , as well as whether the performance translates to tasks other than image recognition or to operations other than convolution on grids . 3 RANDOMLY WIRED GNNS . In this section , we first introduce randomly wired architectures and the notation we are going to use . We then analyze their behavior when viewed as ensembles of paths . ∑ RELU GCONV BN 𝜎 ( wia ) 𝜎 ( wib ) 𝜎 ( wic ) h ( i ) h ( a ) h ( b ) h ( c ) Figure 2 : An architecture node is equivalent to a GNN layer . A randomly wired architecture consists of a directed acyclic graph ( DAG ) connecting a source architecture node , which is fed with the input data , to a sink architecture node . One should not confuse the architecture DAG with the graph representing the GNN domain : to avoid any source of confusion we will use the terms architecture nodes ( edges ) and domain nodes ( edges ) , respectively . A domain node is a node of the graph that is fed as input to the GNN . An architecture node is effectively a GNN layer performing the following operations ( Fig . 2 ) : i ) aggregation of the inputs from other architecture nodes via a weighted sum as in ( Xie et al. , 2019 ) : h ( i ) = ∑ j∈Ai ωijh ( j ) = ∑ j∈Ai σ ( wij ) h ( j ) , i = 1 , ... , L− 1 ( 1 ) 3 being σ a sigmoid function , Ai the set of direct predecessors of the architecture node i , and wij a scalar trainable weight ; ii ) a non-linear activation ; iii ) a graph-convolution operation ( without output activation ) ; iv ) batch normalization . The architecture DAG is generated using a random graph generator . In this paper , we will focus on the Erdős-Renyi model where the adjacency matrix of the DAG is a strictly upper triangular matrix with entries being realizations of a Bernoulli random variable with probability p. If multiple input architecture nodes are randomly generated , they are all wired to a single global input . Multiple output architecture nodes are averaged to obtain a global output . Other random generators may be used , e.g. , small-world and scale-free random networks have been studied in ( Xie et al. , 2019 ) . However , a different generator will display a different behavior concerning the properties we study in Sec . 3.1 . 3.1 RANDOMLY WIRED ARCHITECTURES BEHAVE LIKE PATH ENSEMBLES . It has already been shown that ResNets behave like ensembles of relatively shallow networks , where one can see the ResNet architecture as a collection of paths of varied lengths ( Veit et al. , 2016 ) . More specifically , in a ResNet with n layers , where all layers have a skip connection except the first one and the last one , there are exactly 2L−2 paths , whose lengths follow a Binomial distribution ( i.e. , the number of paths of length l from layer k to the last layer is ( L−k−1 l−2 ) ) , and the average path length is L 2 + 1 ( Veit et al. , 2016 ) . In this section , we show that a randomly wired neural network can also be considered as an ensemble of networks with varied depth . However , in this case , the distribution of the path length is different from the one obtained with the ResNet , as shown in the following lemma ( proof in the supplementary material ) . Lemma 3.1 . Let us consider a randomly wired network with L architecture nodes , where the architecture DAG is generated according to a Erdős-Renyi graph generator with probability p. The average number of paths of length l from node k to the sink , where k < L , is E [ N ( k ) l ] = ( L−k−1 l−2 ) pl−1 and the average total number of paths from node k to the sink is E [ N ( k ) ] = p ( 1 + p ) L−k−1 . We can observe that if p = 1 , the randomly wired network converges to the ResNet architecture . This allows to think of randomly wired architectures as generalizations of ResNets as they enable increased flexibility in the number and distribution of paths instead of enforcing the use of all 2L−2 .
The paper proposes a new method for building graph convolutional neural networks. It shows, that during the building of the network, instead of stacking many layers and adding the residual connection between them, one could employ a randomly-wired architecture, that can be a more effective way to increase the capacity of the network and thus it could obtain richer representations. The proposed method is an interesting direction in the field of graph convolutional neural networks. The new method could be seen asa generalization of the residual networks and the jumping knowledge networks.
SP:9d58dff3946cc3ebd5f5272deab9c5ccddd48efc
On Disentangled Representations Learned From Correlated Data
Despite impressive progress in the last decade , it still remains an open challenge to build models that generalize well across multiple tasks and datasets . One path to achieve this is to learn meaningful and compact representations , in which different semantic aspects of data are structurally disentangled . The focus of disentanglement approaches has been on separating independent factors of variation despite the fact that real-world observations are often not structured into meaningful independent causal variables . In this work , we bridge the gap to real-world scenarios by analyzing the behavior of most prominent methods and disentanglement scores on correlated data in a large scale empirical study ( including 4260 models ) . We show that systematically induced correlations in the dataset are being learned and reflected in the latent representations , while widely used disentanglement scores fall short of capturing these latent correlations . Finally , we demonstrate how to disentangle these latent correlations using weak supervision , even if we constrain this supervision to be causally plausible . Our results thus support the argument to learn independent mechanisms rather than independent factors of variations . 1 INTRODUCTION Due to the induced structure , disentangled representations promise generalization to unseen scenarios ( Higgins et al. , 2017b ) , increased interpretability ( Adel et al. , 2018 ; Higgins et al. , 2018 ) and faster learning on downstream tasks ( van Steenkiste et al. , 2019 ; Locatello et al. , 2019a ) . While the advantages of disentangled representations have been well established , they generally assume the existence of natural factors that vary independently within the given dataset , which is rarely the case in real-world settings . As an example , consider a scene with a table and some chairs ( see Fig . 1 ) . The higher-level factors of this representation are in fact correlated and what we actually want to infer are independent ( causal ) mechanisms ( Peters et al. , 2017 ; Parascandolo et al. , 2018 ; Suter et al. , 2019 ; Goyal et al. , 2019 ) . A complex generative model can be thought of as the composition of independent mechanisms or “ causal ” modules , which generate highdimensional observations ( such as images or videos ) . In the causality community , this is often considered a prerequisite to achieve representations which are robust to interventions upon variables determined by such models ( Peters et al. , 2017 ) . One particular instantiation of this idea in the machine learning community is the notion of disentangled representations ( Bengio et al. , 2013 ) . The goal of disentanglement learning is to find a representation of the data which captures all the ground-truth factors of variation ( FoV ) independently . Despite the recent growth of the field , the performance of state-of-the-art disentanglement learners remains unknown for more realistic settings where FoV are correlated during training . Given the potential societal impact in the medical domain ( Chartsias et al. , 2018 ) or fair decision making ( Locatello et al. , 2019a ; Madras et al. , 2018 ; Creager et al. , 2019 ) , the evaluation of the usefulness of disentangled representations trained on correlated data is of high importance . To go beyond the highly idealized settings considered thus far , we conducted a large scale empirical study to systematically assess the effect of induced correlations between pairs of factors of variation in training data on the learned representations . To provide a qualitative and quantitative evaluation , we investigate multiple datasets with access to ground-truth labels . Moreover , we study the generalization abilities of the representations learned on correlated data as well as their performance in particular for the downstream task of fair decision making . Contributions . Our main contributions can be summarized as follows : • We present the first large-scale empirical study ( 4260 models ) 1 that examines how modern disentanglement learners perform when ground truth factors of the observational data are correlated . • We find that factorization-based inductive biases are insufficient to learn disentangled representations from observational data . Existing methods fail to disentangle correlated factors of variation , resulting in correlated latent space dimensions . Moreover , standard disentanglement metrics do not reveal these persisting correlations . • We investigate the usefulness of semi-supervised and weakly-supervised approaches to resolve latent entanglement . For the latter setting , we focus on multiple observational and interventional distributions . 2 BACKGROUND AND RELATED WORK . Disentanglement . Current state-of-the-art disentanglement approaches use the framework of variational auto-encoders ( VAEs ) ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . The ( high-dimensional ) observations x are modelled as being generated from some latent features z with chosen prior p ( z ) according to the probabilistic model pθ ( x|z ) p ( z ) . The generative model pθ ( x|z ) as well as the proxy posterior qφ ( z|x ) can be parameterized by neural networks , which are optimized by maximizing the variational lower bound ( ELBO ) of log p ( x1 , . . . , xN ) . LV AE = N∑ i=1 Eqφ ( z|x ( i ) ) [ log pθ ( x ( i ) |z ) ] −DKL ( qφ ( z|x ( i ) ) ‖p ( z ) ) ( 1 ) The above objective does not enforce any structure on the latent space , except for similarity ( in KL-divergence ) to the prior p ( z ) ( typically chosen as an isotropic Gaussian ) . However , the structure and semantic meaning of latent representations can be relevant to study generation properties . Consequently , various proposals for structure-imposing regularization and commonly used evaluation metrics measuring different notions of disentanglement of the learned representations have been made ( Higgins et al. , 2017a ; Kim & Mnih , 2018 ; Burgess et al. , 2018 ; Kumar et al. , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ; Mathieu et al. , 2018 ) . Recently , it has been shown that unsupervised disentangling by optimising marginal likelihood in a generative model is impossible without further inductive bias ( Locatello et al. , 2019b ) . To address this theoretical limitation , methods have been proposed that do not require explicitly labelled data but only some weak labeling information ( Locatello et al. , 2020 ; Shu et al. , 2019 ) . Ideas related to disentangling the factors of variations date back to the non-linear ICA literature ( Bach & Jordan , 2002 ; Comon , 1994 ; Jutten & Karhunen , 2003 ; Hyvärinen & Pajunen , 1999 ; Hyvarinen et al. , 2019 ; Hyvarinen & Morioka , 2016 ; Gresele et al. , 2019 ) . Recent work combines non-linear ICA with disentanglement ( Khemakhem et al. , 2020 ; Sorrenson et al. , 2020 ; Klindt et al. , 2020 ) Correlations . A set of random variables Xi=1 , ... , n is not independent , if and only if their joint distribution does not factorize P ( X1 , X2 , . . . , Xn ) 6= n∏ i=1 P ( Xi ) . ( 2 ) In this case , we speak of dependence between the random variables , also commonly referred to as correlation.2 Correlation between two variables can either stem from a direct causal relationship ( one 1Each model has been trained for 300,000 iterations on Tesla V100 GPUs . Reproducing these experiments requires approximately 0.79 GPU years . 2We use the term correlation here in a broad sense of any statistical association , not just linear dependencies . variable affects the other ) , but can also be due to different unobserved circumstances ( confounders ) affecting both . Real-world datasets display many of these ( “ spurious ” and often a priori unknown ) correlations ( Geirhos et al. , 2020 ) . However , most work on learning disentangled representations assumes that there is an underlying set of independent ground truth variables that govern the generative process of observable data . These methods are hence predominantly evaluated on data that obey independence in the true factors of variation , which we then consider to be the correct factorization . In the real world , the observation generating process is likely not always as clearly “ disentangled ” and we do expect correlations in the collected datasets . It is thus an open question to what degree existing inductive biases from the encoder/decoder architecture , but more importantly the dataset biases , affect the learned representation . In our experiments , we introduce dataset correlations in a controlled manner to understand to what degree state-of-the-art approaches can cope with such correlations . We believe these correlations to reflect a major feature of more realistic environments . Other Related Work . Most popular datasets in the disentanglement literature exhibit perfect independence in their FoV . At some level this is sensible as it reflects the underlying assumption in the inductive bias being studied . However , this assumption is unlikely to hold in practice as shown by Li et al . ( 2019 ) , who propose methods based on a pairwise independence assumption instead . The literature so far has not thoroughly measured how popular inductive biases such as factorized priors behave when learning from correlated datasets , although several smaller experiments along these lines can be acknowledged . Chen et al . ( 2018 ) studied correlated 3DFaces ( Paysan et al. , 2009 ) by fixing all except three factors in which the authors conclude that the β-TC-VAE regularizer can help to disentangle imposed correlations . Brekelmans et al . ( 2019 ) show that Echo noise results in superior disentanglement compared to standard betaVAE in a small experiment on a downsampled dSprites variant where randomly selected factor pairs are excluded . However , the latent structure was not studied in detail ; our findings suggest that global disentanglement metrics are insufficient to diagnose issues when models learn from correlated data . Creager et al . ( 2019 ) based some of the evaluations of a proposed new autoencoder architecture in the fairness context on a biased dSprites variant and Yang et al . ( 2020 ) study a linear SCM in a VAE architecure on datasets with dependent variables . However , their studies focused on representation learners that require strong supervision via FoV labels at train time . 3 THE EFFECT OF CORRELATED DATA ON DISENTANGLEMENT LEARNERS . In this section , we want to present the key findings from our empirical study of unsupervised disentanglement learning on a particular variant of correlated data . We start by outlining the experimental design of our study in Section 3.1 . Based on this , we analyze the latent spaces in Section 3.2 and find that factorization-based inductive biases are insufficient to learn disentangled representations from observational data . Persisting pairwise correlations in the latent space are not sufficiently revealed by standard disentanglement metrics that might be particularly relevant and problematic for fairness applications . Finally , in Section 3.3 , we show extrapolation and generalization capabilities of the learned representations towards unseen factor combinations due to the induced correlations . 3.1 EXPERIMENTAL DESIGN . For our first experiments we introduce correlations between single pairs of factors of variation on the following three datasets : Shapes3D with object size and azimuth ( denoted “ A ” ) , dSprites with orientation and X-position ( “ B ” ) and finally the real-world observations dataset MPI-3D with first and second degree of freedom ( “ C ” ) . We focus on linear correlations with Gaussian noise between the two variables , which we denote by c1 , c2 . The ground truth factors for c1 , c2 take values zc1 ∈ { 0 , . . . , zmaxc1 } and zc2 ∈ { 0 , . . . , zmaxc2 } respectively . We then parameterize correlations by sampling the training dataset from the joint P ( zc1 , zc2 ) ∝ N ( zc2−αzc1 , σ ) where α = zmaxc2 /zmaxc1 . The strength of the correlations can be tuned by σ , for which we choose 0.2 , 0.4 , 0.7 in normalized units with respect to the range of values in zc1 , c2 . Lower σ indicates stronger correlation . See Fig . 5 for an example of P ( zc1 , zc2 ) for correlating azimuth and object size in Shapes3D with σ = 0.2 . Additionally , we study the uncorrelated limit ( σ =∞ ) , which amounts to the case typically studied in the literature . We train the same six VAE methods as discussed in Locatello et al . ( 2019b ) , including β-VAE , FactorVAE , AnnealedVAE , DIP-VAE-I , DIP-VAE-II and β-TC-VAE , each with six hyperparameter settings . Each method has been trained using five different random seeds . All remaining factors of variation are sampled uniformly at random . This first study sums up to a total of 2160 trained models , or 180 models per dataset and correlation strength3 . Appendix A describes additional implementation details .
The paper studies the behaviour of disentanglement methods and metrics on data where a couple of factors of variation (FoV) are correlated, a more realistic setup compared to the usual independent FoV setting in the literature. The paper shows how the correlation in the FoV is reflected in the representations learned by the models, and claims that the widely used disentanglement scores fail to capture these correlations. A couple of solutions that use weak supervision are suggested.
SP:ca83623b552cb6bd000d5a67fd81e41a6d7b1e7a
On Disentangled Representations Learned From Correlated Data
Despite impressive progress in the last decade , it still remains an open challenge to build models that generalize well across multiple tasks and datasets . One path to achieve this is to learn meaningful and compact representations , in which different semantic aspects of data are structurally disentangled . The focus of disentanglement approaches has been on separating independent factors of variation despite the fact that real-world observations are often not structured into meaningful independent causal variables . In this work , we bridge the gap to real-world scenarios by analyzing the behavior of most prominent methods and disentanglement scores on correlated data in a large scale empirical study ( including 4260 models ) . We show that systematically induced correlations in the dataset are being learned and reflected in the latent representations , while widely used disentanglement scores fall short of capturing these latent correlations . Finally , we demonstrate how to disentangle these latent correlations using weak supervision , even if we constrain this supervision to be causally plausible . Our results thus support the argument to learn independent mechanisms rather than independent factors of variations . 1 INTRODUCTION Due to the induced structure , disentangled representations promise generalization to unseen scenarios ( Higgins et al. , 2017b ) , increased interpretability ( Adel et al. , 2018 ; Higgins et al. , 2018 ) and faster learning on downstream tasks ( van Steenkiste et al. , 2019 ; Locatello et al. , 2019a ) . While the advantages of disentangled representations have been well established , they generally assume the existence of natural factors that vary independently within the given dataset , which is rarely the case in real-world settings . As an example , consider a scene with a table and some chairs ( see Fig . 1 ) . The higher-level factors of this representation are in fact correlated and what we actually want to infer are independent ( causal ) mechanisms ( Peters et al. , 2017 ; Parascandolo et al. , 2018 ; Suter et al. , 2019 ; Goyal et al. , 2019 ) . A complex generative model can be thought of as the composition of independent mechanisms or “ causal ” modules , which generate highdimensional observations ( such as images or videos ) . In the causality community , this is often considered a prerequisite to achieve representations which are robust to interventions upon variables determined by such models ( Peters et al. , 2017 ) . One particular instantiation of this idea in the machine learning community is the notion of disentangled representations ( Bengio et al. , 2013 ) . The goal of disentanglement learning is to find a representation of the data which captures all the ground-truth factors of variation ( FoV ) independently . Despite the recent growth of the field , the performance of state-of-the-art disentanglement learners remains unknown for more realistic settings where FoV are correlated during training . Given the potential societal impact in the medical domain ( Chartsias et al. , 2018 ) or fair decision making ( Locatello et al. , 2019a ; Madras et al. , 2018 ; Creager et al. , 2019 ) , the evaluation of the usefulness of disentangled representations trained on correlated data is of high importance . To go beyond the highly idealized settings considered thus far , we conducted a large scale empirical study to systematically assess the effect of induced correlations between pairs of factors of variation in training data on the learned representations . To provide a qualitative and quantitative evaluation , we investigate multiple datasets with access to ground-truth labels . Moreover , we study the generalization abilities of the representations learned on correlated data as well as their performance in particular for the downstream task of fair decision making . Contributions . Our main contributions can be summarized as follows : • We present the first large-scale empirical study ( 4260 models ) 1 that examines how modern disentanglement learners perform when ground truth factors of the observational data are correlated . • We find that factorization-based inductive biases are insufficient to learn disentangled representations from observational data . Existing methods fail to disentangle correlated factors of variation , resulting in correlated latent space dimensions . Moreover , standard disentanglement metrics do not reveal these persisting correlations . • We investigate the usefulness of semi-supervised and weakly-supervised approaches to resolve latent entanglement . For the latter setting , we focus on multiple observational and interventional distributions . 2 BACKGROUND AND RELATED WORK . Disentanglement . Current state-of-the-art disentanglement approaches use the framework of variational auto-encoders ( VAEs ) ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . The ( high-dimensional ) observations x are modelled as being generated from some latent features z with chosen prior p ( z ) according to the probabilistic model pθ ( x|z ) p ( z ) . The generative model pθ ( x|z ) as well as the proxy posterior qφ ( z|x ) can be parameterized by neural networks , which are optimized by maximizing the variational lower bound ( ELBO ) of log p ( x1 , . . . , xN ) . LV AE = N∑ i=1 Eqφ ( z|x ( i ) ) [ log pθ ( x ( i ) |z ) ] −DKL ( qφ ( z|x ( i ) ) ‖p ( z ) ) ( 1 ) The above objective does not enforce any structure on the latent space , except for similarity ( in KL-divergence ) to the prior p ( z ) ( typically chosen as an isotropic Gaussian ) . However , the structure and semantic meaning of latent representations can be relevant to study generation properties . Consequently , various proposals for structure-imposing regularization and commonly used evaluation metrics measuring different notions of disentanglement of the learned representations have been made ( Higgins et al. , 2017a ; Kim & Mnih , 2018 ; Burgess et al. , 2018 ; Kumar et al. , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ; Mathieu et al. , 2018 ) . Recently , it has been shown that unsupervised disentangling by optimising marginal likelihood in a generative model is impossible without further inductive bias ( Locatello et al. , 2019b ) . To address this theoretical limitation , methods have been proposed that do not require explicitly labelled data but only some weak labeling information ( Locatello et al. , 2020 ; Shu et al. , 2019 ) . Ideas related to disentangling the factors of variations date back to the non-linear ICA literature ( Bach & Jordan , 2002 ; Comon , 1994 ; Jutten & Karhunen , 2003 ; Hyvärinen & Pajunen , 1999 ; Hyvarinen et al. , 2019 ; Hyvarinen & Morioka , 2016 ; Gresele et al. , 2019 ) . Recent work combines non-linear ICA with disentanglement ( Khemakhem et al. , 2020 ; Sorrenson et al. , 2020 ; Klindt et al. , 2020 ) Correlations . A set of random variables Xi=1 , ... , n is not independent , if and only if their joint distribution does not factorize P ( X1 , X2 , . . . , Xn ) 6= n∏ i=1 P ( Xi ) . ( 2 ) In this case , we speak of dependence between the random variables , also commonly referred to as correlation.2 Correlation between two variables can either stem from a direct causal relationship ( one 1Each model has been trained for 300,000 iterations on Tesla V100 GPUs . Reproducing these experiments requires approximately 0.79 GPU years . 2We use the term correlation here in a broad sense of any statistical association , not just linear dependencies . variable affects the other ) , but can also be due to different unobserved circumstances ( confounders ) affecting both . Real-world datasets display many of these ( “ spurious ” and often a priori unknown ) correlations ( Geirhos et al. , 2020 ) . However , most work on learning disentangled representations assumes that there is an underlying set of independent ground truth variables that govern the generative process of observable data . These methods are hence predominantly evaluated on data that obey independence in the true factors of variation , which we then consider to be the correct factorization . In the real world , the observation generating process is likely not always as clearly “ disentangled ” and we do expect correlations in the collected datasets . It is thus an open question to what degree existing inductive biases from the encoder/decoder architecture , but more importantly the dataset biases , affect the learned representation . In our experiments , we introduce dataset correlations in a controlled manner to understand to what degree state-of-the-art approaches can cope with such correlations . We believe these correlations to reflect a major feature of more realistic environments . Other Related Work . Most popular datasets in the disentanglement literature exhibit perfect independence in their FoV . At some level this is sensible as it reflects the underlying assumption in the inductive bias being studied . However , this assumption is unlikely to hold in practice as shown by Li et al . ( 2019 ) , who propose methods based on a pairwise independence assumption instead . The literature so far has not thoroughly measured how popular inductive biases such as factorized priors behave when learning from correlated datasets , although several smaller experiments along these lines can be acknowledged . Chen et al . ( 2018 ) studied correlated 3DFaces ( Paysan et al. , 2009 ) by fixing all except three factors in which the authors conclude that the β-TC-VAE regularizer can help to disentangle imposed correlations . Brekelmans et al . ( 2019 ) show that Echo noise results in superior disentanglement compared to standard betaVAE in a small experiment on a downsampled dSprites variant where randomly selected factor pairs are excluded . However , the latent structure was not studied in detail ; our findings suggest that global disentanglement metrics are insufficient to diagnose issues when models learn from correlated data . Creager et al . ( 2019 ) based some of the evaluations of a proposed new autoencoder architecture in the fairness context on a biased dSprites variant and Yang et al . ( 2020 ) study a linear SCM in a VAE architecure on datasets with dependent variables . However , their studies focused on representation learners that require strong supervision via FoV labels at train time . 3 THE EFFECT OF CORRELATED DATA ON DISENTANGLEMENT LEARNERS . In this section , we want to present the key findings from our empirical study of unsupervised disentanglement learning on a particular variant of correlated data . We start by outlining the experimental design of our study in Section 3.1 . Based on this , we analyze the latent spaces in Section 3.2 and find that factorization-based inductive biases are insufficient to learn disentangled representations from observational data . Persisting pairwise correlations in the latent space are not sufficiently revealed by standard disentanglement metrics that might be particularly relevant and problematic for fairness applications . Finally , in Section 3.3 , we show extrapolation and generalization capabilities of the learned representations towards unseen factor combinations due to the induced correlations . 3.1 EXPERIMENTAL DESIGN . For our first experiments we introduce correlations between single pairs of factors of variation on the following three datasets : Shapes3D with object size and azimuth ( denoted “ A ” ) , dSprites with orientation and X-position ( “ B ” ) and finally the real-world observations dataset MPI-3D with first and second degree of freedom ( “ C ” ) . We focus on linear correlations with Gaussian noise between the two variables , which we denote by c1 , c2 . The ground truth factors for c1 , c2 take values zc1 ∈ { 0 , . . . , zmaxc1 } and zc2 ∈ { 0 , . . . , zmaxc2 } respectively . We then parameterize correlations by sampling the training dataset from the joint P ( zc1 , zc2 ) ∝ N ( zc2−αzc1 , σ ) where α = zmaxc2 /zmaxc1 . The strength of the correlations can be tuned by σ , for which we choose 0.2 , 0.4 , 0.7 in normalized units with respect to the range of values in zc1 , c2 . Lower σ indicates stronger correlation . See Fig . 5 for an example of P ( zc1 , zc2 ) for correlating azimuth and object size in Shapes3D with σ = 0.2 . Additionally , we study the uncorrelated limit ( σ =∞ ) , which amounts to the case typically studied in the literature . We train the same six VAE methods as discussed in Locatello et al . ( 2019b ) , including β-VAE , FactorVAE , AnnealedVAE , DIP-VAE-I , DIP-VAE-II and β-TC-VAE , each with six hyperparameter settings . Each method has been trained using five different random seeds . All remaining factors of variation are sampled uniformly at random . This first study sums up to a total of 2160 trained models , or 180 models per dataset and correlation strength3 . Appendix A describes additional implementation details .
This paper systematically presents a large-scale empirical study on the disentangled representation learning when the underlying factors are possibly entangled. From the results of purely unsupervised settings, the authors have discovered the shortcomings of the existing metrics of disentanglement as well as the poor learned representations (in terms of disentanglement). However, with the help of small amount of factor labels or other weak supervision signals, recent approaches could learn fairly perfect representation.
SP:ca83623b552cb6bd000d5a67fd81e41a6d7b1e7a
Acceleration in Hyperbolic and Spherical Spaces
We further research on the acceleration phenomenon on Riemannian manifolds by introducing the first global first-order method that achieves the same rates as accelerated gradient descent in the Euclidean space for the optimization of smooth and geodesically convex ( g-convex ) or strongly g-convex functions defined on the hyperbolic space or a subset of the sphere , up to constants and log factors . To the best of our knowledge , this is the first method that is proved to achieve these rates globally on functions defined on a Riemannian manifoldM other than the Euclidean space . Additionally , for any Riemannian manifold of bounded sectional curvature , we provide reductions from optimization methods for smooth and gconvex functions to methods for smooth and strongly g-convex functions and vice versa . 1 INTRODUCTION . Acceleration in convex optimization is a phenomenon that has drawn lots of attention and has yielded many important results , since the renowned Accelerated Gradient Descent ( AGD ) method of Nesterov ( 1983 ) . Having been proved successful for deep learning Sutskever et al . ( 2013 ) , among other fields , there have been recent efforts to better understand this phenomenon Allen Zhu & Orecchia ( 2017 ) ; Diakonikolas & Orecchia ( 2019 ) ; Su et al . ( 2016 ) ; Wibisono et al . ( 2016 ) . These have yielded numerous new results going beyond convexity or the standard oracle model , in a wide variety of settings Allen-Zhu ( 2017 ; 2018a ; b ) ; Allen Zhu & Orecchia ( 2015 ) ; Allen Zhu et al . ( 2016 ) ; Allen-Zhu et al . ( 2017 ) ; Carmon et al . ( 2017 ) ; Cohen et al . ( 2018 ) ; Cutkosky & Sarlós ( 2019 ) ; Diakonikolas & Jordan ( 2019 ) ; Diakonikolas & Orecchia ( 2018 ) ; Gasnikov et al . ( 2019 ) ; Wang et al . ( 2016 ) . This surge of research that applies tools of convex optimization to models going beyond convexity has been fruitful . One of these models is the setting of geodesically convex Riemannian optimization . In this setting , the function to optimize is geodesically convex ( g-convex ) , i.e . convex restricted to any geodesic ( cf . Definition 1.1 ) . Riemannian optimization , g-convex and non-g-convex alike , is an extensive area of research . In recent years there have been numerous efforts towards obtaining Riemannian optimization algorithms that share analogous properties to the more broadly studied Euclidean first-order methods : deterministic de Carvalho Bento et al . ( 2017 ) ; Wei et al . ( 2016 ) ; Zhang & Sra ( 2016 ) , stochastic Hosseini & Sra ( 2017 ) ; Khuzani & Li ( 2017 ) ; Tripuraneni et al . ( 2018 ) , variance-reduced Sato et al . ( 2017 ; 2019 ) ; Zhang et al . ( 2016 ) , adaptive Kasai et al . ( 2019 ) , saddle-point-escaping Criscitiello & Boumal ( 2019 ) ; Sun et al . ( 2019 ) ; Zhang et al . ( 2018 ) ; Zhou et al . ( 2019 ) ; Criscitiello & Boumal ( 2020 ) , and projection-free methods Weber & Sra ( 2017 ; 2019 ) , among others . Unsurprisingly , Riemannian optimization has found many applications in machine learning , including low-rank matrix completion Cambier & Absil ( 2016 ) ; Heidel & Schulz ( 2018 ) ; Mishra & Sepulchre ( 2014 ) ; Tan et al . ( 2014 ) ; Vandereycken ( 2013 ) , dictionary learning Cherian & Sra ( 2017 ) ; Sun et al . ( 2017 ) , optimization under orthogonality constraints Edelman et al . ( 1998 ) , with applications to Recurrent Neural Networks Lezcano-Casado ( 2019 ) ; Lezcano-Casado & Martínez-Rubio ( 2019 ) , robust covariance estimation in Gaussian distributions Wiesel ( 2012 ) , Gaussian mixture models Hosseini & Sra ( 2015 ) , operator scaling Allen-Zhu et al . ( 2018 ) , and sparse principal component analysis Genicot et al . ( 2015 ) ; Huang & Wei ( 2019b ) ; Jolliffe et al . ( 2003 ) . However , the acceleration phenomenon , largely celebrated in the Euclidean space , is still not understood in Riemannian manifolds , although there has been some progress on this topic recently ( cf . Related work ) . This poses the following question , which is the central subject of this paper : Can a Riemannian first-order method enjoy the same rates as AGD in the Euclidean space ? In this work , we provide an answer in the affirmative for functions defined on hyperbolic and spherical spaces , up to constants depending on the curvature and the initial distance to an optimum , and up to log factors . In particular , the main results of this work are the following . Main Results : • Full acceleration . We design algorithms that provably achieve the same rates of convergence as AGD in the Euclidean space , up to constants and log factors . More precisely , we obtain the rates Õ ( L/ √ ε ) and O∗ ( √ L/µ log ( µ/ε ) ) when optimizing L-smooth functions that are , respectively , g-convex and µ-strongly g-convex , defined on the hyperbolic space or a subset of the sphere . The notation Õ ( · ) and O∗ ( · ) omits log ( L/ε ) and log ( L/µ ) factors , respectively , and constants . Previous approaches only showed local results Zhang & Sra ( 2018 ) or obtained results with rates in between the ones obtainable by Riemannian Gradient Descent ( RGD ) and AGD Ahn & Sra ( 2020 ) . Moreover , these previous works only apply to functions that are smooth and strongly g-convex and not to smooth functions that are only g-convex . As a proxy , we design an accelerated algorithm under a condition between of convexity and quasar-convexity in the constrained setting , which is of independent interest . • Reductions . We present two reductions for any Riemannian manifold of bounded sectional curvature . Given an optimization method for smooth and g-convex functions they provide a method for optimizing smooth and strongly g-convex functions , and vice versa . This allows to focus on designing methods for one set of assumptions only . It is often the case that methods and key geometric inequalities that apply to manifolds with bounded sectional curvatures are obtained from the ones existing for the spaces of constant extremal sectional curvature Grove et al . ( 1997 ) ; Zhang & Sra ( 2016 ; 2018 ) . Consequently , our contribution is relevant not only because we establish an algorithm achieving global acceleration on functions defined on a manifold other than the Euclidean space , but also because understanding the constant sectional curvature case is an important step towards understanding the more general case of obtaining algorithms that optimize g-convex functions , strongly or not , defined on manifolds of bounded sectional curvature . Our main technique for designing the accelerated method consists of mapping the function domain to a subset B of the Euclidean space via a geodesic map : a transformation that maps geodesics to geodesics . Given the gradient of a point x ∈M , which defines a lower bound on the function that is linear over the tangent space of x , we find a lower bound of the function that is linear over B , despite the map being non-conformal , deforming distances , and breaking convexity . This allows to aggregate the lower bounds easily . We believe that effective lower bound aggregation is key to achieving Riemannian acceleration and optimality . Using this strategy , we are able to provide an algorithm along the lines of the one in Diakonikolas & Orecchia ( 2018 ) to define a continuous method that we discretize using an approximate implementation of the implicit Euler method , obtaining a method achieving the same rates as the Euclidean AGD , up to constants and log factors . Our reductions take into account the deformations produced by the geometry to generalize existing Euclidean reductions Allen Zhu & Hazan ( 2016 ) ; Allen Zhu & Orecchia ( 2017 ) . Basic Geometric Definitions . We recall basic definitions of Riemannian geometry that we use in this work . For a thorough introduction we refer to Petersen et al . ( 2006 ) . A Riemannian manifold ( M , g ) is a real smooth manifoldM equipped with a metric g , which is a smoothly varying inner product . For x ∈M and any two vectors v , w ∈ TxM in the tangent space ofM , the inner product 〈v , w〉x is g ( v , w ) . For v ∈ TxM , the norm is defined as usual ‖v‖x def = √ 〈v , v〉x . Typically , x is known given v or w , so we will just write 〈v , w〉 or ‖v‖ if x is clear from context . A geodesic is a curve γ : [ 0 , 1 ] →M of unit speed that is locally distance minimizing . A uniquely geodesic space is a space such that for every two points there is one and only one geodesic that joins them . In such a case the exponential map Expx : TxM→M and inverse exponential map Exp−1x : M→ TxM are well defined for every pair of points , and are as follows . Given x , y ∈ M , v ∈ TxM , and a geodesic γ of length ‖v‖ such that γ ( 0 ) = x , γ ( 1 ) = y , γ′ ( 0 ) = v/‖v‖ , we have that Expx ( v ) = y and Exp−1x ( y ) = v. Note , however , that Expx ( · ) might not be defined for each v ∈ TxM . We denote by d ( x , y ) the distance between x and y . Its value is the same as ‖Exp−1x ( y ) ‖ . Given a 2-dimensional subspace V ⊆ TxM , the sectional curvature at x with respect to V is defined as the Gauss curvature of the manifold Expx ( V ) at x . Notation . Let M be a manifold and let B ⊆ Rd . We denote by h : M → B a geodesic map Kreyszig ( 1991 ) , which is a diffeomorphism such that the image and the inverse image of a geodesic is a geodesic . Usually , given an initial point x0 of our algorithm , we will have h ( x0 ) = 0 . Given a point x ∈ M we use the notation x̃ = h ( x ) and vice versa , any point in B will use a tilde . Given two points x , y ∈ M and a vector v ∈ TxM in the tangent space of x , we use the formal notation 〈v , y− x〉 def= −〈v , x− y〉 def= 〈v , Exp−1x ( y ) 〉 . Given a vector v ∈ TxM , we call ṽ ∈ Rd the vector of the same norm such that { x̃+ λ̃ṽ|λ̃ ∈ R+ , x̃+ λ̃ṽ ∈ B } = { h ( Expx ( λv ) ) |λ ∈ I ⊆ R+ } , for some interval I . Likewise , given x and a vector ṽ ∈ Rd , we define v ∈ TxM . Let x∗ be any minimizer of F : M→ R. We denote by R ≥ d ( x0 , x∗ ) a bound on the distance between x∗ and the initial point x0 . Note that this implies that x∗ ∈ Expx0 ( B̄ ( 0 , R ) ) , for the closed ball B̄ ( 0 , R ) ⊆ Tx0M . Consequently , we will work with the manifold that is a subset of a d-dimensional complete and simply connected manifold of constant sectional curvature K , namely a subset of the hyperbolic space or sphere Petersen et al . ( 2006 ) , defined as Expx0 ( B̄ ( 0 , R ) ) , with the inherited metric . Denote byH this manifold in the former case and S in the latter , and note that we are not making explicit the dependence on d , R and K. We want to work with the standard choice of uniquely geodesic manifolds Ahn & Sra ( 2020 ) ; Liu et al . ( 2017 ) ; Zhang & Sra ( 2016 ; 2018 ) . Therefore , in the case that the manifold is S , we restrict ourselves to R < π/2 √ K , so S is contained in an open hemisphere . The big O notations Õ ( · ) and O∗ ( · ) omit log ( L/ε ) and log ( L/µ ) factors , respectively , and constant factors depending on R and K. We define now the main properties that will be assumed on the function F to be minimized . Definition 1.1 ( Geodesic Convexity and Smoothness ) . Let F : M→ R be a differentiable function defined on a Riemannian manifold ( M , g ) . Given L ≥ µ > 0 , we say that F is L-smooth , and respectively µ-strongly g-convex , if for any two points x , y ∈M , F satisfies F ( y ) ≤ F ( x ) + 〈∇F ( x ) , y−x〉+ L 2 d ( x , y ) 2 , resp . F ( y ) ≥ F ( x ) + 〈∇F ( x ) , y−x〉+ µ 2 d ( x , y ) 2 . We say F is g-convex if the second inequality above , i.e . µ-strong g-convexity , is satisfied with µ = 0 . Note that we have used the formal notation above for the subtraction of points in the inner product . Comparison with Related Work . There are a number of works that study the problem of firstorder acceleration in Riemannian manifolds of bounded sectional curvature . The first study is Liu et al . ( 2017 ) . In this work , the authors develop an accelerated method with the same rates as AGD for both g-convex and strongly g-convex functions , provided that at each step a given nonlinear equation can be solved . No algorithm for solving this equation has been found and , in principle , it could be intractable or infeasible . In Alimisis et al . ( 2019 ) a continuous method analogous to the continuous approach to accelerated methods is presented , but it is not known if there exists an accelerated discretization of it . In Alimisis et al . ( 2020 ) , an algorithm presented is claimed to enjoy an accelerated rate of convergence , but fails to provide convergence when the function value gets below a potentially large constant that depends on the manifold and smoothness constant . In Huang & Wei ( 2019a ) an accelerated algorithm is presented but relying on strong geometric inequalities that are not proved to be satisfied . Zhang & Sra ( 2018 ) obtain a local algorithm that optimizes L-smooth and µ-strongly g-convex functions achieving the same rates as AGD in the Euclidean space , up to constants . That is , the initial point needs to start close to the optimum , O ( ( µ/L ) 3/4 ) close , to be precise . Their approach consists of adapting Nesterov ’ s estimate sequence technique by keeping a quadratic on TxtM that induces onM a regularized lower bound on F ( x∗ ) via Expxt ( · ) . They aggregate the information yielded by the gradient to it , and use a geometric lemma to find a quadratic in Txt+1M whose induced function lower bounds the other one . Ahn & Sra ( 2020 ) generalize the previous algorithm and , by using similar ideas for the lower bound , they adapt it to work globally , obtaining strictly better rates than RGD , recovering the local acceleration of the previous paper , but not achieving global rates comparable to the ones of AGD . In fact , they prove that their algorithm eventually decreases the function value at a rate close to AGD but this can take as many iterations as the ones needed by RGD to minimize the function . In our work , we take a step back and focus on the constant sectional curvature case to provide a global algorithm that achieves the same rates as AGD , up to constants and log factors . It is common to characterize the properties of spaces of bounded sectional curvature by using the ones of the spaces of constant extremal sectional curvature Grove et al . ( 1997 ) ; Zhang & Sra ( 2016 ; 2018 ) , which makes the study of the constant sectional curvature case critical to the development of full accelerated algorithms in the general bounded sectional curvature case . Additionally , our work studies g-convexity besides strong g-convexity . Another related work is the approximate duality gap technique Diakonikolas & Orecchia ( 2019 ) , which presents a unified view of the analysis of first-order methods for the optimization of convex functions defined in the Euclidean space . It defines a continuous duality gap and by enforcing a natural invariant , it obtains accelerated continuous dynamics and their discretizations for most classical first-order methods . A derived work Diakonikolas & Orecchia ( 2018 ) obtains acceleration in a fundamentally different way from previous acceleration approaches , namely using an approximate implicit Euler method for the discretization of the acceleration dynamics . The convergence analysis of Theorem 2.4 is inspired by these two works . We will see in the sequel that , for our manifolds of interest , g-convexity is related to a model known in the literature as quasar-convexity or weak-quasiconvexity Guminov & Gasnikov ( 2017 ) ; Hinder et al . ( 2019 ) ; Nesterov et al . ( 2018 ) .
This paper provides a generalization of AGD to constant sectional curvature spaces (or subsets of them), and proves the same global rates of convergence that hold in the Euclidean space. Additionally, they provide reductions for the bounded sectional curvature case. Their basic strategy involves the use of geodesic maps to accumulate local linear lower bounds, in a way that accounts for the geometric distortion incurred by the map.
SP:3f9266d190e590b01625de888376769d59737d81
Acceleration in Hyperbolic and Spherical Spaces
We further research on the acceleration phenomenon on Riemannian manifolds by introducing the first global first-order method that achieves the same rates as accelerated gradient descent in the Euclidean space for the optimization of smooth and geodesically convex ( g-convex ) or strongly g-convex functions defined on the hyperbolic space or a subset of the sphere , up to constants and log factors . To the best of our knowledge , this is the first method that is proved to achieve these rates globally on functions defined on a Riemannian manifoldM other than the Euclidean space . Additionally , for any Riemannian manifold of bounded sectional curvature , we provide reductions from optimization methods for smooth and gconvex functions to methods for smooth and strongly g-convex functions and vice versa . 1 INTRODUCTION . Acceleration in convex optimization is a phenomenon that has drawn lots of attention and has yielded many important results , since the renowned Accelerated Gradient Descent ( AGD ) method of Nesterov ( 1983 ) . Having been proved successful for deep learning Sutskever et al . ( 2013 ) , among other fields , there have been recent efforts to better understand this phenomenon Allen Zhu & Orecchia ( 2017 ) ; Diakonikolas & Orecchia ( 2019 ) ; Su et al . ( 2016 ) ; Wibisono et al . ( 2016 ) . These have yielded numerous new results going beyond convexity or the standard oracle model , in a wide variety of settings Allen-Zhu ( 2017 ; 2018a ; b ) ; Allen Zhu & Orecchia ( 2015 ) ; Allen Zhu et al . ( 2016 ) ; Allen-Zhu et al . ( 2017 ) ; Carmon et al . ( 2017 ) ; Cohen et al . ( 2018 ) ; Cutkosky & Sarlós ( 2019 ) ; Diakonikolas & Jordan ( 2019 ) ; Diakonikolas & Orecchia ( 2018 ) ; Gasnikov et al . ( 2019 ) ; Wang et al . ( 2016 ) . This surge of research that applies tools of convex optimization to models going beyond convexity has been fruitful . One of these models is the setting of geodesically convex Riemannian optimization . In this setting , the function to optimize is geodesically convex ( g-convex ) , i.e . convex restricted to any geodesic ( cf . Definition 1.1 ) . Riemannian optimization , g-convex and non-g-convex alike , is an extensive area of research . In recent years there have been numerous efforts towards obtaining Riemannian optimization algorithms that share analogous properties to the more broadly studied Euclidean first-order methods : deterministic de Carvalho Bento et al . ( 2017 ) ; Wei et al . ( 2016 ) ; Zhang & Sra ( 2016 ) , stochastic Hosseini & Sra ( 2017 ) ; Khuzani & Li ( 2017 ) ; Tripuraneni et al . ( 2018 ) , variance-reduced Sato et al . ( 2017 ; 2019 ) ; Zhang et al . ( 2016 ) , adaptive Kasai et al . ( 2019 ) , saddle-point-escaping Criscitiello & Boumal ( 2019 ) ; Sun et al . ( 2019 ) ; Zhang et al . ( 2018 ) ; Zhou et al . ( 2019 ) ; Criscitiello & Boumal ( 2020 ) , and projection-free methods Weber & Sra ( 2017 ; 2019 ) , among others . Unsurprisingly , Riemannian optimization has found many applications in machine learning , including low-rank matrix completion Cambier & Absil ( 2016 ) ; Heidel & Schulz ( 2018 ) ; Mishra & Sepulchre ( 2014 ) ; Tan et al . ( 2014 ) ; Vandereycken ( 2013 ) , dictionary learning Cherian & Sra ( 2017 ) ; Sun et al . ( 2017 ) , optimization under orthogonality constraints Edelman et al . ( 1998 ) , with applications to Recurrent Neural Networks Lezcano-Casado ( 2019 ) ; Lezcano-Casado & Martínez-Rubio ( 2019 ) , robust covariance estimation in Gaussian distributions Wiesel ( 2012 ) , Gaussian mixture models Hosseini & Sra ( 2015 ) , operator scaling Allen-Zhu et al . ( 2018 ) , and sparse principal component analysis Genicot et al . ( 2015 ) ; Huang & Wei ( 2019b ) ; Jolliffe et al . ( 2003 ) . However , the acceleration phenomenon , largely celebrated in the Euclidean space , is still not understood in Riemannian manifolds , although there has been some progress on this topic recently ( cf . Related work ) . This poses the following question , which is the central subject of this paper : Can a Riemannian first-order method enjoy the same rates as AGD in the Euclidean space ? In this work , we provide an answer in the affirmative for functions defined on hyperbolic and spherical spaces , up to constants depending on the curvature and the initial distance to an optimum , and up to log factors . In particular , the main results of this work are the following . Main Results : • Full acceleration . We design algorithms that provably achieve the same rates of convergence as AGD in the Euclidean space , up to constants and log factors . More precisely , we obtain the rates Õ ( L/ √ ε ) and O∗ ( √ L/µ log ( µ/ε ) ) when optimizing L-smooth functions that are , respectively , g-convex and µ-strongly g-convex , defined on the hyperbolic space or a subset of the sphere . The notation Õ ( · ) and O∗ ( · ) omits log ( L/ε ) and log ( L/µ ) factors , respectively , and constants . Previous approaches only showed local results Zhang & Sra ( 2018 ) or obtained results with rates in between the ones obtainable by Riemannian Gradient Descent ( RGD ) and AGD Ahn & Sra ( 2020 ) . Moreover , these previous works only apply to functions that are smooth and strongly g-convex and not to smooth functions that are only g-convex . As a proxy , we design an accelerated algorithm under a condition between of convexity and quasar-convexity in the constrained setting , which is of independent interest . • Reductions . We present two reductions for any Riemannian manifold of bounded sectional curvature . Given an optimization method for smooth and g-convex functions they provide a method for optimizing smooth and strongly g-convex functions , and vice versa . This allows to focus on designing methods for one set of assumptions only . It is often the case that methods and key geometric inequalities that apply to manifolds with bounded sectional curvatures are obtained from the ones existing for the spaces of constant extremal sectional curvature Grove et al . ( 1997 ) ; Zhang & Sra ( 2016 ; 2018 ) . Consequently , our contribution is relevant not only because we establish an algorithm achieving global acceleration on functions defined on a manifold other than the Euclidean space , but also because understanding the constant sectional curvature case is an important step towards understanding the more general case of obtaining algorithms that optimize g-convex functions , strongly or not , defined on manifolds of bounded sectional curvature . Our main technique for designing the accelerated method consists of mapping the function domain to a subset B of the Euclidean space via a geodesic map : a transformation that maps geodesics to geodesics . Given the gradient of a point x ∈M , which defines a lower bound on the function that is linear over the tangent space of x , we find a lower bound of the function that is linear over B , despite the map being non-conformal , deforming distances , and breaking convexity . This allows to aggregate the lower bounds easily . We believe that effective lower bound aggregation is key to achieving Riemannian acceleration and optimality . Using this strategy , we are able to provide an algorithm along the lines of the one in Diakonikolas & Orecchia ( 2018 ) to define a continuous method that we discretize using an approximate implementation of the implicit Euler method , obtaining a method achieving the same rates as the Euclidean AGD , up to constants and log factors . Our reductions take into account the deformations produced by the geometry to generalize existing Euclidean reductions Allen Zhu & Hazan ( 2016 ) ; Allen Zhu & Orecchia ( 2017 ) . Basic Geometric Definitions . We recall basic definitions of Riemannian geometry that we use in this work . For a thorough introduction we refer to Petersen et al . ( 2006 ) . A Riemannian manifold ( M , g ) is a real smooth manifoldM equipped with a metric g , which is a smoothly varying inner product . For x ∈M and any two vectors v , w ∈ TxM in the tangent space ofM , the inner product 〈v , w〉x is g ( v , w ) . For v ∈ TxM , the norm is defined as usual ‖v‖x def = √ 〈v , v〉x . Typically , x is known given v or w , so we will just write 〈v , w〉 or ‖v‖ if x is clear from context . A geodesic is a curve γ : [ 0 , 1 ] →M of unit speed that is locally distance minimizing . A uniquely geodesic space is a space such that for every two points there is one and only one geodesic that joins them . In such a case the exponential map Expx : TxM→M and inverse exponential map Exp−1x : M→ TxM are well defined for every pair of points , and are as follows . Given x , y ∈ M , v ∈ TxM , and a geodesic γ of length ‖v‖ such that γ ( 0 ) = x , γ ( 1 ) = y , γ′ ( 0 ) = v/‖v‖ , we have that Expx ( v ) = y and Exp−1x ( y ) = v. Note , however , that Expx ( · ) might not be defined for each v ∈ TxM . We denote by d ( x , y ) the distance between x and y . Its value is the same as ‖Exp−1x ( y ) ‖ . Given a 2-dimensional subspace V ⊆ TxM , the sectional curvature at x with respect to V is defined as the Gauss curvature of the manifold Expx ( V ) at x . Notation . Let M be a manifold and let B ⊆ Rd . We denote by h : M → B a geodesic map Kreyszig ( 1991 ) , which is a diffeomorphism such that the image and the inverse image of a geodesic is a geodesic . Usually , given an initial point x0 of our algorithm , we will have h ( x0 ) = 0 . Given a point x ∈ M we use the notation x̃ = h ( x ) and vice versa , any point in B will use a tilde . Given two points x , y ∈ M and a vector v ∈ TxM in the tangent space of x , we use the formal notation 〈v , y− x〉 def= −〈v , x− y〉 def= 〈v , Exp−1x ( y ) 〉 . Given a vector v ∈ TxM , we call ṽ ∈ Rd the vector of the same norm such that { x̃+ λ̃ṽ|λ̃ ∈ R+ , x̃+ λ̃ṽ ∈ B } = { h ( Expx ( λv ) ) |λ ∈ I ⊆ R+ } , for some interval I . Likewise , given x and a vector ṽ ∈ Rd , we define v ∈ TxM . Let x∗ be any minimizer of F : M→ R. We denote by R ≥ d ( x0 , x∗ ) a bound on the distance between x∗ and the initial point x0 . Note that this implies that x∗ ∈ Expx0 ( B̄ ( 0 , R ) ) , for the closed ball B̄ ( 0 , R ) ⊆ Tx0M . Consequently , we will work with the manifold that is a subset of a d-dimensional complete and simply connected manifold of constant sectional curvature K , namely a subset of the hyperbolic space or sphere Petersen et al . ( 2006 ) , defined as Expx0 ( B̄ ( 0 , R ) ) , with the inherited metric . Denote byH this manifold in the former case and S in the latter , and note that we are not making explicit the dependence on d , R and K. We want to work with the standard choice of uniquely geodesic manifolds Ahn & Sra ( 2020 ) ; Liu et al . ( 2017 ) ; Zhang & Sra ( 2016 ; 2018 ) . Therefore , in the case that the manifold is S , we restrict ourselves to R < π/2 √ K , so S is contained in an open hemisphere . The big O notations Õ ( · ) and O∗ ( · ) omit log ( L/ε ) and log ( L/µ ) factors , respectively , and constant factors depending on R and K. We define now the main properties that will be assumed on the function F to be minimized . Definition 1.1 ( Geodesic Convexity and Smoothness ) . Let F : M→ R be a differentiable function defined on a Riemannian manifold ( M , g ) . Given L ≥ µ > 0 , we say that F is L-smooth , and respectively µ-strongly g-convex , if for any two points x , y ∈M , F satisfies F ( y ) ≤ F ( x ) + 〈∇F ( x ) , y−x〉+ L 2 d ( x , y ) 2 , resp . F ( y ) ≥ F ( x ) + 〈∇F ( x ) , y−x〉+ µ 2 d ( x , y ) 2 . We say F is g-convex if the second inequality above , i.e . µ-strong g-convexity , is satisfied with µ = 0 . Note that we have used the formal notation above for the subtraction of points in the inner product . Comparison with Related Work . There are a number of works that study the problem of firstorder acceleration in Riemannian manifolds of bounded sectional curvature . The first study is Liu et al . ( 2017 ) . In this work , the authors develop an accelerated method with the same rates as AGD for both g-convex and strongly g-convex functions , provided that at each step a given nonlinear equation can be solved . No algorithm for solving this equation has been found and , in principle , it could be intractable or infeasible . In Alimisis et al . ( 2019 ) a continuous method analogous to the continuous approach to accelerated methods is presented , but it is not known if there exists an accelerated discretization of it . In Alimisis et al . ( 2020 ) , an algorithm presented is claimed to enjoy an accelerated rate of convergence , but fails to provide convergence when the function value gets below a potentially large constant that depends on the manifold and smoothness constant . In Huang & Wei ( 2019a ) an accelerated algorithm is presented but relying on strong geometric inequalities that are not proved to be satisfied . Zhang & Sra ( 2018 ) obtain a local algorithm that optimizes L-smooth and µ-strongly g-convex functions achieving the same rates as AGD in the Euclidean space , up to constants . That is , the initial point needs to start close to the optimum , O ( ( µ/L ) 3/4 ) close , to be precise . Their approach consists of adapting Nesterov ’ s estimate sequence technique by keeping a quadratic on TxtM that induces onM a regularized lower bound on F ( x∗ ) via Expxt ( · ) . They aggregate the information yielded by the gradient to it , and use a geometric lemma to find a quadratic in Txt+1M whose induced function lower bounds the other one . Ahn & Sra ( 2020 ) generalize the previous algorithm and , by using similar ideas for the lower bound , they adapt it to work globally , obtaining strictly better rates than RGD , recovering the local acceleration of the previous paper , but not achieving global rates comparable to the ones of AGD . In fact , they prove that their algorithm eventually decreases the function value at a rate close to AGD but this can take as many iterations as the ones needed by RGD to minimize the function . In our work , we take a step back and focus on the constant sectional curvature case to provide a global algorithm that achieves the same rates as AGD , up to constants and log factors . It is common to characterize the properties of spaces of bounded sectional curvature by using the ones of the spaces of constant extremal sectional curvature Grove et al . ( 1997 ) ; Zhang & Sra ( 2016 ; 2018 ) , which makes the study of the constant sectional curvature case critical to the development of full accelerated algorithms in the general bounded sectional curvature case . Additionally , our work studies g-convexity besides strong g-convexity . Another related work is the approximate duality gap technique Diakonikolas & Orecchia ( 2019 ) , which presents a unified view of the analysis of first-order methods for the optimization of convex functions defined in the Euclidean space . It defines a continuous duality gap and by enforcing a natural invariant , it obtains accelerated continuous dynamics and their discretizations for most classical first-order methods . A derived work Diakonikolas & Orecchia ( 2018 ) obtains acceleration in a fundamentally different way from previous acceleration approaches , namely using an approximate implicit Euler method for the discretization of the acceleration dynamics . The convergence analysis of Theorem 2.4 is inspired by these two works . We will see in the sequel that , for our manifolds of interest , g-convexity is related to a model known in the literature as quasar-convexity or weak-quasiconvexity Guminov & Gasnikov ( 2017 ) ; Hinder et al . ( 2019 ) ; Nesterov et al . ( 2018 ) .
This paper considered the problem of minimizing (strongly and non-strongly) geodesically convex functions on hyperbolic and spherical manifolds, manifolds of constant curvature 1 and -1, respectively, and proposed accelerated algorithms for such problems. In particular, the author(s) showed the proposed algorithms enjoy global accelerated rates that match their Euclidean counterparts. A key to the main result is Lemma 2.2 which asserts a certain quasar convexity-type condition of the pull-back of the objective function to some Euclidean domain through a geodesic map. Based on this lemma, the main result follows from combining techniques for developing accelerated algorithms in Euclidean space, such as the approximate duality gap technique and a certain discretization scheme for continuous dynamics. Some reduction results, which obtain accelerated algorithms for the strongly convex case from the non-strongly convex case, and vice versa, are also presented.
SP:3f9266d190e590b01625de888376769d59737d81
Selectivity considered harmful: evaluating the causal impact of class selectivity in DNNs
1 INTRODUCTION . Our ability to understand deep learning systems lags considerably behind our ability to obtain practical outcomes with them . A breadth of approaches have been developed in attempts to better understand deep learning systems and render them more comprehensible to humans ( Yosinski et al. , 2015 ; Bau et al. , 2017 ; Olah et al. , 2018 ; Hooker et al. , 2019 ) . Many of these approaches examine the properties of single neurons and treat them as representative of the networks in which they ’ re embedded ( Erhan et al. , 2009 ; Zeiler and Fergus , 2014 ; Karpathy et al. , 2016 ; Amjad et al. , 2018 ; Lillian et al. , 2018 ; Dhamdhere et al. , 2019 ; Olah et al. , 2020 ) . The selectivity of individual units ( i.e . the variability in a neuron ’ s responses across data classes or dimensions ) is one property that has been of particular interest to researchers trying to better understand deep neural networks ( DNNs ) ( Zhou et al. , 2015 ; Olah et al. , 2017 ; Morcos et al. , 2018b ; Zhou et al. , 2018 ; Meyes et al. , 2019 ; Na et al. , 2019 ; Zhou et al. , 2019 ; Rafegas et al. , 2019 ; Bau et al. , 2020 ) . This focus on individual neurons makes intuitive sense , as the tractable , semantic nature of selectivity is extremely alluring ; some measure of selectivity in individual units is often provided as an explanation of `` what '' a network is `` doing '' . One notable study highlighted a neuron selective for sentiment in an LSTM network trained on a word prediction task ( Radford et al. , 2017 ) . Another attributed visualizable , semantic features to the activity of individual neurons across GoogLeNet trained on ImageNet ( Olah et al. , 2017 ) . Both of these examples influenced many subsequent studies , demonstrating the widespread , intuitive appeal of `` selectivity '' ( Amjad et al. , 2018 ; Meyes et al. , 2019 ; Morcos et al. , 2018b ; Zhou et al. , 2015 ; 2018 ; Bau et al. , 2017 ; Karpathy et al. , 2016 ; Na et al. , 2019 ; Radford et al. , 2017 ; Rafegas et al. , 2019 ; Morcos et al. , 2018b ; Olah et al. , 2017 ; 2018 ; 2020 ) . ∗Work performed as part of the Facebook AI Residency Finding intuitive ways of representing the workings of DNNs is essential for making them understandable and accountable , but we must ensure that our approaches are based on meaningful properties of the system . Recent studies have begun to address this issue by investigating the relationships between selectivity and measures of network function such as generalization and robustness to perturbation ( Morcos et al. , 2018b ; Zhou et al. , 2018 ; Dalvi et al. , 2019 ) . Selectivity has also been used as the basis for targeted modulation of neural network function through individual units ( Bau et al. , 2019a ; b ) . However there is also growing evidence from experiments in both deep learning ( Fong and Vedaldi , 2018 ; Morcos et al. , 2018b ; Gale et al. , 2019 ; Donnelly and Roegiest , 2019 ) and neuroscience ( Leavitt et al. , 2017 ; Zylberberg , 2018 ; Insanally et al. , 2019 ) that single unit selectivity may not be as important as once thought . Previous studies examining the functional role of selectivity in DNNs have often measured how selectivity mediates the effects of ablating single units , or used indirect , correlational approaches that modulate selectivity indirectly ( e.g . batch norm ) ( Morcos et al. , 2018b ; Zhou et al. , 2018 ; Lillian et al. , 2018 ; Meyes et al. , 2019 ; Kanda et al. , 2020 ) . But single unit ablation in trained networks has two critical limitations : it can not address whether the presence of selectivity is beneficial , nor whether networks need to learn selectivity to function properly . It can only address the effect of removing a neuron from a network whose training process assumed the presence of that neuron . And even then , the observed effect might be misleading . For example , a property that is critical to network function may be replicated across multiple neurons . This redundancy means that ablating any one of these neurons would show little effect , and could thus lead to the erroneous conclusion that the examined property has little impact on network function . We were motivated by these issues to pursue a series of experiments investigating the causal importance of class selectivity in artificial neural networks . To do so , we introduced a term to the loss function that allows us to directly regularize for or against class selectivity , giving us a single knob to control class selectivity in the network . The selectivity regularizer sidesteps the limitations of single unit ablation and other indirect techniques , allowing us to conduct a series of experiments evaluating the causal impact of class selectivity on DNN performance . Our findings are as follows : • Performance can be improved by reducing class selectivity , suggesting that naturally-learned levels of class selectivity can be detrimental . Reducing class selectivity could improve test accuracy by over 2 % in ResNet18 and 1 % in ResNet50 trained on Tiny ImageNet . • Even when class selectivity isn ’ t detrimental to network function , it remains largely unnecessary . We reduced the mean class selectivity of units in ResNet20 trained on CIFAR10 by a factor of ∼2.5 with no impact on test accuracy , and by a factor of ∼20—nearly to a mean of 0—with only a 2 % change in test accuracy . • Our regularizer does not simply cause networks to preserve class-selectivity by rotating it off of unit-aligned axes ( i.e . by distributing selectivity linearly across units ) , but rather seems to suppress selectivity more generally , even when optimizing for high-selectivity basis sets . This demonstrates the viability of low-selectivity representations distributed across units . • We show that regularizing to increase class selectivity , even by small amounts , has significant negative effects on performance . Trained networks seem to be perched precariously at a performance cliff with regard to class selectivity . These results indicate that the levels of class selectivity learned by individual units in the absence of explicit regularization are at the limit of what will impair the network . Our findings collectively demonstrate that class selectivity in individual units is neither necessary nor sufficient for convolutional neural networks ( CNNs ) to perform image classification tasks , and in some cases can actually be detrimental . This alludes to the possibility of class selectivity regularization as a technique for improving CNN performance . More generally , our results encourage caution when focusing on the properties of single units as representative of the mechanisms by which CNNs function , and emphasize the importance of analyses that examine properties across neurons ( i.e . distributed representations ) . Most importantly , our results are a reminder to verify that the properties we do focus on are actually relevant to CNN function . 2 RELATED WORK . 2.1 SELECTIVITY IN DEEP LEARNING . Examining some form of selectivity in individual units constitutes the bedrock of many approaches to understanding DNNs . Sometimes the goal is simply to visualize selectivity , which has been pursued using a breadth of methods . These include identifying the input sample ( s ) ( e.g . images ) or sample subregions that maximally activate a given neuron ( Zhou et al. , 2015 ; Rafegas et al. , 2019 ) , and numerous optimization-based techniques for generating samples that maximize unit activations ( Erhan et al. , 2009 ; Zeiler and Fergus , 2014 ; Simonyan et al. , 2014 ; Yosinski et al. , 2015 ; Nguyen et al. , 2016 ; Olah et al. , 2017 ; 2018 ) . While the different methods for quantifying single unit selectivity are often conceptually quite similar ( measuring how variable are a neuron ’ s responses across different classes of data samples ) , they have been applied across a broad range of contexts ( Amjad et al. , 2018 ; Meyes et al. , 2019 ; Morcos et al. , 2018b ; Zhou et al. , 2015 ; 2018 ; Bau et al. , 2017 ; Karpathy et al. , 2016 ; Na et al. , 2019 ; Radford et al. , 2017 ; Rafegas et al. , 2019 ) . For example , Bau et al . ( 2017 ) quantified single unit selectivity for `` concepts '' ( as annotated by humans ) in networks trained for object and scene recognition . Olah et al . ( 2018 ; 2020 ) have pursued a research program examining single unit selectivity as a building block for understanding DNNs . And single units in models trained to solve natural language processing tasks have been found to exhibit selectivity for syntactical and semantic features ( Karpathy et al. , 2016 ; Na et al. , 2019 ) , of which the `` sentiment-selective neuron '' reported by Radford et al . ( 2017 ) is a particularly recognized example . The relationship between individual unit selectivity and various measures of DNN performance have been examined in prior studies , but the conclusions have not been concordant . Morcos et al . ( 2018b ) , using single unit ablation and other techniques , found that a network ’ s test set generalization is negatively correlated ( or uncorrelated ) with the class selectivity of its units , a finding replicated by Kanda et al . ( 2020 ) . In contrast , though Amjad et al . ( 2018 ) confirmed these results for single unit ablation , they also performed cumulative ablation analyses which suggested that selectivity is beneficial , suggesting that redundancy across units may make it difficult to interpret single unit ablation studies . In a follow-up study , Zhou et al . ( 2018 ) found that ablating class-selective units impairs classification accuracy for specific classes ( though interestingly , not always the same class the unit was selective for ) , but a compensatory increase in accuracy for other classes can often leave overall accuracy unaffected . Ukita ( 2018 ) found that orientation selectivity in individual units is correlated with generalization performance in convolutional neural networks ( CNNs ) , and that ablating highly orientation-selective units impairs classification accuracy more than ablating units with low orientation-selectivity . But while orientation selectivity and class selectivity can both be considered types of feature selectivity , orientation selectivity is far less abstract and focuses on specific properties of the image ( e.g. , oriented edges ) rather than semantically meaningful concepts and classes . Nevertheless , this study still demonstrates the importance of some types of selectivity . Results are also variable for models trained on NLP tasks . Dalvi et al . ( 2019 ) found that ablating units selective for linguistic features causes greater performance deficits than ablating less-selective units , while Donnelly and Roegiest ( 2019 ) found that ablating the `` sentiment neuron '' of Radford et al . ( 2017 ) has equivocal effects on performance . These findings seem challenging to reconcile . All of these studies examining class selectivity in single units are hamstrung by their reliance on single unit ablation , which could account for their conflicting results . As discussed earlier , single unit ablation can only address whether class selectivity affects performance in trained networks , and not whether individual units to need to learn class selectivity for optimal network function . And even then , the conclusions obtained from single neuron ablation analyses can be misleading due to redundancy across units ( Amjad et al. , 2018 ; Meyes et al. , 2019 ) .
This paper examines the impact of forcing units in a CNN to be more or less “class-selective” – i.e. respond preferentially to one image class compared to another. The approach taken is to include a regularizer in the loss that directly penalizes or encourages class selectivity in individual units. They report that penalizing class selectivity at intermediate layers has little-to-no effect on classification performance, and in some cases mildly improves performance. They authors conclude that class selectivity is not an essential component of successful performance in CNNs, and that methods which use class selectivity to interpret CNNs should be approached with caution.
SP:759f85692cb4edfe6521d013dbbb55e20a458a4b
Selectivity considered harmful: evaluating the causal impact of class selectivity in DNNs
1 INTRODUCTION . Our ability to understand deep learning systems lags considerably behind our ability to obtain practical outcomes with them . A breadth of approaches have been developed in attempts to better understand deep learning systems and render them more comprehensible to humans ( Yosinski et al. , 2015 ; Bau et al. , 2017 ; Olah et al. , 2018 ; Hooker et al. , 2019 ) . Many of these approaches examine the properties of single neurons and treat them as representative of the networks in which they ’ re embedded ( Erhan et al. , 2009 ; Zeiler and Fergus , 2014 ; Karpathy et al. , 2016 ; Amjad et al. , 2018 ; Lillian et al. , 2018 ; Dhamdhere et al. , 2019 ; Olah et al. , 2020 ) . The selectivity of individual units ( i.e . the variability in a neuron ’ s responses across data classes or dimensions ) is one property that has been of particular interest to researchers trying to better understand deep neural networks ( DNNs ) ( Zhou et al. , 2015 ; Olah et al. , 2017 ; Morcos et al. , 2018b ; Zhou et al. , 2018 ; Meyes et al. , 2019 ; Na et al. , 2019 ; Zhou et al. , 2019 ; Rafegas et al. , 2019 ; Bau et al. , 2020 ) . This focus on individual neurons makes intuitive sense , as the tractable , semantic nature of selectivity is extremely alluring ; some measure of selectivity in individual units is often provided as an explanation of `` what '' a network is `` doing '' . One notable study highlighted a neuron selective for sentiment in an LSTM network trained on a word prediction task ( Radford et al. , 2017 ) . Another attributed visualizable , semantic features to the activity of individual neurons across GoogLeNet trained on ImageNet ( Olah et al. , 2017 ) . Both of these examples influenced many subsequent studies , demonstrating the widespread , intuitive appeal of `` selectivity '' ( Amjad et al. , 2018 ; Meyes et al. , 2019 ; Morcos et al. , 2018b ; Zhou et al. , 2015 ; 2018 ; Bau et al. , 2017 ; Karpathy et al. , 2016 ; Na et al. , 2019 ; Radford et al. , 2017 ; Rafegas et al. , 2019 ; Morcos et al. , 2018b ; Olah et al. , 2017 ; 2018 ; 2020 ) . ∗Work performed as part of the Facebook AI Residency Finding intuitive ways of representing the workings of DNNs is essential for making them understandable and accountable , but we must ensure that our approaches are based on meaningful properties of the system . Recent studies have begun to address this issue by investigating the relationships between selectivity and measures of network function such as generalization and robustness to perturbation ( Morcos et al. , 2018b ; Zhou et al. , 2018 ; Dalvi et al. , 2019 ) . Selectivity has also been used as the basis for targeted modulation of neural network function through individual units ( Bau et al. , 2019a ; b ) . However there is also growing evidence from experiments in both deep learning ( Fong and Vedaldi , 2018 ; Morcos et al. , 2018b ; Gale et al. , 2019 ; Donnelly and Roegiest , 2019 ) and neuroscience ( Leavitt et al. , 2017 ; Zylberberg , 2018 ; Insanally et al. , 2019 ) that single unit selectivity may not be as important as once thought . Previous studies examining the functional role of selectivity in DNNs have often measured how selectivity mediates the effects of ablating single units , or used indirect , correlational approaches that modulate selectivity indirectly ( e.g . batch norm ) ( Morcos et al. , 2018b ; Zhou et al. , 2018 ; Lillian et al. , 2018 ; Meyes et al. , 2019 ; Kanda et al. , 2020 ) . But single unit ablation in trained networks has two critical limitations : it can not address whether the presence of selectivity is beneficial , nor whether networks need to learn selectivity to function properly . It can only address the effect of removing a neuron from a network whose training process assumed the presence of that neuron . And even then , the observed effect might be misleading . For example , a property that is critical to network function may be replicated across multiple neurons . This redundancy means that ablating any one of these neurons would show little effect , and could thus lead to the erroneous conclusion that the examined property has little impact on network function . We were motivated by these issues to pursue a series of experiments investigating the causal importance of class selectivity in artificial neural networks . To do so , we introduced a term to the loss function that allows us to directly regularize for or against class selectivity , giving us a single knob to control class selectivity in the network . The selectivity regularizer sidesteps the limitations of single unit ablation and other indirect techniques , allowing us to conduct a series of experiments evaluating the causal impact of class selectivity on DNN performance . Our findings are as follows : • Performance can be improved by reducing class selectivity , suggesting that naturally-learned levels of class selectivity can be detrimental . Reducing class selectivity could improve test accuracy by over 2 % in ResNet18 and 1 % in ResNet50 trained on Tiny ImageNet . • Even when class selectivity isn ’ t detrimental to network function , it remains largely unnecessary . We reduced the mean class selectivity of units in ResNet20 trained on CIFAR10 by a factor of ∼2.5 with no impact on test accuracy , and by a factor of ∼20—nearly to a mean of 0—with only a 2 % change in test accuracy . • Our regularizer does not simply cause networks to preserve class-selectivity by rotating it off of unit-aligned axes ( i.e . by distributing selectivity linearly across units ) , but rather seems to suppress selectivity more generally , even when optimizing for high-selectivity basis sets . This demonstrates the viability of low-selectivity representations distributed across units . • We show that regularizing to increase class selectivity , even by small amounts , has significant negative effects on performance . Trained networks seem to be perched precariously at a performance cliff with regard to class selectivity . These results indicate that the levels of class selectivity learned by individual units in the absence of explicit regularization are at the limit of what will impair the network . Our findings collectively demonstrate that class selectivity in individual units is neither necessary nor sufficient for convolutional neural networks ( CNNs ) to perform image classification tasks , and in some cases can actually be detrimental . This alludes to the possibility of class selectivity regularization as a technique for improving CNN performance . More generally , our results encourage caution when focusing on the properties of single units as representative of the mechanisms by which CNNs function , and emphasize the importance of analyses that examine properties across neurons ( i.e . distributed representations ) . Most importantly , our results are a reminder to verify that the properties we do focus on are actually relevant to CNN function . 2 RELATED WORK . 2.1 SELECTIVITY IN DEEP LEARNING . Examining some form of selectivity in individual units constitutes the bedrock of many approaches to understanding DNNs . Sometimes the goal is simply to visualize selectivity , which has been pursued using a breadth of methods . These include identifying the input sample ( s ) ( e.g . images ) or sample subregions that maximally activate a given neuron ( Zhou et al. , 2015 ; Rafegas et al. , 2019 ) , and numerous optimization-based techniques for generating samples that maximize unit activations ( Erhan et al. , 2009 ; Zeiler and Fergus , 2014 ; Simonyan et al. , 2014 ; Yosinski et al. , 2015 ; Nguyen et al. , 2016 ; Olah et al. , 2017 ; 2018 ) . While the different methods for quantifying single unit selectivity are often conceptually quite similar ( measuring how variable are a neuron ’ s responses across different classes of data samples ) , they have been applied across a broad range of contexts ( Amjad et al. , 2018 ; Meyes et al. , 2019 ; Morcos et al. , 2018b ; Zhou et al. , 2015 ; 2018 ; Bau et al. , 2017 ; Karpathy et al. , 2016 ; Na et al. , 2019 ; Radford et al. , 2017 ; Rafegas et al. , 2019 ) . For example , Bau et al . ( 2017 ) quantified single unit selectivity for `` concepts '' ( as annotated by humans ) in networks trained for object and scene recognition . Olah et al . ( 2018 ; 2020 ) have pursued a research program examining single unit selectivity as a building block for understanding DNNs . And single units in models trained to solve natural language processing tasks have been found to exhibit selectivity for syntactical and semantic features ( Karpathy et al. , 2016 ; Na et al. , 2019 ) , of which the `` sentiment-selective neuron '' reported by Radford et al . ( 2017 ) is a particularly recognized example . The relationship between individual unit selectivity and various measures of DNN performance have been examined in prior studies , but the conclusions have not been concordant . Morcos et al . ( 2018b ) , using single unit ablation and other techniques , found that a network ’ s test set generalization is negatively correlated ( or uncorrelated ) with the class selectivity of its units , a finding replicated by Kanda et al . ( 2020 ) . In contrast , though Amjad et al . ( 2018 ) confirmed these results for single unit ablation , they also performed cumulative ablation analyses which suggested that selectivity is beneficial , suggesting that redundancy across units may make it difficult to interpret single unit ablation studies . In a follow-up study , Zhou et al . ( 2018 ) found that ablating class-selective units impairs classification accuracy for specific classes ( though interestingly , not always the same class the unit was selective for ) , but a compensatory increase in accuracy for other classes can often leave overall accuracy unaffected . Ukita ( 2018 ) found that orientation selectivity in individual units is correlated with generalization performance in convolutional neural networks ( CNNs ) , and that ablating highly orientation-selective units impairs classification accuracy more than ablating units with low orientation-selectivity . But while orientation selectivity and class selectivity can both be considered types of feature selectivity , orientation selectivity is far less abstract and focuses on specific properties of the image ( e.g. , oriented edges ) rather than semantically meaningful concepts and classes . Nevertheless , this study still demonstrates the importance of some types of selectivity . Results are also variable for models trained on NLP tasks . Dalvi et al . ( 2019 ) found that ablating units selective for linguistic features causes greater performance deficits than ablating less-selective units , while Donnelly and Roegiest ( 2019 ) found that ablating the `` sentiment neuron '' of Radford et al . ( 2017 ) has equivocal effects on performance . These findings seem challenging to reconcile . All of these studies examining class selectivity in single units are hamstrung by their reliance on single unit ablation , which could account for their conflicting results . As discussed earlier , single unit ablation can only address whether class selectivity affects performance in trained networks , and not whether individual units to need to learn class selectivity for optimal network function . And even then , the conclusions obtained from single neuron ablation analyses can be misleading due to redundancy across units ( Amjad et al. , 2018 ; Meyes et al. , 2019 ) .
This paper asks the interesting question of whether you need individual neuron (or even population level) class selectivity at intermediate stages in order to have good classification performance. The authors introduce a regularization term to the loss that controls the amount of selectivity in the units of the network. They find that the selectivity of the units in standard networks can be reduced while maintaining classification performance.
SP:759f85692cb4edfe6521d013dbbb55e20a458a4b
Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers
1 INTRODUCTION . Reinforcement learning ( RL ) can automate the acquisition of complex behavioral policies through real-world trial-and-error experimentation . However , many domains where we would like to learn policies are not amenable to such trial-and-error learning , because the errors are too costly : from autonomous driving to flying airplanes to devising medical treatment plans , safety-critical RL problems necessitate some type of transfer learning , where a safer source domain , such as a simulator , is used to train a policy that can then function effectively in a target domain . In this paper , we examine a specific transfer learning scenario that we call domain adaptation , by analogy to domain adaptation problems in computer vision ( Csurka , 2017 ) , where the training process in a source domain can be modified so that the resulting policy is effective in a given target domain . RL algorithms today require a large amount of experience in the target domain . However , for many tasks we may have access to a different but structurally similar source domain . While the source domain has different dynamics than the target domain , experience in the source domain is much cheaper to collect . However , transferring policies from one domain to another is challenging because strategies which are effective in the source domain may not be effective in the target domain . For example , aggressive driving may work well on a dry racetrack but fail catastrophically on an icy road . ∗Equal contribution . While prior work has studied the domain adaptation of observations in RL ( Bousmalis et al. , 2018 ; Ganin et al. , 2016 ; Higgins et al. , 2017 ) , it ignores the domain adaptation of the dynamics . This paper presents a simple approach for domain adaptation in RL , illustrated in Fig . 1 . Our main idea is that the agent ’ s experience in the source domain should look similar to its experience in the target domain . Building off of a probabilistic view of RL , we formally show that we can achieve this goal by compensating for the difference in dynamics by modifying the reward function . This modified reward function is simple to estimate by learning auxiliary classifiers that distinguish sourcedomain transitions from target-domain transitions . Because our method learns a classifier , rather than a dynamics model , we expect it to handle high-dimensional tasks better than model-based methods , a conjecture supported by experiments on the 111-dimensional Ant task . Unlike prior work based on similar intuition ( Koos et al. , 2012 ; Wulfmeier et al. , 2017b ) , a key contribution of our work is a formal guarantee that our method yields a near-optimal policy for the target domain . The main contribution of this work is an algorithm for domain adaptation to dynamics changes in RL , based on the idea of compensating for differences in dynamics by modifying the reward function . We call this algorithm Domain Adaptation with Rewards from Classifiers , or DARC for short . DARC does not estimate transition probabilities , but rather modifies the reward function using a pair of classifiers . We formally analyze the conditions under which our method produces nearoptimal policies for the target domain . On a range of discrete and continuous control tasks , we both illustrate the mechanics of our approach and demonstrate its scalability to higher-dimensional tasks . 2 RELATED WORK . While our work will focus on domain adaptation applied to RL , we start by reviewing more general ideas in domain adaptation , and defer to Kouw & Loog ( 2019 ) for a recent review of the field . Two common approaches to domain adaptation are importance weighting and domain-agnostic features . Importance-weighting methods ( e.g. , ( Zadrozny , 2004 ; Cortes & Mohri , 2014 ; Lipton et al. , 2018 ) ) estimate the likelihood ratio of examples under the target domain versus the source domain , and use this ratio to re-weight examples sampled from the source domain . Similar to prior work on importance weighting ( Bickel et al. , 2007 ; Sønderby et al. , 2016 ; Mohamed & Lakshminarayanan , 2016 ; Uehara et al. , 2016 ) , our method will use a classifier to estimate a probability ratio . Since we will need to estimate the density ratio of conditional distributions ( transition probabilities ) , we will learn two classifiers . Importantly , we will use the logarithm of the density ratio to modify the reward function instead of weighting samples by the density ratio , which is often numerically unstable ( see , e.g. , Schulman et al . ( 2017 , §3 ) ) and led to poor performance in our experiments . Prior methods for applying domain adaptation to RL include approaches based on system identification , domain randomization , and observation adaptation . Perhaps the most established approach , system identification ( Ljung , 1999 ) , uses observed data to tune the parameters of a simulator ( Feldbaum , 1960 ; Werbos , 1989 ; Wittenmark , 1995 ; Ross & Bagnell , 2012 ; Tan et al. , 2016 ; Zhu et al. , 2017b ; Farchy et al. , 2013 ) More recent work has successfully used this strategy to bridge the sim2real gap ( Chebotar et al. , 2019 ; Rajeswaran et al. , 2016 ) . Closely related is work on online system identification and meta-learning , which directly uses the inferred system parameters to update the policy ( Yu et al. , 2017 ; Clavera et al. , 2018 ; Tanaskovic et al. , 2013 ; Sastry & Isidori , 1989 ) . However , these approaches typically require either a model of the environment or a manually-specified distribution over potential test-time dynamics , requirements that our method will lift . Another approach , domain randomization , randomly samples the parameters of the source domain and then finds the best policy for this randomized environment ( Sadeghi & Levine , 2016 ; Tobin et al. , 2017 ; Peng et al. , 2018 ; Cutler et al. , 2014 ) . While often effective , this method is sensitive to the choice of which parameters are randomized , and the distributions from which these simulator parameters are sampled . A third approach , observation adaptation , modifies the observations of the source domain to appear similar to those in the target domain ( Fernando et al. , 2013 ; Hoffman et al. , 2016 ; Wulfmeier et al. , 2017a ) . While this approach has been successfully applied to video games ( Gamrian & Goldberg , 2018 ) and robot manipulation ( Bousmalis et al. , 2018 ) , it ignores the fact that the source and target domains may have differing dynamics . Finally , our work is similar to prior work on transfer learning ( Taylor & Stone , 2009 ) and metalearning in RL , but makes less strict assumptions than most prior work . For example , most work on meta-RL ( Killian et al. , 2017 ; Duan et al. , 2016 ; Mishra et al. , 2017 ; Rakelly et al. , 2019 ) and some work on transfer learning ( Perkins et al. , 1999 ; Tanaka & Yamamura , 2003 ; Sunmola & Wyatt , 2006 ) assume that the agent has access to many source tasks , all drawn from the same distribution as the target task . Selfridge et al . ( 1985 ) ; Madden & Howley ( 2004 ) assume a manually-specified curriculum of tasks , Ravindran & Barto ( 2004 ) assume that the source and target domains have the same dynamics locally , and Sherstov & Stone ( 2005 ) assume that the set of actions that are useful in the source domain is the same as the set of actions that will be useful in the target domain . Our method does not require these assumptions , allowing it to successfully learn in settings where these prior works would fail . For example , the assumption of Sherstov & Stone ( 2005 ) is violated in our experiments with broken robots : actions which move a joint are useful in the source domain ( where the robot is fully-function ) but not useful in the target domain ( where that joint is disabled ) . Our method will significantly outperform an importance weighting baseline ( Lazaric , 2008 ) . Unlike Vemula et al . ( 2020 ) , our method does not require learning a dynamics model and is applicable to stochastic environments and those with continuous states and actions . Our algorithm bears a resemblance to that in Wulfmeier et al . ( 2017b ) , but a crucial algorithmic difference allows us to prove that our method acquires a near-optimal policy in the target domain , and also leads to improved performance empirically . The theoretical derivation of our method is inspired by prior work which formulates control as a problem of probabilistic inference ( e.g. , ( Toussaint , 2009 ; Rawlik et al. , 2013 ; Levine et al. , 2018 ) ) . Algorithms for model-based RL ( e.g. , ( Deisenroth & Rasmussen , 2011 ; Hafner et al. , 2018 ; Janner et al. , 2019 ) ) and off-policy RL ( e.g. , ( Munos et al. , 2016 ; Fujimoto et al. , 2018 ; Dann et al. , 2014 ; Dudı́k et al. , 2011 ) similarly aim to improve the sample efficiency of RL , but do use the source domain to accelerate learning . Our method is applicable to any maximum entropy RL algorithm , including on-policy ( Song et al. , 2019 ) , off-policy ( Abdolmaleki et al. , 2018 ; Haarnoja et al. , 2018 ) , and model-based ( Janner et al. , 2019 ; Williams et al. , 2015 ) algorithms . We will use the SAC ( Haarnoja et al. , 2018 ) in our experiments and compare against model-based baselines . 3 PRELIMINARIES . In this section , we introduce notation and formally define domain adaptation for RL . Our problem setting will consider two MDPs : Msource represents the source domain ( e.g. , a practice facility , simulator , or learned approximate model of the target domain ) whileMtarget represents a the target domain . We assume that the two domains have the same state space S , action space A , reward function r , and initially state distribution p1 ( s1 ) ; the only difference between the domains is the dynamics , psource ( st+1 | st , at ) and ptarget ( st+1 | st , at ) . We will learn a Markovian policy πθ ( a | s ) , parametrized by θ . Our objective is to learn a policy π that maximizes the expected discounted sum of rewards onMtarget , Eπ , Mtarget [ ∑ t γ tr ( st , at ) ] . We now formally define our problem setting : Definition 1 . Domain Adaptation for RL is the problem of using interactions in the source MDP Msource together with a small number of interactions in the target MDPMtarget to acquire a policy that achieves high reward in the target MDP , Mtarget . We will assume every transition with non-zero probability in the target domain will have non-zero probability in the source domain : ptarget ( st+1 | st , at ) > 0 =⇒ psource ( st+1 | st , at ) > 0 for all st , st+1 ∈ S , at ∈ A . ( 1 ) This assumption is common in work on importance sampling ( Koller & Friedman , 2009 , §12.2.2 ) , and the converse need not hold : transitions that are possible in the source domain need not be possible in the target domain . If this assumption did not hold , then the optimal policy for the target domain might involve behaviors that are not possible in the source domain , so it is unclear how one could learn a near-optimal policy by practicing in the source domain .
This paper proposes a method for domain adaptation in RL where the source and target domains differ only in the transition distriubtions. A theoretical derivation based on RL as probabilistic inference is presented that starts with the objective of matching the desired distribution of trajectories in the target domain with the distribution achieved by the policy in the source domain. The final objective appears as a modification to the reward function while training in the source domain and is implemented easily with just two binary classifiers that predict the domain given either state-action or state-action-next-state tuples. Theorem 4.1 provides a theoretical guarantee on the performance of a policy trained on such a modified reward in the source domain by giving a bound on the performance in the target domain, under a very mild assumption that the optimal policy on the target domain achieves similar rewards when put in the source domain. Experiments are presented that show improved performance in terms of rewards vs experience on target domain on environments such as broken reacher, broken ant, etc (where the target domain has some "broken" component). Further, it is also shown that the reward modification on source visually matches the reward expected in target (Fig 4), that without the reward modification the policy usually exploits the source domain's transitions which cannot be exploited in the target domain, and finally, that safety emerges from the proposed objective.
SP:a39d669cce510debfadda370c1cb47d2eb960795
Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers
1 INTRODUCTION . Reinforcement learning ( RL ) can automate the acquisition of complex behavioral policies through real-world trial-and-error experimentation . However , many domains where we would like to learn policies are not amenable to such trial-and-error learning , because the errors are too costly : from autonomous driving to flying airplanes to devising medical treatment plans , safety-critical RL problems necessitate some type of transfer learning , where a safer source domain , such as a simulator , is used to train a policy that can then function effectively in a target domain . In this paper , we examine a specific transfer learning scenario that we call domain adaptation , by analogy to domain adaptation problems in computer vision ( Csurka , 2017 ) , where the training process in a source domain can be modified so that the resulting policy is effective in a given target domain . RL algorithms today require a large amount of experience in the target domain . However , for many tasks we may have access to a different but structurally similar source domain . While the source domain has different dynamics than the target domain , experience in the source domain is much cheaper to collect . However , transferring policies from one domain to another is challenging because strategies which are effective in the source domain may not be effective in the target domain . For example , aggressive driving may work well on a dry racetrack but fail catastrophically on an icy road . ∗Equal contribution . While prior work has studied the domain adaptation of observations in RL ( Bousmalis et al. , 2018 ; Ganin et al. , 2016 ; Higgins et al. , 2017 ) , it ignores the domain adaptation of the dynamics . This paper presents a simple approach for domain adaptation in RL , illustrated in Fig . 1 . Our main idea is that the agent ’ s experience in the source domain should look similar to its experience in the target domain . Building off of a probabilistic view of RL , we formally show that we can achieve this goal by compensating for the difference in dynamics by modifying the reward function . This modified reward function is simple to estimate by learning auxiliary classifiers that distinguish sourcedomain transitions from target-domain transitions . Because our method learns a classifier , rather than a dynamics model , we expect it to handle high-dimensional tasks better than model-based methods , a conjecture supported by experiments on the 111-dimensional Ant task . Unlike prior work based on similar intuition ( Koos et al. , 2012 ; Wulfmeier et al. , 2017b ) , a key contribution of our work is a formal guarantee that our method yields a near-optimal policy for the target domain . The main contribution of this work is an algorithm for domain adaptation to dynamics changes in RL , based on the idea of compensating for differences in dynamics by modifying the reward function . We call this algorithm Domain Adaptation with Rewards from Classifiers , or DARC for short . DARC does not estimate transition probabilities , but rather modifies the reward function using a pair of classifiers . We formally analyze the conditions under which our method produces nearoptimal policies for the target domain . On a range of discrete and continuous control tasks , we both illustrate the mechanics of our approach and demonstrate its scalability to higher-dimensional tasks . 2 RELATED WORK . While our work will focus on domain adaptation applied to RL , we start by reviewing more general ideas in domain adaptation , and defer to Kouw & Loog ( 2019 ) for a recent review of the field . Two common approaches to domain adaptation are importance weighting and domain-agnostic features . Importance-weighting methods ( e.g. , ( Zadrozny , 2004 ; Cortes & Mohri , 2014 ; Lipton et al. , 2018 ) ) estimate the likelihood ratio of examples under the target domain versus the source domain , and use this ratio to re-weight examples sampled from the source domain . Similar to prior work on importance weighting ( Bickel et al. , 2007 ; Sønderby et al. , 2016 ; Mohamed & Lakshminarayanan , 2016 ; Uehara et al. , 2016 ) , our method will use a classifier to estimate a probability ratio . Since we will need to estimate the density ratio of conditional distributions ( transition probabilities ) , we will learn two classifiers . Importantly , we will use the logarithm of the density ratio to modify the reward function instead of weighting samples by the density ratio , which is often numerically unstable ( see , e.g. , Schulman et al . ( 2017 , §3 ) ) and led to poor performance in our experiments . Prior methods for applying domain adaptation to RL include approaches based on system identification , domain randomization , and observation adaptation . Perhaps the most established approach , system identification ( Ljung , 1999 ) , uses observed data to tune the parameters of a simulator ( Feldbaum , 1960 ; Werbos , 1989 ; Wittenmark , 1995 ; Ross & Bagnell , 2012 ; Tan et al. , 2016 ; Zhu et al. , 2017b ; Farchy et al. , 2013 ) More recent work has successfully used this strategy to bridge the sim2real gap ( Chebotar et al. , 2019 ; Rajeswaran et al. , 2016 ) . Closely related is work on online system identification and meta-learning , which directly uses the inferred system parameters to update the policy ( Yu et al. , 2017 ; Clavera et al. , 2018 ; Tanaskovic et al. , 2013 ; Sastry & Isidori , 1989 ) . However , these approaches typically require either a model of the environment or a manually-specified distribution over potential test-time dynamics , requirements that our method will lift . Another approach , domain randomization , randomly samples the parameters of the source domain and then finds the best policy for this randomized environment ( Sadeghi & Levine , 2016 ; Tobin et al. , 2017 ; Peng et al. , 2018 ; Cutler et al. , 2014 ) . While often effective , this method is sensitive to the choice of which parameters are randomized , and the distributions from which these simulator parameters are sampled . A third approach , observation adaptation , modifies the observations of the source domain to appear similar to those in the target domain ( Fernando et al. , 2013 ; Hoffman et al. , 2016 ; Wulfmeier et al. , 2017a ) . While this approach has been successfully applied to video games ( Gamrian & Goldberg , 2018 ) and robot manipulation ( Bousmalis et al. , 2018 ) , it ignores the fact that the source and target domains may have differing dynamics . Finally , our work is similar to prior work on transfer learning ( Taylor & Stone , 2009 ) and metalearning in RL , but makes less strict assumptions than most prior work . For example , most work on meta-RL ( Killian et al. , 2017 ; Duan et al. , 2016 ; Mishra et al. , 2017 ; Rakelly et al. , 2019 ) and some work on transfer learning ( Perkins et al. , 1999 ; Tanaka & Yamamura , 2003 ; Sunmola & Wyatt , 2006 ) assume that the agent has access to many source tasks , all drawn from the same distribution as the target task . Selfridge et al . ( 1985 ) ; Madden & Howley ( 2004 ) assume a manually-specified curriculum of tasks , Ravindran & Barto ( 2004 ) assume that the source and target domains have the same dynamics locally , and Sherstov & Stone ( 2005 ) assume that the set of actions that are useful in the source domain is the same as the set of actions that will be useful in the target domain . Our method does not require these assumptions , allowing it to successfully learn in settings where these prior works would fail . For example , the assumption of Sherstov & Stone ( 2005 ) is violated in our experiments with broken robots : actions which move a joint are useful in the source domain ( where the robot is fully-function ) but not useful in the target domain ( where that joint is disabled ) . Our method will significantly outperform an importance weighting baseline ( Lazaric , 2008 ) . Unlike Vemula et al . ( 2020 ) , our method does not require learning a dynamics model and is applicable to stochastic environments and those with continuous states and actions . Our algorithm bears a resemblance to that in Wulfmeier et al . ( 2017b ) , but a crucial algorithmic difference allows us to prove that our method acquires a near-optimal policy in the target domain , and also leads to improved performance empirically . The theoretical derivation of our method is inspired by prior work which formulates control as a problem of probabilistic inference ( e.g. , ( Toussaint , 2009 ; Rawlik et al. , 2013 ; Levine et al. , 2018 ) ) . Algorithms for model-based RL ( e.g. , ( Deisenroth & Rasmussen , 2011 ; Hafner et al. , 2018 ; Janner et al. , 2019 ) ) and off-policy RL ( e.g. , ( Munos et al. , 2016 ; Fujimoto et al. , 2018 ; Dann et al. , 2014 ; Dudı́k et al. , 2011 ) similarly aim to improve the sample efficiency of RL , but do use the source domain to accelerate learning . Our method is applicable to any maximum entropy RL algorithm , including on-policy ( Song et al. , 2019 ) , off-policy ( Abdolmaleki et al. , 2018 ; Haarnoja et al. , 2018 ) , and model-based ( Janner et al. , 2019 ; Williams et al. , 2015 ) algorithms . We will use the SAC ( Haarnoja et al. , 2018 ) in our experiments and compare against model-based baselines . 3 PRELIMINARIES . In this section , we introduce notation and formally define domain adaptation for RL . Our problem setting will consider two MDPs : Msource represents the source domain ( e.g. , a practice facility , simulator , or learned approximate model of the target domain ) whileMtarget represents a the target domain . We assume that the two domains have the same state space S , action space A , reward function r , and initially state distribution p1 ( s1 ) ; the only difference between the domains is the dynamics , psource ( st+1 | st , at ) and ptarget ( st+1 | st , at ) . We will learn a Markovian policy πθ ( a | s ) , parametrized by θ . Our objective is to learn a policy π that maximizes the expected discounted sum of rewards onMtarget , Eπ , Mtarget [ ∑ t γ tr ( st , at ) ] . We now formally define our problem setting : Definition 1 . Domain Adaptation for RL is the problem of using interactions in the source MDP Msource together with a small number of interactions in the target MDPMtarget to acquire a policy that achieves high reward in the target MDP , Mtarget . We will assume every transition with non-zero probability in the target domain will have non-zero probability in the source domain : ptarget ( st+1 | st , at ) > 0 =⇒ psource ( st+1 | st , at ) > 0 for all st , st+1 ∈ S , at ∈ A . ( 1 ) This assumption is common in work on importance sampling ( Koller & Friedman , 2009 , §12.2.2 ) , and the converse need not hold : transitions that are possible in the source domain need not be possible in the target domain . If this assumption did not hold , then the optimal policy for the target domain might involve behaviors that are not possible in the source domain , so it is unclear how one could learn a near-optimal policy by practicing in the source domain .
The paper introduces DARC, a domain transfer algorithm motivated by maximum entropy RL. By introducing classifiers for the target and source domain, the reward function in the source domain can be modified such that it restricts the behavior of the optimized policy to transitions that reflect the target domain. In this way, the method achieves good domain transfer without having an explicit model.
SP:a39d669cce510debfadda370c1cb47d2eb960795
Non-Local Graph Neural Networks
1 INTRODUCTION . Graph neural networks ( GNNs ) process graphs and map each node to an embedding vector ( Zhang et al. , 2018b ; Wu et al. , 2019 ) . These node embeddings can be directly used for node-level applications , such as node classification ( Kipf & Welling , 2017 ) and link prediction ( Schütt et al. , 2017 ) . In addition , they can be used to learn the graph representation vector with graph pooling ( Ying et al. , 2018 ; Zhang et al. , 2018a ; Lee et al. , 2019 ; Yuan & Ji , 2020 ) , in order to fit graph-level tasks ( Yanardag & Vishwanathan , 2015 ) . Many variants of GNNs have been proposed , such as ChebNets ( Defferrard et al. , 2016 ) , GCNs ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2017 ) , GATs ( Veličković et al. , 2018 ) , LGCN ( Gao et al. , 2018 ) and GINs ( Xu et al. , 2019 ) . Their advantages have been shown on various graph datasets and tasks ( Errica et al. , 2020 ) . However , these GNNs share a multilayer local aggregation framework , which is similar to convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) on grid-like data such as images and texts . In recent years , the importance of non-local aggregation has been demonstrated in many applications in the field of computer vision ( Wang et al. , 2018 ; 2020 ) and natural language processing ( Vaswani et al. , 2017 ) . In particular , the attention mechanism has been widely explored to achieve non-local aggregation and capture long-range dependencies from distant locations . Basically , the attention mechanism measures the similarity between every pair of locations and enables information to be communicated among distant but similar locations . In terms of graphs , non-local aggregation is also crucial for disassortative graphs , while previous studies of GNNs focus on assortative graph datasets ( Section 2.2 ) . In addition , we find that local aggregation is even harmful for some disassortative graphs ( Section 4.3 ) . The recently proposed Geom-GCN ( Pei et al. , 2020 ) explores to capture longrange dependencies in disassortative graphs . It contains an attention-like step that computes the Euclidean distance between every pair of nodes . However , this step is computationally prohibitive for large-scale graphs , as the computational complexity is quadratic in the number of nodes . In addition , Geom-GCN employs pre-trained node embeddings ( Tenenbaum et al. , 2000 ; Nickel & Kiela , 2017 ; Ribeiro et al. , 2017 ) that are not task-specific , limiting the effectiveness and flexibility . In this work , we propose a simple yet effective non-local aggregation framework for GNNs . At the heart of the framework lies an efficient attention-guided sorting , which enables non-local aggregation through classic local aggregation operators in general deep learning . The proposed framework can be flexibly used to augment common GNNs with low computational costs . Based on the framework , we build various efficient non-local GNNs . In addition , we perform detailed analysis on existing disassortative graph datasets , and apply different non-local GNNs accordingly . Experimental results show that our non-local GNNs significantly outperform previous state-of-the-art methods on node classification tasks on six benchmark datasets of disassortative graphs . 2 BACKGROUND AND RELATED WORK . 2.1 GRAPH NEURAL NETWORKS . We focus on learning the embedding vector for each node through graph neural networks ( GNNs ) . Most existing GNNs are inspired by convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) and follow a local aggregation framework . In general , each layer of GNNs scans every node in the graph and aggregates local information from directly connected nodes , i.e. , the 1-hop neighbors . Specifically , a common layer of GNNs performs a two-step processing similar to the depthwise separable convolution ( Chollet , 2017 ) : spatial aggregation and feature transformation . The first step updates each node embedding using embedding vectors of spatially neighboring nodes . For example , GCNs ( Kipf & Welling , 2017 ) and GATs ( Veličković et al. , 2018 ) compute a weighted sum of node embeddings within the 1-hop neighborhood , where weights come from the degree of nodes and the interaction between nodes , respectively . GraphSAGE ( Hamilton et al. , 2017 ) applies the max pooling , while GINs ( Xu et al. , 2019 ) simply sums the node embeddings . The feature transformation step is similar to the 1×1 convolution , where each node embedding vector is mapped into a new feature space through a shared linear transformation ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ) or multilayer perceptron ( MLP ) ( Xu et al. , 2019 ) . Different from these studies , LGCN ( Gao et al. , 2018 ) explores to directly apply the regular convolution through top-k ranking . Nevertheless , each layer of these GNNs only aggregates local information within the 1-hop neighborhood . While stacking multiple layers can theoretically enable communication between nodes across the multi-hop neighborhood , the aggregation is essentially local . In addition , deep GNNs usually suffer from the over-smoothing problem ( Xu et al. , 2018 ; Li et al. , 2018 ; Chen et al. , 2020 ) . 2.2 ASSORTATIVE AND DISASSORTATIVE GRAPHS . There are many kinds of graphs in the literature , such as citation networks ( Kipf & Welling , 2017 ) , community networks ( Chen et al. , 2020 ) , co-occurrence networks ( Tang et al. , 2009 ) , and webpage linking networks ( Rozemberczki et al. , 2019 ) . We focus on graph datasets corresponding to the node classification tasks . In particular , we categorize graph datasets into assortative and disassortative ones ( Newman , 2002 ; Ribeiro et al. , 2017 ) according to the node homophily in terms of labels , i.e. , how likely nodes with the same label are near each other in the graph . Assortative graphs refer to those with a high node homophily . Common assortative graph datasets are citation networks and community networks . On the other hand , graphs in disassortative graph datasets contain more nodes that have the same label but are distant from each other . Example disassortative graph datasets are co-occurrence networks and webpage linking networks . As introduced above , most existing GNNs perform local aggregation only and achieve good performance on assortative graphs ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Gao et al. , 2018 ) . However , they may fail on disassortative graphs , where informative nodes in the same class tend to be out of the local multi-hop neighborhood and non-local aggregation is needed . Thus , in this work , we explore the non-local GNNs . 2.3 ATTENTION MECHANISM . The attention mechanism ( Vaswani et al. , 2017 ) has been widely used in GNNs ( Veličković et al. , 2018 ; Gao & Ji , 2019 ; Knyazev et al. , 2019 ) as well as other deep learning models ( Yang et al. , 2016 ; Wang et al. , 2018 ; 2020 ) . A typical attention mechanism takes three groups of vectors as inputs , namely the query vector q , key vectors ( k1 , k2 , . . . , kn ) , value vectors ( v1 , v2 , . . . , vn ) . Note that key and value vectors have a one-to-one correspondence and can be the same sometimes . The attention mechanism computes the output vector o as ai = ATTEND ( q , ki ) ∈ R , i = 1 , 2 , . . . , n ; o = ∑ i aivi , ( 1 ) where the ATTEND ( · ) function could be any function that outputs a scalar attention score ai from the interaction between q and ki , such as dot product ( Gao & Ji , 2019 ) or even a neural net- work ( Veličković et al. , 2018 ) . The definition of the three groups of input vectors depends on the models and applications . Notably , existing GNNs usually use the attention mechanism for local aggregation ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) . Specifically , when aggregating information for node v , the query vector is the embedding vector of v while the key and value vectors come from node embeddings of v ’ s directly connected nodes . And the process is iterated for each v ∈ V . It is worth noting that the attention mechanism can be easily extended for non-local aggregation ( Wang et al. , 2018 ; 2020 ) , by letting the key and value vectors correspond to all the nodes in the graph when aggregating information for each node . However , it is computationally prohibitive given large-scale graphs , as iterating it for each node in a graph of n nodes requires O ( n2 ) time . In this work , we propose a novel non-local aggregation method that only requires O ( n log n ) time . 3 THE PROPOSED METHOD . 3.1 NON-LOCAL AGGREGATION WITH ATTENTION-GUIDED SORTING . We consider a graph G = ( V , E ) , where V is the set of nodes and E is the set of edges . Each edge e ∈ E connects two nodes so that E ⊆ V ×V . Each node v ∈ V has a node feature vector xv ∈ Rd . The k-hop neighborhood of v refers to the set of nodes Nk ( v ) that can reach v within k edges . For example , the set of v ’ s directly connected nodes is its 1-hop neighborhood N1 ( v ) . Our proposed non-local aggregation framework is composed of three steps , namely local embedding , attention-guided sorting , and non-local aggregation . In the following , we describe them one by one . Local Embedding : Our proposed framework is built upon a local embedding step that extracts local node embeddings from the node feature vectors . The local embedding step can be as simple as zv = MLP ( xv ) ∈ Rf , ∀v ∈ V. ( 2 ) The MLP ( · ) function is a multilayer perceptron ( MLP ) , and f is the dimension of the local node embedding zv . Note that the MLP ( · ) function is shared across all the nodes in the graph . Applying MLP only takes the node itself into consideration without aggregating information from the neighborhood . This property is very important on some disassortative graphs , as shown in Section 4.3 . On the other hand , graph neural networks ( GNNs ) can be used as the local embedding step as well , so that our proposed framework can be easily employed to augment existing GNNs . As introduced in Section 2.1 , modern GNNs perform multilayer local aggregation . Typically , for each node , one layer of a GNN aggregates information from its 1-hop neighborhood . Stacking L such local aggregation layers allows each node to access information that is L hops away . To be specific , the ` -th layer of a L-layer GNN ( ` = 1 , 2 , . . . , L ) can be described as z ( ` ) v = TRANSFORM ( ` ) ( AGGREGATE ( ` ) ( { z ( ` −1 ) u : u ∈ N1 ( v ) ∪ v } ) ) ∈ Rf , ∀v ∈ V , ( 3 ) where z ( 0 ) v = xv , and zv = z ( L ) v represents the local node embedding . The AGGREGATE ( ` ) ( · ) and TRANSFORM ( ` ) ( · ) functions represent the spatial aggregation and feature transformation step introduced in Section 2.1 , respectively . With the above framework , GNNs can capture the node feature information from nodes within a local neighborhood as well as the structural information . When either MLP or GNNs is used as the local embedding step , the local node embedding zv only contains local information of a node v. However , zv can be used to guide non-local aggregation , as distant but informative nodes are likely to have similar node features and local structures . Based on this intuition , we propose the attention-guided sorting to enable the non-local aggregation . Attention-Guided Sorting : The basic idea of the attention-guided sorting is to learn an ordering of nodes , where distant but informative nodes are put near each other . Specifically , given the local node embedding zv obtained through the local embedding step , we compute one set of attention scores by av = ATTEND ( c , zv ) ∈ R , ∀v ∈ V , ( 4 ) where c is a calibration vector that is randomly initialized and jointly learned during training ( Yang et al. , 2016 ) . In this attention operator , c serves as the query vector and zv are the key vectors . In addition , we also treat zv as the value vectors . However , unlike the attention mechanism introduced in Section 2.3 , we use the attention scores to sort the value vectors instead of computing a weighted sum to aggregating them . Note that originally there is no ordering among nodes in a graph . To be specific , as av and zv have one-to-one correspondence through Equation ( 4 ) , sorting the attention scores in non-decreasing order into ( a1 , a2 , . . . , an ) provides an ordering among nodes , where n = |V | is the number of nodes in the graph . The resulting sequence of local node embeddings can be denoted as ( z1 , z2 , . . . , zn ) . The attention process in Equation ( 4 ) can be also understood as a projection of local node embeddings onto a 1-dimensional space . The projection depends on the concrete ATTEND ( · ) function and the calibration vector c. As indicated by its name , the calibration vector c is used to calibrate the 1-dimensional space , in order to push distant but informative nodes close to each other in this space . This goal is fulfilled through the following non-local aggregation step and the training of the calibration vector c , as demonstrated below . Non-Local Aggregation : We point out that , with the attention-guided sorting , the non-local aggregation can be achieved by convolution , the most common local aggregation operator in deep learning . Specifically , given the sorted sequence of local node embeddings ( z1 , z2 , . . . , zn ) , we compute ( ẑ1 , ẑ2 , . . . , ẑn ) = CONV ( z1 , z2 , . . . , zn ) , ( 5 ) where the CONV ( · ) function represents a 1D convolution with appropriate padding . Note that the CONV ( · ) function can be replaced by a 1D convolutional neural network as long as the number of input and output vectors remains the same . To see how the CONV ( · ) function performs non-local aggregation with the attention-guided sorting , we take an example where the CONV ( · ) function is a 1D convolution of kernel size 2s + 1 . In this case , ẑi is computed from ( zi+s , . . . , zi−s ) , corresponding to the receptive field of the CONV ( · ) function . As a result , if the attention-guided sorting leads to ( zi+s , . . . , zi−s ) containing nodes that are distant but informative to zi , the output ẑi aggregates non-local information . Another view is that we can consider the attention-guided sorting as re-connects nodes in the graph , where ( zi+s , . . . , zi−s ) can be treated as the 1-hop neighborhood of zi . After the CONV ( · ) function , ẑi and zi are concatenated as the input to a classifier to predict the label of the corresponding node , where both non-local and local dependencies can be captured . In order to enable the end-to-end training of the calibration vector c , we modify Equation ( 5 ) into ( ẑ1 , ẑ2 , . . . , ẑn ) = CONV ( a1z1 , a2z2 , . . . , anzn ) , ( 6 ) where we multiply the attention score with the corresponding local node embedding . As a result , the calibration vector c receives gradients through the attention scores during training . The remaining question is how to make sure that the attention-guided sorting pushes distant but informative nodes together . The short answer is that it is not necessary to guarantee this , as the requirement of non-local aggregation depends on the concrete graphs . In fact , our proposed framework grants GNNs the ability of non-local aggregation but lets the end-to-end training process determine whether to use non-local information . The back-propagation from the supervised loss will tune the calibration vector c and encourage ẑi to capture useful information that is not encoded by zi . In the case of disassortative graphs , ẑi usually needs to aggregate information from distant but informative nodes . Hence , the calibration vector c tends to arrange the attention-guided sorting to put distant but informative nodes together , as demonstrated experimentally in Section 4.5 . On the other hand , nodes within the local neighborhood are usually much more informative than distant nodes in assortative graphs . In this situation , ẑi may simply perform local aggregation that is similar to GNNs . In Section 4 , we demonstrate the effectiveness of our proposed non-local aggregation framework on six disassortative graph datasets . In particular , we achieve the state-of-the-art performance on all the datasets with significant improvements over previous methods .
This paper targets on addressing the node embedding problem in disassortative graphs. A non-local aggregation framework is proposed, since local aggregation may be harmful for some disassortative graphs. To address the high computational cost in the recent Geom-GCN model that has an attention-like step to compute the Euclidean distance between every pair of nodes, an idea of attention-guided sorting is introduced. It learns an ordering of nodes, such that distant but informative nodes are put near each other. The sorting order depends on the attention scores computed with the local embedding vector of a node. Then Covn(.) function is applied on the sorted sequence of local node embeddings to obtain the non-local embedding. The final node embedding is then the concatenation of the local and non-local embedding, which is used for node classification.
SP:4341b2c3554d27983bb5077f0cb3448c0c764823
Non-Local Graph Neural Networks
1 INTRODUCTION . Graph neural networks ( GNNs ) process graphs and map each node to an embedding vector ( Zhang et al. , 2018b ; Wu et al. , 2019 ) . These node embeddings can be directly used for node-level applications , such as node classification ( Kipf & Welling , 2017 ) and link prediction ( Schütt et al. , 2017 ) . In addition , they can be used to learn the graph representation vector with graph pooling ( Ying et al. , 2018 ; Zhang et al. , 2018a ; Lee et al. , 2019 ; Yuan & Ji , 2020 ) , in order to fit graph-level tasks ( Yanardag & Vishwanathan , 2015 ) . Many variants of GNNs have been proposed , such as ChebNets ( Defferrard et al. , 2016 ) , GCNs ( Kipf & Welling , 2017 ) , GraphSAGE ( Hamilton et al. , 2017 ) , GATs ( Veličković et al. , 2018 ) , LGCN ( Gao et al. , 2018 ) and GINs ( Xu et al. , 2019 ) . Their advantages have been shown on various graph datasets and tasks ( Errica et al. , 2020 ) . However , these GNNs share a multilayer local aggregation framework , which is similar to convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) on grid-like data such as images and texts . In recent years , the importance of non-local aggregation has been demonstrated in many applications in the field of computer vision ( Wang et al. , 2018 ; 2020 ) and natural language processing ( Vaswani et al. , 2017 ) . In particular , the attention mechanism has been widely explored to achieve non-local aggregation and capture long-range dependencies from distant locations . Basically , the attention mechanism measures the similarity between every pair of locations and enables information to be communicated among distant but similar locations . In terms of graphs , non-local aggregation is also crucial for disassortative graphs , while previous studies of GNNs focus on assortative graph datasets ( Section 2.2 ) . In addition , we find that local aggregation is even harmful for some disassortative graphs ( Section 4.3 ) . The recently proposed Geom-GCN ( Pei et al. , 2020 ) explores to capture longrange dependencies in disassortative graphs . It contains an attention-like step that computes the Euclidean distance between every pair of nodes . However , this step is computationally prohibitive for large-scale graphs , as the computational complexity is quadratic in the number of nodes . In addition , Geom-GCN employs pre-trained node embeddings ( Tenenbaum et al. , 2000 ; Nickel & Kiela , 2017 ; Ribeiro et al. , 2017 ) that are not task-specific , limiting the effectiveness and flexibility . In this work , we propose a simple yet effective non-local aggregation framework for GNNs . At the heart of the framework lies an efficient attention-guided sorting , which enables non-local aggregation through classic local aggregation operators in general deep learning . The proposed framework can be flexibly used to augment common GNNs with low computational costs . Based on the framework , we build various efficient non-local GNNs . In addition , we perform detailed analysis on existing disassortative graph datasets , and apply different non-local GNNs accordingly . Experimental results show that our non-local GNNs significantly outperform previous state-of-the-art methods on node classification tasks on six benchmark datasets of disassortative graphs . 2 BACKGROUND AND RELATED WORK . 2.1 GRAPH NEURAL NETWORKS . We focus on learning the embedding vector for each node through graph neural networks ( GNNs ) . Most existing GNNs are inspired by convolutional neural networks ( CNNs ) ( LeCun et al. , 1998 ) and follow a local aggregation framework . In general , each layer of GNNs scans every node in the graph and aggregates local information from directly connected nodes , i.e. , the 1-hop neighbors . Specifically , a common layer of GNNs performs a two-step processing similar to the depthwise separable convolution ( Chollet , 2017 ) : spatial aggregation and feature transformation . The first step updates each node embedding using embedding vectors of spatially neighboring nodes . For example , GCNs ( Kipf & Welling , 2017 ) and GATs ( Veličković et al. , 2018 ) compute a weighted sum of node embeddings within the 1-hop neighborhood , where weights come from the degree of nodes and the interaction between nodes , respectively . GraphSAGE ( Hamilton et al. , 2017 ) applies the max pooling , while GINs ( Xu et al. , 2019 ) simply sums the node embeddings . The feature transformation step is similar to the 1×1 convolution , where each node embedding vector is mapped into a new feature space through a shared linear transformation ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ) or multilayer perceptron ( MLP ) ( Xu et al. , 2019 ) . Different from these studies , LGCN ( Gao et al. , 2018 ) explores to directly apply the regular convolution through top-k ranking . Nevertheless , each layer of these GNNs only aggregates local information within the 1-hop neighborhood . While stacking multiple layers can theoretically enable communication between nodes across the multi-hop neighborhood , the aggregation is essentially local . In addition , deep GNNs usually suffer from the over-smoothing problem ( Xu et al. , 2018 ; Li et al. , 2018 ; Chen et al. , 2020 ) . 2.2 ASSORTATIVE AND DISASSORTATIVE GRAPHS . There are many kinds of graphs in the literature , such as citation networks ( Kipf & Welling , 2017 ) , community networks ( Chen et al. , 2020 ) , co-occurrence networks ( Tang et al. , 2009 ) , and webpage linking networks ( Rozemberczki et al. , 2019 ) . We focus on graph datasets corresponding to the node classification tasks . In particular , we categorize graph datasets into assortative and disassortative ones ( Newman , 2002 ; Ribeiro et al. , 2017 ) according to the node homophily in terms of labels , i.e. , how likely nodes with the same label are near each other in the graph . Assortative graphs refer to those with a high node homophily . Common assortative graph datasets are citation networks and community networks . On the other hand , graphs in disassortative graph datasets contain more nodes that have the same label but are distant from each other . Example disassortative graph datasets are co-occurrence networks and webpage linking networks . As introduced above , most existing GNNs perform local aggregation only and achieve good performance on assortative graphs ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Gao et al. , 2018 ) . However , they may fail on disassortative graphs , where informative nodes in the same class tend to be out of the local multi-hop neighborhood and non-local aggregation is needed . Thus , in this work , we explore the non-local GNNs . 2.3 ATTENTION MECHANISM . The attention mechanism ( Vaswani et al. , 2017 ) has been widely used in GNNs ( Veličković et al. , 2018 ; Gao & Ji , 2019 ; Knyazev et al. , 2019 ) as well as other deep learning models ( Yang et al. , 2016 ; Wang et al. , 2018 ; 2020 ) . A typical attention mechanism takes three groups of vectors as inputs , namely the query vector q , key vectors ( k1 , k2 , . . . , kn ) , value vectors ( v1 , v2 , . . . , vn ) . Note that key and value vectors have a one-to-one correspondence and can be the same sometimes . The attention mechanism computes the output vector o as ai = ATTEND ( q , ki ) ∈ R , i = 1 , 2 , . . . , n ; o = ∑ i aivi , ( 1 ) where the ATTEND ( · ) function could be any function that outputs a scalar attention score ai from the interaction between q and ki , such as dot product ( Gao & Ji , 2019 ) or even a neural net- work ( Veličković et al. , 2018 ) . The definition of the three groups of input vectors depends on the models and applications . Notably , existing GNNs usually use the attention mechanism for local aggregation ( Veličković et al. , 2018 ; Gao & Ji , 2019 ) . Specifically , when aggregating information for node v , the query vector is the embedding vector of v while the key and value vectors come from node embeddings of v ’ s directly connected nodes . And the process is iterated for each v ∈ V . It is worth noting that the attention mechanism can be easily extended for non-local aggregation ( Wang et al. , 2018 ; 2020 ) , by letting the key and value vectors correspond to all the nodes in the graph when aggregating information for each node . However , it is computationally prohibitive given large-scale graphs , as iterating it for each node in a graph of n nodes requires O ( n2 ) time . In this work , we propose a novel non-local aggregation method that only requires O ( n log n ) time . 3 THE PROPOSED METHOD . 3.1 NON-LOCAL AGGREGATION WITH ATTENTION-GUIDED SORTING . We consider a graph G = ( V , E ) , where V is the set of nodes and E is the set of edges . Each edge e ∈ E connects two nodes so that E ⊆ V ×V . Each node v ∈ V has a node feature vector xv ∈ Rd . The k-hop neighborhood of v refers to the set of nodes Nk ( v ) that can reach v within k edges . For example , the set of v ’ s directly connected nodes is its 1-hop neighborhood N1 ( v ) . Our proposed non-local aggregation framework is composed of three steps , namely local embedding , attention-guided sorting , and non-local aggregation . In the following , we describe them one by one . Local Embedding : Our proposed framework is built upon a local embedding step that extracts local node embeddings from the node feature vectors . The local embedding step can be as simple as zv = MLP ( xv ) ∈ Rf , ∀v ∈ V. ( 2 ) The MLP ( · ) function is a multilayer perceptron ( MLP ) , and f is the dimension of the local node embedding zv . Note that the MLP ( · ) function is shared across all the nodes in the graph . Applying MLP only takes the node itself into consideration without aggregating information from the neighborhood . This property is very important on some disassortative graphs , as shown in Section 4.3 . On the other hand , graph neural networks ( GNNs ) can be used as the local embedding step as well , so that our proposed framework can be easily employed to augment existing GNNs . As introduced in Section 2.1 , modern GNNs perform multilayer local aggregation . Typically , for each node , one layer of a GNN aggregates information from its 1-hop neighborhood . Stacking L such local aggregation layers allows each node to access information that is L hops away . To be specific , the ` -th layer of a L-layer GNN ( ` = 1 , 2 , . . . , L ) can be described as z ( ` ) v = TRANSFORM ( ` ) ( AGGREGATE ( ` ) ( { z ( ` −1 ) u : u ∈ N1 ( v ) ∪ v } ) ) ∈ Rf , ∀v ∈ V , ( 3 ) where z ( 0 ) v = xv , and zv = z ( L ) v represents the local node embedding . The AGGREGATE ( ` ) ( · ) and TRANSFORM ( ` ) ( · ) functions represent the spatial aggregation and feature transformation step introduced in Section 2.1 , respectively . With the above framework , GNNs can capture the node feature information from nodes within a local neighborhood as well as the structural information . When either MLP or GNNs is used as the local embedding step , the local node embedding zv only contains local information of a node v. However , zv can be used to guide non-local aggregation , as distant but informative nodes are likely to have similar node features and local structures . Based on this intuition , we propose the attention-guided sorting to enable the non-local aggregation . Attention-Guided Sorting : The basic idea of the attention-guided sorting is to learn an ordering of nodes , where distant but informative nodes are put near each other . Specifically , given the local node embedding zv obtained through the local embedding step , we compute one set of attention scores by av = ATTEND ( c , zv ) ∈ R , ∀v ∈ V , ( 4 ) where c is a calibration vector that is randomly initialized and jointly learned during training ( Yang et al. , 2016 ) . In this attention operator , c serves as the query vector and zv are the key vectors . In addition , we also treat zv as the value vectors . However , unlike the attention mechanism introduced in Section 2.3 , we use the attention scores to sort the value vectors instead of computing a weighted sum to aggregating them . Note that originally there is no ordering among nodes in a graph . To be specific , as av and zv have one-to-one correspondence through Equation ( 4 ) , sorting the attention scores in non-decreasing order into ( a1 , a2 , . . . , an ) provides an ordering among nodes , where n = |V | is the number of nodes in the graph . The resulting sequence of local node embeddings can be denoted as ( z1 , z2 , . . . , zn ) . The attention process in Equation ( 4 ) can be also understood as a projection of local node embeddings onto a 1-dimensional space . The projection depends on the concrete ATTEND ( · ) function and the calibration vector c. As indicated by its name , the calibration vector c is used to calibrate the 1-dimensional space , in order to push distant but informative nodes close to each other in this space . This goal is fulfilled through the following non-local aggregation step and the training of the calibration vector c , as demonstrated below . Non-Local Aggregation : We point out that , with the attention-guided sorting , the non-local aggregation can be achieved by convolution , the most common local aggregation operator in deep learning . Specifically , given the sorted sequence of local node embeddings ( z1 , z2 , . . . , zn ) , we compute ( ẑ1 , ẑ2 , . . . , ẑn ) = CONV ( z1 , z2 , . . . , zn ) , ( 5 ) where the CONV ( · ) function represents a 1D convolution with appropriate padding . Note that the CONV ( · ) function can be replaced by a 1D convolutional neural network as long as the number of input and output vectors remains the same . To see how the CONV ( · ) function performs non-local aggregation with the attention-guided sorting , we take an example where the CONV ( · ) function is a 1D convolution of kernel size 2s + 1 . In this case , ẑi is computed from ( zi+s , . . . , zi−s ) , corresponding to the receptive field of the CONV ( · ) function . As a result , if the attention-guided sorting leads to ( zi+s , . . . , zi−s ) containing nodes that are distant but informative to zi , the output ẑi aggregates non-local information . Another view is that we can consider the attention-guided sorting as re-connects nodes in the graph , where ( zi+s , . . . , zi−s ) can be treated as the 1-hop neighborhood of zi . After the CONV ( · ) function , ẑi and zi are concatenated as the input to a classifier to predict the label of the corresponding node , where both non-local and local dependencies can be captured . In order to enable the end-to-end training of the calibration vector c , we modify Equation ( 5 ) into ( ẑ1 , ẑ2 , . . . , ẑn ) = CONV ( a1z1 , a2z2 , . . . , anzn ) , ( 6 ) where we multiply the attention score with the corresponding local node embedding . As a result , the calibration vector c receives gradients through the attention scores during training . The remaining question is how to make sure that the attention-guided sorting pushes distant but informative nodes together . The short answer is that it is not necessary to guarantee this , as the requirement of non-local aggregation depends on the concrete graphs . In fact , our proposed framework grants GNNs the ability of non-local aggregation but lets the end-to-end training process determine whether to use non-local information . The back-propagation from the supervised loss will tune the calibration vector c and encourage ẑi to capture useful information that is not encoded by zi . In the case of disassortative graphs , ẑi usually needs to aggregate information from distant but informative nodes . Hence , the calibration vector c tends to arrange the attention-guided sorting to put distant but informative nodes together , as demonstrated experimentally in Section 4.5 . On the other hand , nodes within the local neighborhood are usually much more informative than distant nodes in assortative graphs . In this situation , ẑi may simply perform local aggregation that is similar to GNNs . In Section 4 , we demonstrate the effectiveness of our proposed non-local aggregation framework on six disassortative graph datasets . In particular , we achieve the state-of-the-art performance on all the datasets with significant improvements over previous methods .
The goal of the paper is to perform node classification for graphs. The authors propose a strategy to augment message passing graph neural networks with information from non-local nodes in the graph - with a focus on dis-assortative graphs. Dis-assortative graphs are graph datasets - where nodes with identical node labels are distant from each other in terms of edge connectivity.
SP:4341b2c3554d27983bb5077f0cb3448c0c764823
On the Landscape of Sparse Linear Networks
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved remarkable empirical successes in the domains of computer vision , speech recognition , and natural language processing , sparking great interests in the theory behind their architectures and training . However , DNNs are often found to be highly overparameterized , making them computationally expensive with large amounts of memory and computational power . For example , it may take up to weeks on a modern multi-GPU server for large datasets such as ImageNet ( Deng et al. , 2009 ) . Hence , DNNs are often unsuitable for smaller devices like embedded electronics , and there is a pressing demand for techniques to optimize models with reduced model size , faster inference and lower power consumption . Sparse networks , that is , neural networks in which a large subset of the model parameters are zero , have emerged as one of the leading approaches for reducing model parameter count . It has been shown empirically that deep neural networks can achieve state-of-the-art results under high levels of sparsity ( Han et al. , 2015b ; Gale et al. , 2019 ; Louizos et al. , 2017a ) . Modern sparse networks are mainly obtained from network pruning ( Zhu & Gupta , 2017 ; Lee et al. , 2018 ; Liu et al. , 2018 ; Frankle & Carbin , 2018 ) , which has been the subject of a great deal of work in recent years . However , training a sparse network with fixed sparsity patterns is difficult ( Evci et al. , 2019 ) and few theoretical understanding of general sparse networks has been provided . Previous work has already analyze deep neural networks , showing that the non-convexity of the associated loss functions may cause complicated and strange optimization landscapes . However , the property of general sparse networks is poorly understood . Saxe et al . ( 2013 ) empirically showed that the optimization of deep linear models exhibits similar properties as deep nonlinear models , and for theoretical development , it is natural to begin with linear models before studying nonlinear models ( Baldi & Lu , 2012 ) . In addition , several works ( Sun et al. , 2020 ) have show bad minimum exists with nonlinear activation . Hence , it is natural to begin with linear activation to understand the impact of sparsity . In this article , we go further to consider the global landscape of general sparse linear neural networks . We need to emphasize that dense deep linear networks already satisfy that every local minimum is a global minimum under mild conditions ( Kawaguchi , 2016 ; Lu & Kawaguchi , 2017 ) , but findings are different and complicated for sparse linear network . The goal of this paper is to study the relation between sparsity and local minima with the following contributions : • First , we point out that every local minimum is a global minimum in scalar target case with any depths , any widths and any sparse structure . Besides , we also briefly show that similar results hold for non-overlapping filters and orthogonal data feature when sparsity only occurs in the first layer . • Second , we find out that sparse connections would already give sub-optimal local minima in general non-scalar case through analytic and numerical examples built on convergence analyze . The local-min may be produced from two situations : a sub-sparse linear network which owes its minimum as a local-min of the original sparse network ; a rank-deficient solution between different data features due to sparse connections , while both cases verify the fact that sparsity cuts out the decreasing path in original fully-connected networks . Overall , we hope our work contributes to a better understanding of the landscape of sparsity network on simple neural networks , and provide insights for future research . The remainder of our paper is organized as follows . In Section 2 , we derive the positive findings of shallow sparse linear networks , providing similar landscape as dense linear networks . In Section 3 , we give several examples to show the existence of bad local-min for non-scalar case . In section 4 , we briefly generalize the results from shallow to deep sparse linear networks . Some proofs are in Appendix . 1.1 RELATED WORK . There is a rapidly increasing literature on analyzing the loss surface of neural network objectives , surveying all of which is well outside our scope . Thus , we only briefly survey the works most related to ours . Local minima is Global . The landscape of a linear network date back to Baldi & Hornik ( 1989 ) , proving that shallow linear neural networks do not suffer from bad local minima . Kawaguchi ( 2016 ) generalized same results to deep linear neural networks , and subsequent several works ( Arora et al. , 2018 ; Du & Hu , 2019 ; Eftekhari , 2020 ) give direct algorithm-type convergence based on this benign property , though algorithm analysis is beyond the scope of this paper . However , situations are quite complicated with nonlinear activations . Multiple works ( Ge et al. , 2017 ; Safran & Shamir , 2018 ; Yun et al. , 2018 ) show that spurious local minima can happen even in two-layer network with population or empirical loss , some are specific to two-layer and difficult to generalize to general multilayer cases . Another line of works ( Arora et al. , 2018 ; Allen-Zhu et al. , 2018 ; Du & Hu , 2019 ; Du et al. , 2018 ; Li et al. , 2018 ; Mei et al. , 2018 ) understands the landscape of neural network in an overparameterized setting , discovering benign landscape with or without gradient method . Since modern sparse networks reserve few parameters compared to overparameterization , we still seek a fundamental view of sparsity in contrast . Our standpoint is that spurious local minima can happen when applied with specific sparsity even in linear networks . Sparse networks . Sparse networks ( Han et al. , 2015b ; a ; Zhu & Gupta , 2017 ; Frankle & Carbin , 2018 ; Liu et al. , 2018 ) have a long history , but appears heavily on the experiments , and mainly related to network pruning , which has practical importance for reducing model parameter count and deploying diverse devices . However , training sparse networks ( from scratch ) suffers great difficulty . Frankle & Carbin ( 2018 ) recommend reusing the sparsity pattern found through pruning and train a sparse network from the same initialization as the original training ( ‘ lottery ’ ) to obtain comparable performance and avoid bad solution . Besides , for fixed sparsity patterns , Evci et al . ( 2019 ) attempt to find a decreasing objective path from ‘ bad ’ solutions to the ‘ good ’ ones in the sparse subspace but fail , showing bad local minima can be produced by pruning , while we give more direct view of simple examples to verify this . Moreover , several recent works also give abundant methods ( Molchanov et al. , 2017 ; Louizos et al. , 2017b ; Lee et al. , 2018 ; Carreira-Perpinán & Idelbayev , 2018 ) for choosing weights or sparse network structure while achieving similar performance . In theoretical view , Malach et al . ( 2020 ) prove that a sufficiently over-parameterized neural network with random weights contains a subnetwork with roughly the same accuracy as the target network , providing guarantee for ‘ good ’ sparse networks . Some works analyze convolutional network ( Shalev-Shwartz et al. , 2017 ; Du et al. , 2018 ) as a specific sparse structure . Brutzkus & Globerson ( 2017 ) analyze non-overlapping and overlapping structure as we do , but with weight sharing to simulate CNN-type structure , and under teacher-student setting with population risk . We do not follow CNN-type network but in general sparse networks , though still linear , to conclude straightforward results . 2 LANDSCAPE OF SHALLOW SPARSE LINEAR NETWORKS . 2.1 PRELIMINARIES AND NOTATION . We use bold-faced letters ( e.g. , w and a ) to denote vectors , capital letters ( e.g. , W = [ wij ] and A = [ aij ] ) for matrices . Let PX be the orthogonal projection to the column space of the matrix X , and λi ( H ) is the i-th smallest eigenvalue of a real symmetric matrix H . We consider the training samples and their outputs as { ( xi , yi ) } ni=1 ⊂ Rdx × Rdy , which may come from unknown distribution D. We form the data matrices X = [ x1 , . . . , xn ] T ∈ Rn×dx and Y = [ y1 , . . . , yn ] T ∈ Rn×dy , respectively . In our analysis in Sections 2 and 3 , we consider a two-layer ( sparse ) linear neural network with squared loss : min W , A L ( W , A ) : = 1 2 ‖Y −XWA‖2F , ( 1 ) where the first layer weight matrix W = [ w1 , . . . , wd ] ∈ Rdx×d , and the second layer weight matrix A = [ a1 , . . . , ad ] T ∈ Rd×dy . After weights pruning or sparsity constraint , many weights parameters become zero and would not be updated during retraining . We adopt Sj : = { k : wkj = 0 } as pruned dimensions in the j-th column ofW , and−Sj : = Scj = [ dx ] \Sj , where [ d ] : = { 1 , . . . , d } . In addition , wj , S denotes the sub-vector of wj choosing the positions in S , XS the sub-matrix of X choosing the column indices in S. We let pj = dx − |Sj | , where |S| is the cardinality of the set S. Then wj , −Sj ∈ Rpj is the remaining j-th column in first layer weight which leaves out pruned dimension set Sj . Similarly , X−Sj ∈ Rn×pj means the remaining data matrix connected to j-th node in the first layer . Finally , for simplicity , we denote X−j = X−Sj , w−j = wj , −Sj , and ( ̃· ) as the pruned layer weight with several zero elements not updated all along , if no ambiguity . Before we begin , a small note on the sparse structure we concern : there may have unnecessary connections and nodes , such as a node with zero out-degree which can be retrieved and excluded from the final layer to the first layer , and other cases are showing in Appendix C. Thus we do not consider them in the subsequent proof and assume each data dimension has valid output connection , i.e. , ∩dj=1Sj = ∅ . 2.2 SCALAR CASE . In the scalar case , assume dy = 1 . We then simplify A = ( a1 , . . . , ad ) T . When pruning any weight ai in the second layer , the output of the i-th node in the first layer contribute zero to final output . Hence wi can also be pruned . Without loss of generality , we assume second layer parameters are not pruned . After pruning several parameters , the original problem becomes min w−i , ai L ( W̃ , A ) : = 1 2 ∥∥∥∥∥∥∥Y − ( X−1 , . . . , X−i , . . . , X−d ) a1w−1 ... adw−d ∥∥∥∥∥∥∥ 2 F . ( 2 ) Theorem 1 For a two-layer linear neural network with scalar output and any sparse structure , every local minimum is a global minimum . Proof : From Eq . ( 2 ) , if a local minimizer satisfies ai = 0 for some 1 ≤ i ≤ d , then based on the second order condition for a local minima , we have ∂2L ∂a2i ∂2L ∂ai∂wT−i ∂L ∂w−i∂ai ∂L ∂w−i∂wT−i 0 , ( 3 ) which implies that wT−iX−iXT−iw−i − ( Y −∑di=1X−iw−iai ) T X−i −XT−i ( Y − ∑d i=1X−iw−iai ) 0 0 . ( 4 ) Then XT−i ( Y − ∑d i=1X−iw−iai ) = 0 , which is the global minimizer condition of w−iai . Otherwise , ai 6= 0 , then from the first-order condition for a local minima , ∂L ∂w−i = aiX T −i ( Y − d∑ i=1 X−iw−iai ) = 0 , showing that XT−i ( Y − ∑d i=1X−iw−iai ) = 0 , which also gives the global minimizer condition of w−iai . Hence every local minimum is a global minimum .
This paper studies the loss landscapes of sparse linear networks. It proves that under squared loss, (1) spurious local minimum does not exist when the output dimension is one, or with separated first layer and orthogonal training data; and (2) for two-layer sparse linear networks, the good property in (1) does not exist anymore when the conditions are violated. The authors also report experimental results to show that two-layer sparse linear networks with two hidden neurons have spurious local minima.
SP:ef9027da9feec26a1fe583b9cd8c77e260bdc00f
On the Landscape of Sparse Linear Networks
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved remarkable empirical successes in the domains of computer vision , speech recognition , and natural language processing , sparking great interests in the theory behind their architectures and training . However , DNNs are often found to be highly overparameterized , making them computationally expensive with large amounts of memory and computational power . For example , it may take up to weeks on a modern multi-GPU server for large datasets such as ImageNet ( Deng et al. , 2009 ) . Hence , DNNs are often unsuitable for smaller devices like embedded electronics , and there is a pressing demand for techniques to optimize models with reduced model size , faster inference and lower power consumption . Sparse networks , that is , neural networks in which a large subset of the model parameters are zero , have emerged as one of the leading approaches for reducing model parameter count . It has been shown empirically that deep neural networks can achieve state-of-the-art results under high levels of sparsity ( Han et al. , 2015b ; Gale et al. , 2019 ; Louizos et al. , 2017a ) . Modern sparse networks are mainly obtained from network pruning ( Zhu & Gupta , 2017 ; Lee et al. , 2018 ; Liu et al. , 2018 ; Frankle & Carbin , 2018 ) , which has been the subject of a great deal of work in recent years . However , training a sparse network with fixed sparsity patterns is difficult ( Evci et al. , 2019 ) and few theoretical understanding of general sparse networks has been provided . Previous work has already analyze deep neural networks , showing that the non-convexity of the associated loss functions may cause complicated and strange optimization landscapes . However , the property of general sparse networks is poorly understood . Saxe et al . ( 2013 ) empirically showed that the optimization of deep linear models exhibits similar properties as deep nonlinear models , and for theoretical development , it is natural to begin with linear models before studying nonlinear models ( Baldi & Lu , 2012 ) . In addition , several works ( Sun et al. , 2020 ) have show bad minimum exists with nonlinear activation . Hence , it is natural to begin with linear activation to understand the impact of sparsity . In this article , we go further to consider the global landscape of general sparse linear neural networks . We need to emphasize that dense deep linear networks already satisfy that every local minimum is a global minimum under mild conditions ( Kawaguchi , 2016 ; Lu & Kawaguchi , 2017 ) , but findings are different and complicated for sparse linear network . The goal of this paper is to study the relation between sparsity and local minima with the following contributions : • First , we point out that every local minimum is a global minimum in scalar target case with any depths , any widths and any sparse structure . Besides , we also briefly show that similar results hold for non-overlapping filters and orthogonal data feature when sparsity only occurs in the first layer . • Second , we find out that sparse connections would already give sub-optimal local minima in general non-scalar case through analytic and numerical examples built on convergence analyze . The local-min may be produced from two situations : a sub-sparse linear network which owes its minimum as a local-min of the original sparse network ; a rank-deficient solution between different data features due to sparse connections , while both cases verify the fact that sparsity cuts out the decreasing path in original fully-connected networks . Overall , we hope our work contributes to a better understanding of the landscape of sparsity network on simple neural networks , and provide insights for future research . The remainder of our paper is organized as follows . In Section 2 , we derive the positive findings of shallow sparse linear networks , providing similar landscape as dense linear networks . In Section 3 , we give several examples to show the existence of bad local-min for non-scalar case . In section 4 , we briefly generalize the results from shallow to deep sparse linear networks . Some proofs are in Appendix . 1.1 RELATED WORK . There is a rapidly increasing literature on analyzing the loss surface of neural network objectives , surveying all of which is well outside our scope . Thus , we only briefly survey the works most related to ours . Local minima is Global . The landscape of a linear network date back to Baldi & Hornik ( 1989 ) , proving that shallow linear neural networks do not suffer from bad local minima . Kawaguchi ( 2016 ) generalized same results to deep linear neural networks , and subsequent several works ( Arora et al. , 2018 ; Du & Hu , 2019 ; Eftekhari , 2020 ) give direct algorithm-type convergence based on this benign property , though algorithm analysis is beyond the scope of this paper . However , situations are quite complicated with nonlinear activations . Multiple works ( Ge et al. , 2017 ; Safran & Shamir , 2018 ; Yun et al. , 2018 ) show that spurious local minima can happen even in two-layer network with population or empirical loss , some are specific to two-layer and difficult to generalize to general multilayer cases . Another line of works ( Arora et al. , 2018 ; Allen-Zhu et al. , 2018 ; Du & Hu , 2019 ; Du et al. , 2018 ; Li et al. , 2018 ; Mei et al. , 2018 ) understands the landscape of neural network in an overparameterized setting , discovering benign landscape with or without gradient method . Since modern sparse networks reserve few parameters compared to overparameterization , we still seek a fundamental view of sparsity in contrast . Our standpoint is that spurious local minima can happen when applied with specific sparsity even in linear networks . Sparse networks . Sparse networks ( Han et al. , 2015b ; a ; Zhu & Gupta , 2017 ; Frankle & Carbin , 2018 ; Liu et al. , 2018 ) have a long history , but appears heavily on the experiments , and mainly related to network pruning , which has practical importance for reducing model parameter count and deploying diverse devices . However , training sparse networks ( from scratch ) suffers great difficulty . Frankle & Carbin ( 2018 ) recommend reusing the sparsity pattern found through pruning and train a sparse network from the same initialization as the original training ( ‘ lottery ’ ) to obtain comparable performance and avoid bad solution . Besides , for fixed sparsity patterns , Evci et al . ( 2019 ) attempt to find a decreasing objective path from ‘ bad ’ solutions to the ‘ good ’ ones in the sparse subspace but fail , showing bad local minima can be produced by pruning , while we give more direct view of simple examples to verify this . Moreover , several recent works also give abundant methods ( Molchanov et al. , 2017 ; Louizos et al. , 2017b ; Lee et al. , 2018 ; Carreira-Perpinán & Idelbayev , 2018 ) for choosing weights or sparse network structure while achieving similar performance . In theoretical view , Malach et al . ( 2020 ) prove that a sufficiently over-parameterized neural network with random weights contains a subnetwork with roughly the same accuracy as the target network , providing guarantee for ‘ good ’ sparse networks . Some works analyze convolutional network ( Shalev-Shwartz et al. , 2017 ; Du et al. , 2018 ) as a specific sparse structure . Brutzkus & Globerson ( 2017 ) analyze non-overlapping and overlapping structure as we do , but with weight sharing to simulate CNN-type structure , and under teacher-student setting with population risk . We do not follow CNN-type network but in general sparse networks , though still linear , to conclude straightforward results . 2 LANDSCAPE OF SHALLOW SPARSE LINEAR NETWORKS . 2.1 PRELIMINARIES AND NOTATION . We use bold-faced letters ( e.g. , w and a ) to denote vectors , capital letters ( e.g. , W = [ wij ] and A = [ aij ] ) for matrices . Let PX be the orthogonal projection to the column space of the matrix X , and λi ( H ) is the i-th smallest eigenvalue of a real symmetric matrix H . We consider the training samples and their outputs as { ( xi , yi ) } ni=1 ⊂ Rdx × Rdy , which may come from unknown distribution D. We form the data matrices X = [ x1 , . . . , xn ] T ∈ Rn×dx and Y = [ y1 , . . . , yn ] T ∈ Rn×dy , respectively . In our analysis in Sections 2 and 3 , we consider a two-layer ( sparse ) linear neural network with squared loss : min W , A L ( W , A ) : = 1 2 ‖Y −XWA‖2F , ( 1 ) where the first layer weight matrix W = [ w1 , . . . , wd ] ∈ Rdx×d , and the second layer weight matrix A = [ a1 , . . . , ad ] T ∈ Rd×dy . After weights pruning or sparsity constraint , many weights parameters become zero and would not be updated during retraining . We adopt Sj : = { k : wkj = 0 } as pruned dimensions in the j-th column ofW , and−Sj : = Scj = [ dx ] \Sj , where [ d ] : = { 1 , . . . , d } . In addition , wj , S denotes the sub-vector of wj choosing the positions in S , XS the sub-matrix of X choosing the column indices in S. We let pj = dx − |Sj | , where |S| is the cardinality of the set S. Then wj , −Sj ∈ Rpj is the remaining j-th column in first layer weight which leaves out pruned dimension set Sj . Similarly , X−Sj ∈ Rn×pj means the remaining data matrix connected to j-th node in the first layer . Finally , for simplicity , we denote X−j = X−Sj , w−j = wj , −Sj , and ( ̃· ) as the pruned layer weight with several zero elements not updated all along , if no ambiguity . Before we begin , a small note on the sparse structure we concern : there may have unnecessary connections and nodes , such as a node with zero out-degree which can be retrieved and excluded from the final layer to the first layer , and other cases are showing in Appendix C. Thus we do not consider them in the subsequent proof and assume each data dimension has valid output connection , i.e. , ∩dj=1Sj = ∅ . 2.2 SCALAR CASE . In the scalar case , assume dy = 1 . We then simplify A = ( a1 , . . . , ad ) T . When pruning any weight ai in the second layer , the output of the i-th node in the first layer contribute zero to final output . Hence wi can also be pruned . Without loss of generality , we assume second layer parameters are not pruned . After pruning several parameters , the original problem becomes min w−i , ai L ( W̃ , A ) : = 1 2 ∥∥∥∥∥∥∥Y − ( X−1 , . . . , X−i , . . . , X−d ) a1w−1 ... adw−d ∥∥∥∥∥∥∥ 2 F . ( 2 ) Theorem 1 For a two-layer linear neural network with scalar output and any sparse structure , every local minimum is a global minimum . Proof : From Eq . ( 2 ) , if a local minimizer satisfies ai = 0 for some 1 ≤ i ≤ d , then based on the second order condition for a local minima , we have ∂2L ∂a2i ∂2L ∂ai∂wT−i ∂L ∂w−i∂ai ∂L ∂w−i∂wT−i 0 , ( 3 ) which implies that wT−iX−iXT−iw−i − ( Y −∑di=1X−iw−iai ) T X−i −XT−i ( Y − ∑d i=1X−iw−iai ) 0 0 . ( 4 ) Then XT−i ( Y − ∑d i=1X−iw−iai ) = 0 , which is the global minimizer condition of w−iai . Otherwise , ai 6= 0 , then from the first-order condition for a local minima , ∂L ∂w−i = aiX T −i ( Y − d∑ i=1 X−iw−iai ) = 0 , showing that XT−i ( Y − ∑d i=1X−iw−iai ) = 0 , which also gives the global minimizer condition of w−iai . Hence every local minimum is a global minimum .
This paper studies the optimization landscape of (deep) sparse linear networks. The study of sparse neural networks is well motivated: on the one hand, there is a lot of experimental evidence that the loss of the trained network does not decrease much after removing a large subset of the connections; on the other hand, there is little theoretical evidence of what makes this behaviour possible (or how to provably construct sparse networks from dense ones). As a result, an investigation of the optimization landscape of sparse networks, even in the simple case of a linear activation function, is timely and interesting to the ICLR community, since it can potentially shed light on the questions above.
SP:ef9027da9feec26a1fe583b9cd8c77e260bdc00f
Generating Adversarial Computer Programs using Optimized Obfuscations
1 INTRODUCTION . Machine learning ( ML ) models are increasingly being used for software engineering tasks . Applications such as refactoring programs , auto-completing them in editors , and synthesizing GUI code have benefited from ML models trained on large repositories of programs , sourced from popular websites like GitHub ( Allamanis et al. , 2018 ) . They have also been adopted to reason about and assess programs ( Srikant & Aggarwal , 2014 ; Si et al. , 2018 ) , find and fix bugs ( Gupta et al. , 2017 ; Pradel & Sen , 2018 ) , detect malware and vulnerabilities in them ( Li et al. , 2018 ; Zhou et al. , 2019 ) etc . thus complementing traditional program analysis tools . As these models continue to be adopted for such applications , it is important to understand how robust they are to adversarial attacks . Such attacks can have adverse consequences , particularly in settings such as security ( Zhou et al. , 2019 ) and compliance automation ( Pedersen , 2010 ) . For example , an attacker could craft changes in malicious programs in a way which forces a model to incorrectly classify them as being benign , or make changes to pass off code which is licensed as open-source in an organization ’ s proprietary code-base . Adversarially perturbing a program should achieve two goals – a trained model should flip its decision when provided with the perturbed version of the program , and second , the perturbation should be imperceivable . Adversarial attacks have mainly been considered in image classification ( Goodfellow et al. , 2014 ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ) , where calculated minor changes made to pixels of an image are enough to satisfy the imperceptibility requirement . Such changes escape a human ’ s attention by making the image look the same as before perturbing it , while modifying the underlying representation enough to flip a classifier ’ s decision . However , programs demand a stricter imperceptibility requirement – not only should the changes avoid human attention , but the changed program should also importantly functionally behave the same as the unperturbed program . 1Source code : https : //github.com/ALFA-group/adversarial-code-generation Program obfuscations provide the agency to implement one such set of imperceivable changes in programs . Obfuscating computer programs have long been used as a way to avoid attempts at reverse-engineering them . They transform a program in a way that only hampers humans ’ comprehension of parts of the program , while retaining its original semantics and functionality . For example , one common obfuscation operation is to rename variables in an attempt to hide the program ’ s intent from a reader . Renaming a variable sum in the program statement int sum = 0 to int xyz = 0 neither alters how a compiler analyzes this variable nor changes any computations or states in the program ; it only hampers our understanding of this variable ’ s role in the program . Modifying a very small number of such aspects of a program marginally affects how we comprehend it , thus providing a way to produce changes imperceivable to both humans and a compiler . In this work , we view adversarial perturbations to programs as a special case of applying obfuscation transformations to them . Having identified a set of candidate transformations which produce imperceivable changes , a specific subset needs to be chosen in a way which would make the transformed program adversarial . Recent attempts ( Yefet et al. , 2019 ; Ramakrishnan et al. , 2020 ; Bielik & Vechev , 2020 ) which came closest to addressing this problem did not offer any rigorous formulation . They recommended using a variety of transformations without presenting any principled approach to selecting an optimal subset of transformations . We present a formulation which when solved provides the exact location to transform as well as a transformation to apply at the location . Figure 1 illustrates this . A randomly selected local-variable ( name ) when replaced by the name virtualname , which is generated by the stateof-the-art attack generation algorithm for programs ( Ramakrishnan et al. , 2020 ) , is unable to fool a program summarizer ( which predicts set item ) unless our proposed site optimization is applied . We provide a detailed comparison in Section 2 . In our work , we make the following key contributions – • We identify two problems central to defining an adversarial program – identifying the sites in a program to apply perturbations on , and the specific perturbations to apply on the selected sites . These perturbations are involve replacing existing tokens or inserting new ones . • We provide a general mathematical formulation of a perturbed program that models site locations and the perturbation choice for each location . It is independent of programming languages and the task on which a model is trained , while seamlessly modeling the application of multiple transformations to the program . • We propose a set of first-order optimization algorithms to solve our proposed formulation efficiently , resulting in a differentiable generator for adversarial programs . We further propose a randomized smoothing algorithm to achieve improved optimization performance . • Our approach demonstrates a 1.5x increase in the attack success rate over the state-of-the-art attack generation algorithm ( Ramakrishnan et al. , 2020 ) on large datasets of Python and Java programs . • We further show that our formulation provides better robustness against adversarial attacks compared to the state-of-the-art when used in training an ML model . 2 RELATED WORK . Due to a large body of literature on adversarial attacks in general , we focus on related works in the domain of computer programs . Wang & Christodorescu ( 2019 ) , Quiring et al . ( 2019 ) , Rabin et al . ( 2020 ) , and Pierazzi et al . ( 2020 ) identify obfuscation transformations as potential adversarial examples . They do not , however , find an optimal set of transformations to deceive a downstream model . Liu et al . ( 2017 ) provide a stochastic optimization formulation to obfuscate programs optimally by maximizing its impact on an obscurity language model ( OLM ) . However , they do not address the problem of adversarial robustness of ML models of programs , and their formulation is only to find the right sequence of transformations which increases their OLM ’ s perplexity . They use an MCMC-based search to find the best sequence . Yefet et al . ( 2019 ) propose perturbing programs by replacing local variables , and inserting print statements with replaceable string arguments . They find optimal replacements using a first-order optimization method , similar to Balog et al . ( 2016 ) and HotFlip ( Ebrahimi et al. , 2017 ) . This is formed - two replace sites corresponding to local variables b and r , and three insert sites at locations I1 , I2 , I3 . Ω is a vocabulary of tokens which can be used for the transformations . ( c ) This is a perturbed program with the tokens world and set from Ω used to replace tokens b and at location I3 . These transformations do not change the original functionality of P , but cause an incorrect prediction delete ( d ) Examples of two site selection vectors zi , zii selecting different components . zi = 1 for a location i signifies that the ith token in P is selected to be optimally transformed . zi corresponds to the perturbed program in ( c ) . an improvement over Zhang et al . ( 2020 ) , who use the Metropolis-Hastings algorithm to find an optimal replacement for variable names . Bielik & Vechev ( 2020 ) propose a robust training strategy which trains a model to abstain from deciding when uncertain if an input program is adversarially perturbed . The transformation space they consider is small , which they search through greedily . Moreover , their solution is designed to reason over a limited context of the program ( predicting variable types ) , and is non-trivial to extend to applications such as program summarization ( explored in this work ) which requires reasoning over an entire program . Ramakrishnan et al . ( 2020 ) extend the work by Yefet et al . ( 2019 ) and is most relevant to what we propose in this work . They experiment with a larger set of transformations and propose a standard min-max formulation to adversarially train robust models . Their inner-maximizer , which generates adversarial programs , models multiple transformations applied to a program in contrast to Yefet et al . ( 2019 ) . However , they do not propose any principled way to solve the problem of choosing between multiple program transformations . They randomly select transformation operations to apply , and then randomly select locations in the program to apply those transformations on . We instead show that optimizing for locations alone improves the attack performance . Further , we propose a joint optimization problem of finding the optimal location and optimal transformation , only the latter of which Ramakrishnan et al . ( 2020 ) ( and Yefet et al . ( 2019 ) ) address in a principled manner . Although formally unpublished at the time of preparing this work , we compare our experiments to Ramakrishnan et al . ( 2020 ) , the state-of-the-art in evaluating and defending against adversarial attacks on models for programs , and contrast the advantages of our formulation . 3 PROGRAM OBFUSCATIONS AS ADVERSARIAL PERTURBATIONS . In this section , we formalize program obfuscation operations , and show how generating adversarial programs can be cast as a constrained combinatorial optimization problem . Program obfuscations . We view obfuscation transformations made to programs as adversarial perturbations which can affect a downstream ML/DL model like a malware classifier or a program summarizer . While a variety of such obfuscation transformations exist for programs in general ( see section 2A , Liu et al . ( 2017 ) ) , we consider two broad classes – replace and insert transformations . In replace transformations , existing program constructs are replaced with variants which decrease readability . For example , replacing a variable ’ s name , a function parameter ’ s name , or an object field ’ s name does not affect the semantics of the program in any way . These names in any program exclusively aid human comprehension , and thus serve as three replace transformations . In insert transformations , we insert new statements to the program which are unrelated to the code it is inserted around , thereby obfuscating its original intent . For example , including a print statement with an arbitrary string argument does not change the semantics of the program in any way . Our goal hence is to introduce a systematic way to transform a program with insert or replace transformations such that a trained model misclassifies a program P that it originally classified correctly . Site-selection and Site-perturbation – Towards defining adversarial programs . Before we formally define an adversarial program , we highlight the key factors which need to be considered in our formulation through the example program introduced in Figure 2 . Consider applying the following two obfuscation transformations on the example program P in Figure 2.a – replacing local variable names ( a replace transform ) , and inserting print statements ( an insert transform ) . The two local variables b and r in P are potential candidates where the replace transform can be applied , while a print statement can potentially be inserted at the three locations I1 , I2 , I3 ( highlighted in Figure 2.b ) . We notate these choices in a program as sites– locations in a program where a unique transformation can be applied . Thus , in order to adversarially perturb P , we identify two important questions that need to be addressed . First , which sites in a program should be transformed ? Of the n sites in a program , if we are allowed to choose at most k sites , which set of ≤ k sites would have the highest impact on the downstream model ’ s performance ? We identify this as the site-selection problem , where the constraint k is the perturbation strength of an attacker . Second , what tokens should be inserted/replaced at the k selected sites ? Once we pick k sites , we still have to determine the best choice of tokens to replace/insert at those sites which would have the highest impact on the downstream model . We refer to this as the site-perturbation problem . Mathematical formulation . In what follows , we propose a general and rigorous formulation of adversarial programs . LetP denote a benign program which consists of a series of n tokens { Pi } ni=1 in the source code domain . For example , the program in Figure 2.a , when read from top to bottom and left to right , forms a series of n = 12 tokens { def , b , . . . , r , + , 5 } . We ignore white spaces and other delimiters when tokenizing . Each Pi ∈ { 0 , 1 } |Ω| here is considered a one-hot vector of length |Ω| , where Ω is a vocabulary of tokens . Let P ′ define a perturbed program ( with respect to P ) created by solving the site-selection and site-perturbation problems , which use the vocabulary Ω to find an optimal replacement . Since our formulation is agnostic to the type of transformation , perturbation in the remainder of this section refers to both replace and insert transforms . In our work , we use a shared vocabulary Ω to select transforms from both these classes . In practice , we can also assign a unique vocabulary to each transformation we define . To formalize the site-selection problem , we introduce a vector of boolean variables z ∈ { 0 , 1 } n to indicate whether or not a site is selected for perturbation . If zi = 1 then the ith site ( namely , Pi ) is perturbed . If there exist multiple occurrences of a token in the program , then all such sites are marked 1 . For example , in Figure 2.d , if the site corresponding to local variable b is selected , then both indices of its occurrences , z3 , z9 are marked as 1 as shown in zi . Moreover , the number of perturbed sites , namely , 1T z ≤ k provides a means of measuring perturbation strength . For example , k = 1 is the minimum perturbation possible , where only one site is allowed to be perturbed . To define site-perturbation , we introduce a one-hot vector ui ∈ { 0 , 1 } |Ω| to encode the selection of a token from Ω which would serve as the insert/replace token for a chosen transformation at a chosen site . If the jth entry [ ui ] j = 1 and zi = 1 , then the jth token in Ω is used as the obfuscation transformation applied at the site i ( namely , to perturb Pi ) . We also have the constraint 1Tui = 1 , implying that only one perturbation is performed at Pi . Let vector u ∈ { 0 , 1 } n×|Ω| denote n different ui vectors , one for each token i in P . Using the above formulations for site-selection , site-perturbation and perturbation strength , the perturbed program P ′ can then be defined as P ′ = ( 1− z ) · P + z · u , where 1T z ≤ k , z ∈ { 0 , 1 } n , 1Tui = 1 , ui ∈ { 0 , 1 } |Ω| , ∀i , ( 1 ) where · denotes the element-column wise product . The adversarial effect of P ′ is then measured by passing it as input to a downstream ML/DL model θ and seeing if it successfully manages to fool it . Generating a successful adversarial program is then formulated as the optimization problem , minimize z , u ` attack ( ( 1− z ) · P + z · u ; P , θ ) subject to constraints in ( 1 ) , ( 2 ) where ` attack denotes an attack loss . In this work , we specify ` attack as the cross-entropy loss on the predicted output evaluated at P ′ in an untargeted setting ( namely , without specifying the prediction label targeted by an adversary ) ( Ramakrishnan et al. , 2020 ) . One can also consider other specifications of ` attack , e.g. , C & W untargeted and targeted attack losses ( Carlini & Wagner , 2017 ) .
This work tackles the problem of adversarial attacks against ML models for code-understanding tasks, such as function summarization. It formulates the problem as the adversarial application of existing semantics-preserving program transformations (e.g., renaming variables), by jointly optimizing on the location of such a transformation, and the argument to the transformation (e.g., what to replace an existing identifier with). It shows that such adversarial examples increase the attack success rate over baseline approaches, and training with such examples increases the robustness of the resulting model to the same or baseline attacks.
SP:598a0c59ed1b2fb08626115179948768d09f0e45
Generating Adversarial Computer Programs using Optimized Obfuscations
1 INTRODUCTION . Machine learning ( ML ) models are increasingly being used for software engineering tasks . Applications such as refactoring programs , auto-completing them in editors , and synthesizing GUI code have benefited from ML models trained on large repositories of programs , sourced from popular websites like GitHub ( Allamanis et al. , 2018 ) . They have also been adopted to reason about and assess programs ( Srikant & Aggarwal , 2014 ; Si et al. , 2018 ) , find and fix bugs ( Gupta et al. , 2017 ; Pradel & Sen , 2018 ) , detect malware and vulnerabilities in them ( Li et al. , 2018 ; Zhou et al. , 2019 ) etc . thus complementing traditional program analysis tools . As these models continue to be adopted for such applications , it is important to understand how robust they are to adversarial attacks . Such attacks can have adverse consequences , particularly in settings such as security ( Zhou et al. , 2019 ) and compliance automation ( Pedersen , 2010 ) . For example , an attacker could craft changes in malicious programs in a way which forces a model to incorrectly classify them as being benign , or make changes to pass off code which is licensed as open-source in an organization ’ s proprietary code-base . Adversarially perturbing a program should achieve two goals – a trained model should flip its decision when provided with the perturbed version of the program , and second , the perturbation should be imperceivable . Adversarial attacks have mainly been considered in image classification ( Goodfellow et al. , 2014 ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ) , where calculated minor changes made to pixels of an image are enough to satisfy the imperceptibility requirement . Such changes escape a human ’ s attention by making the image look the same as before perturbing it , while modifying the underlying representation enough to flip a classifier ’ s decision . However , programs demand a stricter imperceptibility requirement – not only should the changes avoid human attention , but the changed program should also importantly functionally behave the same as the unperturbed program . 1Source code : https : //github.com/ALFA-group/adversarial-code-generation Program obfuscations provide the agency to implement one such set of imperceivable changes in programs . Obfuscating computer programs have long been used as a way to avoid attempts at reverse-engineering them . They transform a program in a way that only hampers humans ’ comprehension of parts of the program , while retaining its original semantics and functionality . For example , one common obfuscation operation is to rename variables in an attempt to hide the program ’ s intent from a reader . Renaming a variable sum in the program statement int sum = 0 to int xyz = 0 neither alters how a compiler analyzes this variable nor changes any computations or states in the program ; it only hampers our understanding of this variable ’ s role in the program . Modifying a very small number of such aspects of a program marginally affects how we comprehend it , thus providing a way to produce changes imperceivable to both humans and a compiler . In this work , we view adversarial perturbations to programs as a special case of applying obfuscation transformations to them . Having identified a set of candidate transformations which produce imperceivable changes , a specific subset needs to be chosen in a way which would make the transformed program adversarial . Recent attempts ( Yefet et al. , 2019 ; Ramakrishnan et al. , 2020 ; Bielik & Vechev , 2020 ) which came closest to addressing this problem did not offer any rigorous formulation . They recommended using a variety of transformations without presenting any principled approach to selecting an optimal subset of transformations . We present a formulation which when solved provides the exact location to transform as well as a transformation to apply at the location . Figure 1 illustrates this . A randomly selected local-variable ( name ) when replaced by the name virtualname , which is generated by the stateof-the-art attack generation algorithm for programs ( Ramakrishnan et al. , 2020 ) , is unable to fool a program summarizer ( which predicts set item ) unless our proposed site optimization is applied . We provide a detailed comparison in Section 2 . In our work , we make the following key contributions – • We identify two problems central to defining an adversarial program – identifying the sites in a program to apply perturbations on , and the specific perturbations to apply on the selected sites . These perturbations are involve replacing existing tokens or inserting new ones . • We provide a general mathematical formulation of a perturbed program that models site locations and the perturbation choice for each location . It is independent of programming languages and the task on which a model is trained , while seamlessly modeling the application of multiple transformations to the program . • We propose a set of first-order optimization algorithms to solve our proposed formulation efficiently , resulting in a differentiable generator for adversarial programs . We further propose a randomized smoothing algorithm to achieve improved optimization performance . • Our approach demonstrates a 1.5x increase in the attack success rate over the state-of-the-art attack generation algorithm ( Ramakrishnan et al. , 2020 ) on large datasets of Python and Java programs . • We further show that our formulation provides better robustness against adversarial attacks compared to the state-of-the-art when used in training an ML model . 2 RELATED WORK . Due to a large body of literature on adversarial attacks in general , we focus on related works in the domain of computer programs . Wang & Christodorescu ( 2019 ) , Quiring et al . ( 2019 ) , Rabin et al . ( 2020 ) , and Pierazzi et al . ( 2020 ) identify obfuscation transformations as potential adversarial examples . They do not , however , find an optimal set of transformations to deceive a downstream model . Liu et al . ( 2017 ) provide a stochastic optimization formulation to obfuscate programs optimally by maximizing its impact on an obscurity language model ( OLM ) . However , they do not address the problem of adversarial robustness of ML models of programs , and their formulation is only to find the right sequence of transformations which increases their OLM ’ s perplexity . They use an MCMC-based search to find the best sequence . Yefet et al . ( 2019 ) propose perturbing programs by replacing local variables , and inserting print statements with replaceable string arguments . They find optimal replacements using a first-order optimization method , similar to Balog et al . ( 2016 ) and HotFlip ( Ebrahimi et al. , 2017 ) . This is formed - two replace sites corresponding to local variables b and r , and three insert sites at locations I1 , I2 , I3 . Ω is a vocabulary of tokens which can be used for the transformations . ( c ) This is a perturbed program with the tokens world and set from Ω used to replace tokens b and at location I3 . These transformations do not change the original functionality of P , but cause an incorrect prediction delete ( d ) Examples of two site selection vectors zi , zii selecting different components . zi = 1 for a location i signifies that the ith token in P is selected to be optimally transformed . zi corresponds to the perturbed program in ( c ) . an improvement over Zhang et al . ( 2020 ) , who use the Metropolis-Hastings algorithm to find an optimal replacement for variable names . Bielik & Vechev ( 2020 ) propose a robust training strategy which trains a model to abstain from deciding when uncertain if an input program is adversarially perturbed . The transformation space they consider is small , which they search through greedily . Moreover , their solution is designed to reason over a limited context of the program ( predicting variable types ) , and is non-trivial to extend to applications such as program summarization ( explored in this work ) which requires reasoning over an entire program . Ramakrishnan et al . ( 2020 ) extend the work by Yefet et al . ( 2019 ) and is most relevant to what we propose in this work . They experiment with a larger set of transformations and propose a standard min-max formulation to adversarially train robust models . Their inner-maximizer , which generates adversarial programs , models multiple transformations applied to a program in contrast to Yefet et al . ( 2019 ) . However , they do not propose any principled way to solve the problem of choosing between multiple program transformations . They randomly select transformation operations to apply , and then randomly select locations in the program to apply those transformations on . We instead show that optimizing for locations alone improves the attack performance . Further , we propose a joint optimization problem of finding the optimal location and optimal transformation , only the latter of which Ramakrishnan et al . ( 2020 ) ( and Yefet et al . ( 2019 ) ) address in a principled manner . Although formally unpublished at the time of preparing this work , we compare our experiments to Ramakrishnan et al . ( 2020 ) , the state-of-the-art in evaluating and defending against adversarial attacks on models for programs , and contrast the advantages of our formulation . 3 PROGRAM OBFUSCATIONS AS ADVERSARIAL PERTURBATIONS . In this section , we formalize program obfuscation operations , and show how generating adversarial programs can be cast as a constrained combinatorial optimization problem . Program obfuscations . We view obfuscation transformations made to programs as adversarial perturbations which can affect a downstream ML/DL model like a malware classifier or a program summarizer . While a variety of such obfuscation transformations exist for programs in general ( see section 2A , Liu et al . ( 2017 ) ) , we consider two broad classes – replace and insert transformations . In replace transformations , existing program constructs are replaced with variants which decrease readability . For example , replacing a variable ’ s name , a function parameter ’ s name , or an object field ’ s name does not affect the semantics of the program in any way . These names in any program exclusively aid human comprehension , and thus serve as three replace transformations . In insert transformations , we insert new statements to the program which are unrelated to the code it is inserted around , thereby obfuscating its original intent . For example , including a print statement with an arbitrary string argument does not change the semantics of the program in any way . Our goal hence is to introduce a systematic way to transform a program with insert or replace transformations such that a trained model misclassifies a program P that it originally classified correctly . Site-selection and Site-perturbation – Towards defining adversarial programs . Before we formally define an adversarial program , we highlight the key factors which need to be considered in our formulation through the example program introduced in Figure 2 . Consider applying the following two obfuscation transformations on the example program P in Figure 2.a – replacing local variable names ( a replace transform ) , and inserting print statements ( an insert transform ) . The two local variables b and r in P are potential candidates where the replace transform can be applied , while a print statement can potentially be inserted at the three locations I1 , I2 , I3 ( highlighted in Figure 2.b ) . We notate these choices in a program as sites– locations in a program where a unique transformation can be applied . Thus , in order to adversarially perturb P , we identify two important questions that need to be addressed . First , which sites in a program should be transformed ? Of the n sites in a program , if we are allowed to choose at most k sites , which set of ≤ k sites would have the highest impact on the downstream model ’ s performance ? We identify this as the site-selection problem , where the constraint k is the perturbation strength of an attacker . Second , what tokens should be inserted/replaced at the k selected sites ? Once we pick k sites , we still have to determine the best choice of tokens to replace/insert at those sites which would have the highest impact on the downstream model . We refer to this as the site-perturbation problem . Mathematical formulation . In what follows , we propose a general and rigorous formulation of adversarial programs . LetP denote a benign program which consists of a series of n tokens { Pi } ni=1 in the source code domain . For example , the program in Figure 2.a , when read from top to bottom and left to right , forms a series of n = 12 tokens { def , b , . . . , r , + , 5 } . We ignore white spaces and other delimiters when tokenizing . Each Pi ∈ { 0 , 1 } |Ω| here is considered a one-hot vector of length |Ω| , where Ω is a vocabulary of tokens . Let P ′ define a perturbed program ( with respect to P ) created by solving the site-selection and site-perturbation problems , which use the vocabulary Ω to find an optimal replacement . Since our formulation is agnostic to the type of transformation , perturbation in the remainder of this section refers to both replace and insert transforms . In our work , we use a shared vocabulary Ω to select transforms from both these classes . In practice , we can also assign a unique vocabulary to each transformation we define . To formalize the site-selection problem , we introduce a vector of boolean variables z ∈ { 0 , 1 } n to indicate whether or not a site is selected for perturbation . If zi = 1 then the ith site ( namely , Pi ) is perturbed . If there exist multiple occurrences of a token in the program , then all such sites are marked 1 . For example , in Figure 2.d , if the site corresponding to local variable b is selected , then both indices of its occurrences , z3 , z9 are marked as 1 as shown in zi . Moreover , the number of perturbed sites , namely , 1T z ≤ k provides a means of measuring perturbation strength . For example , k = 1 is the minimum perturbation possible , where only one site is allowed to be perturbed . To define site-perturbation , we introduce a one-hot vector ui ∈ { 0 , 1 } |Ω| to encode the selection of a token from Ω which would serve as the insert/replace token for a chosen transformation at a chosen site . If the jth entry [ ui ] j = 1 and zi = 1 , then the jth token in Ω is used as the obfuscation transformation applied at the site i ( namely , to perturb Pi ) . We also have the constraint 1Tui = 1 , implying that only one perturbation is performed at Pi . Let vector u ∈ { 0 , 1 } n×|Ω| denote n different ui vectors , one for each token i in P . Using the above formulations for site-selection , site-perturbation and perturbation strength , the perturbed program P ′ can then be defined as P ′ = ( 1− z ) · P + z · u , where 1T z ≤ k , z ∈ { 0 , 1 } n , 1Tui = 1 , ui ∈ { 0 , 1 } |Ω| , ∀i , ( 1 ) where · denotes the element-column wise product . The adversarial effect of P ′ is then measured by passing it as input to a downstream ML/DL model θ and seeing if it successfully manages to fool it . Generating a successful adversarial program is then formulated as the optimization problem , minimize z , u ` attack ( ( 1− z ) · P + z · u ; P , θ ) subject to constraints in ( 1 ) , ( 2 ) where ` attack denotes an attack loss . In this work , we specify ` attack as the cross-entropy loss on the predicted output evaluated at P ′ in an untargeted setting ( namely , without specifying the prediction label targeted by an adversary ) ( Ramakrishnan et al. , 2020 ) . One can also consider other specifications of ` attack , e.g. , C & W untargeted and targeted attack losses ( Carlini & Wagner , 2017 ) .
* This paper proposes an optimization problem to adopt insert/replace operations (program obfuscations) to generate adversarial programs. They apply it to the task of program summarization, and show that they outperform the existing baseline published in 2020. In particular, one of the main contributions is the identification of the site-perturbation and site-selection process, and formalizing them as practical optimization based on PGD.
SP:598a0c59ed1b2fb08626115179948768d09f0e45
Domain-Free Adversarial Splitting for Domain Generalization
Domain generalization is an approach that utilizes several source domains to train the learner to be generalizable to unseen target domain to tackle domain shift issue . It has drawn much attention in machine learning community . This paper aims to learn to generalize well to unseen target domain without relying on the knowledge of the number of source domains and domain labels . We unify adversarial training and meta-learning in a novel proposed Domain-Free Adversarial Splitting ( DFAS ) framework . In this framework , we model the domain generalization as a learning problem that enforces the learner to be able to generalize well for any train/val subsets splitting of the training dataset . To achieve this goal , we propose a min-max optimization problem which can be solved by an iterative adversarial training process . In each iteration , it adversarially splits the training dataset into train/val subsets to maximize domain shift between them using current learner , and then updates the learner on this splitting to be able to generalize well from train-subset to val-subset using meta-learning approach . Extensive experiments on three benchmark datasets under three different settings on the source and target domains show that our method achieves state-of-the-art results and confirm the effectiveness of our method by ablation study . We also derive a generalization error bound for theoretical understanding of our method . 1 INTRODUCTION . Deep learning approach has achieved great success in image recognition ( He et al. , 2016 ; Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2014 ) . However , deep learning methods mostly succeed in the case that the training and test data are sampled from the same distribution ( i.e. , the i.i.d . assumption ) . However , this assumption is often violated in real-world applications since the equipments/environments that generate data are often different in training and test datasets . When there exists distribution difference ( domain shift ( Torralba & Efros , 2011 ) ) between training and test datasets , the performance of trained model , i.e. , learner , will significantly degrade . To tackle the domain shift issue , domain adaptation approach ( Pan & Yang , 2010 ; Daume III & Marcu , 2006 ; Huang et al. , 2007 ) learns a transferable learner from source domain to target domain . Domain adaptation methods align distributions of different domains either in feature space ( Long et al. , 2015 ; Ganin et al. , 2016 ) or in raw pixel space ( Hoffman et al. , 2018 ) , which relies on unlabeled data from target domain at training time . However , in many applications , it is unrealistic to access the unlabeled target data , therefore this prevents us to use domain adaptation approach in this setting , and motivates the research on the learning problem of domain generalization . Domain generalization ( DG ) approach ( Blanchard et al. , 2011 ; Muandet et al. , 2013 ) commonly uses several source domains to train a learner that can generalize to an unseen target domain . The underlying assumption is that there exists a latent domain invariant feature space across source domains and unseen target domain . To learn the domain invariant features , ( Muandet et al. , 2013 ; Ghifary et al. , 2015 ; Li et al. , 2018b ) explicitly align distributions of different source domains in feature space . ( Balaji et al. , 2018 ; Li et al. , 2019b ; 2018a ; Dou et al. , 2019 ) split source domains into meta-train and meta-test to simulate domain shift and train learner in a meta-learning approach . ( Shankar et al. , 2018 ; Carlucci et al. , 2019 ; Zhou et al. , 2020 ; Ryu et al. , 2020 ) augment images or features to train learner to enhance generalization capability . Conventional domain generalization methods assume that the domain labels are available . But in a more realistic scenario , the domain labels may be unknown ( Wang et al. , 2019 ) . To handle this domain-free setting , Carlucci et al . ( 2019 ) combines supervised learning and self-supervised learning to solve jigsaw puzzles of the training images . Matsuura & Harada ( 2020 ) divides samples into several latent domains via clustering and trains a domain invariant feature extractor via adversarial training . Huang et al . ( 2020 ) discards the dominant activated features , forcing the learner to activate remaining features that correlate with labels . Another line of works ( Volpi et al. , 2018 ; Qiao et al. , 2020 ) tackle the single source setting that the training set comprises a single domain , and the train and test data are from different domains . In this work , we focus on a general learning scenario of domain generalization as follows . First , we do not know the domain label of each data and do not assume that there are several domains in the training dataset . Second , we do not assume that the training and test data are from different domains ( e.g. , styles ) . However , the previous domain-free DG methods ( Matsuura & Harada , 2020 ) commonly evaluate on the datasets ( e.g. , PACS ) composed of several domains though they do not use domain labels in training . In our domain-free setting , we do not assume and know the domains in the training dataset , we therefore model domain generalization as a learning problem that the learner should be able to generalize well for any splitting of train/val subsets , i.e. , synthetic source/target domains , over the training dataset . This explicitly enforces that the trained learner should be generalizable for any possible domain shifts within the training dataset . To achieve this goal , we propose an adversarial splitting model that is a min-max optimization problem , due to the difficulty of enumerating all splittings . In this min-max problem , we adversarially split training dataset to train/val subsets by maximizing the domain shift between them based on the given learner , and then update learner by minimizing the prediction error on val-subset using meta-learning approach given the splitting . By optimizing this min-max problem , we enforce the learner to generalize well even in the worst-case splitting . We also investigate L2-normalization of features in our domain generalization method . It is surprisingly found that L2-normalization can improve performance of learner and mitigate gradient explosion in the meta-learning process of DG . We further theorectically analyze the underlying reasons for this finding . This proposed domain generalization approach is dubbed Domain-Free Adversarial Splitting , i.e. , DFAS . To verify the effectiveness of our method , we conduct extensive experiments on benchmark datasets of PACS , Office-Home and CIFAR-10 under different settings with multiple/single source domains . In experiments that the training data are from several source domains , our method achieves state-ofthe-art results on both PACS and Office-Home datasets . We also find that our method significantly outperforms baselines in experiments that the training data are from a single source domain on PACS and CIFAR-10 . We also confirm the effectiveness of our method by ablation study . Based on domain adaptation theory , we also derive an upper bound of the generalization error on unseen target domain . We analyze that the terms in this upper bound are implicitly minimized by our method . This theoretical analysis partially explains the success of our method . 2 RELATED WORKS . We summarize and compare with related domain generalization ( DG ) methods in two perspectives , i.e. , DG with domain labels and DG without domain labels . DG with domain labels . When the domain labels are available , there are three categories of methods for DG . First , ( Muandet et al. , 2013 ; Ghifary et al. , 2015 ; Li et al. , 2018b ; Piratla et al. , 2020 ) learn domain invariant features by aligning feature distributions or by common/specific feature decomposition . Second , ( Li et al. , 2019a ; Balaji et al. , 2018 ; Li et al. , 2019b ; 2018a ; Dou et al. , 2019 ; Du et al. , 2020a ; b ) are based on meta-learning approach that splits given source domains into meta-train and meta-test domains and trains learner in an episodic training paradigm . Third , ( Shankar et al. , 2018 ; Carlucci et al. , 2019 ; Zhou et al. , 2020 ; Wang et al. , 2020 ) augment fake domain data to train learner for enhancing generalization capability of learner . Our method may mostly relate to the above second category of methods . But differently , we consider the DG problem in domain-free setting and adversarially split training dataset to synthesize domain shift in a principled min-max optimization method , instead of using leave-one-domain-out splitting in these methods . DG without domain labels . When the domain label is unavailable , to enhance generalization ability of learner , Wang et al . ( 2019 ) extracts robust feature representation by projecting out superficial patterns like color and texture . Carlucci et al . ( 2019 ) proposes to solve jigsaw puzzles of the training images . Matsuura & Harada ( 2020 ) divides samples into several latent domains via clustering and learns domain invariant features via adversarial training of feature extractor and domain discriminator . Huang et al . ( 2020 ) discards the dominant activated features , forcing the learner to activate remaining features that correlate with labels . Volpi et al . ( 2018 ) and Qiao et al . ( 2020 ) propose adversarial data augmentation to tackle the setting that the training set comprises a single domain . In methodology , these methods either explicitly force the learner to extract robust features ( Wang et al. , 2019 ; Matsuura & Harada , 2020 ; Huang et al. , 2020 ) or augment new data to increase training data ( Carlucci et al. , 2019 ; Qiao et al. , 2020 ; Volpi et al. , 2018 ) . While our method is a novel meta-learning approach for DG by introducing adversarial splitting of training dataset during training , without relying on data/domain augmentation . 3 METHOD . In our setting , since we do not assume and know the domains in the training dataset , the training data could be independently sampled from several underlying source domains or just from a single source domain . We denote S = { ( xi , yi ) } Ni=1 as the training dataset . Our goal is to train the learner with S that can generalize well on an unseen target domain . In the following sections , we introduce details of our proposed model in Sect . 3.1 , followed by its optimization method in Sect . 3.2 . We also investigate L2-normalization for domain generalization in Sect . 3.3 . Theoretical analysis for our method is presented in Sect . 4 . Experimental results are reported in Sect . 5 . Sect . 6 concludes this paper . 3.1 DOMAIN-FREE ADVERSARIAL SPLITTING MODEL . As mentioned in Sect . 1 , we model DG as a learning problem that enforces the learner to be able to generalize well for any train/val subsets splitting of the training dataset . The learner is trained using meta-learning approach ( Finn et al. , 2017 ) . To formulate our idea mathematically , we first introduce some notations . We denote f as a function/learner ( f could be a deep neural network , e.g. , ResNet ( He et al. , 2016 ) ) that outputs classification score of the input image , l as the loss such as cross-entropy , St and Sv as the train-subset and val-subset respectively such that S = St ∪ Sv and St ∩ Sv = ∅ . The formulated optimization problem for domain generalization is min w 1 |Γξ| ∑ Sv∈Γξ L ( θ ( w ) ; Sv ) +R ( w ) s.t . θ ( w ) = arg min θ L ( θ ; St , w ) , St = S − Sv . ( 1 ) In Eq . ( 1 ) , Γξ = { Sv : Sv ⊂ S , |Sv| = ξ } is the set of all possible val-subsets of S with length of ξ , St = S − Sv is train-subset paired with each Sv , L ( θ ( w ) ; Sv ) = 1|Sv| ∑ ( x , y ) ∈Sv l ( fθ ( w ) ( x ) , y ) is the loss on Sv , where θ ( w ) is the parameters of f , L ( θ ; St , w ) is L ( θ ; St ) with θ initialized by w andR ( w ) is regularization term . In the optimization model of Eq . ( 1 ) , the parameter θ ( w ) of learner trained on St is treated as a function of the initial parameter w. To force the learner trained on St to generalize well on Sv , we directly minimize the loss L ( θ ( w ) ; Sv ) , dubbed generalization loss , on val-subset Sv , w.r.t . the parameter θ ( w ) trained on St . Solving Eq . ( 1 ) will force the learner to be able to generalize well from any train-subset to corresponding val-subset . Since |Γξ| may be extremely large , it is infeasible to enumerate all possible train/val splittings . Thus , we propose the following adversarial splitting model instead , min w max Sv∈Γξ L ( θ ( w ) ; Sv ) +R ( w ) s.t . θ ( w ) = arg min θ L ( θ ; St , w ) , St = S − Sv . ( 2 ) In the min-max problem of Eq . ( 2 ) , the train/val ( St/Sv ) splitting is optimized to maximize the generalization loss to increase the domain shift between train and val subsets by finding the hardest splitting to the learner . While w is optimized by minimizing the generalization loss of learner over the splitting . Solving this adversarial splitting optimization model in Eq . ( 2 ) enforces the learner to be generalizable even for the worst-case splitting . We therefore expect that the trained learner is robust to the domain shifts within the training dataset . For the regularization termR ( w ) , we set it to be the training loss on St ( i.e. , R ( w ) = L ( w ; St ) ) , which additionally constrains that the learner with parameter w should be effective on St ( Li et al. , 2018a ) . The effect of the hyper-parameter ξ will be discussed in Appendix A.2 . In conventional adversarial machine learning , adversarial training is imposed on adversarial samples and learner to increase robustness of the learner to adversarial corruption ( Goodfellow et al. , 2015 ) . While in our optimization model of Eq . ( 2 ) , adversarial training is conducted on data splitting and learner to force the learner to be robust to domain shift between train/val subsets . Our model bridges adversarial training and meta-learning . It is a general learning framework for domain generalization and is a complement to adversarial machine learning .
This paper focuses on domain generalization, targeting the challenging scenario where the training set might not include different sources; even under the presence of different sources, the problem formulation does not takes into account domain labels. The proposed solution is based on meta-learning, following the path drawn by Li et al. AAAI 2018; the Authors propose to adversarially split the training set in meta-train and meta-validation sets, and then update the current model in a direction that fosters good generalization performance on the meta-test. Results on standard benchmarks are encouraging.
SP:dc605d174368de20c31edca06ef90fc18fb79faa
Domain-Free Adversarial Splitting for Domain Generalization
Domain generalization is an approach that utilizes several source domains to train the learner to be generalizable to unseen target domain to tackle domain shift issue . It has drawn much attention in machine learning community . This paper aims to learn to generalize well to unseen target domain without relying on the knowledge of the number of source domains and domain labels . We unify adversarial training and meta-learning in a novel proposed Domain-Free Adversarial Splitting ( DFAS ) framework . In this framework , we model the domain generalization as a learning problem that enforces the learner to be able to generalize well for any train/val subsets splitting of the training dataset . To achieve this goal , we propose a min-max optimization problem which can be solved by an iterative adversarial training process . In each iteration , it adversarially splits the training dataset into train/val subsets to maximize domain shift between them using current learner , and then updates the learner on this splitting to be able to generalize well from train-subset to val-subset using meta-learning approach . Extensive experiments on three benchmark datasets under three different settings on the source and target domains show that our method achieves state-of-the-art results and confirm the effectiveness of our method by ablation study . We also derive a generalization error bound for theoretical understanding of our method . 1 INTRODUCTION . Deep learning approach has achieved great success in image recognition ( He et al. , 2016 ; Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2014 ) . However , deep learning methods mostly succeed in the case that the training and test data are sampled from the same distribution ( i.e. , the i.i.d . assumption ) . However , this assumption is often violated in real-world applications since the equipments/environments that generate data are often different in training and test datasets . When there exists distribution difference ( domain shift ( Torralba & Efros , 2011 ) ) between training and test datasets , the performance of trained model , i.e. , learner , will significantly degrade . To tackle the domain shift issue , domain adaptation approach ( Pan & Yang , 2010 ; Daume III & Marcu , 2006 ; Huang et al. , 2007 ) learns a transferable learner from source domain to target domain . Domain adaptation methods align distributions of different domains either in feature space ( Long et al. , 2015 ; Ganin et al. , 2016 ) or in raw pixel space ( Hoffman et al. , 2018 ) , which relies on unlabeled data from target domain at training time . However , in many applications , it is unrealistic to access the unlabeled target data , therefore this prevents us to use domain adaptation approach in this setting , and motivates the research on the learning problem of domain generalization . Domain generalization ( DG ) approach ( Blanchard et al. , 2011 ; Muandet et al. , 2013 ) commonly uses several source domains to train a learner that can generalize to an unseen target domain . The underlying assumption is that there exists a latent domain invariant feature space across source domains and unseen target domain . To learn the domain invariant features , ( Muandet et al. , 2013 ; Ghifary et al. , 2015 ; Li et al. , 2018b ) explicitly align distributions of different source domains in feature space . ( Balaji et al. , 2018 ; Li et al. , 2019b ; 2018a ; Dou et al. , 2019 ) split source domains into meta-train and meta-test to simulate domain shift and train learner in a meta-learning approach . ( Shankar et al. , 2018 ; Carlucci et al. , 2019 ; Zhou et al. , 2020 ; Ryu et al. , 2020 ) augment images or features to train learner to enhance generalization capability . Conventional domain generalization methods assume that the domain labels are available . But in a more realistic scenario , the domain labels may be unknown ( Wang et al. , 2019 ) . To handle this domain-free setting , Carlucci et al . ( 2019 ) combines supervised learning and self-supervised learning to solve jigsaw puzzles of the training images . Matsuura & Harada ( 2020 ) divides samples into several latent domains via clustering and trains a domain invariant feature extractor via adversarial training . Huang et al . ( 2020 ) discards the dominant activated features , forcing the learner to activate remaining features that correlate with labels . Another line of works ( Volpi et al. , 2018 ; Qiao et al. , 2020 ) tackle the single source setting that the training set comprises a single domain , and the train and test data are from different domains . In this work , we focus on a general learning scenario of domain generalization as follows . First , we do not know the domain label of each data and do not assume that there are several domains in the training dataset . Second , we do not assume that the training and test data are from different domains ( e.g. , styles ) . However , the previous domain-free DG methods ( Matsuura & Harada , 2020 ) commonly evaluate on the datasets ( e.g. , PACS ) composed of several domains though they do not use domain labels in training . In our domain-free setting , we do not assume and know the domains in the training dataset , we therefore model domain generalization as a learning problem that the learner should be able to generalize well for any splitting of train/val subsets , i.e. , synthetic source/target domains , over the training dataset . This explicitly enforces that the trained learner should be generalizable for any possible domain shifts within the training dataset . To achieve this goal , we propose an adversarial splitting model that is a min-max optimization problem , due to the difficulty of enumerating all splittings . In this min-max problem , we adversarially split training dataset to train/val subsets by maximizing the domain shift between them based on the given learner , and then update learner by minimizing the prediction error on val-subset using meta-learning approach given the splitting . By optimizing this min-max problem , we enforce the learner to generalize well even in the worst-case splitting . We also investigate L2-normalization of features in our domain generalization method . It is surprisingly found that L2-normalization can improve performance of learner and mitigate gradient explosion in the meta-learning process of DG . We further theorectically analyze the underlying reasons for this finding . This proposed domain generalization approach is dubbed Domain-Free Adversarial Splitting , i.e. , DFAS . To verify the effectiveness of our method , we conduct extensive experiments on benchmark datasets of PACS , Office-Home and CIFAR-10 under different settings with multiple/single source domains . In experiments that the training data are from several source domains , our method achieves state-ofthe-art results on both PACS and Office-Home datasets . We also find that our method significantly outperforms baselines in experiments that the training data are from a single source domain on PACS and CIFAR-10 . We also confirm the effectiveness of our method by ablation study . Based on domain adaptation theory , we also derive an upper bound of the generalization error on unseen target domain . We analyze that the terms in this upper bound are implicitly minimized by our method . This theoretical analysis partially explains the success of our method . 2 RELATED WORKS . We summarize and compare with related domain generalization ( DG ) methods in two perspectives , i.e. , DG with domain labels and DG without domain labels . DG with domain labels . When the domain labels are available , there are three categories of methods for DG . First , ( Muandet et al. , 2013 ; Ghifary et al. , 2015 ; Li et al. , 2018b ; Piratla et al. , 2020 ) learn domain invariant features by aligning feature distributions or by common/specific feature decomposition . Second , ( Li et al. , 2019a ; Balaji et al. , 2018 ; Li et al. , 2019b ; 2018a ; Dou et al. , 2019 ; Du et al. , 2020a ; b ) are based on meta-learning approach that splits given source domains into meta-train and meta-test domains and trains learner in an episodic training paradigm . Third , ( Shankar et al. , 2018 ; Carlucci et al. , 2019 ; Zhou et al. , 2020 ; Wang et al. , 2020 ) augment fake domain data to train learner for enhancing generalization capability of learner . Our method may mostly relate to the above second category of methods . But differently , we consider the DG problem in domain-free setting and adversarially split training dataset to synthesize domain shift in a principled min-max optimization method , instead of using leave-one-domain-out splitting in these methods . DG without domain labels . When the domain label is unavailable , to enhance generalization ability of learner , Wang et al . ( 2019 ) extracts robust feature representation by projecting out superficial patterns like color and texture . Carlucci et al . ( 2019 ) proposes to solve jigsaw puzzles of the training images . Matsuura & Harada ( 2020 ) divides samples into several latent domains via clustering and learns domain invariant features via adversarial training of feature extractor and domain discriminator . Huang et al . ( 2020 ) discards the dominant activated features , forcing the learner to activate remaining features that correlate with labels . Volpi et al . ( 2018 ) and Qiao et al . ( 2020 ) propose adversarial data augmentation to tackle the setting that the training set comprises a single domain . In methodology , these methods either explicitly force the learner to extract robust features ( Wang et al. , 2019 ; Matsuura & Harada , 2020 ; Huang et al. , 2020 ) or augment new data to increase training data ( Carlucci et al. , 2019 ; Qiao et al. , 2020 ; Volpi et al. , 2018 ) . While our method is a novel meta-learning approach for DG by introducing adversarial splitting of training dataset during training , without relying on data/domain augmentation . 3 METHOD . In our setting , since we do not assume and know the domains in the training dataset , the training data could be independently sampled from several underlying source domains or just from a single source domain . We denote S = { ( xi , yi ) } Ni=1 as the training dataset . Our goal is to train the learner with S that can generalize well on an unseen target domain . In the following sections , we introduce details of our proposed model in Sect . 3.1 , followed by its optimization method in Sect . 3.2 . We also investigate L2-normalization for domain generalization in Sect . 3.3 . Theoretical analysis for our method is presented in Sect . 4 . Experimental results are reported in Sect . 5 . Sect . 6 concludes this paper . 3.1 DOMAIN-FREE ADVERSARIAL SPLITTING MODEL . As mentioned in Sect . 1 , we model DG as a learning problem that enforces the learner to be able to generalize well for any train/val subsets splitting of the training dataset . The learner is trained using meta-learning approach ( Finn et al. , 2017 ) . To formulate our idea mathematically , we first introduce some notations . We denote f as a function/learner ( f could be a deep neural network , e.g. , ResNet ( He et al. , 2016 ) ) that outputs classification score of the input image , l as the loss such as cross-entropy , St and Sv as the train-subset and val-subset respectively such that S = St ∪ Sv and St ∩ Sv = ∅ . The formulated optimization problem for domain generalization is min w 1 |Γξ| ∑ Sv∈Γξ L ( θ ( w ) ; Sv ) +R ( w ) s.t . θ ( w ) = arg min θ L ( θ ; St , w ) , St = S − Sv . ( 1 ) In Eq . ( 1 ) , Γξ = { Sv : Sv ⊂ S , |Sv| = ξ } is the set of all possible val-subsets of S with length of ξ , St = S − Sv is train-subset paired with each Sv , L ( θ ( w ) ; Sv ) = 1|Sv| ∑ ( x , y ) ∈Sv l ( fθ ( w ) ( x ) , y ) is the loss on Sv , where θ ( w ) is the parameters of f , L ( θ ; St , w ) is L ( θ ; St ) with θ initialized by w andR ( w ) is regularization term . In the optimization model of Eq . ( 1 ) , the parameter θ ( w ) of learner trained on St is treated as a function of the initial parameter w. To force the learner trained on St to generalize well on Sv , we directly minimize the loss L ( θ ( w ) ; Sv ) , dubbed generalization loss , on val-subset Sv , w.r.t . the parameter θ ( w ) trained on St . Solving Eq . ( 1 ) will force the learner to be able to generalize well from any train-subset to corresponding val-subset . Since |Γξ| may be extremely large , it is infeasible to enumerate all possible train/val splittings . Thus , we propose the following adversarial splitting model instead , min w max Sv∈Γξ L ( θ ( w ) ; Sv ) +R ( w ) s.t . θ ( w ) = arg min θ L ( θ ; St , w ) , St = S − Sv . ( 2 ) In the min-max problem of Eq . ( 2 ) , the train/val ( St/Sv ) splitting is optimized to maximize the generalization loss to increase the domain shift between train and val subsets by finding the hardest splitting to the learner . While w is optimized by minimizing the generalization loss of learner over the splitting . Solving this adversarial splitting optimization model in Eq . ( 2 ) enforces the learner to be generalizable even for the worst-case splitting . We therefore expect that the trained learner is robust to the domain shifts within the training dataset . For the regularization termR ( w ) , we set it to be the training loss on St ( i.e. , R ( w ) = L ( w ; St ) ) , which additionally constrains that the learner with parameter w should be effective on St ( Li et al. , 2018a ) . The effect of the hyper-parameter ξ will be discussed in Appendix A.2 . In conventional adversarial machine learning , adversarial training is imposed on adversarial samples and learner to increase robustness of the learner to adversarial corruption ( Goodfellow et al. , 2015 ) . While in our optimization model of Eq . ( 2 ) , adversarial training is conducted on data splitting and learner to force the learner to be robust to domain shift between train/val subsets . Our model bridges adversarial training and meta-learning . It is a general learning framework for domain generalization and is a complement to adversarial machine learning .
This paper proposes to unify adversarial training and meta-learning in domain-free generalization where labels of source domains are unavailable. To maximize the domain shift between the subsets of meta-train and meta-val, adversarial training is leveraged to find the worst-case train/val splits. Extensive experiments on benchmark datasets under different settings demonstrate the effectiveness of the proposed method.
SP:dc605d174368de20c31edca06ef90fc18fb79faa
Loss Function Discovery for Object Detection via Convergence-Simulation Driven Search
1 INTRODUCTION . The computer vision community has witnessed substantial progress in object detection in recent years . The advances for the architecture design , e.g . two-stage detectors ( Ren et al. , 2015 ; Cai & Vasconcelos , 2018 ) and one-stage detectors ( Lin et al. , 2017b ; Tian et al. , 2019 ) , have remarkably ∗Equal Contribution . Work done when the first author ( Peidong Liu ) interns at Huawei Noah ’ s Ark Lab . †Correspondence to : Xiaodan Liang ( xdliang328 @ gmail.com ) , Yong Jiang ( jiangy @ sz.tsinghua.edu.cn ) . pushed forward the state of the art . The success can not be separated from the sophisticated design for training objective , i.e . loss function . Traditionally , two-stage detectors equip the combination of Cross-entropy loss ( CE ) and L1 loss/Smooth L1 loss ( Girshick , 2015 ) for bounding box classification and regression respectively . In contrast , one-stage detectors , suffering from the severe positive-negative sample imbalance due to dense sampling of possible object locations , introduce Focal loss ( FL ) ( Lin et al. , 2017b ) to alleviate the imbalance issue . However , optimizing object detectors with traditional hand-crafted loss functions may lead to sub-optimal solutions due to the limited connection with the evaluation metric ( e.g . AP ) . Therefore , IoU-Net ( Jiang et al. , 2018 ) proposes to jointly predict Intersection over Union ( IoU ) during training . IoU loss series , including IoU loss ( Yu et al. , 2016 ) , Bounded IoU loss ( Tychsen-Smith & Petersson , 2018 ) , Generalized IoU loss ( GIoU ) ( Rezatofighi et al. , 2019 ) , Distance IoU loss ( DIoU ) , and Complete IoU loss ( CIoU ) ( Zheng et al. , 2020 ) , optimize IoU between predicted and target directly . These works manifest the necessity of developing effective loss functions towards better alignment with evaluation metric for object detection , while they heavily rely on careful design and expertise experience . In this work , we aim to discover novel loss functions for object detection automatically to reduce human burden , inspired by the recent progress in network architecture search ( NAS ) and automated machine learning ( AutoML ) ( Cai et al. , 2019 ; Liu et al. , 2020a ) . Different from Wang et al . ( 2020 ) and Li et al . ( 2019b ) that only search for particular hyper-parameters within the fixed loss formula , we steer towards finding new forms of the loss function . Notably , AutoML-Zero ( Real et al. , 2020 ) proposes a framework to construct ML algorithm from simple mathematical operations , which motivates us to design loss functions from primitive mathematical operations with evolutionary algorithm . However , it encounters a severe issue that a slight variation of operations would lead to a huge performance drop , which is attributed to the sparse action space . Therefore , we propose a novel Convergence-Simulation driven Evolutionary search algorithm , named CSE-Autoloss , to alleviate the sparsity issue . Benefit from the flexibility and effectiveness of the search space , as Figure 1 shows , CSE-Autoloss discovers distinct loss formulas with comparable performance with the Crossentropy loss , such as ( b ) and ( c ) in the figure . Moreover , the best-searched loss function ( d ) , named CSE-Autoloss-Acls , outperformed CE loss by a large margin . Specifically , to get preferable loss functions , CSE-Autoloss contains a well-designed search space , including 20 primitive mathematical operations , 3 constant-type inputs , and 3 variable-type inputs , which can cover a wide range of existing popular hand-crafted loss functions . Besides , to tackle the sparsity issue , CSE-Autoloss puts forward progressive convergence-simulation modules , which verify the evolved loss functions from two aspects , including mathematical convergence property and optimization behavior , facilitating the efficiency of the vanilla evolution algorithm for loss function search without compromising the accuracy of the best-discovered loss . For different types of detector , CSE-Autoloss is capable of designing appropriate loss functions automatically without onerous human works . In summary , our main contributions are as follows : 1 ) We put forward CSE-Autoloss , an end-to-end pipeline , which makes the first study to search insightful loss functions towards aligning the evaluation metric for object detection . 2 ) A well-designed search space , consisting of various primitive operations and inputs , is proposed as the foundation of the search algorithm to explore novel loss functions . 3 ) To handle the inefficiency issue caused by the sparsity of action space , innovative convergence-simulation modules are raised , which significantly reduces the search overhead with promising discovered loss functions . 4 ) Extensive evaluation experiments on various detectors and different detection benchmarks including COCO , VOC2017 , and BDD , demonstrate the effectiveness and generalization of both CSE-Autoloss and the discovered loss functions . 2 RELATED WORK . Loss Functions in Object Detection . In object detection frameworks , CE loss dominates the twostage detectors ( Ren et al. , 2015 ; Cai & Vasconcelos , 2018 ) for classification purpose , while Focal loss ( Lin et al. , 2017b ) and GHM loss ( Li et al. , 2019a ) are widely equipped in one-stage detectors ( Lin et al. , 2017b ; Tian et al. , 2019 ) for solving imbalance issues between positive and negative samples . Chen et al . ( 2019b ) ; Qian et al . ( 2020 ) attempt to handle the sample-imbalance problem from the ranking perspective . However , these works are sensitive to hyper-parameters hence they can not generalize well . To further improve classification and localization quality , Jiang et al . ( 2018 ) ; Tian et al . ( 2019 ) ; Wu et al . ( 2020 ) introduce quality estimation , and GFocal ( Li et al. , 2020 ) unifies the quality estimation with classification towards consistent prediction . With regard to regression loss functions , Smooth L1 Loss ( Girshick , 2015 ) has been commonly performed in the past years until IoU-based loss series ( Yu et al. , 2016 ; Rezatofighi et al. , 2019 ; Zheng et al. , 2020 ) gradually occupy regression branch for their effectiveness in bounding box distance representation due to the direct optimization of the evaluation metric . However , these works rely on expert experience on loss formula construction , which limits the development of the loss function design in object detection . Automated Loss Function Design . By introducing a unified formulation of loss function , Li et al . ( 2019b ) ; Wang et al . ( 2020 ) raise automated techniques to adjust loss functions for face recognition . However , they only search for specific hyper-parameters in the fixed loss formulas , which limit the search space and fail to discover new forms of loss functions . Real et al . ( 2020 ) ; Liu et al . ( 2020b ) ; Ramachandran et al . ( 2018 ) attempt to design formulations from basic mathematical operations to construct building blocks in machine learning such as normalization layers and activation functions . However , these works can not directly apply to loss function search since their search space and search strategies are specialized . Gonzalez & Miikkulainen ( 2020 ) proposes a framework for searching classification loss functions but the searched loss poorly generalizes to large-scale datasets . Besides , all these works are not suitable for the challenging object detection task due to the sparsity of the action space and the heavy evaluation cost for training object detectors . Instead , in this work , we make the first attempt to search for loss function formulations directly on the largescale detection dataset via an effective pipeline with novel convergence-simulation modules . 3 METHOD . In this section , we present the CSE-Autoloss pipeline for discovering novel loss functions towards aligning the evaluation metric for object detection . We first introduce the well-designed search space in Section 3.1 . The detailed CSE-Autoloss pipeline is elaborated in Section 3.2 . 3.1 SEARCH SPACE DESIGN . Input Nodes . In object detection , default classification losses ( i.e . CE loss and FL loss ) , take prediction and label as inputs . Inspired by GFocal loss ( Li et al. , 2020 ) , to better motivate the loss to align with the evaluation metric ( i.e . AP ) , we introduce IoU between ground truth and prediction into the loss formula , where prediction , label , IoU are notated as x , y , w respectively . For the regression branch , to cover the mainstream IoU loss series ( i.e . IoU and GIoU ) , we take the intersection i , union u , and enclosing area e between the predicted and target box as input tensors . Besides , 3 constant-type inputs ( i.e . 1 , 2 , 3 ) are brought in to improve the flexibility of the search space . As mentioned above , for consistent prediction of localization quality and classification score between training and testing , we simply introduce IoU into the CE and FL loss to get two nuanced loss variants , namely CEI and FLI respectively : CEI ( x , y , w ) = −dot ( wy , log ( softmax ( x ) ) ) , FLI ( x′ , y′ , w ) = −w [ y′ ( 1− σ ( x′ ) ) log σ ( x′ ) + ( 1− y′ ) σ ( x′ ) log ( 1− σ ( x′ ) ) ] , where x , y ∈ Rc+1 , x′ ∈ R , c is the number of class . x and x′ are the prediction , y is a one-hot vector of ground truth class , y′ ∈ { 0 , 1 } is the binary target , and w ∈ R is the IoU value between ground truth and prediction . As Table 4 shows , CEI and FLI outperform CE and FL by a small margin in terms of AP , which verifies the effectiveness of introducing IoU into the classification branch . Note that we apply CEI and FLI loss as the predefined initial loss LI in the search experiment for two-stage detectors and one-stage detectors , respectively . Primitive Operators . The primitive operators , including element-wise and aggregation functions that enable interactions between tensors with different dimensions , are listed as below : • Unary functions : −x , ex , log ( x ) , |x| , √ x , softmax ( x ) , softplus ( x ) , σ ( x ) , gd ( x ) , alf ( x ) , erf ( x ) , erfc ( x ) , tanh ( x ) , relu ( x ) , sin ( x ) , cos ( x ) • Binary functions : x1 + x2 , x1 − x2 , x1 × x2 , x1x2+ , dot ( x1 , x2 ) is a small value to avoid zero division , softplus ( x ) = ln ( 1 + ex ) , σ ( x ) = 11+e−x is the sigmoid function . To enlarge the search space , more S-type curves and their variants∗ are included , i.e . gd ( x ) = 2 arctan ( tanh ( x2 ) ) , alf ( x ) = x√ 1+x2 , erf ( x ) = 2√ π ∫ x 0 e−t 2 dt is the error function , erfc ( x ) = 1 − erf ( x ) . For binary operations , broadcasting is introduced to ensure the assembling of inputs with different dimensions . dot ( x1 , x2 ) is the class-wise dot product of two matrix x1 , x2 ∈ RB×C , where B and C indicate batch size and number of categories respectively . In practice , regression branch contains fewer primitive operators than classification branch because introducing more primitive functions for regression branch does not bring performance gain . ∗In the implementation , the output of these functions are re-scaled to obtain the same range as sigmoid function , i.e . from 0 to 1 . Loss Function as a Computation Graph . As Figure 1 illustrates , we represent the loss function as a directed acyclic graph ( DAG ) computation graph that transforms input nodes into the scalar output o ( i.e . loss value ) with multiple primitive operators in the intermediate . Sparsity of the Action Space . We perform random search for Faster R-CNN classification branch on COCO and find only one acceptable loss every 105 , which indicates the sparsity of the action space and the challenge for searching the loss function formulations .
This paper proposes to use an evolutionary search algorithm to search for better loss functions for the classification and regression branch of an object detector. The algorithm starts with 20 primitive mathematical operations. Due to the highly sparse action space, the vanilla evolutionary algorithm would take a long time to converge. Then the authors propose two ways to reduce the search space. First, they filter out loss functions which generates gradients of large magnitude to well-classified samples and do not converge to zero. Second, they construct a very small dataset by sampling only one image randomly from each category and evaluate the loss function on it to quickly filter out bad loss candidates.
SP:dec287e2fe3b34942440388a7e79031e833dc718
Loss Function Discovery for Object Detection via Convergence-Simulation Driven Search
1 INTRODUCTION . The computer vision community has witnessed substantial progress in object detection in recent years . The advances for the architecture design , e.g . two-stage detectors ( Ren et al. , 2015 ; Cai & Vasconcelos , 2018 ) and one-stage detectors ( Lin et al. , 2017b ; Tian et al. , 2019 ) , have remarkably ∗Equal Contribution . Work done when the first author ( Peidong Liu ) interns at Huawei Noah ’ s Ark Lab . †Correspondence to : Xiaodan Liang ( xdliang328 @ gmail.com ) , Yong Jiang ( jiangy @ sz.tsinghua.edu.cn ) . pushed forward the state of the art . The success can not be separated from the sophisticated design for training objective , i.e . loss function . Traditionally , two-stage detectors equip the combination of Cross-entropy loss ( CE ) and L1 loss/Smooth L1 loss ( Girshick , 2015 ) for bounding box classification and regression respectively . In contrast , one-stage detectors , suffering from the severe positive-negative sample imbalance due to dense sampling of possible object locations , introduce Focal loss ( FL ) ( Lin et al. , 2017b ) to alleviate the imbalance issue . However , optimizing object detectors with traditional hand-crafted loss functions may lead to sub-optimal solutions due to the limited connection with the evaluation metric ( e.g . AP ) . Therefore , IoU-Net ( Jiang et al. , 2018 ) proposes to jointly predict Intersection over Union ( IoU ) during training . IoU loss series , including IoU loss ( Yu et al. , 2016 ) , Bounded IoU loss ( Tychsen-Smith & Petersson , 2018 ) , Generalized IoU loss ( GIoU ) ( Rezatofighi et al. , 2019 ) , Distance IoU loss ( DIoU ) , and Complete IoU loss ( CIoU ) ( Zheng et al. , 2020 ) , optimize IoU between predicted and target directly . These works manifest the necessity of developing effective loss functions towards better alignment with evaluation metric for object detection , while they heavily rely on careful design and expertise experience . In this work , we aim to discover novel loss functions for object detection automatically to reduce human burden , inspired by the recent progress in network architecture search ( NAS ) and automated machine learning ( AutoML ) ( Cai et al. , 2019 ; Liu et al. , 2020a ) . Different from Wang et al . ( 2020 ) and Li et al . ( 2019b ) that only search for particular hyper-parameters within the fixed loss formula , we steer towards finding new forms of the loss function . Notably , AutoML-Zero ( Real et al. , 2020 ) proposes a framework to construct ML algorithm from simple mathematical operations , which motivates us to design loss functions from primitive mathematical operations with evolutionary algorithm . However , it encounters a severe issue that a slight variation of operations would lead to a huge performance drop , which is attributed to the sparse action space . Therefore , we propose a novel Convergence-Simulation driven Evolutionary search algorithm , named CSE-Autoloss , to alleviate the sparsity issue . Benefit from the flexibility and effectiveness of the search space , as Figure 1 shows , CSE-Autoloss discovers distinct loss formulas with comparable performance with the Crossentropy loss , such as ( b ) and ( c ) in the figure . Moreover , the best-searched loss function ( d ) , named CSE-Autoloss-Acls , outperformed CE loss by a large margin . Specifically , to get preferable loss functions , CSE-Autoloss contains a well-designed search space , including 20 primitive mathematical operations , 3 constant-type inputs , and 3 variable-type inputs , which can cover a wide range of existing popular hand-crafted loss functions . Besides , to tackle the sparsity issue , CSE-Autoloss puts forward progressive convergence-simulation modules , which verify the evolved loss functions from two aspects , including mathematical convergence property and optimization behavior , facilitating the efficiency of the vanilla evolution algorithm for loss function search without compromising the accuracy of the best-discovered loss . For different types of detector , CSE-Autoloss is capable of designing appropriate loss functions automatically without onerous human works . In summary , our main contributions are as follows : 1 ) We put forward CSE-Autoloss , an end-to-end pipeline , which makes the first study to search insightful loss functions towards aligning the evaluation metric for object detection . 2 ) A well-designed search space , consisting of various primitive operations and inputs , is proposed as the foundation of the search algorithm to explore novel loss functions . 3 ) To handle the inefficiency issue caused by the sparsity of action space , innovative convergence-simulation modules are raised , which significantly reduces the search overhead with promising discovered loss functions . 4 ) Extensive evaluation experiments on various detectors and different detection benchmarks including COCO , VOC2017 , and BDD , demonstrate the effectiveness and generalization of both CSE-Autoloss and the discovered loss functions . 2 RELATED WORK . Loss Functions in Object Detection . In object detection frameworks , CE loss dominates the twostage detectors ( Ren et al. , 2015 ; Cai & Vasconcelos , 2018 ) for classification purpose , while Focal loss ( Lin et al. , 2017b ) and GHM loss ( Li et al. , 2019a ) are widely equipped in one-stage detectors ( Lin et al. , 2017b ; Tian et al. , 2019 ) for solving imbalance issues between positive and negative samples . Chen et al . ( 2019b ) ; Qian et al . ( 2020 ) attempt to handle the sample-imbalance problem from the ranking perspective . However , these works are sensitive to hyper-parameters hence they can not generalize well . To further improve classification and localization quality , Jiang et al . ( 2018 ) ; Tian et al . ( 2019 ) ; Wu et al . ( 2020 ) introduce quality estimation , and GFocal ( Li et al. , 2020 ) unifies the quality estimation with classification towards consistent prediction . With regard to regression loss functions , Smooth L1 Loss ( Girshick , 2015 ) has been commonly performed in the past years until IoU-based loss series ( Yu et al. , 2016 ; Rezatofighi et al. , 2019 ; Zheng et al. , 2020 ) gradually occupy regression branch for their effectiveness in bounding box distance representation due to the direct optimization of the evaluation metric . However , these works rely on expert experience on loss formula construction , which limits the development of the loss function design in object detection . Automated Loss Function Design . By introducing a unified formulation of loss function , Li et al . ( 2019b ) ; Wang et al . ( 2020 ) raise automated techniques to adjust loss functions for face recognition . However , they only search for specific hyper-parameters in the fixed loss formulas , which limit the search space and fail to discover new forms of loss functions . Real et al . ( 2020 ) ; Liu et al . ( 2020b ) ; Ramachandran et al . ( 2018 ) attempt to design formulations from basic mathematical operations to construct building blocks in machine learning such as normalization layers and activation functions . However , these works can not directly apply to loss function search since their search space and search strategies are specialized . Gonzalez & Miikkulainen ( 2020 ) proposes a framework for searching classification loss functions but the searched loss poorly generalizes to large-scale datasets . Besides , all these works are not suitable for the challenging object detection task due to the sparsity of the action space and the heavy evaluation cost for training object detectors . Instead , in this work , we make the first attempt to search for loss function formulations directly on the largescale detection dataset via an effective pipeline with novel convergence-simulation modules . 3 METHOD . In this section , we present the CSE-Autoloss pipeline for discovering novel loss functions towards aligning the evaluation metric for object detection . We first introduce the well-designed search space in Section 3.1 . The detailed CSE-Autoloss pipeline is elaborated in Section 3.2 . 3.1 SEARCH SPACE DESIGN . Input Nodes . In object detection , default classification losses ( i.e . CE loss and FL loss ) , take prediction and label as inputs . Inspired by GFocal loss ( Li et al. , 2020 ) , to better motivate the loss to align with the evaluation metric ( i.e . AP ) , we introduce IoU between ground truth and prediction into the loss formula , where prediction , label , IoU are notated as x , y , w respectively . For the regression branch , to cover the mainstream IoU loss series ( i.e . IoU and GIoU ) , we take the intersection i , union u , and enclosing area e between the predicted and target box as input tensors . Besides , 3 constant-type inputs ( i.e . 1 , 2 , 3 ) are brought in to improve the flexibility of the search space . As mentioned above , for consistent prediction of localization quality and classification score between training and testing , we simply introduce IoU into the CE and FL loss to get two nuanced loss variants , namely CEI and FLI respectively : CEI ( x , y , w ) = −dot ( wy , log ( softmax ( x ) ) ) , FLI ( x′ , y′ , w ) = −w [ y′ ( 1− σ ( x′ ) ) log σ ( x′ ) + ( 1− y′ ) σ ( x′ ) log ( 1− σ ( x′ ) ) ] , where x , y ∈ Rc+1 , x′ ∈ R , c is the number of class . x and x′ are the prediction , y is a one-hot vector of ground truth class , y′ ∈ { 0 , 1 } is the binary target , and w ∈ R is the IoU value between ground truth and prediction . As Table 4 shows , CEI and FLI outperform CE and FL by a small margin in terms of AP , which verifies the effectiveness of introducing IoU into the classification branch . Note that we apply CEI and FLI loss as the predefined initial loss LI in the search experiment for two-stage detectors and one-stage detectors , respectively . Primitive Operators . The primitive operators , including element-wise and aggregation functions that enable interactions between tensors with different dimensions , are listed as below : • Unary functions : −x , ex , log ( x ) , |x| , √ x , softmax ( x ) , softplus ( x ) , σ ( x ) , gd ( x ) , alf ( x ) , erf ( x ) , erfc ( x ) , tanh ( x ) , relu ( x ) , sin ( x ) , cos ( x ) • Binary functions : x1 + x2 , x1 − x2 , x1 × x2 , x1x2+ , dot ( x1 , x2 ) is a small value to avoid zero division , softplus ( x ) = ln ( 1 + ex ) , σ ( x ) = 11+e−x is the sigmoid function . To enlarge the search space , more S-type curves and their variants∗ are included , i.e . gd ( x ) = 2 arctan ( tanh ( x2 ) ) , alf ( x ) = x√ 1+x2 , erf ( x ) = 2√ π ∫ x 0 e−t 2 dt is the error function , erfc ( x ) = 1 − erf ( x ) . For binary operations , broadcasting is introduced to ensure the assembling of inputs with different dimensions . dot ( x1 , x2 ) is the class-wise dot product of two matrix x1 , x2 ∈ RB×C , where B and C indicate batch size and number of categories respectively . In practice , regression branch contains fewer primitive operators than classification branch because introducing more primitive functions for regression branch does not bring performance gain . ∗In the implementation , the output of these functions are re-scaled to obtain the same range as sigmoid function , i.e . from 0 to 1 . Loss Function as a Computation Graph . As Figure 1 illustrates , we represent the loss function as a directed acyclic graph ( DAG ) computation graph that transforms input nodes into the scalar output o ( i.e . loss value ) with multiple primitive operators in the intermediate . Sparsity of the Action Space . We perform random search for Faster R-CNN classification branch on COCO and find only one acceptable loss every 105 , which indicates the sparsity of the action space and the challenge for searching the loss function formulations .
This paper proposes to automatically discover proper loss functions for object detection. It first designs some unit mathematical operations as search space, and then performs evolutionary algorithm to discover well-performed loss functions for the object detection tasks. Different from image classification, one needs to search both classification and localization losses in object detection. To accelerate the search, the paper proposes convergence property verification and model optimization simulation to effectively evaluate the searched loss and reduce the search space.
SP:dec287e2fe3b34942440388a7e79031e833dc718
Meta-Active Learning in Probabilistically-Safe Optimization
1 INTRODUCTION . Safe and efficient control of a novel systems with latent dynamics is an important objective in domains from healthcare to robotics . In healthcare , deep brain stimulation devices implanted in the brain can improve memory deficits in patients with Alzheimers ( Posporelis et al. , 2018 ) and responsive neurostimulators ( RNS ) can counter epileptiform activity to mitigate seizures . Yet , the surgeon ’ s trial-and-error process of finding effective RNS parameters for each patient is time-consuming and risky , with poor device settings possibly damaging the brain . Researchers studying active learning and Bayesian optimization have sought to develop algorithms to efficiently and safely learn a systems ’ dynamics , e.g . learning a brain ’ s dynamics for RNS configuration ( Ashmaig et al. , 2018 ; Sui et al. , 2018 ) . However , because these algorithms fail to scale up to higher-dimensional state-action spaces , researchers utilize only simple voltage and frequency controls rather than all 32 channels of the RNS waveform ( Ashmaig et al. , 2018 ) . Similarly , tasks in robotics , e.g . learning the dynamics of novel robotic systems ( e.g. , an autopilot learning to fly a damaged aircraft ) , require active learning methods that succeed in higher-dimensional domains . In this paper , we develop a probabilistically-safe , meta-active learning approach to tackle these challenging tasks to efficiently learn system dynamics and optimal configurations . We draw inspiration from recent contributions in meta-learning ( Finn et al. , 2017 ; Nagabandi et al. , 2019 ; Wang et al. , 2016 ; Andrychowicz et al. , 2016 ) that seek to leverage a distribution over training tasks to optimize the parameters of a neural network for efficient , online adaptation . Researchers have previously investigated meta-learning for active learning , e.g . learning a Bayesian prior over a Gaussian Process ( Wang et al. , 2018b ) for learning an acquisition function . However , these approaches do not consider the important problem of safely and actively learning to control a system with altered dynamics , which is a requirement for safety-critical robotic applications . Furthermore , as we show in Section 5 , on challenging control tasks for healthcare and robotics , the performance of prior active learning approaches ( Kirsch et al. , 2019 ; Hastie et al. , 2017 ) leaves much to be desired . We seek to overcome these key limitations of prior work by harnessing the power of meta-learning for active learning in a chance-constrained optimization framework for safe , online adaptation by encoding a learned representation of sample history . Instead of hand-engineering an acquisition function for our specific domains , our approach employs a data-drive , meta-learning approach , which results in better performance than prior approaches , as shown in Section 5 . Furthermore , our approach has the unique ability to impose analytical safety constraints over a sample trajectory . Contributions – We develop a probabilistically safe , meta-learning approach for active learning ( ” meta-active learning ” ) that sets a new state-of-the-art . Our acquisition function ( i.e. , the function that predicts the expected information gain of a data point ) is meta-learned offline , allowing the policy to benefit from past experience and provide a more robust measure of the value of an action . The key to our approach is a novel interweaving of our deep , meta-learned acquisition function as a Long-Short Term Memory Network ( Gers et al. , 1999 ) ( LSTM ) within a chance-constrained , mixed-integer linear program ( MILP ) ( Schrijver , 1998 ) . By encoding the LSTM ’ s linear , piece-wise output layers into the MILP , we directly optimize an action trajectory that best ensures the safety of the system while also maximizing the information learned about the system . In this paper , we describe our novel architecture which uniquely combines the power of a learned acquisition function with chance-constrained optimization and evaluate its performance against state-of-the-art baselines in several relevant domains . To the best of our knowledge , this is the only architecture which meta-learns an acquisition function for optimization tasks and is capable of embedding this acquisition function in a chance-constrained linear program to guarantee a minimum level of safe operation . The contributions of this paper are as follows : 1 . Meta-active learning for autonomously synthesizing an acquisition function to efficiently infer altered or unknown system dynamics and optimize system parameters . 2 . Probabilistically-safe control combined with an active-learning framework through the integration of our deep learning-based acquisition function and integer linear programming . 3 . State-of-the art results for safe , active learning . We achieve a 46 % increase in information gain in a high-dimensional environment of controlling a damaged aircraft , and we achieve a 58 % increase in information gain in our deep brain stimulation against our baselines . 2 PRELIMINARIES . In this section , we review the foundations of our work in active , meta- , and reinforcement learning . Active Learning – Labelled training data is often difficult to obtain due either to tight time constraints or lack of expert resources . Active learning attempts to address this problem by utilizing an “ acquisition function ” to quantify the amount of information an unlabelled training sample , x ∈ DU = 〈xi〉ni=1 , would provide a base learner , T̂ψ , if that sample were given a label , y and added to a labeled dataset , DL = 〈xj , yj〉mj=1 , i.e. , DL ← DL ∪ 〈x , y〉 . The active learning algorithm queries its acquisition function , H ( DU , DL , Tψ ) , to select which x ∈ DU should be labeled and added to DL ; then , a label is queried ( e.g. , by taking an action in an environment and observing the effect ) for x , and the new labeled sample is added to DL ( Muslea et al. , 2006 ; Pang et al. , 2018 ) . Meta-Learning – Meta-learning approaches attempt to learn a method to quickly adapt to new tasks online . In contrast to active learning , meta-learning attempts to learn a skill or learning method , e.g . learning an active learning function , which can be transferable to novel tasks or scenarios . These tasks or skills are trained offline , and a common assumption is that the tasks selected at test time are drawn from the same distribution used for training ( Hospedales et al. , 2020 ) . Reinforcement Learning and Q-Learning – A Markov decision process ( MDP ) is a stochastic control process for decision making and can be defined by the 5-tuple 〈X , U , T , R , γ〉 . X represents the set of states and U the set of actions . T : X × U × X ′ → [ 0 , 1 ] is the transition function that returns the probability of transitioning to state x′ from state x applying action , u. R : X × U → R is a reward function that maps a state and action to a reward , and γ weights the discounting of future rewards . Reinforcement learning seeks to synthesize a policy , π : X → U , mapping states to actions to maximize the future expected reward . When π is the optimal policy , π∗ , the following Bellman condition holds : Qπ ∗ ( x , u ) : = Ex′∼T [ R ( x , u ) + γQπ ∗ ( x′ , π∗ ( x ) ) ] ( Sutton & Barto , 2018 ) . 2.1 PROBLEM SET-UP . Our work is at the unique nexus of active learning , meta-learning and deep reinforcement learning with the objective of learning the Q-function as an acquisition function to describe the expected future information gained when taking action , u , in state , x , given a set of previously experienced states and actions . We define information gain as the percent decrease in the error of the objective ( e.g. , decrease in model error ) . A formal definition is provided in the Appendix . The Q-function is trained via a meta-learning strategy in which an agent interacts in environments sampled from a distribution of different scenarios to distill the most effective acquisition function for active learning of system dynamics . In our context , the state , X , of the active learning system is given by X : 〈DU , DL , T̂ψ〉 , where DU consists of all possible state-action pairs , DL is the set of state-action pairs that the agent has already experienced , and T̂ψ is a neural network function approximator of the transition dynamics , which is parameterized by ψ and updated online as samples are collected . We note that this state , X , is distinct from the state , X , of the robotic ( or other ) system we are controlling . The reward , R ( i ) , is proportional to the reduction of the mean squared error ( MSE ) loss of T̂ψ at time step , i . 3 SAFE META-LEARNING ARCHITECTURE . Several key components are vital for learning about an unknown system in a timely manner . First , an encoded representation of the context of the new dynamics is important for determining where exploration should be focused and which actions may be beneficial for gaining information of unknown dynamics . Second , a range of prior experiences in active learning should be leveraged to best inform which actions elicit the most information in a novel context within a distribution of tasks . We seek to develop a framework with these key attributes to enable sample-efficient and computationally light-weight active learning . An overview of our system is shown in Fig . 1 . 3.1 META-LEARNING ALGORITHM . To infer the Q-function for an action ( i.e . the acquisition function ) , we meta-learn over a distribution of altered dynamics as described in Algorithm 1 . For each episode , we sample from this distribution of altered dynamics and limit each episode to the number of time steps , M , tuned to collect enough data to accurately learn our approximate dynamics , T̂ψ , as a neural network with parameters , ψ . We utilize Q-learning to infer the Q-function which is represented by a DQN . In our training scheme we search over the action space via a MILP , as described in Section 3.2 and select the action set , ~U ( t : T ) , which maximizes the Q-function while satisfying safety constraints . The acquisition Q-function , Qθ , as described in Eq . 1 is trained via Deep Q-Learning ( Ganger et al. , 2016 ) with target network , Qφ . During training , our Deep Q-Learning framework is augmented to account for safety . The learned acquisition function , Qθ , is utilized by our policy ( Eq . 1 ) , which is solved via a safety-constrained MILP solver . The reward , R ( t ) , for taking a set of actions in a given state is defined as the percent decrease in the MSE error of the model , T̂ψ . This Bellman loss is backpropagated through the Q-value linear and ( ReLU ) output layers through the LSTM encoding layers . π ( ~Z ( t+1 ) ) is the set of actions , ~U ( t+1 ) , determined by maximizing Eq . 1 , which we describe in Section 3.2 . The dynamics model , T̂ψ , is retrained with each new set of state-action pairs . Algorithm 1 Meta-learning for training 1 : Randomly initialize Qθ and Qφ with weights θ = φ 2 : Initialize replay buffer , D 3 : for episode=1 to N do 4 : Initialize T̂ψ based on meta-learning distribution 5 : Collect small initial set of state-action pairs , U ( 0 ) , X ( 0 ) 6 : Train T̂ψ on initial set 7 : for t=1 to M do 8 : Forward pass on encoder to obtain ~Z ( t ) 9 : Select U ( t ) from Eq . 1 10 : Execute actions U ( t ) + N according to exploration noise , N ; observe states X ( t+1 ) 11 : Retrain T̂ψ on X ( 0 : t ) , U ( 0 : t ) and observe reward R ( t ) 12 : D ← D ∪ 〈U ( t ) , X ( t ) , X ( t+1 ) , R ( t ) 〉 13 : Sample a batch of transitions from D 14 : Perform forward pass through encoder to obtain ~Z ( t+1 ) 15 : Calculate y ( t ) = R ( t ) + γQφ ( π ( ~Z ( t+1 ) ) , ~Z ( t+1 ) ) 16 : Update Qθ according to ( y ( t ) −Qθ ( ~U ( t ) , ~Z ( t ) ) ) 17 : Qφ ← τQθ + τ ( 1−Qφ ) 18 : end for 19 : end for ; Algorithm 2 Metalearning for testing 1 : Draw test example from distribution 2 : Initialize T̂ψ 3 : for t=1 to M do 4 : Do forward pass through encoder to get ~Z ( t ) 5 : Select actions , U ( t ) , according to Eq . 1 6 : Execute actions , U ( t ) ; observe states X ( t+1 ) and reward R ( t ) 7 : Retrain T̂ψ on X ( 0 : t+1 ) , U ( 0 : t+1 ) 8 : end for
This paper presents a meta-active learning approach to obtain an LSTM-based embedding of a dynamic system and use a chance-constrained (probabilistic safe) optimization to find optimal control configuration via applying mixed-inter linear programming (MILP) on the learned embeddings of the dynamic system. The main idea is to learn a Q-function as an acquisition function to describe the future information gain, which is the percent decrease in the error of the objective (e.g. model error) via a meta-learning strategy in which the agent interacts with the environment via distribution of altered dynamics.
SP:c1297729b15bbaece175e784cd5f7db7f395fede
Meta-Active Learning in Probabilistically-Safe Optimization
1 INTRODUCTION . Safe and efficient control of a novel systems with latent dynamics is an important objective in domains from healthcare to robotics . In healthcare , deep brain stimulation devices implanted in the brain can improve memory deficits in patients with Alzheimers ( Posporelis et al. , 2018 ) and responsive neurostimulators ( RNS ) can counter epileptiform activity to mitigate seizures . Yet , the surgeon ’ s trial-and-error process of finding effective RNS parameters for each patient is time-consuming and risky , with poor device settings possibly damaging the brain . Researchers studying active learning and Bayesian optimization have sought to develop algorithms to efficiently and safely learn a systems ’ dynamics , e.g . learning a brain ’ s dynamics for RNS configuration ( Ashmaig et al. , 2018 ; Sui et al. , 2018 ) . However , because these algorithms fail to scale up to higher-dimensional state-action spaces , researchers utilize only simple voltage and frequency controls rather than all 32 channels of the RNS waveform ( Ashmaig et al. , 2018 ) . Similarly , tasks in robotics , e.g . learning the dynamics of novel robotic systems ( e.g. , an autopilot learning to fly a damaged aircraft ) , require active learning methods that succeed in higher-dimensional domains . In this paper , we develop a probabilistically-safe , meta-active learning approach to tackle these challenging tasks to efficiently learn system dynamics and optimal configurations . We draw inspiration from recent contributions in meta-learning ( Finn et al. , 2017 ; Nagabandi et al. , 2019 ; Wang et al. , 2016 ; Andrychowicz et al. , 2016 ) that seek to leverage a distribution over training tasks to optimize the parameters of a neural network for efficient , online adaptation . Researchers have previously investigated meta-learning for active learning , e.g . learning a Bayesian prior over a Gaussian Process ( Wang et al. , 2018b ) for learning an acquisition function . However , these approaches do not consider the important problem of safely and actively learning to control a system with altered dynamics , which is a requirement for safety-critical robotic applications . Furthermore , as we show in Section 5 , on challenging control tasks for healthcare and robotics , the performance of prior active learning approaches ( Kirsch et al. , 2019 ; Hastie et al. , 2017 ) leaves much to be desired . We seek to overcome these key limitations of prior work by harnessing the power of meta-learning for active learning in a chance-constrained optimization framework for safe , online adaptation by encoding a learned representation of sample history . Instead of hand-engineering an acquisition function for our specific domains , our approach employs a data-drive , meta-learning approach , which results in better performance than prior approaches , as shown in Section 5 . Furthermore , our approach has the unique ability to impose analytical safety constraints over a sample trajectory . Contributions – We develop a probabilistically safe , meta-learning approach for active learning ( ” meta-active learning ” ) that sets a new state-of-the-art . Our acquisition function ( i.e. , the function that predicts the expected information gain of a data point ) is meta-learned offline , allowing the policy to benefit from past experience and provide a more robust measure of the value of an action . The key to our approach is a novel interweaving of our deep , meta-learned acquisition function as a Long-Short Term Memory Network ( Gers et al. , 1999 ) ( LSTM ) within a chance-constrained , mixed-integer linear program ( MILP ) ( Schrijver , 1998 ) . By encoding the LSTM ’ s linear , piece-wise output layers into the MILP , we directly optimize an action trajectory that best ensures the safety of the system while also maximizing the information learned about the system . In this paper , we describe our novel architecture which uniquely combines the power of a learned acquisition function with chance-constrained optimization and evaluate its performance against state-of-the-art baselines in several relevant domains . To the best of our knowledge , this is the only architecture which meta-learns an acquisition function for optimization tasks and is capable of embedding this acquisition function in a chance-constrained linear program to guarantee a minimum level of safe operation . The contributions of this paper are as follows : 1 . Meta-active learning for autonomously synthesizing an acquisition function to efficiently infer altered or unknown system dynamics and optimize system parameters . 2 . Probabilistically-safe control combined with an active-learning framework through the integration of our deep learning-based acquisition function and integer linear programming . 3 . State-of-the art results for safe , active learning . We achieve a 46 % increase in information gain in a high-dimensional environment of controlling a damaged aircraft , and we achieve a 58 % increase in information gain in our deep brain stimulation against our baselines . 2 PRELIMINARIES . In this section , we review the foundations of our work in active , meta- , and reinforcement learning . Active Learning – Labelled training data is often difficult to obtain due either to tight time constraints or lack of expert resources . Active learning attempts to address this problem by utilizing an “ acquisition function ” to quantify the amount of information an unlabelled training sample , x ∈ DU = 〈xi〉ni=1 , would provide a base learner , T̂ψ , if that sample were given a label , y and added to a labeled dataset , DL = 〈xj , yj〉mj=1 , i.e. , DL ← DL ∪ 〈x , y〉 . The active learning algorithm queries its acquisition function , H ( DU , DL , Tψ ) , to select which x ∈ DU should be labeled and added to DL ; then , a label is queried ( e.g. , by taking an action in an environment and observing the effect ) for x , and the new labeled sample is added to DL ( Muslea et al. , 2006 ; Pang et al. , 2018 ) . Meta-Learning – Meta-learning approaches attempt to learn a method to quickly adapt to new tasks online . In contrast to active learning , meta-learning attempts to learn a skill or learning method , e.g . learning an active learning function , which can be transferable to novel tasks or scenarios . These tasks or skills are trained offline , and a common assumption is that the tasks selected at test time are drawn from the same distribution used for training ( Hospedales et al. , 2020 ) . Reinforcement Learning and Q-Learning – A Markov decision process ( MDP ) is a stochastic control process for decision making and can be defined by the 5-tuple 〈X , U , T , R , γ〉 . X represents the set of states and U the set of actions . T : X × U × X ′ → [ 0 , 1 ] is the transition function that returns the probability of transitioning to state x′ from state x applying action , u. R : X × U → R is a reward function that maps a state and action to a reward , and γ weights the discounting of future rewards . Reinforcement learning seeks to synthesize a policy , π : X → U , mapping states to actions to maximize the future expected reward . When π is the optimal policy , π∗ , the following Bellman condition holds : Qπ ∗ ( x , u ) : = Ex′∼T [ R ( x , u ) + γQπ ∗ ( x′ , π∗ ( x ) ) ] ( Sutton & Barto , 2018 ) . 2.1 PROBLEM SET-UP . Our work is at the unique nexus of active learning , meta-learning and deep reinforcement learning with the objective of learning the Q-function as an acquisition function to describe the expected future information gained when taking action , u , in state , x , given a set of previously experienced states and actions . We define information gain as the percent decrease in the error of the objective ( e.g. , decrease in model error ) . A formal definition is provided in the Appendix . The Q-function is trained via a meta-learning strategy in which an agent interacts in environments sampled from a distribution of different scenarios to distill the most effective acquisition function for active learning of system dynamics . In our context , the state , X , of the active learning system is given by X : 〈DU , DL , T̂ψ〉 , where DU consists of all possible state-action pairs , DL is the set of state-action pairs that the agent has already experienced , and T̂ψ is a neural network function approximator of the transition dynamics , which is parameterized by ψ and updated online as samples are collected . We note that this state , X , is distinct from the state , X , of the robotic ( or other ) system we are controlling . The reward , R ( i ) , is proportional to the reduction of the mean squared error ( MSE ) loss of T̂ψ at time step , i . 3 SAFE META-LEARNING ARCHITECTURE . Several key components are vital for learning about an unknown system in a timely manner . First , an encoded representation of the context of the new dynamics is important for determining where exploration should be focused and which actions may be beneficial for gaining information of unknown dynamics . Second , a range of prior experiences in active learning should be leveraged to best inform which actions elicit the most information in a novel context within a distribution of tasks . We seek to develop a framework with these key attributes to enable sample-efficient and computationally light-weight active learning . An overview of our system is shown in Fig . 1 . 3.1 META-LEARNING ALGORITHM . To infer the Q-function for an action ( i.e . the acquisition function ) , we meta-learn over a distribution of altered dynamics as described in Algorithm 1 . For each episode , we sample from this distribution of altered dynamics and limit each episode to the number of time steps , M , tuned to collect enough data to accurately learn our approximate dynamics , T̂ψ , as a neural network with parameters , ψ . We utilize Q-learning to infer the Q-function which is represented by a DQN . In our training scheme we search over the action space via a MILP , as described in Section 3.2 and select the action set , ~U ( t : T ) , which maximizes the Q-function while satisfying safety constraints . The acquisition Q-function , Qθ , as described in Eq . 1 is trained via Deep Q-Learning ( Ganger et al. , 2016 ) with target network , Qφ . During training , our Deep Q-Learning framework is augmented to account for safety . The learned acquisition function , Qθ , is utilized by our policy ( Eq . 1 ) , which is solved via a safety-constrained MILP solver . The reward , R ( t ) , for taking a set of actions in a given state is defined as the percent decrease in the MSE error of the model , T̂ψ . This Bellman loss is backpropagated through the Q-value linear and ( ReLU ) output layers through the LSTM encoding layers . π ( ~Z ( t+1 ) ) is the set of actions , ~U ( t+1 ) , determined by maximizing Eq . 1 , which we describe in Section 3.2 . The dynamics model , T̂ψ , is retrained with each new set of state-action pairs . Algorithm 1 Meta-learning for training 1 : Randomly initialize Qθ and Qφ with weights θ = φ 2 : Initialize replay buffer , D 3 : for episode=1 to N do 4 : Initialize T̂ψ based on meta-learning distribution 5 : Collect small initial set of state-action pairs , U ( 0 ) , X ( 0 ) 6 : Train T̂ψ on initial set 7 : for t=1 to M do 8 : Forward pass on encoder to obtain ~Z ( t ) 9 : Select U ( t ) from Eq . 1 10 : Execute actions U ( t ) + N according to exploration noise , N ; observe states X ( t+1 ) 11 : Retrain T̂ψ on X ( 0 : t ) , U ( 0 : t ) and observe reward R ( t ) 12 : D ← D ∪ 〈U ( t ) , X ( t ) , X ( t+1 ) , R ( t ) 〉 13 : Sample a batch of transitions from D 14 : Perform forward pass through encoder to obtain ~Z ( t+1 ) 15 : Calculate y ( t ) = R ( t ) + γQφ ( π ( ~Z ( t+1 ) ) , ~Z ( t+1 ) ) 16 : Update Qθ according to ( y ( t ) −Qθ ( ~U ( t ) , ~Z ( t ) ) ) 17 : Qφ ← τQθ + τ ( 1−Qφ ) 18 : end for 19 : end for ; Algorithm 2 Metalearning for testing 1 : Draw test example from distribution 2 : Initialize T̂ψ 3 : for t=1 to M do 4 : Do forward pass through encoder to get ~Z ( t ) 5 : Select actions , U ( t ) , according to Eq . 1 6 : Execute actions , U ( t ) ; observe states X ( t+1 ) and reward R ( t ) 7 : Retrain T̂ψ on X ( 0 : t+1 ) , U ( 0 : t+1 ) 8 : end for
In this work, a meta active learning approach is proposed to learn the hidden dynamics of control systems, where safety is also a major concern. The main idea lies in doing meta-learning with Q-learning, meanwhile selecting safe actions by solving a mixed-integer linear programming problem. The performance of the proposed approach is verified from real datasets of deep brain stimulation by outperforming existing baselines for a significant gap in both accuracy and computational complexity.
SP:c1297729b15bbaece175e784cd5f7db7f395fede
Categorical Normalizing Flows via Continuous Transformations
1 INTRODUCTION . Normalizing Flows have been popular for tasks with continuous data like image modeling ( Dinh et al. , 2017 ; Kingma and Dhariwal , 2018 ; Ho et al. , 2019 ) and speech generation ( Kim et al. , 2019 ; Prenger et al. , 2019 ) by providing efficient parallel sampling and exact density evaluation . The concept that normalizing flows rely on is the rule of change of variables , a continuous transformation designed for continuous data . However , there exist many data types typically encoded as discrete , categorical variables , like language and graphs , where normalizing flows are not straightforward to apply . To address this , it has recently been proposed to discretize the transformations inside normalizing flows to act directly on discrete data . Unfortunately , these discrete transformations have shown to be limited in terms of the vocabulary size and layer depth due to gradient approximations ( Hoogeboom et al. , 2019 ; Tran et al. , 2019 ) . For the specific case of discrete but ordinal data , like images where integers represent quantized values , a popular strategy is to add a small amount of noise to each value ( Dinh et al. , 2017 ; Ho et al. , 2019 ) . It is unnatural , however , to apply such dequantization techniques for the general case of categorical data , where values represent categories with no intrinsic order . Treating these categories as integers for dequantization biases the data to a non-existing order , and makes the modeling task significantly harder . Besides , relations between categories are often multi-dimensional , for example , word meanings , which can not be represented with dequantization . In this paper , we investigate normalizing flows for the general case of categorical data . To account for discontinuity , we propose continuous encodings in which different categories correspond to unique , non-overlapping and thus close-to-deterministic volumes in a continuous latent space . Instead of pre-specifying the non-overlapping volumes per category , we resort to variational inference to jointly learn those and model the likelihood by a normalizing flow at the same time . This work is not the first to propose variational inference with normalizing flows , mostly considered for improving the flexibility of the approximate posterior ( Kingma et al. , 2016 ; Rezende and Mohamed , 2015 ; Van Den Berg et al. , 2018 ) . Different from previous works , we use variational inference to learn a continuous representation z of the discrete categorical data x to a normalizing flow . A similar idea has been investigated in ( Ziegler and Rush , 2019 ) , who use a variational autoencoder structure with the normalizing flow being the prior . As both their decoder and normalizing flow model ( complex ) dependencies between categorical variables , ( Ziegler and Rush , 2019 ) rely on intricate yet sensitive learning schedules for balancing the likelihood terms . Instead , we propose to separate the representation and relation modeling by factorizing the decoder both over the categorical variable x and the conditioning latent z . This forces the encoder and decoder to focus only on the mapping from categorical data to continuous encodings , and not model any interactions . By inserting this inductive bias , we move all complexity into the flow . We call this approach Categorical Normalizing Flows ( CNF ) . Categorical Normalizing Flows can be applied to any task involving categorical variables , but we primarily focus on modeling graphs . Current state-of-the-art approaches often rely on autoregressive models ( Li et al. , 2018 ; Shi et al. , 2020 ; You et al. , 2018 ) that view graphs as sequences , although there exists no intrinsic order of the node . In contrast , normalizing flows can perform generation in parallel making a definition of order unnecessary . By treating both nodes and edges as categorical variables , we employ our variational inference encoding and propose GraphCNF . GraphCNF is a novel permutation-invariant normalizing flow on graph generation which assigns equal likelihood to any ordering of nodes . Meanwhile , GraphCNF efficiently encodes the node attributes , edge attributes , and graph structure in three consecutive steps . As shown in the experiments , the improved encoding and flow architecture allows GraphCNF to outperform significantly both the autoregressive and parallel flow-based state-of-the-art . Further , we show that Categorical Normalizing Flows can be used in problems with regular categorical variables like modeling natural language or sets . Our contributions are summarized as follows . Firstly , we propose Categorical Normalizing Flows using variational inference with a factorized decoder to move all complexity into the prior and scale up to large number of categories . Secondly , starting from the Categorical Normalizing Flows , we propose GraphCNF , a permutation-invariant normalizing flow on graph generation . On molecule generation , GraphCNF sets a new state-of-the-art for flow-based methods outperforming one-shot and autoregressive baselines . Finally , we show that simple mixture models for encoding distributions are accurate , efficient , and generalize across a multitude of setups , including sets language and graphs . 2 CATEGORICAL NORMALIZING FLOWS . 2.1 NORMALIZING FLOWS ON CONTINUOUS DATA . A normalizing flow ( Rezende and Mohamed , 2015 ; Tabak and Vanden Eijnden , 2010 ) is a generative model that models a probability distribution p ( z ( 0 ) ) by applying a sequence of invertible , smooth mappings f1 , ... , fK : Rd → Rd . Using the rule of change of variables , the likelihood of the input z ( 0 ) is determined as follows : p ( z ( 0 ) ) = p ( z ( K ) ) · K∏ k=1 ∣∣∣∣det ∂fk ( z ( k−1 ) ) ∂z ( k−1 ) ∣∣∣∣ ( 1 ) where z ( k ) = fk ( z ( k−1 ) ) , and p ( z ( K ) ) represents a prior distribution . This calculation requires to compute the Jacobian for the mappings f1 , ... , fK , which is expensive for arbitrary functions . Thus , the mappings are often designed to allow efficient computation of its determinant . One of such is the coupling layer proposed by Dinh et al . ( 2017 ) which showed to work well with neural networks . For a detailed introduction to normalizing flows , we refer the reader to Kobyzev et al . ( 2019 ) . 2.2 NORMALIZING FLOWS ON CATEGORICAL DATA . We define x = { x1 , ... , xS } to be a multivariate , categorical random variable , where each element xi is itself a categorical variable of K categories with no intrinsic order . For instance , x could be a sentence with xi being the words . Our goal is to learn the joint probability mass function , Pmodel ( x ) , via a normalizing flow . Specifically , as normalizing flows constitute a class of continuous transformations , we aim to learn a continuous latent space in which each categorical choice of a variable xi maps to a stochastic continuous variable zi ∈ Rd whose distribution we learn . Compared to variational autoencoders ( Kingma and Welling , 2014 ) and latent normalizing flows ( Ziegler and Rush , 2019 ) , we want to ensure that all modeling complexity is solely in the prior , and keep a lossless reconstruction from latent space . To implement this , we simplify the decoder by factorizing the decoder over latent variables : p ( x|z ) = ∏ i p ( xi|zi ) . Factorizing the conditional likelihood means that we enforce independence between the categorical variables xi given their learned continuous encodings zi . Therefore , any interaction between the categorical variables x must be learned inside the normalizing flow . If in this setup , the encoding distributions of multiple categories would overlap , the prior would be limited in the dependencies over x1 , ... , xS it can model as it can not clearly distinguish between all categories . Therefore , the encoder q ( z|x ) is being optimized to provide suitable representations of the categorical variables to the flow while separating the different categories in latent space . Meanwhile , the decoder is incentivized to be deterministic , i.e . precisely reconstructing x from z , in order to minimize the overlap of categories . Overall , our objective becomes : Ex∼Pdata [ logPmodel ( x ) ] ≥ Ex∼PdataEz∼q ( ·|x ) [ log pmodel ( z ) ∏ i p ( xi|zi ) q ( z|x ) ] ( 2 ) We refer to this framework as Categorical Normalizing Flows . In contrast to dequantization , the continuous encoding z is not bounded by the domain of the encoding distribution . Instead , the partitioning is jointly learned with the model likelihood . Furthermore , we can freely choose the dimensionality of the continuous variables , zi , to fit the number of categories and their relations . Modeling the encoder The encoder q ( z|x ) and decoder p ( xi|zi ) can be implemented in several ways . The first and main setup we consider is to encode each category by a logistic distribution with a learned mean and scaling . Therefore , our encoding distribution q ( zi ) is a mixture of K logistics , one per category . With g denoting the logistic , the encoder becomes q ( z|x ) = ∏S i=1 g ( zi|µ ( xi ) , σ ( xi ) ) . In this setup , the decoder likelihood can actually be found correspondingly to the encoder by applying Bayes : p ( xi|zi ) = p̃ ( xi ) q ( zi|xi ) ∑ x̂ p̃ ( x̂ ) q ( zi|x̂ ) with p̃ ( xi ) being a prior over categories . Hence , we do not need to learn a separate decoder but can calculate the likelihood based on the encoder ’ s parameters . The objective in Equation 2 simplifies to the following : Ex∼Pdata [ logPmodel ( x ) ] ≥ Ex∼PdataEz∼q ( ·|x ) [ log ( pmodel ( z ) S∏ i=1 p̃ ( xi ) ∑ x̂ p̃ ( x̂ ) q ( zi|x̂ ) ) ] ( 3 ) Note that the term q ( zi|xi ) in the numerator of p ( xi|zi ) cancels out with the denominator in Equation 2 . Given that the encoder and decoder are sharing the parameters , we remove any possible mismatch between p ( xi|zi ) and q ( xi|zi ) . This allows changes in the encoding distribution to directly being propagated to the decoder , and further moves the focus of the training to the prior . Besides , the mixture encoding introduces a dependency of the true posterior p ( z|x ) on the approximate posterior q ( z|x ) , which potentially tightens the variational gap compared to a separately learned decoder . During testing , we can use importance sampling ( Burda et al. , 2016 ) to further reduce the gap . Details on the posterior dependency in the variational gap , and training and test steps can be found in Appendix A.1 . The mixture model is simple and efficient , but might be limited in the distributions it can express . To test whether greater encoding flexibility is needed , we experiment with adding flows conditioned on the categories which transform each logistic into a more complex distribution . We refer to this approach as linear flows . Taking a step further , we can also represent the encoder q ( z|x ) with a flow across categorical variables , similar to variational dequantization ( Ho et al. , 2019 ) . Experiments presented in Section 5 show however that a simple mixture of logistics usually suffices .
This work uses the idea of variational inference to map categorical data to continuous space affording the use of normalizing flows. Authors use several ideas to increase their framework's applicability--factorized distribution assumption, use of multi-scale architecture for step-generation, and permutation invariant components—achieving favorable results on several problems. The approach seems to be especially useful when data is non-sequential.
SP:a27b9b91520ec4d7e1cabce40411ff8a10dea9c8
Categorical Normalizing Flows via Continuous Transformations
1 INTRODUCTION . Normalizing Flows have been popular for tasks with continuous data like image modeling ( Dinh et al. , 2017 ; Kingma and Dhariwal , 2018 ; Ho et al. , 2019 ) and speech generation ( Kim et al. , 2019 ; Prenger et al. , 2019 ) by providing efficient parallel sampling and exact density evaluation . The concept that normalizing flows rely on is the rule of change of variables , a continuous transformation designed for continuous data . However , there exist many data types typically encoded as discrete , categorical variables , like language and graphs , where normalizing flows are not straightforward to apply . To address this , it has recently been proposed to discretize the transformations inside normalizing flows to act directly on discrete data . Unfortunately , these discrete transformations have shown to be limited in terms of the vocabulary size and layer depth due to gradient approximations ( Hoogeboom et al. , 2019 ; Tran et al. , 2019 ) . For the specific case of discrete but ordinal data , like images where integers represent quantized values , a popular strategy is to add a small amount of noise to each value ( Dinh et al. , 2017 ; Ho et al. , 2019 ) . It is unnatural , however , to apply such dequantization techniques for the general case of categorical data , where values represent categories with no intrinsic order . Treating these categories as integers for dequantization biases the data to a non-existing order , and makes the modeling task significantly harder . Besides , relations between categories are often multi-dimensional , for example , word meanings , which can not be represented with dequantization . In this paper , we investigate normalizing flows for the general case of categorical data . To account for discontinuity , we propose continuous encodings in which different categories correspond to unique , non-overlapping and thus close-to-deterministic volumes in a continuous latent space . Instead of pre-specifying the non-overlapping volumes per category , we resort to variational inference to jointly learn those and model the likelihood by a normalizing flow at the same time . This work is not the first to propose variational inference with normalizing flows , mostly considered for improving the flexibility of the approximate posterior ( Kingma et al. , 2016 ; Rezende and Mohamed , 2015 ; Van Den Berg et al. , 2018 ) . Different from previous works , we use variational inference to learn a continuous representation z of the discrete categorical data x to a normalizing flow . A similar idea has been investigated in ( Ziegler and Rush , 2019 ) , who use a variational autoencoder structure with the normalizing flow being the prior . As both their decoder and normalizing flow model ( complex ) dependencies between categorical variables , ( Ziegler and Rush , 2019 ) rely on intricate yet sensitive learning schedules for balancing the likelihood terms . Instead , we propose to separate the representation and relation modeling by factorizing the decoder both over the categorical variable x and the conditioning latent z . This forces the encoder and decoder to focus only on the mapping from categorical data to continuous encodings , and not model any interactions . By inserting this inductive bias , we move all complexity into the flow . We call this approach Categorical Normalizing Flows ( CNF ) . Categorical Normalizing Flows can be applied to any task involving categorical variables , but we primarily focus on modeling graphs . Current state-of-the-art approaches often rely on autoregressive models ( Li et al. , 2018 ; Shi et al. , 2020 ; You et al. , 2018 ) that view graphs as sequences , although there exists no intrinsic order of the node . In contrast , normalizing flows can perform generation in parallel making a definition of order unnecessary . By treating both nodes and edges as categorical variables , we employ our variational inference encoding and propose GraphCNF . GraphCNF is a novel permutation-invariant normalizing flow on graph generation which assigns equal likelihood to any ordering of nodes . Meanwhile , GraphCNF efficiently encodes the node attributes , edge attributes , and graph structure in three consecutive steps . As shown in the experiments , the improved encoding and flow architecture allows GraphCNF to outperform significantly both the autoregressive and parallel flow-based state-of-the-art . Further , we show that Categorical Normalizing Flows can be used in problems with regular categorical variables like modeling natural language or sets . Our contributions are summarized as follows . Firstly , we propose Categorical Normalizing Flows using variational inference with a factorized decoder to move all complexity into the prior and scale up to large number of categories . Secondly , starting from the Categorical Normalizing Flows , we propose GraphCNF , a permutation-invariant normalizing flow on graph generation . On molecule generation , GraphCNF sets a new state-of-the-art for flow-based methods outperforming one-shot and autoregressive baselines . Finally , we show that simple mixture models for encoding distributions are accurate , efficient , and generalize across a multitude of setups , including sets language and graphs . 2 CATEGORICAL NORMALIZING FLOWS . 2.1 NORMALIZING FLOWS ON CONTINUOUS DATA . A normalizing flow ( Rezende and Mohamed , 2015 ; Tabak and Vanden Eijnden , 2010 ) is a generative model that models a probability distribution p ( z ( 0 ) ) by applying a sequence of invertible , smooth mappings f1 , ... , fK : Rd → Rd . Using the rule of change of variables , the likelihood of the input z ( 0 ) is determined as follows : p ( z ( 0 ) ) = p ( z ( K ) ) · K∏ k=1 ∣∣∣∣det ∂fk ( z ( k−1 ) ) ∂z ( k−1 ) ∣∣∣∣ ( 1 ) where z ( k ) = fk ( z ( k−1 ) ) , and p ( z ( K ) ) represents a prior distribution . This calculation requires to compute the Jacobian for the mappings f1 , ... , fK , which is expensive for arbitrary functions . Thus , the mappings are often designed to allow efficient computation of its determinant . One of such is the coupling layer proposed by Dinh et al . ( 2017 ) which showed to work well with neural networks . For a detailed introduction to normalizing flows , we refer the reader to Kobyzev et al . ( 2019 ) . 2.2 NORMALIZING FLOWS ON CATEGORICAL DATA . We define x = { x1 , ... , xS } to be a multivariate , categorical random variable , where each element xi is itself a categorical variable of K categories with no intrinsic order . For instance , x could be a sentence with xi being the words . Our goal is to learn the joint probability mass function , Pmodel ( x ) , via a normalizing flow . Specifically , as normalizing flows constitute a class of continuous transformations , we aim to learn a continuous latent space in which each categorical choice of a variable xi maps to a stochastic continuous variable zi ∈ Rd whose distribution we learn . Compared to variational autoencoders ( Kingma and Welling , 2014 ) and latent normalizing flows ( Ziegler and Rush , 2019 ) , we want to ensure that all modeling complexity is solely in the prior , and keep a lossless reconstruction from latent space . To implement this , we simplify the decoder by factorizing the decoder over latent variables : p ( x|z ) = ∏ i p ( xi|zi ) . Factorizing the conditional likelihood means that we enforce independence between the categorical variables xi given their learned continuous encodings zi . Therefore , any interaction between the categorical variables x must be learned inside the normalizing flow . If in this setup , the encoding distributions of multiple categories would overlap , the prior would be limited in the dependencies over x1 , ... , xS it can model as it can not clearly distinguish between all categories . Therefore , the encoder q ( z|x ) is being optimized to provide suitable representations of the categorical variables to the flow while separating the different categories in latent space . Meanwhile , the decoder is incentivized to be deterministic , i.e . precisely reconstructing x from z , in order to minimize the overlap of categories . Overall , our objective becomes : Ex∼Pdata [ logPmodel ( x ) ] ≥ Ex∼PdataEz∼q ( ·|x ) [ log pmodel ( z ) ∏ i p ( xi|zi ) q ( z|x ) ] ( 2 ) We refer to this framework as Categorical Normalizing Flows . In contrast to dequantization , the continuous encoding z is not bounded by the domain of the encoding distribution . Instead , the partitioning is jointly learned with the model likelihood . Furthermore , we can freely choose the dimensionality of the continuous variables , zi , to fit the number of categories and their relations . Modeling the encoder The encoder q ( z|x ) and decoder p ( xi|zi ) can be implemented in several ways . The first and main setup we consider is to encode each category by a logistic distribution with a learned mean and scaling . Therefore , our encoding distribution q ( zi ) is a mixture of K logistics , one per category . With g denoting the logistic , the encoder becomes q ( z|x ) = ∏S i=1 g ( zi|µ ( xi ) , σ ( xi ) ) . In this setup , the decoder likelihood can actually be found correspondingly to the encoder by applying Bayes : p ( xi|zi ) = p̃ ( xi ) q ( zi|xi ) ∑ x̂ p̃ ( x̂ ) q ( zi|x̂ ) with p̃ ( xi ) being a prior over categories . Hence , we do not need to learn a separate decoder but can calculate the likelihood based on the encoder ’ s parameters . The objective in Equation 2 simplifies to the following : Ex∼Pdata [ logPmodel ( x ) ] ≥ Ex∼PdataEz∼q ( ·|x ) [ log ( pmodel ( z ) S∏ i=1 p̃ ( xi ) ∑ x̂ p̃ ( x̂ ) q ( zi|x̂ ) ) ] ( 3 ) Note that the term q ( zi|xi ) in the numerator of p ( xi|zi ) cancels out with the denominator in Equation 2 . Given that the encoder and decoder are sharing the parameters , we remove any possible mismatch between p ( xi|zi ) and q ( xi|zi ) . This allows changes in the encoding distribution to directly being propagated to the decoder , and further moves the focus of the training to the prior . Besides , the mixture encoding introduces a dependency of the true posterior p ( z|x ) on the approximate posterior q ( z|x ) , which potentially tightens the variational gap compared to a separately learned decoder . During testing , we can use importance sampling ( Burda et al. , 2016 ) to further reduce the gap . Details on the posterior dependency in the variational gap , and training and test steps can be found in Appendix A.1 . The mixture model is simple and efficient , but might be limited in the distributions it can express . To test whether greater encoding flexibility is needed , we experiment with adding flows conditioned on the categories which transform each logistic into a more complex distribution . We refer to this approach as linear flows . Taking a step further , we can also represent the encoder q ( z|x ) with a flow across categorical variables , similar to variational dequantization ( Ho et al. , 2019 ) . Experiments presented in Section 5 show however that a simple mixture of logistics usually suffices .
The paper considers the problem of modeling discrete distributions with normalizing flows. Authors propose a novel framework “Categorical Normalizing Flows”, i.e CNF. By jointly modeling a mapping to continuous latent space, and the likelihood of flows CNF solves some of the bottlenecks in current algorithms. With experiments on some synthetic domains, and benchmarking tasks like Zinc250, the authors empirically demonstrate that CNF-based algorithms perform competitively and often improve significantly on related approaches like Latent NF, discrete flows.
SP:a27b9b91520ec4d7e1cabce40411ff8a10dea9c8
DyHCN: Dynamic Hypergraph Convolutional Networks
1 INTRODUCTION . Graph Convolutional Network ( GCN ) Scarselli et al . ( 2008 ) extends deep neural networks to process graph data , which encodes the relations between nodes via propagating node features over the graph structure . GCN has become a promising solution in a wide spectral of graph analytic tasks , such as relation detection Schlichtkrull et al . ( 2018 ) and recommendation Ying et al . ( 2018 ) . An emergent direction of GCN research is extending the graph covolution operations to hypergraphs , i.e. , hypergraph convolutional networks Zhu et al . ( 2017 ) ; Zhou et al . ( 2007 ) ; Zhang et al . ( 2017 ) ; Feng et al . ( 2019b ) ; Yadati et al . ( 2019 ) , where high-order node relations are represented as hyperedges ( one hyperedge can connect multiple nodes ) . For instance , in a hypergraph of stocks , an financial event relevant to several stocks is represented as a hyperedge . While a surge of attention paid on hypergraph convolutional networks , most of them discard the dynamic property of hypergraphs in real-world applications , e.g. , new hyperedges ( i.e. , events ) emerge in the hypergraph of stocks ( see Fig . 1 ) , where the evolution of the hypergraph is crucial for the analytic tasks ( e.g. , stock price prediction ) . Aiming to bridge the gap , this work explore the central theme of dynamic hypergraph and the corresponding GCN . Formally , a hypergraph with n nodes and m hyperedges is represented as G = ( V , E , A , H , X ) where V and E denote the set of nodes and hyperedges respectively ; A ∈ Rn×m is an incidence matrix with binary value indicating the connectedness of nodes ; H ∈ Rm×c and X ∈ Rn×d are features represent the hyperedges and nodes respectively . In order to account for the evolution , we first extend the concept of static hypergraph to dynamic hypergraph , which has two different formulations when treating the time as continuous value or discrete value . 1 ) Discrete-time formulation . A straightforward solution is to treat a time window with length of T ( e.g. , T days ) as a sequence of time-steps and get a snapshot at each time-step . In this way , a dynamic hypergraph is defined as GD = [ G1 , · · · , Gt , · · · , GT ] T where Gt is a hypergraph dumped at time-step t. 2 ) Continuous formulation . By treating time as a continuous variable , the dynamic hypergraph can be defined as GC = ( G0 , U ) where G0 is the initial status ( a hypergraph ) and U = { ( pt , v t , at ) |t < = T } is a streaming of updates . pt denotes the target variable ( e.g. , a row of X ) changed at time t ; v t denotes the latest value of the target variable , at denotes the action of change , including add , delete , update . It should be noted that both formulations have pros and cons , e.g. , the discrete-time formulation is more friendly to existing analytic techniques on static hypergraph such as HCN while the continuous-time formulation records the accurate time of changes . This work focuses on the discrete-time formulation and makes the first attempt to extend HCN to dynamic hypergraph . A big challenge of capturing spatial-temporal dependency in a dynamic hypergraph is that it is tough to extract the features of those changing nodes or hyperedges in a unified manner for the sake of varied scales of nodes and hyperedges . Besides , how to absorb their dynamic properties is very important for various application tasks . Towards this end , we need to design the proper convolution operations on dynamic hypergraph . There are two challenging toughs : 1 ) at each time step , since there are various relations between hyperedges and nodes , it is important to update the node features by considering various relations in the hyperedges ; 2 ) due to dynamically changes of the node features , modeling the temporal dependency needs to extract the corresponding temporal features . In this work , we propose a framework of Dynamic Hypergraph Convolutional Networks ( DyHCN ) to tackle the challenges , which has two modules : Hypergraph Convolution ( HC ) module and Temporal Evolution ( TE ) module . In a dynamic hypergraph , the set of hyperedges at each time step includes different hyperedge embeddings and each hyperedge contains different numbers of nodes . We exploit three submodules to update an node ’ s embeddings in HC : inner attention , outer attention , and embeddings update . Firstly , inner attention transform node features along with its hyperedge into the node-hyperedge feature ; and then outer attention utilizes attention mechanism to estimate the importance of each hyperedge and output the importance weights ; and then we update the node ’ s embeddings by aggregating node-hyperedge , hyperedge and node features with the weight of each hyperedge . Getting the nodes embeddings , we extract temporal features of nodes ’ embeddings and make a prediction by the TE module . Extensive experimental results on two real-world datasets validate the superior performance of DyHCN over the existing baselines which proves the effectiveness of DyHCN on dynamically hypergraphs . The rest of the paper is organized as follows . Section 2 introduces the preliminary knowledge about GCN and the hypergraph convolutional network . Section 3 explains the proposed DyHCN method . Section 4 introduces related work about GCN on the graph and hyperedge . Applications and experimental results are presented in Section 5 . Finally , we conclude this work in Section 6 . 2 PRELIMINARY . Graph Convolutional Network Given a graph G = ( V , E ) with N nodes vi ∈ V , edges ( vi , vj ) ∈ E , an adjacency matrix A ∈ RN×N and a degree matrix Dii = ∑ j Aij . With the input signal x , Kipf & Welling ( 2016 ) considers spectral convolutions on graphs with a filter gθ = diag ( θ ) in the Fourier domain , gθ ? x = UgθUT x , where U is the matrix of eigenvectors of the normalized graph Laplacian L = IN − D−1/2AD−1/2 = UΛUT , with a diagonal matrix of eigenvalues Λ and the graph Fourier transform UTx . In order to reduce the computation complexity , gθ is approximated with Chebyshev polynomials Tk ( x ) = 2xTk−1 ( x ) −Tk−2 ( x ) Defferrard et al . ( 2016 ) , which can be formulated as : gθ ≈ ∑K k=0 θkTk ( Λ̂ ) , where Λ̂ = 2 λmax Λ − I , λmax denotes the largest eigenvalue of Laplacian matrix , θk denotes the Chebyshev coefficients . Kipf & Welling ( 2016 ) proved that the GCN can be simplified to K=1 and λmax ≈ 2 , which is the state-of-the-art of GCN . Hypergraph Convolutional Network A hypergraph can be formulated as G = ( V , E , W ) , where V is a set of vertes , E is a set of hyperedges and W is a diagonal matrix which denotes the weight of each hyperedge . The adjacency matrix of hypergraph G can be denoted by H ∈ R|V|×|E| . The degree of node is d ( v ) = ∑ e∈E w ( e ) h ( v , e ) and the degree of edge δ ( e ) = ∑ v∈V h ( v , e ) . De and Dv denotes the matrices of edge degrees and node degrees . The spectral convolution of x and filter g can be formulated as g ? x = Φ ( ( ΦT g ) ( ΦT x ) ) = Φg ( Λ ) ΦT x , where denotes the element-wise multiplication and g ( Λ ) is a function of Fourier coefficients Feng et al . ( 2019b ) . As simplified in GCN , the convolution operation can be simplified to g ? x ≈ θD−1/2v HWDe −1HTD−1/2v x . 3 DYNAMIC HYPERGRAPH CONVOLUTIONAL NETWORKS . 3.1 FORMULATION OF DYNAMIC HYPERGRAPH . Dynamic hypergraph can be formulated into two categories : discrete-time and continuous-time dynamic hypergraph . The discrete-time approach views dynamic hypergraph as a collection of static graph snapshots over time , while the continuous counterpart extracts fine-grained temporal information on nodes and hyperedges which characterize the dynamic evolution of hypergraph . Discrete-time Dynamic Hypergraph Discrete-time dynamic hypergraph can be formulated as GD = ( Vt , Et , At , Ht , Xt ) , where Xt = [ xt1 , xt2 , · · · , xtn ] T ∈ Rn×d , Ht = [ ht1 , ht2 , · · · , htm ] T ∈ Rm×c , xti ( i = 1 , 2 , · · · , n ) denotes the feature of the i -th node and htj ( j = 1 , 2 , · · · , m ) denotes the feature of the j-th hyperedge , and m , n is the number of hyperedges and nodes on hypergraph Gt ( hypergraph on time step t ) . At ∈ Rn×m is an incidence matrix with binary value indicating the connectedness of nodes on hypergraph Gt . Vt is the set of nodes , Et is the set of hyperedges . C te = [ u t 1 , u t 2 , · · · , u tkte ] T ∈ Rkte×d and D tu = [ et1 , et2 , · · · , etktu ] T ∈ Rktu×c are used to denote the node set contained in hyperedge e and the hyperedge set containing the node u at time setp t respectively . Note that k te and k t u are the number of nodes in hyperedge e and the number of hyperedges containing node u on time t , respectively . As the representation evolve over time , we capture the spatial dependency by hypergraph convolutional networks and use CNNs to model the temporal dependency . Continuous-time Dynamic Hypergraph Continuous-time dynamic hypergraph can be defined as GC = ( G0 , U ) where G0 is the initial status ( a hypergraph ) and U = { ( pt , v t , at ) |t < = T } is a streaming of updates . pt denotes the target variable ( e.g. , a row of X ) changed at time t ; v t denotes the latest value of the target variable , at denotes the action of change , including add , delete , update . Due to a static hypergraph model can be extended to dynamic hypergraphs by applying it on each snapshots and then aggregating the results of the model , and the distinction between an evolving and a temporal network is less important Skarding et al . ( 2020 ) , we adapt discrete-time dynamic hypergraph to build the DyHCN model in our work . DyHCN DyHCN is composed of two modules : hypergraph convolution ( HC ) and temporal evolution ( TE ) . The HC module is designed to aggregate features among nodes and hyperedges with attention mechanisms and update the embeddings of centroid nodes . The TE module is used for capturing dynamic changes in temporal features . The framework of DyHCN is illustrated in Fig.2 , 3.2 HYPERGRAPH CONVOLUTION . Hypergraph convolution consists of three submodules : inner attention , outer attention , and embeddings update . In particular , inner attention aggregates nodes ’ features to hyperedge , outer attention uses attention mechanisms to determine the importance of each hyperedge , and embeddings update submodule aggregates node-hyperedge features , hyperedge features and the node features to update centroid node embeddings with the weight of each hyperedge . Inner attention The inner attention is shown on the left plane of Fig . 3 which aggregates node embeddings to node-hyperedge features by using a self-attention mechanism . With a multi-layer perceptron ( MLP ) we can get the weight score of each node . For a specific node xti on time step t , the input of inner attention is C te = [ u t 1 , u t 2 , · · · , u tkte ] T ∈ Rkte×d and the output of node-hyperedge embedding d t is the weighted sum of node features , which is formulated as : ωt = softmax ( C tewe + be ) , ( 1 ) dt = kte∑ j=0 ωtju t j , ( 2 ) where we ∈ Rd×1 and be ∈ R k t e×1 are trainable parameters , ωt ∈ R kte×1 is the weight of nodes in hyperedge , dt ∈ R1×d denotes the node-hyperedge features , and k te denotes the number of nodes in hyperedge , d is node feature dimension . Outer attention Due to multiple hyperedges related to center node , and the importance of each hyperedge is different , we propose an outer attention submodule to determine the weight of each hyperedge . The right plane of Fig . 3 shows the outer attention submodule which calculates the weight of each hyperedge based on hyperedge features . For specific node xti , the input of outer attention is D tu = [ e t 1 , e t 2 , · · · , etktu ] T ∈ Rktu×c , a hyperedge set containing vertex xti , and the output is ωth , the weight of each hyperedge on time step t. rtu = sigmoid ( D t uwu + bu ) , ( 3 ) ωth = softmax ( r t u ) , ( 4 ) where wu ∈ Rc×1 , bu ∈ Rk t u ×1 are trainable parameters and ωth ∈ Rk t u ×1 is the weight vector of each hyperedge , k tu is the number of hyperedges containing vertex u at time step t , and c is the hyperedge feature dimension . Embeddings Update With the output of inner attention and out attention , we update the centroid node embeddings sti by aggregating node ’ s input features x t i , node-hyperedge features dt and hyperedge features hti with the weight of hyperedges ω t h. We explore three aggregation methods , 1 ) Concatenated features We concatenate the node-hyperedge features and hyperedge features directly with the activation funciton of tanh , qt = tanh [ dt : hti ] ∈ R1× ( d+c ) . 2 ) Dot-product features We multiply the node-hyperedge features with hyperedge features with the element-wise operation to model the interaction of two kinds features , tanh , qt = tanh [ dt hti ] ∈ R1×d ( by setting d=c ) , where denotes element-wise product operation . 3 ) MLP features We concatenate the node-hyperedge features with hyperedge features with an MLP process to aggregate the features , qt = tanh ( [ dt : hti ] Wc + bc ) ∈ R1×d , where Wc ∈ R ( d+c ) ×d , bc ∈ R1×d are trainable parameters . Note that , htc only stands for the concatenated features for one hyperedge , so for k t u hyperedges , we can get a concatenated features matrix Qti = [ qt0 , qt1 , · · · , qtktu ] T which denotes the influence from nodes and each hyperedge . Considering the weight of each hyperedge ωth , we first calculate the weighted sum of concatenated features Qti to measure the influence from all hyperedges and related nodes . And then update the specific node embedding sti with the input feature x t i and the influence embeddings . zti = sum ( ω t h ·Q t i ) , ( 5 ) sti = tanh ( [ x t i : z t i ] Wh + bh ) , ( 6 ) where zti ∈ R1×d is the weighted aggregated features , Wh ∈ R2d×d and bh ∈ R1×d are trainable parameters .
The paper extends over hypergraph convolutional networks (HCN) by adding a temporal evolution module in order to solve prediction tasks in a dynamic environment. The main part of the paper is the description of the proposed system. It is composed of a HCN for computing node embeddings at each time step and a LSTM as the temporal module. Experimental results are provided for dynamic prediction tasks over stock datasets.
SP:6c4659d71144bea924d9e77ee2be1bd6d11cf7f0
DyHCN: Dynamic Hypergraph Convolutional Networks
1 INTRODUCTION . Graph Convolutional Network ( GCN ) Scarselli et al . ( 2008 ) extends deep neural networks to process graph data , which encodes the relations between nodes via propagating node features over the graph structure . GCN has become a promising solution in a wide spectral of graph analytic tasks , such as relation detection Schlichtkrull et al . ( 2018 ) and recommendation Ying et al . ( 2018 ) . An emergent direction of GCN research is extending the graph covolution operations to hypergraphs , i.e. , hypergraph convolutional networks Zhu et al . ( 2017 ) ; Zhou et al . ( 2007 ) ; Zhang et al . ( 2017 ) ; Feng et al . ( 2019b ) ; Yadati et al . ( 2019 ) , where high-order node relations are represented as hyperedges ( one hyperedge can connect multiple nodes ) . For instance , in a hypergraph of stocks , an financial event relevant to several stocks is represented as a hyperedge . While a surge of attention paid on hypergraph convolutional networks , most of them discard the dynamic property of hypergraphs in real-world applications , e.g. , new hyperedges ( i.e. , events ) emerge in the hypergraph of stocks ( see Fig . 1 ) , where the evolution of the hypergraph is crucial for the analytic tasks ( e.g. , stock price prediction ) . Aiming to bridge the gap , this work explore the central theme of dynamic hypergraph and the corresponding GCN . Formally , a hypergraph with n nodes and m hyperedges is represented as G = ( V , E , A , H , X ) where V and E denote the set of nodes and hyperedges respectively ; A ∈ Rn×m is an incidence matrix with binary value indicating the connectedness of nodes ; H ∈ Rm×c and X ∈ Rn×d are features represent the hyperedges and nodes respectively . In order to account for the evolution , we first extend the concept of static hypergraph to dynamic hypergraph , which has two different formulations when treating the time as continuous value or discrete value . 1 ) Discrete-time formulation . A straightforward solution is to treat a time window with length of T ( e.g. , T days ) as a sequence of time-steps and get a snapshot at each time-step . In this way , a dynamic hypergraph is defined as GD = [ G1 , · · · , Gt , · · · , GT ] T where Gt is a hypergraph dumped at time-step t. 2 ) Continuous formulation . By treating time as a continuous variable , the dynamic hypergraph can be defined as GC = ( G0 , U ) where G0 is the initial status ( a hypergraph ) and U = { ( pt , v t , at ) |t < = T } is a streaming of updates . pt denotes the target variable ( e.g. , a row of X ) changed at time t ; v t denotes the latest value of the target variable , at denotes the action of change , including add , delete , update . It should be noted that both formulations have pros and cons , e.g. , the discrete-time formulation is more friendly to existing analytic techniques on static hypergraph such as HCN while the continuous-time formulation records the accurate time of changes . This work focuses on the discrete-time formulation and makes the first attempt to extend HCN to dynamic hypergraph . A big challenge of capturing spatial-temporal dependency in a dynamic hypergraph is that it is tough to extract the features of those changing nodes or hyperedges in a unified manner for the sake of varied scales of nodes and hyperedges . Besides , how to absorb their dynamic properties is very important for various application tasks . Towards this end , we need to design the proper convolution operations on dynamic hypergraph . There are two challenging toughs : 1 ) at each time step , since there are various relations between hyperedges and nodes , it is important to update the node features by considering various relations in the hyperedges ; 2 ) due to dynamically changes of the node features , modeling the temporal dependency needs to extract the corresponding temporal features . In this work , we propose a framework of Dynamic Hypergraph Convolutional Networks ( DyHCN ) to tackle the challenges , which has two modules : Hypergraph Convolution ( HC ) module and Temporal Evolution ( TE ) module . In a dynamic hypergraph , the set of hyperedges at each time step includes different hyperedge embeddings and each hyperedge contains different numbers of nodes . We exploit three submodules to update an node ’ s embeddings in HC : inner attention , outer attention , and embeddings update . Firstly , inner attention transform node features along with its hyperedge into the node-hyperedge feature ; and then outer attention utilizes attention mechanism to estimate the importance of each hyperedge and output the importance weights ; and then we update the node ’ s embeddings by aggregating node-hyperedge , hyperedge and node features with the weight of each hyperedge . Getting the nodes embeddings , we extract temporal features of nodes ’ embeddings and make a prediction by the TE module . Extensive experimental results on two real-world datasets validate the superior performance of DyHCN over the existing baselines which proves the effectiveness of DyHCN on dynamically hypergraphs . The rest of the paper is organized as follows . Section 2 introduces the preliminary knowledge about GCN and the hypergraph convolutional network . Section 3 explains the proposed DyHCN method . Section 4 introduces related work about GCN on the graph and hyperedge . Applications and experimental results are presented in Section 5 . Finally , we conclude this work in Section 6 . 2 PRELIMINARY . Graph Convolutional Network Given a graph G = ( V , E ) with N nodes vi ∈ V , edges ( vi , vj ) ∈ E , an adjacency matrix A ∈ RN×N and a degree matrix Dii = ∑ j Aij . With the input signal x , Kipf & Welling ( 2016 ) considers spectral convolutions on graphs with a filter gθ = diag ( θ ) in the Fourier domain , gθ ? x = UgθUT x , where U is the matrix of eigenvectors of the normalized graph Laplacian L = IN − D−1/2AD−1/2 = UΛUT , with a diagonal matrix of eigenvalues Λ and the graph Fourier transform UTx . In order to reduce the computation complexity , gθ is approximated with Chebyshev polynomials Tk ( x ) = 2xTk−1 ( x ) −Tk−2 ( x ) Defferrard et al . ( 2016 ) , which can be formulated as : gθ ≈ ∑K k=0 θkTk ( Λ̂ ) , where Λ̂ = 2 λmax Λ − I , λmax denotes the largest eigenvalue of Laplacian matrix , θk denotes the Chebyshev coefficients . Kipf & Welling ( 2016 ) proved that the GCN can be simplified to K=1 and λmax ≈ 2 , which is the state-of-the-art of GCN . Hypergraph Convolutional Network A hypergraph can be formulated as G = ( V , E , W ) , where V is a set of vertes , E is a set of hyperedges and W is a diagonal matrix which denotes the weight of each hyperedge . The adjacency matrix of hypergraph G can be denoted by H ∈ R|V|×|E| . The degree of node is d ( v ) = ∑ e∈E w ( e ) h ( v , e ) and the degree of edge δ ( e ) = ∑ v∈V h ( v , e ) . De and Dv denotes the matrices of edge degrees and node degrees . The spectral convolution of x and filter g can be formulated as g ? x = Φ ( ( ΦT g ) ( ΦT x ) ) = Φg ( Λ ) ΦT x , where denotes the element-wise multiplication and g ( Λ ) is a function of Fourier coefficients Feng et al . ( 2019b ) . As simplified in GCN , the convolution operation can be simplified to g ? x ≈ θD−1/2v HWDe −1HTD−1/2v x . 3 DYNAMIC HYPERGRAPH CONVOLUTIONAL NETWORKS . 3.1 FORMULATION OF DYNAMIC HYPERGRAPH . Dynamic hypergraph can be formulated into two categories : discrete-time and continuous-time dynamic hypergraph . The discrete-time approach views dynamic hypergraph as a collection of static graph snapshots over time , while the continuous counterpart extracts fine-grained temporal information on nodes and hyperedges which characterize the dynamic evolution of hypergraph . Discrete-time Dynamic Hypergraph Discrete-time dynamic hypergraph can be formulated as GD = ( Vt , Et , At , Ht , Xt ) , where Xt = [ xt1 , xt2 , · · · , xtn ] T ∈ Rn×d , Ht = [ ht1 , ht2 , · · · , htm ] T ∈ Rm×c , xti ( i = 1 , 2 , · · · , n ) denotes the feature of the i -th node and htj ( j = 1 , 2 , · · · , m ) denotes the feature of the j-th hyperedge , and m , n is the number of hyperedges and nodes on hypergraph Gt ( hypergraph on time step t ) . At ∈ Rn×m is an incidence matrix with binary value indicating the connectedness of nodes on hypergraph Gt . Vt is the set of nodes , Et is the set of hyperedges . C te = [ u t 1 , u t 2 , · · · , u tkte ] T ∈ Rkte×d and D tu = [ et1 , et2 , · · · , etktu ] T ∈ Rktu×c are used to denote the node set contained in hyperedge e and the hyperedge set containing the node u at time setp t respectively . Note that k te and k t u are the number of nodes in hyperedge e and the number of hyperedges containing node u on time t , respectively . As the representation evolve over time , we capture the spatial dependency by hypergraph convolutional networks and use CNNs to model the temporal dependency . Continuous-time Dynamic Hypergraph Continuous-time dynamic hypergraph can be defined as GC = ( G0 , U ) where G0 is the initial status ( a hypergraph ) and U = { ( pt , v t , at ) |t < = T } is a streaming of updates . pt denotes the target variable ( e.g. , a row of X ) changed at time t ; v t denotes the latest value of the target variable , at denotes the action of change , including add , delete , update . Due to a static hypergraph model can be extended to dynamic hypergraphs by applying it on each snapshots and then aggregating the results of the model , and the distinction between an evolving and a temporal network is less important Skarding et al . ( 2020 ) , we adapt discrete-time dynamic hypergraph to build the DyHCN model in our work . DyHCN DyHCN is composed of two modules : hypergraph convolution ( HC ) and temporal evolution ( TE ) . The HC module is designed to aggregate features among nodes and hyperedges with attention mechanisms and update the embeddings of centroid nodes . The TE module is used for capturing dynamic changes in temporal features . The framework of DyHCN is illustrated in Fig.2 , 3.2 HYPERGRAPH CONVOLUTION . Hypergraph convolution consists of three submodules : inner attention , outer attention , and embeddings update . In particular , inner attention aggregates nodes ’ features to hyperedge , outer attention uses attention mechanisms to determine the importance of each hyperedge , and embeddings update submodule aggregates node-hyperedge features , hyperedge features and the node features to update centroid node embeddings with the weight of each hyperedge . Inner attention The inner attention is shown on the left plane of Fig . 3 which aggregates node embeddings to node-hyperedge features by using a self-attention mechanism . With a multi-layer perceptron ( MLP ) we can get the weight score of each node . For a specific node xti on time step t , the input of inner attention is C te = [ u t 1 , u t 2 , · · · , u tkte ] T ∈ Rkte×d and the output of node-hyperedge embedding d t is the weighted sum of node features , which is formulated as : ωt = softmax ( C tewe + be ) , ( 1 ) dt = kte∑ j=0 ωtju t j , ( 2 ) where we ∈ Rd×1 and be ∈ R k t e×1 are trainable parameters , ωt ∈ R kte×1 is the weight of nodes in hyperedge , dt ∈ R1×d denotes the node-hyperedge features , and k te denotes the number of nodes in hyperedge , d is node feature dimension . Outer attention Due to multiple hyperedges related to center node , and the importance of each hyperedge is different , we propose an outer attention submodule to determine the weight of each hyperedge . The right plane of Fig . 3 shows the outer attention submodule which calculates the weight of each hyperedge based on hyperedge features . For specific node xti , the input of outer attention is D tu = [ e t 1 , e t 2 , · · · , etktu ] T ∈ Rktu×c , a hyperedge set containing vertex xti , and the output is ωth , the weight of each hyperedge on time step t. rtu = sigmoid ( D t uwu + bu ) , ( 3 ) ωth = softmax ( r t u ) , ( 4 ) where wu ∈ Rc×1 , bu ∈ Rk t u ×1 are trainable parameters and ωth ∈ Rk t u ×1 is the weight vector of each hyperedge , k tu is the number of hyperedges containing vertex u at time step t , and c is the hyperedge feature dimension . Embeddings Update With the output of inner attention and out attention , we update the centroid node embeddings sti by aggregating node ’ s input features x t i , node-hyperedge features dt and hyperedge features hti with the weight of hyperedges ω t h. We explore three aggregation methods , 1 ) Concatenated features We concatenate the node-hyperedge features and hyperedge features directly with the activation funciton of tanh , qt = tanh [ dt : hti ] ∈ R1× ( d+c ) . 2 ) Dot-product features We multiply the node-hyperedge features with hyperedge features with the element-wise operation to model the interaction of two kinds features , tanh , qt = tanh [ dt hti ] ∈ R1×d ( by setting d=c ) , where denotes element-wise product operation . 3 ) MLP features We concatenate the node-hyperedge features with hyperedge features with an MLP process to aggregate the features , qt = tanh ( [ dt : hti ] Wc + bc ) ∈ R1×d , where Wc ∈ R ( d+c ) ×d , bc ∈ R1×d are trainable parameters . Note that , htc only stands for the concatenated features for one hyperedge , so for k t u hyperedges , we can get a concatenated features matrix Qti = [ qt0 , qt1 , · · · , qtktu ] T which denotes the influence from nodes and each hyperedge . Considering the weight of each hyperedge ωth , we first calculate the weighted sum of concatenated features Qti to measure the influence from all hyperedges and related nodes . And then update the specific node embedding sti with the input feature x t i and the influence embeddings . zti = sum ( ω t h ·Q t i ) , ( 5 ) sti = tanh ( [ x t i : z t i ] Wh + bh ) , ( 6 ) where zti ∈ R1×d is the weighted aggregated features , Wh ∈ R2d×d and bh ∈ R1×d are trainable parameters .
This paper proposes a method called DyHCN for learning dynamic hypergraph convolutional networks where the hypergraph structure is allowed to evolve over time. The interactions within each hyper edge, that between nodes, as well as related are used to learn the hypergaph embedding. The evolution of the centroid nodes is then modelled using LSTM. DyHCN gives better modelling accuracy as compared to some existing ones.
SP:6c4659d71144bea924d9e77ee2be1bd6d11cf7f0
Visual Question Answering From Another Perspective: CLEVR Mental Rotation Tests
1 INTRODUCTION . Psychologists have employed mental rotation tests for decades ( Shepard & Metzler , 1971 ) as a powerful tool for devising how the human mind interprets and ( internally ) manipulates three dimensional representations of the world . Instead of using these test to probe the human capacity for mental 3D manipulation , we are interested here in : a ) understanding the ability of modern deep neural architectures to perform mental rotation tasks , and b ) building architectures better suited to 3D inference and understanding . Recent applications of concepts from 3D graphics to deep learning , and vice versa , have led to promising results . We are similarly interested in leveraging models of 3D image formation from the graphics and vision communities to augment neural network architectures with inductive biases that improve their ability to reason about the real world . Here we measure the effectiveness of adding such biases , confirming their ability to improve the performance of neural models on mental rotation tasks . Concepts from inverse graphics can be used to guide the construction of neural architectures designed to perform tasks related to the reverse of the traditional image synthesis processes : namely , taking 2D image input and inferring 3D information about the scene . For instance , 3D reconstruction in computer vision ( Furukawa & Hernández , 2015 ) can be realized with neural-based approaches that output voxel ( Wu et al. , 2016 ; Nguyen-Phuoc et al. , 2019 ) , mesh ( Wang et al. , 2018 ) , or point cloud ( Qi et al. , 2017 ) representations of the underlying 3D scene geometry . Such inverse graphics methods range from fully-differentiable graphics pipelines ( Kato et al. , 2018 ) to implicit neural-based approaches with learnable modules designed to mimic the structure of certain components of the forward graphics pipeline ( Yao et al. , 2018 ; Thies et al. , 2019 ) . While inverse rendering is potentially an interesting and useful goal in itself , many computer vision systems could benefit from neural architectures that demonstrate good performance for more targeted mental rotation tasks . In our work here we are interested in exploring neural “ mental rotation ” by adapting a well known standard benchmark for visual question-and-answering ( VQA ) through answering questions with respect to another viewpoint . We use the the Compositional Language and Elementary Visual Reasoning ( CLEVR ) Diagnostic Dataset ( Johnson et al. , 2017 ) as the starting point for our work . While we focus on this well known benchmark , many analogous questions of practical interest exist . For example , given the camera viewpoint of a ( blind ) person crossing the road , can we infer if each of the drivers of the cars at an intersection can see this blind person crossing the street ? As humans , we are endowed with the ability to reason about scenes and imagine them from different viewpoints , even if we have only seen them from one perspective . As noted by others , it therefore seems intuitive that we should encourage the same capabilities in deep neural networks ( Harley et al. , 2019 ) . In order to answer such questions effectively , some sort of representation encoding 3D information seems necessary to permit inferences to be drawn due to a change in the orientation and position of the viewpoint camera . However , humans clearly do not have access to error signals obtained through re-rendering scenes , but are able to perform such tasks . To explore these problems in a controlled setting , we adapt the original CLEVR setup in which a VQA model is trained to answer different types of questions about a scene consisting of various types and colours of objects . While images from this dataset are generated through the rendering of randomly generated 3D scenes , the three-dimensional structure of the scene is never fully exploited because the viewpoint camera never changes . We call our problem formulation and data set CLEVR-MRT , as it is a new Mental Rotation Test version of the CLEVR problem setup . In CLEVR-MRT alternative views of a scene are rendered and used as the input to a perception pipeline that must then answer a question that was posed with respect to another ( the original CLEVR ) viewpoint.1 This gives rise to a more difficult task where the VQA model must learn how to map from its current viewpoint to the viewpoint that is required to answer the question . This can be seen in Figure 1 ( b ) . Figure 1 ( a ) depicts a real world situation and analogy where the answers to similar types of questions may help different types of systems make consequential decisions , e.g . intelligent intersections , cars , robots , or navigation assistants for the blind . The fact that MRTs are a classical tool of Psychology and the link to these different practical applications motivated us to create the controlled setting of CLEVR-MRTs depicted in Figure 1 ( b ) . ( a ) ( Left ) A view of a street corner . ( Middle ) a CLEVR-like representation of the scene with abstractions of buildings , cars and pedestrians . ( Right ) The same virtual scene from another viewpoint , where questions concerning the relative positions of objects after a mental rotation could be of significant practical interest . ( b ) Random views of an example scene in CLEVR-MRT . The center image is the ‘ canonical ’ view , which is the unseen point of view for which questions must be answered using only one of the other views as input . Figure 1 : ( a ) A real-world example where the ability to perform mental rotations can be of practical utility . ( b ) Images from the CLEVR-MRT dataset . Using our new mental rotation task definition and our CLEVR-MRT dataset , we examine a number of new inverse-graphics inspired neural architectures . We examine models that use the FILM ( Feature-wise Linear Modulation ) technique ( Perez et al. , 2017 ) for VQA , which delivers competitive performance using contemporary state-of-the-art convolutional network techniques . We observe that such methods fall short for this more challenging MRT VQA setting . This motivates us to create new architectures that involve inferring a latent feature volume that we subject to rigid 3D transformations ( rotations and translations ) , in a manner that has been examined in 3D generative modelling techniques such as spatial transformers ( Jaderberg et al. , 2015 ) as well as HoloGAN 1Dataset and code will be available at https : //github.com/anonymouscat2434/clevr-mrt ( Nguyen-Phuoc et al. , 2019 ) . This can either be done through the adaptation of a pre-trained 2D encoder network , i.e . an ImageNet-based feature extractor as in Section 2.2.1 , or through training our encoder proposed here , which is obtained through the use of contrastive learning as in Section 2.2.3 . In the case of the latter model , we leverage the InfoNCE loss ( Oord et al. , 2018 ) to minimise the distance between different views of the same scene in metric space , and conversely the opposite for views of different scenes altogether . However , rather than simply using a stochastic ( 2D ) data augmentation policy to create positive pairs ( e.g . random crops , resizes , and pixel perturbations ) , we leverage the fact that we have access to many views of each scene at training time and that this can be seen as a data augmentation policy operating in 3D . This in turn can be leveraged to learn an encoder that can map 2D views to a 3D latent space without assuming any extra guidance such as camera extrinsics . 2 METHODS . We begin here by describing simple and strong baseline methods as well as upper bound estimates used to evaluate the performance of different techniques on this dataset . We then present our new approach to learning 3D features and two different ways to address this task . 2.1 FILM BASELINES . The architecture we use is very similar to that proposed by FILM ( Perez et al. , 2017 ) , in which a pre-trained ResNet-101 classifier on ImageNet extracts features from the input images which are then fed to a succession of FILM-modulated residual blocks using the hidden state output from the GRU . As a sanity check – to ensure our models are adequately parameterised – the simplest baseline to run is one where images in the dataset are filtered to only contain canonical views . In this setting , we would expect the highest validation performance since the viewpoint given is the same as the canonical viewpoint ( the viewpoint wrt which the question must be answered ) . The second and third baselines to run are ones where we use the full dataset , with and without conditioning on the viewpoint camera via FILM , respectively . This is illustrated in Figure 2 , where we can see the viewpoint camera also being embedded before being concatenated to the question embedding and passed through the subsequent FILM blocks . Note that in the case of the canonical baseline , the viewpoint and canonical view is the same thing , so no camera conditioning is necessary . If we let S denote a scene consisting of all of its camera views ( images ) X , the camera c , the question q , and its corresponding answer y , we can summarise this as the following : S = ( X , q , c , y ) ∼ D ( sample a scene ) x ∼ X ( sample a random view ) h : = ResNet ( x ) ecam : = embed ( film ) φ ( c ) egru : = GRUφ ( q ) ỹ : = FILMφ ( h , [ egru , ecam ] ) ` cls : = ` ( y , ỹ ) , ( 1 ) where the encoder ( a ResNet ) is frozen and we do not update its parameters during training . 2.2 LEARNING 3D FEATURE REPRESENTATIONS FROM SINGLE VIEW IMAGES . So far we have been operating in 2D , based on the pre-trained ResNet-101 ImageNet encoder which outputs a high-dimensional stack of feature maps ( a 3D tensor ) . To work in 3D , we would either need to somehow transform the existing encoding into a 4D tensor ( a stack of 3D feature cubes ) or use a completely different encoder altogether which can output a 3D volume directly . Assuming we already had such a volume , we can manipulate the volume in 3D space directly by having it undergo any rigid transformation that is necessary for the question to be answered . In Section 2.2.1 we illustrate a simple technique which simply takes the existing ImageNet encoder ’ s features and runs it through a learnable ‘ post-processing ’ block to yield a 3D volume , and in Section 2.2.3 we propose a self-supervised contrastive approach to learn such an encoder from scratch . 2.2.1 PROJECTING 2D FEATURES INTO 3D FEATURES . To exploit the power of pre-trained representations , we start with a pre-trained ResNet encoder and transform its stack of feature maps through an additional set of 2D convolution blocks using the ‘ post-processor ’ shown in Figure 3 , right before reshaping the 3D tensor into 4D . In other words , we learn a module which maps from a stack of feature maps h to a stack of feature cubes h′ . Since the post-processor is a learnable module through which the FILM part of the pipeline is able to backpropagate through , it can be seen as learning an appropriate set of transforms that construct 3D feature volumes h′ . Through back-propagation it learns to perform well when manipulated with camera controllable FILM operations either as is or , more interestingly , when also subjected to rigid 3D transformations as we will see shortly in Section 2.2.2 .
The paper explores the problem of visual question answering from another perspective. Similar to VQA, a system is provided with a scene and a question. However, the difference is that the question needs to be answered from a viewpoint different from the one provided. Hence, the system needs to perform “mental rotation”. The paper creates a new dataset called CLEVR Mental Rotation Tests which is based on the prior CLEVR dataset. The paper also studies the efficacy of various supervised and self-supervised models on the proposed dataset.
SP:5542cb8de7d232cde44071f0612827309298e98b
Visual Question Answering From Another Perspective: CLEVR Mental Rotation Tests
1 INTRODUCTION . Psychologists have employed mental rotation tests for decades ( Shepard & Metzler , 1971 ) as a powerful tool for devising how the human mind interprets and ( internally ) manipulates three dimensional representations of the world . Instead of using these test to probe the human capacity for mental 3D manipulation , we are interested here in : a ) understanding the ability of modern deep neural architectures to perform mental rotation tasks , and b ) building architectures better suited to 3D inference and understanding . Recent applications of concepts from 3D graphics to deep learning , and vice versa , have led to promising results . We are similarly interested in leveraging models of 3D image formation from the graphics and vision communities to augment neural network architectures with inductive biases that improve their ability to reason about the real world . Here we measure the effectiveness of adding such biases , confirming their ability to improve the performance of neural models on mental rotation tasks . Concepts from inverse graphics can be used to guide the construction of neural architectures designed to perform tasks related to the reverse of the traditional image synthesis processes : namely , taking 2D image input and inferring 3D information about the scene . For instance , 3D reconstruction in computer vision ( Furukawa & Hernández , 2015 ) can be realized with neural-based approaches that output voxel ( Wu et al. , 2016 ; Nguyen-Phuoc et al. , 2019 ) , mesh ( Wang et al. , 2018 ) , or point cloud ( Qi et al. , 2017 ) representations of the underlying 3D scene geometry . Such inverse graphics methods range from fully-differentiable graphics pipelines ( Kato et al. , 2018 ) to implicit neural-based approaches with learnable modules designed to mimic the structure of certain components of the forward graphics pipeline ( Yao et al. , 2018 ; Thies et al. , 2019 ) . While inverse rendering is potentially an interesting and useful goal in itself , many computer vision systems could benefit from neural architectures that demonstrate good performance for more targeted mental rotation tasks . In our work here we are interested in exploring neural “ mental rotation ” by adapting a well known standard benchmark for visual question-and-answering ( VQA ) through answering questions with respect to another viewpoint . We use the the Compositional Language and Elementary Visual Reasoning ( CLEVR ) Diagnostic Dataset ( Johnson et al. , 2017 ) as the starting point for our work . While we focus on this well known benchmark , many analogous questions of practical interest exist . For example , given the camera viewpoint of a ( blind ) person crossing the road , can we infer if each of the drivers of the cars at an intersection can see this blind person crossing the street ? As humans , we are endowed with the ability to reason about scenes and imagine them from different viewpoints , even if we have only seen them from one perspective . As noted by others , it therefore seems intuitive that we should encourage the same capabilities in deep neural networks ( Harley et al. , 2019 ) . In order to answer such questions effectively , some sort of representation encoding 3D information seems necessary to permit inferences to be drawn due to a change in the orientation and position of the viewpoint camera . However , humans clearly do not have access to error signals obtained through re-rendering scenes , but are able to perform such tasks . To explore these problems in a controlled setting , we adapt the original CLEVR setup in which a VQA model is trained to answer different types of questions about a scene consisting of various types and colours of objects . While images from this dataset are generated through the rendering of randomly generated 3D scenes , the three-dimensional structure of the scene is never fully exploited because the viewpoint camera never changes . We call our problem formulation and data set CLEVR-MRT , as it is a new Mental Rotation Test version of the CLEVR problem setup . In CLEVR-MRT alternative views of a scene are rendered and used as the input to a perception pipeline that must then answer a question that was posed with respect to another ( the original CLEVR ) viewpoint.1 This gives rise to a more difficult task where the VQA model must learn how to map from its current viewpoint to the viewpoint that is required to answer the question . This can be seen in Figure 1 ( b ) . Figure 1 ( a ) depicts a real world situation and analogy where the answers to similar types of questions may help different types of systems make consequential decisions , e.g . intelligent intersections , cars , robots , or navigation assistants for the blind . The fact that MRTs are a classical tool of Psychology and the link to these different practical applications motivated us to create the controlled setting of CLEVR-MRTs depicted in Figure 1 ( b ) . ( a ) ( Left ) A view of a street corner . ( Middle ) a CLEVR-like representation of the scene with abstractions of buildings , cars and pedestrians . ( Right ) The same virtual scene from another viewpoint , where questions concerning the relative positions of objects after a mental rotation could be of significant practical interest . ( b ) Random views of an example scene in CLEVR-MRT . The center image is the ‘ canonical ’ view , which is the unseen point of view for which questions must be answered using only one of the other views as input . Figure 1 : ( a ) A real-world example where the ability to perform mental rotations can be of practical utility . ( b ) Images from the CLEVR-MRT dataset . Using our new mental rotation task definition and our CLEVR-MRT dataset , we examine a number of new inverse-graphics inspired neural architectures . We examine models that use the FILM ( Feature-wise Linear Modulation ) technique ( Perez et al. , 2017 ) for VQA , which delivers competitive performance using contemporary state-of-the-art convolutional network techniques . We observe that such methods fall short for this more challenging MRT VQA setting . This motivates us to create new architectures that involve inferring a latent feature volume that we subject to rigid 3D transformations ( rotations and translations ) , in a manner that has been examined in 3D generative modelling techniques such as spatial transformers ( Jaderberg et al. , 2015 ) as well as HoloGAN 1Dataset and code will be available at https : //github.com/anonymouscat2434/clevr-mrt ( Nguyen-Phuoc et al. , 2019 ) . This can either be done through the adaptation of a pre-trained 2D encoder network , i.e . an ImageNet-based feature extractor as in Section 2.2.1 , or through training our encoder proposed here , which is obtained through the use of contrastive learning as in Section 2.2.3 . In the case of the latter model , we leverage the InfoNCE loss ( Oord et al. , 2018 ) to minimise the distance between different views of the same scene in metric space , and conversely the opposite for views of different scenes altogether . However , rather than simply using a stochastic ( 2D ) data augmentation policy to create positive pairs ( e.g . random crops , resizes , and pixel perturbations ) , we leverage the fact that we have access to many views of each scene at training time and that this can be seen as a data augmentation policy operating in 3D . This in turn can be leveraged to learn an encoder that can map 2D views to a 3D latent space without assuming any extra guidance such as camera extrinsics . 2 METHODS . We begin here by describing simple and strong baseline methods as well as upper bound estimates used to evaluate the performance of different techniques on this dataset . We then present our new approach to learning 3D features and two different ways to address this task . 2.1 FILM BASELINES . The architecture we use is very similar to that proposed by FILM ( Perez et al. , 2017 ) , in which a pre-trained ResNet-101 classifier on ImageNet extracts features from the input images which are then fed to a succession of FILM-modulated residual blocks using the hidden state output from the GRU . As a sanity check – to ensure our models are adequately parameterised – the simplest baseline to run is one where images in the dataset are filtered to only contain canonical views . In this setting , we would expect the highest validation performance since the viewpoint given is the same as the canonical viewpoint ( the viewpoint wrt which the question must be answered ) . The second and third baselines to run are ones where we use the full dataset , with and without conditioning on the viewpoint camera via FILM , respectively . This is illustrated in Figure 2 , where we can see the viewpoint camera also being embedded before being concatenated to the question embedding and passed through the subsequent FILM blocks . Note that in the case of the canonical baseline , the viewpoint and canonical view is the same thing , so no camera conditioning is necessary . If we let S denote a scene consisting of all of its camera views ( images ) X , the camera c , the question q , and its corresponding answer y , we can summarise this as the following : S = ( X , q , c , y ) ∼ D ( sample a scene ) x ∼ X ( sample a random view ) h : = ResNet ( x ) ecam : = embed ( film ) φ ( c ) egru : = GRUφ ( q ) ỹ : = FILMφ ( h , [ egru , ecam ] ) ` cls : = ` ( y , ỹ ) , ( 1 ) where the encoder ( a ResNet ) is frozen and we do not update its parameters during training . 2.2 LEARNING 3D FEATURE REPRESENTATIONS FROM SINGLE VIEW IMAGES . So far we have been operating in 2D , based on the pre-trained ResNet-101 ImageNet encoder which outputs a high-dimensional stack of feature maps ( a 3D tensor ) . To work in 3D , we would either need to somehow transform the existing encoding into a 4D tensor ( a stack of 3D feature cubes ) or use a completely different encoder altogether which can output a 3D volume directly . Assuming we already had such a volume , we can manipulate the volume in 3D space directly by having it undergo any rigid transformation that is necessary for the question to be answered . In Section 2.2.1 we illustrate a simple technique which simply takes the existing ImageNet encoder ’ s features and runs it through a learnable ‘ post-processing ’ block to yield a 3D volume , and in Section 2.2.3 we propose a self-supervised contrastive approach to learn such an encoder from scratch . 2.2.1 PROJECTING 2D FEATURES INTO 3D FEATURES . To exploit the power of pre-trained representations , we start with a pre-trained ResNet encoder and transform its stack of feature maps through an additional set of 2D convolution blocks using the ‘ post-processor ’ shown in Figure 3 , right before reshaping the 3D tensor into 4D . In other words , we learn a module which maps from a stack of feature maps h to a stack of feature cubes h′ . Since the post-processor is a learnable module through which the FILM part of the pipeline is able to backpropagate through , it can be seen as learning an appropriate set of transforms that construct 3D feature volumes h′ . Through back-propagation it learns to perform well when manipulated with camera controllable FILM operations either as is or , more interestingly , when also subjected to rigid 3D transformations as we will see shortly in Section 2.2.2 .
The paper studies visual question answering focusing on answering questions in a reference image of a different viewpoint. They propose a new dataset CLEVR-MRT drawing motivation from the well-known visual reasoning dataset CLEVR to illustrate the idea in which they have full control of the changes of viewpoints in an image. They then propose to use a volumetric encoder to represent 3D image features of an image via either 2D-to-3D projection or a contrastive-based encoder and further adapt an existing method (FiLM) to handle 3D tensors. Experiments on the CLEVR-MRT show that the use of the 2D features and 3D features of an image is complementary to each other.
SP:5542cb8de7d232cde44071f0612827309298e98b
Understanding Over-parameterization in Generative Adversarial Networks
A broad class of unsupervised deep learning methods such as Generative Adversarial Networks ( GANs ) involve training of overparameterized models where the number of parameters of the model exceeds a certain threshold . Indeed , most successful GANs used in practice are trained using overparameterized generator and discriminator networks , both in terms of depth and width . A large body of work in supervised learning have shown the importance of model overparameterization in the convergence of the gradient descent ( GD ) to globally optimal solutions . In contrast , the unsupervised setting and GANs in particular involve non-convex concave mini-max optimization problems that are often trained using Gradient Descent/Ascent ( GDA ) . The role and benefits of model overparameterization in the convergence of GDA to a global saddle point in non-convex concave problems is far less understood . In this work , we present a comprehensive analysis of the importance of model overparameterization in GANs both theoretically and empirically . We theoretically show that in an overparameterized GAN model with a 1-layer neural network generator and a linear discriminator , GDA converges to a global saddle point of the underlying non-convex concave min-max problem . To the best of our knowledge , this is the first result for global convergence of GDA in such settings . Our theory is based on a more general result that holds for a broader class of nonlinear generators and discriminators that obey certain assumptions ( including deeper generators and random feature discriminators ) . Our theory utilizes and builds upon a novel connection with the convergence analysis of linear timevarying dynamical systems which may have broader implications for understanding the convergence behavior of GDA for non-convex concave problems involving overparameterized models . We also empirically study the role of model overparameterization in GANs using several large-scale experiments on CIFAR-10 and Celeb-A datasets . Our experiments show that overparameterization improves the quality of generated samples across various model architectures and datasets . Remarkably , we observe that overparameterization leads to faster and more stable convergence behavior of GDA across the board . 1 INTRODUCTION . In recent years , we have witnessed tremendous progress in deep generative modeling with some state-of-the-art models capable of generating photo-realistic images of objects and scenes ( Brock et al. , 2019 ; Karras et al. , 2019 ; Clark et al. , 2019 ) . Three prominent classes of deep generative models include GANs ( Goodfellow et al. , 2014 ) , VAEs ( Kingma & Welling , 2014 ) and normalizing flows ( Dinh et al. , 2017 ) . Of these , GANs remain a popular choice for data synthesis especially in the image domain . GANs are based on a two player min-max game between a generator network that generates samples from a distribution , and a critic ( discriminator ) network that discriminates real distribution from the generated one . The networks are optimized using Gradient Descent/Ascent ( GDA ) to reach a saddle-point of the min-max optimization problem . ∗First two authors contributed equally . Correspondence to yogesh @ cs.umd.edu , sajedi @ usc.edu One of the key factors that has contributed to the successful training of GANs is model overparameterization , defined based on the model parameters count . By increasing the complexity of discriminator and generator networks , both in depth and width , recent papers show that GANs can achieve photo-realistic image and video synthesis ( Brock et al. , 2019 ; Clark et al. , 2019 ; Karras et al. , 2019 ) . While these works empirically demonstrate some benefits of overparameterization , there is lack of a rigorous study explaining this phenomena . In this work , we attempt to provide a comprehensive understanding of the role of overparameterization in GANs , both theoretically and empirically . We note that while overparameterization is a key factor in training successful GANs , other factors such as generator and discriminator architectures , regularization functions and model hyperparameters have to be taken into account as well to improve the performance of GANs . Recently , there has been a large body of work in supervised learning ( e.g . regression or classification problems ) studying the importance of model overparameterization in gradient descent ( GD ) ’ s convergence to globally optimal solutions ( Soltanolkotabi et al. , 2018 ; Allen-Zhu et al. , 2019 ; Du et al. , 2019 ; Oymak & Soltanolkotabi , 2019 ; Zou & Gu , 2019 ; Oymak et al. , 2019 ) . A key observation in these works is that , under some conditions , overparameterized models experience lazy training ( Chizat et al. , 2019 ) where optimal model parameters computed by GD remain close to a randomly initialized model . Thus , using a linear approximation of the model in the parameter space , one can show the global convergence of GD in such minimization problems . In contrast , training GANs often involves solving a non-convex concave min-max optimization problem that fundamentally differs from a single minimization problem of classification/regression . The key question is whether overparameterized GANs also experience lazy training in the sense that overparameterized generator and discriminator networks remain sufficiently close to their initializations . This may then lead to a general theory of global convergence of GDA for such overparameterized non-convex concave min-max problems . In this paper we first theoretically study the role of overparameterization for a GAN model with a 1-hidden layer generator and a linear discriminator . We study two optimization procedures to solve this problem : ( i ) using a conventional training procedure in GANs based on GDA in which generator and discriminator networks perform simultaneous steps of gradient descent to optimize their respective models , ( ii ) using GD to optimize generator ’ s parameters for the optimal discriminator . The latter case corresponds to taking a sufficiently large number of gradient ascent steps to update discriminator ’ s parameters for each GD step of the generator . In both cases , our results show that in an overparameterized regime , the GAN optimization converges to a global solution . To the best of our knowledge , this is the first result showing the global convergence of GDA in such settings . While in our results we focus on one-hidden layer generators and linear discriminators , our theory is based on analyzing a general class of min-max optimization problems which can be used to study a much broader class of generators and discriminators potentially including deep generators and deep random feature-based discriminators . A key component of our analysis is a novel connection to exponential stability of non-symmetric time varying dynamical systems in control theory which may have broader implications for theoretical analysis of GAN ’ s training . Ideas from control theory have also been used for understanding and improving training dynamics of GANs in ( Xu et al. , 2019 ; An et al. , 2018 ) . Having analyzed overparameterized GANs for relatively simple models , we next provide a comprehensive empirical study of this problem for practical GANs such as DCGAN ( Radford et al. , 2016 ) and ResNet GAN ( Gulrajani et al. , 2017 ) trained on CIFAR-10 and Celeb-A datasets . For example , the benefit of overparamterization in training DCGANs on CIFAR-10 is illustrated in Figure 1 . We have three key observations : ( i ) as the model becomes more overparameterized ( e.g . using wider networks ) , the training FID scores that measure the training error , decrease . This phenomenon has been observed in other studies as well ( Brock et al. , 2019 ) . ( ii ) overparameterization does not hurt the test FID scores ( i.e . the generalization gap remains small ) . This improved test-time performance can also be seen qualitatively in the center panel of Figure 1 , where overparameterized models produce samples of improved quality . ( iii ) Remarkably , overparameterized GANs , with a lot of parameters to optimize over , have significantly improved convergence behavior of GDA , both in terms of rate and stability , compared to small GAN models ( see the right panel of Figure 1 ) . In summary , in this paper • We provide the first theoretical guarantee of simultaneous GDA ’ s global convergence for an overparameterized GAN with one-hidden neural network generator and a linear discriminator ( Theorem 2.1 ) . • By establishing connections with linear time-varying dynamical systems , we provide a theoretical framework to analyze simultaneous GDA ’ s global convergence for a general overparameterized GAN ( including deeper generators and random feature discriminators ) , under some general conditions ( Theorems 2.3 and A.4 ) . • We provide a comprehensive empirical study of the role of model overparameterization in GANs using several large-scale experiments on CIFAR-10 and Celeb-A datasets . We observe overparameterization improves GANs ’ training error , generalization error , sample qualities as well as the convergence rate and stability of GDA . 2 THEORETICAL RESULTS . 2.1 PROBLEM FORMULATION . Given n data points of the form x1 , x2 , . . . , xn ∈ Rm , the goal of GAN ’ s training is to find a generator that can mimic sampling from the same distribution as the training data . More specifically , the goal is to find a generator mapping Gθ ( z ) : Rd → Rm , parameterized by θ ∈ Rp , so that Gθ ( z1 ) , Gθ ( z2 ) , . . . , Gθ ( zn ) with z1 , z2 , . . . , zn generated i.i.d . according toN ( 0 , Id ) has a similar empirical distribution to x1 , x2 , . . . , xn1 . To measure the discrepancy between the data points and the GAN outputs , one typically uses a discriminator mapping Dθ̃ : R m → R parameterized with θ̃ ∈ Rp̃ . The overall training approach takes the form of the following min-max optimization problem which minimizes the worst-case discrepancy detected by the discriminator min θ max θ̃ 1 n n∑ i=1 Dθ̃ ( xi ) − 1 n n∑ i=1 Dθ̃ ( Gθ ( zi ) ) +R ( θ̃ ) . ( 1 ) Here , R ( θ̃ ) is a regularizer that typically ensures the discriminator is Lipschitz . This formulation mimics the popular Wasserstein GAN ( Arjovsky et al. , 2017 ) ( or , IPM GAN ) formulations . This optimization problem is typically solved by running Gradient Descent Ascent ( GDA ) on the minimization/maximization variables . The generator and discriminator mappings G and D used in practice are often deep neural networks . Thus , the min-max optimization problem above is highly nonlinear and non-convex concave . Saddle point optimization is a classical and fundamental problem in game theory ( Von Neumann & Morgenstern , 1953 ) and control ( Gutman , 1979 ) . However , most of the classical results apply to the 1In general , the number of observed and generated samples can be different . However , in practical GAN implementations , batch sizes of observed and generated samples are usually the same . Thus , for simplicity , we make this assumption in our setup . convex-concave case ( Arrow et al. , 1958 ) while the saddle point optimization of GANs is often non convex-concave . If GDA converges to the global ( local ) saddle points , we say it is globally ( locally ) stable . For a general min-max optimization , however , GDA can be trapped in a loop or even diverge . Except in some special cases ( e.g . ( Feizi et al. , 2018 ) for a quadratic GAN formulation or ( Lei et al. , 2019 ) for the under-parametrized setup when the generator is a one-layer network ) , GDA is not globally stable for GANs in general ( Nagarajan & Kolter , 2017 ; Mescheder et al. , 2018 ; Adolphs et al. , 2019 ; Mescheder et al. , 2017 ; Daskalakis et al. , 2020 ) . None of these works , however , study the role of model overparameterization in the global/local convergence ( stability ) of GDA . In particular , it has been empirically observed ( as we also demonstrate in this paper ) that when the generator/discriminator contain a large number of parameters ( i.e . are sufficiently overparameterized ) GDA does indeed find ( near ) globally optimal solutions . In this section we wish to demystify this phenomenon from a theoretical perspective .
This paper studies how over-parameterization plays a role in GAN training. Theoretically, it shows that a GAN with over-parameterized 1-layer neural network generator and a linear discriminator can converge to global saddle point via stochastic optimisation. Similar results are obtained for nonlinear generators and discriminators under some conditions. It also provides empirical results to support its findings.
SP:8a6de840ca758da3973655a8a478e83f8edde474
Understanding Over-parameterization in Generative Adversarial Networks
A broad class of unsupervised deep learning methods such as Generative Adversarial Networks ( GANs ) involve training of overparameterized models where the number of parameters of the model exceeds a certain threshold . Indeed , most successful GANs used in practice are trained using overparameterized generator and discriminator networks , both in terms of depth and width . A large body of work in supervised learning have shown the importance of model overparameterization in the convergence of the gradient descent ( GD ) to globally optimal solutions . In contrast , the unsupervised setting and GANs in particular involve non-convex concave mini-max optimization problems that are often trained using Gradient Descent/Ascent ( GDA ) . The role and benefits of model overparameterization in the convergence of GDA to a global saddle point in non-convex concave problems is far less understood . In this work , we present a comprehensive analysis of the importance of model overparameterization in GANs both theoretically and empirically . We theoretically show that in an overparameterized GAN model with a 1-layer neural network generator and a linear discriminator , GDA converges to a global saddle point of the underlying non-convex concave min-max problem . To the best of our knowledge , this is the first result for global convergence of GDA in such settings . Our theory is based on a more general result that holds for a broader class of nonlinear generators and discriminators that obey certain assumptions ( including deeper generators and random feature discriminators ) . Our theory utilizes and builds upon a novel connection with the convergence analysis of linear timevarying dynamical systems which may have broader implications for understanding the convergence behavior of GDA for non-convex concave problems involving overparameterized models . We also empirically study the role of model overparameterization in GANs using several large-scale experiments on CIFAR-10 and Celeb-A datasets . Our experiments show that overparameterization improves the quality of generated samples across various model architectures and datasets . Remarkably , we observe that overparameterization leads to faster and more stable convergence behavior of GDA across the board . 1 INTRODUCTION . In recent years , we have witnessed tremendous progress in deep generative modeling with some state-of-the-art models capable of generating photo-realistic images of objects and scenes ( Brock et al. , 2019 ; Karras et al. , 2019 ; Clark et al. , 2019 ) . Three prominent classes of deep generative models include GANs ( Goodfellow et al. , 2014 ) , VAEs ( Kingma & Welling , 2014 ) and normalizing flows ( Dinh et al. , 2017 ) . Of these , GANs remain a popular choice for data synthesis especially in the image domain . GANs are based on a two player min-max game between a generator network that generates samples from a distribution , and a critic ( discriminator ) network that discriminates real distribution from the generated one . The networks are optimized using Gradient Descent/Ascent ( GDA ) to reach a saddle-point of the min-max optimization problem . ∗First two authors contributed equally . Correspondence to yogesh @ cs.umd.edu , sajedi @ usc.edu One of the key factors that has contributed to the successful training of GANs is model overparameterization , defined based on the model parameters count . By increasing the complexity of discriminator and generator networks , both in depth and width , recent papers show that GANs can achieve photo-realistic image and video synthesis ( Brock et al. , 2019 ; Clark et al. , 2019 ; Karras et al. , 2019 ) . While these works empirically demonstrate some benefits of overparameterization , there is lack of a rigorous study explaining this phenomena . In this work , we attempt to provide a comprehensive understanding of the role of overparameterization in GANs , both theoretically and empirically . We note that while overparameterization is a key factor in training successful GANs , other factors such as generator and discriminator architectures , regularization functions and model hyperparameters have to be taken into account as well to improve the performance of GANs . Recently , there has been a large body of work in supervised learning ( e.g . regression or classification problems ) studying the importance of model overparameterization in gradient descent ( GD ) ’ s convergence to globally optimal solutions ( Soltanolkotabi et al. , 2018 ; Allen-Zhu et al. , 2019 ; Du et al. , 2019 ; Oymak & Soltanolkotabi , 2019 ; Zou & Gu , 2019 ; Oymak et al. , 2019 ) . A key observation in these works is that , under some conditions , overparameterized models experience lazy training ( Chizat et al. , 2019 ) where optimal model parameters computed by GD remain close to a randomly initialized model . Thus , using a linear approximation of the model in the parameter space , one can show the global convergence of GD in such minimization problems . In contrast , training GANs often involves solving a non-convex concave min-max optimization problem that fundamentally differs from a single minimization problem of classification/regression . The key question is whether overparameterized GANs also experience lazy training in the sense that overparameterized generator and discriminator networks remain sufficiently close to their initializations . This may then lead to a general theory of global convergence of GDA for such overparameterized non-convex concave min-max problems . In this paper we first theoretically study the role of overparameterization for a GAN model with a 1-hidden layer generator and a linear discriminator . We study two optimization procedures to solve this problem : ( i ) using a conventional training procedure in GANs based on GDA in which generator and discriminator networks perform simultaneous steps of gradient descent to optimize their respective models , ( ii ) using GD to optimize generator ’ s parameters for the optimal discriminator . The latter case corresponds to taking a sufficiently large number of gradient ascent steps to update discriminator ’ s parameters for each GD step of the generator . In both cases , our results show that in an overparameterized regime , the GAN optimization converges to a global solution . To the best of our knowledge , this is the first result showing the global convergence of GDA in such settings . While in our results we focus on one-hidden layer generators and linear discriminators , our theory is based on analyzing a general class of min-max optimization problems which can be used to study a much broader class of generators and discriminators potentially including deep generators and deep random feature-based discriminators . A key component of our analysis is a novel connection to exponential stability of non-symmetric time varying dynamical systems in control theory which may have broader implications for theoretical analysis of GAN ’ s training . Ideas from control theory have also been used for understanding and improving training dynamics of GANs in ( Xu et al. , 2019 ; An et al. , 2018 ) . Having analyzed overparameterized GANs for relatively simple models , we next provide a comprehensive empirical study of this problem for practical GANs such as DCGAN ( Radford et al. , 2016 ) and ResNet GAN ( Gulrajani et al. , 2017 ) trained on CIFAR-10 and Celeb-A datasets . For example , the benefit of overparamterization in training DCGANs on CIFAR-10 is illustrated in Figure 1 . We have three key observations : ( i ) as the model becomes more overparameterized ( e.g . using wider networks ) , the training FID scores that measure the training error , decrease . This phenomenon has been observed in other studies as well ( Brock et al. , 2019 ) . ( ii ) overparameterization does not hurt the test FID scores ( i.e . the generalization gap remains small ) . This improved test-time performance can also be seen qualitatively in the center panel of Figure 1 , where overparameterized models produce samples of improved quality . ( iii ) Remarkably , overparameterized GANs , with a lot of parameters to optimize over , have significantly improved convergence behavior of GDA , both in terms of rate and stability , compared to small GAN models ( see the right panel of Figure 1 ) . In summary , in this paper • We provide the first theoretical guarantee of simultaneous GDA ’ s global convergence for an overparameterized GAN with one-hidden neural network generator and a linear discriminator ( Theorem 2.1 ) . • By establishing connections with linear time-varying dynamical systems , we provide a theoretical framework to analyze simultaneous GDA ’ s global convergence for a general overparameterized GAN ( including deeper generators and random feature discriminators ) , under some general conditions ( Theorems 2.3 and A.4 ) . • We provide a comprehensive empirical study of the role of model overparameterization in GANs using several large-scale experiments on CIFAR-10 and Celeb-A datasets . We observe overparameterization improves GANs ’ training error , generalization error , sample qualities as well as the convergence rate and stability of GDA . 2 THEORETICAL RESULTS . 2.1 PROBLEM FORMULATION . Given n data points of the form x1 , x2 , . . . , xn ∈ Rm , the goal of GAN ’ s training is to find a generator that can mimic sampling from the same distribution as the training data . More specifically , the goal is to find a generator mapping Gθ ( z ) : Rd → Rm , parameterized by θ ∈ Rp , so that Gθ ( z1 ) , Gθ ( z2 ) , . . . , Gθ ( zn ) with z1 , z2 , . . . , zn generated i.i.d . according toN ( 0 , Id ) has a similar empirical distribution to x1 , x2 , . . . , xn1 . To measure the discrepancy between the data points and the GAN outputs , one typically uses a discriminator mapping Dθ̃ : R m → R parameterized with θ̃ ∈ Rp̃ . The overall training approach takes the form of the following min-max optimization problem which minimizes the worst-case discrepancy detected by the discriminator min θ max θ̃ 1 n n∑ i=1 Dθ̃ ( xi ) − 1 n n∑ i=1 Dθ̃ ( Gθ ( zi ) ) +R ( θ̃ ) . ( 1 ) Here , R ( θ̃ ) is a regularizer that typically ensures the discriminator is Lipschitz . This formulation mimics the popular Wasserstein GAN ( Arjovsky et al. , 2017 ) ( or , IPM GAN ) formulations . This optimization problem is typically solved by running Gradient Descent Ascent ( GDA ) on the minimization/maximization variables . The generator and discriminator mappings G and D used in practice are often deep neural networks . Thus , the min-max optimization problem above is highly nonlinear and non-convex concave . Saddle point optimization is a classical and fundamental problem in game theory ( Von Neumann & Morgenstern , 1953 ) and control ( Gutman , 1979 ) . However , most of the classical results apply to the 1In general , the number of observed and generated samples can be different . However , in practical GAN implementations , batch sizes of observed and generated samples are usually the same . Thus , for simplicity , we make this assumption in our setup . convex-concave case ( Arrow et al. , 1958 ) while the saddle point optimization of GANs is often non convex-concave . If GDA converges to the global ( local ) saddle points , we say it is globally ( locally ) stable . For a general min-max optimization , however , GDA can be trapped in a loop or even diverge . Except in some special cases ( e.g . ( Feizi et al. , 2018 ) for a quadratic GAN formulation or ( Lei et al. , 2019 ) for the under-parametrized setup when the generator is a one-layer network ) , GDA is not globally stable for GANs in general ( Nagarajan & Kolter , 2017 ; Mescheder et al. , 2018 ; Adolphs et al. , 2019 ; Mescheder et al. , 2017 ; Daskalakis et al. , 2020 ) . None of these works , however , study the role of model overparameterization in the global/local convergence ( stability ) of GDA . In particular , it has been empirically observed ( as we also demonstrate in this paper ) that when the generator/discriminator contain a large number of parameters ( i.e . are sufficiently overparameterized ) GDA does indeed find ( near ) globally optimal solutions . In this section we wish to demystify this phenomenon from a theoretical perspective .
This paper studies the effect of model over-parametrization in GANs. While there is a lot of work on this in the supervised learning setting of classification/regression there is not much in the GAN framework where the minimax objective function complicates such an analysis. This paper considers two types of training of the GAN model, one with the simultaneous gradient descent ascent and one where the discriminator is trained to optimality for every generator update. It provides global convergence results under both algorithms in the case of a generator network with one hidden layer that is large enough and a linear discriminator.
SP:8a6de840ca758da3973655a8a478e83f8edde474
Hierarchical Autoregressive Modeling for Neural Video Compression
1 INTRODUCTION . Recent advances in deep generative modeling have seen a surge of applications , including learningbased compression . Generative models have already demonstrated empirical improvements in image compression , outperforming classical codecs ( Minnen et al. , 2018 ; Yang et al. , 2020d ) , such as BPG ( Bellard , 2014 ) . In contrast , the less developed area of neural video compression remains challenging due to complex temporal dependencies operating at multiple scales . Nevertheless , recent neural video codecs have shown promising performance gains ( Agustsson et al. , 2020 ) , in some cases on par with current hand-designed , classical codecs , e.g. , HEVC . Compared to hand-designed codecs , learnable codecs are not limited to specific data modality , and offer a promising approach for streaming specialized content , such as sports or video chats . Therefore , improving neural video compression is vital for dealing with the ever-growing amount of video content being created . Source compression fundamentally involves decorrelation , i.e. , transforming input data into white noise distributions that can be easily modeled and entropy-coded . Thus , improving a model ’ s capability to decorrelate data automatically improves its compression performance . Likewise , we can improve the associated entropy model ( i.e. , the model ’ s prior ) to capture any remaining dependencies . Just as compression techniques attempt to remove structure , generative models attempt to model structure . One family of models , autoregressive flows , maps between less structured distributions , e.g. , uncorrelated noise , and more structured distributions , e.g. , images or video ( Dinh et al. , 2014 ; 2016 ) . The inverse mapping can remove dependencies in the data , making it more amenable for compression . Thus , a natural question to ask is how autoregressive flows can best be utilized in compression , and if mechanisms in existing compression schemes can be interpreted as flows . This paper draws on recent insights in hierarchical sequential latent variable models with autoregressive flows ( Marino et al. , 2020 ) . In particular , we identify connections between this family of models and recent neural video codecs based on motion estimation ( Lu et al. , 2019 ; Agustsson et al. , 2020 ) . By interpreting this technique as an instantiation of a more general autoregressive flow transform , we propose various alternatives and improvements based on insights from generative modeling . In more detail , our main contributions are as follows : 1 . A new framework . We interpret existing video compression methods through the more general framework of generative modeling , variational inference , and autoregressive flows , allowing us to readily investigate extensions and ablations . In particular , we compare fully data-driven approaches with motion-estimation-based neural compression schemes , and consider a more expressive prior model for better entropy coding ( described in the second bullet point below ) . This framework also provides directions for future work . 2 . A new model . Following the predictive coding paradigm of video compression ( Wiegand et al. , 2003 ) , Scale-Space Flow ( SSF ) ( Agustsson et al. , 2020 ) uses motion estimation to predict the frame being compressed , and further compresses the residual obtained by subtraction . Our proposed model extends the SSF model with a more flexible decoder and prior , and improves over the state of the art in rate-distortion performance . Specifically , we • Incorporate a learnable scaling transform to allow for more expressive and accurate reconstruction . Augmenting a shift transform by scale-then-shift is inspired by improvements from extending NICE ( Dinh et al. , 2014 ) to RealNVP ( Dinh et al. , 2016 ) . • Introduce a structured prior over the two sets of latent variables in the generative model of SSF , corresponding to jointly encoding the motion information and residual information . As the two tend to be spatially correlated , encoding residual information conditioned on motion information results in a more informed prior , and thus better entropy model , for the residual information ; this cuts down the bit-rate for the latter that typically dominates the overall bit-rate . 3 . A new dataset . The neural video compression community currently lacks large , highresolution benchmark datasets . While we extensively experimented on the publicly available Vimeo-90k dataset ( Xue et al. , 2019 ) , we also collected and utilized a larger dataset , YouTube-NT1 , available through executable scripts . Since no training data was publicly released for the previous state-of-the-art method ( Agustsson et al. , 2020 ) , YouTube-NT would be a useful resource for making and comparing further progress in this field . 2 RELATED WORK . We divide related work into three categories : neural image compression , neural video compression , and sequential generative models . Neural Image Compression . Considerable progress has been made by applying neural networks to image compression . Early works proposed by Toderici et al . ( 2017 ) and Johnston et al . ( 2018 ) leveraged LSTMs to model spatial correlations of the pixels within an image . Theis et al . ( 2017 ) first proposed an autoencoder architecture for image compression and used the straight-through estimator ( Bengio et al. , 2013 ) for learning a discrete latent representation . The connection to probabilistic generative models was drawn by Ballé et al . ( 2017 ) , who firstly applied variational autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) to image compression . In subsequent work , Ballé et al . ( 2018 ) encoded images with a two-level VAE architecture involving a scale hyper-prior , which can be further improved by autoregressive structures ( Minnen et al. , 2018 ; Minnen & Singh , 2020 ) or by optimization at encoding time ( Yang et al. , 2020d ) . Yang et al . ( 2020e ) and Flamich et al . ( 2019 ) demonstrated competitive image compression performance without a pre-defined quantization grid . Neural Video Compression . Compared to image compression , video compression is a significantly more challenging problem , as statistical redundancies exist not only within each video frame ( exploited by intra-frame compression ) but also along the temporal dimension . Early works by Wu et al . ( 2018 ) ; Djelouah et al . ( 2019 ) and Han et al . ( 2019 ) performed video compression by predicting future frames using a recurrent neural network , whereas Chen et al . ( 2019 ) and Chen et al . ( 2017 ) used convolutional architectures within a traditional block-based motion estimation approach . These early approaches did not outperform the traditional H.264 codec and barely surpassed the MPEG-2 codec . Lu et al . ( 2019 ) adopted a hybrid architecture that combined a pre-trained Flownet ( Dosovitskiy et al. , 2015 ) and residual compression , which leads to an elaborate training scheme . Habibian et al . ( 2019 ) and Liu et al . ( 2020 ) combined 3D convolutions for dimensionality reduction with expressive autoregressive priors for better entropy modeling at the expense of parallelism and runtime efficiency . Our method extends a low-latency model proposed by Agustsson et al . ( 2020 ) , which allows for end-to-end training , efficient online encoding and decoding , and parallelism . 1https : //github.com/privateyoung/Youtube-NT Sequential Deep Generative Models . We drew inspiration from a body of work on sequential generative modeling . Early deep learning architectures for dynamics forecasting involved RNNs ( Chung et al. , 2015 ) . Denton & Fergus ( 2018 ) and Babaeizadeh et al . ( 2018 ) used VAE-based stochastic models in conjunction with LSTMs to model dynamics . Li & Mandt ( 2018 ) introduced both local and global latent variables for learning disentangled representations in videos . Other video generation models used generative adversarial networks ( GANs ) ( Vondrick et al. , 2016 ; Lee et al. , 2018 ) or autoregressive models and normalizing flows ( Rezende & Mohamed , 2015 ; Dinh et al. , 2014 ; 2016 ; Kingma & Dhariwal , 2018 ; Kingma et al. , 2016 ; Papamakarios et al. , 2017 ) . Recently , Marino et al . ( 2020 ) proposed to combine latent variable models with autoregressive flows for modeling dynamics at different levels of abstraction , which inspired our models and viewpoints . 3 VIDEO COMPRESSION THROUGH DEEP AUTOREGRESSIVE MODELING . We identify commonalities between hierarchical autoregressive flow models ( Marino et al. , 2020 ) and state-of-the-art neural video compression architectures ( Agustsson et al. , 2020 ) , and will use this viewpoint to propose improvements on existing models . 3.1 BACKGROUND . We first review VAE-based compression schemes ( Ballé et al. , 2017 ) and formulate existing lowlatency video codecs in this framework ; we then review the related autoregressive flow model . Generative Modeling and Source Compression . Given a a sequence of video frames x1 : T , lossy compression seeks a compact description of x1 : T that simultaneously minimizes the description length R and information loss D. The distortion D measures the reconstruction error caused by encoding x1 : T into a lossy representation z̄1 : T and subsequently decoding it back to x̂1 : T , while R measures the bit rate ( file size ) . In learned compression methods ( Ballé et al. , 2017 ; Theis et al. , 2017 ) , the above process is parameterized by flexible functions f ( “ encoder ” ) and g ( “ decoder ” ) that map between the video and its latent representation z̄1 : T = f ( x1 : T ) . The goal is to minimize a rate-distortion loss , with the tradeoff between the two controlled by a hyperparameter β > 0 : L = D ( x1 : T , g ( bz̄1 : T e ) ) + βR ( bz̄1 : T e ) . We adopt the end-to-end compression approach of Ballé et al . ( 2017 ) , which approximates the rounding operations b·e ( required for entropy coding ) by uniform noise injection to enable gradientbased optimization during training . With an appropriate choice of probability model p ( z1 : T ) , the relaxed version of above R-D ( rate-distortion ) objective then corresponds to the VAE objective : L̃ = Eq ( z1 : T |x1 : T ) [ − log p ( x1 : T |z1 : T ) − log p ( z1 : T ) ] . ( 1 ) In this model , the likelihood p ( x1 : T |z1 : T ) follows a Gaussian distribution with mean x̂1 : T = g ( z1 : T ) and diagonal covariance β2 log 2I , and the approximate posterior q is chosen to be a unit-width uniform distribution ( thus has zero differential entropy ) whose mean z̄1 : T is predicted by an amortized inference network f . The prior density p ( z1 : T ) interpolates its discretized version , so that it measures the code length of discretized z̄1 : T after entropy-coding . Low-Latency Sequential Compression We specialize Eq . 1 to make it suitable for low-latency video compression , widely used in both conventional and recent neural codecs ( Rippel et al. , 2019 ; Agustsson et al. , 2020 ) . To this end , we encode and decode individual frames xt in sequence . Given the ground truth current frame xt and the previously reconstructed frames x̂ < t , the encoder is restricted to be of the form z̄t = f ( xt , x̂ < t ) , and similarly the decoder computes reconstruction sequentially based on previous reconstructions and the current encoding , x̂t = g ( x̂ < t , bz̄te ) ) . Existing codecs usually condition on a single reconstructed frame , substituting x̂ < t by x̂t−1 in favor of efficiency . In the language of variational inference , the sequential encoder corresponds to a variational posterior of the form q ( zt|xt , z < t ) , i.e. , filtering , and the sequential decoder corresponds to the likelihood p ( xt|z≤t ) = N ( x̂t , β2 log 2I ) ; in both distributions , the probabilistic conditioning on z < t is based on the observation that x̂t−1 is a deterministic function of z < t , if we identify bz̄te with the random variable zt and unroll the recurrence x̂t = g ( x̂ < t , zt ) . As we show , all sequential compression approaches considered in this work follow this paradigm , and the form of the reconstruction transform x̂ determines the lowest hierarchy of the corresponding generative process of video x. Masked Autoregressive Flow ( MAF ) . As a final component in neural sequence modeling , we discuss MAF ( Papamakarios et al. , 2017 ) , which models the joint distribution of a sequence p ( x1 : T ) in terms of a simpler distribution of its underlying noise variables y1 : T through the following autoregressive transform and its inverse : xt = hµ ( x < t ) + hσ ( x < t ) yt ; ⇔ yt = xt−hµ ( x < t ) hσ ( x < t ) . ( 2 ) The noise variable yt usually comes from a standard normal distribution . While the forward MAF transforms a sequence of standard normal noises into a data sequence , the inverse flow “ whitens ” the data sequence and removes temporal correlations . Due to its invertible nature , MAF allows for exact likelihood computations , but as we will explain in Section 3.3 , we will not exploit this aspect in compression but rather draw on its expressiveness in modeling conditional likelihoods .
In this paper, the authors provide a new interpretation of existing video compression models. Their perspective is that a video decoder is a stochastic temporal autoregressive model with latent variables. The introduced latent variables could be either used for providing more expressive power for 1) motion estimation&compensation modeling and 2) residual noise modeling, which are two key components of traditional video codecs. The proposed method shows favorable results when the bitrate is higher than 0.12 bits per pixel on the public benchmarks.
SP:65e92cbe15e2f0237433a41149d1d68ded0cc51c
Hierarchical Autoregressive Modeling for Neural Video Compression
1 INTRODUCTION . Recent advances in deep generative modeling have seen a surge of applications , including learningbased compression . Generative models have already demonstrated empirical improvements in image compression , outperforming classical codecs ( Minnen et al. , 2018 ; Yang et al. , 2020d ) , such as BPG ( Bellard , 2014 ) . In contrast , the less developed area of neural video compression remains challenging due to complex temporal dependencies operating at multiple scales . Nevertheless , recent neural video codecs have shown promising performance gains ( Agustsson et al. , 2020 ) , in some cases on par with current hand-designed , classical codecs , e.g. , HEVC . Compared to hand-designed codecs , learnable codecs are not limited to specific data modality , and offer a promising approach for streaming specialized content , such as sports or video chats . Therefore , improving neural video compression is vital for dealing with the ever-growing amount of video content being created . Source compression fundamentally involves decorrelation , i.e. , transforming input data into white noise distributions that can be easily modeled and entropy-coded . Thus , improving a model ’ s capability to decorrelate data automatically improves its compression performance . Likewise , we can improve the associated entropy model ( i.e. , the model ’ s prior ) to capture any remaining dependencies . Just as compression techniques attempt to remove structure , generative models attempt to model structure . One family of models , autoregressive flows , maps between less structured distributions , e.g. , uncorrelated noise , and more structured distributions , e.g. , images or video ( Dinh et al. , 2014 ; 2016 ) . The inverse mapping can remove dependencies in the data , making it more amenable for compression . Thus , a natural question to ask is how autoregressive flows can best be utilized in compression , and if mechanisms in existing compression schemes can be interpreted as flows . This paper draws on recent insights in hierarchical sequential latent variable models with autoregressive flows ( Marino et al. , 2020 ) . In particular , we identify connections between this family of models and recent neural video codecs based on motion estimation ( Lu et al. , 2019 ; Agustsson et al. , 2020 ) . By interpreting this technique as an instantiation of a more general autoregressive flow transform , we propose various alternatives and improvements based on insights from generative modeling . In more detail , our main contributions are as follows : 1 . A new framework . We interpret existing video compression methods through the more general framework of generative modeling , variational inference , and autoregressive flows , allowing us to readily investigate extensions and ablations . In particular , we compare fully data-driven approaches with motion-estimation-based neural compression schemes , and consider a more expressive prior model for better entropy coding ( described in the second bullet point below ) . This framework also provides directions for future work . 2 . A new model . Following the predictive coding paradigm of video compression ( Wiegand et al. , 2003 ) , Scale-Space Flow ( SSF ) ( Agustsson et al. , 2020 ) uses motion estimation to predict the frame being compressed , and further compresses the residual obtained by subtraction . Our proposed model extends the SSF model with a more flexible decoder and prior , and improves over the state of the art in rate-distortion performance . Specifically , we • Incorporate a learnable scaling transform to allow for more expressive and accurate reconstruction . Augmenting a shift transform by scale-then-shift is inspired by improvements from extending NICE ( Dinh et al. , 2014 ) to RealNVP ( Dinh et al. , 2016 ) . • Introduce a structured prior over the two sets of latent variables in the generative model of SSF , corresponding to jointly encoding the motion information and residual information . As the two tend to be spatially correlated , encoding residual information conditioned on motion information results in a more informed prior , and thus better entropy model , for the residual information ; this cuts down the bit-rate for the latter that typically dominates the overall bit-rate . 3 . A new dataset . The neural video compression community currently lacks large , highresolution benchmark datasets . While we extensively experimented on the publicly available Vimeo-90k dataset ( Xue et al. , 2019 ) , we also collected and utilized a larger dataset , YouTube-NT1 , available through executable scripts . Since no training data was publicly released for the previous state-of-the-art method ( Agustsson et al. , 2020 ) , YouTube-NT would be a useful resource for making and comparing further progress in this field . 2 RELATED WORK . We divide related work into three categories : neural image compression , neural video compression , and sequential generative models . Neural Image Compression . Considerable progress has been made by applying neural networks to image compression . Early works proposed by Toderici et al . ( 2017 ) and Johnston et al . ( 2018 ) leveraged LSTMs to model spatial correlations of the pixels within an image . Theis et al . ( 2017 ) first proposed an autoencoder architecture for image compression and used the straight-through estimator ( Bengio et al. , 2013 ) for learning a discrete latent representation . The connection to probabilistic generative models was drawn by Ballé et al . ( 2017 ) , who firstly applied variational autoencoders ( VAEs ) ( Kingma & Welling , 2013 ) to image compression . In subsequent work , Ballé et al . ( 2018 ) encoded images with a two-level VAE architecture involving a scale hyper-prior , which can be further improved by autoregressive structures ( Minnen et al. , 2018 ; Minnen & Singh , 2020 ) or by optimization at encoding time ( Yang et al. , 2020d ) . Yang et al . ( 2020e ) and Flamich et al . ( 2019 ) demonstrated competitive image compression performance without a pre-defined quantization grid . Neural Video Compression . Compared to image compression , video compression is a significantly more challenging problem , as statistical redundancies exist not only within each video frame ( exploited by intra-frame compression ) but also along the temporal dimension . Early works by Wu et al . ( 2018 ) ; Djelouah et al . ( 2019 ) and Han et al . ( 2019 ) performed video compression by predicting future frames using a recurrent neural network , whereas Chen et al . ( 2019 ) and Chen et al . ( 2017 ) used convolutional architectures within a traditional block-based motion estimation approach . These early approaches did not outperform the traditional H.264 codec and barely surpassed the MPEG-2 codec . Lu et al . ( 2019 ) adopted a hybrid architecture that combined a pre-trained Flownet ( Dosovitskiy et al. , 2015 ) and residual compression , which leads to an elaborate training scheme . Habibian et al . ( 2019 ) and Liu et al . ( 2020 ) combined 3D convolutions for dimensionality reduction with expressive autoregressive priors for better entropy modeling at the expense of parallelism and runtime efficiency . Our method extends a low-latency model proposed by Agustsson et al . ( 2020 ) , which allows for end-to-end training , efficient online encoding and decoding , and parallelism . 1https : //github.com/privateyoung/Youtube-NT Sequential Deep Generative Models . We drew inspiration from a body of work on sequential generative modeling . Early deep learning architectures for dynamics forecasting involved RNNs ( Chung et al. , 2015 ) . Denton & Fergus ( 2018 ) and Babaeizadeh et al . ( 2018 ) used VAE-based stochastic models in conjunction with LSTMs to model dynamics . Li & Mandt ( 2018 ) introduced both local and global latent variables for learning disentangled representations in videos . Other video generation models used generative adversarial networks ( GANs ) ( Vondrick et al. , 2016 ; Lee et al. , 2018 ) or autoregressive models and normalizing flows ( Rezende & Mohamed , 2015 ; Dinh et al. , 2014 ; 2016 ; Kingma & Dhariwal , 2018 ; Kingma et al. , 2016 ; Papamakarios et al. , 2017 ) . Recently , Marino et al . ( 2020 ) proposed to combine latent variable models with autoregressive flows for modeling dynamics at different levels of abstraction , which inspired our models and viewpoints . 3 VIDEO COMPRESSION THROUGH DEEP AUTOREGRESSIVE MODELING . We identify commonalities between hierarchical autoregressive flow models ( Marino et al. , 2020 ) and state-of-the-art neural video compression architectures ( Agustsson et al. , 2020 ) , and will use this viewpoint to propose improvements on existing models . 3.1 BACKGROUND . We first review VAE-based compression schemes ( Ballé et al. , 2017 ) and formulate existing lowlatency video codecs in this framework ; we then review the related autoregressive flow model . Generative Modeling and Source Compression . Given a a sequence of video frames x1 : T , lossy compression seeks a compact description of x1 : T that simultaneously minimizes the description length R and information loss D. The distortion D measures the reconstruction error caused by encoding x1 : T into a lossy representation z̄1 : T and subsequently decoding it back to x̂1 : T , while R measures the bit rate ( file size ) . In learned compression methods ( Ballé et al. , 2017 ; Theis et al. , 2017 ) , the above process is parameterized by flexible functions f ( “ encoder ” ) and g ( “ decoder ” ) that map between the video and its latent representation z̄1 : T = f ( x1 : T ) . The goal is to minimize a rate-distortion loss , with the tradeoff between the two controlled by a hyperparameter β > 0 : L = D ( x1 : T , g ( bz̄1 : T e ) ) + βR ( bz̄1 : T e ) . We adopt the end-to-end compression approach of Ballé et al . ( 2017 ) , which approximates the rounding operations b·e ( required for entropy coding ) by uniform noise injection to enable gradientbased optimization during training . With an appropriate choice of probability model p ( z1 : T ) , the relaxed version of above R-D ( rate-distortion ) objective then corresponds to the VAE objective : L̃ = Eq ( z1 : T |x1 : T ) [ − log p ( x1 : T |z1 : T ) − log p ( z1 : T ) ] . ( 1 ) In this model , the likelihood p ( x1 : T |z1 : T ) follows a Gaussian distribution with mean x̂1 : T = g ( z1 : T ) and diagonal covariance β2 log 2I , and the approximate posterior q is chosen to be a unit-width uniform distribution ( thus has zero differential entropy ) whose mean z̄1 : T is predicted by an amortized inference network f . The prior density p ( z1 : T ) interpolates its discretized version , so that it measures the code length of discretized z̄1 : T after entropy-coding . Low-Latency Sequential Compression We specialize Eq . 1 to make it suitable for low-latency video compression , widely used in both conventional and recent neural codecs ( Rippel et al. , 2019 ; Agustsson et al. , 2020 ) . To this end , we encode and decode individual frames xt in sequence . Given the ground truth current frame xt and the previously reconstructed frames x̂ < t , the encoder is restricted to be of the form z̄t = f ( xt , x̂ < t ) , and similarly the decoder computes reconstruction sequentially based on previous reconstructions and the current encoding , x̂t = g ( x̂ < t , bz̄te ) ) . Existing codecs usually condition on a single reconstructed frame , substituting x̂ < t by x̂t−1 in favor of efficiency . In the language of variational inference , the sequential encoder corresponds to a variational posterior of the form q ( zt|xt , z < t ) , i.e. , filtering , and the sequential decoder corresponds to the likelihood p ( xt|z≤t ) = N ( x̂t , β2 log 2I ) ; in both distributions , the probabilistic conditioning on z < t is based on the observation that x̂t−1 is a deterministic function of z < t , if we identify bz̄te with the random variable zt and unroll the recurrence x̂t = g ( x̂ < t , zt ) . As we show , all sequential compression approaches considered in this work follow this paradigm , and the form of the reconstruction transform x̂ determines the lowest hierarchy of the corresponding generative process of video x. Masked Autoregressive Flow ( MAF ) . As a final component in neural sequence modeling , we discuss MAF ( Papamakarios et al. , 2017 ) , which models the joint distribution of a sequence p ( x1 : T ) in terms of a simpler distribution of its underlying noise variables y1 : T through the following autoregressive transform and its inverse : xt = hµ ( x < t ) + hσ ( x < t ) yt ; ⇔ yt = xt−hµ ( x < t ) hσ ( x < t ) . ( 2 ) The noise variable yt usually comes from a standard normal distribution . While the forward MAF transforms a sequence of standard normal noises into a data sequence , the inverse flow “ whitens ” the data sequence and removes temporal correlations . Due to its invertible nature , MAF allows for exact likelihood computations , but as we will explain in Section 3.3 , we will not exploit this aspect in compression but rather draw on its expressiveness in modeling conditional likelihoods .
In this paper, the authors focus on the problem of lossy video compression. To this end they propose the application of latent variable sequential generative models, specifically autoregressive flows to compress video streams. They evaluate variations of these models quantitatively including their own proposed version of scale space flow. They also introduce a new dataset named Youtube-NT and show promising quantitative performance.
SP:65e92cbe15e2f0237433a41149d1d68ded0cc51c
Free Lunch for Few-shot Learning: Distribution Calibration
1 INTRODUCTION Table 1 : The class mean similarity ( “ mean sim ” ) and class variance similarity ( “ var sim ” ) between Arctic fox and different classes . Arctic fox mean sim var sim white wolf 97 % 97 % malamute 85 % 78 % lion 81 % 70 % meerkat 78 % 70 % jellyfish 46 % 26 % orange 40 % 19 % beer bottle 34 % 11 % Learning from a limited number of training samples has drawn increasing attention due to the high cost of collecting and annotating a large amount of data . Researchers have developed algorithms to improve the performance of models that have been trained with very few data . Finn et al . ( 2017 ) ; Snell et al . ( 2017 ) train models in a meta-learning fashion so that the model can adapt quickly on tasks with only a few training samples available . Hariharan & Girshick ( 2017 ) ; Wang et al . ( 2018 ) try to synthesize data or features by learning a generative model to alleviate the data insufficiency problem . Ren et al . ( 2018 ) propose to leverage unlabeled data and predict pseudo labels to improve the performance of fewshot learning . While most previous works focus on developing stronger models , scant attention has been paid to the property of the data itself . It is natural that when the number of data grows , the ground truth distribution can be more accurately uncovered . Models trained with a wide coverage of data can generalize well during evaluation . On the other hand , when training a model with only a few training data , the model tends to overfit on these few samples by minimizing the training loss over these samples . These phenomena are illustrated in Figure 1 . This biased distribution based on a few examples can damage the generalization ability of the model since it is far from mirroring the ground truth distribution from which test cases are sampled during evaluation . ∗Corresponding author . Here , we consider calibrating this biased distribution into a more accurate approximation of the ground truth distribution . In this way , a model trained with inputs sampled from the calibrated distribution can generalize over a broader range of data from a more accurate distribution rather than only fitting itself to those few samples . Instead of calibrating the distribution of the original data space , we try to calibrate the distribution in the feature space , which has much lower dimensions and is easier to calibrate ( Xian et al . ( 2018 ) ) . We assume every dimension in the feature vectors follows a Gaussian distribution and observe that similar classes usually have similar mean and variance of the feature representations , as shown in Table 1 . Thus , the mean and variance of the Gaussian distribution can be transferred across similar classes ( Salakhutdinov et al . ( 2012 ) ) . Meanwhile , the statistics can be estimated more accurately when there are adequate samples for this class . Based on these observations , we reuse the statistics from many-shot classes and transfer them to better estimate the distribution of the few-shot classes according to their class similarity . More samples can be generated according to the estimated distribution which provides sufficient supervision for training the classification model . In the experiments , we show that a simple logistic regression classifier trained with our strategy can achieve state-of-the-art accuracy on three datasets . Our distribution calibration strategy can be paired with any classifier and feature extractor with no extra learnable parameters . Training with samples selected from the calibrated distribution can achieve 12 % accuracy gain compared to the baseline which is only trained with the few samples given in a 5way1shot task . We also visualize the calibrated distribution and show that it is an accurate approximation of the ground truth that can better cover the test cases . 2 RELATED WORKS . Few-shot classification is a challenging machine learning problem and researchers have explored the idea of learning to learn or meta-learning to improve the quick adaptation ability to alleviate the few-shot challenge . One of the most general algorithms for meta-learning is the optimizationbased algorithm . Finn et al . ( 2017 ) and Li et al . ( 2017 ) proposed to learn how to optimize the gradient descent procedure so that the learner can have a good initialization , update direction , and learning rate . For the classification problem , researchers proposed simple but effective algorithms based on metric learning . MatchingNet ( Vinyals et al. , 2016 ) and ProtoNet ( Snell et al. , 2017 ) learned to classify samples by comparing the distance to the representatives of each class . Our distribution calibration and feature sampling procedure does not include any learnable parameters and the classifier is trained in a traditional supervised learning way . Another line of algorithms is to compensate for the insufficient number of available samples by generation . Most methods use the idea of Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) or autoencoder ( Rumelhart et al. , 1986 ) to generate samples ( Zhang et al . ( 2018 ) ; Chen et al . ( 2019b ) ; Schwartz et al . ( 2018 ) ; Gao et al . ( 2018 ) ) or features ( Xian et al . ( 2018 ) ; Zhang et al . ( 2019 ) ) to augment the training set . Specifically , Zhang et al . ( 2018 ) and Xian et al . ( 2018 ) proposed to synthesize data by introducing an adversarial generator conditioned on tasks . Zhang et al . ( 2019 ) tried to learn a variational autoencoder to approximate the distribution and predict labels based on the estimated statistics . The autoencoder can also augment samples by projecting between the visual space and the semantic space ( Chen et al. , 2019b ) or encoding the intra-class deformations ( Schwartz et al. , 2018 ) . Liu et al . ( 2019b ) and Liu et al . ( 2019a ) propose to generate features through the class hierarchy . While these methods can generate extra samples or features for training , they require the design of a complex model and loss function to learn how to generate . However , our distribution calibration strategy is simple and does not need extra learnable parameters . Data augmentation is a traditional and effective way of increasing the number of training samples . Qin et al . ( 2020 ) and Antoniou & Storkey ( 2019 ) proposed the used of the traditional data augmentation technique to construct pretext tasks for unsupervised few-shot learning . Wang et al . ( 2018 ) and Hariharan & Girshick ( 2017 ) leveraged the general idea of data augmentation , they designed a hallucination model to generate the augmented version of the image with different choices for the model ’ s input , i.e. , an image and a noise ( Wang et al. , 2018 ) or the concatenation of multiple features ( Hariharan & Girshick , 2017 ) . Park et al . ( 2020 ) ; Wang et al . ( 2019 ) ; Liu et al . ( 2020b ) tried to augment feature representations by leveraging intra-class variance . These methods learn to augment from the original samples or their feature representation while we try to estimate the classlevel distribution and thus can eliminate the inductive bias from a single sample and provide more diverse generations from the calibrated distribution . 3 MAIN APPROACH . In this section , we introduce the few-shot classification problem definition in Section 3.1 and details of our proposed approach in Section 3.2 . 3.1 PROBLEM DEFINITION . We follow a typical few-shot classification setting . Given a dataset with data-label pairs D = { ( xi , yi ) } where xi ∈ Rd is the feature vector of a sample and yi ∈ C , where C denotes the set of classes . This set of classes is divided into base classes Cb and novel classes Cn , where Cb∩Cn = ∅ and Cb ∪ Cn = C. The goal is to train a model on the data from the base classes so that the model can generalize well on tasks sampled from the novel classes . In order to evaluate the fast adaptation ability or the generalization ability of the model , there are only a few available labeled samples for each task T . The most common way to build a task is called an N-way-K-shot task ( Vinyals et al . ( 2016 ) ) , where N classes are sampled from the novel set and only K ( e.g. , 1 or 5 ) labeled samples are provided for each class . The few available labeled data are called support set S = { ( xi , yi ) } N×Ki=1 and the model is evaluated on another query setQ = { ( xi , yi ) } N×K+N×qi=N×K+1 , where every class in the task has q test cases . Thus , the performance of a model is evaluated as the averaged accuracy on ( the query set of ) multiple tasks sampled from the novel classes . 3.2 DISTRIBUTION CALIBRATION . As introduced in Section 3.1 , the base classes have a sufficient amount of data while the evaluation tasks sampled from the novel classes only have a limited number of labeled samples . The statistics of the distribution for the base class can be estimated more accurately compared to the estimation based on few-shot samples , which is an ill-posed problem . As shown in Table 1 , we observe that if we assume the feature distribution is Gaussian , the mean and variance with respect to each class are correlated to the semantic similarity of each class . With this in mind , the statistics can be transferred from the base classes to the novel classes if we learn how similar the two classes are . In the following sections , we discuss how we calibrate the distribution estimation of the classes with only a few samples ( Section 3.2.2 ) with the help of the statistics of the base classes ( Section 3.2.1 ) . We will also elaborate on how do we leverage the calibrated distribution to improve the performance of few-shot learning ( Section 3.2.3 ) . Note that our distribution calibration strategy is over the feature-level and is agnostic to any feature extractor . Thus , it can be built on top of any pretrained feature extractors without further costly finetuning . In our experiments , we use the pretrained WideResNet Zagoruyko & Komodakis ( 2016 ) following previous work ( Mangla et al . ( 2020 ) ) . The WideResNet is trained to classify the base classes , along with a self-supervised pretext task to learn the general-purpose representations suitable for image understanding tasks . Please refer to their paper for more details on training the feature extractor . Algorithm 1 Training procedure for an N-way-K-shot task Require : Support set features S = ( xi , y ) N×Ki=1 Require : Base classes ’ statistics { µi } |Cb|i=1 , { Σi } |Cb| i=1 1 : Transform ( xi ) N×Ki=1 with Tukey ’ s Ladder of Powers as Equation 3 2 : for ( xi , yi ) ∈ S do 3 : Calibrate the mean µ′ and the covariance Σ′ for class yi using xi with Equation 6 4 : Sample features for class yi from the calibrated distribution as Equation 7 5 : end for 6 : Train a classifier using both support set features and all sampled features as Equation 8
The paper proposes a method to calibrate the underlying distribution of a few samples in the few-shot classification scenario. The idea is to estimate a feature distribution of a few samples of a novel class from base class distributions. The authors assume that every dimension in the feature vector follows a Gaussian distribution. Based on the observation that the mean and variance of the distribution with respect to each class are correlated to the semantic similarity of each class, base class distribution can be transferred to the novel class distribution. After distribution calibration, features can be generated from the calibrated distribution and the generated features are used to train classifiers. SVM and logistic regression classifier are used to verify the approach on the mini-imagenet and CUB datasets.
SP:98a52d7970d0d39f8e14f6b5679f8383a3f0e8b1
Free Lunch for Few-shot Learning: Distribution Calibration
1 INTRODUCTION Table 1 : The class mean similarity ( “ mean sim ” ) and class variance similarity ( “ var sim ” ) between Arctic fox and different classes . Arctic fox mean sim var sim white wolf 97 % 97 % malamute 85 % 78 % lion 81 % 70 % meerkat 78 % 70 % jellyfish 46 % 26 % orange 40 % 19 % beer bottle 34 % 11 % Learning from a limited number of training samples has drawn increasing attention due to the high cost of collecting and annotating a large amount of data . Researchers have developed algorithms to improve the performance of models that have been trained with very few data . Finn et al . ( 2017 ) ; Snell et al . ( 2017 ) train models in a meta-learning fashion so that the model can adapt quickly on tasks with only a few training samples available . Hariharan & Girshick ( 2017 ) ; Wang et al . ( 2018 ) try to synthesize data or features by learning a generative model to alleviate the data insufficiency problem . Ren et al . ( 2018 ) propose to leverage unlabeled data and predict pseudo labels to improve the performance of fewshot learning . While most previous works focus on developing stronger models , scant attention has been paid to the property of the data itself . It is natural that when the number of data grows , the ground truth distribution can be more accurately uncovered . Models trained with a wide coverage of data can generalize well during evaluation . On the other hand , when training a model with only a few training data , the model tends to overfit on these few samples by minimizing the training loss over these samples . These phenomena are illustrated in Figure 1 . This biased distribution based on a few examples can damage the generalization ability of the model since it is far from mirroring the ground truth distribution from which test cases are sampled during evaluation . ∗Corresponding author . Here , we consider calibrating this biased distribution into a more accurate approximation of the ground truth distribution . In this way , a model trained with inputs sampled from the calibrated distribution can generalize over a broader range of data from a more accurate distribution rather than only fitting itself to those few samples . Instead of calibrating the distribution of the original data space , we try to calibrate the distribution in the feature space , which has much lower dimensions and is easier to calibrate ( Xian et al . ( 2018 ) ) . We assume every dimension in the feature vectors follows a Gaussian distribution and observe that similar classes usually have similar mean and variance of the feature representations , as shown in Table 1 . Thus , the mean and variance of the Gaussian distribution can be transferred across similar classes ( Salakhutdinov et al . ( 2012 ) ) . Meanwhile , the statistics can be estimated more accurately when there are adequate samples for this class . Based on these observations , we reuse the statistics from many-shot classes and transfer them to better estimate the distribution of the few-shot classes according to their class similarity . More samples can be generated according to the estimated distribution which provides sufficient supervision for training the classification model . In the experiments , we show that a simple logistic regression classifier trained with our strategy can achieve state-of-the-art accuracy on three datasets . Our distribution calibration strategy can be paired with any classifier and feature extractor with no extra learnable parameters . Training with samples selected from the calibrated distribution can achieve 12 % accuracy gain compared to the baseline which is only trained with the few samples given in a 5way1shot task . We also visualize the calibrated distribution and show that it is an accurate approximation of the ground truth that can better cover the test cases . 2 RELATED WORKS . Few-shot classification is a challenging machine learning problem and researchers have explored the idea of learning to learn or meta-learning to improve the quick adaptation ability to alleviate the few-shot challenge . One of the most general algorithms for meta-learning is the optimizationbased algorithm . Finn et al . ( 2017 ) and Li et al . ( 2017 ) proposed to learn how to optimize the gradient descent procedure so that the learner can have a good initialization , update direction , and learning rate . For the classification problem , researchers proposed simple but effective algorithms based on metric learning . MatchingNet ( Vinyals et al. , 2016 ) and ProtoNet ( Snell et al. , 2017 ) learned to classify samples by comparing the distance to the representatives of each class . Our distribution calibration and feature sampling procedure does not include any learnable parameters and the classifier is trained in a traditional supervised learning way . Another line of algorithms is to compensate for the insufficient number of available samples by generation . Most methods use the idea of Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) or autoencoder ( Rumelhart et al. , 1986 ) to generate samples ( Zhang et al . ( 2018 ) ; Chen et al . ( 2019b ) ; Schwartz et al . ( 2018 ) ; Gao et al . ( 2018 ) ) or features ( Xian et al . ( 2018 ) ; Zhang et al . ( 2019 ) ) to augment the training set . Specifically , Zhang et al . ( 2018 ) and Xian et al . ( 2018 ) proposed to synthesize data by introducing an adversarial generator conditioned on tasks . Zhang et al . ( 2019 ) tried to learn a variational autoencoder to approximate the distribution and predict labels based on the estimated statistics . The autoencoder can also augment samples by projecting between the visual space and the semantic space ( Chen et al. , 2019b ) or encoding the intra-class deformations ( Schwartz et al. , 2018 ) . Liu et al . ( 2019b ) and Liu et al . ( 2019a ) propose to generate features through the class hierarchy . While these methods can generate extra samples or features for training , they require the design of a complex model and loss function to learn how to generate . However , our distribution calibration strategy is simple and does not need extra learnable parameters . Data augmentation is a traditional and effective way of increasing the number of training samples . Qin et al . ( 2020 ) and Antoniou & Storkey ( 2019 ) proposed the used of the traditional data augmentation technique to construct pretext tasks for unsupervised few-shot learning . Wang et al . ( 2018 ) and Hariharan & Girshick ( 2017 ) leveraged the general idea of data augmentation , they designed a hallucination model to generate the augmented version of the image with different choices for the model ’ s input , i.e. , an image and a noise ( Wang et al. , 2018 ) or the concatenation of multiple features ( Hariharan & Girshick , 2017 ) . Park et al . ( 2020 ) ; Wang et al . ( 2019 ) ; Liu et al . ( 2020b ) tried to augment feature representations by leveraging intra-class variance . These methods learn to augment from the original samples or their feature representation while we try to estimate the classlevel distribution and thus can eliminate the inductive bias from a single sample and provide more diverse generations from the calibrated distribution . 3 MAIN APPROACH . In this section , we introduce the few-shot classification problem definition in Section 3.1 and details of our proposed approach in Section 3.2 . 3.1 PROBLEM DEFINITION . We follow a typical few-shot classification setting . Given a dataset with data-label pairs D = { ( xi , yi ) } where xi ∈ Rd is the feature vector of a sample and yi ∈ C , where C denotes the set of classes . This set of classes is divided into base classes Cb and novel classes Cn , where Cb∩Cn = ∅ and Cb ∪ Cn = C. The goal is to train a model on the data from the base classes so that the model can generalize well on tasks sampled from the novel classes . In order to evaluate the fast adaptation ability or the generalization ability of the model , there are only a few available labeled samples for each task T . The most common way to build a task is called an N-way-K-shot task ( Vinyals et al . ( 2016 ) ) , where N classes are sampled from the novel set and only K ( e.g. , 1 or 5 ) labeled samples are provided for each class . The few available labeled data are called support set S = { ( xi , yi ) } N×Ki=1 and the model is evaluated on another query setQ = { ( xi , yi ) } N×K+N×qi=N×K+1 , where every class in the task has q test cases . Thus , the performance of a model is evaluated as the averaged accuracy on ( the query set of ) multiple tasks sampled from the novel classes . 3.2 DISTRIBUTION CALIBRATION . As introduced in Section 3.1 , the base classes have a sufficient amount of data while the evaluation tasks sampled from the novel classes only have a limited number of labeled samples . The statistics of the distribution for the base class can be estimated more accurately compared to the estimation based on few-shot samples , which is an ill-posed problem . As shown in Table 1 , we observe that if we assume the feature distribution is Gaussian , the mean and variance with respect to each class are correlated to the semantic similarity of each class . With this in mind , the statistics can be transferred from the base classes to the novel classes if we learn how similar the two classes are . In the following sections , we discuss how we calibrate the distribution estimation of the classes with only a few samples ( Section 3.2.2 ) with the help of the statistics of the base classes ( Section 3.2.1 ) . We will also elaborate on how do we leverage the calibrated distribution to improve the performance of few-shot learning ( Section 3.2.3 ) . Note that our distribution calibration strategy is over the feature-level and is agnostic to any feature extractor . Thus , it can be built on top of any pretrained feature extractors without further costly finetuning . In our experiments , we use the pretrained WideResNet Zagoruyko & Komodakis ( 2016 ) following previous work ( Mangla et al . ( 2020 ) ) . The WideResNet is trained to classify the base classes , along with a self-supervised pretext task to learn the general-purpose representations suitable for image understanding tasks . Please refer to their paper for more details on training the feature extractor . Algorithm 1 Training procedure for an N-way-K-shot task Require : Support set features S = ( xi , y ) N×Ki=1 Require : Base classes ’ statistics { µi } |Cb|i=1 , { Σi } |Cb| i=1 1 : Transform ( xi ) N×Ki=1 with Tukey ’ s Ladder of Powers as Equation 3 2 : for ( xi , yi ) ∈ S do 3 : Calibrate the mean µ′ and the covariance Σ′ for class yi using xi with Equation 6 4 : Sample features for class yi from the calibrated distribution as Equation 7 5 : end for 6 : Train a classifier using both support set features and all sampled features as Equation 8
This paper identifies the problem of biased distributions in few-shot learning and proposes to fix it. In few-shot learning, only a few samples per class are available; this makes estimating the class distribution difficult. The paper proposes a distribution calibration algorithm that makes use of the meta-train class distributions to calibrate the few-shot class distributions. Once calibrated, more samples are drawn from this distribution to learn a classifier that generalizes better. This approach does not require additional learnable parameters and can be (potentially) built on-top of any pre-trained feature extractor. Empirical results show that this approach achieves state-of-the-art results on Mini-ImageNet and CUB.
SP:98a52d7970d0d39f8e14f6b5679f8383a3f0e8b1
TOWARDS NATURAL ROBUSTNESS AGAINST ADVERSARIAL EXAMPLES
1 INTRODUCTION . Deep neural networks have made great progress in numerous domains of machine learning , especially in computer vision . But Szegedy et al . ( 2013 ) found that most of the existing state-of-theart neural networks are easily fooled by adversarial examples that generated by putting only very small perturbations to the input images . Since realizing the unstability of deep neural networks , researchers have proposed different kinds of methods to defense adversarial examples , such as adversarial training ( Goodfellow et al. , 2014 ) , data compression ( Dziugaite et al. , 2016 ) , and distillation defense ( Papernot et al. , 2016 ) . But each of these methods is a remedy for the original problem , and none of these methods can solve it fundamentally . For example , Moosavi-Dezfooli et al . ( 2016 ) showed that no matter how much adversarial examples are added to training sets , there are new adversarial examples that can successfully attack the adversarial trained deep neural network . So , avoiding adversarial examples technically can not solve the most essential problem : why such subtle change in adversarial examples can beat deep neural networks ? Meanwhile , it leads to a more important question : how to make deep neural networks have natural robustness so that they can get rid of malicious adversarial examples . Early explanations for adversarial examples considered that a smoothness prior is typically valid for kernel methods that imperceptibly tiny perturbations of a given image do not normally change the underlying class , while the smoothness assumption does not hold for deep neural networks due to its high non-linearity ( Szegedy et al. , 2013 ) . This analysis underlies plain deep neural networks like AlexNet ( Krizhevsky et al. , 2012 ) . But later than that , Goodfellow et al . ( 2014 ) claim adversarial examples are a result of models being too linear rather than too non-linear , they can be explained as a property of high-dimensional dot products . Unfortunately , both of these explanations seem to imply that adversarial examples are inevitable for deep neural networks . On the other hand , we notice that skip connections are widely used in current deep neural networks after the appearance of Highway Network ( Srivastava et al. , 2015 ) and ResNet ( He et al. , 2016 ) . It turns out that the identity mapping in ResNet is formally equivalent to one step of Euler ’ s method which has been used to solve ordinary differential equations ( Weinan , 2017 ) . More than that , other kinds of skip connections used by different network architectures can be considered as different numerical methods for solving ordinary differential equations . The link between numerical ordinary differential equations with deep neural networks can bring us a whole new perspective to explain adversarial examples through the numerical stability analysis . In this paper , we attempt to utilize the natural property of neural networks to defense adversarial examples . We first analyze how adversarial examples affect the output of neural networks with identity mappings , obtain an upper bound for this kind of neural networks , and find that this upper bound is impractical in actual computations . In the same way , we figure out why adversarial examples can fool commonly used deep neural networks with skip connections . Then , we demonstrate that Neural ODEs hold a weaker upper bound and verify the natural robustness of Neural ODEs under four types of perturbations . Finally , we compare Neural ODEs with three types of adversarial training methods to show that the natural robustness of Neural ODEs is better than the robustness of neural networks that are trained with adversarial training . The main contributions of our work are as follows : • We introduce and formalize the numerical stability analysis for deep neural networks with identity mappings , prove that there is an upper bound for neural networks with identity mappings to constrain the error caused by adversarial noises . • We provide a new reason why commonly used deep neural networks with skip connections can not resist adversarial examples . • We demonstrate that Neural ODEs hold a weaker upper bound which limits the amount of change in the result from being too large . Compare with ResNet and three types of adversarial training methods , we show the natural robustness of Neural ODEs . 2 RELATED WORKS . 2.1 ADVERSARIAL DEFENSE . Adversarial training typically uses a robust optimization to generate adversarial examples for training deep neural networks . Madry et al . ( 2017 ) take the optimization as a saddle point problem . Zhang et al . ( 2019a ) cast adversarial training as a discrete time differential game . Adversarial training can be seen as a data augmentation particularly enhance the robustness to white-box attacks ( Tramèr et al. , 2017 ) . Zantedeschi et al . ( 2017 ) augmented the training sets with examples perturbed using Gaussian noises which can also enhance the robustness to black-box attacks . Lee et al . ( 2017 ) proposed a novel adversarial training method using a generative adversarial network framework . Besides , Finlay et al . ( 2018 ) augmented adversarial training with worst case adversarial training which improves adversarial robustness in the ` 2 norm on CIFAR10 . Modifying the neural networks by using auto encoders , input gradient regularization and distillation can result in robustness against adversarial attacks ( Bai et al. , 2017 ; Ross & Doshi-Velez , 2017 ; Papernot et al. , 2016 ) . Besides , there are some biologically inspired deep learning models designed to have natural robustness against adversarial examples . Nayebi & Ganguli ( 2017 ) developed a scheme similar to nonlinear dendritic computation to train deep neural networks to make them robust to adversarial attacks . Krotov & Hopfield ( 2018 ) proposed Dense Associative Memory ( DAM ) models and suggested that DAM with higher order energy functions are closer to human visual perception than deep neural networks with ReLUs . In addition to augmenting datasets or modifying original neural networks , there exist adversarial defense methods that rely on using external models and detecting adversarial examples . Akhtar et al . ( 2018 ) presented Perturbation Rectifying Network ( PRN ) as ‘ pre-input ’ layers to a targeted model , if a perturbation is detected , the output of the PRN is used for label prediction instead of the actual image . Xu et al . ( 2017 ) proposed a strategy called feature squeezing to reduce the search space available to an adversary by coalescing samples that correspond to many different feature vectors in the original space into a single sample . 3 NUMERICAL STABILITY ANALYSIS FOR DNNS . 3.1 RESNET AND EULER ’ S METHOD . The building block of ResNet is defined as yn+1 = yn + f ( yn ; θn ) ( 1 ) Where n ∈ { 0 ... N ( h ) − 1 } , yn and yn+1 are input and output vectors of the layers considered . The function f ( yn ; θn ) represents the residual mapping and θn are weights to be learned . In numerical methods for solving ordinary differential equations , Euler ’ s method is defined by taking this to be exact : yn+1 = yn + hf ( tn , yn ; θn ) ( 2 ) It can be easily seen that Eqn . ( 1 ) is a special case of Euler ’ s method when the step size h = 1 . The iterative updates of ResNet can be seen as an Euler discretization of a continuous transformation ( Lu et al. , 2018 ; Haber & Ruthotto , 2017 ; Ruthotto & Haber , 2019 ) . When the input data is perturbed by adversarial noises , we denote the adversarial example by z0 = y0 + ( 3 ) To perform stability analysis for ResNet with adversarial example z0 as input , we define a numerical solution zn by zn+1 = zn + hf ( tn , zn ; θn ) ( 4 ) and provide following theorem to show that the amount of change between yn and zn holds an upper bound by some assumptions . Theorem 3.1 . Let f ( t , y ; θ ) be a continuous function for t0 ≤ t ≤ b and −∞ < y < ∞ , and further assume that f ( t , y ; θ ) satisfies the Lipschitz condition . Then compare the two numerical solutions yn and zn as h → 0 , there is a constant c ≥ 0 , such that amount of change between yn and zn satisfies max 0≤n≤N ( h ) |zn − yn| ≤ c| | ( 5 ) Proof . Let en = zn − yn , n ≥ 0 . Then e0 = , and subtracting Eqn . ( 2 ) from Eqn . ( 4 ) , we obtain en+1 = en + h [ f ( tn , zn ; θn ) − f ( tn , yn ; θn ) ] ( 6 ) Assume that the derivative function f ( t , y ; θ ) satisfied the following Lipschitz condition : there exists K ≥ 0 such that |f ( t , y1 ; θ ) − f ( t , y2 ; θ ) | ≤ K|y1 − y2| ( 7 ) Taking bounds using Eqn . ( 7 ) , we obtain |en+1| ≤ |en|+ hK̂|zn − yn| ( 8 ) |en+1| ≤ ( 1 + hK̂ ) |en| ( 9 ) where K̂ is the largest Lipschitz constant . Apply this recursively to obtain |en| ≤ ( 1 + hK̂ ) n|e0| ( 10 ) Using the inequality ( 1 + t ) m ≤ emt , for any t ≥ −1 , any m ≥ 0 , we obtain ( 1 + hK ) n ≤ enhK̂ = e ( b−t0 ) K̂ ( 11 ) and this implies the main result Eqn. ( 5 ) . Roughly speaking , theorem 3.1 means that a small adversarial perturbation initial value of the problem leads to a small change in the solution , provided that the function f ( t , y ; θ ) is continuous and the step size h is sufficiently small . Obviously , ResNet does not satisfied the assumption of continuity and its step size h always equal to 1 . Particularly , the functions f ( t , y ; θ ) in ResNet are composite function which contains ReLU activation functions . Although ReLU activation functions g ( x ) = max ( 0 , x ) break the continuity , due to their contractive property , i.e . satisfies ‖g ( x ) − g ( x+ ) ‖ ≤ | | for all x , ; it follows that ‖gn ( x ; θn ) − gn ( x+ ; θn ) ‖ = ‖max ( 0 , θnx+ bn ) −max ( 0 , θn ( x+ ) + bn ) ) ‖ ≤ ‖θn ‖ ≤ ‖θn‖‖ || ( 12 ) This provides a weaker upper bound for ReLU to mitigate the loss of continuity . Even if the step size h in ResNet can be adjusted by multiply outputs of convolution layers by a chosen constant , but unfortunately , the step size h in ResNet can not be too small since a very small step size decreases the efficiency in actual computations . We can experimentally show that when step size h is small ( such as 10−1 , 10−2 and 10−3 ) , ResNet has no obvious robustness against adversarial examples , and when step size is very small ( such as 10−8 , 10−9 , 10−10 ) , ResNet is difficult to train , so not only the classification accuracy of adversarial examples but also the accuracy of clean examples is quite low . To summarize , the main reason for ResNet ’ s failure in adversarial examples is the step size h = 1 destroys the upper bound given by Eqn . ( 5 ) and we can not find a proper way to deal with it . Thus , when the input of ResNet is perturbed by adversarial noises , the amount of change in the result will become unpredictably large so that ResNet can no longer correctly classify the input .
This paper offers an interesting viewpoint of adversarial robustness by comparing neural networks with skip connections such as ResNet with their Neural ODE counterparts. The authors analyze the different behaviors of the networks through their Lipschitz constants. They also try to support their claims that Neural ODEs are more robust due to their continuity (small step sizes) through experiments.
SP:5e3798130b00275f58f296666d614d56147ec57a
TOWARDS NATURAL ROBUSTNESS AGAINST ADVERSARIAL EXAMPLES
1 INTRODUCTION . Deep neural networks have made great progress in numerous domains of machine learning , especially in computer vision . But Szegedy et al . ( 2013 ) found that most of the existing state-of-theart neural networks are easily fooled by adversarial examples that generated by putting only very small perturbations to the input images . Since realizing the unstability of deep neural networks , researchers have proposed different kinds of methods to defense adversarial examples , such as adversarial training ( Goodfellow et al. , 2014 ) , data compression ( Dziugaite et al. , 2016 ) , and distillation defense ( Papernot et al. , 2016 ) . But each of these methods is a remedy for the original problem , and none of these methods can solve it fundamentally . For example , Moosavi-Dezfooli et al . ( 2016 ) showed that no matter how much adversarial examples are added to training sets , there are new adversarial examples that can successfully attack the adversarial trained deep neural network . So , avoiding adversarial examples technically can not solve the most essential problem : why such subtle change in adversarial examples can beat deep neural networks ? Meanwhile , it leads to a more important question : how to make deep neural networks have natural robustness so that they can get rid of malicious adversarial examples . Early explanations for adversarial examples considered that a smoothness prior is typically valid for kernel methods that imperceptibly tiny perturbations of a given image do not normally change the underlying class , while the smoothness assumption does not hold for deep neural networks due to its high non-linearity ( Szegedy et al. , 2013 ) . This analysis underlies plain deep neural networks like AlexNet ( Krizhevsky et al. , 2012 ) . But later than that , Goodfellow et al . ( 2014 ) claim adversarial examples are a result of models being too linear rather than too non-linear , they can be explained as a property of high-dimensional dot products . Unfortunately , both of these explanations seem to imply that adversarial examples are inevitable for deep neural networks . On the other hand , we notice that skip connections are widely used in current deep neural networks after the appearance of Highway Network ( Srivastava et al. , 2015 ) and ResNet ( He et al. , 2016 ) . It turns out that the identity mapping in ResNet is formally equivalent to one step of Euler ’ s method which has been used to solve ordinary differential equations ( Weinan , 2017 ) . More than that , other kinds of skip connections used by different network architectures can be considered as different numerical methods for solving ordinary differential equations . The link between numerical ordinary differential equations with deep neural networks can bring us a whole new perspective to explain adversarial examples through the numerical stability analysis . In this paper , we attempt to utilize the natural property of neural networks to defense adversarial examples . We first analyze how adversarial examples affect the output of neural networks with identity mappings , obtain an upper bound for this kind of neural networks , and find that this upper bound is impractical in actual computations . In the same way , we figure out why adversarial examples can fool commonly used deep neural networks with skip connections . Then , we demonstrate that Neural ODEs hold a weaker upper bound and verify the natural robustness of Neural ODEs under four types of perturbations . Finally , we compare Neural ODEs with three types of adversarial training methods to show that the natural robustness of Neural ODEs is better than the robustness of neural networks that are trained with adversarial training . The main contributions of our work are as follows : • We introduce and formalize the numerical stability analysis for deep neural networks with identity mappings , prove that there is an upper bound for neural networks with identity mappings to constrain the error caused by adversarial noises . • We provide a new reason why commonly used deep neural networks with skip connections can not resist adversarial examples . • We demonstrate that Neural ODEs hold a weaker upper bound which limits the amount of change in the result from being too large . Compare with ResNet and three types of adversarial training methods , we show the natural robustness of Neural ODEs . 2 RELATED WORKS . 2.1 ADVERSARIAL DEFENSE . Adversarial training typically uses a robust optimization to generate adversarial examples for training deep neural networks . Madry et al . ( 2017 ) take the optimization as a saddle point problem . Zhang et al . ( 2019a ) cast adversarial training as a discrete time differential game . Adversarial training can be seen as a data augmentation particularly enhance the robustness to white-box attacks ( Tramèr et al. , 2017 ) . Zantedeschi et al . ( 2017 ) augmented the training sets with examples perturbed using Gaussian noises which can also enhance the robustness to black-box attacks . Lee et al . ( 2017 ) proposed a novel adversarial training method using a generative adversarial network framework . Besides , Finlay et al . ( 2018 ) augmented adversarial training with worst case adversarial training which improves adversarial robustness in the ` 2 norm on CIFAR10 . Modifying the neural networks by using auto encoders , input gradient regularization and distillation can result in robustness against adversarial attacks ( Bai et al. , 2017 ; Ross & Doshi-Velez , 2017 ; Papernot et al. , 2016 ) . Besides , there are some biologically inspired deep learning models designed to have natural robustness against adversarial examples . Nayebi & Ganguli ( 2017 ) developed a scheme similar to nonlinear dendritic computation to train deep neural networks to make them robust to adversarial attacks . Krotov & Hopfield ( 2018 ) proposed Dense Associative Memory ( DAM ) models and suggested that DAM with higher order energy functions are closer to human visual perception than deep neural networks with ReLUs . In addition to augmenting datasets or modifying original neural networks , there exist adversarial defense methods that rely on using external models and detecting adversarial examples . Akhtar et al . ( 2018 ) presented Perturbation Rectifying Network ( PRN ) as ‘ pre-input ’ layers to a targeted model , if a perturbation is detected , the output of the PRN is used for label prediction instead of the actual image . Xu et al . ( 2017 ) proposed a strategy called feature squeezing to reduce the search space available to an adversary by coalescing samples that correspond to many different feature vectors in the original space into a single sample . 3 NUMERICAL STABILITY ANALYSIS FOR DNNS . 3.1 RESNET AND EULER ’ S METHOD . The building block of ResNet is defined as yn+1 = yn + f ( yn ; θn ) ( 1 ) Where n ∈ { 0 ... N ( h ) − 1 } , yn and yn+1 are input and output vectors of the layers considered . The function f ( yn ; θn ) represents the residual mapping and θn are weights to be learned . In numerical methods for solving ordinary differential equations , Euler ’ s method is defined by taking this to be exact : yn+1 = yn + hf ( tn , yn ; θn ) ( 2 ) It can be easily seen that Eqn . ( 1 ) is a special case of Euler ’ s method when the step size h = 1 . The iterative updates of ResNet can be seen as an Euler discretization of a continuous transformation ( Lu et al. , 2018 ; Haber & Ruthotto , 2017 ; Ruthotto & Haber , 2019 ) . When the input data is perturbed by adversarial noises , we denote the adversarial example by z0 = y0 + ( 3 ) To perform stability analysis for ResNet with adversarial example z0 as input , we define a numerical solution zn by zn+1 = zn + hf ( tn , zn ; θn ) ( 4 ) and provide following theorem to show that the amount of change between yn and zn holds an upper bound by some assumptions . Theorem 3.1 . Let f ( t , y ; θ ) be a continuous function for t0 ≤ t ≤ b and −∞ < y < ∞ , and further assume that f ( t , y ; θ ) satisfies the Lipschitz condition . Then compare the two numerical solutions yn and zn as h → 0 , there is a constant c ≥ 0 , such that amount of change between yn and zn satisfies max 0≤n≤N ( h ) |zn − yn| ≤ c| | ( 5 ) Proof . Let en = zn − yn , n ≥ 0 . Then e0 = , and subtracting Eqn . ( 2 ) from Eqn . ( 4 ) , we obtain en+1 = en + h [ f ( tn , zn ; θn ) − f ( tn , yn ; θn ) ] ( 6 ) Assume that the derivative function f ( t , y ; θ ) satisfied the following Lipschitz condition : there exists K ≥ 0 such that |f ( t , y1 ; θ ) − f ( t , y2 ; θ ) | ≤ K|y1 − y2| ( 7 ) Taking bounds using Eqn . ( 7 ) , we obtain |en+1| ≤ |en|+ hK̂|zn − yn| ( 8 ) |en+1| ≤ ( 1 + hK̂ ) |en| ( 9 ) where K̂ is the largest Lipschitz constant . Apply this recursively to obtain |en| ≤ ( 1 + hK̂ ) n|e0| ( 10 ) Using the inequality ( 1 + t ) m ≤ emt , for any t ≥ −1 , any m ≥ 0 , we obtain ( 1 + hK ) n ≤ enhK̂ = e ( b−t0 ) K̂ ( 11 ) and this implies the main result Eqn. ( 5 ) . Roughly speaking , theorem 3.1 means that a small adversarial perturbation initial value of the problem leads to a small change in the solution , provided that the function f ( t , y ; θ ) is continuous and the step size h is sufficiently small . Obviously , ResNet does not satisfied the assumption of continuity and its step size h always equal to 1 . Particularly , the functions f ( t , y ; θ ) in ResNet are composite function which contains ReLU activation functions . Although ReLU activation functions g ( x ) = max ( 0 , x ) break the continuity , due to their contractive property , i.e . satisfies ‖g ( x ) − g ( x+ ) ‖ ≤ | | for all x , ; it follows that ‖gn ( x ; θn ) − gn ( x+ ; θn ) ‖ = ‖max ( 0 , θnx+ bn ) −max ( 0 , θn ( x+ ) + bn ) ) ‖ ≤ ‖θn ‖ ≤ ‖θn‖‖ || ( 12 ) This provides a weaker upper bound for ReLU to mitigate the loss of continuity . Even if the step size h in ResNet can be adjusted by multiply outputs of convolution layers by a chosen constant , but unfortunately , the step size h in ResNet can not be too small since a very small step size decreases the efficiency in actual computations . We can experimentally show that when step size h is small ( such as 10−1 , 10−2 and 10−3 ) , ResNet has no obvious robustness against adversarial examples , and when step size is very small ( such as 10−8 , 10−9 , 10−10 ) , ResNet is difficult to train , so not only the classification accuracy of adversarial examples but also the accuracy of clean examples is quite low . To summarize , the main reason for ResNet ’ s failure in adversarial examples is the step size h = 1 destroys the upper bound given by Eqn . ( 5 ) and we can not find a proper way to deal with it . Thus , when the input of ResNet is perturbed by adversarial noises , the amount of change in the result will become unpredictably large so that ResNet can no longer correctly classify the input .
This paper uses theoretical grounding, starting with Lipshitz continuity-based assumptions on residual connections, to show why such architectures are more susceptible to adversarial inputs. In the process, the authors draw a parallel between these residual connections and neural ODEs, showing how the latter can circumvent the main reason that leads to adversarial susceptibility for the former. Finally, via empirical evaluations, they show how neural ODEs have "natural" robustness to adversarial examples: they have a non-trivial performance on adversarial inputs, despite not being explicitly trained for robustness.
SP:5e3798130b00275f58f296666d614d56147ec57a
Continual Memory: Can We Reason After Long-Term Memorization?
1 INTRODUCTION . In recent years , the tremendous progress of neural networks has enabled machines to perform reasoning given a query Q and the input contents X , e.g. , infer the answer of given questions from the text/video stream in text/video question answering ( Seo et al. , 2016 ; Le et al. , 2020b ) , or predict whether a user will click the given item based on the user behavior sequence in recommender systems ( Ren et al. , 2019 ; Pi et al. , 2019 ) . Studies that achieve top performances at such reasoning tasks usually follow the setting of “ end-to-end reasoning ” , where the raw input contents X is available at the time of answering Q . In this setting , complex interaction between X and Q can be designed to extract query-relevant information from X with little loss , such as co-attention interaction ( Xiong et al. , 2016 ) . Though these methods ( Seo et al. , 2016 ; Le et al. , 2020b ) can effectively handle these reasoning tasks , they require unlimited storage resources to hold the original input X . Further , they have to encode the whole input and develop the elaborate interaction from scratch , which are time consuming . This is not acceptable for online services that require instant response such as recommender systems , as the input sequence becomes extremely long ( Ren et al. , 2019 ) . Another setting of “ reasoning after memorization ” , which has the restrictions that the raw input X is not available at the time of answering Q , requires the model to first digest X in a streaming manner , i.e. , incrementally compress the current subsequence of X into a memory M with very limited capacity ( size much smaller than |X| ) . Under such constraints , in the inference phase , we can only capture query-relevant clues from the limited states M ( rather than X ) to infer the answer to Q , where the information compression procedure in M is totally not aware of Q , posing great challenges of what to remember in M . This setting is very similar to the daily situation of our human beings , i.e. , we may not even know the tasksQ that we will answer in the future when we are experiencing current events , and we also can not go back to replay when we are solving problems at hand . However , it ’ s our instincts , which continually process information during our entire life with limited and compressed memory storages , that allow us to recall and draw upon past events to frame our behaviors given the present situations ( Moscovitch et al. , 2016 ; Baddeley , 1992 ) . Compared to “ end-to-end reasoning ” , “ reasoning after memorization ” though may not achieve better precisions at regular tasks with short sequences according to literatures ( Park et al. , 2020 ) , is naturally a better choice for applications like long-sequence recommendation ( Ren et al. , 2019 ) and long-text understanding ( Ding et al. , 2020 ) . Maintaining M can be incremental with only a small part of inputs at each timestep while inference over M and Q is also tractable for online service . Memory augmented neural networks ( MANNs ) ( Graves et al. , 2014 ; 2016 ) introduce a write-read memory that already follows the setting of “ reasoning after memorization ” , which compress the input contents into a fixed-size memory and only read relevant information from the memory during reasoning . However , existing works do not emphasize on using MANNs to perform long-term memory-based reasoning . They learn how to maintain the memory only by back-propagated losses to the final answer and do not design specific training target for long-term memorization , which inevitably lead to the gradual forgetting of early contents ( Le et al. , 2019a ) . That is , when dealing with the long-term input stream , the memory may only focus on current contents and naturally neglect long-term clues . Thus , existing MANNs fail to answer the query relevant to early information due to the lack of long-term memorization training . In this paper , we propose the Continual Memory ( CM ) to further explore this ability of reasoning after long-term memorization . Specifically , we compress the long-term input stream into the continual memory with fixed-size capacity and infer subsequent queries based on the memory . To overcome gradual forgetting of early information and increase the generalization ability of the memorization technique , we develop the extra self-supervised task to recall the recorded history contents from the memory . This is inspired by the fact that human beings can recall details nearby some specific events and distinguish whether a series of events happened in the history , which respectively correspond to two different memory process revealed in cognitive , neuropsychological , and neuroimaging studies , i.e. , recollection and familiarity ( Yonelinas , 2002 ; Moscovitch et al. , 2016 ) . Concretely , we design the self-supervised memorization training with item-level and sequence-level objectives . The item-level objective aims to predict the masked items in history fragments , which are sampled from the original input stream and parts of items are masked as the prediction target . This task tries to endow the recollection ability that enables one to relive past episodes . And the sequence-level objective tries to distinguish whether a historical fragment ever appears in the input stream , where we directly sample positive fragments from the early input stream and replace parts of the items in positive ones as negative fragments . This task enables the familiarity process that can recognize experienced events or stimulus as familiar . We also give implementations on segment-level maintenance of memory to better capture context clues and improve the modeling efficiency . We illustrate the long-term memorization ability of our continual memory via a synthetic task , and evaluate its performance at solving real-world downstream tasks , including long-term text QA , long-term video QA and recommendation with long sequences , showing that it achieves significant advantages over existing MANNs in the “ reasoning after memorizing ” setting . 2 RELATED WORKS . Memory Augmented Neural Networks ( MANNs ) introduce external memory to store and access the past information by differentiable write-read operators . Neural Turing Machine ( NTM ) ( Graves et al. , 2014 ) and Differentiable Neural Computer ( DNC ) ( Graves et al. , 2016 ) are the typical MANNs for human-like reasoning under the setting of “ reasoning after memorizing ” , whose inference relies only on the memory with limited capacity rather than starting from the original input data . In this line of research , Rae et al . ( 2016 ) adopt the sparse memory accessing to reduce computational cost . Csordás & Schmidhuber ( 2019 ) introduce the key/value separation problem of content-based addressing and adopt a mask for memory operations as a solution . Le et al . ( 2019b ) manipulate both data and programs stored in memory to perform universal computations . And Santoro et al . ( 2018 ) ; Le et al . ( 2020a ) consider the complex relational reasoning with the information they remember . However , these works exploit MANNs mainly to help capture long-range dependencies in dealing with input sequences , but not paying efforts in dealing with the gradual forgetting issue in MANNs ( Le et al. , 2019a ) . They share the same training objective as those methods developed for the setting of “ end-to-end reasoning ” , inevitably incurring gradual forgetting of early contents ( Le et al. , 2019a ) . Recently , there are a few works trying to alleviate this problem in training MANNs . Le et al . ( 2019a ) propose to measure “ remember ” ability by the final gradient on the early input , and adopt a uniform writing operation on the memory . Rae et al . ( 2019 ) minimize the difference between successive memory states along with the reasoning objective , as they assume the steadily changed memory states will benefit remembering older information . And Munkhdalai et al . ( 2019 ) design the meta-learned neural memory instead of the conventional array-structured memory and memorize the current and past information by reconstructing the written values via the memory function . Note that our approach is different and parallel to these techniques , since we give no assumptions on what behavior will remember the most . Instead , we optimize towards this goal directly by designing auxiliary tasks in a self-supervised manner . A recent work ( Park et al. , 2020 ) also introduces a selfsupervised memory loss to ensure how well the current input is written to the memory , but it only focuses on remembering the current information and ignoring the long-term information forgetting . Continual learning ( Kirkpatrick et al. , 2017 ; Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2018 ; de Masson d ’ Autume et al. , 2019 ) is another field about the forgetting problem of neural networks , which aims to learn from an infinite stream of data and gradually extend acquired knowledge without catastrophic forgetting of early knowledge . But our continual memory focuses on remembering the infinite information stream and try to overcome gradually forgetting of long-term information . 3 CONTINUAL MEMORY . 3.1 PROBLEM FORMULATION . Given the input stream X = { x1 , x2 , · · · } and a query Q , the methods under the setting of “ endto-end reasoning ” directly learn the reason model T ( X , Q ) to predict the answer A . These is an important assumption that the input stream X can be always accessed while reasoning . And complex interaction between X and Q can be designed to extract query-relevant information in T ( X , Q ) . Obviously , these methods have to store the original input and infer the answer from scratch when the query is known . But under the setting of “ reasoning after memorizing ” , we compress the input stream X into a fixed-size memory M = { mk } Kk=1 with K memory slots and then infer the answer for any relevant query Q by A = R ( M , Q ) . Here we only need to store the compressed memory M , which can be updated in real-time and reused for a series of queries . Since the slot number K in the memory is irrelevant to the input length |X| , this setting only requires O ( 1 ) storage space rather than O ( |X| ) in the setting of “ end-to-end reasoning ” . 3.2 CONTINUAL MEMORY MACHINE . As shown in Figure 1 , given the input stream X = { x1 , x2 , · · · } , we apply a continual memory machine GΘ ( · ) to compress them into continual memory M = { mk } Kk=1 with K memory slots . By self-supervised memorization training , we try to overcome the gradual forgetting of early information and make it possible to capture the clues at any time in the stream . Concretely , based on continual memory , we develop the history recall model Hξ ( · ) to reconstruct the masked history fragments and distinguish positive history fragments from negative ones . Simultaneously , we train the task-specific reason model RΩ ( · ) based on continual memory . Under the setting of “ reasoning after memorizing ” , we can develop the continual memory M = GΘ ( X ) and then infer the answer for any relevant query Q by A = RΩ ( M , Q ) . We deal with the input stream X from the segment level rather than item level , i.e. , we cut the input sequence into fixed-length segments and memorize them into the memory slots segment-by-segment . Compared to existing MANNs ( Graves et al. , 2014 ; 2016 ) , which store the input stream item-by-item orderly with a RNN-based controller , our segmentlevel memorization can further capture the bidirectional context of each item and improve the modeling efficiency . We denote the t-th seg- ment as Xt = { xtn } Nn=1 and the current memory as Mt = { mtk } Kk=1 , where we have recorded t-1 segments in Mt . The xtn and m t n have the dimension dx and dm , respectively . We first model the t-th segment by a Transformer encoder ( Vaswani et al. , 2017 ) and obtain the sequence features Ft = { f tn } Nn=1 with dimension dx . After it , we apply a memory update module to write Ft into Mt . As shown in Figure 2 , we apply a slot-to-item attention to align the sequence features to slot features in the current memory Mt , and then develop multi-head gate-based update . Concretely , we first calculate the slot-to-item attention matrix where each element means the relevance of a slot-item pair , and then learn aligned features Lt = { ltk } Kk=1 for each slot , given by αtkn = w > a tanh ( W a 1m t k +W a 2f t n + b a ) , α̂tkn = exp ( αtkn ) ∑K j=1 exp ( α t jn ) , ltk = N∑ n=1 α̂tknf t n , ( 1 ) where Wa1 ∈ Rdmodel×dm , Wa2 ∈ Rdmodel×dx and ba ∈ Rdmodel are the projection matrices and bias . w > a is the row vector . After it , we project slot features and aligned features into Z subspaces , which is similar to the Multi-Head setting in Transformer ( Vaswani et al. , 2017 ) , given by mtkz = W M z m t k , l t kz = W L z l t k , ( 2 ) where WMz ∈ Rdmodel/Z×dm and WLz ∈ Rdmodel/Z×dx are the projection matrices . The mtkz and ltkz are the slot and aligned sub-features in the z-th subspace . Next , the k-th slot sub-feature m t kz is updated with the corresponding sub-feature ltkz based on the z-th GRU unit with dmodel Z -d hidden states , given by mt+1kz = GRUz ( m t kz , l t kz ) , ( 3 ) where ltkz is the current input of the z-th GRU unit . Next , the new slot feature m t+1 k is aggregated from Z subspaces by mt+1k = W oConcat ( mt+1k1 , · · · , m t+1 kZ ) , where W o ∈ Rdm×dmodel is the aggregation matrix . After the memorization of T segments , we can obtain continual memory MT and we denote it by M for convenience . Note that , at the inference stage , we can develop and update the continual memory in real time by GΘ ( · ) , thus we do not need the input contents during subsequent reasoning and have the ability to reason after long-term memorization .
To approach "reasoning after memorization", the paper presents a Continual Memory (CM) framework using a memory-augmented neural network (MANN) and self-supervised training. In particular, the CM compresses the input sequence into a matrix memory using self-attention mechanisms and gated recurrent update (GRU). Then together with a Transformer decoder, the memory is used for downstream reasoning tasks without the need of referring to the original input sequence. Moreover, the framework is simultaneously trained with auxiliary losses to enforce memorization capability. A variety of experiments demonstrate promising results, in which the CM outperforms two MANN baselines and shows competitive performance against state-of-the-art methods.
SP:75b5d32a5a6bc3373309ee3e9ad7507d23221f19
Continual Memory: Can We Reason After Long-Term Memorization?
1 INTRODUCTION . In recent years , the tremendous progress of neural networks has enabled machines to perform reasoning given a query Q and the input contents X , e.g. , infer the answer of given questions from the text/video stream in text/video question answering ( Seo et al. , 2016 ; Le et al. , 2020b ) , or predict whether a user will click the given item based on the user behavior sequence in recommender systems ( Ren et al. , 2019 ; Pi et al. , 2019 ) . Studies that achieve top performances at such reasoning tasks usually follow the setting of “ end-to-end reasoning ” , where the raw input contents X is available at the time of answering Q . In this setting , complex interaction between X and Q can be designed to extract query-relevant information from X with little loss , such as co-attention interaction ( Xiong et al. , 2016 ) . Though these methods ( Seo et al. , 2016 ; Le et al. , 2020b ) can effectively handle these reasoning tasks , they require unlimited storage resources to hold the original input X . Further , they have to encode the whole input and develop the elaborate interaction from scratch , which are time consuming . This is not acceptable for online services that require instant response such as recommender systems , as the input sequence becomes extremely long ( Ren et al. , 2019 ) . Another setting of “ reasoning after memorization ” , which has the restrictions that the raw input X is not available at the time of answering Q , requires the model to first digest X in a streaming manner , i.e. , incrementally compress the current subsequence of X into a memory M with very limited capacity ( size much smaller than |X| ) . Under such constraints , in the inference phase , we can only capture query-relevant clues from the limited states M ( rather than X ) to infer the answer to Q , where the information compression procedure in M is totally not aware of Q , posing great challenges of what to remember in M . This setting is very similar to the daily situation of our human beings , i.e. , we may not even know the tasksQ that we will answer in the future when we are experiencing current events , and we also can not go back to replay when we are solving problems at hand . However , it ’ s our instincts , which continually process information during our entire life with limited and compressed memory storages , that allow us to recall and draw upon past events to frame our behaviors given the present situations ( Moscovitch et al. , 2016 ; Baddeley , 1992 ) . Compared to “ end-to-end reasoning ” , “ reasoning after memorization ” though may not achieve better precisions at regular tasks with short sequences according to literatures ( Park et al. , 2020 ) , is naturally a better choice for applications like long-sequence recommendation ( Ren et al. , 2019 ) and long-text understanding ( Ding et al. , 2020 ) . Maintaining M can be incremental with only a small part of inputs at each timestep while inference over M and Q is also tractable for online service . Memory augmented neural networks ( MANNs ) ( Graves et al. , 2014 ; 2016 ) introduce a write-read memory that already follows the setting of “ reasoning after memorization ” , which compress the input contents into a fixed-size memory and only read relevant information from the memory during reasoning . However , existing works do not emphasize on using MANNs to perform long-term memory-based reasoning . They learn how to maintain the memory only by back-propagated losses to the final answer and do not design specific training target for long-term memorization , which inevitably lead to the gradual forgetting of early contents ( Le et al. , 2019a ) . That is , when dealing with the long-term input stream , the memory may only focus on current contents and naturally neglect long-term clues . Thus , existing MANNs fail to answer the query relevant to early information due to the lack of long-term memorization training . In this paper , we propose the Continual Memory ( CM ) to further explore this ability of reasoning after long-term memorization . Specifically , we compress the long-term input stream into the continual memory with fixed-size capacity and infer subsequent queries based on the memory . To overcome gradual forgetting of early information and increase the generalization ability of the memorization technique , we develop the extra self-supervised task to recall the recorded history contents from the memory . This is inspired by the fact that human beings can recall details nearby some specific events and distinguish whether a series of events happened in the history , which respectively correspond to two different memory process revealed in cognitive , neuropsychological , and neuroimaging studies , i.e. , recollection and familiarity ( Yonelinas , 2002 ; Moscovitch et al. , 2016 ) . Concretely , we design the self-supervised memorization training with item-level and sequence-level objectives . The item-level objective aims to predict the masked items in history fragments , which are sampled from the original input stream and parts of items are masked as the prediction target . This task tries to endow the recollection ability that enables one to relive past episodes . And the sequence-level objective tries to distinguish whether a historical fragment ever appears in the input stream , where we directly sample positive fragments from the early input stream and replace parts of the items in positive ones as negative fragments . This task enables the familiarity process that can recognize experienced events or stimulus as familiar . We also give implementations on segment-level maintenance of memory to better capture context clues and improve the modeling efficiency . We illustrate the long-term memorization ability of our continual memory via a synthetic task , and evaluate its performance at solving real-world downstream tasks , including long-term text QA , long-term video QA and recommendation with long sequences , showing that it achieves significant advantages over existing MANNs in the “ reasoning after memorizing ” setting . 2 RELATED WORKS . Memory Augmented Neural Networks ( MANNs ) introduce external memory to store and access the past information by differentiable write-read operators . Neural Turing Machine ( NTM ) ( Graves et al. , 2014 ) and Differentiable Neural Computer ( DNC ) ( Graves et al. , 2016 ) are the typical MANNs for human-like reasoning under the setting of “ reasoning after memorizing ” , whose inference relies only on the memory with limited capacity rather than starting from the original input data . In this line of research , Rae et al . ( 2016 ) adopt the sparse memory accessing to reduce computational cost . Csordás & Schmidhuber ( 2019 ) introduce the key/value separation problem of content-based addressing and adopt a mask for memory operations as a solution . Le et al . ( 2019b ) manipulate both data and programs stored in memory to perform universal computations . And Santoro et al . ( 2018 ) ; Le et al . ( 2020a ) consider the complex relational reasoning with the information they remember . However , these works exploit MANNs mainly to help capture long-range dependencies in dealing with input sequences , but not paying efforts in dealing with the gradual forgetting issue in MANNs ( Le et al. , 2019a ) . They share the same training objective as those methods developed for the setting of “ end-to-end reasoning ” , inevitably incurring gradual forgetting of early contents ( Le et al. , 2019a ) . Recently , there are a few works trying to alleviate this problem in training MANNs . Le et al . ( 2019a ) propose to measure “ remember ” ability by the final gradient on the early input , and adopt a uniform writing operation on the memory . Rae et al . ( 2019 ) minimize the difference between successive memory states along with the reasoning objective , as they assume the steadily changed memory states will benefit remembering older information . And Munkhdalai et al . ( 2019 ) design the meta-learned neural memory instead of the conventional array-structured memory and memorize the current and past information by reconstructing the written values via the memory function . Note that our approach is different and parallel to these techniques , since we give no assumptions on what behavior will remember the most . Instead , we optimize towards this goal directly by designing auxiliary tasks in a self-supervised manner . A recent work ( Park et al. , 2020 ) also introduces a selfsupervised memory loss to ensure how well the current input is written to the memory , but it only focuses on remembering the current information and ignoring the long-term information forgetting . Continual learning ( Kirkpatrick et al. , 2017 ; Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2018 ; de Masson d ’ Autume et al. , 2019 ) is another field about the forgetting problem of neural networks , which aims to learn from an infinite stream of data and gradually extend acquired knowledge without catastrophic forgetting of early knowledge . But our continual memory focuses on remembering the infinite information stream and try to overcome gradually forgetting of long-term information . 3 CONTINUAL MEMORY . 3.1 PROBLEM FORMULATION . Given the input stream X = { x1 , x2 , · · · } and a query Q , the methods under the setting of “ endto-end reasoning ” directly learn the reason model T ( X , Q ) to predict the answer A . These is an important assumption that the input stream X can be always accessed while reasoning . And complex interaction between X and Q can be designed to extract query-relevant information in T ( X , Q ) . Obviously , these methods have to store the original input and infer the answer from scratch when the query is known . But under the setting of “ reasoning after memorizing ” , we compress the input stream X into a fixed-size memory M = { mk } Kk=1 with K memory slots and then infer the answer for any relevant query Q by A = R ( M , Q ) . Here we only need to store the compressed memory M , which can be updated in real-time and reused for a series of queries . Since the slot number K in the memory is irrelevant to the input length |X| , this setting only requires O ( 1 ) storage space rather than O ( |X| ) in the setting of “ end-to-end reasoning ” . 3.2 CONTINUAL MEMORY MACHINE . As shown in Figure 1 , given the input stream X = { x1 , x2 , · · · } , we apply a continual memory machine GΘ ( · ) to compress them into continual memory M = { mk } Kk=1 with K memory slots . By self-supervised memorization training , we try to overcome the gradual forgetting of early information and make it possible to capture the clues at any time in the stream . Concretely , based on continual memory , we develop the history recall model Hξ ( · ) to reconstruct the masked history fragments and distinguish positive history fragments from negative ones . Simultaneously , we train the task-specific reason model RΩ ( · ) based on continual memory . Under the setting of “ reasoning after memorizing ” , we can develop the continual memory M = GΘ ( X ) and then infer the answer for any relevant query Q by A = RΩ ( M , Q ) . We deal with the input stream X from the segment level rather than item level , i.e. , we cut the input sequence into fixed-length segments and memorize them into the memory slots segment-by-segment . Compared to existing MANNs ( Graves et al. , 2014 ; 2016 ) , which store the input stream item-by-item orderly with a RNN-based controller , our segmentlevel memorization can further capture the bidirectional context of each item and improve the modeling efficiency . We denote the t-th seg- ment as Xt = { xtn } Nn=1 and the current memory as Mt = { mtk } Kk=1 , where we have recorded t-1 segments in Mt . The xtn and m t n have the dimension dx and dm , respectively . We first model the t-th segment by a Transformer encoder ( Vaswani et al. , 2017 ) and obtain the sequence features Ft = { f tn } Nn=1 with dimension dx . After it , we apply a memory update module to write Ft into Mt . As shown in Figure 2 , we apply a slot-to-item attention to align the sequence features to slot features in the current memory Mt , and then develop multi-head gate-based update . Concretely , we first calculate the slot-to-item attention matrix where each element means the relevance of a slot-item pair , and then learn aligned features Lt = { ltk } Kk=1 for each slot , given by αtkn = w > a tanh ( W a 1m t k +W a 2f t n + b a ) , α̂tkn = exp ( αtkn ) ∑K j=1 exp ( α t jn ) , ltk = N∑ n=1 α̂tknf t n , ( 1 ) where Wa1 ∈ Rdmodel×dm , Wa2 ∈ Rdmodel×dx and ba ∈ Rdmodel are the projection matrices and bias . w > a is the row vector . After it , we project slot features and aligned features into Z subspaces , which is similar to the Multi-Head setting in Transformer ( Vaswani et al. , 2017 ) , given by mtkz = W M z m t k , l t kz = W L z l t k , ( 2 ) where WMz ∈ Rdmodel/Z×dm and WLz ∈ Rdmodel/Z×dx are the projection matrices . The mtkz and ltkz are the slot and aligned sub-features in the z-th subspace . Next , the k-th slot sub-feature m t kz is updated with the corresponding sub-feature ltkz based on the z-th GRU unit with dmodel Z -d hidden states , given by mt+1kz = GRUz ( m t kz , l t kz ) , ( 3 ) where ltkz is the current input of the z-th GRU unit . Next , the new slot feature m t+1 k is aggregated from Z subspaces by mt+1k = W oConcat ( mt+1k1 , · · · , m t+1 kZ ) , where W o ∈ Rdm×dmodel is the aggregation matrix . After the memorization of T segments , we can obtain continual memory MT and we denote it by M for convenience . Note that , at the inference stage , we can develop and update the continual memory in real time by GΘ ( · ) , thus we do not need the input contents during subsequent reasoning and have the ability to reason after long-term memorization .
In this paper, the authors propose the Continual Memory (CM) targeted towards a reasoning scenario called “reasoning after memorization”. The main goal of CM is to enable long-term memorization as opposed to memory networks that suffer from gradual forgetting. They evaluate their model both on synthetic data as well as a few downstream benchmarks.
SP:75b5d32a5a6bc3373309ee3e9ad7507d23221f19
Semi-Relaxed Quantization with DropBits: Training Low-Bit Neural Networks via Bitwise Regularization
1 INTRODUCTION . Deep neural networks have achieved great success in various computer vision applications such as image classification , object detection/segmentation , pose estimation , action recognition , and so on . However , state-of-the-art neural network architectures require too much computation and memory to be deployed to resource-limited devices . Therefore , researchers have been exploring various approaches to compress deep neural networks to reduce their memory usage and computation cost . In this paper , we focus on neural network quantization , which aims to reduce the bit-width of a neural network while maintaining competitive performance with a full-precision network . It is typically divided into two groups , uniform and heterogeneous quantization . In uniform quantization , one of the simplest methods is to round the full-precision weights and activations to the nearest grid points : x̂ = αb xα + 1 2c where α controls the grid interval size . However , this naı̈ve approach incurs severe performance degradation on large datasets . Recent network quantization methods tackle this problem from different perspectives . In particular , Relaxed Quantization ( RQ ) ( Louizos et al. , 2019 ) employs Gumbel-Softmax ( Jang et al. , 2017 ; Maddison et al. , 2017 ) to force weights and activations to be located near quantization grids with high density . Louizos et al . ( 2019 ) notice the importance of keeping the gradient variance small , which leads them to use high Gumbel-Softmax temperatures in RQ . However , such high temperatures may cause a large quantization error , thus preventing quantized networks from achieving comparable performance to full-precision networks . To resolve this issue , we first propose Semi-Relaxed Quantization ( SRQ ) that uses the mode of the original categorical distribution in the forward pass , which induces small quantization error . It is clearly distinguished from Gumbel-Softmax choosing argmax among the samples from the concrete distribution . To cluster weights cohesively around quantization grid points , we devise a multi-class straight-through estimator ( STE ) that allows for efficient gradient-based optimization as well . As this STE is biased like a traditional one ( Bengio et al. , 2013 ) for the binary case , we present a novel technique , DropBits to reduce the distribution bias of the multi-calss STE in SRQ . Motivated from Dropout ( Srivastava et al. , 2014 ) , DropBits drops bits rather than neurons/filters to train low-bit neural networks under SRQ framework . In addition to uniform quantization , DropBits allows for heterogeneous quantization , which learns different bit-width per parameter/channel/layer by dropping redundant bits . DropBits with learnable bit-drop rates adaptively finds out the optimal bit-width for each group of parameters , possibly further reducing the overall bits . In contrast to recent studies ( Wang et al. , 2019 ; Uhlich et al. , 2020 ) in heterogeneous quantization that exhibit almost all layers possess at least 4 bits , up to 10-bit , our method yields much more resource-efficient low-bit neural networks with at most 4 bits for all layers . With trainable bit-widths , we also articulate a new hypothesis for quantization where one can find the learned bit-width network ( termed a ‘ quantized sub-network ’ ) which can perform better than the network with the same but fixed bit-widths from scratch . Our contribution is threefold : • We propose a new quantization method , Semi-Relaxed Quantization ( SRQ ) that introduces the multi-class straight-through estimator to reduce the quantization error of Relaxed Quantization for transforming continuous activations and weights to discrete ones . We further present a novel technique , DropBits to reduce the distribution bias of the multi-class straight-through estimator in SRQ . • Extending DropBits technique , we propose a more resource-efficient heterogeneous quantization algorithm to curtail redundant bit-widths across groups of weights and/or activations ( e.g . across layers ) and verify that our method is able to find out ‘ quantized sub-networks ’ . • We conduct extensive experiments on several benchmark datasets to demonstrate the effectiveness of our method . We accomplish new state-of-the-art results for ResNet-18 and MobileNetV2 on the ImageNet dataset when all layers are uniformly quantized . 2 RELATED WORK . While our goal in this work is to obtain an extremely low-bit neural network both for weights and activations , here we broadly discuss existing quantization techniques with various goals and settings . BinaryConnect ( Courbariaux et al. , 2015 ) first attempted to binarize weights to ±1 by employing deterministic or stochastic operation . To obtain better performance , various studies ( Rastegari et al. , 2016 ; Li et al. , 2016 ; Achterhold et al. , 2018 ; Shayer et al. , 2018 ) have been conducted in binarization and ternarization . To reduce hardware cost for inference , Geng et al . ( 2019 ) proposed softmax approximation via a look-up table . Although these works effectively decrease the model size and raise the accuracy , they are limited to quantizing weights with activations remained in full-precision . To take full advantage of quantization at run-time , it is necessary to quantize activations as well . Researchers have recently focused more on simultaneously quantizing both weights and activations ( Zhou et al. , 2016 ; Yin et al. , 2018 ; Choi et al. , 2018 ; Zhang et al. , 2018 ; Gong et al. , 2019 ; Jung et al. , 2019 ; Esser et al. , 2020 ) . XNOR-Net ( Rastegari et al. , 2016 ) , the beginning of this line of work , exploits the efficiency of XNOR and bit-counting operations . QIL ( Jung et al. , 2019 ) also quantizes weights and activations by introducing parametrized learnable quantizers that can be trained jointly with weight parameters . Esser et al . ( 2020 ) recently presented a simple technique to approximate the gradients with respect to the grid interval size to improve QIL . Nevertheless , these methods do not quantize the first or last layer , which leaves a room to improve power-efficiency . For ease of deployment in practice , it is inevitable to quantize weights and activations of all layers , which is the most challenging . Louizos et al . ( 2019 ) proposed to cluster weights by using GumbelSoftmax , but it shows drawbacks as we will discuss in Section 3.2 . Jain et al . ( 2019 ) presented efficient fixed-point implementations by formulating the grid interval size to the power of two , but they quantized the first and last layer to at least 8-bit . Zhao et al . ( 2020 ) proposed to quantize the grid interval size and network parameters in batch normalization for the deployment of quantized models on low-bit integer hardware , but it requires a specific accelerator only for this approach . As another line of work , Fromm et al . ( 2018 ) proposed a heterogeneous binarization given pre-defined bit-distribution . HAWQ ( Dong et al. , 2019 ) determines the bit-width for each block heuristically based on the top eigenvalue of Hessian . Unfortunately , both of them do not learn optimal bit-widths for heterogeneity . Toward this , Wang et al . ( 2019 ) and Uhlich et al . ( 2020 ) proposed a layer-wise heterogeneous quantization by exploiting reinforcement learning and learning dynamic range of quantizers , respectively . However , their results exhibit that almost all layers have up to 10-bit ( at least 4-bit ) , which would be suboptimal . Lou et al . ( 2020 ) presented a channel-wise heterogeneous quantization by exploiting hierarchical reinforcement learning , but channel-wise precision limits the structure of accelerators , thereby restricting the applicability of the model . 3 METHOD . In this section , we briefly review Relaxed Quantization ( RQ ) ( Louizos et al. , 2019 ) and propose Semi-Relaxed Quantization , which selects the nearest grid point in the forward pass to decrease the quantization error . To make it learnable and to cluster compressed parameters cohesively , SRQ expresses the nearest grid selection of the forward pass as the equivalent form , the combination of logistic distribution and argmax , and performs the backward pass on it . Then , we present DropBits technique to reduce the distribution bias of SRQ and its extension to heterogeneous quantization . 3.1 PRELIMINARY : RELAXED QUANTIZATION . Relaxed Quantization ( RQ ) considers the following quantization grids for weights : Ĝ = α [ −2b−1 , . . . , 0 , . . . , 2b−1 − 1 ] = : [ g0 , . . . , g2b−1 ] where b is the bit-width and a learnable parameter α > 0 for each layer controls a grid interval . When quantizing activations , the grid points in Ĝ start from zero since the output of ReLU is always non-negative . Then , x ( a weight or an activation ) is perturbed by noise as x̃ = x+ , which enables gradient-based optimization for non-differentiable rounding . The noise follows a distribution p ( ) = Logistic ( 0 , σ ) so that p ( x̃ ) is governed by Logistic ( x , σ ) where σ represents the standard deviation . Under p ( x̃ ) , we can easily compute the unnormalized probability of x̃ being quantized to each grid point gi in a closed form as below : πi = p ( x̂ = gi|x , α , σ ) = Sigmoid ( ( gi + α/2− x ) /σ ) − Sigmoid ( ( gi − α/2− x ) /σ ) , ( 1 ) where x̂ denotes a quantized realization of x̃ . Note that the cumulative distribution function of the logistic distribution is just a sigmoid function . Finally , given unnormalized categorical probability π = { πi } 2 b−1 i=0 for grid points Ĝ = { gi } 2b−1 i=0 , RQ discretizes x to x̂ = r ·Ĝ by sampling r = { ri } 2b−1 i=0 from the concrete distribution ( Jang et al. , 2017 ; Maddison et al. , 2017 ) with a temperature τ : ui ∼ Gumbel ( 0 , 1 ) , ri = exp ( ( log πi + ui ) /τ ) ∑2b−1 j=0 exp ( ( log πj + uj ) /τ ) , x̂ = 2b−1∑ i=0 rigi . ( 2 ) The algorithm of RQ is described in Appendix in detail . 3.2 SEMI-RELAXED QUANTIZATION - FIXING PITFALLS OF RQ . Although RQ achieves competitive performance with both weights and activations of neural networks quantized , the quantization probability modeling of RQ may still incur large quantization error , thereby yielding suboptimal performance . To be specific , Louizos et al . ( 2019 ) recommend high temperatures for the concrete distribution ( e.g . τ = 1.0 or 2.0 ) in ( 2 ) since exploiting low temperatures hinders networks from converging due to high variance of gradients . However , it turns out that the concrete distribution with such a high temperature is almost similar to the uniform distribution . As a concrete example , we consider 2-bit quantization with Ĝ = α [ −2 , −1 , 0 , 1 ] for a fixed scale parameter α > 0 , σ = α/3 , and we set τ to 1.0 as in Louizos et al . ( 2019 ) . Now , suppose that the original weight value is α/2 . As in Figure 1- ( b , d , e ) , ? can be sporadically quantized to below zero by RQ as the original categorical distribution has support for −α and −2α . It may be okay on average , but RQ computes only one sample in each forward pass due to computational burden , which can accidentally lead to very large quantization error for these particular sample . To avoid the counterintuitive-sample with large quantization error as seen in Figure 1- ( b , d , e ) , we propose ‘ Semi-Relaxed Quantization ’ ( SRQ ) which rather directly considers the original categorical distribution in Figure 1- ( g ) . To be concrete , for a weight or an activation x , the probability of x being quantized to each grid is ri = πi/ ∑2b−1 j=0 πj for i ∈ { 0 , · · · , 2b − 1 } with b-bit precision , where πi is computed as ( 1 ) . In such a manner , selecting a grid point for x can be thought of as sampling from the categorical distribution with categories Ĝ = { gi } 2 b−1 i=0 and the corresponding probabilities r = { ri } 2 b−1 i=0 as illustrated in Figure 1- ( g ) . Then , the grid point gimax with imax = argmaxi ri would be the most reasonable speculation due to the highest probability . SRQ therefore chooses the mode of the original categorical distribution , gimax and assign it to x̂ , entirely discriminated from Gumbel-Softmax which selects the argmax among samples from the concrete distribution . As a result , SRQ does not suffer from counterintutive-sample problem that RQ encounters at all . The last essential part for SRQ is to handle the non-differentiable argmax operator in computing imax . Toward this , we propose a multi-class straight-through estimator ( STE ) that allows for backpropagating through a non-differentiable categorical sample by approximating ∂L/∂rimax to ∂L/∂yimax and ∂L/∂ri to zero for i 6= imax , where L is the cross entropy between the true label and the prediction made by a quantized neural network as delineated in the previous paragraph and yimax is the imax-th entry of the one-hot vector y . The forward and backward passes of SRQ are summarized as follows . Forward : y = one hot [ argmax i ri ] , Backward : ∂L ∂rimax = ∂L ∂yimax and ∂L ∂ri = 0 for i 6= imax ( 3 ) Such a formulation brings two important advantages in network quantization . First of all , ( 3 ) makes the variance of gradient estimator become zero . Since SRQ always chooses the mode of the original categorical distribution ( i.e. , there is no randomness in the forward pass of SRQ ) , and the gradient of loss function L with respect to the individual categorical probabilities is defined as zero everywhere except for the coordinate corresponding to the mode , the variance of gradients in SRQ is indeed zero . The other advantage is that the backward pass ( 3 ) can cluster network weight parameters cohesively . Under the assumption that ri = πi , ∂L∂x is proportional to ∂πimax ∂x = 1 σ ( Sigmoid ( gimax +α/2−x σ ) Sigmoid ( − gimax +α/2−xσ ) −Sigmoid ( gimax−α/2−x σ ) Sigmoid ( − gimax−α/2−x σ ) ) 1 . When x is close to gimax , ∂πimax/∂x is nearly zero , so is ∂L/∂x . With an appropriate learning rate , x converges to gimax , which leads SRQ to cluster weights better than RQ as shown in Figure 2 . Although ∂L∂x is almost zero , α is still trained . After α is updated , there is a gap between x and α so that x can be trained . Hence , the network will continue to train until it finds the optimal α .
This paper deals with network quantization. It proposes Semi-Relaxed Quantization (SRQ) that uses a multi-class straight-through estimator to effectively reduce the bias and variance, along with a new regularization technique, DropBits that replaces dropout regularization to randomly drop the bits. Extensive experiments are conducted to validate our method on various benchmark datasets and network architectures.
SP:722584f20a74efbfb6e50fb795aa33a39d73f13b
Semi-Relaxed Quantization with DropBits: Training Low-Bit Neural Networks via Bitwise Regularization
1 INTRODUCTION . Deep neural networks have achieved great success in various computer vision applications such as image classification , object detection/segmentation , pose estimation , action recognition , and so on . However , state-of-the-art neural network architectures require too much computation and memory to be deployed to resource-limited devices . Therefore , researchers have been exploring various approaches to compress deep neural networks to reduce their memory usage and computation cost . In this paper , we focus on neural network quantization , which aims to reduce the bit-width of a neural network while maintaining competitive performance with a full-precision network . It is typically divided into two groups , uniform and heterogeneous quantization . In uniform quantization , one of the simplest methods is to round the full-precision weights and activations to the nearest grid points : x̂ = αb xα + 1 2c where α controls the grid interval size . However , this naı̈ve approach incurs severe performance degradation on large datasets . Recent network quantization methods tackle this problem from different perspectives . In particular , Relaxed Quantization ( RQ ) ( Louizos et al. , 2019 ) employs Gumbel-Softmax ( Jang et al. , 2017 ; Maddison et al. , 2017 ) to force weights and activations to be located near quantization grids with high density . Louizos et al . ( 2019 ) notice the importance of keeping the gradient variance small , which leads them to use high Gumbel-Softmax temperatures in RQ . However , such high temperatures may cause a large quantization error , thus preventing quantized networks from achieving comparable performance to full-precision networks . To resolve this issue , we first propose Semi-Relaxed Quantization ( SRQ ) that uses the mode of the original categorical distribution in the forward pass , which induces small quantization error . It is clearly distinguished from Gumbel-Softmax choosing argmax among the samples from the concrete distribution . To cluster weights cohesively around quantization grid points , we devise a multi-class straight-through estimator ( STE ) that allows for efficient gradient-based optimization as well . As this STE is biased like a traditional one ( Bengio et al. , 2013 ) for the binary case , we present a novel technique , DropBits to reduce the distribution bias of the multi-calss STE in SRQ . Motivated from Dropout ( Srivastava et al. , 2014 ) , DropBits drops bits rather than neurons/filters to train low-bit neural networks under SRQ framework . In addition to uniform quantization , DropBits allows for heterogeneous quantization , which learns different bit-width per parameter/channel/layer by dropping redundant bits . DropBits with learnable bit-drop rates adaptively finds out the optimal bit-width for each group of parameters , possibly further reducing the overall bits . In contrast to recent studies ( Wang et al. , 2019 ; Uhlich et al. , 2020 ) in heterogeneous quantization that exhibit almost all layers possess at least 4 bits , up to 10-bit , our method yields much more resource-efficient low-bit neural networks with at most 4 bits for all layers . With trainable bit-widths , we also articulate a new hypothesis for quantization where one can find the learned bit-width network ( termed a ‘ quantized sub-network ’ ) which can perform better than the network with the same but fixed bit-widths from scratch . Our contribution is threefold : • We propose a new quantization method , Semi-Relaxed Quantization ( SRQ ) that introduces the multi-class straight-through estimator to reduce the quantization error of Relaxed Quantization for transforming continuous activations and weights to discrete ones . We further present a novel technique , DropBits to reduce the distribution bias of the multi-class straight-through estimator in SRQ . • Extending DropBits technique , we propose a more resource-efficient heterogeneous quantization algorithm to curtail redundant bit-widths across groups of weights and/or activations ( e.g . across layers ) and verify that our method is able to find out ‘ quantized sub-networks ’ . • We conduct extensive experiments on several benchmark datasets to demonstrate the effectiveness of our method . We accomplish new state-of-the-art results for ResNet-18 and MobileNetV2 on the ImageNet dataset when all layers are uniformly quantized . 2 RELATED WORK . While our goal in this work is to obtain an extremely low-bit neural network both for weights and activations , here we broadly discuss existing quantization techniques with various goals and settings . BinaryConnect ( Courbariaux et al. , 2015 ) first attempted to binarize weights to ±1 by employing deterministic or stochastic operation . To obtain better performance , various studies ( Rastegari et al. , 2016 ; Li et al. , 2016 ; Achterhold et al. , 2018 ; Shayer et al. , 2018 ) have been conducted in binarization and ternarization . To reduce hardware cost for inference , Geng et al . ( 2019 ) proposed softmax approximation via a look-up table . Although these works effectively decrease the model size and raise the accuracy , they are limited to quantizing weights with activations remained in full-precision . To take full advantage of quantization at run-time , it is necessary to quantize activations as well . Researchers have recently focused more on simultaneously quantizing both weights and activations ( Zhou et al. , 2016 ; Yin et al. , 2018 ; Choi et al. , 2018 ; Zhang et al. , 2018 ; Gong et al. , 2019 ; Jung et al. , 2019 ; Esser et al. , 2020 ) . XNOR-Net ( Rastegari et al. , 2016 ) , the beginning of this line of work , exploits the efficiency of XNOR and bit-counting operations . QIL ( Jung et al. , 2019 ) also quantizes weights and activations by introducing parametrized learnable quantizers that can be trained jointly with weight parameters . Esser et al . ( 2020 ) recently presented a simple technique to approximate the gradients with respect to the grid interval size to improve QIL . Nevertheless , these methods do not quantize the first or last layer , which leaves a room to improve power-efficiency . For ease of deployment in practice , it is inevitable to quantize weights and activations of all layers , which is the most challenging . Louizos et al . ( 2019 ) proposed to cluster weights by using GumbelSoftmax , but it shows drawbacks as we will discuss in Section 3.2 . Jain et al . ( 2019 ) presented efficient fixed-point implementations by formulating the grid interval size to the power of two , but they quantized the first and last layer to at least 8-bit . Zhao et al . ( 2020 ) proposed to quantize the grid interval size and network parameters in batch normalization for the deployment of quantized models on low-bit integer hardware , but it requires a specific accelerator only for this approach . As another line of work , Fromm et al . ( 2018 ) proposed a heterogeneous binarization given pre-defined bit-distribution . HAWQ ( Dong et al. , 2019 ) determines the bit-width for each block heuristically based on the top eigenvalue of Hessian . Unfortunately , both of them do not learn optimal bit-widths for heterogeneity . Toward this , Wang et al . ( 2019 ) and Uhlich et al . ( 2020 ) proposed a layer-wise heterogeneous quantization by exploiting reinforcement learning and learning dynamic range of quantizers , respectively . However , their results exhibit that almost all layers have up to 10-bit ( at least 4-bit ) , which would be suboptimal . Lou et al . ( 2020 ) presented a channel-wise heterogeneous quantization by exploiting hierarchical reinforcement learning , but channel-wise precision limits the structure of accelerators , thereby restricting the applicability of the model . 3 METHOD . In this section , we briefly review Relaxed Quantization ( RQ ) ( Louizos et al. , 2019 ) and propose Semi-Relaxed Quantization , which selects the nearest grid point in the forward pass to decrease the quantization error . To make it learnable and to cluster compressed parameters cohesively , SRQ expresses the nearest grid selection of the forward pass as the equivalent form , the combination of logistic distribution and argmax , and performs the backward pass on it . Then , we present DropBits technique to reduce the distribution bias of SRQ and its extension to heterogeneous quantization . 3.1 PRELIMINARY : RELAXED QUANTIZATION . Relaxed Quantization ( RQ ) considers the following quantization grids for weights : Ĝ = α [ −2b−1 , . . . , 0 , . . . , 2b−1 − 1 ] = : [ g0 , . . . , g2b−1 ] where b is the bit-width and a learnable parameter α > 0 for each layer controls a grid interval . When quantizing activations , the grid points in Ĝ start from zero since the output of ReLU is always non-negative . Then , x ( a weight or an activation ) is perturbed by noise as x̃ = x+ , which enables gradient-based optimization for non-differentiable rounding . The noise follows a distribution p ( ) = Logistic ( 0 , σ ) so that p ( x̃ ) is governed by Logistic ( x , σ ) where σ represents the standard deviation . Under p ( x̃ ) , we can easily compute the unnormalized probability of x̃ being quantized to each grid point gi in a closed form as below : πi = p ( x̂ = gi|x , α , σ ) = Sigmoid ( ( gi + α/2− x ) /σ ) − Sigmoid ( ( gi − α/2− x ) /σ ) , ( 1 ) where x̂ denotes a quantized realization of x̃ . Note that the cumulative distribution function of the logistic distribution is just a sigmoid function . Finally , given unnormalized categorical probability π = { πi } 2 b−1 i=0 for grid points Ĝ = { gi } 2b−1 i=0 , RQ discretizes x to x̂ = r ·Ĝ by sampling r = { ri } 2b−1 i=0 from the concrete distribution ( Jang et al. , 2017 ; Maddison et al. , 2017 ) with a temperature τ : ui ∼ Gumbel ( 0 , 1 ) , ri = exp ( ( log πi + ui ) /τ ) ∑2b−1 j=0 exp ( ( log πj + uj ) /τ ) , x̂ = 2b−1∑ i=0 rigi . ( 2 ) The algorithm of RQ is described in Appendix in detail . 3.2 SEMI-RELAXED QUANTIZATION - FIXING PITFALLS OF RQ . Although RQ achieves competitive performance with both weights and activations of neural networks quantized , the quantization probability modeling of RQ may still incur large quantization error , thereby yielding suboptimal performance . To be specific , Louizos et al . ( 2019 ) recommend high temperatures for the concrete distribution ( e.g . τ = 1.0 or 2.0 ) in ( 2 ) since exploiting low temperatures hinders networks from converging due to high variance of gradients . However , it turns out that the concrete distribution with such a high temperature is almost similar to the uniform distribution . As a concrete example , we consider 2-bit quantization with Ĝ = α [ −2 , −1 , 0 , 1 ] for a fixed scale parameter α > 0 , σ = α/3 , and we set τ to 1.0 as in Louizos et al . ( 2019 ) . Now , suppose that the original weight value is α/2 . As in Figure 1- ( b , d , e ) , ? can be sporadically quantized to below zero by RQ as the original categorical distribution has support for −α and −2α . It may be okay on average , but RQ computes only one sample in each forward pass due to computational burden , which can accidentally lead to very large quantization error for these particular sample . To avoid the counterintuitive-sample with large quantization error as seen in Figure 1- ( b , d , e ) , we propose ‘ Semi-Relaxed Quantization ’ ( SRQ ) which rather directly considers the original categorical distribution in Figure 1- ( g ) . To be concrete , for a weight or an activation x , the probability of x being quantized to each grid is ri = πi/ ∑2b−1 j=0 πj for i ∈ { 0 , · · · , 2b − 1 } with b-bit precision , where πi is computed as ( 1 ) . In such a manner , selecting a grid point for x can be thought of as sampling from the categorical distribution with categories Ĝ = { gi } 2 b−1 i=0 and the corresponding probabilities r = { ri } 2 b−1 i=0 as illustrated in Figure 1- ( g ) . Then , the grid point gimax with imax = argmaxi ri would be the most reasonable speculation due to the highest probability . SRQ therefore chooses the mode of the original categorical distribution , gimax and assign it to x̂ , entirely discriminated from Gumbel-Softmax which selects the argmax among samples from the concrete distribution . As a result , SRQ does not suffer from counterintutive-sample problem that RQ encounters at all . The last essential part for SRQ is to handle the non-differentiable argmax operator in computing imax . Toward this , we propose a multi-class straight-through estimator ( STE ) that allows for backpropagating through a non-differentiable categorical sample by approximating ∂L/∂rimax to ∂L/∂yimax and ∂L/∂ri to zero for i 6= imax , where L is the cross entropy between the true label and the prediction made by a quantized neural network as delineated in the previous paragraph and yimax is the imax-th entry of the one-hot vector y . The forward and backward passes of SRQ are summarized as follows . Forward : y = one hot [ argmax i ri ] , Backward : ∂L ∂rimax = ∂L ∂yimax and ∂L ∂ri = 0 for i 6= imax ( 3 ) Such a formulation brings two important advantages in network quantization . First of all , ( 3 ) makes the variance of gradient estimator become zero . Since SRQ always chooses the mode of the original categorical distribution ( i.e. , there is no randomness in the forward pass of SRQ ) , and the gradient of loss function L with respect to the individual categorical probabilities is defined as zero everywhere except for the coordinate corresponding to the mode , the variance of gradients in SRQ is indeed zero . The other advantage is that the backward pass ( 3 ) can cluster network weight parameters cohesively . Under the assumption that ri = πi , ∂L∂x is proportional to ∂πimax ∂x = 1 σ ( Sigmoid ( gimax +α/2−x σ ) Sigmoid ( − gimax +α/2−xσ ) −Sigmoid ( gimax−α/2−x σ ) Sigmoid ( − gimax−α/2−x σ ) ) 1 . When x is close to gimax , ∂πimax/∂x is nearly zero , so is ∂L/∂x . With an appropriate learning rate , x converges to gimax , which leads SRQ to cluster weights better than RQ as shown in Figure 2 . Although ∂L∂x is almost zero , α is still trained . After α is updated , there is a gap between x and α so that x can be trained . Hence , the network will continue to train until it finds the optimal α .
This work presents 1) Semi-Relaxed Quantization (SRQ), a method that targets learning low-bit neural networks, 2) DropBits, a method that performs dropout-like regularization on the bit width of the quantizers with an option to also automatically optimise the bit-width per layer according to the data, and 3) quantised lottery ticket hypothesis. SRQ is an extension of Relaxed Quantization (RQ), which is prior work, in two ways; firstly the authors replace the sampling from the concrete relaxation during training to deterministically selecting the mode (which is non-differentiable) and, secondly, they propose a specific straight-through gradient estimator (STE) than only propagates the gradient backwards for the elements that were selected in the forward pass. DropBits is motivated from the perspective of reducing the bias of the STE gradient estimator by randomly dropping grid points associated with a specific bit-width and then renormalising the SRQ distribution over the grid. This essentially induces stochasticity in the sampling distribution for the quantised value (which was removed before by selecting the mode in SRQ). The authors further extend DropBits in a way that allows for learning the drop probabilities for each bit-width, thus allowing for learning mixed-precision networks. Finally the authors postulate the quantised lottery ticket hypothesis, which refers to that “one can find the learned bit-width network which can perform better than the network with the same but fixed bit-widths from scratch”.
SP:722584f20a74efbfb6e50fb795aa33a39d73f13b
Adversarial Boot Camp: label free certified robustness in one epoch
1 Introduction . Neural networks are very accurate on image classification tasks , but they are vulnerable to adversarial perturbations , i.e . small changes to the model input leading to misclassification ( Szegedy et al. , 2014 ) . Adversarial training ( Madry et al. , 2018 ) improves robustness , at the expense of a loss of accuracy on unperturbed images ( Zhang et al. , 2019 ) . Model certification ( Lécuyer et al. , 2019 ; Raghunathan et al. , 2018 ; Cohen et al. , 2019 ) is complementary approach to adversarial training , which provides a guarantee that a model prediction is invariant to perturbations up to a given norm . Given an input x , the model f is certified to ` 2 norm r at x if it gives the same classification on f ( x+ η ) for all perturbation η with norm up to r , arg max f ( x+ η ) = arg max f ( x ) , for all ‖η‖2 ≤ r ( 1 ) Cohen et al . ( 2019 ) and Salman et al . ( 2019 ) certify models by defining a “ smoothed ” model , fsmooth , which is the expected Gaussian average of our initial model f at a given input example x , fsmooth ( x ) ≈ Eη [ f ( x+ η ) ] ( 2 ) where the perturbation is sampled from a Gaussian , η ∼ N ( 0 , σ2I ) . Cohen et al . ( 2019 ) used a probabilistic argument to show that models defined by ( 2 ) can be certified to a given radius by making a large number of stochastic model evaluations . Certified models can classify by first averaging the model , ( Salman et al. , 2019 ) , or by taking the mode , the most popular classification given by the ensemble ( Cohen et al. , 2019 ) . Cohen et al . and Salman et al . approximate the model fsmooth stochastically , using a Gaussian ensemble , which consists of evaluating the base model f multiple times on the image perturbed by noise . Like all ensemble models , these stochastic models require multiple inferences , which is more costly than performing inference a single time . In addition , these stochastic models require training the base model f from scratch , by exposing it to Gaussian noise , in order to improve the accuracy of fsmooth . Salman et al . ( 2019 ) additionally expose the model to adversarial attacks during training . In the case of certified models , there is a trade-off between certification and accuracy : the certified models lose accuracy on unperturbed images . Model CIFAR-10 ImageNet-1k CPU GPU CPU GPU Deterministic ( ours ) 0.0049 0.0080 0.0615 0.0113 Stochastic ( Cohen et al. , 2019 ) 0.0480 0.0399 0.1631 0.0932 2 Related work . The issue of adversarial vulnerability arose in the works of Szegedy et al . ( 2014 ) and Goodfellow et al . ( 2015 ) , and has spawned a vast body of research . The idea of training models to be robust to adversarial attacks was widely popularized in Madry et al . ( 2018 ) . This method , known as adversarial training , trains a model on images corrupted by gradientbased adversarial attacks , resulting in robust models . In terms of certification , early work by Cheng et al . ( 2017 ) provided a method of computing maximum perturbation bounds for neural networks , and reduced to solving a mixed integer optimization problem . Weng et al . ( 2018a ) introduced non-trivial robustness bounds for fully connected networks , and provided tight robustness bounds at low computational cost . Weng et al . ( 2018b ) proposed a metric that has theoretical grounding based on Lipschitz continuity of the classifier model and is scaleable to state-of-the-art ImageNet neural network classifiers . Zhang et al . ( 2018 ) proposed a general framework to certify neural networks based on linear and quadratic bounding techniques on the activation functions , which is more flexible than its predecessors . Training a neural network with Gaussian noise has been shown to be equivalent to gradient regularization ( Bishop , 1995 ) . This helps improve robustness of models ; however , recent work has used additive noise during training and evaluation for certification purposes . Lécuyer et al . ( 2019 ) first considered adding random Gaussian noise as a certifiable defense in a method called PixelDP . In their method , they take a known neural network architecture and add a layer of random noise to make the model ’ s output random . The expected classification is in turn more robust to adversarial perturbations . Furthermore , their defense is a certified defense , meaning they provide a lower bound on the amount of adversarial perturbations for which their defence will always work . In a following work , Li et al . ( 2018 ) provided a defence with improved certified robustness . The certification guarantees given in these two papers are loose , meaning the defended model will always be more robust than the certification bound indicates . In contrast , Cohen et al . ( 2019 ) provided a defence utilizing randomized Gaussian smoothing that leads to tight robustness guarantees under the ` 2 norm . Moreover Cohen et al . used Monte Carlo sampling to compute the radius in which a model ’ s prediction is unchanged ; we refer to this method as RandomizedSmoothing . In work building on Cohen et al. , Salman et al . ( 2019 ) developed an adversarial training framework called SmoothAdv and defined a Lipschitz constant of averaged models . Yang et al . ( 2020 ) generalize previous randomized smoothing methods by providing robustness guarantees in the ` 1 , ` 2 , and ` ∞ norms for smoothing with several non-Gaussian distributions . 3 Deterministic Smoothing . Suppose we are given a dataset consisting of paired samples ( x , y ) ∈ X × Y where x is an example with corresponding true classification y . The supervised learning approach trains a model f : X −→ RNc which maps images to a vector whose length equals the number of classes . Suppose f is the initial model , and let fsmooth be the averaged model given by equation ( 2 ) . Cohen et al . ( 2019 ) find a Gaussian smoothed classification model fsmooth by sampling η ∼ N ( 0 , σ2I ) independently n times , performing n classifications , and then computing the most popular classification . In the randomized smoothing method , the initial model f is trained on data which is augmented with Gaussian noise to improve accuracy on noisy images . We take a different approach to Gaussian smoothing . Starting from an accurate pretrained model f , we now discard the training labels , and iteratively retrain a new model , fsmooth using a quadratic loss between the model f and the new model ’ s predictions , with an additional gradient regularization term . We have found that discarding the original one-hot labels and instead using model predictions helps make the model smoother . To be precise , our new models is a result of minimizing the loss which we call HeatSmoothing , Ex [ 1 2 ∥∥softmax ( fsmooth ( x ) ) − softmax ( f ( x ) ) ∥∥22 + σ22 ∥∥∇xfsmooth ( x ) ∥∥22 ] ( 3 ) The smoothing achieved by the new models is illustrated schematically in Figure 5 . 3.1 Related regularized losses . Gradient regularization is known to be equivalent to Gaussian smoothing ( Bishop , 1995 ; LeCun et al. , 1998 ) . Our deterministic smoothed model arises by training using the HeatSmoothing loss ( 3 ) , which is designed so to ensure that ( 2 ) holds for our model . Our results is related to the early results on regularized networks ( Bishop , 1995 ; LeCun et al. , 1998 ) : that full gradient regularization is equivalent to Gaussian smoothing . Formally this is stated as follows . Theorem 1 . ( Bishop , 1995 ) Training a feed-forward neural-network model using the quadratic ( or mean-squared error ) loss , with added Gaussian noise of mean 0 and variance σ2 to the inputs , is equivalent to training with Ex [ ‖f ( x ) − y‖2 + σ2‖∇f ( x ) ‖2 ] ( 4 ) up to higher order terms . The equivalence is normally used to go from models augmented with Gaussian noise to regularized models . In our case , we use the result in the other direction : we train a regularized model in order to produce a model which is equivalent to evaluating with noise . In practice , this means that rather than adding noise to regularize models for certifiable robustness , we explicitly perform a type of gradient regularization , in order to produce a model which performs as if Gaussian noise was added . See Figure 4 in Appendix D for an illustration of the effect of this gradient regularization . The gradient regularization term in the HeatSmoothing loss ( 3 ) , is also related to adversarial training . Tikhonov regularization is used to produced adversarially robust models ( Finlay and Oberman , 2019 ) . However in adversarial training , the gradient of the loss is used , rather that the gradient of the full model . Also , our loss does not use information from the true labels . The reason for these differences is due to the fact that we wish to have a model that approximates the Gaussian average of our initial model f ( see Appendix A ) . Furthermore , minimizing the gradient-norm of the loss of the output gives us a smooth model in all directions , rather than being robust to only adversarial perturbations . 3.2 Algorithmic Details . We have found that early on in training , the value 12 ∥∥fsmooth ( x ) − fk ( x ) ∥∥22 may be far greater than the σ 2 2 ∥∥∇xfsmooth ( x ) ∥∥22 term . So we introduced a softmax of the vectors in the distance-squared term to reduce the overall magnitude of this term . We perform the training minimization of ( 3 ) for one epoch . The pseudo-code for our neural network weight update is given by Algorithm 1 1 Note that the ∥∥∇xfsmooth ( x ) ∥∥22 term in ( 3 ) requires the computation of a Jacobian matrix norm . In high dimensions this is computationally expensive . To approximate this term , we make use of the Johnson-Lindenstrauss lemma ( Johnson and Lindenstrauss , 1984 ; Vempala , 2005 ) followed by the finite difference approximation from Finlay and Oberman ( 2019 ) . We are able to approximate ∥∥∇xfsmooth ( x ) ∥∥22 by taking the average of the product of the Jacobian matrix and Gaussian noise vectors . Jacobian-vector products can be easily computed via reverse mode automatic differentiation , by moving the noise vector w inside : w · ( ∇xv ( x ) ) = ∇x ( w · v ( x ) ) ( 5 ) Further computation expense is reduced by using finite-differences to approximate the norm of the gradient . Once the finite-difference is computed , we detach this term from the automatic differentiation computation graph , further speeding training . More details of our implementation of these approximation techniques , and the definition of the term ĝ which is a regularization of the gradient , are presented in Appendix B. Algorithm 1 : HeatSmoothing Neural Network Weight Update Input : Minibatch of input examples x ( mb ) = ( x ( 1 ) , . . . , x ( Nb ) ) A model v set to “ train ” mode Current model f set to “ eval ” mode σ , standard deviation of Gaussian smoothing κ , number of Gaussian noise replications ( default= 10 ) δ , finite difference step-size ( default= 0.1 ) Update : learning-rate according to a pre-defined scheduler . for i ∈ { 1 , . . . Nb } do Compute : fsmooth ( x ( i ) ) , f ( x ( i ) ) ∈ RNc Ji = 12 ∥∥fsmooth ( x ( i ) ) − f ( x ( i ) ) ∥∥22 ∈ R for j ∈ { 1 , . . . κ } do Generate w = 1√ Nc ( w1 , . . . , wNc ) , w1 , . . . , wNc ∈ N ( 0 , 1 ) Compute the normalized gradient ĝ via ( 18 ) Detach x ( i ) from the computation graph Ji ← Ji + σ2 2δ2 ( w · fsmooth ( x ( i ) + δĝ ) − w · fsmooth ( x ( i ) ) ) 2 end J ← 1Nb Nb∑ i=1 Ji end Update the weights of v by running backpropagation on J at the current learning rate .
The paper claims that a (computationally intractable) randomized smoothing of any classifier can be distilled into the (deterministic) classifier itself via fine-tuning it with gradient penalty. This is motivated by a theoretical result that Gaussian smoothing of a classifier is equivalent to solving a certain heat equation, which can be approximated by a regularized loss training. Experimental results use the resulting deterministic classifier to compute the certified radius compared to (stochastic) smoothed classifiers, arguing its efficiency and higher certified radius of the proposed method.
SP:45cbc9c97027fe59ce2ce7f8a02d9257d3460a4c
Adversarial Boot Camp: label free certified robustness in one epoch
1 Introduction . Neural networks are very accurate on image classification tasks , but they are vulnerable to adversarial perturbations , i.e . small changes to the model input leading to misclassification ( Szegedy et al. , 2014 ) . Adversarial training ( Madry et al. , 2018 ) improves robustness , at the expense of a loss of accuracy on unperturbed images ( Zhang et al. , 2019 ) . Model certification ( Lécuyer et al. , 2019 ; Raghunathan et al. , 2018 ; Cohen et al. , 2019 ) is complementary approach to adversarial training , which provides a guarantee that a model prediction is invariant to perturbations up to a given norm . Given an input x , the model f is certified to ` 2 norm r at x if it gives the same classification on f ( x+ η ) for all perturbation η with norm up to r , arg max f ( x+ η ) = arg max f ( x ) , for all ‖η‖2 ≤ r ( 1 ) Cohen et al . ( 2019 ) and Salman et al . ( 2019 ) certify models by defining a “ smoothed ” model , fsmooth , which is the expected Gaussian average of our initial model f at a given input example x , fsmooth ( x ) ≈ Eη [ f ( x+ η ) ] ( 2 ) where the perturbation is sampled from a Gaussian , η ∼ N ( 0 , σ2I ) . Cohen et al . ( 2019 ) used a probabilistic argument to show that models defined by ( 2 ) can be certified to a given radius by making a large number of stochastic model evaluations . Certified models can classify by first averaging the model , ( Salman et al. , 2019 ) , or by taking the mode , the most popular classification given by the ensemble ( Cohen et al. , 2019 ) . Cohen et al . and Salman et al . approximate the model fsmooth stochastically , using a Gaussian ensemble , which consists of evaluating the base model f multiple times on the image perturbed by noise . Like all ensemble models , these stochastic models require multiple inferences , which is more costly than performing inference a single time . In addition , these stochastic models require training the base model f from scratch , by exposing it to Gaussian noise , in order to improve the accuracy of fsmooth . Salman et al . ( 2019 ) additionally expose the model to adversarial attacks during training . In the case of certified models , there is a trade-off between certification and accuracy : the certified models lose accuracy on unperturbed images . Model CIFAR-10 ImageNet-1k CPU GPU CPU GPU Deterministic ( ours ) 0.0049 0.0080 0.0615 0.0113 Stochastic ( Cohen et al. , 2019 ) 0.0480 0.0399 0.1631 0.0932 2 Related work . The issue of adversarial vulnerability arose in the works of Szegedy et al . ( 2014 ) and Goodfellow et al . ( 2015 ) , and has spawned a vast body of research . The idea of training models to be robust to adversarial attacks was widely popularized in Madry et al . ( 2018 ) . This method , known as adversarial training , trains a model on images corrupted by gradientbased adversarial attacks , resulting in robust models . In terms of certification , early work by Cheng et al . ( 2017 ) provided a method of computing maximum perturbation bounds for neural networks , and reduced to solving a mixed integer optimization problem . Weng et al . ( 2018a ) introduced non-trivial robustness bounds for fully connected networks , and provided tight robustness bounds at low computational cost . Weng et al . ( 2018b ) proposed a metric that has theoretical grounding based on Lipschitz continuity of the classifier model and is scaleable to state-of-the-art ImageNet neural network classifiers . Zhang et al . ( 2018 ) proposed a general framework to certify neural networks based on linear and quadratic bounding techniques on the activation functions , which is more flexible than its predecessors . Training a neural network with Gaussian noise has been shown to be equivalent to gradient regularization ( Bishop , 1995 ) . This helps improve robustness of models ; however , recent work has used additive noise during training and evaluation for certification purposes . Lécuyer et al . ( 2019 ) first considered adding random Gaussian noise as a certifiable defense in a method called PixelDP . In their method , they take a known neural network architecture and add a layer of random noise to make the model ’ s output random . The expected classification is in turn more robust to adversarial perturbations . Furthermore , their defense is a certified defense , meaning they provide a lower bound on the amount of adversarial perturbations for which their defence will always work . In a following work , Li et al . ( 2018 ) provided a defence with improved certified robustness . The certification guarantees given in these two papers are loose , meaning the defended model will always be more robust than the certification bound indicates . In contrast , Cohen et al . ( 2019 ) provided a defence utilizing randomized Gaussian smoothing that leads to tight robustness guarantees under the ` 2 norm . Moreover Cohen et al . used Monte Carlo sampling to compute the radius in which a model ’ s prediction is unchanged ; we refer to this method as RandomizedSmoothing . In work building on Cohen et al. , Salman et al . ( 2019 ) developed an adversarial training framework called SmoothAdv and defined a Lipschitz constant of averaged models . Yang et al . ( 2020 ) generalize previous randomized smoothing methods by providing robustness guarantees in the ` 1 , ` 2 , and ` ∞ norms for smoothing with several non-Gaussian distributions . 3 Deterministic Smoothing . Suppose we are given a dataset consisting of paired samples ( x , y ) ∈ X × Y where x is an example with corresponding true classification y . The supervised learning approach trains a model f : X −→ RNc which maps images to a vector whose length equals the number of classes . Suppose f is the initial model , and let fsmooth be the averaged model given by equation ( 2 ) . Cohen et al . ( 2019 ) find a Gaussian smoothed classification model fsmooth by sampling η ∼ N ( 0 , σ2I ) independently n times , performing n classifications , and then computing the most popular classification . In the randomized smoothing method , the initial model f is trained on data which is augmented with Gaussian noise to improve accuracy on noisy images . We take a different approach to Gaussian smoothing . Starting from an accurate pretrained model f , we now discard the training labels , and iteratively retrain a new model , fsmooth using a quadratic loss between the model f and the new model ’ s predictions , with an additional gradient regularization term . We have found that discarding the original one-hot labels and instead using model predictions helps make the model smoother . To be precise , our new models is a result of minimizing the loss which we call HeatSmoothing , Ex [ 1 2 ∥∥softmax ( fsmooth ( x ) ) − softmax ( f ( x ) ) ∥∥22 + σ22 ∥∥∇xfsmooth ( x ) ∥∥22 ] ( 3 ) The smoothing achieved by the new models is illustrated schematically in Figure 5 . 3.1 Related regularized losses . Gradient regularization is known to be equivalent to Gaussian smoothing ( Bishop , 1995 ; LeCun et al. , 1998 ) . Our deterministic smoothed model arises by training using the HeatSmoothing loss ( 3 ) , which is designed so to ensure that ( 2 ) holds for our model . Our results is related to the early results on regularized networks ( Bishop , 1995 ; LeCun et al. , 1998 ) : that full gradient regularization is equivalent to Gaussian smoothing . Formally this is stated as follows . Theorem 1 . ( Bishop , 1995 ) Training a feed-forward neural-network model using the quadratic ( or mean-squared error ) loss , with added Gaussian noise of mean 0 and variance σ2 to the inputs , is equivalent to training with Ex [ ‖f ( x ) − y‖2 + σ2‖∇f ( x ) ‖2 ] ( 4 ) up to higher order terms . The equivalence is normally used to go from models augmented with Gaussian noise to regularized models . In our case , we use the result in the other direction : we train a regularized model in order to produce a model which is equivalent to evaluating with noise . In practice , this means that rather than adding noise to regularize models for certifiable robustness , we explicitly perform a type of gradient regularization , in order to produce a model which performs as if Gaussian noise was added . See Figure 4 in Appendix D for an illustration of the effect of this gradient regularization . The gradient regularization term in the HeatSmoothing loss ( 3 ) , is also related to adversarial training . Tikhonov regularization is used to produced adversarially robust models ( Finlay and Oberman , 2019 ) . However in adversarial training , the gradient of the loss is used , rather that the gradient of the full model . Also , our loss does not use information from the true labels . The reason for these differences is due to the fact that we wish to have a model that approximates the Gaussian average of our initial model f ( see Appendix A ) . Furthermore , minimizing the gradient-norm of the loss of the output gives us a smooth model in all directions , rather than being robust to only adversarial perturbations . 3.2 Algorithmic Details . We have found that early on in training , the value 12 ∥∥fsmooth ( x ) − fk ( x ) ∥∥22 may be far greater than the σ 2 2 ∥∥∇xfsmooth ( x ) ∥∥22 term . So we introduced a softmax of the vectors in the distance-squared term to reduce the overall magnitude of this term . We perform the training minimization of ( 3 ) for one epoch . The pseudo-code for our neural network weight update is given by Algorithm 1 1 Note that the ∥∥∇xfsmooth ( x ) ∥∥22 term in ( 3 ) requires the computation of a Jacobian matrix norm . In high dimensions this is computationally expensive . To approximate this term , we make use of the Johnson-Lindenstrauss lemma ( Johnson and Lindenstrauss , 1984 ; Vempala , 2005 ) followed by the finite difference approximation from Finlay and Oberman ( 2019 ) . We are able to approximate ∥∥∇xfsmooth ( x ) ∥∥22 by taking the average of the product of the Jacobian matrix and Gaussian noise vectors . Jacobian-vector products can be easily computed via reverse mode automatic differentiation , by moving the noise vector w inside : w · ( ∇xv ( x ) ) = ∇x ( w · v ( x ) ) ( 5 ) Further computation expense is reduced by using finite-differences to approximate the norm of the gradient . Once the finite-difference is computed , we detach this term from the automatic differentiation computation graph , further speeding training . More details of our implementation of these approximation techniques , and the definition of the term ĝ which is a regularization of the gradient , are presented in Appendix B. Algorithm 1 : HeatSmoothing Neural Network Weight Update Input : Minibatch of input examples x ( mb ) = ( x ( 1 ) , . . . , x ( Nb ) ) A model v set to “ train ” mode Current model f set to “ eval ” mode σ , standard deviation of Gaussian smoothing κ , number of Gaussian noise replications ( default= 10 ) δ , finite difference step-size ( default= 0.1 ) Update : learning-rate according to a pre-defined scheduler . for i ∈ { 1 , . . . Nb } do Compute : fsmooth ( x ( i ) ) , f ( x ( i ) ) ∈ RNc Ji = 12 ∥∥fsmooth ( x ( i ) ) − f ( x ( i ) ) ∥∥22 ∈ R for j ∈ { 1 , . . . κ } do Generate w = 1√ Nc ( w1 , . . . , wNc ) , w1 , . . . , wNc ∈ N ( 0 , 1 ) Compute the normalized gradient ĝ via ( 18 ) Detach x ( i ) from the computation graph Ji ← Ji + σ2 2δ2 ( w · fsmooth ( x ( i ) + δĝ ) − w · fsmooth ( x ( i ) ) ) 2 end J ← 1Nb Nb∑ i=1 Ji end Update the weights of v by running backpropagation on J at the current learning rate .
Randomized smoothing is the major way to certify the robustness of large scale networks, however, it requires sampling from Gaussian distribution many times, which is not fast enough for real-time inference. This paper uses a regularized loss to get deterministic Gaussian averaged results. This paper points out an interesting direction for certifying robustness, the method is simple and effective.
SP:45cbc9c97027fe59ce2ce7f8a02d9257d3460a4c
Multivariate Probabilistic Time Series Forecasting via Conditioned Normalizing Flows
1 INTRODUCTION . Classical time series forecasting methods such as those in Hyndman & Athanasopoulos ( 2018 ) typically provide univariate forecasts and require hand-tuned features to model seasonality and other parameters . Time series models based on recurrent neural networks ( RNN ) , like LSTM ( Hochreiter & Schmidhuber , 1997 ) , have become popular methods due to their end-to-end training , the ease of incorporating exogenous covariates , and their automatic feature extraction abilities , which are the hallmarks of deep learning . Forecasting outputs can either be points or probability distributions , in which case the forecasts typically come with uncertainty bounds . The problem of modeling uncertainties in time series forecasting is of vital importance for assessing how much to trust the predictions for downstream tasks , such as anomaly detection or ( business ) decision making . Without probabilistic modeling , the importance of the forecast in regions of low noise ( small variance around a mean value ) versus a scenario with high noise can not be distinguished . Hence , point estimation models ignore risk stemming from this noise , which would be of particular importance in some contexts such as making ( business ) decisions . Finally , individual time series , in many cases , are statistically dependent on each other , and models need the capacity to adapt to this in order to improve forecast accuracy ( Tsay , 2014 ) . For example , to model the demand for a retail article , it is important to not only model its sales dependent on its own past sales , but also to take into account the effect of interacting articles , which can lead to cannibalization effects in the case of article competition . As another example , consider traffic flow in a network of streets as measured by occupancy sensors . A disruption on one particular street will also ripple to occupancy sensors of nearby streets—a univariate model would arguably not be able to account for these effects . In this work , we propose end-to-end trainable autoregressive deep learning architectures for probabilistic forecasting that explicitly models multivariate time series and their temporal dynamics by employing a normalizing flow , like the Masked Autoregressive Flow ( Papamakarios et al. , 2017 ) or Real NVP ( Dinh et al. , 2017 ) . These models are able to scale to thousands of interacting time series , we show that they are able to learn ground-truth dependency structure on toy data and we establish new state-of-the-art results on diverse real world data sets by comparing to competitive baselines . Additionally , these methods adapt to a broad class of underlying data distribution on account of using a normalizing flow and our Transformer based model is highly efficient due to the parallel nature of attention layers while training . The paper first provides some background context in Section 2 . We cover related work in Section 3 . Section 4 introduces our model and the experiments are detailed in Section 5 . We conclude with some discussion in Section 6 . The Appendix contains details of the datasets , additional metrics and exploratory plots of forecast intervals as well as details of our model . 2 BACKGROUND . 2.1 DENSITY ESTIMATION VIA NORMALIZING FLOWS . Normalizing flows ( Tabak & Turner , 2013 ; Papamakarios et al. , 2019 ) are mappings from RD to RD such that densities pX on the input space X = RD are transformed into some simple distribution pZ ( e.g . an isotropic Gaussian ) on the space Z = RD . These mappings , f : X 7→ Z , are composed of a sequence of bijections or invertible functions . Due to the change of variables formula we can express pX ( x ) by pX ( x ) = pZ ( z ) ∣∣∣∣det ( ∂f ( x ) ∂x ) ∣∣∣∣ , where ∂f ( x ) /∂x is the Jacobian of f at x. Normalizing flows have the property that the inverse x = f−1 ( z ) is easy to evaluate and computing the Jacobian determinant takes O ( D ) time . The bijection introduced by Real NVP ( Dinh et al. , 2017 ) called the coupling layer satisfies the above two properties . It leaves part of its inputs unchanged and transforms the other part via functions of the un-transformed variables ( with superscript denoting the coordinate indices ) { y1 : d = x1 : d yd+1 : D = xd+1 : D exp ( s ( x1 : d ) ) + t ( x1 : d ) , where is an element wise product , s ( ) is a scaling and t ( ) a translation function from Rd 7→ RD−d , given by neural networks . To model a nonlinear density map f ( x ) , a number of coupling layers which map X 7→ Y1 7→ · · · 7→ YK−1 7→ Z are composed together all the while alternating the dimensions which are unchanged and transformed . Via the change of variables formula the probability density function ( PDF ) of the flow given a data point can be written as log pX ( x ) = log pZ ( z ) + log |det ( ∂z/∂x ) | = log pZ ( z ) + K∑ i=1 log |det ( ∂yi/∂yi−1 ) | . ( 1 ) Note that the Jacobian for the Real NVP is a block-triangular matrix and thus the log-determinant of each map simply becomes log |det ( ∂yi/∂yi−1 ) | = log | exp ( sum ( si ( y1 : di−1 ) ) | , ( 2 ) where sum ( ) is the sum over all the vector elements . This model , parameterized by the weights of the scaling and translation neural networks θ , is then trained via stochastic gradient descent ( SGD ) on training data points where for each batch D we maximize the average log likelihood ( 1 ) given by L = 1 |D| ∑ x∈D log pX ( x ; θ ) . In practice , Batch Normalization ( Ioffe & Szegedy , 2015 ) is applied as a bijection to outputs of successive coupling layers to stabilize the training of normalizing flows . This bijection implements the normalization procedure using a weighted moving average of the layer ’ s mean and standard deviation values , which has to be adapted to either training or inference regimes . The Real NVP approach can be generalized , resulting in Masked Autoregressive Flows ( Papamakarios et al. , 2017 ) ( MAF ) where the transformation layer is built as an autoregressive neural network in the sense that it takes in some input x ∈ RD and outputs y = ( y1 , . . . , yD ) with the requirement that this transformation is invertible and any output yi can not depend on input with dimension indices ≥ i , i.e . x≥i . The Jacobian of this transformation is triangular and thus the Jacobian determinant is tractable . Instead of using a RNN to share parameters across the D dimensions of x one avoids this sequential computation by using masking , giving the method its name . The inverse however , needed for generating samples , is sequential . By realizing that the scaling and translation function approximators don ’ t need to be invertible , it is straight-forward to implement conditioning of the PDF pX ( x|h ) on some additional information h ∈ RH : we concatenate h to the inputs of the scaling and translation function approximators of the coupling layers , i.e . s ( concat ( x1 : d , h ) ) and t ( concat ( x1 : d , h ) ) which are modified to map Rd+H 7→ RD−d . Another approach is to add a bias computed from h to every layer inside the s and t networks as proposed by Korshunova et al . ( 2018 ) . This does not change the log-determinant of the coupling layers given by ( 2 ) . More importantly for us , for sequential data , indexed by t , we can share parameters across the different conditioners ht by using RNNs or Attention in an autoregressive fashion . For discrete data the distribution has differential entropy of negative infinity , which leads to arbitrary high likelihood when training normalizing flow models , even on test data . To avoid this one can dequantize the data , often by adding Uniform [ 0 , 1 ) noise to integer-valued data . The log-likelihood of the resulting continuous model is then lower-bounded by the log-likelihood of the discrete one as shown in Theis et al . ( 2016 ) . 2.2 SELF-ATTENTION . The self-attention based Transformer ( Vaswani et al. , 2017 ) model has been used for sequence modeling with great success . The multi-head self-attention mechanism enables it to capture both longand short-term dependencies in time series data . Essentially , the Transformer takes in a sequence X = [ x1 , . . . , xT ] ᵀ ∈ RT×D , and the multi-head self-attention transforms this into H distinct query Qh = XW Q h , key Kh = XW K h and value Vh = XW V h matrices , where the W Q h , W K h , and W V h are learnable parameters . After these linear projections the scaled dot-product attention computes a sequence of vector outputs via : Oh = Attention ( Qh , Kh , Vh ) = softmax ( QhK ᵀ h√ dK ·M ) Vh , where a mask M can be applied to filter out right-ward attention ( or future information leakage ) by setting its upper-triangular elements to −∞ and we normalize by dK the dimension of the WKh matrices . Afterwards , all H outputs Oh are concatenated and linearly projected again . One typically uses the Transformer in an encoder-decoder setup , where some warm-up time series is passed through the encoder and the decoder can be used to learn and autoregressively generate outputs . 3 RELATED WORK . Related to this work are models that combine normalizing flows with sequential modeling in some way . Transformation Autoregressive Networks ( Oliva et al. , 2018 ) which model the density of a multi-variate variable x ∈ RD as D conditional distributions ΠDi=1pX ( xi|xi−1 , . . . , x1 ) , where the conditioning is given by a mixture model coming from the state of a RNN , and is then transformed via a bijection . The PixelSNAIL ( Chen et al. , 2018 ) method also models the joint as a product of conditional distributions , optionally with some global conditioning , via causal convolutions and self-attention ( Vaswani et al. , 2017 ) to capture long-term temporal dependencies . These methods are well suited to modeling high dimensional data like images , however their use in modeling the temporal development of data has only recently been explored for example in VideoFlow ( Kumar et al. , 2019 ) in which they model the distribution of the next video frame via a flow where the model outputs the parameters of the flow ’ s base distribution via a ConvNet , whereas our approach will be based on conditioning of the PDF as described above . Using RNNs for modeling either multivariate or temporal dynamics introduces sequential computational dependencies that are not amenable to parallelization . Despite this , RNNs have been shown to be very effective in modeling sequential dynamics . A recent work in this direction ( Hwang et al. , 2019 ) employs bipartite flows with RNNs for temporal conditioning to develop a conditional generative model of multivariate sequential data . The authors use a bidirectional training procedure to learn a generative model of observations that together with the temporal conditioning through a RNN , can also be conditioned on ( observed ) covariates that are modeled as additional conditioning variables in the latent space , which adds extra padding dimensions to the normalizing flow . The other aspect of related works deals with multivariate probabilistic time series methods which are able to model high dimensional data . The Gaussian Copula Process method ( Salinas et al. , 2019a ) is a RNN-based time series method with a Gaussian copula process output modeled using a low-rank covariance structure to reduce computational complexity and handle non-Gaussian marginal distributions . By using a low-rank approximation of the covariance matrix they obtain a computationally tractable method and are able to scale to multivariate dimensions in the thousands with state-of-the-art results . We will compare our model to this method in what follows .
This work explores combining an RNN and a neural density estimator for forecasting in multivariate time series. RNN is stacked with a density estimator, MAF for best results, to forecast density of a multivariate time series at future time steps. In addition, variations of the architecture with attention and other density estimators are examined. The architecture, RNN+MAF and variants, is evaluated by CRPS score on several datasets.
SP:a685e4a6a1f6f3d69a9f0968145b6afd805dc5ab
Multivariate Probabilistic Time Series Forecasting via Conditioned Normalizing Flows
1 INTRODUCTION . Classical time series forecasting methods such as those in Hyndman & Athanasopoulos ( 2018 ) typically provide univariate forecasts and require hand-tuned features to model seasonality and other parameters . Time series models based on recurrent neural networks ( RNN ) , like LSTM ( Hochreiter & Schmidhuber , 1997 ) , have become popular methods due to their end-to-end training , the ease of incorporating exogenous covariates , and their automatic feature extraction abilities , which are the hallmarks of deep learning . Forecasting outputs can either be points or probability distributions , in which case the forecasts typically come with uncertainty bounds . The problem of modeling uncertainties in time series forecasting is of vital importance for assessing how much to trust the predictions for downstream tasks , such as anomaly detection or ( business ) decision making . Without probabilistic modeling , the importance of the forecast in regions of low noise ( small variance around a mean value ) versus a scenario with high noise can not be distinguished . Hence , point estimation models ignore risk stemming from this noise , which would be of particular importance in some contexts such as making ( business ) decisions . Finally , individual time series , in many cases , are statistically dependent on each other , and models need the capacity to adapt to this in order to improve forecast accuracy ( Tsay , 2014 ) . For example , to model the demand for a retail article , it is important to not only model its sales dependent on its own past sales , but also to take into account the effect of interacting articles , which can lead to cannibalization effects in the case of article competition . As another example , consider traffic flow in a network of streets as measured by occupancy sensors . A disruption on one particular street will also ripple to occupancy sensors of nearby streets—a univariate model would arguably not be able to account for these effects . In this work , we propose end-to-end trainable autoregressive deep learning architectures for probabilistic forecasting that explicitly models multivariate time series and their temporal dynamics by employing a normalizing flow , like the Masked Autoregressive Flow ( Papamakarios et al. , 2017 ) or Real NVP ( Dinh et al. , 2017 ) . These models are able to scale to thousands of interacting time series , we show that they are able to learn ground-truth dependency structure on toy data and we establish new state-of-the-art results on diverse real world data sets by comparing to competitive baselines . Additionally , these methods adapt to a broad class of underlying data distribution on account of using a normalizing flow and our Transformer based model is highly efficient due to the parallel nature of attention layers while training . The paper first provides some background context in Section 2 . We cover related work in Section 3 . Section 4 introduces our model and the experiments are detailed in Section 5 . We conclude with some discussion in Section 6 . The Appendix contains details of the datasets , additional metrics and exploratory plots of forecast intervals as well as details of our model . 2 BACKGROUND . 2.1 DENSITY ESTIMATION VIA NORMALIZING FLOWS . Normalizing flows ( Tabak & Turner , 2013 ; Papamakarios et al. , 2019 ) are mappings from RD to RD such that densities pX on the input space X = RD are transformed into some simple distribution pZ ( e.g . an isotropic Gaussian ) on the space Z = RD . These mappings , f : X 7→ Z , are composed of a sequence of bijections or invertible functions . Due to the change of variables formula we can express pX ( x ) by pX ( x ) = pZ ( z ) ∣∣∣∣det ( ∂f ( x ) ∂x ) ∣∣∣∣ , where ∂f ( x ) /∂x is the Jacobian of f at x. Normalizing flows have the property that the inverse x = f−1 ( z ) is easy to evaluate and computing the Jacobian determinant takes O ( D ) time . The bijection introduced by Real NVP ( Dinh et al. , 2017 ) called the coupling layer satisfies the above two properties . It leaves part of its inputs unchanged and transforms the other part via functions of the un-transformed variables ( with superscript denoting the coordinate indices ) { y1 : d = x1 : d yd+1 : D = xd+1 : D exp ( s ( x1 : d ) ) + t ( x1 : d ) , where is an element wise product , s ( ) is a scaling and t ( ) a translation function from Rd 7→ RD−d , given by neural networks . To model a nonlinear density map f ( x ) , a number of coupling layers which map X 7→ Y1 7→ · · · 7→ YK−1 7→ Z are composed together all the while alternating the dimensions which are unchanged and transformed . Via the change of variables formula the probability density function ( PDF ) of the flow given a data point can be written as log pX ( x ) = log pZ ( z ) + log |det ( ∂z/∂x ) | = log pZ ( z ) + K∑ i=1 log |det ( ∂yi/∂yi−1 ) | . ( 1 ) Note that the Jacobian for the Real NVP is a block-triangular matrix and thus the log-determinant of each map simply becomes log |det ( ∂yi/∂yi−1 ) | = log | exp ( sum ( si ( y1 : di−1 ) ) | , ( 2 ) where sum ( ) is the sum over all the vector elements . This model , parameterized by the weights of the scaling and translation neural networks θ , is then trained via stochastic gradient descent ( SGD ) on training data points where for each batch D we maximize the average log likelihood ( 1 ) given by L = 1 |D| ∑ x∈D log pX ( x ; θ ) . In practice , Batch Normalization ( Ioffe & Szegedy , 2015 ) is applied as a bijection to outputs of successive coupling layers to stabilize the training of normalizing flows . This bijection implements the normalization procedure using a weighted moving average of the layer ’ s mean and standard deviation values , which has to be adapted to either training or inference regimes . The Real NVP approach can be generalized , resulting in Masked Autoregressive Flows ( Papamakarios et al. , 2017 ) ( MAF ) where the transformation layer is built as an autoregressive neural network in the sense that it takes in some input x ∈ RD and outputs y = ( y1 , . . . , yD ) with the requirement that this transformation is invertible and any output yi can not depend on input with dimension indices ≥ i , i.e . x≥i . The Jacobian of this transformation is triangular and thus the Jacobian determinant is tractable . Instead of using a RNN to share parameters across the D dimensions of x one avoids this sequential computation by using masking , giving the method its name . The inverse however , needed for generating samples , is sequential . By realizing that the scaling and translation function approximators don ’ t need to be invertible , it is straight-forward to implement conditioning of the PDF pX ( x|h ) on some additional information h ∈ RH : we concatenate h to the inputs of the scaling and translation function approximators of the coupling layers , i.e . s ( concat ( x1 : d , h ) ) and t ( concat ( x1 : d , h ) ) which are modified to map Rd+H 7→ RD−d . Another approach is to add a bias computed from h to every layer inside the s and t networks as proposed by Korshunova et al . ( 2018 ) . This does not change the log-determinant of the coupling layers given by ( 2 ) . More importantly for us , for sequential data , indexed by t , we can share parameters across the different conditioners ht by using RNNs or Attention in an autoregressive fashion . For discrete data the distribution has differential entropy of negative infinity , which leads to arbitrary high likelihood when training normalizing flow models , even on test data . To avoid this one can dequantize the data , often by adding Uniform [ 0 , 1 ) noise to integer-valued data . The log-likelihood of the resulting continuous model is then lower-bounded by the log-likelihood of the discrete one as shown in Theis et al . ( 2016 ) . 2.2 SELF-ATTENTION . The self-attention based Transformer ( Vaswani et al. , 2017 ) model has been used for sequence modeling with great success . The multi-head self-attention mechanism enables it to capture both longand short-term dependencies in time series data . Essentially , the Transformer takes in a sequence X = [ x1 , . . . , xT ] ᵀ ∈ RT×D , and the multi-head self-attention transforms this into H distinct query Qh = XW Q h , key Kh = XW K h and value Vh = XW V h matrices , where the W Q h , W K h , and W V h are learnable parameters . After these linear projections the scaled dot-product attention computes a sequence of vector outputs via : Oh = Attention ( Qh , Kh , Vh ) = softmax ( QhK ᵀ h√ dK ·M ) Vh , where a mask M can be applied to filter out right-ward attention ( or future information leakage ) by setting its upper-triangular elements to −∞ and we normalize by dK the dimension of the WKh matrices . Afterwards , all H outputs Oh are concatenated and linearly projected again . One typically uses the Transformer in an encoder-decoder setup , where some warm-up time series is passed through the encoder and the decoder can be used to learn and autoregressively generate outputs . 3 RELATED WORK . Related to this work are models that combine normalizing flows with sequential modeling in some way . Transformation Autoregressive Networks ( Oliva et al. , 2018 ) which model the density of a multi-variate variable x ∈ RD as D conditional distributions ΠDi=1pX ( xi|xi−1 , . . . , x1 ) , where the conditioning is given by a mixture model coming from the state of a RNN , and is then transformed via a bijection . The PixelSNAIL ( Chen et al. , 2018 ) method also models the joint as a product of conditional distributions , optionally with some global conditioning , via causal convolutions and self-attention ( Vaswani et al. , 2017 ) to capture long-term temporal dependencies . These methods are well suited to modeling high dimensional data like images , however their use in modeling the temporal development of data has only recently been explored for example in VideoFlow ( Kumar et al. , 2019 ) in which they model the distribution of the next video frame via a flow where the model outputs the parameters of the flow ’ s base distribution via a ConvNet , whereas our approach will be based on conditioning of the PDF as described above . Using RNNs for modeling either multivariate or temporal dynamics introduces sequential computational dependencies that are not amenable to parallelization . Despite this , RNNs have been shown to be very effective in modeling sequential dynamics . A recent work in this direction ( Hwang et al. , 2019 ) employs bipartite flows with RNNs for temporal conditioning to develop a conditional generative model of multivariate sequential data . The authors use a bidirectional training procedure to learn a generative model of observations that together with the temporal conditioning through a RNN , can also be conditioned on ( observed ) covariates that are modeled as additional conditioning variables in the latent space , which adds extra padding dimensions to the normalizing flow . The other aspect of related works deals with multivariate probabilistic time series methods which are able to model high dimensional data . The Gaussian Copula Process method ( Salinas et al. , 2019a ) is a RNN-based time series method with a Gaussian copula process output modeled using a low-rank covariance structure to reduce computational complexity and handle non-Gaussian marginal distributions . By using a low-rank approximation of the covariance matrix they obtain a computationally tractable method and are able to scale to multivariate dimensions in the thousands with state-of-the-art results . We will compare our model to this method in what follows .
The paper proposes a method to provide probabilistic forecasts of multivariate time-series taking dependencies between series into account even for large dimensions. The approach consists in using a normalizing flow to model the distribution of observations at a time-step condition on a state that can be obtained either with a RNN or a transformer. The motivation of using the normalizing flow is to be able to model various type of distributions without having to make specific hypothesis on the distribution which could hinder accuracy. Experiments are performed both on a synthetic task and on real-world datasets where accuracy is shown to outperform previous methods.
SP:a685e4a6a1f6f3d69a9f0968145b6afd805dc5ab
Neural Lyapunov Model Predictive Control
1 INTRODUCTION . Control systems comprise of safety requirements that need to be considered during the controller design process . In most applications , these are in the form of state/input constraints and convergence to an equilibrium point , a specific set or a trajectory . Typically , a control strategy that violates these specifications can lead to unsafe behavior . While learning-based methods are promising for solving challenging non-linear control problems , the lack of interpretability and provable safety guarantees impede their use in practical control settings ( Amodei et al. , 2016 ) . Model-based reinforcement learning ( RL ) with planning uses a surrogate model to minimize the sum of future costs plus a learned value function terminal cost ( Moerland et al. , 2020 ; Lowrey et al. , 2018 ) . Approximated value functions , however , do not offer safety guarantees . By contrast , control theory focuses on these guarantees but it is limited by its assumptions . Thus , there is a gap between theory and practice . A feedback controller stabilizes a system if a local Control Lyapunov Function ( CLF ) function exists for the pair . This requires that the closed-loop response from any initial state results in a smaller value of the CLF at the next state . The existence of such a function is a necessary and sufficient condition for showing stability and convergence ( Khalil , 2014 ) . However , finding an appropriate Lyapunov function is often cumbersome and can be conservative . By exploiting the expressiveness of neural networks ( NNs ) , Lyapunov NNs have been demonstrated as a general tool to produce stability ( safety ) certificates ( Bobiti , 2017 ; Bobiti & Lazar , 2016 ) and also improve an existing controller ( Berkenkamp et al. , 2017 ; Gallieri et al. , 2019 ; Chang et al. , 2019 ) . In most of these settings , the controller is parameterized through a NN as well . The flexibility provided by this choice comes at the cost of increased sample complexity , which is often expensive in real-world safety-critical systems . In this work , we aim to overcome this limitation by leveraging an initial set of one-step transitions from an unknown expert demonstrator ( which may be sub-optimal ) and by using a learned Lyapunov function and surrogate model within an Model Predictive Control ( MPC ) formulation . Our key contribution is an algorithmic framework , Neural Lyapunov MPC ( NLMPC ) , that obtains a single-step horizon MPC for Lyapunov-based control of non-linear deterministic systems with constraints . By treating the learned Lyapunov NN as an estimate of the value function , we provide theoretical results for the performance of the MPC with an imperfect forward model . These results complement the ones by Lowrey et al . ( 2018 ) , which only considers the case of a perfect dynamics model . In our proposed framework , alternate learning is used to train the Lyapunov NN in a supervised manner and to tune the parameters of the MPC . The learned Lyapunov NN is used as the MPC ’ s terminal cost for obtaining closed-loop stability and robustness margins to model errors . For the resulting controller , we show that the size of the stable region can be larger than that from an MPC demonstrator with a longer prediction horizon . To empirically illustrate the efficacy of our approach , we consider constrained non-linear continuous control tasks : torque-limited inverted pendulum and non-holonomic vehicle kinematics . We show that NLMPC can transfer between using an inaccurate surrogate and a nominal forward model , and outperform several baselines in terms of stability . 2 PRELIMINARIES AND ASSUMPTIONS . Controlled Dynamical System Consider a discrete-time , time-invariant , deterministic system : x ( t+ 1 ) = f ( x ( t ) , u ( t ) ) , y ( t ) = x ( t ) , f ( 0 , 0 ) = 0 , ( 1 ) where t ∈ N is the timestep index , x ( t ) ∈ Rnx , u ( t ) ∈ Rnu and y ( t ) ∈ Rny are , respectively , the state , control input , and measurement at timestep t. We assume that the states and measurements are equivalent and the origin is the equilibrium point . Further , the system ( 1 ) is subjected to closed and bounded , convex constraints over the state and input spaces : x ( t ) ∈ X ⊆ Rnx , u ( t ) ∈ U ⊂ Rnu , ∀t > 0 . ( 2 ) The system is to be controlled by a feedback policy , K : Rnx → Rnu . The policy K is considered safe if there exists an invariant set , Xs ⊆ X , for the closed-loop dynamics , inside the constraints . The set Xs is also referred to as the safe-set under K. Namely , every trajectory for the closed-loop system that starts at some x ∈ Xs remains inside this set . If x asymptotically reaches the target , x̄T ∈ Xs , then Xs is a Region of Attraction ( ROA ) . In practice , convergence often occurs to a small set , XT . Lyapunov Conditions and Safety We formally assess the safety of the closed-loop system in terms of the existence of the positively invariant-set , Xs , inside the state constraints . This is done by means of a learned CLF , V ( x ) , given data generated under a ( initially unknown ) policy , K ( x ) . The candidate CLF needs to satisfy certain properties . First , it needs to be upper and lower bounded by strictly increasing , unbounded , positive ( K∞ ) functions ( Khalil , 2014 ) . We focus on optimal control with a quadratic stage cost and assume the origin as the target state : � ( x , u ) = xTQx+ uTRu , Q � 0 , R � 0 . ( 3 ) For above , a possible choice for K∞-function is the scaled sum-of-squares of the states : l��x�22 ≤ V ( x ) ≤ LV �x�22 , ( 4 ) where l� and LV are the minimum eigenvalue of Q and a Lipschitz constant for V respectively . Further for safety , the convergence to a set , XT ⊂ Xs , can be verified by means of the condition : ∀x ∈ Xs\XT , u = K ( x ) ⇒ V ( f ( x , u ) ) − λV ( x ) ≤ 0 , with λ ∈ [ 0 , 1 ) . ( 5 ) This means that to have stability V ( x ) must decrease along the closed-loop trajectory in the annulus . The sets Xs , XT , satisfying ( 5 ) , are ( positively ) invariant . If they are inside constraints , i.e . Xs ⊆ X , then they are safe . For a valid Lyapunov function V , the outer safe-set can be defined as a level-set : Xs = { x ∈ X : V ( x ) ≤ ls } . ( 6 ) For further definitions , we refer the reader to Blanchini & Miani ( 2007 ) ; Kerrigan ( 2000 ) . If condition ( 5 ) , holds everywhere in Xs , then the origin is a stable equilibrium ( XT = { 0 } ) . If ( most likely ) this holds only outside a non-empty inner set , XT = { x ∈ X : V ( x ) ≤ lT } ⊂ Xs , with XT ⊃ { 0 } , then the system converges to a neighborhood of the origin and remains there in the future . Approach Rationale We aim to match or enlarge the safe region of an unknown controller , Ki ( x ) . For a perfect model , f , and a safe set X ( i ) s , there exists an α � 1 , such that the one-step MPC : K ( x ) = argmin u∈U , f ( x , u ) ∈X ( i ) s αV ( f ( x , u ) ) + � ( x , u ) , ( 7 ) results in a new safe set , X ( i+1 ) s = C ( X ( i ) s ) , the one-step controllable set of X ( i ) s and the feasible region of ( 7 ) , X ( i+1 ) s ⊇ X ( i ) s . We soften the state constraints in ( 7 ) and use it recursively to estimate X ( j ) s , j > i . We formulate an algorithm that learns the parameter α as well as the safe set . We train a neural network via SGD to approximate V , hence the ROA estimate will not always increase through iterations . To aim for max ROA and minimum MPC horizon , we use cross-validation and verification . We motivate our work by extending theoretical results on MPC stability and a sub-optimality bound for approximate f and V . Finally , we provide an error bound on the learned f for having stability . Learning and Safety Verification We wish to learn V ( x ) and Xs from one-step on-policy rollouts , as well as a forward model f̂ ( x , u ) . After the learning , the level ls defining set Xs will be refined and its safety formally verified a posteriori . This is done by evaluating ( 5 ) using the model , starting from a large set of states sampled uniformly within Xs\XT . We progressively decrease the level ls starting from the learned one , and also increase the inner level lT , starting from zero , such that condition ( 5 ) holds for n ≥ ns samples in Xs\XT . The number of verifying samples , ns , provides a probability lower bound on safety , namely Psafe ( Xs\XT ) ≥ p ( ns ) , as detailed in ( Bobiti & Lazar , 2016 ) . The algorithm is detailed in appendix and based on ( Bobiti & Lazar , 2016 ) . For our theoretical results , we assume the search terminates with Psafe ( Xs\XT ) ≈ 1 and consider the condition deterministic . NN-based dynamics model In some MPC applications , it might not be possible to gather sufficient data from demonstrations in order to be able to learn a model that predicts over long sequences . One-step or few-steps dynamics learning based on NNs can suffer when the model is unrolled for longer time . For instance , errors can accumulate through the horizon due to small instabilities either from the physical system or as artifacts from short sequence learning . Although some mitigations are possible for specific architectures or longer sequences ( Armenio et al. , 2019 ; Doan et al. , 2019 ; Pathak et al. , 2017 ; Ciccone et al. , 2018 ) , we formulate our MPC to allow for a very short horizon and unstable dynamics . Since we learn a surrogate NN forward model , f̂ ( x , u ) , from one-step trajectories , we will assume this to have a locally bounded one-step-ahead prediction error , w ( t ) , where : w = f ( x , u ) − f̂ ( x , u ) , �w�2 ≤ µ , ∀ ( x , u ) ∈ X̃× U , ( 8 ) for some compact set of states , X̃ ⊇ X . We also assume that both f and f̂ are locally Lipschitz in this set , with constants Lfx , Lfu , and Lf̂x , Lf̂u respectively . A conservative value of µ can be inferred from these constants as the input and state sets are bounded . It can also be estimated from a test set .
This paper addresses the question of how to stabilize a system in a vicinity of an equilibrium. While the majority of reinforcement learning algorithms rely on trial and error, which may damage the system, the authors introduce an algorithm for safe exploration and control. A traditional approach in model-based RL is to use MPC with a surrogate forward model to minimize a planning objective comprising a sum of stage costs along with a terminal cost, often chosen as an approximated value function -i.e. the optimal expected cost-to-go- which can be learned by a Bellman equation. Instead, this work is placed in the framework of Robust MPC, where this value function is replaced by a Luyapunov function $V$, which is related to the notion of stability and is only constrained to decrease along trajectories. Such a Luyapunov function, when available, provides both a safe region, defined as a level-set of V, and a MPC policy for which stability analyses have been developed: the authors extend a result from Limon et al. (2003; 2009) to show that this MPC policy enjoys asymptotic stability in general, and input-to-state stability in the presence of small enough model errors. Accordingly, the authors propose a scheme allowing to learn a Lyapunov function $V$ from demonstration data only, through a loss function that penalizes increments of $V$ along one-step transitions. A regularization parameter $\alpha$ of this MPC, which balances stability with constraints satisfaction and stage costs, is also learned jointly by an alternative training procedure. This approach is evaluated empirically on two standard constrained non-linear continuous control tasks.
SP:1e88ff3d6daf6ca26d2f9d504c5ff282af5d3659
Neural Lyapunov Model Predictive Control
1 INTRODUCTION . Control systems comprise of safety requirements that need to be considered during the controller design process . In most applications , these are in the form of state/input constraints and convergence to an equilibrium point , a specific set or a trajectory . Typically , a control strategy that violates these specifications can lead to unsafe behavior . While learning-based methods are promising for solving challenging non-linear control problems , the lack of interpretability and provable safety guarantees impede their use in practical control settings ( Amodei et al. , 2016 ) . Model-based reinforcement learning ( RL ) with planning uses a surrogate model to minimize the sum of future costs plus a learned value function terminal cost ( Moerland et al. , 2020 ; Lowrey et al. , 2018 ) . Approximated value functions , however , do not offer safety guarantees . By contrast , control theory focuses on these guarantees but it is limited by its assumptions . Thus , there is a gap between theory and practice . A feedback controller stabilizes a system if a local Control Lyapunov Function ( CLF ) function exists for the pair . This requires that the closed-loop response from any initial state results in a smaller value of the CLF at the next state . The existence of such a function is a necessary and sufficient condition for showing stability and convergence ( Khalil , 2014 ) . However , finding an appropriate Lyapunov function is often cumbersome and can be conservative . By exploiting the expressiveness of neural networks ( NNs ) , Lyapunov NNs have been demonstrated as a general tool to produce stability ( safety ) certificates ( Bobiti , 2017 ; Bobiti & Lazar , 2016 ) and also improve an existing controller ( Berkenkamp et al. , 2017 ; Gallieri et al. , 2019 ; Chang et al. , 2019 ) . In most of these settings , the controller is parameterized through a NN as well . The flexibility provided by this choice comes at the cost of increased sample complexity , which is often expensive in real-world safety-critical systems . In this work , we aim to overcome this limitation by leveraging an initial set of one-step transitions from an unknown expert demonstrator ( which may be sub-optimal ) and by using a learned Lyapunov function and surrogate model within an Model Predictive Control ( MPC ) formulation . Our key contribution is an algorithmic framework , Neural Lyapunov MPC ( NLMPC ) , that obtains a single-step horizon MPC for Lyapunov-based control of non-linear deterministic systems with constraints . By treating the learned Lyapunov NN as an estimate of the value function , we provide theoretical results for the performance of the MPC with an imperfect forward model . These results complement the ones by Lowrey et al . ( 2018 ) , which only considers the case of a perfect dynamics model . In our proposed framework , alternate learning is used to train the Lyapunov NN in a supervised manner and to tune the parameters of the MPC . The learned Lyapunov NN is used as the MPC ’ s terminal cost for obtaining closed-loop stability and robustness margins to model errors . For the resulting controller , we show that the size of the stable region can be larger than that from an MPC demonstrator with a longer prediction horizon . To empirically illustrate the efficacy of our approach , we consider constrained non-linear continuous control tasks : torque-limited inverted pendulum and non-holonomic vehicle kinematics . We show that NLMPC can transfer between using an inaccurate surrogate and a nominal forward model , and outperform several baselines in terms of stability . 2 PRELIMINARIES AND ASSUMPTIONS . Controlled Dynamical System Consider a discrete-time , time-invariant , deterministic system : x ( t+ 1 ) = f ( x ( t ) , u ( t ) ) , y ( t ) = x ( t ) , f ( 0 , 0 ) = 0 , ( 1 ) where t ∈ N is the timestep index , x ( t ) ∈ Rnx , u ( t ) ∈ Rnu and y ( t ) ∈ Rny are , respectively , the state , control input , and measurement at timestep t. We assume that the states and measurements are equivalent and the origin is the equilibrium point . Further , the system ( 1 ) is subjected to closed and bounded , convex constraints over the state and input spaces : x ( t ) ∈ X ⊆ Rnx , u ( t ) ∈ U ⊂ Rnu , ∀t > 0 . ( 2 ) The system is to be controlled by a feedback policy , K : Rnx → Rnu . The policy K is considered safe if there exists an invariant set , Xs ⊆ X , for the closed-loop dynamics , inside the constraints . The set Xs is also referred to as the safe-set under K. Namely , every trajectory for the closed-loop system that starts at some x ∈ Xs remains inside this set . If x asymptotically reaches the target , x̄T ∈ Xs , then Xs is a Region of Attraction ( ROA ) . In practice , convergence often occurs to a small set , XT . Lyapunov Conditions and Safety We formally assess the safety of the closed-loop system in terms of the existence of the positively invariant-set , Xs , inside the state constraints . This is done by means of a learned CLF , V ( x ) , given data generated under a ( initially unknown ) policy , K ( x ) . The candidate CLF needs to satisfy certain properties . First , it needs to be upper and lower bounded by strictly increasing , unbounded , positive ( K∞ ) functions ( Khalil , 2014 ) . We focus on optimal control with a quadratic stage cost and assume the origin as the target state : � ( x , u ) = xTQx+ uTRu , Q � 0 , R � 0 . ( 3 ) For above , a possible choice for K∞-function is the scaled sum-of-squares of the states : l��x�22 ≤ V ( x ) ≤ LV �x�22 , ( 4 ) where l� and LV are the minimum eigenvalue of Q and a Lipschitz constant for V respectively . Further for safety , the convergence to a set , XT ⊂ Xs , can be verified by means of the condition : ∀x ∈ Xs\XT , u = K ( x ) ⇒ V ( f ( x , u ) ) − λV ( x ) ≤ 0 , with λ ∈ [ 0 , 1 ) . ( 5 ) This means that to have stability V ( x ) must decrease along the closed-loop trajectory in the annulus . The sets Xs , XT , satisfying ( 5 ) , are ( positively ) invariant . If they are inside constraints , i.e . Xs ⊆ X , then they are safe . For a valid Lyapunov function V , the outer safe-set can be defined as a level-set : Xs = { x ∈ X : V ( x ) ≤ ls } . ( 6 ) For further definitions , we refer the reader to Blanchini & Miani ( 2007 ) ; Kerrigan ( 2000 ) . If condition ( 5 ) , holds everywhere in Xs , then the origin is a stable equilibrium ( XT = { 0 } ) . If ( most likely ) this holds only outside a non-empty inner set , XT = { x ∈ X : V ( x ) ≤ lT } ⊂ Xs , with XT ⊃ { 0 } , then the system converges to a neighborhood of the origin and remains there in the future . Approach Rationale We aim to match or enlarge the safe region of an unknown controller , Ki ( x ) . For a perfect model , f , and a safe set X ( i ) s , there exists an α � 1 , such that the one-step MPC : K ( x ) = argmin u∈U , f ( x , u ) ∈X ( i ) s αV ( f ( x , u ) ) + � ( x , u ) , ( 7 ) results in a new safe set , X ( i+1 ) s = C ( X ( i ) s ) , the one-step controllable set of X ( i ) s and the feasible region of ( 7 ) , X ( i+1 ) s ⊇ X ( i ) s . We soften the state constraints in ( 7 ) and use it recursively to estimate X ( j ) s , j > i . We formulate an algorithm that learns the parameter α as well as the safe set . We train a neural network via SGD to approximate V , hence the ROA estimate will not always increase through iterations . To aim for max ROA and minimum MPC horizon , we use cross-validation and verification . We motivate our work by extending theoretical results on MPC stability and a sub-optimality bound for approximate f and V . Finally , we provide an error bound on the learned f for having stability . Learning and Safety Verification We wish to learn V ( x ) and Xs from one-step on-policy rollouts , as well as a forward model f̂ ( x , u ) . After the learning , the level ls defining set Xs will be refined and its safety formally verified a posteriori . This is done by evaluating ( 5 ) using the model , starting from a large set of states sampled uniformly within Xs\XT . We progressively decrease the level ls starting from the learned one , and also increase the inner level lT , starting from zero , such that condition ( 5 ) holds for n ≥ ns samples in Xs\XT . The number of verifying samples , ns , provides a probability lower bound on safety , namely Psafe ( Xs\XT ) ≥ p ( ns ) , as detailed in ( Bobiti & Lazar , 2016 ) . The algorithm is detailed in appendix and based on ( Bobiti & Lazar , 2016 ) . For our theoretical results , we assume the search terminates with Psafe ( Xs\XT ) ≈ 1 and consider the condition deterministic . NN-based dynamics model In some MPC applications , it might not be possible to gather sufficient data from demonstrations in order to be able to learn a model that predicts over long sequences . One-step or few-steps dynamics learning based on NNs can suffer when the model is unrolled for longer time . For instance , errors can accumulate through the horizon due to small instabilities either from the physical system or as artifacts from short sequence learning . Although some mitigations are possible for specific architectures or longer sequences ( Armenio et al. , 2019 ; Doan et al. , 2019 ; Pathak et al. , 2017 ; Ciccone et al. , 2018 ) , we formulate our MPC to allow for a very short horizon and unstable dynamics . Since we learn a surrogate NN forward model , f̂ ( x , u ) , from one-step trajectories , we will assume this to have a locally bounded one-step-ahead prediction error , w ( t ) , where : w = f ( x , u ) − f̂ ( x , u ) , �w�2 ≤ µ , ∀ ( x , u ) ∈ X̃× U , ( 8 ) for some compact set of states , X̃ ⊇ X . We also assume that both f and f̂ are locally Lipschitz in this set , with constants Lfx , Lfu , and Lf̂x , Lf̂u respectively . A conservative value of µ can be inferred from these constants as the input and state sets are bounded . It can also be estimated from a test set .
In this paper the author proposed an MPC algorithm in which both the dynamics function and the Lyapunov function are parameterized with neural networks.. Specifically leveraging the results of Lyapunov networks (2018 CORL paper: https://arxiv.org/abs/1808.00924) for learning Lyapunov functions, the authors derived an MPC algorithm for quadratic cost/reward problems and also proved the stability, robustness, and sub-optimality performance. To demonstrate the effectiveness of the algorithms, the authors also evaluated this approach on the simple inverted pendulum and car kinematics tasks.
SP:1e88ff3d6daf6ca26d2f9d504c5ff282af5d3659
Understanding and Mitigating Accuracy Disparity in Regression
1 INTRODUCTION . Recent progress in machine learning has led to its widespread use in many high-stakes domains , such as criminal justice , healthcare , student loan approval , and hiring . Meanwhile , it has also been widely observed that accuracy disparity could occur inadvertently under various scenarios in practice ( Barocas & Selbst , 2016 ) . For example , errors are inclined to occur for individuals of certain underrepresented demographic groups ( Kim , 2016 ) . In other cases , Buolamwini & Gebru ( 2018 ) showed that notable accuracy disparity gaps exist across different racial and gender demographic subgroups on several real-world image classification systems . Moreover , Bagdasaryan et al . ( 2019 ) found out that a differentially private model even enlarges such accuracy disparity gaps . Such accuracy disparity gaps across demographic subgroups not only raise concerns in high-stake applications but also can be utilized by malicious parties causing information leakage ( Yaghini et al. , 2019 ) . Despite the ample needs of accuracy parity , most prior work limits its scope to studying the problem in binary classification settings ( Hardt et al. , 2016 ; Zafar et al. , 2017b ; Zhao et al. , 2019 ; Jiang et al. , 2019 ) . In a seminal work , Chen et al . ( 2018 ) analyzed the impact of data collection on accuracy disparity in general learning models . They provided a descriptive analysis of such parity gaps and advocated for collecting more training examples and introducing more predictive variables . While such a suggestion is feasible in applications where data collection and labeling is cheap , it is not applicable in domains where it is time-consuming , expensive , or even infeasible to collect more data , e.g. , in autonomous driving , education , etc . Our Contributions In this paper , we provide a prescriptive analysis of accuracy disparity and aim at providing algorithmic interventions to reduce the disparity gap between different demographic subgroups in the regression setting . To start with , we first formally characterize why accuracy disparity appears in regression problems by depicting the feasible region of the underlying group-wise errors . We also provide a lower bound on the joint error and a complementary upper bound on the error gap across groups . Based on these results , we illustrate why regression models aiming to minimize the global loss will inevitably lead to accuracy disparity if the input distributions or decision functions differ across groups ( see Figure 1a ) . We further propose an error decomposition theorem that decomposes the accuracy disparity into the distance between the label populations and the distance between conditional representations . To mitigate such disparities , we propose two algorithms to reduce accuracy disparity via joint distribution alignment with total variation distance and Wasserstein distance , respectively . Furthermore , we analyze the game-theoretic optima of the objective function and illustrate the principle of our algorithms from a game-theoretic perspective ( see Figure 1b ) . To corroborate the effectiveness of our proposed algorithms in reducing accuracy disparity , we conduct experiments on four real-world datasets . Experimental results suggest that our proposed algorithms help to mitigate accuracy disparity while maintaining the predictive power of the regression models . We believe our theoretical results contribute to the understanding of why accuracy disparity occurs in machine learning models , and the proposed algorithms provides an alternative for intervention in real-world scenarios where accuracy parity is desired but collecting more data/features is time-consuming or infeasible . 2 PRELIMINARIES . Notation We use X ⊆ Rd and Y ⊆ R to denote the input and output space . We use X and Y to denote random variables which take values in X and Y , respectively . Lower case letters x and y denote the instantiation ofX and Y . We useH ( X ) to denote the Shannon entropy of random variable X , H ( X | Y ) to denote the conditional entropy of X given Y , and I ( X ; Y ) to denote the mutual information between X and Y . To simplify the presentation , we use A ∈ { 0 , 1 } as the sensitive attribute , e.g. , gender , race , etc . LetH be the hypothesis class of regression models . In other words , for h ∈ H , h : X → Y is a predictor . Note that even if the predictor does not explicitly take the sensitive attribute A as an input variable , the prediction can still be biased due to the correlations with other input variables . In this work we study the stochastic setting where there is a joint distribution D over X , Y and A from which the data are sampled . For a ∈ { 0 , 1 } and y ∈ R , we use Da to denote the conditional distribution of D given A = a and Dy to denote the conditional distribution of D given Y = y . For an event E , D ( E ) denotes the probability of E under D. Given a feature transformation function g : X → Z that maps instances from the input space X to feature space Z , we define g ] D : = D ◦ g−1 to be the induced ( pushforward ) distribution of D under g , i.e. , for any event E′ ⊆ Z , g ] D ( E′ ) : = D ( { x ∈ X | g ( x ) ∈ E′ } ) . We use ( · ) + to indicate the value of a variable remains unchanged if it is positive or otherwise 0 , i.e. , ( Y ) + equals to Y if the value of Y is positive or otherwise 0 . Given a joint distribution D , the error of a predictor h under D is defined as ErrD ( h ) : = ED [ ( Y − h ( X ) ) 2 ] . To make the notation more compact , we may drop the subscript D when it is clear from the context . Furthermore , we also use MSED ( Ŷ , Y ) to denote the mean squared loss between the predicted variable Ŷ = h ( X ) and the true label Y over the joint distribution D. Similarly , we also use CED ( A ‖  ) denote the cross-entropy loss between the predicted variable  and the true label A over the joint distribution D. Throughout the paper , we make the following standard assumption in regression problems : Assumption 2.1 . There exists M > 0 , such that for any hypothesis H 3 h : X → Y , ‖h‖∞ ≤M and |Y | ≤M . Problem Setup We study the fair regression problem : the goal is to learn a regressor that is fair in the sense that the errors of the regressor are approximately equal across the groups given by the sensitive attribute A . We assume that the sensitive attribute A is only available to the learner during the training phase and is not visible during the inference phase . We would like to point out that there are many other different and important definitions of fairness ( Narayanan , 2018 ) even in the sub-category of group fairness , and our discussion is by no means comprehensive . For example , two frequently used definitions of fairness in the literature are the so-called statistical parity ( Dwork et al. , 2012 ) and equalized odds ( Hardt et al. , 2016 ) . Nevertheless , throughout this paper we mainly focus accuracy parity as our fairness notion , due to the fact that machine learning systems have been shown to exhibit substantial accuracy disparities between different demographic subgroups ( Barocas & Selbst , 2016 ; Kim , 2016 ; Buolamwini & Gebru , 2018 ) . This observation has already brought huge public attention ( e.g. , see New York Times , The Verge , and Insurance Journal ) and calls for machine learning systems that ( at least approximately ) satisfy accuracy parity . Formally , accuracy parity is defined as follows : Definition 2.1 ( Accuracy Parity ) . Given a joint distribution D , a predictor h satisfies accuracy parity if ErrD0 ( h ) = ErrD1 ( h ) . The violation of accuracy parity is also known as disparate mistreatment ( Zafar et al. , 2017a ) . In practice the exact equality of on accuracy between two groups is often hard to ensure , so we define error gap to measure how well the model satisfies accuracy parity : Definition 2.2 ( Error Gap ) . Given a joint distributionD , the error gap of a hypothesis h is ∆Err ( h ) : = |ErrD0 ( h ) − ErrD1 ( h ) | . By definition , if a model satisfies accuracy parity , ∆Err ( h ) will be zero . Next we introduce two distance metrics that will be used in our theoretical analysis and algorithm design : • Total variation distance : it measures the largest possible difference between the probabilities that the two probability distributions can assign to the same event E. We use dTV ( P , Q ) to denote the total variation : dTV ( P , Q ) : = sup E |P ( E ) −Q ( E ) | . • Wasserstein distance : the Wasserstein distance between two probability distributions is W1 ( P , Q ) = sup f∈ { f : ‖f‖L≤1 } ∣∣∣∣∫ Ω fdP − ∫ Ω fdQ ∣∣∣∣ , where ‖f‖L is the Lipschitz semi-norm of a real-valued function of f and Ω is the sample space over which two probability distributions P and Q are defined . By the Kantorovich-Rubinstein duality theorem ( Villani , 2008 ) , we recover the primal form of the Wasserstein distance , defined as W1 ( P , Q ) : = inf γ∈Γ ( P , Q ) ∫ d ( X , Y ) dγ ( X , Y ) , where Γ ( P , Q ) denotes the collection of all couplings of P andQ , andX and Y denote the random variables with law P and Q respectively . Note that we use L1 distance for d ( · , · ) throughout the paper , but the extensions to other distance , e.g. , L2 distance , is straightforward . 3 MAIN RESULTS . In this section , we first characterize why accuracy disparity arises in regression models . More specifically , given a hypothesis h ∈ H , we first describe the feasible region of ErrD0 and ErrD1 by proving a lower bound of joint errors and an upper bound of the error gap . Then , we give a geometric interpretation to visualize the feasible region of ErrD0 and ErrD1 and illustrate how error gap arises when learning a hypothesis h that minimizes the global squared error . We further analyze the accuracy disparity by decomposing it into the distance between label populations and the distance between conditional representations . Motivated by the decomposition , we propose two algorithms to reduce accuracy disparity , connect the game-theoretic optima of the objective functions in our algorithms with our theorems , and describe the practical implementations of the algorithms . Due to the space limit , we defer all the detailed proofs to the appendix . 3.1 BOUNDS ON CONDITIONAL ERRORS AND ACCURACY DISPARITY GAP . When we learn a predictor , the prediction function induces X h−→ Ŷ , where Ŷ is the predicted target variable given by hypothesis h. Hence for any distribution D0 ( D1 ) of X , the predictor also induces a distribution h ] D0 ( h ] D1 ) of Ŷ . Recall that the Wasserstein distance is metric , hence the following chain of triangle inequalities holds : W1 ( D0 ( Y ) , D1 ( Y ) ) ≤W1 ( D0 ( Y ) , h ] D0 ) +W1 ( h ] D0 , h ] D1 ) +W1 ( h ] D1 , D1 ( Y ) ) Intuitively , W1 ( D0 ( Y ) , h ] D0 ) and W1 ( h ] D1 , D1 ( Y ) ) measure the distance between the true label distribution and the predicted one on A = 0/1 cases , respectively . This distance is related to the prediction error of function h conditioned on A = a : Lemma 3.1 . Let Ŷ = h ( X ) ∈ R , then for a ∈ { 0 , 1 } , W1 ( Da ( Y ) , h ] Da ) ≤ √ ErrDa ( h ) . With the above results , we can get the following theorem that characterizes the lower bound of joint error on different groups : Theorem 3.1 . Let Ŷ = h ( X ) ∈ R , we have ErrD0 ( h ) + ErrD1 ( h ) ≥ 12 [ ( W1 ( D0 ( Y ) , D1 ( Y ) ) − W1 ( h ] D0 , h ] D1 ) ) + ] 2 . In Theorem 3.1 , we see that if the difference between the label distribution across groups is large , then statistical disparity could potentially lead to a large joint error . Moreover , Theorem 3.1 could be extended to give a lower bound on the joint error incurred by h as well : Corollary 3.1 . Let Ŷ = h ( X ) ∈ R and α = D ( A = 0 ) ∈ [ 0 , 1 ] , we have ErrD ( h ) ≥ 12 min { α , 1− α } · [ ( W1 ( D0 ( Y ) , D1 ( Y ) ) −W1 ( h ] D0 , h ] D1 ) ) + ] 2 . Next , we upper bound the error gap to gain more insights on accuracy disparity . For a ∈ { 0 , 1 } , define the conditional variance VarDa [ Y |X ] = EDa [ ( Y − EDa [ Y |X ] ) 2|X ] and it shows up as the irreducible error of predicting Y when we only use the knowledge of X . We also know that the optimal decision function conditioned on A = a under mean squared error to be EDa [ Y |X ] . The following theorem characterizes the upper bound of the error gap between two groups : Theorem 3.2 . For any hypothesisH 3 h : X → Y , if the Assumption 2.1 holds , then : ∆Err ( h ) ≤ 8M2 dTV ( D0 ( X ) , D1 ( X ) ) + |ED0 [ VarD0 [ Y |X ] ] − ED1 [ VarD1 [ Y |X ] ] | + 4M min { ED0 [ |ED0 ( Y |X ) − ED1 ( Y |X ) | ] , ED1 [ |ED0 ( Y |X ) − ED1 ( Y |X ) | ] } . Remark Theorem 3.2 upper bounds the error gap across groups by three terms : the first term corresponds to the distance of input distribution across groups , the second term is the noise ( variance ) difference , and third term is the discrepancy of optimal decision functions across different groups . In an ideal and fair setting , where both distributions are noiseless , and the optimal decision functions are insensitive to the group membership , then Theorem 3.2 implies a sufficient condition to guarantee accuracy parity is to find group-invariant representation that minimize dTV ( D0 ( X ) , D1 ( X ) ) . Geometric Interpretation By Theorem 3.1 and Theorem 3.2 , in Figure 1a , we visually illustrate how accuracy disparity arises given data distribution and the learned hypothesis that aims to minimize the global squared error . In Figure 1a , given the hypothesis classH , we use the line ErrD0 + ErrD1 = B to denote the lower bound in Theorem 3.1 and the two lines |ErrD0 − ErrD1 | = A to denote the upper bound in Theorem 3.2 . These three lines form a feasible region ( the green area ) of ErrD0 and ErrD1 under the hypothesis classH . For any optimal hypothesis h which is solely designed to minimize the overall error , the best the hypothesis h can do is to intersect with one of the two bottom vertices . For example , the hypotheses ( the red dotted line and the blue dotted line ) trying to minimize overall error intersect with the two vertices of the region to achieve the smallest ErrD0-intercept ( ErrD1 -intercept ) , due to the imbalance between these two groups . However , since these two vertices are not on the diagonal of the feasible region , there is no guarantee that the hypothesis can satisfy accuracy parity ( ErrD0 = ErrD1 ) , unless we can shrink the width of green area to zero . Conditional Distribution Alignment Reduces Accuracy Parity In Theorem 3.2 , we illustrate how accuracy disparity arises in regression models due to noise , distance between representations , and distance between decision functions . However , it is nearly impossible to collect noiseless data with group-invariant input distribution . Moreover , there is no guarantee that the upper bound will be lower if we learn the group-invariant representation that minimizes dTV ( D0 ( X ) , D1 ( X ) ) alone , since the learned representation could potentially increase the variance . In this regard , we prove a novel upper bound which is free from the above noise term to motivate aligning conditional distributions to mitigate the error disparity across groups . To do so , we relate the error gap to the label distribution and the predicted distribution condition on Y = y : Theorem 3.3 . If Assumption 2.1 holds , then for ∀h ∈ H , let Ŷ = h ( X ) , the following inequality holds : ∆Err ( h ) ≤ 8M2dTV ( D0 ( Y ) , D1 ( Y ) ) + 3M min { ED0 [ |EDy0 [ Ŷ ] − EDy1 [ Ŷ ] | ] , ED1 [ |EDy0 [ Ŷ ] − EDy1 [ Ŷ ] | ] } . Remark We see that the error gap is upper bounded by two terms : the distance between label distributions and the discrepancy between conditional predicted distributions across groups . Note that this is different from the decomposition we have in Theorem 3.2 , where the marginal distribution is on X instead of Y . Given a dataset , the distance of label distributions is a constant since the label distribution is fixed . For the second term , if we can minimize the discrepancy of the conditional predicted distribution across groups , we then have a model that is free of accuracy disparity when the label distribution is well aligned .
This paper deals with a fair regression problem in which the accuracy disparity is employed as a fairness measure. The authors derived the upper and lower bounds on the difference of accuracy between groups to demonstrate that imbalance in the groups' sizes leads to accuracy disparity. Furthermore, they propose learning algorithms enabling us to mitigate the accuracy disparity, which is accomplished by minimizing the upper bound they derived. The empirical evaluations show that the present methods achieve a better trade-off between accuracy and fairness than some existing fair regression methods.
SP:e27fedc58e99952aaa61b87bb613b7e2c3e23126
Understanding and Mitigating Accuracy Disparity in Regression
1 INTRODUCTION . Recent progress in machine learning has led to its widespread use in many high-stakes domains , such as criminal justice , healthcare , student loan approval , and hiring . Meanwhile , it has also been widely observed that accuracy disparity could occur inadvertently under various scenarios in practice ( Barocas & Selbst , 2016 ) . For example , errors are inclined to occur for individuals of certain underrepresented demographic groups ( Kim , 2016 ) . In other cases , Buolamwini & Gebru ( 2018 ) showed that notable accuracy disparity gaps exist across different racial and gender demographic subgroups on several real-world image classification systems . Moreover , Bagdasaryan et al . ( 2019 ) found out that a differentially private model even enlarges such accuracy disparity gaps . Such accuracy disparity gaps across demographic subgroups not only raise concerns in high-stake applications but also can be utilized by malicious parties causing information leakage ( Yaghini et al. , 2019 ) . Despite the ample needs of accuracy parity , most prior work limits its scope to studying the problem in binary classification settings ( Hardt et al. , 2016 ; Zafar et al. , 2017b ; Zhao et al. , 2019 ; Jiang et al. , 2019 ) . In a seminal work , Chen et al . ( 2018 ) analyzed the impact of data collection on accuracy disparity in general learning models . They provided a descriptive analysis of such parity gaps and advocated for collecting more training examples and introducing more predictive variables . While such a suggestion is feasible in applications where data collection and labeling is cheap , it is not applicable in domains where it is time-consuming , expensive , or even infeasible to collect more data , e.g. , in autonomous driving , education , etc . Our Contributions In this paper , we provide a prescriptive analysis of accuracy disparity and aim at providing algorithmic interventions to reduce the disparity gap between different demographic subgroups in the regression setting . To start with , we first formally characterize why accuracy disparity appears in regression problems by depicting the feasible region of the underlying group-wise errors . We also provide a lower bound on the joint error and a complementary upper bound on the error gap across groups . Based on these results , we illustrate why regression models aiming to minimize the global loss will inevitably lead to accuracy disparity if the input distributions or decision functions differ across groups ( see Figure 1a ) . We further propose an error decomposition theorem that decomposes the accuracy disparity into the distance between the label populations and the distance between conditional representations . To mitigate such disparities , we propose two algorithms to reduce accuracy disparity via joint distribution alignment with total variation distance and Wasserstein distance , respectively . Furthermore , we analyze the game-theoretic optima of the objective function and illustrate the principle of our algorithms from a game-theoretic perspective ( see Figure 1b ) . To corroborate the effectiveness of our proposed algorithms in reducing accuracy disparity , we conduct experiments on four real-world datasets . Experimental results suggest that our proposed algorithms help to mitigate accuracy disparity while maintaining the predictive power of the regression models . We believe our theoretical results contribute to the understanding of why accuracy disparity occurs in machine learning models , and the proposed algorithms provides an alternative for intervention in real-world scenarios where accuracy parity is desired but collecting more data/features is time-consuming or infeasible . 2 PRELIMINARIES . Notation We use X ⊆ Rd and Y ⊆ R to denote the input and output space . We use X and Y to denote random variables which take values in X and Y , respectively . Lower case letters x and y denote the instantiation ofX and Y . We useH ( X ) to denote the Shannon entropy of random variable X , H ( X | Y ) to denote the conditional entropy of X given Y , and I ( X ; Y ) to denote the mutual information between X and Y . To simplify the presentation , we use A ∈ { 0 , 1 } as the sensitive attribute , e.g. , gender , race , etc . LetH be the hypothesis class of regression models . In other words , for h ∈ H , h : X → Y is a predictor . Note that even if the predictor does not explicitly take the sensitive attribute A as an input variable , the prediction can still be biased due to the correlations with other input variables . In this work we study the stochastic setting where there is a joint distribution D over X , Y and A from which the data are sampled . For a ∈ { 0 , 1 } and y ∈ R , we use Da to denote the conditional distribution of D given A = a and Dy to denote the conditional distribution of D given Y = y . For an event E , D ( E ) denotes the probability of E under D. Given a feature transformation function g : X → Z that maps instances from the input space X to feature space Z , we define g ] D : = D ◦ g−1 to be the induced ( pushforward ) distribution of D under g , i.e. , for any event E′ ⊆ Z , g ] D ( E′ ) : = D ( { x ∈ X | g ( x ) ∈ E′ } ) . We use ( · ) + to indicate the value of a variable remains unchanged if it is positive or otherwise 0 , i.e. , ( Y ) + equals to Y if the value of Y is positive or otherwise 0 . Given a joint distribution D , the error of a predictor h under D is defined as ErrD ( h ) : = ED [ ( Y − h ( X ) ) 2 ] . To make the notation more compact , we may drop the subscript D when it is clear from the context . Furthermore , we also use MSED ( Ŷ , Y ) to denote the mean squared loss between the predicted variable Ŷ = h ( X ) and the true label Y over the joint distribution D. Similarly , we also use CED ( A ‖  ) denote the cross-entropy loss between the predicted variable  and the true label A over the joint distribution D. Throughout the paper , we make the following standard assumption in regression problems : Assumption 2.1 . There exists M > 0 , such that for any hypothesis H 3 h : X → Y , ‖h‖∞ ≤M and |Y | ≤M . Problem Setup We study the fair regression problem : the goal is to learn a regressor that is fair in the sense that the errors of the regressor are approximately equal across the groups given by the sensitive attribute A . We assume that the sensitive attribute A is only available to the learner during the training phase and is not visible during the inference phase . We would like to point out that there are many other different and important definitions of fairness ( Narayanan , 2018 ) even in the sub-category of group fairness , and our discussion is by no means comprehensive . For example , two frequently used definitions of fairness in the literature are the so-called statistical parity ( Dwork et al. , 2012 ) and equalized odds ( Hardt et al. , 2016 ) . Nevertheless , throughout this paper we mainly focus accuracy parity as our fairness notion , due to the fact that machine learning systems have been shown to exhibit substantial accuracy disparities between different demographic subgroups ( Barocas & Selbst , 2016 ; Kim , 2016 ; Buolamwini & Gebru , 2018 ) . This observation has already brought huge public attention ( e.g. , see New York Times , The Verge , and Insurance Journal ) and calls for machine learning systems that ( at least approximately ) satisfy accuracy parity . Formally , accuracy parity is defined as follows : Definition 2.1 ( Accuracy Parity ) . Given a joint distribution D , a predictor h satisfies accuracy parity if ErrD0 ( h ) = ErrD1 ( h ) . The violation of accuracy parity is also known as disparate mistreatment ( Zafar et al. , 2017a ) . In practice the exact equality of on accuracy between two groups is often hard to ensure , so we define error gap to measure how well the model satisfies accuracy parity : Definition 2.2 ( Error Gap ) . Given a joint distributionD , the error gap of a hypothesis h is ∆Err ( h ) : = |ErrD0 ( h ) − ErrD1 ( h ) | . By definition , if a model satisfies accuracy parity , ∆Err ( h ) will be zero . Next we introduce two distance metrics that will be used in our theoretical analysis and algorithm design : • Total variation distance : it measures the largest possible difference between the probabilities that the two probability distributions can assign to the same event E. We use dTV ( P , Q ) to denote the total variation : dTV ( P , Q ) : = sup E |P ( E ) −Q ( E ) | . • Wasserstein distance : the Wasserstein distance between two probability distributions is W1 ( P , Q ) = sup f∈ { f : ‖f‖L≤1 } ∣∣∣∣∫ Ω fdP − ∫ Ω fdQ ∣∣∣∣ , where ‖f‖L is the Lipschitz semi-norm of a real-valued function of f and Ω is the sample space over which two probability distributions P and Q are defined . By the Kantorovich-Rubinstein duality theorem ( Villani , 2008 ) , we recover the primal form of the Wasserstein distance , defined as W1 ( P , Q ) : = inf γ∈Γ ( P , Q ) ∫ d ( X , Y ) dγ ( X , Y ) , where Γ ( P , Q ) denotes the collection of all couplings of P andQ , andX and Y denote the random variables with law P and Q respectively . Note that we use L1 distance for d ( · , · ) throughout the paper , but the extensions to other distance , e.g. , L2 distance , is straightforward . 3 MAIN RESULTS . In this section , we first characterize why accuracy disparity arises in regression models . More specifically , given a hypothesis h ∈ H , we first describe the feasible region of ErrD0 and ErrD1 by proving a lower bound of joint errors and an upper bound of the error gap . Then , we give a geometric interpretation to visualize the feasible region of ErrD0 and ErrD1 and illustrate how error gap arises when learning a hypothesis h that minimizes the global squared error . We further analyze the accuracy disparity by decomposing it into the distance between label populations and the distance between conditional representations . Motivated by the decomposition , we propose two algorithms to reduce accuracy disparity , connect the game-theoretic optima of the objective functions in our algorithms with our theorems , and describe the practical implementations of the algorithms . Due to the space limit , we defer all the detailed proofs to the appendix . 3.1 BOUNDS ON CONDITIONAL ERRORS AND ACCURACY DISPARITY GAP . When we learn a predictor , the prediction function induces X h−→ Ŷ , where Ŷ is the predicted target variable given by hypothesis h. Hence for any distribution D0 ( D1 ) of X , the predictor also induces a distribution h ] D0 ( h ] D1 ) of Ŷ . Recall that the Wasserstein distance is metric , hence the following chain of triangle inequalities holds : W1 ( D0 ( Y ) , D1 ( Y ) ) ≤W1 ( D0 ( Y ) , h ] D0 ) +W1 ( h ] D0 , h ] D1 ) +W1 ( h ] D1 , D1 ( Y ) ) Intuitively , W1 ( D0 ( Y ) , h ] D0 ) and W1 ( h ] D1 , D1 ( Y ) ) measure the distance between the true label distribution and the predicted one on A = 0/1 cases , respectively . This distance is related to the prediction error of function h conditioned on A = a : Lemma 3.1 . Let Ŷ = h ( X ) ∈ R , then for a ∈ { 0 , 1 } , W1 ( Da ( Y ) , h ] Da ) ≤ √ ErrDa ( h ) . With the above results , we can get the following theorem that characterizes the lower bound of joint error on different groups : Theorem 3.1 . Let Ŷ = h ( X ) ∈ R , we have ErrD0 ( h ) + ErrD1 ( h ) ≥ 12 [ ( W1 ( D0 ( Y ) , D1 ( Y ) ) − W1 ( h ] D0 , h ] D1 ) ) + ] 2 . In Theorem 3.1 , we see that if the difference between the label distribution across groups is large , then statistical disparity could potentially lead to a large joint error . Moreover , Theorem 3.1 could be extended to give a lower bound on the joint error incurred by h as well : Corollary 3.1 . Let Ŷ = h ( X ) ∈ R and α = D ( A = 0 ) ∈ [ 0 , 1 ] , we have ErrD ( h ) ≥ 12 min { α , 1− α } · [ ( W1 ( D0 ( Y ) , D1 ( Y ) ) −W1 ( h ] D0 , h ] D1 ) ) + ] 2 . Next , we upper bound the error gap to gain more insights on accuracy disparity . For a ∈ { 0 , 1 } , define the conditional variance VarDa [ Y |X ] = EDa [ ( Y − EDa [ Y |X ] ) 2|X ] and it shows up as the irreducible error of predicting Y when we only use the knowledge of X . We also know that the optimal decision function conditioned on A = a under mean squared error to be EDa [ Y |X ] . The following theorem characterizes the upper bound of the error gap between two groups : Theorem 3.2 . For any hypothesisH 3 h : X → Y , if the Assumption 2.1 holds , then : ∆Err ( h ) ≤ 8M2 dTV ( D0 ( X ) , D1 ( X ) ) + |ED0 [ VarD0 [ Y |X ] ] − ED1 [ VarD1 [ Y |X ] ] | + 4M min { ED0 [ |ED0 ( Y |X ) − ED1 ( Y |X ) | ] , ED1 [ |ED0 ( Y |X ) − ED1 ( Y |X ) | ] } . Remark Theorem 3.2 upper bounds the error gap across groups by three terms : the first term corresponds to the distance of input distribution across groups , the second term is the noise ( variance ) difference , and third term is the discrepancy of optimal decision functions across different groups . In an ideal and fair setting , where both distributions are noiseless , and the optimal decision functions are insensitive to the group membership , then Theorem 3.2 implies a sufficient condition to guarantee accuracy parity is to find group-invariant representation that minimize dTV ( D0 ( X ) , D1 ( X ) ) . Geometric Interpretation By Theorem 3.1 and Theorem 3.2 , in Figure 1a , we visually illustrate how accuracy disparity arises given data distribution and the learned hypothesis that aims to minimize the global squared error . In Figure 1a , given the hypothesis classH , we use the line ErrD0 + ErrD1 = B to denote the lower bound in Theorem 3.1 and the two lines |ErrD0 − ErrD1 | = A to denote the upper bound in Theorem 3.2 . These three lines form a feasible region ( the green area ) of ErrD0 and ErrD1 under the hypothesis classH . For any optimal hypothesis h which is solely designed to minimize the overall error , the best the hypothesis h can do is to intersect with one of the two bottom vertices . For example , the hypotheses ( the red dotted line and the blue dotted line ) trying to minimize overall error intersect with the two vertices of the region to achieve the smallest ErrD0-intercept ( ErrD1 -intercept ) , due to the imbalance between these two groups . However , since these two vertices are not on the diagonal of the feasible region , there is no guarantee that the hypothesis can satisfy accuracy parity ( ErrD0 = ErrD1 ) , unless we can shrink the width of green area to zero . Conditional Distribution Alignment Reduces Accuracy Parity In Theorem 3.2 , we illustrate how accuracy disparity arises in regression models due to noise , distance between representations , and distance between decision functions . However , it is nearly impossible to collect noiseless data with group-invariant input distribution . Moreover , there is no guarantee that the upper bound will be lower if we learn the group-invariant representation that minimizes dTV ( D0 ( X ) , D1 ( X ) ) alone , since the learned representation could potentially increase the variance . In this regard , we prove a novel upper bound which is free from the above noise term to motivate aligning conditional distributions to mitigate the error disparity across groups . To do so , we relate the error gap to the label distribution and the predicted distribution condition on Y = y : Theorem 3.3 . If Assumption 2.1 holds , then for ∀h ∈ H , let Ŷ = h ( X ) , the following inequality holds : ∆Err ( h ) ≤ 8M2dTV ( D0 ( Y ) , D1 ( Y ) ) + 3M min { ED0 [ |EDy0 [ Ŷ ] − EDy1 [ Ŷ ] | ] , ED1 [ |EDy0 [ Ŷ ] − EDy1 [ Ŷ ] | ] } . Remark We see that the error gap is upper bounded by two terms : the distance between label distributions and the discrepancy between conditional predicted distributions across groups . Note that this is different from the decomposition we have in Theorem 3.2 , where the marginal distribution is on X instead of Y . Given a dataset , the distance of label distributions is a constant since the label distribution is fixed . For the second term , if we can minimize the discrepancy of the conditional predicted distribution across groups , we then have a model that is free of accuracy disparity when the label distribution is well aligned .
This paper theoretically and empirically studies accuracy disparity in regression problems. It proves an information-theoretic lower bound on the joint error and a complementary upper bound on the error gap across groups to depict the feasible region of group-wise errors. It further proposes to achieve accuracy parity theoretically and empirically by learning conditional group-invariant representations using statistical distances.
SP:e27fedc58e99952aaa61b87bb613b7e2c3e23126
CaPC Learning: Confidential and Private Collaborative Learning
Machine learning benefits from large training datasets , which may not always be possible to collect by any single entity , especially when using privacy-sensitive data . In many contexts , such as healthcare and finance , separate parties may wish to collaborate and learn from each other ’ s data but are prevented from doing so due to privacy regulations . Some regulations prevent explicit sharing of data between parties by joining datasets in a central location ( confidentiality ) . Others also limit implicit sharing of data , e.g. , through model predictions ( privacy ) . There is currently no method that enables machine learning in such a setting , where both confidentiality and privacy need to be preserved , to prevent both explicit and implicit sharing of data . Federated learning only provides confidentiality , not privacy , since gradients shared still contain private information . Differentially private learning assumes unreasonably large datasets . Furthermore , both of these learning paradigms produce a central model whose architecture was previously agreed upon by all parties rather than enabling collaborative learning where each party learns and improves their own local model . We introduce Confidential and Private Collaborative ( CaPC ) learning , the first method provably achieving both confidentiality and privacy in a collaborative setting . We leverage secure multiparty computation ( MPC ) , homomorphic encryption ( HE ) , and other techniques in combination with privately aggregated teacher models . We demonstrate how CaPC allows participants to collaborate without having to explicitly join their training sets or train a central model . Each party is able to improve the accuracy and fairness of their model , even in settings where each party has a model that performs well on their own dataset or when datasets are not IID and model architectures are heterogeneous across parties.1 1 INTRODUCTION . The predictions of machine learning ( ML ) systems often reveal private information contained in their training data ( Shokri et al. , 2017 ; Carlini et al. , 2019 ) or test inputs . Because of these limitations , legislation increasingly regulates the use of personal data ( Mantelero , 2013 ) . The relevant ethical ∗Equal contributions , authors ordered alphabetically . †Work done while the author was at Vector Institute . ‡Equal contributions , authors ordered alphabetically . 1Code is available at : https : //github.com/cleverhans-lab/capc-iclr . to evaluate Enc ( q ) onMi and outputs encrypted logits Enc ( ri ) . 1b Each answering party , Pi , generates a random vector r̂i , and sends Enc ( ri − r̂i ) to the querying party , Pi∗ , who decrypts to get ri − r̂i . 1c Each answering party Pi runs Yao ’ s garbled circuit protocol ( Yi ) with querying party Pi∗ to get si for Pi∗ and ŝi for Pi s.t . si + ŝi is the one-hot encoding of argmax of logits . 2 Each answering party sends ŝi to the privacy guardian ( PG ) . The PG sums ŝi from each Pi and adds Laplacian or Gaussian noise for DP . The querying party sums si from each Yi computation . 3 The PG and the querying party run Yao ’ s garbled circuit Ys to obtain argmax of querying party and PG ’ s noisy share . The label is output to the querying party . concerns prompted researchers to invent ML algorithms that protect the privacy of training data and confidentiality of test inputs ( Abadi et al. , 2016 ; Konečnỳ et al. , 2016 ; Juvekar et al. , 2018 ) . Yet , these algorithms require a large dataset stored either in a single location or distributed amongst billions of participants . This is the case for example with federated learning ( McMahan et al. , 2017 ) . Prior algorithms also assume that all parties are collectively training a single model with a fixed architecture . These requirements are often too restrictive in practice . For instance , a hospital may want to improve a medical diagnosis for a patient using data and models from other hospitals . In this case , the data is stored in multiple locations , and there are only a few parties collaborating . Further , each party may also want to train models with different architectures that best serve their own priorities . We propose a new strategy that lets fewer heterogeneous parties learn from each other collaboratively , enabling each party to improve their own local models while protecting the confidentiality and privacy of their data . We call this Confidential and Private Collaborative ( CaPC ) learning . Our strategy improves on confidential inference ( Boemer , 2020 ) and PATE , the private aggregation of teacher ensembles ( Papernot et al. , 2017 ) . Through structured applications of these two techniques , we design a strategy for inference that enables participants to operate an ensemble of heterogeneous models , i.e . the teachers , without having to explicitly join each party ’ s data or teacher model at a single location . This also gives each party control at inference , because inference requires the agreement and participation of each party . In addition , our strategy provides measurable confidentiality and privacy guarantees , which we formally prove . We use the running example of a network of hospitals to illustrate our approach . The hospitals participating in CaPC protocol need guarantees on both confidentiality ( i.e. , data from a hospital can only be read by said hospital ) and privacy ( i.e. , no hospital can infer private information about other hospitals ’ data by observing their predictions ) . First , one hospital queries all the other parties over homomorphic encryption ( HE ) , asking them to label an encrypted input using their own teacher models . This can prevent the other hospitals from reading the input ( Boemer et al. , 2019 ) , an improvement over PATE , and allows the answering hospitals to provide a prediction to the querying hospital without sharing their teacher models . The answering hospitals use multi-party computation ( MPC ) to compute an aggregated label , and add noise during the aggregation to obtain differential privacy guarantees ( Dwork et al. , 2014 ) . This is achieved by a privacy guardian ( PG ) , which then relays the aggregated label to the querying hospital . The PG only needs to be semi-trusted : we operate under the honest-but-curious assumption . The use of MPC ensures that the PG can not decipher each teacher model ’ s individual prediction , and the noise added via noisy argmax mechanism gives differential privacy even when there are few participants . This is a significant advantage over prior decentralized approaches like federated learning , which require billions of participants to achieve differential privacy , because the sensitivity of the histogram used in our aggregation is lower than that of the gradients aggregated in federated learning . Unlike our approach , prior efforts involving few participants thus had to prioritize model utility over privacy and only guarantee confidentiality ( Sheller et al. , 2020 ) . Finally , the querying hospital can learn from this confidential and private label to improve their local model . Since the shared information is a label rather than a gradient , as used by federated learning , CaPC participants do not need to share a common model architecture ; in fact , their architectures can vary throughout the participation in the protocol . This favors model development to a degree which is not possible in prior efforts such as federated learning . We show how participants can instantiate various forms of active and online learning with the labels returned by our protocol : each party participating in the CaPC protocol may ( a ) identify deficiencies of its model throughout its deployment and ( b ) finetune the model with labels obtained by interacting with other parties . Intuitively , we achieve the analog of a doctor querying colleagues for a second opinion on a difficult diagnostic , without having to reveal the patient ’ s medical condition . This protocol leads to improvements in both the accuracy and fairness ( when there is a skew in the data distribution of each participating hospital ) of model predictions for each of the CaPC participants . To summarize , our contributions are the following : • We introduce CaPC learning : a confidential and private collaborative learning platform that provides both confidentiality and privacy while remaining agnostic to ML techniques . • Through a structured application of homomorphic encryption , secure MPC , and private aggregation , we design a protocol for CaPC . We use two-party deep learning inference and design an implementation of the noisy argmax mechanism with garbled circuits . • Our experiments on SVHN and CIFAR10 demonstrate that CaPC enables participants to collaborate and improve the utility of their models , even in the heterogeneous setting where the architectures of their local models differ , and when there are only a few participants . • Further , when the distribution of data drifts across participating parties , we show that CaPC significantly improves fairness metrics because querying parties benefit from knowledge learned by other parties on different data distributions , which is distilled in their predictions . • We release the source code for reproducing all our experiments . 2 BACKGROUND . Before introducing CaPC , we first go over elements of cryptography and differential privacy that are required to understand it . Detailed treatment of these topics can be found in Appendices A and B . 2.1 CRYPTOGRAPHIC PRELIMINARIES FOR CONFIDENTIALITY . The main cryptographic tool used in CaPC is secure multi-party computation ( MPC ) ( Yao , 1986 ) . MPC allows a set of distrusting parties to jointly evaluate a function on their input without revealing anything beyond the output . In general , most practical MPC protocols can be classified into two categories : 1 ) generic MPC protocols that can compute any function with the above security goal ( Malkhi et al. , 2004 ) ; and 2 ) specialized MPC protocols that can be used to compute only selected functions ( e.g. , private set intersection ( Pinkas et al. , 2020 ) , secure machine learning ( Mohassel & Zhang , 2017 ) ) . Although specialized MPC protocols are less general , they are often more efficient in execution time . Protocols in both categories use similar cryptographic building blocks , including ( fully ) homomorphic encryption ( Gentry , 2009 ) , secret sharing ( Shamir , 1979 ) , oblivious transfer ( Rabin , 2005 ) , garbled circuits ( Yao , 1986 ) . To understand our protocol , it is not necessary to know all details about these cryptographic building blocks and thus we describe them in Appendix A.1 . Our work uses these cryptographic preliminaries for secure computation at prediction time , unlike recent approaches , which explore new methods to achieving confidentiality at training time ( Huang et al. , 2020a ; b ) . The cryptographic protocol designed in this paper uses a specialized MPC protocol for securely evaluating a private ML model on private data , and a generic two-party computation protocol to compute an argmax in different forms . For the generic two-party computation , we use a classical Yao ’ s garbled-circuit protocol that can compute any function in Boolean circuit . For secure classification of neural networks , our protocol design is flexible to work with most existing protocols ( Boemer et al. , 2020 ; 2019 ; Gilad-Bachrach et al. , 2016 ; Mishra et al. , 2020 ) . Most existing protocols are different in how they handle linear layers ( e.g . convolution ) and non-linear layers ( e.g . ReLU ) . For instance , one can perform all computations using a fully homomorphic encryption scheme resulting in low communication but very high computation , or using classical MPC techniques with more communication but less computation . Other works ( Juvekar et al. , 2018 ) use a hybrid of both and thus enjoy further improvement in performance ( Mishra et al. , 2020 ) . We discuss it in more details in Appendix A.2 .
This paper works on the problem of collaborative learning while preserving both confidentiality and privacy of the data points. It combines techniques from secure multi-party computation and differential privacy for the same, and improves on confidential inference and PATE in the process. The new technique is called CaPC. Finally, it states empirical results as evidence for the improved accuracy.
SP:e1b814eef558840aef2fba9092482c1b09b1ef30
CaPC Learning: Confidential and Private Collaborative Learning
Machine learning benefits from large training datasets , which may not always be possible to collect by any single entity , especially when using privacy-sensitive data . In many contexts , such as healthcare and finance , separate parties may wish to collaborate and learn from each other ’ s data but are prevented from doing so due to privacy regulations . Some regulations prevent explicit sharing of data between parties by joining datasets in a central location ( confidentiality ) . Others also limit implicit sharing of data , e.g. , through model predictions ( privacy ) . There is currently no method that enables machine learning in such a setting , where both confidentiality and privacy need to be preserved , to prevent both explicit and implicit sharing of data . Federated learning only provides confidentiality , not privacy , since gradients shared still contain private information . Differentially private learning assumes unreasonably large datasets . Furthermore , both of these learning paradigms produce a central model whose architecture was previously agreed upon by all parties rather than enabling collaborative learning where each party learns and improves their own local model . We introduce Confidential and Private Collaborative ( CaPC ) learning , the first method provably achieving both confidentiality and privacy in a collaborative setting . We leverage secure multiparty computation ( MPC ) , homomorphic encryption ( HE ) , and other techniques in combination with privately aggregated teacher models . We demonstrate how CaPC allows participants to collaborate without having to explicitly join their training sets or train a central model . Each party is able to improve the accuracy and fairness of their model , even in settings where each party has a model that performs well on their own dataset or when datasets are not IID and model architectures are heterogeneous across parties.1 1 INTRODUCTION . The predictions of machine learning ( ML ) systems often reveal private information contained in their training data ( Shokri et al. , 2017 ; Carlini et al. , 2019 ) or test inputs . Because of these limitations , legislation increasingly regulates the use of personal data ( Mantelero , 2013 ) . The relevant ethical ∗Equal contributions , authors ordered alphabetically . †Work done while the author was at Vector Institute . ‡Equal contributions , authors ordered alphabetically . 1Code is available at : https : //github.com/cleverhans-lab/capc-iclr . to evaluate Enc ( q ) onMi and outputs encrypted logits Enc ( ri ) . 1b Each answering party , Pi , generates a random vector r̂i , and sends Enc ( ri − r̂i ) to the querying party , Pi∗ , who decrypts to get ri − r̂i . 1c Each answering party Pi runs Yao ’ s garbled circuit protocol ( Yi ) with querying party Pi∗ to get si for Pi∗ and ŝi for Pi s.t . si + ŝi is the one-hot encoding of argmax of logits . 2 Each answering party sends ŝi to the privacy guardian ( PG ) . The PG sums ŝi from each Pi and adds Laplacian or Gaussian noise for DP . The querying party sums si from each Yi computation . 3 The PG and the querying party run Yao ’ s garbled circuit Ys to obtain argmax of querying party and PG ’ s noisy share . The label is output to the querying party . concerns prompted researchers to invent ML algorithms that protect the privacy of training data and confidentiality of test inputs ( Abadi et al. , 2016 ; Konečnỳ et al. , 2016 ; Juvekar et al. , 2018 ) . Yet , these algorithms require a large dataset stored either in a single location or distributed amongst billions of participants . This is the case for example with federated learning ( McMahan et al. , 2017 ) . Prior algorithms also assume that all parties are collectively training a single model with a fixed architecture . These requirements are often too restrictive in practice . For instance , a hospital may want to improve a medical diagnosis for a patient using data and models from other hospitals . In this case , the data is stored in multiple locations , and there are only a few parties collaborating . Further , each party may also want to train models with different architectures that best serve their own priorities . We propose a new strategy that lets fewer heterogeneous parties learn from each other collaboratively , enabling each party to improve their own local models while protecting the confidentiality and privacy of their data . We call this Confidential and Private Collaborative ( CaPC ) learning . Our strategy improves on confidential inference ( Boemer , 2020 ) and PATE , the private aggregation of teacher ensembles ( Papernot et al. , 2017 ) . Through structured applications of these two techniques , we design a strategy for inference that enables participants to operate an ensemble of heterogeneous models , i.e . the teachers , without having to explicitly join each party ’ s data or teacher model at a single location . This also gives each party control at inference , because inference requires the agreement and participation of each party . In addition , our strategy provides measurable confidentiality and privacy guarantees , which we formally prove . We use the running example of a network of hospitals to illustrate our approach . The hospitals participating in CaPC protocol need guarantees on both confidentiality ( i.e. , data from a hospital can only be read by said hospital ) and privacy ( i.e. , no hospital can infer private information about other hospitals ’ data by observing their predictions ) . First , one hospital queries all the other parties over homomorphic encryption ( HE ) , asking them to label an encrypted input using their own teacher models . This can prevent the other hospitals from reading the input ( Boemer et al. , 2019 ) , an improvement over PATE , and allows the answering hospitals to provide a prediction to the querying hospital without sharing their teacher models . The answering hospitals use multi-party computation ( MPC ) to compute an aggregated label , and add noise during the aggregation to obtain differential privacy guarantees ( Dwork et al. , 2014 ) . This is achieved by a privacy guardian ( PG ) , which then relays the aggregated label to the querying hospital . The PG only needs to be semi-trusted : we operate under the honest-but-curious assumption . The use of MPC ensures that the PG can not decipher each teacher model ’ s individual prediction , and the noise added via noisy argmax mechanism gives differential privacy even when there are few participants . This is a significant advantage over prior decentralized approaches like federated learning , which require billions of participants to achieve differential privacy , because the sensitivity of the histogram used in our aggregation is lower than that of the gradients aggregated in federated learning . Unlike our approach , prior efforts involving few participants thus had to prioritize model utility over privacy and only guarantee confidentiality ( Sheller et al. , 2020 ) . Finally , the querying hospital can learn from this confidential and private label to improve their local model . Since the shared information is a label rather than a gradient , as used by federated learning , CaPC participants do not need to share a common model architecture ; in fact , their architectures can vary throughout the participation in the protocol . This favors model development to a degree which is not possible in prior efforts such as federated learning . We show how participants can instantiate various forms of active and online learning with the labels returned by our protocol : each party participating in the CaPC protocol may ( a ) identify deficiencies of its model throughout its deployment and ( b ) finetune the model with labels obtained by interacting with other parties . Intuitively , we achieve the analog of a doctor querying colleagues for a second opinion on a difficult diagnostic , without having to reveal the patient ’ s medical condition . This protocol leads to improvements in both the accuracy and fairness ( when there is a skew in the data distribution of each participating hospital ) of model predictions for each of the CaPC participants . To summarize , our contributions are the following : • We introduce CaPC learning : a confidential and private collaborative learning platform that provides both confidentiality and privacy while remaining agnostic to ML techniques . • Through a structured application of homomorphic encryption , secure MPC , and private aggregation , we design a protocol for CaPC . We use two-party deep learning inference and design an implementation of the noisy argmax mechanism with garbled circuits . • Our experiments on SVHN and CIFAR10 demonstrate that CaPC enables participants to collaborate and improve the utility of their models , even in the heterogeneous setting where the architectures of their local models differ , and when there are only a few participants . • Further , when the distribution of data drifts across participating parties , we show that CaPC significantly improves fairness metrics because querying parties benefit from knowledge learned by other parties on different data distributions , which is distilled in their predictions . • We release the source code for reproducing all our experiments . 2 BACKGROUND . Before introducing CaPC , we first go over elements of cryptography and differential privacy that are required to understand it . Detailed treatment of these topics can be found in Appendices A and B . 2.1 CRYPTOGRAPHIC PRELIMINARIES FOR CONFIDENTIALITY . The main cryptographic tool used in CaPC is secure multi-party computation ( MPC ) ( Yao , 1986 ) . MPC allows a set of distrusting parties to jointly evaluate a function on their input without revealing anything beyond the output . In general , most practical MPC protocols can be classified into two categories : 1 ) generic MPC protocols that can compute any function with the above security goal ( Malkhi et al. , 2004 ) ; and 2 ) specialized MPC protocols that can be used to compute only selected functions ( e.g. , private set intersection ( Pinkas et al. , 2020 ) , secure machine learning ( Mohassel & Zhang , 2017 ) ) . Although specialized MPC protocols are less general , they are often more efficient in execution time . Protocols in both categories use similar cryptographic building blocks , including ( fully ) homomorphic encryption ( Gentry , 2009 ) , secret sharing ( Shamir , 1979 ) , oblivious transfer ( Rabin , 2005 ) , garbled circuits ( Yao , 1986 ) . To understand our protocol , it is not necessary to know all details about these cryptographic building blocks and thus we describe them in Appendix A.1 . Our work uses these cryptographic preliminaries for secure computation at prediction time , unlike recent approaches , which explore new methods to achieving confidentiality at training time ( Huang et al. , 2020a ; b ) . The cryptographic protocol designed in this paper uses a specialized MPC protocol for securely evaluating a private ML model on private data , and a generic two-party computation protocol to compute an argmax in different forms . For the generic two-party computation , we use a classical Yao ’ s garbled-circuit protocol that can compute any function in Boolean circuit . For secure classification of neural networks , our protocol design is flexible to work with most existing protocols ( Boemer et al. , 2020 ; 2019 ; Gilad-Bachrach et al. , 2016 ; Mishra et al. , 2020 ) . Most existing protocols are different in how they handle linear layers ( e.g . convolution ) and non-linear layers ( e.g . ReLU ) . For instance , one can perform all computations using a fully homomorphic encryption scheme resulting in low communication but very high computation , or using classical MPC techniques with more communication but less computation . Other works ( Juvekar et al. , 2018 ) use a hybrid of both and thus enjoy further improvement in performance ( Mishra et al. , 2020 ) . We discuss it in more details in Appendix A.2 .
The authors combine several cryptographic techniques to create a federated systems that allows several entities to run classification against all the model held be the participants without revealing information in the process. In particular, the sample to be classified is not revealed to any other party, and differential privacy is used to protect the training data that was used to train the models. A central semi-honest coordinator is used to aggregate the results and add the differential privacy without learning any private information.
SP:e1b814eef558840aef2fba9092482c1b09b1ef30
Why resampling outperforms reweighting for correcting sampling bias with stochastic gradients
1 INTRODUCTION . A data set sampled from a certain population is called biased if the subgroups of the population are sampled at proportions that are significantly different from their underlying population proportions . Applying machine learning algorithms naively to biased training data can raise serious concerns and lead to controversial results ( Sweeney , 2013 ; Kay et al. , 2015 ; Menon et al. , 2020 ) . In many domains such as demographic surveys , fraud detection , identification of rare diseases , and natural disasters prediction , a model trained from biased data tends to favor oversampled subgroups by achieving high accuracy there while sacrificing the performance on undersampled subgroups . Although one can improve by diversifying and balancing during the data collection process , it is often hard or impossible to eliminate the sampling bias due to historical and operational issues . In order to mitigate the biases and discriminations against the undersampled subgroups , a common technique is to preprocess the data set by compensating the mismatch between population proportion and the sampling proportion . Among various approaches , two commonly-used choices are reweighting and resampling . In reweighting , one multiplies each sample with a ratio equal to its population proportion over its sampling proportion . In resampling , on the other hand , one corrects the proportion mismatch by either generating new samples for the undersampled subgroups or selecting a subset of samples for the oversampled subgroups . Both methods result in statistically equivalent models in terms of the loss function ( see details in Section 2 ) . However , it has been observed in practice that resampling often outperforms reweighting significantly , such as boosting algorithms in classification ( Galar et al. , 2011 ; Seiffert et al. , 2008 ) , off-policy prediction in reinforcement learning ( Schlegel et al. , 2019 ) and so on . The obvious question is why . Main contributions . Our main contribution is to provide an answer to this question : resampling outperforms reweighting because of the stochastic gradient-type algorithms used for training . To the best of our knowledge , our explanation is the first theoretical quantitative analysis for this phenomenon . With stochastic gradient descent ( SGD ) being the dominant method for model training , our analysis is based on some recent developments for understanding SGD . We show via simple and explicitly analyzable examples why resampling generates expected results while reweighting performs undesirably . Our theoretical analysis is based on two points of view , one from the dynamical stability perspective and the other from stochastic asymptotics . In addition to the theoretical analysis , we present experimental examples from three distinct categories ( classification , regression , and off-policy prediction ) to demonstrate that resampling outperforms reweighting in practice . This empirical study illustrates that this is a quite general phenomenon when models are trained using stochastic gradient type algorithms . Our theoretical analysis and experiments show clearly that adjusting only the loss functions is not sufficient for fixing the biased data problem . The output can be disastrous if one overlooks the optimization algorithm used in the training . In fact , recent understanding has shown that objective function design and optimization algorithm are closely related , for example optimization algorithms such as SGD play a key role in the generalizability of deep neural networks . Therefore in order to address the biased data issue , we advocate for considering data , model , and optimization as an integrated system . Related work . In a broader scope , resampling and reweighting can be considered as instances of preprocessing the training data to tackle biases of machine learning algorithms . Though there are many well-developed resampling ( Mani & Zhang , 2003 ; He & Garcia , 2009 ; Maciejewski & Stefanowski , 2011 ) and reweighting ( Kumar et al. , 2010 ; Malisiewicz et al. , 2011 ; Chang et al. , 2017 ) techniques , we only focus on the reweighting approaches that do not change the optimization problem . It has been well-known that training algorithms using disparate data can lead to algorithmic discrimination ( Bolukbasi et al. , 2016 ; Caliskan et al. , 2017 ) , and over the years there have been growing efforts to mitigate such biases , for example see ( Amini et al. , 2019 ; Kamiran & Calders , 2012 ; Calmon et al. , 2017 ; Zhao et al. , 2019 ; López et al. , 2013 ) . We also refer to ( Guo et al. , 2017 ; He & Ma , 2013 ; Krawczyk , 2016 ) for a comprehensive review of this growing research field . Our approaches for understanding the dynamics of resampling and reweighting under SGD are based on tools from numerical analysis for stochastic systems . Connections between numerical analysis and stochastic algorithms have been rapidly developing in recent years . The dynamical stability perspective has been used in ( Wu et al. , 2018 ) to show the impact of learning rate and batch size in minima selection . The stochastic differential equations ( SDE ) approach for approximating stochastic optimization methods can be traced in the line of work ( Li et al. , 2017 ; 2019 ; Rotskoff & VandenEijnden , 2018 ; Shi et al. , 2019 ) , just to mention a few . 2 PROBLEM SETUP . Let us consider a population that is comprised of two different groups , where a proportion a1 of the population belongs to the first group , and the rest with the proportion a2 = 1 − a1 belongs to the second ( i.e. , a1 , a2 > 0 and a1 + a2 = 1 ) . In what follows , we shall call a1 and a2 the population proportions . Consider an optimization problem for this population over a parameter θ . For simplicity , we assume that each individual from the first group experiences a loss function V1 ( θ ) , while each individual from the second group has a loss function of type V2 ( θ ) . Here the loss function V1 ( θ ) is assumed to be identical across all members of the first group and the same for V2 ( θ ) across the second group , however it is possible to extend the formulation to allow for loss function variation within each group . Based on this setup , a minimization problem over the whole population is to find θ∗ = arg min θ V ( θ ) , where V ( θ ) ≡ a1V1 ( θ ) + a2V2 ( θ ) . ( 1 ) For a given set Ω of N individuals sampled uniformly from the population , the empirical minimization problem is θ∗ = arg min θ 1 N ∑ r∈Ω Vir ( θ ) , ( 2 ) where ir ∈ { 1 , 2 } denotes which group an individual r belongs to . When N grows , the empirical loss in ( 2 ) is consistent with the population loss in ( 1 ) as there are approximately a1 fraction of samples from the first group and a2 fraction of samples from the second . However , the sampling can be far from uniformly random in reality . Let n1 and n2 with n1+n2 = N denote the number of samples from the first and the second group , respectively . It is convenient to define fi , i = 1 , 2 as the sampling proportions for each group , i.e. , f1 = n1/N and f2 = n2/N with f1 + f2 = 1 . The data set is biased when the sampling proportions f1 and f2 are different from the population proportions a1 and a2 . In such a case , the empirical loss is f1V1 ( θ ) + f2V2 ( θ ) , which is clearly wrong when compared with ( 1 ) . Let us consider two basic strategies to adjust the model : reweighting and resampling . In reweighting , one assigns to each sample r ∈ Ω a weight air/fir and the reweighting loss function is Vw ( θ ) ≡ 1 N ∑ r∈Ω air fir Vir ( θ ) = a1V1 ( θ ) + a2V2 ( θ ) . ( 3 ) In resampling , one either adds samples to the minority group ( i.e. , oversampling ) or removing samples from the majority group ( i.e. , undersampling ) . Although the actual implementation of oversampling and undersampling could be quite sophisticated in order to avoid overfitting or loss of information , mathematically we interpret the resampling as constructing a new set of samples of size M , among which a1M samples are of the first group and a2M samples of the second . The resampling loss function is Vs ( θ ) ≡ 1 M ∑ s Vis ( θ ) = a1V1 ( θ ) + a2V2 ( θ ) . ( 4 ) Notice that both Vw ( θ ) and Vs ( θ ) are consistent with the population loss function V ( θ ) . This means that , under mild conditions on V1 ( θ ) and V2 ( θ ) , a deterministic gradient descent algorithm from a generic initial condition converges to similar solutions for Vw ( θ ) and Vs ( θ ) . For a stochastic gradient descent algorithm , the expectations of the stochastic gradients of Vw ( θ ) and Vs ( θ ) also agree at any θ value . However , as we shall explain below , the training behavior can be drastically different for a stochastic gradient algorithm . The key reason is that the variances experienced for Vw ( θ ) and Vs ( θ ) can be drastically different : computing the variances of gradients for resampling and reweighting reveals that V [ ∇V̂s ( θ ) ] = a1∇V1 ( θ ) ∇V1 ( θ ) T + a2∇V2 ( θ ) ∇V2 ( θ ) T − ( E [ ∇V̂s ( θ ) ] ) 2 , V [ ∇V̂w ( θ ) ] = a21 f1 ∇V1 ( θ ) ∇V1 ( θ ) T + a22 f2 ∇V2 ( θ ) ∇V2 ( θ ) T − ( E [ ∇V̂w ( θ ) ] ) 2 . ( 5 ) These formulas indicate that , when f1/f2 is significantly misaligned with a1/a2 , the variance of reweighting can be much larger . Without knowing the optimal learning rates a priori , it is difficult to select an efficient learning rate for reliable and stable performance for stiff problems , when only reweighting is used . In comparison , resampling is more favorable especially when the choice of learning rates is restrictive . 3 STABILITY ANALYSIS . Let us use a simple example to illustrate why resampling outperforms reweighting under SGD , from the viewpoint of stability . Consider two loss functions V1 and V2 with disjoint supports , V1 ( θ ) = { 1 2 ( θ + 1 ) 2 − 12 , θ ≤ 0 0 , θ > 0 , V2 ( θ ) = { 0 , θ ≤ 0 1 2 ( θ − 1 ) 2 − 12 , θ > 0 , ( 6 ) each of which is quadratic on its support . The population loss function is V ( θ ) = a1V1 ( θ ) +a2V2 ( θ ) , with two local minima at θ = −1 and θ = 1 . The gradients for V1 and V2 are ∇V1 ( θ ) = { θ + 1 , θ ≤ 0 0 , θ > 0. , ∇V2 ( θ ) = { 0 , θ ≤ 0 θ − 1 , θ > 0 . Suppose that the population proportions satisfy a2 > a1 , then θ = 1 is the global minimizer and it is desired that SGD should be stable near it . However , as shown in Figure 1 , when the sampling proportion f2 is significantly less than the population proportion a2 , for reweighting θ = 1 can easily become unstable : even if one starts near the global minimizer θ = 1 , the trajectories for reweighting always gear towards θ = −1 after a few steps ( see Figure 1 ( 1 ) ) . On the other hand , for resampling θ = 1 is quite stable ( see Figure 1 ( 2 ) ) . The expectations of the stochastic gradient are the same for both methods . It is the difference in the second moment that explains why trajectories near the two minima exhibit different behaviors . Our explanation is based on the stability analysis framework used in ( Wu et al. , 2018 ) . By definition , a stationary point θ∗ is stochastically stable if there exists a uniform constant 0 < C ≤ 1 such that E [ ‖θk − θ∗‖2 ] ≤ C‖θ0 − θ∗‖2 , where θk is the k-th iterate of SGD . The stability conditions for resampling and reweighting are stated in the following two lemmas , in which we use η to denote the learning rate . Lemma 1 . For resampling , the conditions for the SGD to be stochastically stable around θ = −1 and θ = 1 are respectively ( 1− ηa1 ) 2 + η2a1a2 ≤ 1 , ( 1− ηa2 ) 2 + η2a1a2 ≤ 1 . Lemma 2 . For reweighting , the condition for the SGD to be stochastically stable around θ = −1 and θ = 1 are respectively ( 1− ηa1 ) 2 + η2f1f2 ( a1 f1 ) 2 ≤ 1 , ( 1− ηa2 ) 2 + η2f1f2 ( a2 f2 ) 2 ≤ 1 . Note that the stability conditions for resampling are independent of the sampling proportions ( f1 , f2 ) , while the ones for reweighting clearly depend on ( f1 , f2 ) . We defer the detailed computations to Appendix A. Lemma 2 shows that reweighting can incur a more stringent stability criterion . Let us consider the case a1 = 12 − , a2 = 1 2 + with a small constant > 0 and f2/f1 1 . For reweighting , the global minimum θ = 1 is stochastically stable only if η ( 1 + f1/f2 ) ≤ 4 + O ( ) . This condition becomes rather stringent in terms of the learning rate η since f1/f2 1 . On the other hand , the local minimizer θ = −1 is stable if η ( 1 + f2/f1 ) ≤ 4 +O ( ) , which could be satisfied for a broader range of η because f2/f1 1 . In other words , for a fixed learning rate η , when the ratio f2/f1 between the sampling proportions is sufficiently small , the desired minimizer θ = 1 is no longer statistically stable with respect to SGD .
This paper delves into a stability analysis of reweighting and resampling for overcoming imbalanced data in supervised learning. Reweighting employs the use of importance ratios to modify a samples weight to the training in turn changing the effective distribution. There are several resampling procedures which all have a similar effect in the analysis, and the authors consider several algorithms for resampling in their experiments. The reweighting approach, while convenient, leads to poorer stability under simplifying assumptions. While this is interesting in its own right, they show that under certain distributions of the data reweighting will actually not converge to the optimal minima, while resampling will. This is motivated by a large collection of work developing resampling methods for imbalanced data, which all come to similar conclusions (i.e. that following a resampling procedure outperforms a reweighting procedure in many, but not all, settings). They follow up with a SDE analysis in another toy problem, which they then extend to more realistic assumptions.
SP:aabb111652a2063c12c8faf92abc12e446d5d377
Why resampling outperforms reweighting for correcting sampling bias with stochastic gradients
1 INTRODUCTION . A data set sampled from a certain population is called biased if the subgroups of the population are sampled at proportions that are significantly different from their underlying population proportions . Applying machine learning algorithms naively to biased training data can raise serious concerns and lead to controversial results ( Sweeney , 2013 ; Kay et al. , 2015 ; Menon et al. , 2020 ) . In many domains such as demographic surveys , fraud detection , identification of rare diseases , and natural disasters prediction , a model trained from biased data tends to favor oversampled subgroups by achieving high accuracy there while sacrificing the performance on undersampled subgroups . Although one can improve by diversifying and balancing during the data collection process , it is often hard or impossible to eliminate the sampling bias due to historical and operational issues . In order to mitigate the biases and discriminations against the undersampled subgroups , a common technique is to preprocess the data set by compensating the mismatch between population proportion and the sampling proportion . Among various approaches , two commonly-used choices are reweighting and resampling . In reweighting , one multiplies each sample with a ratio equal to its population proportion over its sampling proportion . In resampling , on the other hand , one corrects the proportion mismatch by either generating new samples for the undersampled subgroups or selecting a subset of samples for the oversampled subgroups . Both methods result in statistically equivalent models in terms of the loss function ( see details in Section 2 ) . However , it has been observed in practice that resampling often outperforms reweighting significantly , such as boosting algorithms in classification ( Galar et al. , 2011 ; Seiffert et al. , 2008 ) , off-policy prediction in reinforcement learning ( Schlegel et al. , 2019 ) and so on . The obvious question is why . Main contributions . Our main contribution is to provide an answer to this question : resampling outperforms reweighting because of the stochastic gradient-type algorithms used for training . To the best of our knowledge , our explanation is the first theoretical quantitative analysis for this phenomenon . With stochastic gradient descent ( SGD ) being the dominant method for model training , our analysis is based on some recent developments for understanding SGD . We show via simple and explicitly analyzable examples why resampling generates expected results while reweighting performs undesirably . Our theoretical analysis is based on two points of view , one from the dynamical stability perspective and the other from stochastic asymptotics . In addition to the theoretical analysis , we present experimental examples from three distinct categories ( classification , regression , and off-policy prediction ) to demonstrate that resampling outperforms reweighting in practice . This empirical study illustrates that this is a quite general phenomenon when models are trained using stochastic gradient type algorithms . Our theoretical analysis and experiments show clearly that adjusting only the loss functions is not sufficient for fixing the biased data problem . The output can be disastrous if one overlooks the optimization algorithm used in the training . In fact , recent understanding has shown that objective function design and optimization algorithm are closely related , for example optimization algorithms such as SGD play a key role in the generalizability of deep neural networks . Therefore in order to address the biased data issue , we advocate for considering data , model , and optimization as an integrated system . Related work . In a broader scope , resampling and reweighting can be considered as instances of preprocessing the training data to tackle biases of machine learning algorithms . Though there are many well-developed resampling ( Mani & Zhang , 2003 ; He & Garcia , 2009 ; Maciejewski & Stefanowski , 2011 ) and reweighting ( Kumar et al. , 2010 ; Malisiewicz et al. , 2011 ; Chang et al. , 2017 ) techniques , we only focus on the reweighting approaches that do not change the optimization problem . It has been well-known that training algorithms using disparate data can lead to algorithmic discrimination ( Bolukbasi et al. , 2016 ; Caliskan et al. , 2017 ) , and over the years there have been growing efforts to mitigate such biases , for example see ( Amini et al. , 2019 ; Kamiran & Calders , 2012 ; Calmon et al. , 2017 ; Zhao et al. , 2019 ; López et al. , 2013 ) . We also refer to ( Guo et al. , 2017 ; He & Ma , 2013 ; Krawczyk , 2016 ) for a comprehensive review of this growing research field . Our approaches for understanding the dynamics of resampling and reweighting under SGD are based on tools from numerical analysis for stochastic systems . Connections between numerical analysis and stochastic algorithms have been rapidly developing in recent years . The dynamical stability perspective has been used in ( Wu et al. , 2018 ) to show the impact of learning rate and batch size in minima selection . The stochastic differential equations ( SDE ) approach for approximating stochastic optimization methods can be traced in the line of work ( Li et al. , 2017 ; 2019 ; Rotskoff & VandenEijnden , 2018 ; Shi et al. , 2019 ) , just to mention a few . 2 PROBLEM SETUP . Let us consider a population that is comprised of two different groups , where a proportion a1 of the population belongs to the first group , and the rest with the proportion a2 = 1 − a1 belongs to the second ( i.e. , a1 , a2 > 0 and a1 + a2 = 1 ) . In what follows , we shall call a1 and a2 the population proportions . Consider an optimization problem for this population over a parameter θ . For simplicity , we assume that each individual from the first group experiences a loss function V1 ( θ ) , while each individual from the second group has a loss function of type V2 ( θ ) . Here the loss function V1 ( θ ) is assumed to be identical across all members of the first group and the same for V2 ( θ ) across the second group , however it is possible to extend the formulation to allow for loss function variation within each group . Based on this setup , a minimization problem over the whole population is to find θ∗ = arg min θ V ( θ ) , where V ( θ ) ≡ a1V1 ( θ ) + a2V2 ( θ ) . ( 1 ) For a given set Ω of N individuals sampled uniformly from the population , the empirical minimization problem is θ∗ = arg min θ 1 N ∑ r∈Ω Vir ( θ ) , ( 2 ) where ir ∈ { 1 , 2 } denotes which group an individual r belongs to . When N grows , the empirical loss in ( 2 ) is consistent with the population loss in ( 1 ) as there are approximately a1 fraction of samples from the first group and a2 fraction of samples from the second . However , the sampling can be far from uniformly random in reality . Let n1 and n2 with n1+n2 = N denote the number of samples from the first and the second group , respectively . It is convenient to define fi , i = 1 , 2 as the sampling proportions for each group , i.e. , f1 = n1/N and f2 = n2/N with f1 + f2 = 1 . The data set is biased when the sampling proportions f1 and f2 are different from the population proportions a1 and a2 . In such a case , the empirical loss is f1V1 ( θ ) + f2V2 ( θ ) , which is clearly wrong when compared with ( 1 ) . Let us consider two basic strategies to adjust the model : reweighting and resampling . In reweighting , one assigns to each sample r ∈ Ω a weight air/fir and the reweighting loss function is Vw ( θ ) ≡ 1 N ∑ r∈Ω air fir Vir ( θ ) = a1V1 ( θ ) + a2V2 ( θ ) . ( 3 ) In resampling , one either adds samples to the minority group ( i.e. , oversampling ) or removing samples from the majority group ( i.e. , undersampling ) . Although the actual implementation of oversampling and undersampling could be quite sophisticated in order to avoid overfitting or loss of information , mathematically we interpret the resampling as constructing a new set of samples of size M , among which a1M samples are of the first group and a2M samples of the second . The resampling loss function is Vs ( θ ) ≡ 1 M ∑ s Vis ( θ ) = a1V1 ( θ ) + a2V2 ( θ ) . ( 4 ) Notice that both Vw ( θ ) and Vs ( θ ) are consistent with the population loss function V ( θ ) . This means that , under mild conditions on V1 ( θ ) and V2 ( θ ) , a deterministic gradient descent algorithm from a generic initial condition converges to similar solutions for Vw ( θ ) and Vs ( θ ) . For a stochastic gradient descent algorithm , the expectations of the stochastic gradients of Vw ( θ ) and Vs ( θ ) also agree at any θ value . However , as we shall explain below , the training behavior can be drastically different for a stochastic gradient algorithm . The key reason is that the variances experienced for Vw ( θ ) and Vs ( θ ) can be drastically different : computing the variances of gradients for resampling and reweighting reveals that V [ ∇V̂s ( θ ) ] = a1∇V1 ( θ ) ∇V1 ( θ ) T + a2∇V2 ( θ ) ∇V2 ( θ ) T − ( E [ ∇V̂s ( θ ) ] ) 2 , V [ ∇V̂w ( θ ) ] = a21 f1 ∇V1 ( θ ) ∇V1 ( θ ) T + a22 f2 ∇V2 ( θ ) ∇V2 ( θ ) T − ( E [ ∇V̂w ( θ ) ] ) 2 . ( 5 ) These formulas indicate that , when f1/f2 is significantly misaligned with a1/a2 , the variance of reweighting can be much larger . Without knowing the optimal learning rates a priori , it is difficult to select an efficient learning rate for reliable and stable performance for stiff problems , when only reweighting is used . In comparison , resampling is more favorable especially when the choice of learning rates is restrictive . 3 STABILITY ANALYSIS . Let us use a simple example to illustrate why resampling outperforms reweighting under SGD , from the viewpoint of stability . Consider two loss functions V1 and V2 with disjoint supports , V1 ( θ ) = { 1 2 ( θ + 1 ) 2 − 12 , θ ≤ 0 0 , θ > 0 , V2 ( θ ) = { 0 , θ ≤ 0 1 2 ( θ − 1 ) 2 − 12 , θ > 0 , ( 6 ) each of which is quadratic on its support . The population loss function is V ( θ ) = a1V1 ( θ ) +a2V2 ( θ ) , with two local minima at θ = −1 and θ = 1 . The gradients for V1 and V2 are ∇V1 ( θ ) = { θ + 1 , θ ≤ 0 0 , θ > 0. , ∇V2 ( θ ) = { 0 , θ ≤ 0 θ − 1 , θ > 0 . Suppose that the population proportions satisfy a2 > a1 , then θ = 1 is the global minimizer and it is desired that SGD should be stable near it . However , as shown in Figure 1 , when the sampling proportion f2 is significantly less than the population proportion a2 , for reweighting θ = 1 can easily become unstable : even if one starts near the global minimizer θ = 1 , the trajectories for reweighting always gear towards θ = −1 after a few steps ( see Figure 1 ( 1 ) ) . On the other hand , for resampling θ = 1 is quite stable ( see Figure 1 ( 2 ) ) . The expectations of the stochastic gradient are the same for both methods . It is the difference in the second moment that explains why trajectories near the two minima exhibit different behaviors . Our explanation is based on the stability analysis framework used in ( Wu et al. , 2018 ) . By definition , a stationary point θ∗ is stochastically stable if there exists a uniform constant 0 < C ≤ 1 such that E [ ‖θk − θ∗‖2 ] ≤ C‖θ0 − θ∗‖2 , where θk is the k-th iterate of SGD . The stability conditions for resampling and reweighting are stated in the following two lemmas , in which we use η to denote the learning rate . Lemma 1 . For resampling , the conditions for the SGD to be stochastically stable around θ = −1 and θ = 1 are respectively ( 1− ηa1 ) 2 + η2a1a2 ≤ 1 , ( 1− ηa2 ) 2 + η2a1a2 ≤ 1 . Lemma 2 . For reweighting , the condition for the SGD to be stochastically stable around θ = −1 and θ = 1 are respectively ( 1− ηa1 ) 2 + η2f1f2 ( a1 f1 ) 2 ≤ 1 , ( 1− ηa2 ) 2 + η2f1f2 ( a2 f2 ) 2 ≤ 1 . Note that the stability conditions for resampling are independent of the sampling proportions ( f1 , f2 ) , while the ones for reweighting clearly depend on ( f1 , f2 ) . We defer the detailed computations to Appendix A. Lemma 2 shows that reweighting can incur a more stringent stability criterion . Let us consider the case a1 = 12 − , a2 = 1 2 + with a small constant > 0 and f2/f1 1 . For reweighting , the global minimum θ = 1 is stochastically stable only if η ( 1 + f1/f2 ) ≤ 4 + O ( ) . This condition becomes rather stringent in terms of the learning rate η since f1/f2 1 . On the other hand , the local minimizer θ = −1 is stable if η ( 1 + f2/f1 ) ≤ 4 +O ( ) , which could be satisfied for a broader range of η because f2/f1 1 . In other words , for a fixed learning rate η , when the ratio f2/f1 between the sampling proportions is sufficiently small , the desired minimizer θ = 1 is no longer statistically stable with respect to SGD .
This paper provides an analysis of why resampling can be better than reweighting in some cases. By observing the behaviour of resampling and reweighting in simple optimizations with SGD, the theoretical results show that resampling tends to be more stable. The general analysis is based on SDE approximation. Experiments on classification and off-policy evaluation show that resampling can be better in some cases.
SP:aabb111652a2063c12c8faf92abc12e446d5d377
Data augmentation as stochastic optimization
1 INTRODUCTION . Implementing gradient-based optimization in practice requires many choices . These include setting hyperparameters such as learning rate and batch size as well as specifying a data augmentation scheme , a popular set of techniques in which data is augmented ( i.e . modified ) at every step of optimization . Trained model quality is highly sensitive to these choices . In practice they are made using methods ranging from a simple grid search to Bayesian optimization and reinforcement learning ( Cubuk et al. , 2019 ; 2020 ; Ho et al. , 2019 ) . Such approaches , while effective , are often ad-hoc and computationally expensive due to the need to handle scheduling , in which optimization hyperparameters and augmentation choices and strengths are chosen to change over the course of optimization . These empirical results stand in contrast to theoretically grounded approaches to stochastic optimization which provide both provable guarantees and reliable intuitions . The most extensive work in this direction builds on the seminal article ( Robbins & Monro , 1951 ) , which gives provably optimal learning rate schedules for stochastic optimization of strongly convex objectives . While rigorous , these approaches are typically are not sufficiently flexible to address the myriad augmentation types and hyperparameter choices beyond learning rates necessary in practice . This article is a step towards bridging this gap . We provide in §3 a rigorous framework for reinterpreting gradient descent with arbitrary data augmentation as stochastic gradient descent on a time-varying sequence of objectives . This provides a unified language to study traditional stochastic optimization methods such as minibatch SGD together with widely used augmentations such as additive noise ( Grandvalet & Canu , 1997 ) , CutOut ( DeVries & Taylor , 2017 ) , Mixup ( Zhang et al. , 2017 ) and label-preserving transformations ( e.g . color jitter , geometric transformations ( Simard et al. , 2003 ) ) . It also opens the door to studying how to schedule and evaluate arbitrary augmentations , an important topic given the recent interest in learned augmentation Cubuk et al . ( 2019 ) . Quantitative results in our framework are difficult to obtain in full generality due to the complex interaction between models and augmentations . To illustrate the utility of our approach and better understand specific augmentations , we present in §3 and §5 results about arbitrary augmentations for overparameterized linear regression and specialize to additive noise and minibatch SGD in §4 and §6 . While our results apply directly only to simple quadratic losses , they treat very general augmentations . Treating more complex models is left to future work . Our main contributions are : • In Theorem 5.1 , we give sufficient conditions under which gradient descent under any augmentation scheme converges in the setting of overparameterized linear regression . Our result extends classical results of Monro-Robbins type and covers schedules for both learning rate and data augmentation scheme . • We complement the asymptotic results of Theorem 5.1 with quantitative rates of conver- gence furnished in Theorem 5.2 . These rates depend only on the first few moments of the augmented data distribution , underscoring the flexibility of our framework . • In §4 , we analyze additive input noise , a popular augmentation strategy for increasing model robustness . We recover the known fact that it is equivalent to stochastic optimization with ` 2-regularization and find criteria in Theorem 4.1 for jointly scheduling the learning rate and noise level to provably recover the minimal norm solution . • In §6 , we analyze minibatch SGD , recovering known results about rates of convergence for SGD ( Theorem 6.1 ) and novel results about SGD with noise ( Theorem 6.2 ) . 2 RELATED WORK . In addition to the extensive empirical work on data augmentation cited elsewhere in this article , we briefly catalog other theoretical work on data augmentation and learning rate schedules . The latter were first considered in the seminal work Robbins & Monro ( 1951 ) . This spawned a vast literature on rates of convergence for GD , SGD , and their variants . We mention only the relatively recent articles Bach & Moulines ( 2013 ) ; Défossez & Bach ( 2015 ) ; Bottou et al . ( 2018 ) ; Smith et al . ( 2018 ) ; Ma et al . ( 2018 ) and the references therein . The last of these , namely Ma et al . ( 2018 ) , finds optimal choices of learning rate and batch size for SGD in the overparametrized linear setting . A number of articles have also pointed out in various regimes that data augmentation and more general transformations such as feature dropout correspond in part to ` 2-type regularization on model parameters , features , gradients , and Hessians . The first article of this kind of which we are aware is Bishop ( 1995 ) , which treats the case of additive Gaussian noise ( see §4 ) . More recent work in this direction includes Chapelle et al . ( 2001 ) ; Wager et al . ( 2013 ) ; LeJeune et al . ( 2019 ) ; Liu et al . ( 2020 ) . There are also several articles investigating optimal choices of ` 2-regularization for linear models ( cf e.g . Wu et al . ( 2018 ) ; Wu & Xu ( 2020 ) ; Bartlett et al . ( 2020 ) ) . These articles focus directly on the generalization effects of ridge-regularized minima but not on the dynamics of optimization . We also point the reader to Lewkowycz & Gur-Ari ( 2020 ) , which considers optimal choices for the weight decay coefficient empirically in neural networks and analytically in simple models . We also refer the reader to a number of recent attempts to characterize the benefits of data augmentation . In Rajput et al . ( 2019 ) , for example , the authors quantify how much augmented data , produced via additive noise , is needed to learn positive margin classifiers . Chen et al . ( 2019 ) , in contrast , focuses on the case of data invariant under the action of a group . Using the group action to generate label-preserving augmentations , the authors prove that the variance of any function depending only on the trained model will decrease . This applies in particular to estimators for the trainable parameters themselves . Dao et al . ( 2019 ) shows augmented k-NN classification reduces to a kernel method for augmentations transforming each datapoint to a finite orbit of possibilities . It also gives a second order expansion for the proxy loss of a kernel method under such augmentations and interprets how each term affects generalization . Finally , the article Wu et al . ( 2020 ) considers both label preserving and noising augmentations , pointing out the conceptually distinct roles such augmentations play . 3 DATA AUGMENTATION AS STOCHASTIC OPTIMIZATION . A common task in modern machine learning is the optimization of an empirical risk L ( W ; D ) = 1 |D| ∑ ( xj , yj ) ∈D ` ( f ( xj ; W ) , yj ) , ( 3.1 ) where f ( x ; W ) is a parameterized model for a dataset D of input-response pairs ( x , y ) and ` is a per-sample loss . Optimizing W by vanilla gradient descent on L corresponds to the update equation Wt+1 = Wt − ηt∇WL ( Wt ; D ) . In this context , we define a data augmentation scheme to be any procedure that consists , at every step of optimization , of replacing the dataset D by a randomly augmented variant , which we will denote by Dt . Typically , Dt is related to D in some way , but our framework does not explicitly constrain the form of this relationship . Instead , certain conditions on this relationship will be required for our main results Theorems 5.1 and 5.2 to give useful results for a specific augmentation scheme . A data augmentation scheme therefore corresponds to the augmented update equation Wt+1 = Wt − ηt∇WL ( Wt ; Dt ) . ( 3.2 ) SinceDt is a stochastic function ofD , it is natural to view the augmented update rule ( 3.2 ) as a form of stochastic optimization for the proxy loss at time t Lt ( W ) : = EDt [ L ( W ; Dt ) ] . ( 3.3 ) The update ( 3.2 ) corresponds precisely to stochastic optimization for the time-varying objective Lt ( W ) in which the unbiased estimate of its gradient is obtained by evaluating the gradient of L ( W ; Dt ) on a single sampleDt drawn from the augmentation distribution . The connection between data augmentation and this proxy loss was introduced for Gaussian noise in Bishop ( 1995 ) and in general in Chapelle et al . ( 2001 ) , but we now consider it in the context of stochastic optimization . Despite being mathematically straightforward , reformulating data augmentation as stochastic optimization provides a unified language for questions about learning rate schedules and general augmentation schemes including SGD . In general , such questions can be challenging to answer , and even evaluating the proxy loss Lt ( W ) may require significant ingenuity . While we will return to more sophisticated models in future work , we henceforth analyze general augmentations in the simple context of overparameterized linear regression . Though there are many ways to perform linear regression , we restrict to augmented gradient descent both to gain intuition about specific augmentations and to understand the effect of augmentation on optimization . We therefore consider optimizing the entries of a weight matrix W ∈ Rp×n by gradient descent on L ( W ; D ) = 1 |D| ∑ ( x , y ) ∈D ||y −Wx||2F = 1 N ||Y −WX||2F , ( 3.4 ) where our dataset D is summarized by data matrices X ∈ Rn×N and Y ∈ Rp×N , whose N < n columns consist of inputs xi ∈ Rn and associated labels yi ∈ Rp . Following this notation , a data augmentation scheme is specified by prescribing at each time step an augmented dataset Dt consisting of modified data matrices Xt , Yt , whose columns we denote by xi , t ∈ Rn and yi , t ∈ Rp . Here , the number of columns in Xt and Yt ( i.e . the number of datapoints in Dt ) may vary . We now give examples of some commonly used augmentations our framework can address . • Additive Gaussian noise : This is implemented by setting Xt = X + σt · G and Yt = Y for σt > 0 and G a matrix of i.i.d . standard Gaussians . We analyze this in §4 . • Mini-batch SGD : To implement mini-batch SGD with batch size Bt , we can take Xt = XAt and Yt = Y At where At ∈ RN×Bt has i.i.d . columns containing a single non-zero entry equal to 1 chosen uniformly at random . We analyze this in detail in §6 . • Random projection : This is implemented by Xt = ΠtX and Yt = Y , where Πt is an orthogonal projection onto a random subspace . For γt = Tr ( Πt ) /n , the proxy loss is Lt ( W ) = ‖Y − γtWX‖2F + γt ( 1− γt ) n−1 Tr ( XXT ) ‖W‖2F +O ( n−1 ) , which adds a data-dependent ` 2 penalty and applies a Stein shrinkage on input data . • Label-preserving transformations : For a 2-D image viewed as a vector x ∈ Rn , geomet- ric transforms ( with pixel interpolation ) or other label-preserving transforms such as color jitter take the form of linear transforms Rn → Rn . We may implement such augmentations in our framework by Xt = AtX and Yt = Y for some random transform matrix At . • Mixup : To implement Mixup , we can takeXt = XAt and Yt = Y At , whereAt ∈ RN×Bt has i.i.d . columns containing with two random non-zero entries equal to 1− ct and ct with mixing coefficient ct drawn from a Beta ( αt , αt ) distribution for a parameter αt . Our main technical results , Theorems 5.1 and 5.2 , give sufficient conditions for a learning rate schedule ηt and a schedule for the statistics of Xt , Yt under which optimization with augmented gradient descent will provably converge . We state these general results in §5 . Before doing so , we seek to demonstrate both the utility of our framework and the flavor of our results by focusing on the simple but already informative case of additive Gaussian noise .
.** Authors present a novel theoretical framework for assessing the effect of data augmentation (e.g. mini batch SGD), noise addition and the learning rate setup in gradient-based optimization with overparametrized models. Despite the analysis is only performed for linear regression, results extend the well-known Monro-Robbins theorem on rates of convergence. The manuscript is a first step for future analysis of the aforementioned techniques with other type of models and/or loss functions.
SP:a92ce63df0b4384bf0304661c8a8c80553377d57
Data augmentation as stochastic optimization
1 INTRODUCTION . Implementing gradient-based optimization in practice requires many choices . These include setting hyperparameters such as learning rate and batch size as well as specifying a data augmentation scheme , a popular set of techniques in which data is augmented ( i.e . modified ) at every step of optimization . Trained model quality is highly sensitive to these choices . In practice they are made using methods ranging from a simple grid search to Bayesian optimization and reinforcement learning ( Cubuk et al. , 2019 ; 2020 ; Ho et al. , 2019 ) . Such approaches , while effective , are often ad-hoc and computationally expensive due to the need to handle scheduling , in which optimization hyperparameters and augmentation choices and strengths are chosen to change over the course of optimization . These empirical results stand in contrast to theoretically grounded approaches to stochastic optimization which provide both provable guarantees and reliable intuitions . The most extensive work in this direction builds on the seminal article ( Robbins & Monro , 1951 ) , which gives provably optimal learning rate schedules for stochastic optimization of strongly convex objectives . While rigorous , these approaches are typically are not sufficiently flexible to address the myriad augmentation types and hyperparameter choices beyond learning rates necessary in practice . This article is a step towards bridging this gap . We provide in §3 a rigorous framework for reinterpreting gradient descent with arbitrary data augmentation as stochastic gradient descent on a time-varying sequence of objectives . This provides a unified language to study traditional stochastic optimization methods such as minibatch SGD together with widely used augmentations such as additive noise ( Grandvalet & Canu , 1997 ) , CutOut ( DeVries & Taylor , 2017 ) , Mixup ( Zhang et al. , 2017 ) and label-preserving transformations ( e.g . color jitter , geometric transformations ( Simard et al. , 2003 ) ) . It also opens the door to studying how to schedule and evaluate arbitrary augmentations , an important topic given the recent interest in learned augmentation Cubuk et al . ( 2019 ) . Quantitative results in our framework are difficult to obtain in full generality due to the complex interaction between models and augmentations . To illustrate the utility of our approach and better understand specific augmentations , we present in §3 and §5 results about arbitrary augmentations for overparameterized linear regression and specialize to additive noise and minibatch SGD in §4 and §6 . While our results apply directly only to simple quadratic losses , they treat very general augmentations . Treating more complex models is left to future work . Our main contributions are : • In Theorem 5.1 , we give sufficient conditions under which gradient descent under any augmentation scheme converges in the setting of overparameterized linear regression . Our result extends classical results of Monro-Robbins type and covers schedules for both learning rate and data augmentation scheme . • We complement the asymptotic results of Theorem 5.1 with quantitative rates of conver- gence furnished in Theorem 5.2 . These rates depend only on the first few moments of the augmented data distribution , underscoring the flexibility of our framework . • In §4 , we analyze additive input noise , a popular augmentation strategy for increasing model robustness . We recover the known fact that it is equivalent to stochastic optimization with ` 2-regularization and find criteria in Theorem 4.1 for jointly scheduling the learning rate and noise level to provably recover the minimal norm solution . • In §6 , we analyze minibatch SGD , recovering known results about rates of convergence for SGD ( Theorem 6.1 ) and novel results about SGD with noise ( Theorem 6.2 ) . 2 RELATED WORK . In addition to the extensive empirical work on data augmentation cited elsewhere in this article , we briefly catalog other theoretical work on data augmentation and learning rate schedules . The latter were first considered in the seminal work Robbins & Monro ( 1951 ) . This spawned a vast literature on rates of convergence for GD , SGD , and their variants . We mention only the relatively recent articles Bach & Moulines ( 2013 ) ; Défossez & Bach ( 2015 ) ; Bottou et al . ( 2018 ) ; Smith et al . ( 2018 ) ; Ma et al . ( 2018 ) and the references therein . The last of these , namely Ma et al . ( 2018 ) , finds optimal choices of learning rate and batch size for SGD in the overparametrized linear setting . A number of articles have also pointed out in various regimes that data augmentation and more general transformations such as feature dropout correspond in part to ` 2-type regularization on model parameters , features , gradients , and Hessians . The first article of this kind of which we are aware is Bishop ( 1995 ) , which treats the case of additive Gaussian noise ( see §4 ) . More recent work in this direction includes Chapelle et al . ( 2001 ) ; Wager et al . ( 2013 ) ; LeJeune et al . ( 2019 ) ; Liu et al . ( 2020 ) . There are also several articles investigating optimal choices of ` 2-regularization for linear models ( cf e.g . Wu et al . ( 2018 ) ; Wu & Xu ( 2020 ) ; Bartlett et al . ( 2020 ) ) . These articles focus directly on the generalization effects of ridge-regularized minima but not on the dynamics of optimization . We also point the reader to Lewkowycz & Gur-Ari ( 2020 ) , which considers optimal choices for the weight decay coefficient empirically in neural networks and analytically in simple models . We also refer the reader to a number of recent attempts to characterize the benefits of data augmentation . In Rajput et al . ( 2019 ) , for example , the authors quantify how much augmented data , produced via additive noise , is needed to learn positive margin classifiers . Chen et al . ( 2019 ) , in contrast , focuses on the case of data invariant under the action of a group . Using the group action to generate label-preserving augmentations , the authors prove that the variance of any function depending only on the trained model will decrease . This applies in particular to estimators for the trainable parameters themselves . Dao et al . ( 2019 ) shows augmented k-NN classification reduces to a kernel method for augmentations transforming each datapoint to a finite orbit of possibilities . It also gives a second order expansion for the proxy loss of a kernel method under such augmentations and interprets how each term affects generalization . Finally , the article Wu et al . ( 2020 ) considers both label preserving and noising augmentations , pointing out the conceptually distinct roles such augmentations play . 3 DATA AUGMENTATION AS STOCHASTIC OPTIMIZATION . A common task in modern machine learning is the optimization of an empirical risk L ( W ; D ) = 1 |D| ∑ ( xj , yj ) ∈D ` ( f ( xj ; W ) , yj ) , ( 3.1 ) where f ( x ; W ) is a parameterized model for a dataset D of input-response pairs ( x , y ) and ` is a per-sample loss . Optimizing W by vanilla gradient descent on L corresponds to the update equation Wt+1 = Wt − ηt∇WL ( Wt ; D ) . In this context , we define a data augmentation scheme to be any procedure that consists , at every step of optimization , of replacing the dataset D by a randomly augmented variant , which we will denote by Dt . Typically , Dt is related to D in some way , but our framework does not explicitly constrain the form of this relationship . Instead , certain conditions on this relationship will be required for our main results Theorems 5.1 and 5.2 to give useful results for a specific augmentation scheme . A data augmentation scheme therefore corresponds to the augmented update equation Wt+1 = Wt − ηt∇WL ( Wt ; Dt ) . ( 3.2 ) SinceDt is a stochastic function ofD , it is natural to view the augmented update rule ( 3.2 ) as a form of stochastic optimization for the proxy loss at time t Lt ( W ) : = EDt [ L ( W ; Dt ) ] . ( 3.3 ) The update ( 3.2 ) corresponds precisely to stochastic optimization for the time-varying objective Lt ( W ) in which the unbiased estimate of its gradient is obtained by evaluating the gradient of L ( W ; Dt ) on a single sampleDt drawn from the augmentation distribution . The connection between data augmentation and this proxy loss was introduced for Gaussian noise in Bishop ( 1995 ) and in general in Chapelle et al . ( 2001 ) , but we now consider it in the context of stochastic optimization . Despite being mathematically straightforward , reformulating data augmentation as stochastic optimization provides a unified language for questions about learning rate schedules and general augmentation schemes including SGD . In general , such questions can be challenging to answer , and even evaluating the proxy loss Lt ( W ) may require significant ingenuity . While we will return to more sophisticated models in future work , we henceforth analyze general augmentations in the simple context of overparameterized linear regression . Though there are many ways to perform linear regression , we restrict to augmented gradient descent both to gain intuition about specific augmentations and to understand the effect of augmentation on optimization . We therefore consider optimizing the entries of a weight matrix W ∈ Rp×n by gradient descent on L ( W ; D ) = 1 |D| ∑ ( x , y ) ∈D ||y −Wx||2F = 1 N ||Y −WX||2F , ( 3.4 ) where our dataset D is summarized by data matrices X ∈ Rn×N and Y ∈ Rp×N , whose N < n columns consist of inputs xi ∈ Rn and associated labels yi ∈ Rp . Following this notation , a data augmentation scheme is specified by prescribing at each time step an augmented dataset Dt consisting of modified data matrices Xt , Yt , whose columns we denote by xi , t ∈ Rn and yi , t ∈ Rp . Here , the number of columns in Xt and Yt ( i.e . the number of datapoints in Dt ) may vary . We now give examples of some commonly used augmentations our framework can address . • Additive Gaussian noise : This is implemented by setting Xt = X + σt · G and Yt = Y for σt > 0 and G a matrix of i.i.d . standard Gaussians . We analyze this in §4 . • Mini-batch SGD : To implement mini-batch SGD with batch size Bt , we can take Xt = XAt and Yt = Y At where At ∈ RN×Bt has i.i.d . columns containing a single non-zero entry equal to 1 chosen uniformly at random . We analyze this in detail in §6 . • Random projection : This is implemented by Xt = ΠtX and Yt = Y , where Πt is an orthogonal projection onto a random subspace . For γt = Tr ( Πt ) /n , the proxy loss is Lt ( W ) = ‖Y − γtWX‖2F + γt ( 1− γt ) n−1 Tr ( XXT ) ‖W‖2F +O ( n−1 ) , which adds a data-dependent ` 2 penalty and applies a Stein shrinkage on input data . • Label-preserving transformations : For a 2-D image viewed as a vector x ∈ Rn , geomet- ric transforms ( with pixel interpolation ) or other label-preserving transforms such as color jitter take the form of linear transforms Rn → Rn . We may implement such augmentations in our framework by Xt = AtX and Yt = Y for some random transform matrix At . • Mixup : To implement Mixup , we can takeXt = XAt and Yt = Y At , whereAt ∈ RN×Bt has i.i.d . columns containing with two random non-zero entries equal to 1− ct and ct with mixing coefficient ct drawn from a Beta ( αt , αt ) distribution for a parameter αt . Our main technical results , Theorems 5.1 and 5.2 , give sufficient conditions for a learning rate schedule ηt and a schedule for the statistics of Xt , Yt under which optimization with augmented gradient descent will provably converge . We state these general results in §5 . Before doing so , we seek to demonstrate both the utility of our framework and the flavor of our results by focusing on the simple but already informative case of additive Gaussian noise .
The paper considers stochastic gradient descent with noisy gradients. In contrast to the standard setting (e.g., gradient Langevin dynamics) where additive Gaussian noise is added to the model gradient, this work focuses on additive perturbations of data instances. As a result of this, the optimization objective changes throughout the training process because the data is no longer static/fixed but assumed to be sampled from some distribution governing the perturbation process (see Eq. 3.3).
SP:a92ce63df0b4384bf0304661c8a8c80553377d57
Domain-slot Relationship Modeling using a Pre-trained Language Encoder for Multi-Domain Dialogue State Tracking
1 INTRODUCTION . A task-oriented dialogue system is designed to help humans solve tasks by understanding their needs and providing relevant information accordingly . For example , such a system may assist its user with making a reservation at an appropriate restaurant by understanding the user ’ s needs for having a nice dinner . It can also recommend an attraction site to a travelling user , accommodating the user ’ s specific preferences . Dialogue State Tracking ( DST ) is a core component of these taskoriented dialogue systems , which aims to identify the state of the dialogue between the user and the system . DST represents the dialogue state with triplets of the following items : a domain , a slot , a value . A set of { restaurant , price range , cheap } , or of { train , arrive-by , 7:00 pm } are examples of such triplets . Fig . 1 illustrates an example case of the dialogue state during the course of the conversation between the user and the system . Since a dialogue continues for multiple turns of utterances , the DST model should successfully predict the dialogue state at each turn as the conversation proceeds . For multi-domain conversations , the DST model should be able to track dialogue states across different domains and slots . Past research on multi-domain conversations used a placeholder in the model to represent domainslot pairs . A domain-slot pair is inserted into the placeholder in each run , and the model runs repeatedly until it covers all types of the domain-slot pairs . ( Wu et al. , 2019 ; Zhang et al. , 2019 ; Lee et al. , 2019 ) . A DST model generally uses an encoder to extract information from the dialogue context that is relevant to the dialogue state . A typical input for a multi-domain DST model comprises a sequence of the user ’ s and the system ’ s utterances up to the turn t , Xt , and the domain-slot information for domain i and slot j , DiSj . In each run , the model feeds the input for a given domain-slot pair through the encoder . fencoder ( Xt , DiSj ) for i = 1 , · · · , n , j = 1 , · · · , m , ( 1 ) where n and m is the number of domains and slots , respectively . However , because each domain-slot pair is modeled independently , the relationship among the domain-slot pairs can not be learned . For example , if the user first asked for a hotel in a certain place and later asked for a restaurant near that hotel , sharing the information between { hotel , area } and { restaurant , area } would help the model recognize that the restaurant should be in the same area as the hotel . Recent approaches address these issues by modeling the dialogue state of every domain-slot pair in a single run , given a dialogue context ( Chen et al. , 2020 ; Le et al. , 2019 ) . This approach can be represented as follows : fencoder ( Xt , D1S1 , · · · , DnSm ) . ( 2 ) Because the encoder receives all of the domain-slot pairs , the model can factor in the relationship among the domain-slot pairs through the encoding process . For the encoder , these studies used models that are trained from scratch , without pre-training . However , since DST involves natural language text for the dialogue context , using a pre-trained language model can help improve the encoding process . Several studies used BERT ( Devlin et al. , 2019 ) , a pre-trained bidirectional language model , for encoding the dialogue context ( Zhang et al. , 2019 ; Lee et al. , 2019 ; Chao & Lane , 2019 ; Gao et al. , 2019 ) , but did not model the dependencies among different domain-slot pairs . Our approach fills the gap between these previous studies . In this work , we propose a model for multi-domain dialogue state tracking that effectively models the relationship among domain-slot pairs using a pre-trained language encoder . We modify the input structure of BERT , specifically the special token part of it , to adjust it for multi-domain DST . The [ CLS ] token of BERT ( Devlin et al. , 2019 ) is expected to encode the aggregate sequence representation as it runs through BERT , which is used for various downstream tasks such as sentence classification or question answering . This [ CLS ] token can also be used as an aggregate representation for a given dialogue context . However , in a multi-domain dialogue , a single [ CLS ] token has to store information for different domain-slot pairs at the same time . In this respect , we propose to use multiple special tokens , one for each domain-slot pair . Using a separate special token for each domain-slot pair is more effective in storing information for different domains and slots since each token can concentrate on its corresponding domain and slot . We consider two different ways to represent such tokens : DS-merge and DS-split . DS-merge employs a single token to represent a single domain-slot pair . For example , to represent a domain-slot pair of { restaurant , area } , we use a special token DS ( restaurant , area ) . DS-split , on the other hand , employs tokens separately for the domain and slot and then merges them into one to represent a domain-slot pair . For { restaurant , area } , the domain token Drestaurant and the slot token Sarea . is computed separately and then merged . We use { DS } merge and { DS } split to represent the special tokens for DS-merge or DS-split , respectively . Unless it is absolutely necessary to specify whether the tokens are from DS-merge or DS-split , we ’ ll refer to the DS-produced tokens as { DS } tokens , without special distinction , in our descriptions forward . The { DS } tokens , after being encoded by the pre-trained language encoder along with the dialogue context , is used to predict its corresponding domain-slot value for a given dialogue context . 2 RELATED WORKS . Recent work on dialogue state tracking can be largely divided into two groups according to how the slot-values are predicted : fixed-vocabulary and open-vocabulary . The fixed-vocabulary approach , also known as the picklisted-based approach , uses a classification module to predict the dialogue state for each slot from a pre-defined set of candidate values ( Zhong et al. , 2018 ; Nouri & HosseiniAsl , 2018 ; Ramadan et al. , 2018 ; Eric et al. , 2019 ; Lee et al. , 2019 ; Chen et al. , 2020 ) . The openvocabulary approach generates the dialogue state for each domain-slot pair either by using a generative decoder to generate text ( Wu et al. , 2019 ; Hosseini-Asl et al. , 2020 ) or by extracting text spans from the dialogue history ( Gao et al. , 2019 ; Goel et al. , 2019 ; Heck et al. , 2020 ) . There is also an approach to use both picklist-based and span-based methods according to the slot type ( Zhang et al. , 2019 ) . For models that deal with multi-domain dialogue , how they deal with different domain-slot pairs is another way to divide them . The first approach encodes the dialogue context independent of the domain-slot pairs and uses separate modules for each domain-slot pair ( Eric et al. , 2019 ; Gao et al. , 2019 ; Goel et al. , 2019 ; Heck et al. , 2020 ) . The second approach encodes the dialogue context using the domain-slot pair information as the prefix and run the encoder multiple times ( Nouri & Hosseini-Asl , 2018 ; Wu et al. , 2019 ) . Other approaches encode the dialogue context independently but merges it with domain-slot pair information later with a separate fusion module ( Zhong et al. , 2018 ; Ramadan et al. , 2018 ; Lee et al. , 2019 ) . However , none of these models are able to model the relationship among different domain-slot pairs because there is no module that enables the interaction between them . ( Le et al. , 2019 ) and ( Chen et al. , 2020 ) directly models the relationship among different domainslot pairs . ( Le et al. , 2019 ) uses a Fertility decoder to learn potential dependencies across domainslot pairs , but without using a pre-trained language model . Also , their model requires additional data such as system action and delexicalized system responses for its performance . ( Chen et al. , 2020 ) also explicitly models the relationship among different domain-slot pairs by using a Graph Attention Network ( GAT ) ( Veličković et al. , 2018 ) . Schema graphs , which is the relation graph between domains and slots , are utilized for connecting edges in the GAT . Our work is different from these works in that we leverage the power of a pre-trained language encoder for directly modeling the dependencies among different domain-slot pairs . ( Hosseini-Asl et al. , 2020 ) takes a different approach from the others by using multi-task learning that encompasses DST as well as action and response generation with a generative language model GPT-2 ( Radford et al. , 2019 ) . However , since our work is focused on DST , we consider the model that is trained on DST only . In the decoding process , dialogue states for different domain-slot pairs are sequentially generated . 3 PROPOSED METHOD . Our model is composed of three parts . The first is the domain-slot-context ( DSC ) encoder , which encodes the dialogue context along with the special tokens representing domain-slot pairs . Next is slot-gate classifier , which is a preliminary classifier that predicts whether each domain-slot pair is relevant to the dialogue context . The adopted the concept of the slot-gate classifier from ( Wu et al. , 2019 ) and made adjustments to apply to our model . The last is the slot value classifier for predicting the value for each domain-slot pair among the candidate values . In the following descriptions , we assume a dialogue context with a total of T turns . The task is to predict the dialogue state , which are { domain , slot , value } triplets for all domain-slot pairs , for every turn t = 1 , · · · , T , using the dialogue context until each turn . Section 3 show the overview of our proposed model . 3.1 DOMAIN-SLOT-CONTEXT ENCODER . The main structure of our model is the DSC encoder , which uses a pre-trained language to encode the dialogue context along with { DS } tokens . For the pre-trained language encoder , we used ALBERT ( Lan et al. , 2019 ) due to its strong performance on numerous natural language understanding tasks while having fewer parameters compared to other BERT-style encoders . { DS } tokens work like the [ CLS ] token for BERT , encoding information corresponding to its domain-slot pair ( DS-merge ) or domain and slot ( DS-split ) . The set of special tokens for each layout are shown in Eq . ( 3 ) and Eq . ( 4 ) , respectively . In DS-merge , we used special tokens for each individual domain-slot pair . If there are many domain-slot pairs , using this layout can increase the number of special tokens as each domain-slot pair requires a separate special token . In DS-split , we used separate tokens for the domain and slot . To represent a domain-slot pair , we merged the corresponding tokens from each domain and slot by concatenating them . This promotes modeling compositionality , since the same slot token can be used for different domains . These { DS } tokens and the dialogue context are processed through the DSC encoder , which results in each token in { DS } being encoded with contextualized representations according to its domain and slot . { DS } merge = { DS ( domain ( 1 ) , slot ( 1 ) ) , · · · , DS ( domain ( n ) , slot ( m ) ) } ( 3 ) { DS } split = { Ddomain ( 1 ) , · · · , Ddomain ( n ) , Sslot ( 1 ) , · · · , Sslot ( m ) } ( 4 ) Fig . 3 shows the input representation of the DSC encoder . The sequence begins with { DS } tokens . The special token [ CLS ] follows , which encodes the overall information of the dialogue context . For the dialogue context , we added a special token [ SEPu ] to separate each user or system utterance , which is added at the end of each utterance from the user or system . The input ends with a special token [ SEP ] as the end-of-sequence token . 4 types of embeddings are summed up to represent each token embedding . We used the pre-trained word embedding of ALBERT , except for the { DS } tokens , which are randomly initialized . We introduced the token type embedding to differentiate the { DS } tokens , user utterances tokens , and system utterances tokens . For DS-merge , we used a single token type embedding to represent a domain-slot pair , whereas for DS-split , we used two token type embeddings , one for the domain and the other for the slot . We did not apply this embedding for the [ CLS ] token . Position embeddings are also employed from ALBERT , but the index of the positional embedding starts from the [ CLS ] token . We did not use the positional embedding for the { DS } tokens as the order within those tokens is meaningless . Lastly , the segment embedding from ALBERT was used to represent the whole sequence as a single segment , which is the default segment embedding of ALBERT . DSC encoder encodes contextualized embeddings for every input token . However , for the slotgate classifier and slot-value classifier , we only use the special token outputs of the DSC encoder ( [ CLS ] token and { DS } tokens ) . This is formally defined as follows for DS-merge and DS-split , respectively , for turn t : D̂S ( 1,1 ) , · · · , D̂S ( n , m ) , ĈLS = DSCencoder ( [ { DS } merge , CLS , Xt , SEP ] ) , ( 5 ) D̂1 , · · · , D̂n , Ŝ1 · · · , Ŝm , ĈLS = DSCencoder ( [ { DS } split , CLS , Xt , SEP ] ) , ( 6 ) where Xt represents the dialogue context of ( S1 , SEPuU1 , SEPu , · · · , St , SEPu , U t , SEPu ) . U t and St represents the utterance for the tth turn for the user and system respectively . The { DS } tokens and [ CLS ] token with the hat notation ̂ represents the encoded output of the DSC encoder for those special tokens . They are vectors of Rd , where d is the hidden dimension of ALBERT .
This paper proposed a new approach for modeling multi-domain dialogue state tracking by incorporating domain-slot relationship using a pre-trained language encoder. The proposed approach are based on using special tokens to mode l such relationship. Two kinds of special tokens are proposed to represent domain-slot pair, DS_merge token for each specific pair, and tokens for every domain and slots separately
SP:140100004dc307efd67790ef58f67929d3403c67
Domain-slot Relationship Modeling using a Pre-trained Language Encoder for Multi-Domain Dialogue State Tracking
1 INTRODUCTION . A task-oriented dialogue system is designed to help humans solve tasks by understanding their needs and providing relevant information accordingly . For example , such a system may assist its user with making a reservation at an appropriate restaurant by understanding the user ’ s needs for having a nice dinner . It can also recommend an attraction site to a travelling user , accommodating the user ’ s specific preferences . Dialogue State Tracking ( DST ) is a core component of these taskoriented dialogue systems , which aims to identify the state of the dialogue between the user and the system . DST represents the dialogue state with triplets of the following items : a domain , a slot , a value . A set of { restaurant , price range , cheap } , or of { train , arrive-by , 7:00 pm } are examples of such triplets . Fig . 1 illustrates an example case of the dialogue state during the course of the conversation between the user and the system . Since a dialogue continues for multiple turns of utterances , the DST model should successfully predict the dialogue state at each turn as the conversation proceeds . For multi-domain conversations , the DST model should be able to track dialogue states across different domains and slots . Past research on multi-domain conversations used a placeholder in the model to represent domainslot pairs . A domain-slot pair is inserted into the placeholder in each run , and the model runs repeatedly until it covers all types of the domain-slot pairs . ( Wu et al. , 2019 ; Zhang et al. , 2019 ; Lee et al. , 2019 ) . A DST model generally uses an encoder to extract information from the dialogue context that is relevant to the dialogue state . A typical input for a multi-domain DST model comprises a sequence of the user ’ s and the system ’ s utterances up to the turn t , Xt , and the domain-slot information for domain i and slot j , DiSj . In each run , the model feeds the input for a given domain-slot pair through the encoder . fencoder ( Xt , DiSj ) for i = 1 , · · · , n , j = 1 , · · · , m , ( 1 ) where n and m is the number of domains and slots , respectively . However , because each domain-slot pair is modeled independently , the relationship among the domain-slot pairs can not be learned . For example , if the user first asked for a hotel in a certain place and later asked for a restaurant near that hotel , sharing the information between { hotel , area } and { restaurant , area } would help the model recognize that the restaurant should be in the same area as the hotel . Recent approaches address these issues by modeling the dialogue state of every domain-slot pair in a single run , given a dialogue context ( Chen et al. , 2020 ; Le et al. , 2019 ) . This approach can be represented as follows : fencoder ( Xt , D1S1 , · · · , DnSm ) . ( 2 ) Because the encoder receives all of the domain-slot pairs , the model can factor in the relationship among the domain-slot pairs through the encoding process . For the encoder , these studies used models that are trained from scratch , without pre-training . However , since DST involves natural language text for the dialogue context , using a pre-trained language model can help improve the encoding process . Several studies used BERT ( Devlin et al. , 2019 ) , a pre-trained bidirectional language model , for encoding the dialogue context ( Zhang et al. , 2019 ; Lee et al. , 2019 ; Chao & Lane , 2019 ; Gao et al. , 2019 ) , but did not model the dependencies among different domain-slot pairs . Our approach fills the gap between these previous studies . In this work , we propose a model for multi-domain dialogue state tracking that effectively models the relationship among domain-slot pairs using a pre-trained language encoder . We modify the input structure of BERT , specifically the special token part of it , to adjust it for multi-domain DST . The [ CLS ] token of BERT ( Devlin et al. , 2019 ) is expected to encode the aggregate sequence representation as it runs through BERT , which is used for various downstream tasks such as sentence classification or question answering . This [ CLS ] token can also be used as an aggregate representation for a given dialogue context . However , in a multi-domain dialogue , a single [ CLS ] token has to store information for different domain-slot pairs at the same time . In this respect , we propose to use multiple special tokens , one for each domain-slot pair . Using a separate special token for each domain-slot pair is more effective in storing information for different domains and slots since each token can concentrate on its corresponding domain and slot . We consider two different ways to represent such tokens : DS-merge and DS-split . DS-merge employs a single token to represent a single domain-slot pair . For example , to represent a domain-slot pair of { restaurant , area } , we use a special token DS ( restaurant , area ) . DS-split , on the other hand , employs tokens separately for the domain and slot and then merges them into one to represent a domain-slot pair . For { restaurant , area } , the domain token Drestaurant and the slot token Sarea . is computed separately and then merged . We use { DS } merge and { DS } split to represent the special tokens for DS-merge or DS-split , respectively . Unless it is absolutely necessary to specify whether the tokens are from DS-merge or DS-split , we ’ ll refer to the DS-produced tokens as { DS } tokens , without special distinction , in our descriptions forward . The { DS } tokens , after being encoded by the pre-trained language encoder along with the dialogue context , is used to predict its corresponding domain-slot value for a given dialogue context . 2 RELATED WORKS . Recent work on dialogue state tracking can be largely divided into two groups according to how the slot-values are predicted : fixed-vocabulary and open-vocabulary . The fixed-vocabulary approach , also known as the picklisted-based approach , uses a classification module to predict the dialogue state for each slot from a pre-defined set of candidate values ( Zhong et al. , 2018 ; Nouri & HosseiniAsl , 2018 ; Ramadan et al. , 2018 ; Eric et al. , 2019 ; Lee et al. , 2019 ; Chen et al. , 2020 ) . The openvocabulary approach generates the dialogue state for each domain-slot pair either by using a generative decoder to generate text ( Wu et al. , 2019 ; Hosseini-Asl et al. , 2020 ) or by extracting text spans from the dialogue history ( Gao et al. , 2019 ; Goel et al. , 2019 ; Heck et al. , 2020 ) . There is also an approach to use both picklist-based and span-based methods according to the slot type ( Zhang et al. , 2019 ) . For models that deal with multi-domain dialogue , how they deal with different domain-slot pairs is another way to divide them . The first approach encodes the dialogue context independent of the domain-slot pairs and uses separate modules for each domain-slot pair ( Eric et al. , 2019 ; Gao et al. , 2019 ; Goel et al. , 2019 ; Heck et al. , 2020 ) . The second approach encodes the dialogue context using the domain-slot pair information as the prefix and run the encoder multiple times ( Nouri & Hosseini-Asl , 2018 ; Wu et al. , 2019 ) . Other approaches encode the dialogue context independently but merges it with domain-slot pair information later with a separate fusion module ( Zhong et al. , 2018 ; Ramadan et al. , 2018 ; Lee et al. , 2019 ) . However , none of these models are able to model the relationship among different domain-slot pairs because there is no module that enables the interaction between them . ( Le et al. , 2019 ) and ( Chen et al. , 2020 ) directly models the relationship among different domainslot pairs . ( Le et al. , 2019 ) uses a Fertility decoder to learn potential dependencies across domainslot pairs , but without using a pre-trained language model . Also , their model requires additional data such as system action and delexicalized system responses for its performance . ( Chen et al. , 2020 ) also explicitly models the relationship among different domain-slot pairs by using a Graph Attention Network ( GAT ) ( Veličković et al. , 2018 ) . Schema graphs , which is the relation graph between domains and slots , are utilized for connecting edges in the GAT . Our work is different from these works in that we leverage the power of a pre-trained language encoder for directly modeling the dependencies among different domain-slot pairs . ( Hosseini-Asl et al. , 2020 ) takes a different approach from the others by using multi-task learning that encompasses DST as well as action and response generation with a generative language model GPT-2 ( Radford et al. , 2019 ) . However , since our work is focused on DST , we consider the model that is trained on DST only . In the decoding process , dialogue states for different domain-slot pairs are sequentially generated . 3 PROPOSED METHOD . Our model is composed of three parts . The first is the domain-slot-context ( DSC ) encoder , which encodes the dialogue context along with the special tokens representing domain-slot pairs . Next is slot-gate classifier , which is a preliminary classifier that predicts whether each domain-slot pair is relevant to the dialogue context . The adopted the concept of the slot-gate classifier from ( Wu et al. , 2019 ) and made adjustments to apply to our model . The last is the slot value classifier for predicting the value for each domain-slot pair among the candidate values . In the following descriptions , we assume a dialogue context with a total of T turns . The task is to predict the dialogue state , which are { domain , slot , value } triplets for all domain-slot pairs , for every turn t = 1 , · · · , T , using the dialogue context until each turn . Section 3 show the overview of our proposed model . 3.1 DOMAIN-SLOT-CONTEXT ENCODER . The main structure of our model is the DSC encoder , which uses a pre-trained language to encode the dialogue context along with { DS } tokens . For the pre-trained language encoder , we used ALBERT ( Lan et al. , 2019 ) due to its strong performance on numerous natural language understanding tasks while having fewer parameters compared to other BERT-style encoders . { DS } tokens work like the [ CLS ] token for BERT , encoding information corresponding to its domain-slot pair ( DS-merge ) or domain and slot ( DS-split ) . The set of special tokens for each layout are shown in Eq . ( 3 ) and Eq . ( 4 ) , respectively . In DS-merge , we used special tokens for each individual domain-slot pair . If there are many domain-slot pairs , using this layout can increase the number of special tokens as each domain-slot pair requires a separate special token . In DS-split , we used separate tokens for the domain and slot . To represent a domain-slot pair , we merged the corresponding tokens from each domain and slot by concatenating them . This promotes modeling compositionality , since the same slot token can be used for different domains . These { DS } tokens and the dialogue context are processed through the DSC encoder , which results in each token in { DS } being encoded with contextualized representations according to its domain and slot . { DS } merge = { DS ( domain ( 1 ) , slot ( 1 ) ) , · · · , DS ( domain ( n ) , slot ( m ) ) } ( 3 ) { DS } split = { Ddomain ( 1 ) , · · · , Ddomain ( n ) , Sslot ( 1 ) , · · · , Sslot ( m ) } ( 4 ) Fig . 3 shows the input representation of the DSC encoder . The sequence begins with { DS } tokens . The special token [ CLS ] follows , which encodes the overall information of the dialogue context . For the dialogue context , we added a special token [ SEPu ] to separate each user or system utterance , which is added at the end of each utterance from the user or system . The input ends with a special token [ SEP ] as the end-of-sequence token . 4 types of embeddings are summed up to represent each token embedding . We used the pre-trained word embedding of ALBERT , except for the { DS } tokens , which are randomly initialized . We introduced the token type embedding to differentiate the { DS } tokens , user utterances tokens , and system utterances tokens . For DS-merge , we used a single token type embedding to represent a domain-slot pair , whereas for DS-split , we used two token type embeddings , one for the domain and the other for the slot . We did not apply this embedding for the [ CLS ] token . Position embeddings are also employed from ALBERT , but the index of the positional embedding starts from the [ CLS ] token . We did not use the positional embedding for the { DS } tokens as the order within those tokens is meaningless . Lastly , the segment embedding from ALBERT was used to represent the whole sequence as a single segment , which is the default segment embedding of ALBERT . DSC encoder encodes contextualized embeddings for every input token . However , for the slotgate classifier and slot-value classifier , we only use the special token outputs of the DSC encoder ( [ CLS ] token and { DS } tokens ) . This is formally defined as follows for DS-merge and DS-split , respectively , for turn t : D̂S ( 1,1 ) , · · · , D̂S ( n , m ) , ĈLS = DSCencoder ( [ { DS } merge , CLS , Xt , SEP ] ) , ( 5 ) D̂1 , · · · , D̂n , Ŝ1 · · · , Ŝm , ĈLS = DSCencoder ( [ { DS } split , CLS , Xt , SEP ] ) , ( 6 ) where Xt represents the dialogue context of ( S1 , SEPuU1 , SEPu , · · · , St , SEPu , U t , SEPu ) . U t and St represents the utterance for the tth turn for the user and system respectively . The { DS } tokens and [ CLS ] token with the hat notation ̂ represents the encoded output of the DSC encoder for those special tokens . They are vectors of Rd , where d is the hidden dimension of ALBERT .
In this paper, the authors proposed a multidomain state-tracking model that leverages the relationship among different domain-slot pairs. This is done by leveraging the full-attention step over the [CLS] special token and by providing all the domain-slot pairs as a special token to a pre-trained language model (Figure 2 is very clear). To predict the value of the slot $D_{i,j}$, the author concatenates the representation of the [CLS] token, share among all the domain-slots, and the $D_{i,j}$, provided as input, and use a gating mechanism, by only using $D_{i,j}$ representation, to decide whether require as value (i.e., prediction) or not (e.g. None). \
SP:140100004dc307efd67790ef58f67929d3403c67
Learnable Embedding sizes for Recommender Systems
1 INTRODUCTION . The success of deep learning-based recommendation models ( Zhang et al. , 2019 ) demonstrates their advantage in learning feature representations , especially for the most widely-used categorical features . These models utilize the embedding technique to map these sparse categorical features into real-valued dense vectors to extract users ’ preferences and items ’ characteristics . The learned vectors are then fed into prediction models , such as the inner product in FM ( Rendle , 2010 ) , selfattention networks in AutoInt ( Song et al. , 2019 ) , to obtain the prediction results . The embedding table could contain a large number of parameters and cost huge amounts of memory since there are always a large number of raw features . Therefore , the embedding table takes the most storage cost . A good case in point is the YouTube Recommendation Systems ( Covington et al. , 2016 ) . It demands tens of millions of parameters for embeddings of the YouTube video IDs . Considering the increasing demand for instant recommendations in today ’ s service providers , the scale of embedding tables becomes the efficiency bottleneck of deep learning recommendation models . On the other hand , features with uniform embedding size may hard to handle the heterogeneity among different features . For example , some features are more sparse , and assigning too large embedding sizes is likely ∗Chen Gao is the Corresponding Author . The work is performed when Siyi Liu is an intern in Tsinghua University . 1Codes are available at : https : //github.com/ssui-liu/learnable-embed-sizes-for-RecSys to result in over-fitting issues . Consequently , recommendation models tend to be sub-optimal when embedding sizes are uniform for all features . The existing works towards this problem can be divided into two categories . Some works ( Zhang et al. , 2020 ; Shi et al. , 2020 ; Kang et al. , 2020 ) proposed that some closely-related features can share parts of embeddings , reducing the whole cost . Some other works ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) proposed to assign embeddings with flexible sizes to different features relying on human-designed rules ( Ginart et al. , 2019 ) or neural architecture search ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) . Despite a reduced embedding size table , these methods still can not perform well on the two most concerned aspects , recommendation performance and computation cost . Specifically , these methods either obtain poor recommendation performance or spend a lot of time and efforts in getting proper embedding sizes . In this paper , to address the limitations of existing works , we proposed a simple yet effective pruning-based framework , named Plug-in Embedding Pruning ( PEP ) , which can plug in various embedding-based recommendation models . Our method adopts a direct manner–pruning those unnecessary embedding parameters in one shot–to reduce parameter number . Specifically , we introduce the learnable threshold ( s ) that can be jointly trained with embedding parameters via gradient descent . Note that the threshold is utilized to determine the importance of each parameter automatically . Then the elements in the embedding vector that are smaller than the threshold will be pruned . Then the whole embedding table is pruned to make sure each feature has a suitable embedding size . That is , the embedding sizes are flexible . After getting the pruned embedding table , we retrain the recommendation model with the inspiration of the Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2018 ) , which demonstrates that a subnetwork can reach higher accuracy compared with the original network . Based on flexible embedding sizes and the LTH , our PEP can cuts down embedding parameters while maintaining and even boosting the model ’ s recommendation performance . Finally , while there is always a trade-off between recommendation performance and parameter number , our PEP can obtain multiple pruned embedding tables by running only once . In other words , our PEP can generate several memory-efficient embedding matrices once-for-all , which can well handle the various demands for performance or memory-efficiency in real-world applications . We conduct extensive experiments on three public benchmark datasets : Criteo , Avazu , and MovieLens-1M . The results demonstrate that our PEP can not only achieve the best performance compared with state-of-the-art baselines but also reduces 97 % to 99 % parameter usage . Further studies show that our PEP is quite computationally-efficient , requiring a few additional time for embedding-size learning . Furthermore , visualization and interpretability analysis on learned embedding confirm that our PEP can capture features ’ intrinsic properties , which provides insights for future researches . 2 RELATED WORK . Existing works try to reduce the embedding table size of recommendation models from two perspectives , embedding parameter sharing and embedding size selection . 2.1 EMBEDDING PARAMETER SHARING . The core idea of these methods is to make different features re-use embeddings via parameter sharing . Kang et al . ( 2020 ) proposed MGQE that retrieves embedding fragments from a small size of shared centroid embeddings and then generates final embedding by concatenating those fragments . Zhang et al . ( 2020 ) used the double-hash trick to make low-frequency features share a small embedding-table while reducing the likelihood of a hash collision . Shi et al . ( 2020 ) tried to yield a unique embedding vector for each feature category from a small embedding table by combining multiple smaller embedding ( called embedding fragments ) . The combination is usually through concatenation , add , or element-wise multiplication among embedding fragments . However , those methods suffer from two limitations . First , engineers are required to carefully design the parameter-sharing ratio to balance accuracy and memory costs . Second , these rough embeddingsharing strategies can not find the redundant parts in the embedding tables , and thus it always causes a drop in recommendation performance . In this work , our method automatically chooses suitable embedding usages by learning from data . Therefore , engineers can be free from massive efforts for designing sharing strategy , and the model performance can be boosted via removing redundant parameters and alleviating the over-fitting issue . 2.2 EMEBDDING SIZE SELECTION . The embedding-sharing methods assign uniform embedding sizes to every feature , which may still fail to deal with the heterogeneity among different features . Recently , several methods proposed a new paradigm of mixed-dimension embedding table . Specifically , different from assigning all features with uniformed embedding size , different features can have different embedding sizes . MDE ( Ginart et al. , 2019 ) proposed a human-defined rule that the embedding size of a feature is proportional to its popularity . However , this rule-based method is too rough and can not handle those important features with low frequency . Additionally , there are plenty of hyper-parameters in MDE requiring a lot of truning efforts . Some other works ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) assigned adaptive embedding sizes to different features , relying on the advances in Neural Architecture Search ( NAS ) ( Elsken et al. , 2019 ) , a significant research direction of Automated Machine Learning ( AutoML ) ( Hutter et al. , 2019 ) . NIS ( Joglekar et al. , 2020 ) used a reinforcement learning-based algorithm to search embedding size from a candidate set predefined by human experts . A controller is adopted to generate the probability distribution of size for specific feature embeddings . This was further extended by DartsEmb ( Zhao et al. , 2020b ) by replacing the reinforcement learning searching algorithm with differentiable search ( Liu et al. , 2018 ) . AutoDim ( Zhao et al. , 2020a ) allocated different embedding sizes for different feature fields , rather than individual features , in a same way as DartsEmb . DNIS ( Cheng et al. , 2020 ) made the candidate embedding size to be continuous without predefined candidate dimensions . However , all these NAS-based methods require extremely high computation costs in the searching procedure . Even for methods that adopt differential architecture search algorithms , the searching cost is still not affordable . Moreover , these methods also require a great effort in designing proper search spaces . Different from these works , our pruning-based method can be trained quite efficiently and does not require any human efforts in determining the embedding-size candidates . 3 PROBLEM FORMULATION . Feature-based recommender system2 is commonly used in today ’ s information services . In general , deep learning recommendation models take various raw features , including users ’ profiles and items ’ attributes , as input and predict the probability that a user like an item . Specifically , models take the combination of user ’ s profiles and item ’ s attributes , denoted by x , as its ’ input vector , where x is the concatenation of all fields that could defined as follows : x = [ x1 ; x2 ; . . . ; xM ] , ( 1 ) where M denotes the number of total feature fields , and xi is the feature representation ( one-hot vector in usual ) of the i-th field . Then for xi , the embedding-based recommendation models generate corresponding embedding vector vi via following formulation : vi = Vixi , ( 2 ) 2It is also known as click-through rate prediction . where Vi ∈ Rni×d is an embedding matrix of i-th field , ni denotes the number of features in the i-th field , and d denotes the size of embedding vectors . The model ’ s embedding matrices V for all fields of features can be formulated as follows , V = { V1 , V2 , . . . , VM } , ( 3 ) The prediction score could be calculated with V and model ’ s other parameters ( mainly refer to the parameters in prediction model ) Θ as follows , ŷ = φ ( x|V , Θ ) , ( 4 ) where ŷ is the predicted probability and φ represent the prediction model , such as FM ( Rendle , 2010 ) or AutoInt ( Song et al. , 2019 ) . As for model training , to learn the models parameters , the optimizer minimizes the training loss as follows , min L ( V , Θ , D ) , ( 5 ) where D = { x , y } represents the data fed into the model , x denotes the input feature , y denotes the ground truth label , and L is the loss function . The Logloss is the most widely-used loss function in recommendation tasks ( Rendle , 2010 ; Guo et al. , 2017 ; Song et al. , 2019 ) and calculated as follows , L = − 1|D| |D|∑ j=1 ( yj log ( ŷj ) + ( 1− yj ) log ( 1− ŷj ) ) , ( 6 ) where |D| is the total number of training samples and regularization terms are omitted for simplification . 4 METHODOLOGY . 4.1 LEARNABLE EMBEDDING SIZES THROUGH PRUNING . As mentioned above , a feasible solution for memory-efficient embedding learning is to automatically assign different embedding sizes d̃i for different features embeddings vi , which is our goal . However , to learn d̃i directly is infeasible due to its discreteness and extremely-large optimization space . To address it , we propose a novel idea that enforce column-wise sparsity on V , which equivalently shrinks the embedding size . For example , as it shown in Figure 1 , the first value in embedding v1 is pruned and set to zero , leading to a d̃1 = d1 − 1 embedding size in effect . Furthermore , some unimportant feature embeddings , like v3 , are dropped by set all values to zero3 . Thus our method can significantly cut down embedding parameters . Note that the technique of sparse matrix storage help us to significantly save memory usage ( Virtanen et al. , 2020 ) . In such a way , we recast the problem of embedding-size selection into learning column-wise sparsity for the embedding matrix V. To achieve that , we design a sparsity constraint on V as follows , min L , s.t . ||V||0 ≤ k , ( 7 ) where || · ||0 denotes the L0-norm , i.e . the number of non-zeros and k is the parameter budget , which is , the constraint on the total number of embedding parameters . 3Our PEP benefit from such kind of reduction , as demonstrated in Section 5.1 , 5.3 and 5.4 . However , direct optimization of Equation ( 7 ) is NP-hard due to the non-convexity of the L0-norm constraint . To solve this problem , the convex relaxation of L0-norm , called L1-norm , has been studied for a long time ( Taheri & Vorobyov , 2011 ; Beck & Teboulle , 2009 ; Jain et al. , 2014 ) . For example , the Projected Gradient Descent ( PGD ) ( Jain et al. , 2014 ) in particular has been proposed to project parameters to L1 ball to make the gradient computable in almost closed form . Note that the L1 ball projection is also known as Soft Thresholding ( Kusupati et al. , 2020 ) . Nevertheless , such methods are still faced with two major issues . First , the process of projecting the optimization values onto L1 ball requires too much computation cost , especially when the recommendation model has millions of parameters . Second , the parameter budget k requires human experts to manually set at a global level . Considering that features have various importance for recommendation , such operation is obviously sub-optimal . To tackle those two challenges , inspired by Soft Threshold Reparameterization ( Kusupati et al. , 2020 ) , we directly optimize the projection of V and adaptively pruning the V via learnable threshold ( s ) which can be updated by gradient descent . The re-parameterization of V can be formulated as follows , V̂ = S ( V , s ) = sign ( V ) ReLU ( |V| − g ( s ) ) , ( 8 ) where V̂ ∈ RN×d denotes the re-parameterized embedding matrix , and g ( s ) serves as a pruning threshold value , of which sigmoid function is a simple yet effective solution.4 We set the initial value of trainable parameter s ∈ R ( called sinit ) to make sure that the threshold ( s ) g start close to zero . The sign ( · ) function converts positive input value to 1 and negative input value to -1 , and zero input will keep unchanged . As S ( V , s ) is applied to each element of V , and thus the optimization problem in Equation ( 5 ) could be redefined as follows , min L ( S ( V , s ) , Θ , D ) . ( 9 ) Then the trainable pruning parameter s could be jointly optimized with parameters of the recommendation models φ , through the standard back-propagation . Specifically , the gradient descent update equation for V at t-th step is formulated as follows , V ( t+1 ) ← V ( t ) − ηt∇S ( V , s ) L ( S ( V ( t ) , s ) , D ) ∇VS ( V , s ) , ( 10 ) where ηt is t-th step learning rate and denotes the Hadamard product . To solve the nondifferentiablilty of S ( · ) , we use sub-gradient to reformat the update equation as follows , V ( t+1 ) ← V ( t ) − ηt∇S ( V , s ) L ( S ( V ( t ) , s ) , D ) 1 { S ( V ( t ) , s ) 6= 0 } , ( 11 ) where 1 { · } denotes the indicator function . Then , as long as we choose a continuous function g in S ( · ) , then the loss functionL ( S ( V ( t ) , s ) , D ) would be continuous for s. Moreover , the sub-gradient of L with respect to s can be used of gradient descent on s as well . Thanks to the automatic differentiation framework like TensorFlow ( Abadi et al. , 2016 ) and PyTorch ( Paszke et al. , 2019 ) , we are free from above complex gradient computation process . Our PEP code can be found in Figure 7 of Appendix A.2 . As we can see , it is quite simple to incorporate with existing recommendation models , and there is no need for us to manually design the backpropagation process .
The paper proposes PEP (Plug-in Embedding Pruning) to reduce the size of embedding table while incurring insignificant drop in accuracy. The related work is well summarized into Embedding Parameter Sharing and Embedding Size Selection methods and the motivation for the current approach is well explained. The paper draws inspiration from Lottery Ticket Hypothesis. The problem formulation of Embedding pruning is done in a crisp way avoiding additional hyper parameter tuning that can be found in other methods. Similar to LTH, the paper shows that the initiation strategy can make the training process faster and stable. The results show an impressive 97-99% parameter pruning via PEP. As for the computation cost, PEP results show an additional 20-30% time cost compare with base models.
SP:2e548e320d5da211ffed027de7f0c6b78935f205
Learnable Embedding sizes for Recommender Systems
1 INTRODUCTION . The success of deep learning-based recommendation models ( Zhang et al. , 2019 ) demonstrates their advantage in learning feature representations , especially for the most widely-used categorical features . These models utilize the embedding technique to map these sparse categorical features into real-valued dense vectors to extract users ’ preferences and items ’ characteristics . The learned vectors are then fed into prediction models , such as the inner product in FM ( Rendle , 2010 ) , selfattention networks in AutoInt ( Song et al. , 2019 ) , to obtain the prediction results . The embedding table could contain a large number of parameters and cost huge amounts of memory since there are always a large number of raw features . Therefore , the embedding table takes the most storage cost . A good case in point is the YouTube Recommendation Systems ( Covington et al. , 2016 ) . It demands tens of millions of parameters for embeddings of the YouTube video IDs . Considering the increasing demand for instant recommendations in today ’ s service providers , the scale of embedding tables becomes the efficiency bottleneck of deep learning recommendation models . On the other hand , features with uniform embedding size may hard to handle the heterogeneity among different features . For example , some features are more sparse , and assigning too large embedding sizes is likely ∗Chen Gao is the Corresponding Author . The work is performed when Siyi Liu is an intern in Tsinghua University . 1Codes are available at : https : //github.com/ssui-liu/learnable-embed-sizes-for-RecSys to result in over-fitting issues . Consequently , recommendation models tend to be sub-optimal when embedding sizes are uniform for all features . The existing works towards this problem can be divided into two categories . Some works ( Zhang et al. , 2020 ; Shi et al. , 2020 ; Kang et al. , 2020 ) proposed that some closely-related features can share parts of embeddings , reducing the whole cost . Some other works ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) proposed to assign embeddings with flexible sizes to different features relying on human-designed rules ( Ginart et al. , 2019 ) or neural architecture search ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) . Despite a reduced embedding size table , these methods still can not perform well on the two most concerned aspects , recommendation performance and computation cost . Specifically , these methods either obtain poor recommendation performance or spend a lot of time and efforts in getting proper embedding sizes . In this paper , to address the limitations of existing works , we proposed a simple yet effective pruning-based framework , named Plug-in Embedding Pruning ( PEP ) , which can plug in various embedding-based recommendation models . Our method adopts a direct manner–pruning those unnecessary embedding parameters in one shot–to reduce parameter number . Specifically , we introduce the learnable threshold ( s ) that can be jointly trained with embedding parameters via gradient descent . Note that the threshold is utilized to determine the importance of each parameter automatically . Then the elements in the embedding vector that are smaller than the threshold will be pruned . Then the whole embedding table is pruned to make sure each feature has a suitable embedding size . That is , the embedding sizes are flexible . After getting the pruned embedding table , we retrain the recommendation model with the inspiration of the Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2018 ) , which demonstrates that a subnetwork can reach higher accuracy compared with the original network . Based on flexible embedding sizes and the LTH , our PEP can cuts down embedding parameters while maintaining and even boosting the model ’ s recommendation performance . Finally , while there is always a trade-off between recommendation performance and parameter number , our PEP can obtain multiple pruned embedding tables by running only once . In other words , our PEP can generate several memory-efficient embedding matrices once-for-all , which can well handle the various demands for performance or memory-efficiency in real-world applications . We conduct extensive experiments on three public benchmark datasets : Criteo , Avazu , and MovieLens-1M . The results demonstrate that our PEP can not only achieve the best performance compared with state-of-the-art baselines but also reduces 97 % to 99 % parameter usage . Further studies show that our PEP is quite computationally-efficient , requiring a few additional time for embedding-size learning . Furthermore , visualization and interpretability analysis on learned embedding confirm that our PEP can capture features ’ intrinsic properties , which provides insights for future researches . 2 RELATED WORK . Existing works try to reduce the embedding table size of recommendation models from two perspectives , embedding parameter sharing and embedding size selection . 2.1 EMBEDDING PARAMETER SHARING . The core idea of these methods is to make different features re-use embeddings via parameter sharing . Kang et al . ( 2020 ) proposed MGQE that retrieves embedding fragments from a small size of shared centroid embeddings and then generates final embedding by concatenating those fragments . Zhang et al . ( 2020 ) used the double-hash trick to make low-frequency features share a small embedding-table while reducing the likelihood of a hash collision . Shi et al . ( 2020 ) tried to yield a unique embedding vector for each feature category from a small embedding table by combining multiple smaller embedding ( called embedding fragments ) . The combination is usually through concatenation , add , or element-wise multiplication among embedding fragments . However , those methods suffer from two limitations . First , engineers are required to carefully design the parameter-sharing ratio to balance accuracy and memory costs . Second , these rough embeddingsharing strategies can not find the redundant parts in the embedding tables , and thus it always causes a drop in recommendation performance . In this work , our method automatically chooses suitable embedding usages by learning from data . Therefore , engineers can be free from massive efforts for designing sharing strategy , and the model performance can be boosted via removing redundant parameters and alleviating the over-fitting issue . 2.2 EMEBDDING SIZE SELECTION . The embedding-sharing methods assign uniform embedding sizes to every feature , which may still fail to deal with the heterogeneity among different features . Recently , several methods proposed a new paradigm of mixed-dimension embedding table . Specifically , different from assigning all features with uniformed embedding size , different features can have different embedding sizes . MDE ( Ginart et al. , 2019 ) proposed a human-defined rule that the embedding size of a feature is proportional to its popularity . However , this rule-based method is too rough and can not handle those important features with low frequency . Additionally , there are plenty of hyper-parameters in MDE requiring a lot of truning efforts . Some other works ( Joglekar et al. , 2020 ; Zhao et al. , 2020b ; a ; Cheng et al. , 2020 ) assigned adaptive embedding sizes to different features , relying on the advances in Neural Architecture Search ( NAS ) ( Elsken et al. , 2019 ) , a significant research direction of Automated Machine Learning ( AutoML ) ( Hutter et al. , 2019 ) . NIS ( Joglekar et al. , 2020 ) used a reinforcement learning-based algorithm to search embedding size from a candidate set predefined by human experts . A controller is adopted to generate the probability distribution of size for specific feature embeddings . This was further extended by DartsEmb ( Zhao et al. , 2020b ) by replacing the reinforcement learning searching algorithm with differentiable search ( Liu et al. , 2018 ) . AutoDim ( Zhao et al. , 2020a ) allocated different embedding sizes for different feature fields , rather than individual features , in a same way as DartsEmb . DNIS ( Cheng et al. , 2020 ) made the candidate embedding size to be continuous without predefined candidate dimensions . However , all these NAS-based methods require extremely high computation costs in the searching procedure . Even for methods that adopt differential architecture search algorithms , the searching cost is still not affordable . Moreover , these methods also require a great effort in designing proper search spaces . Different from these works , our pruning-based method can be trained quite efficiently and does not require any human efforts in determining the embedding-size candidates . 3 PROBLEM FORMULATION . Feature-based recommender system2 is commonly used in today ’ s information services . In general , deep learning recommendation models take various raw features , including users ’ profiles and items ’ attributes , as input and predict the probability that a user like an item . Specifically , models take the combination of user ’ s profiles and item ’ s attributes , denoted by x , as its ’ input vector , where x is the concatenation of all fields that could defined as follows : x = [ x1 ; x2 ; . . . ; xM ] , ( 1 ) where M denotes the number of total feature fields , and xi is the feature representation ( one-hot vector in usual ) of the i-th field . Then for xi , the embedding-based recommendation models generate corresponding embedding vector vi via following formulation : vi = Vixi , ( 2 ) 2It is also known as click-through rate prediction . where Vi ∈ Rni×d is an embedding matrix of i-th field , ni denotes the number of features in the i-th field , and d denotes the size of embedding vectors . The model ’ s embedding matrices V for all fields of features can be formulated as follows , V = { V1 , V2 , . . . , VM } , ( 3 ) The prediction score could be calculated with V and model ’ s other parameters ( mainly refer to the parameters in prediction model ) Θ as follows , ŷ = φ ( x|V , Θ ) , ( 4 ) where ŷ is the predicted probability and φ represent the prediction model , such as FM ( Rendle , 2010 ) or AutoInt ( Song et al. , 2019 ) . As for model training , to learn the models parameters , the optimizer minimizes the training loss as follows , min L ( V , Θ , D ) , ( 5 ) where D = { x , y } represents the data fed into the model , x denotes the input feature , y denotes the ground truth label , and L is the loss function . The Logloss is the most widely-used loss function in recommendation tasks ( Rendle , 2010 ; Guo et al. , 2017 ; Song et al. , 2019 ) and calculated as follows , L = − 1|D| |D|∑ j=1 ( yj log ( ŷj ) + ( 1− yj ) log ( 1− ŷj ) ) , ( 6 ) where |D| is the total number of training samples and regularization terms are omitted for simplification . 4 METHODOLOGY . 4.1 LEARNABLE EMBEDDING SIZES THROUGH PRUNING . As mentioned above , a feasible solution for memory-efficient embedding learning is to automatically assign different embedding sizes d̃i for different features embeddings vi , which is our goal . However , to learn d̃i directly is infeasible due to its discreteness and extremely-large optimization space . To address it , we propose a novel idea that enforce column-wise sparsity on V , which equivalently shrinks the embedding size . For example , as it shown in Figure 1 , the first value in embedding v1 is pruned and set to zero , leading to a d̃1 = d1 − 1 embedding size in effect . Furthermore , some unimportant feature embeddings , like v3 , are dropped by set all values to zero3 . Thus our method can significantly cut down embedding parameters . Note that the technique of sparse matrix storage help us to significantly save memory usage ( Virtanen et al. , 2020 ) . In such a way , we recast the problem of embedding-size selection into learning column-wise sparsity for the embedding matrix V. To achieve that , we design a sparsity constraint on V as follows , min L , s.t . ||V||0 ≤ k , ( 7 ) where || · ||0 denotes the L0-norm , i.e . the number of non-zeros and k is the parameter budget , which is , the constraint on the total number of embedding parameters . 3Our PEP benefit from such kind of reduction , as demonstrated in Section 5.1 , 5.3 and 5.4 . However , direct optimization of Equation ( 7 ) is NP-hard due to the non-convexity of the L0-norm constraint . To solve this problem , the convex relaxation of L0-norm , called L1-norm , has been studied for a long time ( Taheri & Vorobyov , 2011 ; Beck & Teboulle , 2009 ; Jain et al. , 2014 ) . For example , the Projected Gradient Descent ( PGD ) ( Jain et al. , 2014 ) in particular has been proposed to project parameters to L1 ball to make the gradient computable in almost closed form . Note that the L1 ball projection is also known as Soft Thresholding ( Kusupati et al. , 2020 ) . Nevertheless , such methods are still faced with two major issues . First , the process of projecting the optimization values onto L1 ball requires too much computation cost , especially when the recommendation model has millions of parameters . Second , the parameter budget k requires human experts to manually set at a global level . Considering that features have various importance for recommendation , such operation is obviously sub-optimal . To tackle those two challenges , inspired by Soft Threshold Reparameterization ( Kusupati et al. , 2020 ) , we directly optimize the projection of V and adaptively pruning the V via learnable threshold ( s ) which can be updated by gradient descent . The re-parameterization of V can be formulated as follows , V̂ = S ( V , s ) = sign ( V ) ReLU ( |V| − g ( s ) ) , ( 8 ) where V̂ ∈ RN×d denotes the re-parameterized embedding matrix , and g ( s ) serves as a pruning threshold value , of which sigmoid function is a simple yet effective solution.4 We set the initial value of trainable parameter s ∈ R ( called sinit ) to make sure that the threshold ( s ) g start close to zero . The sign ( · ) function converts positive input value to 1 and negative input value to -1 , and zero input will keep unchanged . As S ( V , s ) is applied to each element of V , and thus the optimization problem in Equation ( 5 ) could be redefined as follows , min L ( S ( V , s ) , Θ , D ) . ( 9 ) Then the trainable pruning parameter s could be jointly optimized with parameters of the recommendation models φ , through the standard back-propagation . Specifically , the gradient descent update equation for V at t-th step is formulated as follows , V ( t+1 ) ← V ( t ) − ηt∇S ( V , s ) L ( S ( V ( t ) , s ) , D ) ∇VS ( V , s ) , ( 10 ) where ηt is t-th step learning rate and denotes the Hadamard product . To solve the nondifferentiablilty of S ( · ) , we use sub-gradient to reformat the update equation as follows , V ( t+1 ) ← V ( t ) − ηt∇S ( V , s ) L ( S ( V ( t ) , s ) , D ) 1 { S ( V ( t ) , s ) 6= 0 } , ( 11 ) where 1 { · } denotes the indicator function . Then , as long as we choose a continuous function g in S ( · ) , then the loss functionL ( S ( V ( t ) , s ) , D ) would be continuous for s. Moreover , the sub-gradient of L with respect to s can be used of gradient descent on s as well . Thanks to the automatic differentiation framework like TensorFlow ( Abadi et al. , 2016 ) and PyTorch ( Paszke et al. , 2019 ) , we are free from above complex gradient computation process . Our PEP code can be found in Figure 7 of Appendix A.2 . As we can see , it is quite simple to incorporate with existing recommendation models , and there is no need for us to manually design the backpropagation process .
This paper proposed a novel approach to reduce size of the embedding table while not to drop in accuracy and computational optimization. Fixed-size embedding table has two problems, high memory usage cost and overfitting problem for those features that do not require too large representation. This paper recast the problem of embedding-size selection into learning column-wise sparsity, constraint K (eq(7)) and then convert S(V,s) problem (eq(8)). Paper used three benchmark datasets and some classical methods to verify effect.
SP:2e548e320d5da211ffed027de7f0c6b78935f205
Adding Recurrence to Pretrained Transformers
1 INTRODUCTION . Recent progress in NLP has been dominated by large pretrained transformer neural networks ( Vaswani et al. , 2017 ) , such as BERT ( Devlin et al. , 2019 ) , and GPT-2 ( Radford et al. , 2019 ) . However , these models have a memory footprint that is quadratic in input sequence length . Although architectural innovations such as those of Kitaev et al . ( 2019 ) and Rae et al . ( 2019 ) mitigate this and the issue of a predetermined maximum context size , large pretrained models applying these techniques are not available at this time . Even if large pretrained models of this kind are released in the future , they will likely not cover the wide range of domains that BERT-family models have been published for . For example , there have been BERT-based models trained for other languages such as French ( Le et al. , 2020 ; Martin et al. , 2020 ) , Italian ( Polignano et al. , 2019 ) , and many other languages ( see Nozza et al . ( 2020 ) for an overview ) as well as specific domains such as scientific papers ( Beltagy et al. , 2019 ) , biomedical papers ( Lee et al. , 2020 ) , and health records ( Rasmy et al. , 2020 ) . Individuals working with these models may not have the resources to train new models from scratch using the latest tricks , as the computation requirements for pretraining are extremely high . As such , identifying ways that already existing models can be improved could be widely impactful . Another drawback of this family of models is that they have an a priori fixed maximum context size ( typically 512 or 1024 tokens for the currently available pretrained models ) . A typical application of pretrained language models is producing contextual embeddings for a document . If the document is simply chunked into disjoint segments of 512 tokens , tokens at the boundary of a window will have less contextual information than tokens in the center of a window . This can be mitigated by striding the evaluation of the model , and only keeping the embedding for a token which has the largest context—but this adds quite a bit of wasted computation . In this paper , we propose a method for augmenting and fine-tuning pretrained transformer language models to use context without directly attending to it . Our method simultaneously allows for increasing the context size a transformer processes , while allowing a controllable trade-off between computation and perplexity . We accomplish this by adding a small recurrence module that computes a fixed size representation from the transformer hidden states in a window of text . Then , the representation for that window is used during processing of the next window . Shrinking the window size is then a way to reduce the memory footprint of the model , with less loss of performance than would occur with a standard transformer . Our experiments add recurrence GPT-2 language models , and fine-tune them on the PG-19 ( Rae et al. , 2019 ) and WikiText-103 corpora ( Merity et al. , 2016 ) , and require only the same amount of memory used for standard fine-tuning of a pretrained language model . We demonstrate improvements in perplexity compared to a baseline model using the same amount of computation . Qualitative analysis shows that our recurrent module propagates certain information from previous windows of text , which can facilitate handling of long-distance dependencies with fixed-size input windows . 2 RELATED WORK . Many methods have been proposed to lower the memory footprint or computation time of transformer language models , or allow them to be used on larger contexts . The Transformer-XL ( Dai et al. , 2019 ) allows a position within an attention window to attend to tokens from the previous windows by introducing relative position embeddings . While that mechanism , like ours , allows information to flow between windows , existing BERT and GPT-2 models do not use relative position embeddings , so training from scratch would be necessary to take advantage of this architecture . Additionally , each layer in the Transformer-XL attends to the previous layer in the previous window , so the maximum attention horizon is finite . Our recurrent method could theoretically pass information across an arbitrary distance , although one would not expect it to exceed the Transformer-XL ’ s horizon without a much larger scale of data than we experiment with . We list here some other modifications of the transformer architecture , somewhat imprecisely grouping them for brevity . For a more detailed discussion , see Tay et al . ( 2020b ) . Child et al . ( 2019 ) , Qiu et al . ( 2019 ) , Kitaev et al . ( 2019 ) , Sukhbaatar et al . ( 2019 ) , and Roy et al . ( 2020 ) introduce sparsity to self-attention in various forms , reducing its memory cost . Rae et al . ( 2019 ) and Beltagy et al . ( 2020 ) —dynamically and statically respectively—add extra tokens to attend to which allow for global passing of information . Tay et al . ( 2020a ) and Wu et al . ( 2019 ) replace dynamically computed self-attention with cheaper alternatives . While the above methods all allow for a reduction in computation , they also all require training from scratch . Our goal is to allow more efficient and powerful use of the wide array of existing pre-trained models that cover many domains . Cao et al . ( 2020 ) propose the DeFormer , which also modifies the execution of a pretrained transformer . However , unlike our method , they decompose a single window into multiple windows by removing the attention interactions between these windows . This is largely orthogonal to our method , as one could both decompose windows of text , and additionally use our method to allow information to be passed between neighboring windows . Similarly , distilled versions of pre-trained models such as DistilBERT ( Sanh et al. , 2019 ) provide more computational efficiency , but could be combined with our method to apply them to longer contexts , or reduce the quadratic cost of self-attention . Hao et al . ( 2019 ) apply pre-trained transformers recurrently for machine translation , but do so by using an attention network to embed the document , applying a recurrent encoder to those embeddings , and using the recurrent encoder alongside a typical transformer encoder . This differs from our method as we are fine-tuning language models , which are transformer decoders , and directly modifying the transformer ’ s computation with a recurrent connection , rather than running an RNN on top of embeddings produced by a transformer . 3 METHOD . The main idea of our method is to take a transformer that was pretrained in a fixed context size setting and add recurrence at the level of T -token windows of text . For example , instead of executing the model on one 1000 token window of text , we could instead execute our model with 10 windows of 100 tokens . The first window is processed by the transformer model as normal , but for subsequent windows we add a supplementary embedding , which is generated using the hidden states from the preceding window ( see Figure 1 ) . The recurrence module is extremely small compared to the size of transformer language model , so the additional computation required is negligible . 3.1 ADDING RECURRENCE TO PRETRAINED TRANSFORMERS . Starting by defining terms , we will consider a pretrained transformer with L layers , a hidden state size of k , and a maximum context size of T tokens . Let h ( ` ) i ∈ Rk be the output of the ` -th layer of the pretrained model , at position i . To produce a fixed-size representation of tokens t1 , t2 , . . . , tT , the embeddings produced by the pretrained transformer are mean-pooled as follows : z1 = 1 T T∑ i=1 L∑ ` =1 w ` h ( ` ) i ( 1 ) where w ` are weights softmax-normalized from learned parameters α ` : w ` = eα ` L∑ j=1 eαj The fixed-size representation , z1 , is passed through a feedforward network to produce an embedding hprev,1 which represents the tokens processed so far , t1 : T . Next , instead of evaluating the pretrained transformer without modification on positions T + 1 through 2T , hprev,1 is inserted at a single layer ( denoted ` ins ) of the pretrained model , as an additional embedding that may be used in the computation of attention , as shown in Figure 2 . To keep the number of embeddings per layer fixed , this embedding is only used as a key and a value , but not a query , in the self-attention layer . That is , for a window size of 300 tokens , there are 301 inputs to layer ` ins , but still only 300 outputs . The embeddings for positions T + 1 to 2T are then pooled in the same way as Equation 1 to produce z2 and passed through the feedforward network , outputting hprev,2 . hprev,2 is used to modify the execution of the pretrained language model on tokens 2T + 1 through 3T , and so on . Because the model is now being applied recurrently , it is trained end-to-end with backpropagation through time . One could consider more complex recurrence modules , other methods for pooling the previous window ’ s embeddings , or for inserting hprev into the computation for the next window . We experimented with modifications such as max pooling instead of mean pooling , inserting multiple embeddings into the next window , inserting an embedding at all layers of the transformer for the next window , and using fixed key attention as the pooling function . However during our preliminary experiments , we were not successful in finding a significantly higher performing architecture than the one given above , so it is the one we present results for . 3.2 GRADIENT CHECKPOINTING IN NETWORKS WITH BOTTLENECKS . While our method can reduce the quadratic cost of attention by splitting the input into windows , we can also easily apply it to much longer contexts by use of gradient checkpointing ( Chen et al. , 2016 ) . Gradient checkpointing is a method for lowering the peak memory requirement of training large neural networks . This is accomplished by storing only a subset of activations during the forward pass , and recomputing forward from those cached states during the backwards pass . For example , in a 100 layer feedforward network with uniformly wide layers , one could store the output of only every 10th layer . Then , during the backward pass , in order to compute the gradients for the 95th layer , one would re-compute layers 91 through 99 using the stored 90th layer activations . The overall memory cost is reduced to √ L at the cost of a single additional forward pass . In a network with variable width , the memory reduction can be even larger . When gradient checkpointing is applied to transformers , the outputs of each layer are usually stored ( k × L× T values ) , so that at most one set of self-attention activations is in memory at once . In the case of our recurrent models , we have an even narrower bottleneck : the zi ’ s and hprev , i ’ s . Storing only these values means that the maximum number of activations present in memory while training on sequences N tokens in length isM +2kdNT e , whereM is the number of activations stored when training the transformer on an individual window of length T . Because k is extremely small compared to M , our model can be applied to very long contexts on any GPU on which the pretrained model can be fine-tuned .
The goal of this work is to enable existing pre-trained transformers (e.g. GPT-2) to operate over long input contexts. This is achieved by breaking the input sequence into segments and processing each segment through the transformers while allowing tokens in the current segment to attend over a summary vector of the tokens in the previous segment. The summary vector is created as a weighted combination of the tokens in the summarized segment. Thus the summary vector introduces recurrence where each segment can use information from the previous segment. These modifications yield a better language model for long input texts.
SP:8f5230bf3c19417980b10112488d1c7a8f1177f4
Adding Recurrence to Pretrained Transformers
1 INTRODUCTION . Recent progress in NLP has been dominated by large pretrained transformer neural networks ( Vaswani et al. , 2017 ) , such as BERT ( Devlin et al. , 2019 ) , and GPT-2 ( Radford et al. , 2019 ) . However , these models have a memory footprint that is quadratic in input sequence length . Although architectural innovations such as those of Kitaev et al . ( 2019 ) and Rae et al . ( 2019 ) mitigate this and the issue of a predetermined maximum context size , large pretrained models applying these techniques are not available at this time . Even if large pretrained models of this kind are released in the future , they will likely not cover the wide range of domains that BERT-family models have been published for . For example , there have been BERT-based models trained for other languages such as French ( Le et al. , 2020 ; Martin et al. , 2020 ) , Italian ( Polignano et al. , 2019 ) , and many other languages ( see Nozza et al . ( 2020 ) for an overview ) as well as specific domains such as scientific papers ( Beltagy et al. , 2019 ) , biomedical papers ( Lee et al. , 2020 ) , and health records ( Rasmy et al. , 2020 ) . Individuals working with these models may not have the resources to train new models from scratch using the latest tricks , as the computation requirements for pretraining are extremely high . As such , identifying ways that already existing models can be improved could be widely impactful . Another drawback of this family of models is that they have an a priori fixed maximum context size ( typically 512 or 1024 tokens for the currently available pretrained models ) . A typical application of pretrained language models is producing contextual embeddings for a document . If the document is simply chunked into disjoint segments of 512 tokens , tokens at the boundary of a window will have less contextual information than tokens in the center of a window . This can be mitigated by striding the evaluation of the model , and only keeping the embedding for a token which has the largest context—but this adds quite a bit of wasted computation . In this paper , we propose a method for augmenting and fine-tuning pretrained transformer language models to use context without directly attending to it . Our method simultaneously allows for increasing the context size a transformer processes , while allowing a controllable trade-off between computation and perplexity . We accomplish this by adding a small recurrence module that computes a fixed size representation from the transformer hidden states in a window of text . Then , the representation for that window is used during processing of the next window . Shrinking the window size is then a way to reduce the memory footprint of the model , with less loss of performance than would occur with a standard transformer . Our experiments add recurrence GPT-2 language models , and fine-tune them on the PG-19 ( Rae et al. , 2019 ) and WikiText-103 corpora ( Merity et al. , 2016 ) , and require only the same amount of memory used for standard fine-tuning of a pretrained language model . We demonstrate improvements in perplexity compared to a baseline model using the same amount of computation . Qualitative analysis shows that our recurrent module propagates certain information from previous windows of text , which can facilitate handling of long-distance dependencies with fixed-size input windows . 2 RELATED WORK . Many methods have been proposed to lower the memory footprint or computation time of transformer language models , or allow them to be used on larger contexts . The Transformer-XL ( Dai et al. , 2019 ) allows a position within an attention window to attend to tokens from the previous windows by introducing relative position embeddings . While that mechanism , like ours , allows information to flow between windows , existing BERT and GPT-2 models do not use relative position embeddings , so training from scratch would be necessary to take advantage of this architecture . Additionally , each layer in the Transformer-XL attends to the previous layer in the previous window , so the maximum attention horizon is finite . Our recurrent method could theoretically pass information across an arbitrary distance , although one would not expect it to exceed the Transformer-XL ’ s horizon without a much larger scale of data than we experiment with . We list here some other modifications of the transformer architecture , somewhat imprecisely grouping them for brevity . For a more detailed discussion , see Tay et al . ( 2020b ) . Child et al . ( 2019 ) , Qiu et al . ( 2019 ) , Kitaev et al . ( 2019 ) , Sukhbaatar et al . ( 2019 ) , and Roy et al . ( 2020 ) introduce sparsity to self-attention in various forms , reducing its memory cost . Rae et al . ( 2019 ) and Beltagy et al . ( 2020 ) —dynamically and statically respectively—add extra tokens to attend to which allow for global passing of information . Tay et al . ( 2020a ) and Wu et al . ( 2019 ) replace dynamically computed self-attention with cheaper alternatives . While the above methods all allow for a reduction in computation , they also all require training from scratch . Our goal is to allow more efficient and powerful use of the wide array of existing pre-trained models that cover many domains . Cao et al . ( 2020 ) propose the DeFormer , which also modifies the execution of a pretrained transformer . However , unlike our method , they decompose a single window into multiple windows by removing the attention interactions between these windows . This is largely orthogonal to our method , as one could both decompose windows of text , and additionally use our method to allow information to be passed between neighboring windows . Similarly , distilled versions of pre-trained models such as DistilBERT ( Sanh et al. , 2019 ) provide more computational efficiency , but could be combined with our method to apply them to longer contexts , or reduce the quadratic cost of self-attention . Hao et al . ( 2019 ) apply pre-trained transformers recurrently for machine translation , but do so by using an attention network to embed the document , applying a recurrent encoder to those embeddings , and using the recurrent encoder alongside a typical transformer encoder . This differs from our method as we are fine-tuning language models , which are transformer decoders , and directly modifying the transformer ’ s computation with a recurrent connection , rather than running an RNN on top of embeddings produced by a transformer . 3 METHOD . The main idea of our method is to take a transformer that was pretrained in a fixed context size setting and add recurrence at the level of T -token windows of text . For example , instead of executing the model on one 1000 token window of text , we could instead execute our model with 10 windows of 100 tokens . The first window is processed by the transformer model as normal , but for subsequent windows we add a supplementary embedding , which is generated using the hidden states from the preceding window ( see Figure 1 ) . The recurrence module is extremely small compared to the size of transformer language model , so the additional computation required is negligible . 3.1 ADDING RECURRENCE TO PRETRAINED TRANSFORMERS . Starting by defining terms , we will consider a pretrained transformer with L layers , a hidden state size of k , and a maximum context size of T tokens . Let h ( ` ) i ∈ Rk be the output of the ` -th layer of the pretrained model , at position i . To produce a fixed-size representation of tokens t1 , t2 , . . . , tT , the embeddings produced by the pretrained transformer are mean-pooled as follows : z1 = 1 T T∑ i=1 L∑ ` =1 w ` h ( ` ) i ( 1 ) where w ` are weights softmax-normalized from learned parameters α ` : w ` = eα ` L∑ j=1 eαj The fixed-size representation , z1 , is passed through a feedforward network to produce an embedding hprev,1 which represents the tokens processed so far , t1 : T . Next , instead of evaluating the pretrained transformer without modification on positions T + 1 through 2T , hprev,1 is inserted at a single layer ( denoted ` ins ) of the pretrained model , as an additional embedding that may be used in the computation of attention , as shown in Figure 2 . To keep the number of embeddings per layer fixed , this embedding is only used as a key and a value , but not a query , in the self-attention layer . That is , for a window size of 300 tokens , there are 301 inputs to layer ` ins , but still only 300 outputs . The embeddings for positions T + 1 to 2T are then pooled in the same way as Equation 1 to produce z2 and passed through the feedforward network , outputting hprev,2 . hprev,2 is used to modify the execution of the pretrained language model on tokens 2T + 1 through 3T , and so on . Because the model is now being applied recurrently , it is trained end-to-end with backpropagation through time . One could consider more complex recurrence modules , other methods for pooling the previous window ’ s embeddings , or for inserting hprev into the computation for the next window . We experimented with modifications such as max pooling instead of mean pooling , inserting multiple embeddings into the next window , inserting an embedding at all layers of the transformer for the next window , and using fixed key attention as the pooling function . However during our preliminary experiments , we were not successful in finding a significantly higher performing architecture than the one given above , so it is the one we present results for . 3.2 GRADIENT CHECKPOINTING IN NETWORKS WITH BOTTLENECKS . While our method can reduce the quadratic cost of attention by splitting the input into windows , we can also easily apply it to much longer contexts by use of gradient checkpointing ( Chen et al. , 2016 ) . Gradient checkpointing is a method for lowering the peak memory requirement of training large neural networks . This is accomplished by storing only a subset of activations during the forward pass , and recomputing forward from those cached states during the backwards pass . For example , in a 100 layer feedforward network with uniformly wide layers , one could store the output of only every 10th layer . Then , during the backward pass , in order to compute the gradients for the 95th layer , one would re-compute layers 91 through 99 using the stored 90th layer activations . The overall memory cost is reduced to √ L at the cost of a single additional forward pass . In a network with variable width , the memory reduction can be even larger . When gradient checkpointing is applied to transformers , the outputs of each layer are usually stored ( k × L× T values ) , so that at most one set of self-attention activations is in memory at once . In the case of our recurrent models , we have an even narrower bottleneck : the zi ’ s and hprev , i ’ s . Storing only these values means that the maximum number of activations present in memory while training on sequences N tokens in length isM +2kdNT e , whereM is the number of activations stored when training the transformer on an individual window of length T . Because k is extremely small compared to M , our model can be applied to very long contexts on any GPU on which the pretrained model can be fine-tuned .
The paper proposed to add a recurrent component to pretrained transformers. The component pools the hidden states of a context window and passes it to the next context window as an additional input to the self-attention layer. The component reduces the memory usage at both training and inference time, and enables the Transformer model to work on a longer sequence. The component is evaluated on two language modeling datasets and outperforms baseline models.
SP:8f5230bf3c19417980b10112488d1c7a8f1177f4
On the Universality of Rotation Equivariant Point Cloud Networks
1 INTRODUCTION . Designing neural networks that respect data symmetry is a powerful approach for obtaining efficient deep models . Prominent examples being convolutional networks which respect the translational invariance of images , graph neural networks which respect the permutation invariance of graphs ( Gilmer et al. , 2017 ; Maron et al. , 2019b ) , networks such as ( Zaheer et al. , 2017 ; Qi et al. , 2017a ) which respect the permutation invariance of sets , and networks which respect 3D rotational symmetries ( Cohen et al. , 2018 ; Weiler et al. , 2018 ; Esteves et al. , 2018 ; Worrall & Brostow , 2018 ; Kondor et al. , 2018a ) . While the expressive power of equivariant models is reduced by design to include only equivariant functions , a desirable property of equivariant networks is universality : the ability to approximate any continuous equivariant function . This is not always the case : while convolutional networks and networks for sets are universal ( Yarotsky , 2018 ; Segol & Lipman , 2019 ) , popular graph neural networks are not ( Xu et al. , 2019 ; Morris et al. , 2018 ) . In this paper , we consider the universality of networks that respect the symmetries of 3D point clouds : translations , rotations , and permutations . Designing such networks is a popular paradigm in recent years ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ; Poulenard et al. , 2019 ; Zhao et al. , 2019 ) . While there have been many works on the universality of permutation invariant networks ( Zaheer et al. , 2017 ; Maron et al. , 2019c ; Keriven & Peyré , 2019 ) , and a recent work discussing the universality of rotation equivariant networks ( Bogatskiy et al. , 2020 ) , this is a first paper which discusses the universality of networks which combine rotations , permutations and translations . We start the paper with a general , architecture-agnostic , discussion , and derive two sufficient conditions for universality . These conditions are a result of a novel characterization of equivariant polynomials for the symmetry group of interest . We use these conditions in order to prove universality of the prominent Tensor Field Networks ( TFN ) architecture ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) . The following is a weakened and simplified statement of Theorem 2 stated later on in the paper : Theorem ( Simplification of Theorem 2 ) . Any continuous equivariant function on point clouds can be approximated uniformly on compact sets by a composition of TFN layers . We use our general discussion to prove the universality of two additional equivariant models : the first is a simple modification of the TFN architecture which allows for universality using only low dimensional filters . The second is a minimal architecture which is based on tensor product representations , rather than the more commonly used irreducible representations of SO ( 3 ) . We discuss the advantages and disadvantages of both approaches . To summarize , the contributions of this paper are : ( 1 ) A general approach for proving the universality of rotation equivariant models for point clouds ; ( 2 ) A proof that two recent equivariant models ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) are universal ; ( 3 ) Two additional simple and novel universal architectures . 2 PREVIOUS WORK . Deep learning on point clouds . ( Qi et al. , 2017a ; Zaheer et al. , 2017 ) were the first to apply neural networks directly to the raw point cloud data , by using pointwise functions and pooling operations . Many subsequent works used local neighborhood information ( Qi et al. , 2017b ; Wang et al. , 2019b ; Atzmon et al. , 2018 ) . We refer the reader to a recent survey for more details ( Guo et al. , 2020 ) . In contrast with the aforementioned works which focused solely on permutation invariance , more related to this paper are works that additionally incorporated invariance to rigid motions . ( Thomas et al. , 2018 ) proposed Tensor Field Networks ( TFN ) and showed their efficacy on physics and chemistry tasks . ( Kondor et al. , 2018b ) also suggested an equivariant model for continuous rotations . ( Li et al. , 2019 ) suggested models that are equivariant to discrete subgroups of SO ( 3 ) . ( Poulenard et al. , 2019 ) suggested an invariant model based on spherical harmonics . ( Fuchs et al. , 2020 ) followed TFN and added an attention mechanism . Recently , ( Zhao et al. , 2019 ) proposed a quaternion equivariant point capsule network that also achieves rotation and translation invariance . Universal approximation for invariant networks . Understanding the approximation power of invariant models is a popular research goal . Most of the current results assume that the symmetry group is a permutation group . ( Zaheer et al. , 2017 ; Qi et al. , 2017a ; Segol & Lipman , 2019 ; Maron et al. , 2020 ; Serviansky et al. , 2020 ) proved universality for several Sn-invariant and equivariant models . ( Maron et al. , 2019b ; a ; Keriven & Peyré , 2019 ; Maehara & NT , 2019 ) studied the approximation power of high-order graph neural networks . ( Maron et al. , 2019c ; Ravanbakhsh , 2020 ) targeted universality of networks that use high-order representations for permutation groups ( Yarotsky , 2018 ) provided several theoretical constructions of universal equivariant neural network models based on polynomial invariants , including an SE ( 2 ) equivariant model . In a recent work ( Bogatskiy et al. , 2020 ) presented a universal approximation theorem for networks that are equivariant to several Lie groups including SO ( 3 ) . The main difference from our paper is that we prove a universality theorem for a more complex group that besides rotations also includes translations and permutations . 3 A FRAMEWORK FOR PROVING UNIVERSALITY . In this section , we describe a framework for proving the universality of equivariant networks . We begin with some mathematical preliminaries : 3.1 MATHEMATICAL SETUP . An action of a group G on a real vector space W is a collection of maps ρ ( g ) : W → W defined for any g ∈ G , such that ρ ( g1 ) ◦ ρ ( g2 ) = ρ ( g1g2 ) for all g1 , g2 ∈ G , and the identity element of G is mapped to the identity mapping on W . We say ρ is a representation of G if ρ ( g ) is a linear map for every g ∈ G. As is customary , when it does not cause confusion we often say that W itself is a representation of G . In this paper , we are interested in functions on point clouds . Point clouds are sets of vectors in R3 arranged as matrices : X = ( x1 , . . . , xn ) ∈ R3×n . Many machine learning tasks on point clouds , such as classification , aim to learn a function which is invariant to rigid motions and relabeling of the points . Put differently , such functions are required to be invariant to the action of G = R3 o SO ( 3 ) × Sn on R3×n via ρG ( t , R , P ) ( X ) = R ( X − t1Tn ) PT , ( 1 ) where t ∈ R3 defines a translation , R is a rotation and P is a permutation matrix . Equivariant functions are generalizations of invariant functions : If G acts on W1 via some action ρ1 ( g ) , and on W2 via some other group action ρ2 ( g ) , we say that a function f : W1 → W2 is equivariant if f ( ρ1 ( g ) w ) = ρ2 ( g ) f ( w ) , ∀w ∈W1 and g ∈ G. Invariant functions correspond to the special case where ρ2 ( g ) is the identity mapping for all g ∈ G. In some machine learning tasks on point clouds , the functions learned are not invariant but rather equivariant . For example , segmentation tasks assign a discrete label to each point . They are invariant to translations and rotations but equivariant to permutations – in the sense that permuting the input causes a corresponding permutation of the output . Another example is predicting a normal for each point of a point cloud . This task is invariant to translations but equivariant to both rotations and permutations . In this paper , we are interested in learning equivariant functions from point clouds into WnT , where WT is some representation of SO ( 3 ) . The equivariance of these functions is with respect to the action ρG on point clouds defined in equation 1 , and the action of G on WnT defined by applying the rotation action from the left and permutation action from the right as in 1 , but ‘ ignoring ’ the translation component . Thus , G-equivariant functions will be translation invariant . This formulation of equivariance includes the normals prediction example by taking WT = R3 , as well as the segmentation case by setting WT = R with the trivial identity representation . We focus on the harder case of functions into WnT which are equivariant to permutations , since it easily implies the easier case of permutation invariant functions to WT . Notation . We use the notation N+ = N ∪ { 0 } and N∗+ = ⋃ r∈N Nr+ . We set [ D ] = { 1 , . . . , D } and [ D ] 0 = { 0 , . . . , D } . Proofs . Proofs appear in the appendices , arranged according to sections . 3.2 CONDITIONS FOR UNIVERSALITY . The semi-lifted approach In general , highly expressive equivariant neural networks can be achieved by using a ‘ lifted approach ’ , where intermediate features in the network belong to high dimensional representations of the group . In the context of point clouds where typically n 3 , many papers , e.g. , ( Thomas et al. , 2018 ; Kondor , 2018 ; Bogatskiy et al. , 2020 ) use a ‘ semi-lifted ’ approach , where hidden layers hold only higher dimensional representations of SO ( 3 ) , but not high order permutation representations . In this subsection , we propose a strategy for achieving universality with the semi-lifted approach . We begin by an axiomatic formulation of the semi-lifted approach ( see illustration in inset ) : we assume that our neural networks are composed of two main components : the first component is a family Ffeat of parametric continuous G-equivariant functions ffeat which map the original point cloud R3×n to a semi-lifted point cloud Wnfeat = ⊕n i=1Wfeat , where Wfeat is a lifted ( i.e. , high-order ) representation of SO ( 3 ) . The second component is a family of parametric linear SO ( 3 ) -equivariant functions Fpool , which map from the high order representation Wfeat down to the target representation WT . Each such SO ( 3 ) –equivariant function Λ : Wfeat →WT can be extended to a SO ( 3 ) ×Sn equivariant function Λ̂ : Wnfeat → WnT by applying Λ elementwise . For every positive integer C , these two families of functions induce a family of functions FC obtained by summing C different compositions of these functions : FC ( Ffeat , Fpool ) = { f |f ( X ) = C∑ c=1 Λ̂c ( gc ( X ) ) , ( Λc , gc ) ∈ Fpool ×Ffeat } . ( 2 ) Conditions for universality We now describe two conditions that guarantee universality using the semi-lifted approach . The first step is showing , as in ( Yarotsky , 2018 ) , that continuousG-equivariant functions CG ( R3×n , WnT ) can be approximated by G-equivariant polynomials PG ( R3×n , WnT ) . Lemma 1 . Any continuous G-equivariant function in CG ( R3×n , WnT ) can be approximated uniformly on compact sets by G-equivariant polynomials in PG ( R3×n , WnT ) . Universality is now reduced to the approximation of G-equivariant polynomials . Next , we provide two conditions which guarantee that G-equivariant polynomials of degree D can be expressed by function spaces FC ( Ffeat , Fpool ) as defined in equation 2 . The idea behind these conditions is that explicit characterizations of polynomials equivariant to the joint action of translations , rotations and permutations is challenging . However , it is possible to explicitly characterize polynomials equivariant to translations and permutations ( but not rotations ) . The key observation is then that this characterization can be rewritten as a sum of functions to Wnfeat , a high dimensional representations of SO ( 3 ) which is equivariant to translations , permutations and rotations , composed with a linear map which is permutation equivariant ( but does not respect rotations ) . Accordingly , our first condition is that Ffeat contains a spanning set of such functions to Wnfeat . We call this condition D-spanning : Definition 1 ( D-spanning ) . For D ∈ N+ , let Ffeat be a subset of CG ( R3×n , Wnfeat ) . We say that Ffeat is D-spanning , if there exist f1 , . . . , fK ∈ Ffeat , such that every polynomial p : R3×n → Rn of degree D which is invariant to translations and equivariant to permutations , can be written as p ( X ) = K∑ k=1 Λ̂k ( fk ( X ) ) , ( 3 ) where Λk : Wfeat → R are all linear functionals , and Λ̂k : Wnfeat → Rn are the functions defined by elementwise applications of Λk . In Lemma 4 we explicitly construct a D-spanning family of functions . This provides us with a concrete condition which implies D-spanning for other function families as well . The second condition is that Fpool contains all SO ( 3 ) linear equivariant layers . We call this condition Linear universality . Intuitively , taking linear rotation equivariant Λk in equation 3 ensures that the resulting function p will be rotation equivariant and thus fully G-equivariant , and linear universality guarantees the ability to express all such G invariant functions . Definition 2 ( Linear universality ) . We say that a collection Fpool of equivariant linear functionals between two representations Wfeat and WT of SO ( 3 ) is linearly universal , if it contains all linear SO ( 3 ) -equivariant mappings between the two representations . When these two conditions apply , a rather simple symmetrization arguments leads to the following theorem : Theorem 1 . If Ffeat is D-spanning and Fpool is linearly universal , then there exists some C ( D ) ∈ N such that for all C ≥ C ( D ) the function space FC ( Ffeat , Fpool ) contains all G-equivariant polynomials of degree ≤ D. Proof idea . By the D-spanning assumption , there exist f1 , . . . , fK ∈ Ffeat such that any vector valued polynomial invariant to translations and equivariant to permutations is of the form p ( X ) = K∑ k=1 Λ̂k ( fk ( X ) ) , ( 4 ) While by definition this holds for functions p whose image is Rn , this is easily extended to functions to WnT as well . It remains to show that when p is also SO ( 3 ) -equivariant , we can choose Λk to be SO ( 3 ) equivariant . This is accomplished by averaging over SO ( 3 ) . As a result of Theorem 1 and Lemma 1 we obtain our universality result ( see inset for illustration ) Corollary 1 . For all C , D ∈ N+ , let FC , D denote function spaces generated by a pair of functions spaces which are D-spanning and linearly universal as in equation 2 . Then any continuous G-equivariant function in CG ( R3×n , WnT ) can be approximated uniformly on compact sets by equivariant functions in F = ⋃ D∈N FC ( D ) , D .
The authors introduce a framework for sufficient conditions for proving universality of a general class of neural networks that operate on point clouds which takes as input a set of coordinates of points and as output a feature for each point, such that the network is invariant to joint translation of the coordinates, equivariant to permutation of the points and equivariant to joint SO(3) transformations of the coordinates and output features of all points. Notably, this class contains Tensor Field Networks (TFN). The authors accomplish this by writing the network as a composition of an equivariant function from a class F_feat and followed by a linear pooling layer. When the F_feat class satisfies a “D-spanning” criterion and the pooling layer is universal, the network is universal. For a simple class of networks and for TFNs, the authors prove D-spanning. Linear universality of the pooling layer follows from simple representation theory.
SP:eaac43a5cb483c71834b394b015d191cb8cbd815
On the Universality of Rotation Equivariant Point Cloud Networks
1 INTRODUCTION . Designing neural networks that respect data symmetry is a powerful approach for obtaining efficient deep models . Prominent examples being convolutional networks which respect the translational invariance of images , graph neural networks which respect the permutation invariance of graphs ( Gilmer et al. , 2017 ; Maron et al. , 2019b ) , networks such as ( Zaheer et al. , 2017 ; Qi et al. , 2017a ) which respect the permutation invariance of sets , and networks which respect 3D rotational symmetries ( Cohen et al. , 2018 ; Weiler et al. , 2018 ; Esteves et al. , 2018 ; Worrall & Brostow , 2018 ; Kondor et al. , 2018a ) . While the expressive power of equivariant models is reduced by design to include only equivariant functions , a desirable property of equivariant networks is universality : the ability to approximate any continuous equivariant function . This is not always the case : while convolutional networks and networks for sets are universal ( Yarotsky , 2018 ; Segol & Lipman , 2019 ) , popular graph neural networks are not ( Xu et al. , 2019 ; Morris et al. , 2018 ) . In this paper , we consider the universality of networks that respect the symmetries of 3D point clouds : translations , rotations , and permutations . Designing such networks is a popular paradigm in recent years ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ; Poulenard et al. , 2019 ; Zhao et al. , 2019 ) . While there have been many works on the universality of permutation invariant networks ( Zaheer et al. , 2017 ; Maron et al. , 2019c ; Keriven & Peyré , 2019 ) , and a recent work discussing the universality of rotation equivariant networks ( Bogatskiy et al. , 2020 ) , this is a first paper which discusses the universality of networks which combine rotations , permutations and translations . We start the paper with a general , architecture-agnostic , discussion , and derive two sufficient conditions for universality . These conditions are a result of a novel characterization of equivariant polynomials for the symmetry group of interest . We use these conditions in order to prove universality of the prominent Tensor Field Networks ( TFN ) architecture ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) . The following is a weakened and simplified statement of Theorem 2 stated later on in the paper : Theorem ( Simplification of Theorem 2 ) . Any continuous equivariant function on point clouds can be approximated uniformly on compact sets by a composition of TFN layers . We use our general discussion to prove the universality of two additional equivariant models : the first is a simple modification of the TFN architecture which allows for universality using only low dimensional filters . The second is a minimal architecture which is based on tensor product representations , rather than the more commonly used irreducible representations of SO ( 3 ) . We discuss the advantages and disadvantages of both approaches . To summarize , the contributions of this paper are : ( 1 ) A general approach for proving the universality of rotation equivariant models for point clouds ; ( 2 ) A proof that two recent equivariant models ( Thomas et al. , 2018 ; Fuchs et al. , 2020 ) are universal ; ( 3 ) Two additional simple and novel universal architectures . 2 PREVIOUS WORK . Deep learning on point clouds . ( Qi et al. , 2017a ; Zaheer et al. , 2017 ) were the first to apply neural networks directly to the raw point cloud data , by using pointwise functions and pooling operations . Many subsequent works used local neighborhood information ( Qi et al. , 2017b ; Wang et al. , 2019b ; Atzmon et al. , 2018 ) . We refer the reader to a recent survey for more details ( Guo et al. , 2020 ) . In contrast with the aforementioned works which focused solely on permutation invariance , more related to this paper are works that additionally incorporated invariance to rigid motions . ( Thomas et al. , 2018 ) proposed Tensor Field Networks ( TFN ) and showed their efficacy on physics and chemistry tasks . ( Kondor et al. , 2018b ) also suggested an equivariant model for continuous rotations . ( Li et al. , 2019 ) suggested models that are equivariant to discrete subgroups of SO ( 3 ) . ( Poulenard et al. , 2019 ) suggested an invariant model based on spherical harmonics . ( Fuchs et al. , 2020 ) followed TFN and added an attention mechanism . Recently , ( Zhao et al. , 2019 ) proposed a quaternion equivariant point capsule network that also achieves rotation and translation invariance . Universal approximation for invariant networks . Understanding the approximation power of invariant models is a popular research goal . Most of the current results assume that the symmetry group is a permutation group . ( Zaheer et al. , 2017 ; Qi et al. , 2017a ; Segol & Lipman , 2019 ; Maron et al. , 2020 ; Serviansky et al. , 2020 ) proved universality for several Sn-invariant and equivariant models . ( Maron et al. , 2019b ; a ; Keriven & Peyré , 2019 ; Maehara & NT , 2019 ) studied the approximation power of high-order graph neural networks . ( Maron et al. , 2019c ; Ravanbakhsh , 2020 ) targeted universality of networks that use high-order representations for permutation groups ( Yarotsky , 2018 ) provided several theoretical constructions of universal equivariant neural network models based on polynomial invariants , including an SE ( 2 ) equivariant model . In a recent work ( Bogatskiy et al. , 2020 ) presented a universal approximation theorem for networks that are equivariant to several Lie groups including SO ( 3 ) . The main difference from our paper is that we prove a universality theorem for a more complex group that besides rotations also includes translations and permutations . 3 A FRAMEWORK FOR PROVING UNIVERSALITY . In this section , we describe a framework for proving the universality of equivariant networks . We begin with some mathematical preliminaries : 3.1 MATHEMATICAL SETUP . An action of a group G on a real vector space W is a collection of maps ρ ( g ) : W → W defined for any g ∈ G , such that ρ ( g1 ) ◦ ρ ( g2 ) = ρ ( g1g2 ) for all g1 , g2 ∈ G , and the identity element of G is mapped to the identity mapping on W . We say ρ is a representation of G if ρ ( g ) is a linear map for every g ∈ G. As is customary , when it does not cause confusion we often say that W itself is a representation of G . In this paper , we are interested in functions on point clouds . Point clouds are sets of vectors in R3 arranged as matrices : X = ( x1 , . . . , xn ) ∈ R3×n . Many machine learning tasks on point clouds , such as classification , aim to learn a function which is invariant to rigid motions and relabeling of the points . Put differently , such functions are required to be invariant to the action of G = R3 o SO ( 3 ) × Sn on R3×n via ρG ( t , R , P ) ( X ) = R ( X − t1Tn ) PT , ( 1 ) where t ∈ R3 defines a translation , R is a rotation and P is a permutation matrix . Equivariant functions are generalizations of invariant functions : If G acts on W1 via some action ρ1 ( g ) , and on W2 via some other group action ρ2 ( g ) , we say that a function f : W1 → W2 is equivariant if f ( ρ1 ( g ) w ) = ρ2 ( g ) f ( w ) , ∀w ∈W1 and g ∈ G. Invariant functions correspond to the special case where ρ2 ( g ) is the identity mapping for all g ∈ G. In some machine learning tasks on point clouds , the functions learned are not invariant but rather equivariant . For example , segmentation tasks assign a discrete label to each point . They are invariant to translations and rotations but equivariant to permutations – in the sense that permuting the input causes a corresponding permutation of the output . Another example is predicting a normal for each point of a point cloud . This task is invariant to translations but equivariant to both rotations and permutations . In this paper , we are interested in learning equivariant functions from point clouds into WnT , where WT is some representation of SO ( 3 ) . The equivariance of these functions is with respect to the action ρG on point clouds defined in equation 1 , and the action of G on WnT defined by applying the rotation action from the left and permutation action from the right as in 1 , but ‘ ignoring ’ the translation component . Thus , G-equivariant functions will be translation invariant . This formulation of equivariance includes the normals prediction example by taking WT = R3 , as well as the segmentation case by setting WT = R with the trivial identity representation . We focus on the harder case of functions into WnT which are equivariant to permutations , since it easily implies the easier case of permutation invariant functions to WT . Notation . We use the notation N+ = N ∪ { 0 } and N∗+ = ⋃ r∈N Nr+ . We set [ D ] = { 1 , . . . , D } and [ D ] 0 = { 0 , . . . , D } . Proofs . Proofs appear in the appendices , arranged according to sections . 3.2 CONDITIONS FOR UNIVERSALITY . The semi-lifted approach In general , highly expressive equivariant neural networks can be achieved by using a ‘ lifted approach ’ , where intermediate features in the network belong to high dimensional representations of the group . In the context of point clouds where typically n 3 , many papers , e.g. , ( Thomas et al. , 2018 ; Kondor , 2018 ; Bogatskiy et al. , 2020 ) use a ‘ semi-lifted ’ approach , where hidden layers hold only higher dimensional representations of SO ( 3 ) , but not high order permutation representations . In this subsection , we propose a strategy for achieving universality with the semi-lifted approach . We begin by an axiomatic formulation of the semi-lifted approach ( see illustration in inset ) : we assume that our neural networks are composed of two main components : the first component is a family Ffeat of parametric continuous G-equivariant functions ffeat which map the original point cloud R3×n to a semi-lifted point cloud Wnfeat = ⊕n i=1Wfeat , where Wfeat is a lifted ( i.e. , high-order ) representation of SO ( 3 ) . The second component is a family of parametric linear SO ( 3 ) -equivariant functions Fpool , which map from the high order representation Wfeat down to the target representation WT . Each such SO ( 3 ) –equivariant function Λ : Wfeat →WT can be extended to a SO ( 3 ) ×Sn equivariant function Λ̂ : Wnfeat → WnT by applying Λ elementwise . For every positive integer C , these two families of functions induce a family of functions FC obtained by summing C different compositions of these functions : FC ( Ffeat , Fpool ) = { f |f ( X ) = C∑ c=1 Λ̂c ( gc ( X ) ) , ( Λc , gc ) ∈ Fpool ×Ffeat } . ( 2 ) Conditions for universality We now describe two conditions that guarantee universality using the semi-lifted approach . The first step is showing , as in ( Yarotsky , 2018 ) , that continuousG-equivariant functions CG ( R3×n , WnT ) can be approximated by G-equivariant polynomials PG ( R3×n , WnT ) . Lemma 1 . Any continuous G-equivariant function in CG ( R3×n , WnT ) can be approximated uniformly on compact sets by G-equivariant polynomials in PG ( R3×n , WnT ) . Universality is now reduced to the approximation of G-equivariant polynomials . Next , we provide two conditions which guarantee that G-equivariant polynomials of degree D can be expressed by function spaces FC ( Ffeat , Fpool ) as defined in equation 2 . The idea behind these conditions is that explicit characterizations of polynomials equivariant to the joint action of translations , rotations and permutations is challenging . However , it is possible to explicitly characterize polynomials equivariant to translations and permutations ( but not rotations ) . The key observation is then that this characterization can be rewritten as a sum of functions to Wnfeat , a high dimensional representations of SO ( 3 ) which is equivariant to translations , permutations and rotations , composed with a linear map which is permutation equivariant ( but does not respect rotations ) . Accordingly , our first condition is that Ffeat contains a spanning set of such functions to Wnfeat . We call this condition D-spanning : Definition 1 ( D-spanning ) . For D ∈ N+ , let Ffeat be a subset of CG ( R3×n , Wnfeat ) . We say that Ffeat is D-spanning , if there exist f1 , . . . , fK ∈ Ffeat , such that every polynomial p : R3×n → Rn of degree D which is invariant to translations and equivariant to permutations , can be written as p ( X ) = K∑ k=1 Λ̂k ( fk ( X ) ) , ( 3 ) where Λk : Wfeat → R are all linear functionals , and Λ̂k : Wnfeat → Rn are the functions defined by elementwise applications of Λk . In Lemma 4 we explicitly construct a D-spanning family of functions . This provides us with a concrete condition which implies D-spanning for other function families as well . The second condition is that Fpool contains all SO ( 3 ) linear equivariant layers . We call this condition Linear universality . Intuitively , taking linear rotation equivariant Λk in equation 3 ensures that the resulting function p will be rotation equivariant and thus fully G-equivariant , and linear universality guarantees the ability to express all such G invariant functions . Definition 2 ( Linear universality ) . We say that a collection Fpool of equivariant linear functionals between two representations Wfeat and WT of SO ( 3 ) is linearly universal , if it contains all linear SO ( 3 ) -equivariant mappings between the two representations . When these two conditions apply , a rather simple symmetrization arguments leads to the following theorem : Theorem 1 . If Ffeat is D-spanning and Fpool is linearly universal , then there exists some C ( D ) ∈ N such that for all C ≥ C ( D ) the function space FC ( Ffeat , Fpool ) contains all G-equivariant polynomials of degree ≤ D. Proof idea . By the D-spanning assumption , there exist f1 , . . . , fK ∈ Ffeat such that any vector valued polynomial invariant to translations and equivariant to permutations is of the form p ( X ) = K∑ k=1 Λ̂k ( fk ( X ) ) , ( 4 ) While by definition this holds for functions p whose image is Rn , this is easily extended to functions to WnT as well . It remains to show that when p is also SO ( 3 ) -equivariant , we can choose Λk to be SO ( 3 ) equivariant . This is accomplished by averaging over SO ( 3 ) . As a result of Theorem 1 and Lemma 1 we obtain our universality result ( see inset for illustration ) Corollary 1 . For all C , D ∈ N+ , let FC , D denote function spaces generated by a pair of functions spaces which are D-spanning and linearly universal as in equation 2 . Then any continuous G-equivariant function in CG ( R3×n , WnT ) can be approximated uniformly on compact sets by equivariant functions in F = ⋃ D∈N FC ( D ) , D .
This paper mainly explores the representation ability of invariability of a point cloud network from the theoretical perspective. The universal approximation property for equivariant architectures under shape-preserving transformations is discussed. First, the authors derived two sufficient conditions for equivariant architectures with the universal approximation property. Then, they examined two methods based on the Tensor Field Network to prove that such a property holds for both of them. At last, the authors propose alternative methods which also satisfy the universal approximation property.
SP:eaac43a5cb483c71834b394b015d191cb8cbd815
Implicit Gradient Regularization
1 INTRODUCTION . The loss surface of a deep neural network is a mountainous terrain - highly non-convex with a multitude of peaks , plateaus and valleys ( Li et al. , 2018 ; Liu et al. , 2020 ) . Gradient descent provides a path through this landscape , taking discrete steps in the direction of steepest descent toward a sub-manifold of minima . However , this simple strategy can be just as hazardous as it sounds . For small learning rates , our model is likely to get stuck at the local minima closest to the starting point , which is unlikely to be the most desirable destination . For large learning rates , we run the risk of ricocheting between peaks and diverging . However , for moderate learning rates , gradient descent seems to move away from the closest local minima and move toward flatter regions where test data errors are often smaller ( Keskar et al. , 2017 ; Lewkowycz et al. , 2020 ; Li et al. , 2019 ) . This phenomenon becomes stronger for larger networks , which also tend to have a smaller test error ( Arora et al. , 2019a ; Belkin et al. , 2019 ; Geiger et al. , 2020 ; Liang & Rakhlin , 2018 ; Soudry et al. , 2018 ) . In addition , models with low test errors are more robust to parameter perturbations ( Morcos et al. , 2018 ) . Overall , these observations contribute to an emerging view that there is some form of implicit regularization in gradient descent and several sources of implicit regularization have been identified . We have found a surprising form of implicit regularization hidden within the discrete numerical flow of gradient descent . Gradient descent iterates in discrete steps along the gradient of the loss , so after each step it actually steps off the exact continuous path that minimizes the loss at each point . Instead of following a trajectory down the steepest local gradient , gradient descent follows a shallower path . We show that this trajectory is closer to an exact path along a modified loss surface , which can be calculated using backward error analysis from numerical integration theory ( Hairer et al. , 2006 ) . Our core idea is that the discrepancy between the original loss surface and this modified loss surface is a form of implicit regularization ( Theorem 3.1 , Section 3 ) . We begin by calculating the discrepancy between the modified loss and the original loss using backward error analysis and find that it is proportional to the second moment of the loss gradients , which we call Implicit Gradient Regularization ( IGR ) . Using differential geometry , we show that IGR is also proportional to the square of the loss surface slope , indicating that it encourages optimization paths with shallower slopes and optima discovery in flatter regions of the loss surface . Next , we ∗equal contribution explore the properties of this regularization in deep neural networks such as MLP ’ s trained to classify MNIST digits and ResNets trained to classify CIFAR-10 images and in a tractable two-parameter model . In these cases , we verify that IGR effectively encourages models toward minima in the vicinity of small gradient values , in flatter regions with shallower slopes , and that these minima have low test error , consistent with previous observations . We find that IGR can account for the observation that learning rate size is correlated with test accuracy and model robustness . Finally , we demonstrate that IGR can be used as an explicit regularizer , allowing us to directly strengthen this regularization beyond the maximum possible implicit gradient regularization strength . 2 THE MODIFIED LOSS LANDSCAPE INDUCED BY GRADIENT DESCENT . The general goal of gradient descent is to find a weight vector θ̂ in parameter space Rm that minimizes a loss E ( θ ) . Gradient descent proceeds by iteratively updating the model weights with learning rate h in the direction of the steepest loss gradient : θn+1 = θn − h∇θE ( θn ) ( 1 ) Now , even though gradient descent takes steps in the direction of the steepest loss gradient , it does not stay on the exact continuous path of the steepest loss gradient , because each iteration steps off the exact continuous path . Instead , we show that gradient descent follows a path that is closer to the exact continuous path given by θ̇ = −∇θẼ ( θ ) , along a modified loss Ẽ ( θ ) , which can be calculated analytically using backward error analysis ( see Theorem 3.1 and Section 3 ) , yielding : Ẽ ( θ ) = E ( θ ) + λRIG ( θ ) , ( 2 ) where λ ≡ hm 4 ( 3 ) and RIG ( θ ) ≡ 1 m m∑ i=1 ( ∇θiE ( θ ) ) 2 ( 4 ) Immediately , we see that this modified loss is composed of the original training loss E ( θ ) and an additional term , which we interpret as a regularizer RIG ( θ ) with regularization rate λ . We call RIG ( θ ) the implicit gradient regularizer because it penalizes regions of the loss landscape that have large gradient values , and because it is implicit in gradient descent , rather than being explicitly added to our loss . Definition . Implicit gradient regularization is the implicit regularisation behaviour originating from the use of discrete update steps in gradient descent , as characterized by Equation 2 . We can now make several predictions about IGR which we will explore in experiments : Prediction 2.1 . IGR encourages smaller values of RIG ( θ ) relative to the loss E ( θ ) . Given Equation 2 and Theorem 3.1 , we expect gradient descent to follow trajectories that have relatively small values of RIG ( θ ) . It is already well known that gradient descent converges by reducing the loss gradient so it is important to note that this prediction describes the relative size of RIG ( θ ) along the trajectory of gradient descent . To expose this phenomena in experiments , great care must be taken when comparing different gradient descent trajectories . For instance , in our deep learning experiments , we compare models at the iteration time of maximum test accuracy ( and we consider other controls in the appendix ) , which is an important time point for practical applications and is not trivially determined by the speed of learning ( Figures 1 , 2 ) . Also , related to this , since the regularization rate λ is proportional to the learning rate h and network size m ( Equation 3 ) , we expect that larger models and larger learning rates will encourage smaller values of RIG ( θ ) ( Figure 2 ) . Prediction 2.2 . IGR encourages the discovery of flatter optima . In section 3 we will show that RIG ( θ ) is proportional to the square of the loss surface slope . Given this and Prediction 2.1 , we expect that IGR will guide gradient descent along paths with shallower loss surface slopes , thereby encouraging the discovery of flatter , broader optima . Of course , it is possible to construct loss surfaces at odds with this ( such as a Mexican-hat loss surface , where all minima are equally flat ) . However , we will provide experimental support for this using loss surfaces that are of widespread interest in deep learning , such as MLPs trained on MNIST ( Figure 1 , 2 , 3 ) . Prediction 2.3 . IGR encourages higher test accuracy . Given Prediction 2.2 , we predict that IGR encourages higher test accuracy since flatter minima are known empirically to coincide with higher test accuracy ( Figure 2 ) . Prediction 2.4 . IGR encourages the discovery of optima that are more robust to parameter perturbations . There are several important observations to make about the properties of IGR : 1 ) It does not originate in any specific model architecture or initialization , although our analysis does provide a formula to explain the influence of these model properties through IGR ; 2 ) Other sources of implicit regularization also have an impact on learning , alongside IGR , and the relative importance of these contributions will likely depend on model architecture and initialization ; 3 ) In defining λ and RIG we chose to set λ proportional to the number of parameters m. To support this choice , we demonstrate in experiments that the test accuracy is controlled by the IGR rate λ . 4 ) The modified loss and the original loss share the same global minima , so IGR vanishes when the gradient vanishes . Despite this , the presence of IGR has an impact on learning since it changes the trajectory of gradient descent , and in over-parameterized models this can cause the final parameters to reach different solutions . 5 ) Our theoretical results are derived for full-batch gradient descent , which allows us to isolate the source of implicit regularisation from the stochasticity of stochastic gradient descent ( SGD ) . Extending our theoretical results to SGD is considerably more complicated , and as such , is beyond the scope of this paper . However , in some of our experiments , we will demonstrate that IGR persists in SGD , which is especially important for deep learning . Next , we will provide a proof for Theorem 3.1 , and we will provide experimental support for our predictions . 3 BACKWARD ERROR ANALYSIS OF GRADIENT DESCENT . In this section , we show that gradient descent follows the gradient flow of the modified loss Ẽ ( Equation 2 ) more closely than that of the original loss E. The argument is a standard argument from the backward error analysis of Runge-Kutta methods ( Hairer et al. , 2006 ) . We begin by observing that gradient descent ( Equation 1 ) can be interpreted as a Runge-Kutta method numerically integrating the following ODE : θ̇ = −∇θE ( θ ) ( 5 ) In the language of numerical analysis , gradient descent is the explicit Euler method numerically integrating the vector field f ( θ ) = −∇E ( θ ) . The explicit Euler method is of order 1 , which means that after one gradient descent step θn = θn−1 − h∇E ( θn−1 ) , the deviation from the gradient flow ‖θn−θ ( h ) ‖ is of orderO ( h2 ) , where θ ( h ) is the solution of Equation 5 starting at θn−1 and evaluated at time h. Backward error analysis was developed to deal with this discrepancy between the discrete steps of a Runge-Kutta method and the continuous exact solutions ( or flow ) of a differential equation . The main idea is to modify the ODE vector field θ̇ = f ( θ ) with corrections in powers of the step size f̃ ( θ ) = f ( θ ) + hf1 ( θ ) + h 2f2 ( θ ) + · · · ( 6 ) so that the numerical steps θn approximating the original Equation 5 now lie exactly on the solutions of the modified equation θ̇ = f̃ ( θ ) . In other words , backward error analysis finds the corrections fi in Equation 6 such that θn = θ̃ ( nh ) for all n , where θ̃ ( t ) is the solution of the modified equation starting at θ0 . In theory , we can now precisely study the flow of the modified equation to infer properties of the numerical method because its steps follow the modified differential equation solutions perfectly in a formal sense . The following result is a direct application of backward error analysis to gradient descent : Theorem 3.1 . Let E be a sufficiently differentiable function on a parameter space θ ∈ Rm . The modified equation for gradient flow ( Equation 5 ) is of the form θ̇ = −∇Ẽ ( θ ) +O ( h2 ) ( 7 ) where Ẽ = E + λRIG is the modified loss introduced in Equation 2 . Consider gradient flow with the modified loss θ̇ = −∇Ẽ ( θ ) and its solution θ̃ ( t ) starting at θn−1 . Now the local error ‖θn − θ̃ ( h ) ‖ between θ̃ ( h ) and one step of gradient descent θn = θn−1 − h∇E ( θn−1 ) is of order O ( h3 ) , while it is of order O ( h2 ) for gradient flow with the original loss . Proof . We begin by computing f1 for which the first two orders in h of the Taylor ’ s Series of the modified equation solution θ ( t ) at t = h coincide with one gradient descent step . Since θ′ ( t ) = f̃ ( θ ) , we see that θ′′ ( t ) = f̃ ′ ( θ ) f̃ ( θ ) and we find that θ + hf ( θ ) = θ + hf ( θ ) + h2 ( f1 ( θ ) + 1 2 f ′ ( θ ) f ( θ ) ) , yielding f1 ( θ ) = −f ′ ( θ ) f ( θ ) /2 . Now , when f is a gradient vector field with f = −∇E , we find : f1 ( θ ) = − 1 2 ( D2θE ) ∇θE ( θ ) = − 1 4 ∇‖∇E ( θ ) ‖2 , where D2θE is the Hessian of E ( θ ) . Putting this together , we obtain the first order modified equation : θ̇ = f + hf1 +O ( h2 ) = −∇ ( E ( θ ) + h 4 ‖∇E ( θ ) ‖2 ) +O ( h2 ) , which is a gradient system with modified loss Ẽ ( θ ) = E ( θ ) + h 4 ‖∇E ( θ ) ‖2 . As for the local error , if θ ( h ) is a solution of gradient flow starting at θn−1 , we have in general that θ ( h ) = θn + O ( h2 ) . The correction f1 is constructed so that it cancels out the O ( h2 ) term in the expansion of its solution , yielding θ̃ ( h ) = θn +O ( h3 ) . Remark 3.2 . A direct application of a standard result in backward error analysis ( Hairer & Lubich ( 1997 ) , Thm . 1 ) indicates that the learning rate range where the gradient flow of the modified loss provides a good approximation of gradient descent lies below h0 = CR/M , where∇E is analytic and bounded by M in a ball of radius R around the initialization point and where C depends on the Runge-Kutta method only , which can be estimated for gradient descent . We call this the moderate learning rate regime . For each learning rate below h0 , we can provably find an optimal truncation of the modified equation whose gradient flow is exponentially close to the steps of gradient descent , so the higher term corrections are likely to contribute to the dynamics . Given this , we see that the exact value of the upper bound for the moderate regime will correspond to a setting where the optimal truncation is the first order correction only . Calculating this in general is difficult and beyond the scope of this paper . Nonetheless , our experiments strongly suggest that this moderate learning rate regime overlaps substantially with the learning rate range typically used in deep learning . Next , we give a purely geometric interpretation of IGR , supporting Prediction 2.2 . Consider the loss surface S associated with a loss function E defined over the parameter space θ ∈ Rm . This loss surface is defined as the graph of the loss : S = { ( θ , E ( θ ) ) : θ ∈ Rm } ⊂ Rm+1 . We define α ( θ ) to be the angle between the tangent space TθS to S at θ and the parameter plane , i.e. , the linear subspace { ( θ , 0 ) : θ ∈ Rm } in Rm+1 . We can compute this angle using the inner product between the normal vectorN ( θ ) to S at θ and the normal vector ẑ to the parameter plane : α ( θ ) = arccos 〈N ( θ ) , ẑ〉 . Now we can define the loss surface slope at θ as being the tangent of this angle : slope ( θ ) : = tanα ( θ ) . This is a natural extension of the 1-dimensional notion of slope . With this definition , we can now reformulate the modified loss function in a purely geometric fashion : Proposition 3.3 . The modified loss Ẽ in Equation 2 can be expressed in terms of the loss surface slope as Ẽ ( θ ) = E ( θ ) + h4 slope 2 ( θ ) . This proposition is an immediate consequence of Theorem 3.1 and Corollary A.6.1 in Appendix A.2 . It tells us that gradient descent with higher amounts of implicit regularization ( higher learning rate ) will implicitly minimize the loss surface slope locally along with the original training loss . Prediction 2.2 claims that this local effect of implicit slope regularization accumulates into the global effect of directing gradient descent trajectories toward global minima in regions surrounded by shallower slopes - toward flatter ( or broader ) minima . Remark 3.4 . It is important to note that IGR does not help gradient descent to escape from local minima . In the learning rate regime where the truncated modified equation gives a good approximation for gradient descent , the steps of gradient descent follow the gradient flow of the modified loss closely . As Proposition A.10 shows , the local minima of the original loss are still local minima of the modified loss so gradient descent within this learning rate regime remains trapped within the basin of attraction of these minima . IGR does not lead to an escape from local minima , but instead , encourages a shallower path toward flatter solutions close to the submanifold of global interpolating minima , which the modified loss shares with the original loss ( Proposition A.10 ) .
This paper provides a unique perspective on the implicit regularization effect of gradient descent that has been observed and studied previously. The authors point out that the discrete steps taken by the gradient descent updates means that the path followed through the optimization landscape is not that of steepest descent, but some alternate path. Thinking of GD as trying to solve the continuous time evolution equation implied by GD, they analyze the errors that the actual updates make in solving this equation. Given these errors, they construct an alternate ODE whose solution has a discretization that is precisely the GD updates (up to higher order corrections in the learning rate). Determining the loss implied by this alternative ODE gives an additional term, proportional to the norm squared of the gradient, the learning rate, and the number of parameters. This "Implicit Regularization'' leads to flatter optimization solutions, implying a positive effect on the generalization properties of models optimized under GD.
SP:49ef158a8170a8002d1111080db8009d5a6419d1
Implicit Gradient Regularization
1 INTRODUCTION . The loss surface of a deep neural network is a mountainous terrain - highly non-convex with a multitude of peaks , plateaus and valleys ( Li et al. , 2018 ; Liu et al. , 2020 ) . Gradient descent provides a path through this landscape , taking discrete steps in the direction of steepest descent toward a sub-manifold of minima . However , this simple strategy can be just as hazardous as it sounds . For small learning rates , our model is likely to get stuck at the local minima closest to the starting point , which is unlikely to be the most desirable destination . For large learning rates , we run the risk of ricocheting between peaks and diverging . However , for moderate learning rates , gradient descent seems to move away from the closest local minima and move toward flatter regions where test data errors are often smaller ( Keskar et al. , 2017 ; Lewkowycz et al. , 2020 ; Li et al. , 2019 ) . This phenomenon becomes stronger for larger networks , which also tend to have a smaller test error ( Arora et al. , 2019a ; Belkin et al. , 2019 ; Geiger et al. , 2020 ; Liang & Rakhlin , 2018 ; Soudry et al. , 2018 ) . In addition , models with low test errors are more robust to parameter perturbations ( Morcos et al. , 2018 ) . Overall , these observations contribute to an emerging view that there is some form of implicit regularization in gradient descent and several sources of implicit regularization have been identified . We have found a surprising form of implicit regularization hidden within the discrete numerical flow of gradient descent . Gradient descent iterates in discrete steps along the gradient of the loss , so after each step it actually steps off the exact continuous path that minimizes the loss at each point . Instead of following a trajectory down the steepest local gradient , gradient descent follows a shallower path . We show that this trajectory is closer to an exact path along a modified loss surface , which can be calculated using backward error analysis from numerical integration theory ( Hairer et al. , 2006 ) . Our core idea is that the discrepancy between the original loss surface and this modified loss surface is a form of implicit regularization ( Theorem 3.1 , Section 3 ) . We begin by calculating the discrepancy between the modified loss and the original loss using backward error analysis and find that it is proportional to the second moment of the loss gradients , which we call Implicit Gradient Regularization ( IGR ) . Using differential geometry , we show that IGR is also proportional to the square of the loss surface slope , indicating that it encourages optimization paths with shallower slopes and optima discovery in flatter regions of the loss surface . Next , we ∗equal contribution explore the properties of this regularization in deep neural networks such as MLP ’ s trained to classify MNIST digits and ResNets trained to classify CIFAR-10 images and in a tractable two-parameter model . In these cases , we verify that IGR effectively encourages models toward minima in the vicinity of small gradient values , in flatter regions with shallower slopes , and that these minima have low test error , consistent with previous observations . We find that IGR can account for the observation that learning rate size is correlated with test accuracy and model robustness . Finally , we demonstrate that IGR can be used as an explicit regularizer , allowing us to directly strengthen this regularization beyond the maximum possible implicit gradient regularization strength . 2 THE MODIFIED LOSS LANDSCAPE INDUCED BY GRADIENT DESCENT . The general goal of gradient descent is to find a weight vector θ̂ in parameter space Rm that minimizes a loss E ( θ ) . Gradient descent proceeds by iteratively updating the model weights with learning rate h in the direction of the steepest loss gradient : θn+1 = θn − h∇θE ( θn ) ( 1 ) Now , even though gradient descent takes steps in the direction of the steepest loss gradient , it does not stay on the exact continuous path of the steepest loss gradient , because each iteration steps off the exact continuous path . Instead , we show that gradient descent follows a path that is closer to the exact continuous path given by θ̇ = −∇θẼ ( θ ) , along a modified loss Ẽ ( θ ) , which can be calculated analytically using backward error analysis ( see Theorem 3.1 and Section 3 ) , yielding : Ẽ ( θ ) = E ( θ ) + λRIG ( θ ) , ( 2 ) where λ ≡ hm 4 ( 3 ) and RIG ( θ ) ≡ 1 m m∑ i=1 ( ∇θiE ( θ ) ) 2 ( 4 ) Immediately , we see that this modified loss is composed of the original training loss E ( θ ) and an additional term , which we interpret as a regularizer RIG ( θ ) with regularization rate λ . We call RIG ( θ ) the implicit gradient regularizer because it penalizes regions of the loss landscape that have large gradient values , and because it is implicit in gradient descent , rather than being explicitly added to our loss . Definition . Implicit gradient regularization is the implicit regularisation behaviour originating from the use of discrete update steps in gradient descent , as characterized by Equation 2 . We can now make several predictions about IGR which we will explore in experiments : Prediction 2.1 . IGR encourages smaller values of RIG ( θ ) relative to the loss E ( θ ) . Given Equation 2 and Theorem 3.1 , we expect gradient descent to follow trajectories that have relatively small values of RIG ( θ ) . It is already well known that gradient descent converges by reducing the loss gradient so it is important to note that this prediction describes the relative size of RIG ( θ ) along the trajectory of gradient descent . To expose this phenomena in experiments , great care must be taken when comparing different gradient descent trajectories . For instance , in our deep learning experiments , we compare models at the iteration time of maximum test accuracy ( and we consider other controls in the appendix ) , which is an important time point for practical applications and is not trivially determined by the speed of learning ( Figures 1 , 2 ) . Also , related to this , since the regularization rate λ is proportional to the learning rate h and network size m ( Equation 3 ) , we expect that larger models and larger learning rates will encourage smaller values of RIG ( θ ) ( Figure 2 ) . Prediction 2.2 . IGR encourages the discovery of flatter optima . In section 3 we will show that RIG ( θ ) is proportional to the square of the loss surface slope . Given this and Prediction 2.1 , we expect that IGR will guide gradient descent along paths with shallower loss surface slopes , thereby encouraging the discovery of flatter , broader optima . Of course , it is possible to construct loss surfaces at odds with this ( such as a Mexican-hat loss surface , where all minima are equally flat ) . However , we will provide experimental support for this using loss surfaces that are of widespread interest in deep learning , such as MLPs trained on MNIST ( Figure 1 , 2 , 3 ) . Prediction 2.3 . IGR encourages higher test accuracy . Given Prediction 2.2 , we predict that IGR encourages higher test accuracy since flatter minima are known empirically to coincide with higher test accuracy ( Figure 2 ) . Prediction 2.4 . IGR encourages the discovery of optima that are more robust to parameter perturbations . There are several important observations to make about the properties of IGR : 1 ) It does not originate in any specific model architecture or initialization , although our analysis does provide a formula to explain the influence of these model properties through IGR ; 2 ) Other sources of implicit regularization also have an impact on learning , alongside IGR , and the relative importance of these contributions will likely depend on model architecture and initialization ; 3 ) In defining λ and RIG we chose to set λ proportional to the number of parameters m. To support this choice , we demonstrate in experiments that the test accuracy is controlled by the IGR rate λ . 4 ) The modified loss and the original loss share the same global minima , so IGR vanishes when the gradient vanishes . Despite this , the presence of IGR has an impact on learning since it changes the trajectory of gradient descent , and in over-parameterized models this can cause the final parameters to reach different solutions . 5 ) Our theoretical results are derived for full-batch gradient descent , which allows us to isolate the source of implicit regularisation from the stochasticity of stochastic gradient descent ( SGD ) . Extending our theoretical results to SGD is considerably more complicated , and as such , is beyond the scope of this paper . However , in some of our experiments , we will demonstrate that IGR persists in SGD , which is especially important for deep learning . Next , we will provide a proof for Theorem 3.1 , and we will provide experimental support for our predictions . 3 BACKWARD ERROR ANALYSIS OF GRADIENT DESCENT . In this section , we show that gradient descent follows the gradient flow of the modified loss Ẽ ( Equation 2 ) more closely than that of the original loss E. The argument is a standard argument from the backward error analysis of Runge-Kutta methods ( Hairer et al. , 2006 ) . We begin by observing that gradient descent ( Equation 1 ) can be interpreted as a Runge-Kutta method numerically integrating the following ODE : θ̇ = −∇θE ( θ ) ( 5 ) In the language of numerical analysis , gradient descent is the explicit Euler method numerically integrating the vector field f ( θ ) = −∇E ( θ ) . The explicit Euler method is of order 1 , which means that after one gradient descent step θn = θn−1 − h∇E ( θn−1 ) , the deviation from the gradient flow ‖θn−θ ( h ) ‖ is of orderO ( h2 ) , where θ ( h ) is the solution of Equation 5 starting at θn−1 and evaluated at time h. Backward error analysis was developed to deal with this discrepancy between the discrete steps of a Runge-Kutta method and the continuous exact solutions ( or flow ) of a differential equation . The main idea is to modify the ODE vector field θ̇ = f ( θ ) with corrections in powers of the step size f̃ ( θ ) = f ( θ ) + hf1 ( θ ) + h 2f2 ( θ ) + · · · ( 6 ) so that the numerical steps θn approximating the original Equation 5 now lie exactly on the solutions of the modified equation θ̇ = f̃ ( θ ) . In other words , backward error analysis finds the corrections fi in Equation 6 such that θn = θ̃ ( nh ) for all n , where θ̃ ( t ) is the solution of the modified equation starting at θ0 . In theory , we can now precisely study the flow of the modified equation to infer properties of the numerical method because its steps follow the modified differential equation solutions perfectly in a formal sense . The following result is a direct application of backward error analysis to gradient descent : Theorem 3.1 . Let E be a sufficiently differentiable function on a parameter space θ ∈ Rm . The modified equation for gradient flow ( Equation 5 ) is of the form θ̇ = −∇Ẽ ( θ ) +O ( h2 ) ( 7 ) where Ẽ = E + λRIG is the modified loss introduced in Equation 2 . Consider gradient flow with the modified loss θ̇ = −∇Ẽ ( θ ) and its solution θ̃ ( t ) starting at θn−1 . Now the local error ‖θn − θ̃ ( h ) ‖ between θ̃ ( h ) and one step of gradient descent θn = θn−1 − h∇E ( θn−1 ) is of order O ( h3 ) , while it is of order O ( h2 ) for gradient flow with the original loss . Proof . We begin by computing f1 for which the first two orders in h of the Taylor ’ s Series of the modified equation solution θ ( t ) at t = h coincide with one gradient descent step . Since θ′ ( t ) = f̃ ( θ ) , we see that θ′′ ( t ) = f̃ ′ ( θ ) f̃ ( θ ) and we find that θ + hf ( θ ) = θ + hf ( θ ) + h2 ( f1 ( θ ) + 1 2 f ′ ( θ ) f ( θ ) ) , yielding f1 ( θ ) = −f ′ ( θ ) f ( θ ) /2 . Now , when f is a gradient vector field with f = −∇E , we find : f1 ( θ ) = − 1 2 ( D2θE ) ∇θE ( θ ) = − 1 4 ∇‖∇E ( θ ) ‖2 , where D2θE is the Hessian of E ( θ ) . Putting this together , we obtain the first order modified equation : θ̇ = f + hf1 +O ( h2 ) = −∇ ( E ( θ ) + h 4 ‖∇E ( θ ) ‖2 ) +O ( h2 ) , which is a gradient system with modified loss Ẽ ( θ ) = E ( θ ) + h 4 ‖∇E ( θ ) ‖2 . As for the local error , if θ ( h ) is a solution of gradient flow starting at θn−1 , we have in general that θ ( h ) = θn + O ( h2 ) . The correction f1 is constructed so that it cancels out the O ( h2 ) term in the expansion of its solution , yielding θ̃ ( h ) = θn +O ( h3 ) . Remark 3.2 . A direct application of a standard result in backward error analysis ( Hairer & Lubich ( 1997 ) , Thm . 1 ) indicates that the learning rate range where the gradient flow of the modified loss provides a good approximation of gradient descent lies below h0 = CR/M , where∇E is analytic and bounded by M in a ball of radius R around the initialization point and where C depends on the Runge-Kutta method only , which can be estimated for gradient descent . We call this the moderate learning rate regime . For each learning rate below h0 , we can provably find an optimal truncation of the modified equation whose gradient flow is exponentially close to the steps of gradient descent , so the higher term corrections are likely to contribute to the dynamics . Given this , we see that the exact value of the upper bound for the moderate regime will correspond to a setting where the optimal truncation is the first order correction only . Calculating this in general is difficult and beyond the scope of this paper . Nonetheless , our experiments strongly suggest that this moderate learning rate regime overlaps substantially with the learning rate range typically used in deep learning . Next , we give a purely geometric interpretation of IGR , supporting Prediction 2.2 . Consider the loss surface S associated with a loss function E defined over the parameter space θ ∈ Rm . This loss surface is defined as the graph of the loss : S = { ( θ , E ( θ ) ) : θ ∈ Rm } ⊂ Rm+1 . We define α ( θ ) to be the angle between the tangent space TθS to S at θ and the parameter plane , i.e. , the linear subspace { ( θ , 0 ) : θ ∈ Rm } in Rm+1 . We can compute this angle using the inner product between the normal vectorN ( θ ) to S at θ and the normal vector ẑ to the parameter plane : α ( θ ) = arccos 〈N ( θ ) , ẑ〉 . Now we can define the loss surface slope at θ as being the tangent of this angle : slope ( θ ) : = tanα ( θ ) . This is a natural extension of the 1-dimensional notion of slope . With this definition , we can now reformulate the modified loss function in a purely geometric fashion : Proposition 3.3 . The modified loss Ẽ in Equation 2 can be expressed in terms of the loss surface slope as Ẽ ( θ ) = E ( θ ) + h4 slope 2 ( θ ) . This proposition is an immediate consequence of Theorem 3.1 and Corollary A.6.1 in Appendix A.2 . It tells us that gradient descent with higher amounts of implicit regularization ( higher learning rate ) will implicitly minimize the loss surface slope locally along with the original training loss . Prediction 2.2 claims that this local effect of implicit slope regularization accumulates into the global effect of directing gradient descent trajectories toward global minima in regions surrounded by shallower slopes - toward flatter ( or broader ) minima . Remark 3.4 . It is important to note that IGR does not help gradient descent to escape from local minima . In the learning rate regime where the truncated modified equation gives a good approximation for gradient descent , the steps of gradient descent follow the gradient flow of the modified loss closely . As Proposition A.10 shows , the local minima of the original loss are still local minima of the modified loss so gradient descent within this learning rate regime remains trapped within the basin of attraction of these minima . IGR does not lead to an escape from local minima , but instead , encourages a shallower path toward flatter solutions close to the submanifold of global interpolating minima , which the modified loss shares with the original loss ( Proposition A.10 ) .
The authors show the discrete steps of gradient descent implicitly regularize models by penalizing trajectories that have large loss-gradients, which is called Implicit Gradient Regularization in the paper. The authors adopt a standard argument from the backward error analysis of Runge-Kutta methods to show this phenomenon. In the paper, the authors also provide some empirical results which indicate gradient descent leads to flat minima where test errors are small and solutions are robust to noisy parameter perturbations.
SP:49ef158a8170a8002d1111080db8009d5a6419d1
Laplacian Eigenspaces, Horocycles and Neuron Models on Hyperbolic Spaces
1 INTRODUCTION . Conventional deep network techniques attempt to use architecture based on compositions of simple functions to learn representations of Euclidean data ( LeCun et al. , 2015 ) . They have achieved remarkable successes in a wide range of applications ( Hinton et al. , 2012 ; He et al. , 2016 ) . Geometric deep learning , a niche field that has caught the attention of many authors , attempts to generalize conventional learning techniques to non-Euclidean spaces ( Bronstein et al. , 2017 ; Monti et al. , 2017 ) . There has been growing interest in using hyperbolic spaces in machine learning tasks because they are well-suited for tree-like data representation ( Ontrup & Ritter , 2005 ; Alanis-Lobato et al. , 2016 ; Nickel & Kiela , 2017 ; Chamberlain et al. , 2018 ; Nickel & Kiela , 2018 ; Sala et al. , 2018 ; Ganea et al. , 2018b ; Tifrea et al. , 2019 ; Chami et al. , 2019 ; Liu et al. , 2019 ; Balazevic et al. , 2019 ; Yu & Sa , 2019 ; Gulcehre et al. , 2019 ; Law et al. , 2019 ) . Many authors have introduced hyperbolic analogs of classical learning tools ( Ganea et al. , 2018a ; Cho et al. , 2019 ; Nagano et al. , 2019 ; Grattarola et al. , 2019 ; Mathieu et al. , 2019 ; Ovinnikov , 2020 ; Khrulkov et al. , 2020 ; Shimizu et al. , 2020 ) . Spectral methods are successful in machine learning , from nonlinear dimensionality reduction ( Belkin & Partha , 2002 ) to clustering ( Shi & Malik , 2000 ; Ng et al. , 2002 ) to hashing ( Weiss et al. , 2009 ) to graph CNNs ( Bruna et al. , 2014 ) to spherical CNNs ( Cohen et al. , 2018 ) and to inference networks ( Pfau et al. , 2019 ) . Spectral methods have been applied to learning tasks on spheres ( Cohen et al. , 2018 ) and graphs ( Bruna et al. , 2014 ) , but not yet on hyperbolic spaces . This paper studies a spectral generalization of the FC ( affine ) layer on hyperbolic spaces . Before presenting the spectral generalization of the affine layer , we introduce some notations . Let ( · , · ) E be the inner product , | · | the Euclidean norm , and ρ an activation function . The Poincaré ball model of the hyperbolic space Hn ( n≥2 ) is a manifold { x∈Rn : |x| < 1 } equipped with a Riemannian metric ds2Hn= ∑n i=1 4 ( 1−|x| 2 ) −2dx2i . The boundary of Hn under its canonical embedding in Rn is the unit sphere Sn−1 . The classical neuron y=ρ ( ( x , w ) E+b ) is of input x∈Rn , output y∈R , with trainable parameters w∈Rn , b∈R . An affine layer Rn → Rm is a concatenation of m neurons . An alternative representation of the neuron x 7→ρ ( ( x , w ) E+b ) is given by 1 x∈Rn 7→ ρ ( λ ( x , ω ) E+b ) , ω∈Sn−1 , λ , b∈R . ( 1 ) This neuron is constant over any hyperplane that is perpendicular to a fixed direction ω . In Hn , a horocycle is a n−1 dimensional sphere ( one point deleted ) that is tangential to Sn−1 . Horocycles are hyperbolic counterparts of hyperplanes ( Bonola , 2012 ) . Horocyclic waves 〈x , ω〉H : = 12 log 1−|x|2 |x−ω|2 are constant over any horocycle that is tangential to Sn−1 at ω . Therefore , x∈Hn 7→ ρ ( λ〈x , ω〉H+b ) , ω∈Sn−1 , λ , b∈R ( 2 ) 1if w 6= ( 0 , . . . , 0 ) , one can take ω = w/|w| , λ = |w| ; else , one can take λ = 0 and any ω ∈ Sn−1 . generalizes the classical neuron model ( 1 ) , and a concatenation of finitely many ( 2 ) generalizes the FC ( affine ) layer . We call ( 2 ) a horocycle neuron . Figure 1 ( middle ) is an example on H2 . The neuron models in ( 1 , 2 ) are related to spectral theory because ( · , ω ) E ( respectively 〈· , ω〉H ) are building blocks of the Euclidean ( respectively hyperbolic ) Laplacian eigenspace . Moreover , many L2 spaces have a basis given by Laplacian eigenfunctions ( Einsiedler & Ward , 2017 ) . On one side , all Euclidean ( respectively hyperbolic ) eigenfunctions are some kind of “ superposition ” of ( · , ω ) E ( respectively 〈· , ω〉H ) . On the other side , neural networks based on ( 1 ) ( respectively ( 2 ) ) represent functions that are another kind of “ superposition ” of ( · , ω ) E ( respectively 〈· , ω〉H ) . They heuristically explain why the universal approximation property is likely to hold for networks constructed by ( 1 ) and ( 2 ) . By using the Hahn Banach theorem , an injectivity theorem of Helgason , and integral formula , we prove that finite sums of horocycle neurons ( 2 ) are universal approximators ( Theorem 2 ) . Let p ∈ Hn , Tp ( Hn ) be the tangent space of Hn at p , a ∈ Tp ( Hn ) , ⊕ be the Möbius addition ( Ungar , 2008 ) . We remind the reader that the following functions f1a , p ( x ) = 2|a| 1− |p|2 sinh −1 ( 2 ( −p⊕ x , a ) E ( 1− | − p⊕ x|2 ) |a| ) ( 3 ) are building blocks of many hyperbolic learning tools ( Ganea et al. , 2018a ; Mathieu et al. , 2019 ; Shimizu et al. , 2020 ) . Figure 1 illustrates examples of different neuron models ( 1 , 2 , 3 ) on H2 . In Lemma 1 , we shall present a close relationship between ( 2 ) and ( 3 ) . Using this relationship and Theorem 2 , we obtain a novel result on the expressivity of f1a , p ( Corollary 1 ) . This article contributes to hyperbolic learning . We first apply spectral methods , such as the horocycle , to hyperbolic deep learning . We prove results on the expressivity of horocycle neurons ( 2 ) and f1a , p ( 3 ) . With horocycle neurons , we obtain state-of-the-art results on the Poincaré-embedding subtree classification task and the classification accuracy of the 2-D visualization of images in in the experiment . 2 RELATED WORK . Universal approximation There is a vast literature on universal approximation ( Cybenko , 1989 ; Hornik et al. , 1989 ; Funahashi , 1989 ; Leshno et al. , 1993 ) . Cybenko ( 1989 ) ’ s existential approach uses the Hahn Banach theorem and Fourier transform of Radon measures . To prove Theorem 2 , we also use the Hahn Banach theorem , and additionally an integral formula ( 7 ) and an injectivity Theorem 1 of Helgason . Generalizing integral formulas and injectivity theorems is easier than generalizing Fourier transform of Radon measures on most non-Euclidean spaces . ( Carroll & Dickinson , 1989 ) uses the inverse Radon transform to prove universal approximation theorems . This method relates to ours , as injectivity theorems are akin to inverse Radon transforms . However , using the injectivity theorem is an existential approach while using the inverse Radon transform is a constructive one . Spectral methods Spectral methods in Bronstein et al . ( 2017 ) ; Bruna et al . ( 2014 ) ; Cohen et al . ( 2018 ) use a basis of L2 ( X ) given by eigenfunctions , whereX is a finite graph or the sphere . Because L2 ( Hn ) has no eigenfunctions as a basis , our approach is different from theirs . Hyperbolic deep learning One part of hyperbolic learning concerns embedding data into the hyperbolic space ( Nickel & Kiela , 2017 ; Sala et al. , 2018 ) . Another part concerns learning architectures with hyperbolic data as the input ( Ganea et al . ( 2018a ) ; Cho et al . ( 2019 ) ) . Ganea et al . ( 2018a ) proposes two ways to generalize the affine layer on hyperbolic spaces : one by replacing the linear and bias part of an affine map with ( 25 , 26 ) of their paper ; another one by using a concatenation of f1a , p in their hyperbolic multiple linear regression ( MLR ) . The latter seems more relevant to ours . A level set of f1a , p is a hypercycle that has the same distance to a chosen geodesic hypersurface , while a level set of a horocycle neuron is a horocycle that has the same “ spectral ” distance to an ideal point at infinity . Based on functions similar to f1a , p , Mathieu et al . ( 2019 ) ; Shimizu et al . ( 2020 ) build the gyroplane layer and Poincaré FC layer . Ganea et al . ( 2018a ) ; Cho et al . ( 2019 ) take geodesics as decision hyperplanes , while we ( initially ) take horocycles . We shall construct the horocycle multiple linear regression ( MLR ) , where decision hypersurfaces are geodesics . Geodesics decision hyperplanes ( Ganea et al. , 2018a ; Cho et al. , 2019 ) and geodesic decision hypersurfaces here arise from different methods . Khrulkov et al . ( 2020 ) investigates hyperbolic image embedding , where prototypes ( or models ) of each class are center-based . We study a different one , and we shall call our prototypes end-based . 3 HYPERBOLIC SPACES . This section reviews facts from hyperbolic geometry that are used in the proof of Theorem 2 . For the reader who is not interested in the proof , ( 4 ) is enough for the implementation . Hyperbolic metric We use the Poincaré model . The hyperbolic space Hn ( n≥2 ) is the manifold { x∈Rn : |x| < 1 } equipped with a Riemannian metric ds2 = ∑n i=1 4 ( 1−|x|2 ) −2dx2i . Let o be the origin of Hn . The distance function dHn satisfies dHn ( o , x ) =2 arctanh |x| . Geodesics , horocycles and corresponding points Geodesics in Hn are precisely circular arcs that are orthogonal to Sn−1 . Horocycles in Hn are precisely ( n−1 ) -dimensional spheres that are tangential to Sn−1 ( Helgason , 1970 ) . Horocycles are hyperbolic analogs of hyperplanes . Figure 2 illustrates geodesics and horocycles on H2 . Hyperbolic Poisson kernel The Poisson kernel for Hn is P ( x , ω ) = ( 1−|x|2 |x−ω|2 ) n−1 , where x∈Hn , ω∈Sn−1 ( Helgason ( 1970 ) [ p.108 ] ) . The function 〈· , ω〉H defined by 〈x , ω〉H = 1 2 ( n− 1 ) logP ( · , ω ) = 1 2 log 1− |x|2 |x− ω|2 ( 4 ) is constant over any horocycle that is tangential to Sn−1 at ω ( Figure 1 ( middle ) , ( 6 ) ) . Riemannian volume The Riemannian volume induced by the metric ds2 on Hn is dVol = 2n ( 1− |x|2 ) −ndx1 . . . dxn . ( 5 ) Horocycles Let Ξ be the set of horocycles of Hn , and let Ξω be the set of all horocycles that are tangential to Sn−1 at ω . Given λ∈R , we let ξλ , ω be the unique horocycle that connects ω and tanh ( λ/2 ) · ω . We have Ξω = ∪λ∈R { ξλ , ω } and Ξ = ∪ω∈Sn−1Ξω . The length of any geodesic ( that ends at ω ) line segment cut by ξλ1 , ω and ξλ2 , ω equals |λ1 − λ2| ( A.2 ) . Therefore |λ1 − λ2| is a natural distance function defined on Ξω , and the map λ→ ξλ , ω is an isometry between R and Ξω . This isometry is closely related to 〈· , ω〉H ( A.3 ) : for any x ∈ ξλ , ω , 〈x , ω〉H = λ/2 . ( 6 ) The annoying /2 in ( 6 ) is a tradeoff that the metric here is different from that in Helgason ( 2000 ) . Integral formula For fixed ω ∈ Sn−1 , Hn=∪λ∈Rξλ , ω . Let dVolξλ , ω be the measure induced by ds2 on ξλ , ω . Let L be a family of geodesics that end at ω , δ > 0 , and U=L ∩ ( ∪λ≤α≤λ+δξα , ω ) . For l ∈ L , dH ( l ∩ ξλ , ω , l ∩ ξλ+δ , ω ) =δ ( A.2 ) , hence dVol ( U ) = δ · dVolξλ , ω ( U ∩ ξλ , ω ) and therefore∫ Hn f ( x ) dVol ( x ) = ∫ R ( ∫ ξλ , ω f ( z ) dVolξλ , ω ( z ) ) dλ . ( 7 ) The above proof ( for Hn ) is essentially the same as that in ( Helgason , 2000 ) [ p.37 ] ( for H2 ) . To further convince the reader that ( 7 ) holds for all n , we give another simple proof in A.4 . Injectivity theorem With respect to the canonical measure on Ξ , Helgason ( 1970 ) [ p.13 ] proved Theorem 1 ( Helgason ) . If f ∈ L1 ( Hn ) and ∫ ξ f ( z ) dVolξ ( z ) = 0 for a.e ξ ∈ Ξ , then f = 0 a.e .. Theorem 1 demonstrates that if the integral of f ∈ L1 ( Hn ) over almost every horocycle is zero then f is also zero . This theorem and the integral formula ( 7 ) are essential for the proof of Theorem 2 .
This paper develops a MLR based on hyperbolic geometry. The idea is based on well-known concept of horocycle and horospheres which are known to be hyperbolic counterpart of line and plane in Euclidean geometry (see Coxter). Then the authors show the universal approximation which kind of follows similarly from the Euclidean counterpart. In fact we can probably conject that this universal approximation holds for any manifolds with constant sectional curvature.
SP:50fe6a0cf9b00e462adff4c4273b2604546b4023
Laplacian Eigenspaces, Horocycles and Neuron Models on Hyperbolic Spaces
1 INTRODUCTION . Conventional deep network techniques attempt to use architecture based on compositions of simple functions to learn representations of Euclidean data ( LeCun et al. , 2015 ) . They have achieved remarkable successes in a wide range of applications ( Hinton et al. , 2012 ; He et al. , 2016 ) . Geometric deep learning , a niche field that has caught the attention of many authors , attempts to generalize conventional learning techniques to non-Euclidean spaces ( Bronstein et al. , 2017 ; Monti et al. , 2017 ) . There has been growing interest in using hyperbolic spaces in machine learning tasks because they are well-suited for tree-like data representation ( Ontrup & Ritter , 2005 ; Alanis-Lobato et al. , 2016 ; Nickel & Kiela , 2017 ; Chamberlain et al. , 2018 ; Nickel & Kiela , 2018 ; Sala et al. , 2018 ; Ganea et al. , 2018b ; Tifrea et al. , 2019 ; Chami et al. , 2019 ; Liu et al. , 2019 ; Balazevic et al. , 2019 ; Yu & Sa , 2019 ; Gulcehre et al. , 2019 ; Law et al. , 2019 ) . Many authors have introduced hyperbolic analogs of classical learning tools ( Ganea et al. , 2018a ; Cho et al. , 2019 ; Nagano et al. , 2019 ; Grattarola et al. , 2019 ; Mathieu et al. , 2019 ; Ovinnikov , 2020 ; Khrulkov et al. , 2020 ; Shimizu et al. , 2020 ) . Spectral methods are successful in machine learning , from nonlinear dimensionality reduction ( Belkin & Partha , 2002 ) to clustering ( Shi & Malik , 2000 ; Ng et al. , 2002 ) to hashing ( Weiss et al. , 2009 ) to graph CNNs ( Bruna et al. , 2014 ) to spherical CNNs ( Cohen et al. , 2018 ) and to inference networks ( Pfau et al. , 2019 ) . Spectral methods have been applied to learning tasks on spheres ( Cohen et al. , 2018 ) and graphs ( Bruna et al. , 2014 ) , but not yet on hyperbolic spaces . This paper studies a spectral generalization of the FC ( affine ) layer on hyperbolic spaces . Before presenting the spectral generalization of the affine layer , we introduce some notations . Let ( · , · ) E be the inner product , | · | the Euclidean norm , and ρ an activation function . The Poincaré ball model of the hyperbolic space Hn ( n≥2 ) is a manifold { x∈Rn : |x| < 1 } equipped with a Riemannian metric ds2Hn= ∑n i=1 4 ( 1−|x| 2 ) −2dx2i . The boundary of Hn under its canonical embedding in Rn is the unit sphere Sn−1 . The classical neuron y=ρ ( ( x , w ) E+b ) is of input x∈Rn , output y∈R , with trainable parameters w∈Rn , b∈R . An affine layer Rn → Rm is a concatenation of m neurons . An alternative representation of the neuron x 7→ρ ( ( x , w ) E+b ) is given by 1 x∈Rn 7→ ρ ( λ ( x , ω ) E+b ) , ω∈Sn−1 , λ , b∈R . ( 1 ) This neuron is constant over any hyperplane that is perpendicular to a fixed direction ω . In Hn , a horocycle is a n−1 dimensional sphere ( one point deleted ) that is tangential to Sn−1 . Horocycles are hyperbolic counterparts of hyperplanes ( Bonola , 2012 ) . Horocyclic waves 〈x , ω〉H : = 12 log 1−|x|2 |x−ω|2 are constant over any horocycle that is tangential to Sn−1 at ω . Therefore , x∈Hn 7→ ρ ( λ〈x , ω〉H+b ) , ω∈Sn−1 , λ , b∈R ( 2 ) 1if w 6= ( 0 , . . . , 0 ) , one can take ω = w/|w| , λ = |w| ; else , one can take λ = 0 and any ω ∈ Sn−1 . generalizes the classical neuron model ( 1 ) , and a concatenation of finitely many ( 2 ) generalizes the FC ( affine ) layer . We call ( 2 ) a horocycle neuron . Figure 1 ( middle ) is an example on H2 . The neuron models in ( 1 , 2 ) are related to spectral theory because ( · , ω ) E ( respectively 〈· , ω〉H ) are building blocks of the Euclidean ( respectively hyperbolic ) Laplacian eigenspace . Moreover , many L2 spaces have a basis given by Laplacian eigenfunctions ( Einsiedler & Ward , 2017 ) . On one side , all Euclidean ( respectively hyperbolic ) eigenfunctions are some kind of “ superposition ” of ( · , ω ) E ( respectively 〈· , ω〉H ) . On the other side , neural networks based on ( 1 ) ( respectively ( 2 ) ) represent functions that are another kind of “ superposition ” of ( · , ω ) E ( respectively 〈· , ω〉H ) . They heuristically explain why the universal approximation property is likely to hold for networks constructed by ( 1 ) and ( 2 ) . By using the Hahn Banach theorem , an injectivity theorem of Helgason , and integral formula , we prove that finite sums of horocycle neurons ( 2 ) are universal approximators ( Theorem 2 ) . Let p ∈ Hn , Tp ( Hn ) be the tangent space of Hn at p , a ∈ Tp ( Hn ) , ⊕ be the Möbius addition ( Ungar , 2008 ) . We remind the reader that the following functions f1a , p ( x ) = 2|a| 1− |p|2 sinh −1 ( 2 ( −p⊕ x , a ) E ( 1− | − p⊕ x|2 ) |a| ) ( 3 ) are building blocks of many hyperbolic learning tools ( Ganea et al. , 2018a ; Mathieu et al. , 2019 ; Shimizu et al. , 2020 ) . Figure 1 illustrates examples of different neuron models ( 1 , 2 , 3 ) on H2 . In Lemma 1 , we shall present a close relationship between ( 2 ) and ( 3 ) . Using this relationship and Theorem 2 , we obtain a novel result on the expressivity of f1a , p ( Corollary 1 ) . This article contributes to hyperbolic learning . We first apply spectral methods , such as the horocycle , to hyperbolic deep learning . We prove results on the expressivity of horocycle neurons ( 2 ) and f1a , p ( 3 ) . With horocycle neurons , we obtain state-of-the-art results on the Poincaré-embedding subtree classification task and the classification accuracy of the 2-D visualization of images in in the experiment . 2 RELATED WORK . Universal approximation There is a vast literature on universal approximation ( Cybenko , 1989 ; Hornik et al. , 1989 ; Funahashi , 1989 ; Leshno et al. , 1993 ) . Cybenko ( 1989 ) ’ s existential approach uses the Hahn Banach theorem and Fourier transform of Radon measures . To prove Theorem 2 , we also use the Hahn Banach theorem , and additionally an integral formula ( 7 ) and an injectivity Theorem 1 of Helgason . Generalizing integral formulas and injectivity theorems is easier than generalizing Fourier transform of Radon measures on most non-Euclidean spaces . ( Carroll & Dickinson , 1989 ) uses the inverse Radon transform to prove universal approximation theorems . This method relates to ours , as injectivity theorems are akin to inverse Radon transforms . However , using the injectivity theorem is an existential approach while using the inverse Radon transform is a constructive one . Spectral methods Spectral methods in Bronstein et al . ( 2017 ) ; Bruna et al . ( 2014 ) ; Cohen et al . ( 2018 ) use a basis of L2 ( X ) given by eigenfunctions , whereX is a finite graph or the sphere . Because L2 ( Hn ) has no eigenfunctions as a basis , our approach is different from theirs . Hyperbolic deep learning One part of hyperbolic learning concerns embedding data into the hyperbolic space ( Nickel & Kiela , 2017 ; Sala et al. , 2018 ) . Another part concerns learning architectures with hyperbolic data as the input ( Ganea et al . ( 2018a ) ; Cho et al . ( 2019 ) ) . Ganea et al . ( 2018a ) proposes two ways to generalize the affine layer on hyperbolic spaces : one by replacing the linear and bias part of an affine map with ( 25 , 26 ) of their paper ; another one by using a concatenation of f1a , p in their hyperbolic multiple linear regression ( MLR ) . The latter seems more relevant to ours . A level set of f1a , p is a hypercycle that has the same distance to a chosen geodesic hypersurface , while a level set of a horocycle neuron is a horocycle that has the same “ spectral ” distance to an ideal point at infinity . Based on functions similar to f1a , p , Mathieu et al . ( 2019 ) ; Shimizu et al . ( 2020 ) build the gyroplane layer and Poincaré FC layer . Ganea et al . ( 2018a ) ; Cho et al . ( 2019 ) take geodesics as decision hyperplanes , while we ( initially ) take horocycles . We shall construct the horocycle multiple linear regression ( MLR ) , where decision hypersurfaces are geodesics . Geodesics decision hyperplanes ( Ganea et al. , 2018a ; Cho et al. , 2019 ) and geodesic decision hypersurfaces here arise from different methods . Khrulkov et al . ( 2020 ) investigates hyperbolic image embedding , where prototypes ( or models ) of each class are center-based . We study a different one , and we shall call our prototypes end-based . 3 HYPERBOLIC SPACES . This section reviews facts from hyperbolic geometry that are used in the proof of Theorem 2 . For the reader who is not interested in the proof , ( 4 ) is enough for the implementation . Hyperbolic metric We use the Poincaré model . The hyperbolic space Hn ( n≥2 ) is the manifold { x∈Rn : |x| < 1 } equipped with a Riemannian metric ds2 = ∑n i=1 4 ( 1−|x|2 ) −2dx2i . Let o be the origin of Hn . The distance function dHn satisfies dHn ( o , x ) =2 arctanh |x| . Geodesics , horocycles and corresponding points Geodesics in Hn are precisely circular arcs that are orthogonal to Sn−1 . Horocycles in Hn are precisely ( n−1 ) -dimensional spheres that are tangential to Sn−1 ( Helgason , 1970 ) . Horocycles are hyperbolic analogs of hyperplanes . Figure 2 illustrates geodesics and horocycles on H2 . Hyperbolic Poisson kernel The Poisson kernel for Hn is P ( x , ω ) = ( 1−|x|2 |x−ω|2 ) n−1 , where x∈Hn , ω∈Sn−1 ( Helgason ( 1970 ) [ p.108 ] ) . The function 〈· , ω〉H defined by 〈x , ω〉H = 1 2 ( n− 1 ) logP ( · , ω ) = 1 2 log 1− |x|2 |x− ω|2 ( 4 ) is constant over any horocycle that is tangential to Sn−1 at ω ( Figure 1 ( middle ) , ( 6 ) ) . Riemannian volume The Riemannian volume induced by the metric ds2 on Hn is dVol = 2n ( 1− |x|2 ) −ndx1 . . . dxn . ( 5 ) Horocycles Let Ξ be the set of horocycles of Hn , and let Ξω be the set of all horocycles that are tangential to Sn−1 at ω . Given λ∈R , we let ξλ , ω be the unique horocycle that connects ω and tanh ( λ/2 ) · ω . We have Ξω = ∪λ∈R { ξλ , ω } and Ξ = ∪ω∈Sn−1Ξω . The length of any geodesic ( that ends at ω ) line segment cut by ξλ1 , ω and ξλ2 , ω equals |λ1 − λ2| ( A.2 ) . Therefore |λ1 − λ2| is a natural distance function defined on Ξω , and the map λ→ ξλ , ω is an isometry between R and Ξω . This isometry is closely related to 〈· , ω〉H ( A.3 ) : for any x ∈ ξλ , ω , 〈x , ω〉H = λ/2 . ( 6 ) The annoying /2 in ( 6 ) is a tradeoff that the metric here is different from that in Helgason ( 2000 ) . Integral formula For fixed ω ∈ Sn−1 , Hn=∪λ∈Rξλ , ω . Let dVolξλ , ω be the measure induced by ds2 on ξλ , ω . Let L be a family of geodesics that end at ω , δ > 0 , and U=L ∩ ( ∪λ≤α≤λ+δξα , ω ) . For l ∈ L , dH ( l ∩ ξλ , ω , l ∩ ξλ+δ , ω ) =δ ( A.2 ) , hence dVol ( U ) = δ · dVolξλ , ω ( U ∩ ξλ , ω ) and therefore∫ Hn f ( x ) dVol ( x ) = ∫ R ( ∫ ξλ , ω f ( z ) dVolξλ , ω ( z ) ) dλ . ( 7 ) The above proof ( for Hn ) is essentially the same as that in ( Helgason , 2000 ) [ p.37 ] ( for H2 ) . To further convince the reader that ( 7 ) holds for all n , we give another simple proof in A.4 . Injectivity theorem With respect to the canonical measure on Ξ , Helgason ( 1970 ) [ p.13 ] proved Theorem 1 ( Helgason ) . If f ∈ L1 ( Hn ) and ∫ ξ f ( z ) dVolξ ( z ) = 0 for a.e ξ ∈ Ξ , then f = 0 a.e .. Theorem 1 demonstrates that if the integral of f ∈ L1 ( Hn ) over almost every horocycle is zero then f is also zero . This theorem and the integral formula ( 7 ) are essential for the proof of Theorem 2 .
This paper proposes new neural models for hyperbolic space, which unlike previous hyperbolic NN works, relies on the notion of horocycle in the Poincare disk. This novel framework has connections to spectral learnig in hyperbolic space. Representation theorems alla Cybenko for layers constructed from these neurons are presented. Finally, various experiments on clustering and classifying datasets using these neurons to generate hyperbolic embeddings are presented.
SP:50fe6a0cf9b00e462adff4c4273b2604546b4023
Variance Based Sample Weighting for Supervised Deep Learning
In the context of supervised learning of a function by a Neural Network ( NN ) , we claim and empirically justify that a NN yields better results when the distribution of the data set focuses on regions where the function to learn is steeper . We first traduce this assumption in a mathematically workable way using Taylor expansion . Then , theoretical derivations allow to construct a methodology that we call Variance Based Samples Weighting ( VBSW ) . VBSW uses local variance of the labels to weight the training points . This methodology is general , scalable , cost effective , and significantly increases the performances of a large class of NNs for various classification and regression tasks on image , text and multivariate data . We highlight its benefits with experiments involving NNs from shallow linear NN to ResNet ( He et al. , 2015 ) or Bert ( Devlin et al. , 2019 ) . 1 INTRODUCTION . When a Machine Learning ( ML ) model is used to learn from data , the distribution of the training data set can have a strong impact on its performances . More specifically , in the context of Deep Learning ( DL ) , several works have hinted at the importance of the training set . In Bengio et al . ( 2009 ) ; Matiisen et al . ( 2017 ) , the authors exploit the observation that a human will benefit more from easy examples than from harder ones at the beginning of a learning task . They construct a curriculum , inducing a change in the distribution of the training data set that makes a Neural Network ( NN ) achieve better results in an ML problem . With a different approach , Active Learning ( Settles , 2012 ) modifies dynamically the distribution of the training data , by selecting the data points that will make the training more efficient . Finally , in Reinforcement Learning , the distribution of experiments is crucial for the agent to learn efficiently . Nonetheless , the challenge of finding a good distribution is not specific to ML . Indeed , in the context of Monte Carlo estimation of a quantity of interest based on a random variable X ∼ dPX , Importance Sampling owes its efficiency to the construction of a second random variable , X̄ ∼ dPX̄ that will be used instead of X to improve the estimation of this quantity . Jie & Abbeel ( 2010 ) even make a connection between the success of likelihood ratio policy gradients and importance sampling , which shows that ML and Monte Carlo estimation , both distribution based methods , are closely linked . In this paper , we leverage the importance of the training set distribution to improve performances of NNs in supervised DL . This task can be formalized as approximating a function f with a model fθ parametrized by θ . We build a new distribution from the training points and their labels , based on the observation that fθ needs more data points to approximate f on the regions where it is steep . We use Taylor expansion of a function f , which links the local behaviour of f to its derivatives , to build this distribution . We show that up to a certain order and locally , variance is an estimator of Taylor expansion . It allows constructing a methodology called Variance Based Sample Weighting ( VBSW ) that weights each training data points using the local variance of their neighbor labels to simulate the new distribution . Sample weighting has already been explored in many works and for various goals . Kumar et al . ( 2010 ) ; Jiang et al . ( 2015 ) use it to prioritize easier samples for the training , Shrivastava et al . ( 2016 ) for hard example mining , Cui et al . ( 2019 ) to avoid class imbalance , or ( Liu & Tao , 2016 ) to solve noisy label problem . In this work , the weights ’ construction relies on a more general claim that can be applied to any data set and whose goal is to improve the performances of the model . VBSW is general , because it can be applied to any supervised ML problem based on a loss function . In this work we specifically investigate VBSW application to DL . In that case , VBSW is applied within the feature space of a pre-trained NN . We validate VBSW for DL by obtaining performance improvement on various tasks like classification and regression of text , from Glue benchmark ( Wang et al. , 2019 ) , image , from MNIST ( LeCun & Cortes , 2010 ) and Cifar10 ( Krizhevsky et al . ) and multivariate data , from UCI ML repository ( Dua & Graff , 2017 ) , for several models ranging from linear regression to Bert ( Devlin et al. , 2019 ) or ResNet20 ( He et al. , 2015 ) . As a highlight , we obtain up to 1.65 % classification improvement on Cifar10 with a ResNet . Finally , we conduct analyses on the complementarity of VBSW with other weighting techniques and its robustness . Contributions : ( i ) We present and investigate a new approach of the learning problem , based on the variations of the function f to learn . ( ii ) We construct a new simple , scalable , versatile and cost effective methodology , VBSW , that exploits these findings in order to boost the performances of a NN . ( iii ) We validate VBSW on various ML tasks . 2 RELATED WORKS . Active Learning - Our methodology is based on the consideration that not every sample bring the same amount of information . Active learning ( AL ) exploits the same idea , in the sense that it adapts the training strategy to the problem by introducing a data point selection rule . In ( Gal et al. , 2017 ) , the authors introduce a methodology based on Bayesian Neural Networks ( BNN ) to adapt the selection of points used for the training . Using the variational properties of BNN , they design a rule to focus the training on points that will reduce the prediction uncertainty of the NN . In ( Konyushkova et al. , 2017 ) , the construction of the selection rule is taken as a ML problem itself . See ( Settles , 2012 ) for a review of more classical AL methods . While AL selects the data points , so modifies the distribution of the initial training data set , VBSW is applied independently of the training so the distribution of the weights can not change throughout the training . Examples Weighting - VBSW can be categorized as an example weighting algorithm . The idea of weighting the data set has already been explored in different ways and for different purposes . While curriculum learning ( Bengio et al. , 2009 ; Matiisen et al. , 2017 ) starts the training with easier examples , Self paced learning ( Kumar et al. , 2010 ; Jiang et al. , 2015 ) downscales harder examples . However , some works have proven that focusing on harder examples at the beginning of the learning could accelerate it . In ( Shrivastava et al. , 2016 ) , hard example mining is performed to give more importance to harder examples by selecting them primarily . Example weighting is used in ( Cui et al. , 2019 ) to tackle the class imbalance problem by weighting rarer , so harder examples . At the contrary , in ( Liu & Tao , 2016 ) it is used to solve the noisy label problem by focusing on cleaner , so easier examples . All these ideas show that depending on the application , example weighting can be performed in an opposed manner . Some works aim at going beyond this opposition by proposing more general methodologies . In ( Chang et al. , 2017 ) , the authors use the variance of the prediction of each point throughout the training to decide whether it should be weighted or not . A meta learning approach is proposed in ( Ren et al. , 2018 ) , where the authors choose the weights after an optimization loop included in the training . VBSW stands out from the previously mentioned example weighting methods because it is built on a more general assumption that a model would simply need more points to learn more complicated functions . Its effect is to improve the performances of a NN , without solving data set specific problems like class imbalance or noisy labels . Importance Sampling - Some of the previously mentioned methods use importance sampling to design the weights of the data set or to correct the bias induced by the sample selection ( Katharopoulos & Fleuret , 2018 ) . Here , we construct a new distribution that could be interpreted as an importance distribution . However , we weight the data points to simulate this distribution , not to correct a bias induced by this distribution . Generalization Bound - Generalization bound for the learning theory of NN have motivated many works , most of which are reviewed in ( Jakubovitz et al. , 2018 ) . In Bartlett et al . ( 1998 ) , Bartlett et al . ( 2019 ) , the authors focus on VC-dimension , a measure which depends on the number of parameters of NNs . Arora et al . ( 2018 ) introduces a compression approach that aims at reducing the number of model parameters to investigate its generalization capacities . PAC-Bayes analysis constructs generalization bounds using a priori and a posteriori distributions over the possible models . It is investigated for example in Neyshabur et al . ( 2018 ) ; Bartlett et al . ( 2017 ) , and Neyshabur et al . ( 2017 ) ; Xu & Mannor ( 2012 ) links PAC-Bayes theory to the notion of sharpness of a NN , i.e . its robustness to small perturbation . While sharpness of the model is often mentioned in the previous works , our bound includes the derivatives of f , which can be seen as an indicator of the sharpness of the function to learn . Even if it uses elements of previous works , like the Lipschitz constant of fθ , our work does not pretend to tighten and improve the already existing generalization bounds , but only emphasizes the intuition that the NN would need more points to capture sharper functions . In a sense , it investigates the robustness to perturbations in the input space , not in the parameter space . 3 A NEW TRAINING DISTRIBUTION BASED ON TAYLOR EXPANSION . In this section , we first illustrate why a NN may need more points where f is steep by deriving a generalization bound that involves the derivatives of f . Then , using Taylor expansion , we build a new training distribution that improves the performances of a NN on simple functions . 3.1 PROBLEM FORMULATION . We formalize the supervised ML task as approximating a function f : S ⊂ Rni → Rno with an ML model fθ parametrized by θ , where S is a measured sub-space of Rni depending on the application . To this end , we are given a training data set of N points , { X1 , ... , XN } ∈ S , drawn from X ∼ dPX and their point-wise values , or labels { f ( X1 ) , ... , f ( XN ) } . Parameters θ have to be found in order to minimize an integrated loss function JX ( θ ) = EX [ L ( fθ ( X ) , f ( X ) ) ] , with L the loss function , L : Rno × Rno → R. The data allow estimating JX ( θ ) by ĴX ( θ ) = 1N ∑N i=1 L ( fθ ( Xi ) , f ( Xi ) ) . Then , an optimization algorithm is used to find a minimum of ĴX ( θ ) w.r.t . θ .
A method for computing sample learning weights based on variance is proposed. The method is model independent and a simple k-NN based estimator for the weights is derived. The authors justify their work by appealing to a novel generalisation bound. Overall the idea is interesting but the exposition needs to be significantly improved as proofs are difficult to follow as it currently stands.
SP:ea4d4d3798119498a6df81a19dcab2ae4978996c
Variance Based Sample Weighting for Supervised Deep Learning
In the context of supervised learning of a function by a Neural Network ( NN ) , we claim and empirically justify that a NN yields better results when the distribution of the data set focuses on regions where the function to learn is steeper . We first traduce this assumption in a mathematically workable way using Taylor expansion . Then , theoretical derivations allow to construct a methodology that we call Variance Based Samples Weighting ( VBSW ) . VBSW uses local variance of the labels to weight the training points . This methodology is general , scalable , cost effective , and significantly increases the performances of a large class of NNs for various classification and regression tasks on image , text and multivariate data . We highlight its benefits with experiments involving NNs from shallow linear NN to ResNet ( He et al. , 2015 ) or Bert ( Devlin et al. , 2019 ) . 1 INTRODUCTION . When a Machine Learning ( ML ) model is used to learn from data , the distribution of the training data set can have a strong impact on its performances . More specifically , in the context of Deep Learning ( DL ) , several works have hinted at the importance of the training set . In Bengio et al . ( 2009 ) ; Matiisen et al . ( 2017 ) , the authors exploit the observation that a human will benefit more from easy examples than from harder ones at the beginning of a learning task . They construct a curriculum , inducing a change in the distribution of the training data set that makes a Neural Network ( NN ) achieve better results in an ML problem . With a different approach , Active Learning ( Settles , 2012 ) modifies dynamically the distribution of the training data , by selecting the data points that will make the training more efficient . Finally , in Reinforcement Learning , the distribution of experiments is crucial for the agent to learn efficiently . Nonetheless , the challenge of finding a good distribution is not specific to ML . Indeed , in the context of Monte Carlo estimation of a quantity of interest based on a random variable X ∼ dPX , Importance Sampling owes its efficiency to the construction of a second random variable , X̄ ∼ dPX̄ that will be used instead of X to improve the estimation of this quantity . Jie & Abbeel ( 2010 ) even make a connection between the success of likelihood ratio policy gradients and importance sampling , which shows that ML and Monte Carlo estimation , both distribution based methods , are closely linked . In this paper , we leverage the importance of the training set distribution to improve performances of NNs in supervised DL . This task can be formalized as approximating a function f with a model fθ parametrized by θ . We build a new distribution from the training points and their labels , based on the observation that fθ needs more data points to approximate f on the regions where it is steep . We use Taylor expansion of a function f , which links the local behaviour of f to its derivatives , to build this distribution . We show that up to a certain order and locally , variance is an estimator of Taylor expansion . It allows constructing a methodology called Variance Based Sample Weighting ( VBSW ) that weights each training data points using the local variance of their neighbor labels to simulate the new distribution . Sample weighting has already been explored in many works and for various goals . Kumar et al . ( 2010 ) ; Jiang et al . ( 2015 ) use it to prioritize easier samples for the training , Shrivastava et al . ( 2016 ) for hard example mining , Cui et al . ( 2019 ) to avoid class imbalance , or ( Liu & Tao , 2016 ) to solve noisy label problem . In this work , the weights ’ construction relies on a more general claim that can be applied to any data set and whose goal is to improve the performances of the model . VBSW is general , because it can be applied to any supervised ML problem based on a loss function . In this work we specifically investigate VBSW application to DL . In that case , VBSW is applied within the feature space of a pre-trained NN . We validate VBSW for DL by obtaining performance improvement on various tasks like classification and regression of text , from Glue benchmark ( Wang et al. , 2019 ) , image , from MNIST ( LeCun & Cortes , 2010 ) and Cifar10 ( Krizhevsky et al . ) and multivariate data , from UCI ML repository ( Dua & Graff , 2017 ) , for several models ranging from linear regression to Bert ( Devlin et al. , 2019 ) or ResNet20 ( He et al. , 2015 ) . As a highlight , we obtain up to 1.65 % classification improvement on Cifar10 with a ResNet . Finally , we conduct analyses on the complementarity of VBSW with other weighting techniques and its robustness . Contributions : ( i ) We present and investigate a new approach of the learning problem , based on the variations of the function f to learn . ( ii ) We construct a new simple , scalable , versatile and cost effective methodology , VBSW , that exploits these findings in order to boost the performances of a NN . ( iii ) We validate VBSW on various ML tasks . 2 RELATED WORKS . Active Learning - Our methodology is based on the consideration that not every sample bring the same amount of information . Active learning ( AL ) exploits the same idea , in the sense that it adapts the training strategy to the problem by introducing a data point selection rule . In ( Gal et al. , 2017 ) , the authors introduce a methodology based on Bayesian Neural Networks ( BNN ) to adapt the selection of points used for the training . Using the variational properties of BNN , they design a rule to focus the training on points that will reduce the prediction uncertainty of the NN . In ( Konyushkova et al. , 2017 ) , the construction of the selection rule is taken as a ML problem itself . See ( Settles , 2012 ) for a review of more classical AL methods . While AL selects the data points , so modifies the distribution of the initial training data set , VBSW is applied independently of the training so the distribution of the weights can not change throughout the training . Examples Weighting - VBSW can be categorized as an example weighting algorithm . The idea of weighting the data set has already been explored in different ways and for different purposes . While curriculum learning ( Bengio et al. , 2009 ; Matiisen et al. , 2017 ) starts the training with easier examples , Self paced learning ( Kumar et al. , 2010 ; Jiang et al. , 2015 ) downscales harder examples . However , some works have proven that focusing on harder examples at the beginning of the learning could accelerate it . In ( Shrivastava et al. , 2016 ) , hard example mining is performed to give more importance to harder examples by selecting them primarily . Example weighting is used in ( Cui et al. , 2019 ) to tackle the class imbalance problem by weighting rarer , so harder examples . At the contrary , in ( Liu & Tao , 2016 ) it is used to solve the noisy label problem by focusing on cleaner , so easier examples . All these ideas show that depending on the application , example weighting can be performed in an opposed manner . Some works aim at going beyond this opposition by proposing more general methodologies . In ( Chang et al. , 2017 ) , the authors use the variance of the prediction of each point throughout the training to decide whether it should be weighted or not . A meta learning approach is proposed in ( Ren et al. , 2018 ) , where the authors choose the weights after an optimization loop included in the training . VBSW stands out from the previously mentioned example weighting methods because it is built on a more general assumption that a model would simply need more points to learn more complicated functions . Its effect is to improve the performances of a NN , without solving data set specific problems like class imbalance or noisy labels . Importance Sampling - Some of the previously mentioned methods use importance sampling to design the weights of the data set or to correct the bias induced by the sample selection ( Katharopoulos & Fleuret , 2018 ) . Here , we construct a new distribution that could be interpreted as an importance distribution . However , we weight the data points to simulate this distribution , not to correct a bias induced by this distribution . Generalization Bound - Generalization bound for the learning theory of NN have motivated many works , most of which are reviewed in ( Jakubovitz et al. , 2018 ) . In Bartlett et al . ( 1998 ) , Bartlett et al . ( 2019 ) , the authors focus on VC-dimension , a measure which depends on the number of parameters of NNs . Arora et al . ( 2018 ) introduces a compression approach that aims at reducing the number of model parameters to investigate its generalization capacities . PAC-Bayes analysis constructs generalization bounds using a priori and a posteriori distributions over the possible models . It is investigated for example in Neyshabur et al . ( 2018 ) ; Bartlett et al . ( 2017 ) , and Neyshabur et al . ( 2017 ) ; Xu & Mannor ( 2012 ) links PAC-Bayes theory to the notion of sharpness of a NN , i.e . its robustness to small perturbation . While sharpness of the model is often mentioned in the previous works , our bound includes the derivatives of f , which can be seen as an indicator of the sharpness of the function to learn . Even if it uses elements of previous works , like the Lipschitz constant of fθ , our work does not pretend to tighten and improve the already existing generalization bounds , but only emphasizes the intuition that the NN would need more points to capture sharper functions . In a sense , it investigates the robustness to perturbations in the input space , not in the parameter space . 3 A NEW TRAINING DISTRIBUTION BASED ON TAYLOR EXPANSION . In this section , we first illustrate why a NN may need more points where f is steep by deriving a generalization bound that involves the derivatives of f . Then , using Taylor expansion , we build a new training distribution that improves the performances of a NN on simple functions . 3.1 PROBLEM FORMULATION . We formalize the supervised ML task as approximating a function f : S ⊂ Rni → Rno with an ML model fθ parametrized by θ , where S is a measured sub-space of Rni depending on the application . To this end , we are given a training data set of N points , { X1 , ... , XN } ∈ S , drawn from X ∼ dPX and their point-wise values , or labels { f ( X1 ) , ... , f ( XN ) } . Parameters θ have to be found in order to minimize an integrated loss function JX ( θ ) = EX [ L ( fθ ( X ) , f ( X ) ) ] , with L the loss function , L : Rno × Rno → R. The data allow estimating JX ( θ ) by ĴX ( θ ) = 1N ∑N i=1 L ( fθ ( Xi ) , f ( Xi ) ) . Then , an optimization algorithm is used to find a minimum of ĴX ( θ ) w.r.t . θ .
The authors introduce an algorithm called VBSW to re-weight a training data set in order to improve generalization. In summary, VBSW sets the weight of each example to be the sample variance of the labels of its k nearest neighbors. The nearest neighbors are chosen in the embedding space from the second-to-last layer of a pre-trained neural network. The last layer of the pre-trained model is then trained with these new weights.
SP:ea4d4d3798119498a6df81a19dcab2ae4978996c
RMIX: Risk-Sensitive Multi-Agent Reinforcement Learning
1 INTRODUCTION . Reinforcement learning ( RL ) has made remarkable advances in many domains , including arcade video games ( Mnih et al. , 2015 ) , complex continuous robot control ( Lillicrap et al. , 2016 ) and the game of Go ( Silver et al. , 2017 ) . Recently , many researchers put their efforts to extend the RL methods into multi-agent systems ( MASs ) , such as urban systems ( Singh et al. , 2020 ) , coordination of robot swarms ( Hüttenrauch et al. , 2017 ) and real-time strategy ( RTS ) video games ( Vinyals et al. , 2019 ) . Centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Kraemer & Banerjee , 2016 ) has drawn enormous attention via training policies of each agent with access to global trajectories in a centralized way and executing actions given only the local observations of each agent in a decentralized way . Empowered by CTDE , several MARL methods , including valuebased and policy gradient-based , are proposed ( Foerster et al. , 2017a ; Sunehag et al. , 2017 ; Rashid et al. , 2018 ; Son et al. , 2019 ) . These MARL methods propose decomposition techniques to factorize the global Q value either by structural constraints or by estimating state-values or inter-agent weights to conduct the global Q value estimation . Among these methods , VDN ( Sunehag et al. , 2017 ) and QMIX ( Rashid et al. , 2018 ) are representative methods that use additivity and monotonicity structure constraints , respecitively . With relaxed structural constraints , QTRAN ( Son et al. , 2019 ) guarantees a more general factorization than VDN and QMIX . Some other methods include incorporating an estimation of advantage values ( Wang et al. , 2020a ) and proposing a multi-head attention method to represent the global values ( Yang et al. , 2020 ) . Despite the merits , most of these works focus on decomposing the global Q value into individual Q values with different constraints and network architectures , but ignore the fact that the expected , i.e. , risk-neutral , value decomposition is not sufficient even with CTDE due to the randomness of rewards and the uncertainty in environments , which causes the failure of these methods to train coordinating agents in complex environments . Specifically , these methods only learn the expected values over returns ( Rashid et al. , 2018 ) and do not handle the high variance caused by events with extremely high/low rewards to agents but small probabilities , which cause the inaccurate/insufficient estimations of the future returns . Therefore , instead of expected values , learning distributions of future returns , i.e. , Q values , is more useful for agents to make decisions . Recently , QR-MIX ( Hu et al. , 2020 ) decomposes the estimated joint return distribution ( Bellemare et al. , 2017 ; Dabney et al. , 2018a ) into individual Q values . However , the policies in QR-MIX are still based expected individual Q values . Even further , given that the environment is nonstationary from the perspective of each agent , each agent needs a more dynamic way to choose actions based on the return distributions , rather than simply taking the expected values . However , current MARL methods do not extensively investigate these aspects . Motivated by the previous reasons , we intend to extend the risk-sensitive1 RL ( Chow & Ghavamzadeh , 2014 ; Keramati et al. , 2020 ; Zhang et al. , 2020 ) to MARL settings , where risksensitive RL optimizes policies with a risk measure , such as variance , power formula measure value at risk ( VaR ) and conditional value at risk ( CVaR ) . Among these risk measures , CVaR has been gaining popularity due to both theoretical and computational advantages ( Rockafellar & Uryasev , 2002 ; Ruszczyński , 2010 ) . However , there are two main obstacles : i ) most of the previous works focus on risk-neutral or static risk level in single-agent settings , ignoring the randomness of reward and the temporal structure of agents ’ trajectories ( Dabney et al. , 2018a ; Tang et al. , 2019 ; Ma et al. , 2020 ; Keramati et al. , 2020 ) ; ii ) many methods use risk measures over Q values for policy execution without getting the risk measure values used in policy optimization in temporal difference ( TD ) learning , which causes the global value factorization on expected individual values to sub-optimal behaviours in MARL . We provide a detailed review of related works in Appendix A due to the limited space . In this paper , we propose RMIX , a novel cooperative MARL method with CVaR over the learned distributions of individuals ’ Q values . Specifically , our contributions are in three folds : ( i ) We first learn the return distributions of individuals by using Dirac Delta functions in order to analytically calculate CVaR for decentralized execution . The resulting CVaR values at each time step are used as policies for each agent via arg max operation ; ( ii ) We then propose a dynamic risk level predictor for CVaR calculation to handle the temporal nature of stochastic outcomes during executions . The dynamic risk level predictor measures the discrepancy between the embedding of current individual return distributions and the embedding of historical return distributions . The dynamic risk levels are agent-specific and observation-wise ; ( iii ) We finally propose risk-sensitive Bellman equation along with IGM for centralized training . The risk sensitive Bellman equation enables CVaR value update in a recursive form and can be trained with TD learning via a neural network . These also allow our method to achieve temporally extended exploration and enhanced temporal coordination , which are key to solving complex multi-agent tasks . Empirically , we show that RMIX significantly outperforms state-of-the-art methods on many challenging StarCraft IITM2 tasks , demonstrating enhanced coordination in many symmetric & asymmetric and homogeneous & heterogeneous scenarios and revealing high sample efficiency . To the best of our knowledge , our work is the first attempt to investigate cooperative MARL with risk-sensitive policies under the Dec-POMDP framework . 2 PRELIMINARIES . In this section , we provide the notation and the basic notions we will use in the following . We consider the probability space ( Ω , F , Pr ) , where Ω is the set of outcomes ( sample space ) , F is a σ-algebra over Ω representing the set of events , and Pr is the set of probability distributions . Given a set X , we denote with P ( X ) the set of all probability measures over X . DEC-POMDP A fully MARL problem can be described as a decentralised partially observable Markov decision process ( Dec-POMDP ) ( Oliehoek et al. , 2016 ) which can be formulated as a tuple M = 〈S , U , P , R , Υ , O , N , γ〉 , where s ∈ S denotes the true state of the environment . Each agent i ∈ N : = { 1 , ... , N } chooses an action ui ∈ U at each time step , giving rise to a joint action vector , u : = [ ui ] N i=1 ∈ UN . P ( s′|s , u ) : S × UN × S 7→ P ( S ) is a Markovian transition function and governs all state transition dynamics . Every agent shares the same joint reward function R ( s , u ) : S × UN 7→ R , and γ ∈ [ 0 , 1 ) is the discount factor . Due to partial observability , each agent has individual partial observation υ ∈ Υ , according to some observation functionO ( s , i ) : S×N 7→ Υ . 1 “ Risk ” refers to the uncertainty of future outcomes ( Dabney et al. , 2018a ) . 2StarCraft II is a trademark of Blizzard Entertainment , Inc. Each agent also has an action-observation history τi ∈ T : = ( Υ × U ) ∗ , on which it conditions its stochastic policy πi ( ui|τi ) : T × U 7→ [ 0 , 1 ] . CVaR CVaR is a coherent risk measure and enjoys computational properties ( Rockafellar & Uryasev , 2002 ) that are derived for loss distributions in discreet decision-making in finance . It gains popularity in various engineering and finance applications . CVaR ( as illustrated in Figure 1 ) is the expectation of values that are less equal than the α-percentile value of the distribution over returns . Formally , let X ∈ X be a bounded random variable with cumulative distribution function F ( x ) = P [ X ≤ x ] and the inverse CDF is F−1 ( u ) = inf { x : F ( x ) ≥ u } . The conditional value at risk ( CVaR ) at level α ∈ ( 0 , 1 ] of a random variable X is then defined as CVaRα ( X ) : = supν { ν − 1αE [ ( ν −X ) + ] } ( Rockafellar et al. , 2000 ) when X is a discrete random variable . Correspondingly , CVaRα ( X ) = EX∼F [ X|X ≤ F−1 ( α ) ] ( Acerbi & Tasche , 2002 ) when X has a continuous distribution . The α-percentile value is value at risk ( VaR ) . For ease of notation , we write CVaR as a function of the CDF F , CVaRα ( F ) . Risk-sensitive RL Risk-sensitive RL uses risk criteria over policy/value , which is a sub-field of the Safety RL ( García et al. , 2015 ) . Von Neumann & Morgenstern ( 1947 ) proposed the expected utility theory where a decision policy behaves as though it is maximizing the expected value of some utility functions . The theory is satisfied when the decision policy is a consistent and has a particular set of four axioms . This is the most pervasive notion of risk-sensitivity . A policy maximizing a linear utility function is called risk-neutral , whereas concave or convex utility functions give rise to riskaverse or risk-seeking policies , respectively . Many measures are used in RL such as CVaR ( Chow et al. , 2015 ; Dabney et al. , 2018a ) and power formula ( Dabney et al. , 2018a ) . However , few works have been done in MARL and it can not be easily extended . Our work fills this gap . CTDE CTDE has recently attracted attention from deep MARL to deal with nonstationarity while learning decentralized policies . One of the promising ways to exploit the CTDE paradigm is value function decomposition ( Sunehag et al. , 2017 ; Rashid et al. , 2018 ; Son et al. , 2019 ) which learns a decentralized utility function for each agent and uses a mixing network to combine these local Q values into a global action-value . It follows the IGM principle where the optimal joint actions across agents are equivalent to the collection of individual optimal actions of each agent ( Son et al. , 2019 ) . To achieve learning scalability , existing CTDE methods typically learn a shared local value or policy network for agents . 3 METHODOLOGY . In this section , we present our framework RMIX , as displayed in Figure 2 , where the agent network learns the return distribution of each agent , a risk operator network determines the risk level of each agent and the mixing network mixes the outputs of risk operators of agents to produce the global value . In the rest of this section , we first introduce the CVaR operator to analytically calculate the CVaR value with the modeled individual distribution of each agent in Section 3.1 and propose the dynamic risk level predictor to alleviate time-consistency issue in Section 3.2 . Then , we introduce the risk-sensitive Bellman equation for both centralized training and decentralized execution in Section 3.3 . Finally , we provide the details of centralized training of RMIX in Section 3.4 . All proofs are provided in Appendix B .
The authors propose RMIX to deal with the randomness of rewards and the uncertainty in environments. RMIX learns the individual value distributions of each agent and uses a predictor to calculate the dynamic risk level. Given the individual value distribution and the risk level, a CVaR operator outputs the C value for execution. For training, the $C$ values are mixed as $C^{tot}$ and updated by TD error end-to-end. RMIX outperforms a series of value decomposition baselines on many challenging StarCraft II tasks. The paper is very clear and well-structured. Expanding value decomposition methods to the risk-sensitive field is a novel idea, and it shows competitive performance in empirical studies.
SP:2dc6337218afc973db75d973d08c0cdd7e55698b
RMIX: Risk-Sensitive Multi-Agent Reinforcement Learning
1 INTRODUCTION . Reinforcement learning ( RL ) has made remarkable advances in many domains , including arcade video games ( Mnih et al. , 2015 ) , complex continuous robot control ( Lillicrap et al. , 2016 ) and the game of Go ( Silver et al. , 2017 ) . Recently , many researchers put their efforts to extend the RL methods into multi-agent systems ( MASs ) , such as urban systems ( Singh et al. , 2020 ) , coordination of robot swarms ( Hüttenrauch et al. , 2017 ) and real-time strategy ( RTS ) video games ( Vinyals et al. , 2019 ) . Centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Kraemer & Banerjee , 2016 ) has drawn enormous attention via training policies of each agent with access to global trajectories in a centralized way and executing actions given only the local observations of each agent in a decentralized way . Empowered by CTDE , several MARL methods , including valuebased and policy gradient-based , are proposed ( Foerster et al. , 2017a ; Sunehag et al. , 2017 ; Rashid et al. , 2018 ; Son et al. , 2019 ) . These MARL methods propose decomposition techniques to factorize the global Q value either by structural constraints or by estimating state-values or inter-agent weights to conduct the global Q value estimation . Among these methods , VDN ( Sunehag et al. , 2017 ) and QMIX ( Rashid et al. , 2018 ) are representative methods that use additivity and monotonicity structure constraints , respecitively . With relaxed structural constraints , QTRAN ( Son et al. , 2019 ) guarantees a more general factorization than VDN and QMIX . Some other methods include incorporating an estimation of advantage values ( Wang et al. , 2020a ) and proposing a multi-head attention method to represent the global values ( Yang et al. , 2020 ) . Despite the merits , most of these works focus on decomposing the global Q value into individual Q values with different constraints and network architectures , but ignore the fact that the expected , i.e. , risk-neutral , value decomposition is not sufficient even with CTDE due to the randomness of rewards and the uncertainty in environments , which causes the failure of these methods to train coordinating agents in complex environments . Specifically , these methods only learn the expected values over returns ( Rashid et al. , 2018 ) and do not handle the high variance caused by events with extremely high/low rewards to agents but small probabilities , which cause the inaccurate/insufficient estimations of the future returns . Therefore , instead of expected values , learning distributions of future returns , i.e. , Q values , is more useful for agents to make decisions . Recently , QR-MIX ( Hu et al. , 2020 ) decomposes the estimated joint return distribution ( Bellemare et al. , 2017 ; Dabney et al. , 2018a ) into individual Q values . However , the policies in QR-MIX are still based expected individual Q values . Even further , given that the environment is nonstationary from the perspective of each agent , each agent needs a more dynamic way to choose actions based on the return distributions , rather than simply taking the expected values . However , current MARL methods do not extensively investigate these aspects . Motivated by the previous reasons , we intend to extend the risk-sensitive1 RL ( Chow & Ghavamzadeh , 2014 ; Keramati et al. , 2020 ; Zhang et al. , 2020 ) to MARL settings , where risksensitive RL optimizes policies with a risk measure , such as variance , power formula measure value at risk ( VaR ) and conditional value at risk ( CVaR ) . Among these risk measures , CVaR has been gaining popularity due to both theoretical and computational advantages ( Rockafellar & Uryasev , 2002 ; Ruszczyński , 2010 ) . However , there are two main obstacles : i ) most of the previous works focus on risk-neutral or static risk level in single-agent settings , ignoring the randomness of reward and the temporal structure of agents ’ trajectories ( Dabney et al. , 2018a ; Tang et al. , 2019 ; Ma et al. , 2020 ; Keramati et al. , 2020 ) ; ii ) many methods use risk measures over Q values for policy execution without getting the risk measure values used in policy optimization in temporal difference ( TD ) learning , which causes the global value factorization on expected individual values to sub-optimal behaviours in MARL . We provide a detailed review of related works in Appendix A due to the limited space . In this paper , we propose RMIX , a novel cooperative MARL method with CVaR over the learned distributions of individuals ’ Q values . Specifically , our contributions are in three folds : ( i ) We first learn the return distributions of individuals by using Dirac Delta functions in order to analytically calculate CVaR for decentralized execution . The resulting CVaR values at each time step are used as policies for each agent via arg max operation ; ( ii ) We then propose a dynamic risk level predictor for CVaR calculation to handle the temporal nature of stochastic outcomes during executions . The dynamic risk level predictor measures the discrepancy between the embedding of current individual return distributions and the embedding of historical return distributions . The dynamic risk levels are agent-specific and observation-wise ; ( iii ) We finally propose risk-sensitive Bellman equation along with IGM for centralized training . The risk sensitive Bellman equation enables CVaR value update in a recursive form and can be trained with TD learning via a neural network . These also allow our method to achieve temporally extended exploration and enhanced temporal coordination , which are key to solving complex multi-agent tasks . Empirically , we show that RMIX significantly outperforms state-of-the-art methods on many challenging StarCraft IITM2 tasks , demonstrating enhanced coordination in many symmetric & asymmetric and homogeneous & heterogeneous scenarios and revealing high sample efficiency . To the best of our knowledge , our work is the first attempt to investigate cooperative MARL with risk-sensitive policies under the Dec-POMDP framework . 2 PRELIMINARIES . In this section , we provide the notation and the basic notions we will use in the following . We consider the probability space ( Ω , F , Pr ) , where Ω is the set of outcomes ( sample space ) , F is a σ-algebra over Ω representing the set of events , and Pr is the set of probability distributions . Given a set X , we denote with P ( X ) the set of all probability measures over X . DEC-POMDP A fully MARL problem can be described as a decentralised partially observable Markov decision process ( Dec-POMDP ) ( Oliehoek et al. , 2016 ) which can be formulated as a tuple M = 〈S , U , P , R , Υ , O , N , γ〉 , where s ∈ S denotes the true state of the environment . Each agent i ∈ N : = { 1 , ... , N } chooses an action ui ∈ U at each time step , giving rise to a joint action vector , u : = [ ui ] N i=1 ∈ UN . P ( s′|s , u ) : S × UN × S 7→ P ( S ) is a Markovian transition function and governs all state transition dynamics . Every agent shares the same joint reward function R ( s , u ) : S × UN 7→ R , and γ ∈ [ 0 , 1 ) is the discount factor . Due to partial observability , each agent has individual partial observation υ ∈ Υ , according to some observation functionO ( s , i ) : S×N 7→ Υ . 1 “ Risk ” refers to the uncertainty of future outcomes ( Dabney et al. , 2018a ) . 2StarCraft II is a trademark of Blizzard Entertainment , Inc. Each agent also has an action-observation history τi ∈ T : = ( Υ × U ) ∗ , on which it conditions its stochastic policy πi ( ui|τi ) : T × U 7→ [ 0 , 1 ] . CVaR CVaR is a coherent risk measure and enjoys computational properties ( Rockafellar & Uryasev , 2002 ) that are derived for loss distributions in discreet decision-making in finance . It gains popularity in various engineering and finance applications . CVaR ( as illustrated in Figure 1 ) is the expectation of values that are less equal than the α-percentile value of the distribution over returns . Formally , let X ∈ X be a bounded random variable with cumulative distribution function F ( x ) = P [ X ≤ x ] and the inverse CDF is F−1 ( u ) = inf { x : F ( x ) ≥ u } . The conditional value at risk ( CVaR ) at level α ∈ ( 0 , 1 ] of a random variable X is then defined as CVaRα ( X ) : = supν { ν − 1αE [ ( ν −X ) + ] } ( Rockafellar et al. , 2000 ) when X is a discrete random variable . Correspondingly , CVaRα ( X ) = EX∼F [ X|X ≤ F−1 ( α ) ] ( Acerbi & Tasche , 2002 ) when X has a continuous distribution . The α-percentile value is value at risk ( VaR ) . For ease of notation , we write CVaR as a function of the CDF F , CVaRα ( F ) . Risk-sensitive RL Risk-sensitive RL uses risk criteria over policy/value , which is a sub-field of the Safety RL ( García et al. , 2015 ) . Von Neumann & Morgenstern ( 1947 ) proposed the expected utility theory where a decision policy behaves as though it is maximizing the expected value of some utility functions . The theory is satisfied when the decision policy is a consistent and has a particular set of four axioms . This is the most pervasive notion of risk-sensitivity . A policy maximizing a linear utility function is called risk-neutral , whereas concave or convex utility functions give rise to riskaverse or risk-seeking policies , respectively . Many measures are used in RL such as CVaR ( Chow et al. , 2015 ; Dabney et al. , 2018a ) and power formula ( Dabney et al. , 2018a ) . However , few works have been done in MARL and it can not be easily extended . Our work fills this gap . CTDE CTDE has recently attracted attention from deep MARL to deal with nonstationarity while learning decentralized policies . One of the promising ways to exploit the CTDE paradigm is value function decomposition ( Sunehag et al. , 2017 ; Rashid et al. , 2018 ; Son et al. , 2019 ) which learns a decentralized utility function for each agent and uses a mixing network to combine these local Q values into a global action-value . It follows the IGM principle where the optimal joint actions across agents are equivalent to the collection of individual optimal actions of each agent ( Son et al. , 2019 ) . To achieve learning scalability , existing CTDE methods typically learn a shared local value or policy network for agents . 3 METHODOLOGY . In this section , we present our framework RMIX , as displayed in Figure 2 , where the agent network learns the return distribution of each agent , a risk operator network determines the risk level of each agent and the mixing network mixes the outputs of risk operators of agents to produce the global value . In the rest of this section , we first introduce the CVaR operator to analytically calculate the CVaR value with the modeled individual distribution of each agent in Section 3.1 and propose the dynamic risk level predictor to alleviate time-consistency issue in Section 3.2 . Then , we introduce the risk-sensitive Bellman equation for both centralized training and decentralized execution in Section 3.3 . Finally , we provide the details of centralized training of RMIX in Section 3.4 . All proofs are provided in Appendix B .
This paper proposes a new value-based method using risk measures in cooperative multi-agent reinforcement learning. The authors propose a new network structure that calculates global CVaR through individual distribution and learns risk-sensitized multi-agent policies. The authors also propose a new dynamic risk level prediction method that can dynamically adjust the risk level according to the agent’s observation and action. Applying risk-sensitive reinforcement learning in multi-agent reinforcement learning is interesting, but several points can be improved.
SP:2dc6337218afc973db75d973d08c0cdd7e55698b
Concept Learners for Few-Shot Learning
1 INTRODUCTION . Deep learning has reached human-level performance on domains with the abundance of large-scale labeled training data . However , learning on tasks with a small number of annotated examples is still an open challenge . Due to the lack of training data , models often overfit or are too simplistic to provide good generalization . On the contrary , humans can learn new tasks very quickly by drawing upon prior knowledge and experience . This ability to rapidly learn and adapt to new environments is a hallmark of human intelligence . Few-shot learning ( Miller et al. , 2000 ; Fei-Fei et al. , 2006 ; Koch et al. , 2015 ) aims at addressing this fundamental challenge by designing algorithms that are able to generalize to new tasks given only a few labeled training examples . Meta-learning ( Schmidhuber , 1987 ; Bengio et al. , 1992 ) has recently made major advances in the field by explicitly optimizing the model ’ s ability to generalize , or learning how to learn , from many related tasks ( Snell et al. , 2017 ; Vinyals et al. , 2016 ; Ravi & Larochelle , 2017 ; Finn et al. , 2017 ) . Motivated by the way humans effectively use prior knowledge , meta-learning algorithms acquire prior knowledge over previous tasks so that new tasks can be efficiently learned from a small amount of data . However , recent works ( Chen et al. , 2019b ; Raghu et al. , 2020 ) show that simple baseline methods perform comparably to existing meta-learning methods , opening the question about which components are crucial for rapid adaptation and generalization . Here , we argue that there is an important missing piece in this puzzle . Human knowledge is structured in the form of reusable concepts . For instance , when we learn to recognize new bird species we are already equipped with the critical concepts , such as wing , beak , and feather . We then focus on these specific concepts and combine them to identify a new species . While learning to recognize new species is challenging in the complex bird space , it becomes remarkably simpler once the reasoning is structured into familiar concepts . Moreover , such a structured way of cognition gives us the ability to provide reasoning behind our decisions , such as “ ravens have thicker beaks than crows , with more ∗The two first authors made equal contributions . of a curve to the end ” . We argue that this lack of structure is limiting the generalization ability of the current meta-learners . The importance of compositionality for few-shot learning was emphasized in ( Lake et al. , 2011 ; 2015 ) where hand-designed features of strokes were combined using Bayesian program learning . Motivated by the structured form of human cognition , we propose COMET , a meta-learning method that discovers generalizable representations along human-interpretable concept dimensions . COMET learns a unique metric space for each concept dimension using concept-specific embedding functions , named concept learners , that are parameterized by deep neural networks . Along each high-level dimension , COMET defines concept prototypes that reflect class-level differences in the metric space of the underlying concept . To obtain final predictions , COMET effectively aggregates information from diverse concept learners and concept prototypes . Three key aspects lead to a strong generalization ability of our approach : ( i ) semi-structured representation learning , ( ii ) concept-specific metric spaces described with concept prototypes , and ( iii ) ensembling of many models . The latter assures that the combination of diverse and accurate concept learners improves the generalization ability of the base learner ( Hansen & Salamon , 1990 ; Dvornik et al. , 2019 ) . Remarkably , the high-level universe of concepts that are used to guide our algorithm can be discovered in a fully unsupervised way , or we can use external knowledge bases to define concepts . In particular , we can get a large universe of noisy , incomplete and redundant concepts and COMET learns which subsets of those are important by assigning local and global concept importance scores . Unlike existing methods ( Snell et al. , 2017 ; Vinyals et al. , 2016 ; Sung et al. , 2018 ; Gidaris & Komodakis , 2018 ) , COMET ’ s predictions are interpretable—an advantage especially important in the few-shot learning setting , where predictions are based only on a handful of labeled examples making it hard to trust the model . As such , COMET is the first domain-agnostic interpretable meta-learning approach . We demonstrate the effectiveness of our approach on tasks from extremely diverse domains , including fine-grained image classification in computer vision , document classification in natural language processing , and cell type annotation in biology . In the biological domain , we conduct the first systematic comparison of meta-learning algorithms . We develop a new meta-learning dataset and define a novel benchmark task to characterize single-cell transcriptome of all mouse organs ( Consortium , 2018 ; 2020 ) . Additionally , we consider the scenario in which concepts are not given in advance , and test COMET ’ s performance with automatically extracted visual concepts . Our experimental results show that on all domains COMET significantly improves generalization ability , achieving 6–15 % relative improvement over state-of-the-art methods in the most challenging 1-shot task . Furthermore , we demonstrate the ability of COMET to provide interpretations behind the model ’ s predictions , and support our claim with quantitative and qualitative evaluations of the generated explanations . 2 PROPOSED METHOD . Problem formulation . In few-shot classification , we assume that we are given a labeled training set Dtr , an unlabeled query set Dqr , and a support set S consisting of a few labeled data points that share the label space with the query set . Label space between training and query set is disjoint , i.e. , { Ytr } ∩ { Yqr } = ∅ , where { Ytr } denotes label space of training set and { Yqr } denotes label space of query set . Each labeled data point ( x , y ) consists of a D-dimensional feature vector x ∈ RD and a class label y ∈ { 1 , ... , K } . Given a training set of previously labeled tasks Dtr and the support set S of a few labeled data points on a novel task , the goal is to train a model that can generalize to the novel task and label the query set Dqr . 2.1 PRELIMINARIES . Episodic training . To achieve successful generalization to a new task , training of meta-learning methods is usually performed using sampled mini-batches called episodes ( Vinyals et al. , 2016 ) . Each episode is formed by first sampling classes from the training set , and then sampling data points labeled with these classes . The sampled data points are divided into disjoint sets of : ( i ) a support set consisting of a few labeled data points , and ( ii ) a query set consisting of data points whose labels are used to calculate a prediction error . Given the sampled support set , the model minimizes the loss on the sampled query set in each episode . The key idea behind this meta-learning training scheme is to improve generalization of the model by trying to mimic the low-data regime encountered during testing . Episodes with balanced training sets are usually referred to as “ N-way , k-shot ” episodes where N indicates number of classes per episode ( “ way ” ) , and k indicates number of support points ( labeled training examples ) per class ( “ shot ” ) . Prototypical networks . Our work is inspired by prototypical networks ( Snell et al. , 2017 ) , a simple but highly effective metric-based meta-learning method . Prototypical networks learn a non-linear embedding function fθ : RD → RM parameterized by a convolutional neural network . The main idea is to learn a function fθ such that in the M -dimensional embedding space data points cluster around a single prototype representation pk ∈ RM for each class k. Class prototype pk is computed as the mean vector of the support set labeled with the class k : pk = 1 |Sk| ∑ ( xi , yi ) ∈Sk fθ ( xi ) , ( 1 ) where Sk denotes the subset of the support set S belonging to the class k. Given a query data point xq , prototypical networks output distribution over classes using the softmax function : pθ ( y = k|xq ) = exp ( −d ( fθ ( xq ) , pk ) ) ∑ k′ exp ( −d ( fθ ( xq ) , pk′ ) ) , ( 2 ) where d : RM → R denotes the distance function . Query data point xq is assigned to the class with the minimal distance between the class prototype and embedded query point . 2.2 META-LEARNING VIA CONCEPT LEARNERS . Our main assumption is that input dimensions can be separated into subsets of related dimensions corresponding to high-level , human-interpretable concepts that guide the training . Such sets of potentially overlapping , noisy and incomplete human-interpretable dimensions exists in many realworld scenarios . For instance , in computer vision concepts can be assigned to image segments ; in natural language processing to semantically related words ; whereas in biology we can use external knowledge bases and ontologies . In many problems , concepts are already available as a prior domain knowledge ( Ashburner et al. , 2000 ; Murzin et al. , 1995 ; Wah et al. , 2011 ; Mo et al. , 2019 ; Miller et al. , 2000 ) , or can be automatically generated using existing techniques ( Blei et al. , 2003 ; Zhang et al. , 2018 ; Jakab et al. , 2018 ) . Intuitively , concepts can be seen as part-based representations of the input and reflect the way humans reason about the world . Importantly , we do not assume these concepts are clean or complete . On the contrary , we show that even if there are thousands of concepts , which are noisy , incomplete , overlapping , or redundant , they still provide useful guidance to the meta-learning algorithm . Formally , let C = { c ( j ) } Nj=1 denote a set of N concepts given/extracted as a prior knowledge , where each concept c ( j ) ∈ { 0 , 1 } D is a binary vector such that c ( j ) i = 1 if i-th dimension should be used to describe the j-th concept and D denotes the dimensionality of the input . We do not impose any constraints on C , meaning that the concepts can be disjoint or overlap . Instead of learning single mapping function fθ : RD → RM across all dimensions , COMET separates original space into subspaces of predefined concepts and learns individual embedding functions f ( j ) θ : RD → RM for each concept j ( Figure 1 ) . Concept embedding functions f ( j ) θ , named concept learners , are non-linear functions parametrized by a deep neural network . Each concept learner j produces its own concept prototypes p ( j ) k for class k computed as the average of concept embeddings of data points in the support set : p ( j ) k = 1 |Sk| ∑ ( xi , yi ) ∈Sk f ( j ) θ ( xi ◦ c ( j ) ) , ( 3 ) where ◦ denotes Hadamard product . As a result , each class k is represented with a set of N concept prototypes { p ( j ) k } Nj=1 . Given a query data point xq , we compute its concept embeddings and estimate their distances to the concept prototypes of each class . We then aggregate the information across all concepts by taking sum over distances between concept embeddings and concept prototypes . Specifically , for each concept embedding f ( j ) θ ( xq ◦ c ( j ) ) we compute its distance to concept prototype p ( j ) k of a given class k , and sum distances across all concepts to obtain a distribution over support classes . The probability of assigning query point xq to k-th class is then given by : pθ ( y = k|xq ) = exp ( − ∑ j d ( f ( j ) θ ( xq ◦ c ( j ) ) , p ( j ) k ) ) ∑ k′ exp ( − ∑ j d ( f ( j ) θ ( xq ◦ c ( j ) ) , p ( j ) k′ ) ) . ( 4 ) The loss is computed as the negative log-likelihood Lθ = − log pθ ( y = k|xq ) of the true class , and COMET is trained by minimizing the loss on the query samples of training set in the episodic fashion ( Snell et al. , 2017 ; Vinyals et al. , 2016 ) . In equation ( 4 ) , we use euclidean distance as the distance function . Experimentally , we find that it outperforms cosine distance ( Appendix B ) , which agrees with the theory and experimental findings in ( Snell et al. , 2017 ) . We note that in order for distances to be comparable , it is crucial to normalize neural network layers using batch normalization ( Ioffe & Szegedy , 2015 ) .
The paper presents a knowledge-driven prototypical learning strategy for few-shot classification tasks. The main idea of this work is to introduce a set of concepts defined in the subspaces of inputs and represent each class as a group of concept prototypes for few-shot learning. Following the prototypical networks, the method first computes the concept embeddings of an input, and then takes the summation of the distances between those embeddings and their corresponding concept prototypes in each class to estimate the class probability. The experiments validates the proposed methods on 4 benchmarks in three different domains, including vision, language and biology. For the biology task, the authors also develop a new benchmark on cross-organ cell type classification.
SP:21f870f084d0b9b91f258cf893c66fd207570236
Concept Learners for Few-Shot Learning
1 INTRODUCTION . Deep learning has reached human-level performance on domains with the abundance of large-scale labeled training data . However , learning on tasks with a small number of annotated examples is still an open challenge . Due to the lack of training data , models often overfit or are too simplistic to provide good generalization . On the contrary , humans can learn new tasks very quickly by drawing upon prior knowledge and experience . This ability to rapidly learn and adapt to new environments is a hallmark of human intelligence . Few-shot learning ( Miller et al. , 2000 ; Fei-Fei et al. , 2006 ; Koch et al. , 2015 ) aims at addressing this fundamental challenge by designing algorithms that are able to generalize to new tasks given only a few labeled training examples . Meta-learning ( Schmidhuber , 1987 ; Bengio et al. , 1992 ) has recently made major advances in the field by explicitly optimizing the model ’ s ability to generalize , or learning how to learn , from many related tasks ( Snell et al. , 2017 ; Vinyals et al. , 2016 ; Ravi & Larochelle , 2017 ; Finn et al. , 2017 ) . Motivated by the way humans effectively use prior knowledge , meta-learning algorithms acquire prior knowledge over previous tasks so that new tasks can be efficiently learned from a small amount of data . However , recent works ( Chen et al. , 2019b ; Raghu et al. , 2020 ) show that simple baseline methods perform comparably to existing meta-learning methods , opening the question about which components are crucial for rapid adaptation and generalization . Here , we argue that there is an important missing piece in this puzzle . Human knowledge is structured in the form of reusable concepts . For instance , when we learn to recognize new bird species we are already equipped with the critical concepts , such as wing , beak , and feather . We then focus on these specific concepts and combine them to identify a new species . While learning to recognize new species is challenging in the complex bird space , it becomes remarkably simpler once the reasoning is structured into familiar concepts . Moreover , such a structured way of cognition gives us the ability to provide reasoning behind our decisions , such as “ ravens have thicker beaks than crows , with more ∗The two first authors made equal contributions . of a curve to the end ” . We argue that this lack of structure is limiting the generalization ability of the current meta-learners . The importance of compositionality for few-shot learning was emphasized in ( Lake et al. , 2011 ; 2015 ) where hand-designed features of strokes were combined using Bayesian program learning . Motivated by the structured form of human cognition , we propose COMET , a meta-learning method that discovers generalizable representations along human-interpretable concept dimensions . COMET learns a unique metric space for each concept dimension using concept-specific embedding functions , named concept learners , that are parameterized by deep neural networks . Along each high-level dimension , COMET defines concept prototypes that reflect class-level differences in the metric space of the underlying concept . To obtain final predictions , COMET effectively aggregates information from diverse concept learners and concept prototypes . Three key aspects lead to a strong generalization ability of our approach : ( i ) semi-structured representation learning , ( ii ) concept-specific metric spaces described with concept prototypes , and ( iii ) ensembling of many models . The latter assures that the combination of diverse and accurate concept learners improves the generalization ability of the base learner ( Hansen & Salamon , 1990 ; Dvornik et al. , 2019 ) . Remarkably , the high-level universe of concepts that are used to guide our algorithm can be discovered in a fully unsupervised way , or we can use external knowledge bases to define concepts . In particular , we can get a large universe of noisy , incomplete and redundant concepts and COMET learns which subsets of those are important by assigning local and global concept importance scores . Unlike existing methods ( Snell et al. , 2017 ; Vinyals et al. , 2016 ; Sung et al. , 2018 ; Gidaris & Komodakis , 2018 ) , COMET ’ s predictions are interpretable—an advantage especially important in the few-shot learning setting , where predictions are based only on a handful of labeled examples making it hard to trust the model . As such , COMET is the first domain-agnostic interpretable meta-learning approach . We demonstrate the effectiveness of our approach on tasks from extremely diverse domains , including fine-grained image classification in computer vision , document classification in natural language processing , and cell type annotation in biology . In the biological domain , we conduct the first systematic comparison of meta-learning algorithms . We develop a new meta-learning dataset and define a novel benchmark task to characterize single-cell transcriptome of all mouse organs ( Consortium , 2018 ; 2020 ) . Additionally , we consider the scenario in which concepts are not given in advance , and test COMET ’ s performance with automatically extracted visual concepts . Our experimental results show that on all domains COMET significantly improves generalization ability , achieving 6–15 % relative improvement over state-of-the-art methods in the most challenging 1-shot task . Furthermore , we demonstrate the ability of COMET to provide interpretations behind the model ’ s predictions , and support our claim with quantitative and qualitative evaluations of the generated explanations . 2 PROPOSED METHOD . Problem formulation . In few-shot classification , we assume that we are given a labeled training set Dtr , an unlabeled query set Dqr , and a support set S consisting of a few labeled data points that share the label space with the query set . Label space between training and query set is disjoint , i.e. , { Ytr } ∩ { Yqr } = ∅ , where { Ytr } denotes label space of training set and { Yqr } denotes label space of query set . Each labeled data point ( x , y ) consists of a D-dimensional feature vector x ∈ RD and a class label y ∈ { 1 , ... , K } . Given a training set of previously labeled tasks Dtr and the support set S of a few labeled data points on a novel task , the goal is to train a model that can generalize to the novel task and label the query set Dqr . 2.1 PRELIMINARIES . Episodic training . To achieve successful generalization to a new task , training of meta-learning methods is usually performed using sampled mini-batches called episodes ( Vinyals et al. , 2016 ) . Each episode is formed by first sampling classes from the training set , and then sampling data points labeled with these classes . The sampled data points are divided into disjoint sets of : ( i ) a support set consisting of a few labeled data points , and ( ii ) a query set consisting of data points whose labels are used to calculate a prediction error . Given the sampled support set , the model minimizes the loss on the sampled query set in each episode . The key idea behind this meta-learning training scheme is to improve generalization of the model by trying to mimic the low-data regime encountered during testing . Episodes with balanced training sets are usually referred to as “ N-way , k-shot ” episodes where N indicates number of classes per episode ( “ way ” ) , and k indicates number of support points ( labeled training examples ) per class ( “ shot ” ) . Prototypical networks . Our work is inspired by prototypical networks ( Snell et al. , 2017 ) , a simple but highly effective metric-based meta-learning method . Prototypical networks learn a non-linear embedding function fθ : RD → RM parameterized by a convolutional neural network . The main idea is to learn a function fθ such that in the M -dimensional embedding space data points cluster around a single prototype representation pk ∈ RM for each class k. Class prototype pk is computed as the mean vector of the support set labeled with the class k : pk = 1 |Sk| ∑ ( xi , yi ) ∈Sk fθ ( xi ) , ( 1 ) where Sk denotes the subset of the support set S belonging to the class k. Given a query data point xq , prototypical networks output distribution over classes using the softmax function : pθ ( y = k|xq ) = exp ( −d ( fθ ( xq ) , pk ) ) ∑ k′ exp ( −d ( fθ ( xq ) , pk′ ) ) , ( 2 ) where d : RM → R denotes the distance function . Query data point xq is assigned to the class with the minimal distance between the class prototype and embedded query point . 2.2 META-LEARNING VIA CONCEPT LEARNERS . Our main assumption is that input dimensions can be separated into subsets of related dimensions corresponding to high-level , human-interpretable concepts that guide the training . Such sets of potentially overlapping , noisy and incomplete human-interpretable dimensions exists in many realworld scenarios . For instance , in computer vision concepts can be assigned to image segments ; in natural language processing to semantically related words ; whereas in biology we can use external knowledge bases and ontologies . In many problems , concepts are already available as a prior domain knowledge ( Ashburner et al. , 2000 ; Murzin et al. , 1995 ; Wah et al. , 2011 ; Mo et al. , 2019 ; Miller et al. , 2000 ) , or can be automatically generated using existing techniques ( Blei et al. , 2003 ; Zhang et al. , 2018 ; Jakab et al. , 2018 ) . Intuitively , concepts can be seen as part-based representations of the input and reflect the way humans reason about the world . Importantly , we do not assume these concepts are clean or complete . On the contrary , we show that even if there are thousands of concepts , which are noisy , incomplete , overlapping , or redundant , they still provide useful guidance to the meta-learning algorithm . Formally , let C = { c ( j ) } Nj=1 denote a set of N concepts given/extracted as a prior knowledge , where each concept c ( j ) ∈ { 0 , 1 } D is a binary vector such that c ( j ) i = 1 if i-th dimension should be used to describe the j-th concept and D denotes the dimensionality of the input . We do not impose any constraints on C , meaning that the concepts can be disjoint or overlap . Instead of learning single mapping function fθ : RD → RM across all dimensions , COMET separates original space into subspaces of predefined concepts and learns individual embedding functions f ( j ) θ : RD → RM for each concept j ( Figure 1 ) . Concept embedding functions f ( j ) θ , named concept learners , are non-linear functions parametrized by a deep neural network . Each concept learner j produces its own concept prototypes p ( j ) k for class k computed as the average of concept embeddings of data points in the support set : p ( j ) k = 1 |Sk| ∑ ( xi , yi ) ∈Sk f ( j ) θ ( xi ◦ c ( j ) ) , ( 3 ) where ◦ denotes Hadamard product . As a result , each class k is represented with a set of N concept prototypes { p ( j ) k } Nj=1 . Given a query data point xq , we compute its concept embeddings and estimate their distances to the concept prototypes of each class . We then aggregate the information across all concepts by taking sum over distances between concept embeddings and concept prototypes . Specifically , for each concept embedding f ( j ) θ ( xq ◦ c ( j ) ) we compute its distance to concept prototype p ( j ) k of a given class k , and sum distances across all concepts to obtain a distribution over support classes . The probability of assigning query point xq to k-th class is then given by : pθ ( y = k|xq ) = exp ( − ∑ j d ( f ( j ) θ ( xq ◦ c ( j ) ) , p ( j ) k ) ) ∑ k′ exp ( − ∑ j d ( f ( j ) θ ( xq ◦ c ( j ) ) , p ( j ) k′ ) ) . ( 4 ) The loss is computed as the negative log-likelihood Lθ = − log pθ ( y = k|xq ) of the true class , and COMET is trained by minimizing the loss on the query samples of training set in the episodic fashion ( Snell et al. , 2017 ; Vinyals et al. , 2016 ) . In equation ( 4 ) , we use euclidean distance as the distance function . Experimentally , we find that it outperforms cosine distance ( Appendix B ) , which agrees with the theory and experimental findings in ( Snell et al. , 2017 ) . We note that in order for distances to be comparable , it is crucial to normalize neural network layers using batch normalization ( Ioffe & Szegedy , 2015 ) .
This paper introduces potential use of intermediate structured representation of input space called “concepts” which are most likely human-interpretable. This intermediate space is then used for few-shot learning instead of using only the input space. This leads to better classification performance on the task, and it shows that injecting human-interpretable structured representation into task correlates with better performance (as one would hope). The paper uses datasets from different domains and shows improvement over approaches that don’t use the above defined “concepts”.
SP:21f870f084d0b9b91f258cf893c66fd207570236
Universal Sentence Representations Learning with Conditional Masked Language Model
1 INTRODUCTION . Sentence embeddings map sentences into a vector space . The vectors capture rich semantic information that can be used to measure semantic textual similarity ( STS ) between sentences or train classifiers for a broad range of downstream tasks ( Conneau et al. , 2017 ; Subramanian et al. , 2018 ; Logeswaran & Lee , 2018b ; Cer et al. , 2018 ; Reimers & Gurevych , 2019 ; Yang et al. , 2019a ; d ; Giorgi et al. , 2020 ) . State-of-the-art models are usually trained on supervised tasks such as natural language inference ( Conneau et al. , 2017 ) , or with semi-structured data like question-answer pairs ( Cer et al. , 2018 ) and translation pairs ( Subramanian et al. , 2018 ; Yang et al. , 2019a ) . However , labeled and semi-structured data are difficult and expensive to obtain , making it hard to cover many domains and languages . Conversely , recent efforts to improve language models include the development of masked language model ( MLM ) pre-training from large scale unlabeled corpora ( Devlin et al. , 2019 ; Lan et al. , 2020 ; Liu et al. , 2019 ) . While internal MLM model representations are helpful when fine-tuning on downstream tasks , they do not directly produce good sentence representations , without further supervised ( Reimers & Gurevych , 2019 ) or semi-structured ( Feng et al. , 2020 ) finetuning . In this paper , we explore an unsupervised approach , called Conditional Masked Language Modeling ( CMLM ) , to effectively learn sentence representations from large scale unlabeled corpora . CMLM integrates sentence representation learning into MLM training by conditioning on sentence level representations produced by adjacent sentences . The model therefore needs to learn effective sentence representations in order to perform good MLM . Since CMLM is fully unsupervised , it can be easily extended to new languages . We explore CMLM for both English and multilingual sentence embeddings for 100+ languages . Our English CMLM model achieves state-of-the-art performance on SentEval ( Conneau & Kiela , 2018 ) , even outperforming models learned using ( semi- ) supervised signals . Moreover , models training on the English Amazon review data using our multilingual vectors exhibit strong multilingual transfer performance on translations of the Amazon review evaluation data to French , German and Japanese , outperforming existing multilingual sentence embedding models by > 5 % for non-English languages and by > 2 % on the original English data . We further extend the multilingual CMLM to co-training with parallel text ( bitext ) retrieval task , and finetuning with cross-lingual natural language inference ( NLI ) data , inspired by the success of prior work on multitask sentence representation learning ( Subramanian et al. , 2018 ; Yang et al. , 2019a ) and NLI learning ( Conneau et al. , 2017 ; Reimers & Gurevych , 2019 ) . We achieve performance 1.4 % better than the previous state-of-the-art multilingual sentence representation model ( see details in section 4.2 ) . Language agnostic representations require semantically similar cross-lingual pairs to be closer in representation space than unrelated same-language pairs ( Roy et al. , 2020 ) . While we find our original sentence embeddings do have a bias for same language sentences , we discover that removing the first few principal components of the embeddings eliminates the self language bias . The rest of the paper is organized as follows . Section 2 describes the architecture for CMLM unsupervised learning . In Section 3 we present CMLM trained on English data and evaluation results on SentEval . In Section 3 we apply CMLM to learn sentence multilingual sentence representations . Multitask training strategies on how to effectively combining CMLM , bitext retrieval and cross lingual NLI finetuning are explored . In Section 5 , we investigate self language bias in multilingual representations and how to eliminate it . The contributions of this paper can be summarized as follows : ( 1 ) A novel pre-training technique CMLM for unsupervised sentence representation learning on unlabeled corpora ( either in monolingual and multilingual ) . ( 2 ) An effective multitask training framework , which combines unsupervised learning task CMLM with supervised learning Bitext Retrieval and cross-lingual NLI finetuning . ( 3 ) An evaluation benchmark for multilingual sentence representations . ( 4 ) A simple and effective algebraic method to remove same language bias in multilingual representations . 2 CONDITIONAL MASKED LANGUAGE MODELING . We introduce Conditional Masked Language Modeling ( CMLM ) as a novel architecture for combining next sentence prediction with MLM training . By “ conditional , ” we mean the MLM task for one sentence depends on the encoded sentence level representation of the adjacent sentence . This builds on prior work on next sentence prediction that has been widely used for learning sentence level representations ( Kiros et al. , 2015 ; Logeswaran & Lee , 2018b ; Cer et al. , 2018 ; Yang et al. , 2019a ) , but has thus far produced poor quality sentence embeddings within BERT based models ( Reimers & Gurevych , 2019 ) . While existing MLMs like BERT include next sentence prediction tasks , they do so without any inductive bias to try to encode the meaning of a sentence within a single embedding vector . We introduce a strong inductive bias for learning sentence embeddings by structuring the task as follows . Given a pair of ordered sentences , the first sentence is fed to an encoder that produces a sentence level embedding . The embedding is then provided to an encoder that conditions on the sentence embedding in order to better perform MLM prediction over the second sentence . This is notably similar to Skip-Thought ( Kiros et al. , 2015 ) , but replaces the generation of the complete second sentence with the MLM denoising objective . It is also similar to T5 ’ s MLM inspired unsupervised encode-decoder objective ( Raffel et al. , 2019 ) , with the second encoder acting as a sort of decoder given the representation produced for the first sentence . Our method critically differs from T5 ’ s in that a sentence embedding bottleneck is used to pass information between two model components and in that the task involves denoising a second sentence when conditioning on the first rather than denoising a single text stream . Fig . 1 illustrates the architecture of our model . The first sentence s1 is tokenized and input to a transformer encoder and a sentence vector v 2 Rd is computed from the sequence outputs by average pooling.1 The sentence vector v is then projected into N spaces with one of the projections being the identity mapping , i.e . vp = P ( v ) 2 Rd⇥N . Here we use a three-layer MLP as the projection P ( · ) . The second sentence s2 is then masked following the procedure described in the original BERT paper , including random replacement and the use of unchanged tokens . The second encoder shares the same weights with the encoder used to embed s1 2 . Tokens in the masked s2 are converted into word vectors and concatenated with vp . The concatenated representations are provided to the transformer encoder to predict the masked tokens in s2 . At inference time , we keep the first encoding module and discard the subsequent MLM prediction . In Section 5.2 , we explore various different configurations of CMLM , including the number of projection spaces , and how the projected vectors are connected to the embeddings of the second sentence . 3 LEARNING ENGLISH SENTENCE REPRESENTATIONS WITH CMLM . For training English sentence encoders with CMLM , we use three Common Crawl dumps . The data are filtered by a classifier which detects whether a sentence belongs to the main content of the web page or not . We use WordPiece tokenization and the vocabulary is the same as public English uncased BERT . In order to enable the model to learn bidirectional information , for two consecutive sequences s1 and s2 , we swap their order for 50 % of the time . This order-swapping process echos with the preceding and succeeding sentences prediction in Skip-Thought ( Kiros et al. , 2015 ) . The length of s1 and s2 are set to be 256 tokens ( the maximum length ) . The number of masked tokens in s2 are 80 ( 31.3 % ) , moderately higher than classical BERT . This change in the ratio of masked tokens is to make the task more challenging , due to the fact that in CMLM , language modeling has access to extra information from adjacent sentences . We train with batch size of 2048 for 1 million steps . The optimizer is LAMB with learning rate of 10 3 , 1 = 0.9 , 2 = 0.999 , warm-up in the first 10,000 steps and linear decay afterwards . We explore two transformer configurations , base and large , same as in the original BERT paper . The number of projections N is 15 by experimenting with multiple choices . 3.1 EVALUATION . We evaluate the sentence representations on the following tasks : ( 1 ) classification : MR ( movie reviews Pang & Lee ( 2005 ) ) , binary SST ( sentiment analysis , Socher et al . ( 2013 ) ) , TREC ( question-type , Voorhees & Tice ( 2000 ) ) , CR ( product reviews , Hu & Liu ( 2004 ) ) , SUBJ ( subjectivity/objectivity , Pang & Lee ( 2004 ) ) . ( 2 ) Entailment : SNLI ( Bowman et al. , 2015 ) and SICK dataset for entailment ( SICK-E , Marelli et al . ( 2014 ) ) . The evaluation is done using SentEval ( Conneau & Kiela , 2018 ) which is a prevailing evaluation toolkit for sentence embeddings . The classifier for the downstream is logistic regression . For each task , the encoder and embeddings are fixed and only downstream neural structures are trained . The baseline sentence embedding models include SkipThought ( Kiros et al. , 2015 ) , InferSent ( Conneau et al. , 2017 ) , USE ( Cer et al. , 2018 ) , QuickThought ( Logeswaran & Lee , 2018a ) and English BERT using standard pre-trained models from TensorFlow Hub website ( Devlin et al . ( 2019 ) , and SBert ( Reimers & Gurevych , 2019 ) . To evaluate the possible improvements coming from training data and processes , we train standard BERT models ( English BERT base/large ( CC ) ) on the same Common Crawl Corpora that CMLM is trained on . Similarly , we also train QuickThought , a competitive unsupervised sentence representations learning model , on the same Common Crawl Corpora ( denoted as “ QuickThought ( CC ) ” ) . To further address the possible advantage from using Transformer encoder , we use a Transformer encoder as the sentence encoder in QuickThought ( CC ) . The representations for BERT are computed by averaging pooling of the sequence outputs 1One can equivalently choose other pooling methods , such as max pooling or use the vector output corresponding to a special token position such as the [ CLS ] token . 2The dual-encoder sharing encoder weights for different inputs can be also referred as “ siamese encoder ” ( we also explore options including [ CLS ] vector and max pooling and the results are available in the appendix ) . 3.2 RESULTS . Evaluation results are presented in Table 1 . CMLM outperforms existing models overall , besting MLM ( both English BERT and English BERT ( CC ) ) using both base and large configurations . The closest competing model is SBERT , which uses supervised NLI data rather than a purely unsupervised approach . Interestingly , CMLM outperforms SBERT on the SICK-E NLI task .
This paper presents Conditional Masked Language Modeling (CMLM), which integrates sentence representation learning into MLM training by conditioning on the encoded vectors of adjacent sentences. It is shown that the English CMLM model achieves strong performance on SentEval, and outperforms models learned using (semi-)supervised signals. It is also found that a multilingual CMLM model co-trained with bitext retrieval (BR) and natural language inference (NLI) tasks outperforms the previous state-of-the-art multilingual models by a large margin. The paper further proposes a principle component based approach to remove the language identifying information from the representation while still retaining sentence semantics.
SP:9395fc883c2947587ff26fd36ce0fc797d062f3e
Universal Sentence Representations Learning with Conditional Masked Language Model
1 INTRODUCTION . Sentence embeddings map sentences into a vector space . The vectors capture rich semantic information that can be used to measure semantic textual similarity ( STS ) between sentences or train classifiers for a broad range of downstream tasks ( Conneau et al. , 2017 ; Subramanian et al. , 2018 ; Logeswaran & Lee , 2018b ; Cer et al. , 2018 ; Reimers & Gurevych , 2019 ; Yang et al. , 2019a ; d ; Giorgi et al. , 2020 ) . State-of-the-art models are usually trained on supervised tasks such as natural language inference ( Conneau et al. , 2017 ) , or with semi-structured data like question-answer pairs ( Cer et al. , 2018 ) and translation pairs ( Subramanian et al. , 2018 ; Yang et al. , 2019a ) . However , labeled and semi-structured data are difficult and expensive to obtain , making it hard to cover many domains and languages . Conversely , recent efforts to improve language models include the development of masked language model ( MLM ) pre-training from large scale unlabeled corpora ( Devlin et al. , 2019 ; Lan et al. , 2020 ; Liu et al. , 2019 ) . While internal MLM model representations are helpful when fine-tuning on downstream tasks , they do not directly produce good sentence representations , without further supervised ( Reimers & Gurevych , 2019 ) or semi-structured ( Feng et al. , 2020 ) finetuning . In this paper , we explore an unsupervised approach , called Conditional Masked Language Modeling ( CMLM ) , to effectively learn sentence representations from large scale unlabeled corpora . CMLM integrates sentence representation learning into MLM training by conditioning on sentence level representations produced by adjacent sentences . The model therefore needs to learn effective sentence representations in order to perform good MLM . Since CMLM is fully unsupervised , it can be easily extended to new languages . We explore CMLM for both English and multilingual sentence embeddings for 100+ languages . Our English CMLM model achieves state-of-the-art performance on SentEval ( Conneau & Kiela , 2018 ) , even outperforming models learned using ( semi- ) supervised signals . Moreover , models training on the English Amazon review data using our multilingual vectors exhibit strong multilingual transfer performance on translations of the Amazon review evaluation data to French , German and Japanese , outperforming existing multilingual sentence embedding models by > 5 % for non-English languages and by > 2 % on the original English data . We further extend the multilingual CMLM to co-training with parallel text ( bitext ) retrieval task , and finetuning with cross-lingual natural language inference ( NLI ) data , inspired by the success of prior work on multitask sentence representation learning ( Subramanian et al. , 2018 ; Yang et al. , 2019a ) and NLI learning ( Conneau et al. , 2017 ; Reimers & Gurevych , 2019 ) . We achieve performance 1.4 % better than the previous state-of-the-art multilingual sentence representation model ( see details in section 4.2 ) . Language agnostic representations require semantically similar cross-lingual pairs to be closer in representation space than unrelated same-language pairs ( Roy et al. , 2020 ) . While we find our original sentence embeddings do have a bias for same language sentences , we discover that removing the first few principal components of the embeddings eliminates the self language bias . The rest of the paper is organized as follows . Section 2 describes the architecture for CMLM unsupervised learning . In Section 3 we present CMLM trained on English data and evaluation results on SentEval . In Section 3 we apply CMLM to learn sentence multilingual sentence representations . Multitask training strategies on how to effectively combining CMLM , bitext retrieval and cross lingual NLI finetuning are explored . In Section 5 , we investigate self language bias in multilingual representations and how to eliminate it . The contributions of this paper can be summarized as follows : ( 1 ) A novel pre-training technique CMLM for unsupervised sentence representation learning on unlabeled corpora ( either in monolingual and multilingual ) . ( 2 ) An effective multitask training framework , which combines unsupervised learning task CMLM with supervised learning Bitext Retrieval and cross-lingual NLI finetuning . ( 3 ) An evaluation benchmark for multilingual sentence representations . ( 4 ) A simple and effective algebraic method to remove same language bias in multilingual representations . 2 CONDITIONAL MASKED LANGUAGE MODELING . We introduce Conditional Masked Language Modeling ( CMLM ) as a novel architecture for combining next sentence prediction with MLM training . By “ conditional , ” we mean the MLM task for one sentence depends on the encoded sentence level representation of the adjacent sentence . This builds on prior work on next sentence prediction that has been widely used for learning sentence level representations ( Kiros et al. , 2015 ; Logeswaran & Lee , 2018b ; Cer et al. , 2018 ; Yang et al. , 2019a ) , but has thus far produced poor quality sentence embeddings within BERT based models ( Reimers & Gurevych , 2019 ) . While existing MLMs like BERT include next sentence prediction tasks , they do so without any inductive bias to try to encode the meaning of a sentence within a single embedding vector . We introduce a strong inductive bias for learning sentence embeddings by structuring the task as follows . Given a pair of ordered sentences , the first sentence is fed to an encoder that produces a sentence level embedding . The embedding is then provided to an encoder that conditions on the sentence embedding in order to better perform MLM prediction over the second sentence . This is notably similar to Skip-Thought ( Kiros et al. , 2015 ) , but replaces the generation of the complete second sentence with the MLM denoising objective . It is also similar to T5 ’ s MLM inspired unsupervised encode-decoder objective ( Raffel et al. , 2019 ) , with the second encoder acting as a sort of decoder given the representation produced for the first sentence . Our method critically differs from T5 ’ s in that a sentence embedding bottleneck is used to pass information between two model components and in that the task involves denoising a second sentence when conditioning on the first rather than denoising a single text stream . Fig . 1 illustrates the architecture of our model . The first sentence s1 is tokenized and input to a transformer encoder and a sentence vector v 2 Rd is computed from the sequence outputs by average pooling.1 The sentence vector v is then projected into N spaces with one of the projections being the identity mapping , i.e . vp = P ( v ) 2 Rd⇥N . Here we use a three-layer MLP as the projection P ( · ) . The second sentence s2 is then masked following the procedure described in the original BERT paper , including random replacement and the use of unchanged tokens . The second encoder shares the same weights with the encoder used to embed s1 2 . Tokens in the masked s2 are converted into word vectors and concatenated with vp . The concatenated representations are provided to the transformer encoder to predict the masked tokens in s2 . At inference time , we keep the first encoding module and discard the subsequent MLM prediction . In Section 5.2 , we explore various different configurations of CMLM , including the number of projection spaces , and how the projected vectors are connected to the embeddings of the second sentence . 3 LEARNING ENGLISH SENTENCE REPRESENTATIONS WITH CMLM . For training English sentence encoders with CMLM , we use three Common Crawl dumps . The data are filtered by a classifier which detects whether a sentence belongs to the main content of the web page or not . We use WordPiece tokenization and the vocabulary is the same as public English uncased BERT . In order to enable the model to learn bidirectional information , for two consecutive sequences s1 and s2 , we swap their order for 50 % of the time . This order-swapping process echos with the preceding and succeeding sentences prediction in Skip-Thought ( Kiros et al. , 2015 ) . The length of s1 and s2 are set to be 256 tokens ( the maximum length ) . The number of masked tokens in s2 are 80 ( 31.3 % ) , moderately higher than classical BERT . This change in the ratio of masked tokens is to make the task more challenging , due to the fact that in CMLM , language modeling has access to extra information from adjacent sentences . We train with batch size of 2048 for 1 million steps . The optimizer is LAMB with learning rate of 10 3 , 1 = 0.9 , 2 = 0.999 , warm-up in the first 10,000 steps and linear decay afterwards . We explore two transformer configurations , base and large , same as in the original BERT paper . The number of projections N is 15 by experimenting with multiple choices . 3.1 EVALUATION . We evaluate the sentence representations on the following tasks : ( 1 ) classification : MR ( movie reviews Pang & Lee ( 2005 ) ) , binary SST ( sentiment analysis , Socher et al . ( 2013 ) ) , TREC ( question-type , Voorhees & Tice ( 2000 ) ) , CR ( product reviews , Hu & Liu ( 2004 ) ) , SUBJ ( subjectivity/objectivity , Pang & Lee ( 2004 ) ) . ( 2 ) Entailment : SNLI ( Bowman et al. , 2015 ) and SICK dataset for entailment ( SICK-E , Marelli et al . ( 2014 ) ) . The evaluation is done using SentEval ( Conneau & Kiela , 2018 ) which is a prevailing evaluation toolkit for sentence embeddings . The classifier for the downstream is logistic regression . For each task , the encoder and embeddings are fixed and only downstream neural structures are trained . The baseline sentence embedding models include SkipThought ( Kiros et al. , 2015 ) , InferSent ( Conneau et al. , 2017 ) , USE ( Cer et al. , 2018 ) , QuickThought ( Logeswaran & Lee , 2018a ) and English BERT using standard pre-trained models from TensorFlow Hub website ( Devlin et al . ( 2019 ) , and SBert ( Reimers & Gurevych , 2019 ) . To evaluate the possible improvements coming from training data and processes , we train standard BERT models ( English BERT base/large ( CC ) ) on the same Common Crawl Corpora that CMLM is trained on . Similarly , we also train QuickThought , a competitive unsupervised sentence representations learning model , on the same Common Crawl Corpora ( denoted as “ QuickThought ( CC ) ” ) . To further address the possible advantage from using Transformer encoder , we use a Transformer encoder as the sentence encoder in QuickThought ( CC ) . The representations for BERT are computed by averaging pooling of the sequence outputs 1One can equivalently choose other pooling methods , such as max pooling or use the vector output corresponding to a special token position such as the [ CLS ] token . 2The dual-encoder sharing encoder weights for different inputs can be also referred as “ siamese encoder ” ( we also explore options including [ CLS ] vector and max pooling and the results are available in the appendix ) . 3.2 RESULTS . Evaluation results are presented in Table 1 . CMLM outperforms existing models overall , besting MLM ( both English BERT and English BERT ( CC ) ) using both base and large configurations . The closest competing model is SBERT , which uses supervised NLI data rather than a purely unsupervised approach . Interestingly , CMLM outperforms SBERT on the SICK-E NLI task .
The authors present conditional masked language modeling (CMLM), a new method for unsupervised pretraining, in which the skip-thought notion of conditioning on neighboring sentences is adopted for masked language modeling. The upshot of the proposed approach is that it generates single sentence embeddings that perform competitively on SentEval. In the multilingual setting, the authors combine their CMLM method with a bitext retrieval objective (selecting a sentence’s translation from the other sentences of the language in the batch) that increases performance on a version of the SentEval tasks translated into 14 other languages. In their analysis, the authors make further claims about multilingual embeddings capturing language ID information in their first principle components, a conclusion somewhat substantiated by their results. The authors provide a small amount of ablation experiments for experimental/model design choices.
SP:9395fc883c2947587ff26fd36ce0fc797d062f3e
Measuring and Harnessing Transference in Multi-Task Learning
1 INTRODUCTION . Deciding if two or more objectives should be trained together in a multi-task model , as well as choosing how that model ’ s parameters should be shared , is an inherently complex issue often left to human experts ( Zhang & Yang , 2017 ) . However , a human ’ s understanding of similarity is motivated by their intuition and experience rather than a prescient knowledge of the underlying structures learned by a neural network . To further complicate matters , the benefit or detriment induced from co-training relies on many non-trivial decisions including , but not limited to , dataset characteristics , model architecture , hyperparameters , capacity , and convergence ( Wu et al. , 2020 ; Vandenhende et al. , 2019 ; Standley et al. , 2019 ; Sun et al. , 2019 ) . As a result , a quantifiable measure which conveys the effect of information transfer in a neural network would be valuable to practitioners and researchers alike to better construct or understand multi-task learning paradigms ( Baxter , 2000 ; Ben-David & Schuller , 2003 ) . The training dynamics specific to multitask neural networks , namely cross-task interactions at the shared parameters ( Zhao et al. , 2018 ) , are difficult to predict and only fully manifest at the completion of training . Given the cost , both with regards to time and resources , of fully training a deep neural network , an exhaustive search over the 2m−1 possible combinations ofm tasks to determine ideal task groupings can be infeasible . This search is only complicated by the irreproducibility inherent in traversing a loss landscape with high curvature ; an effect which appears especially pronounced in multi-task learning paradigms ( Yu et al. , 2020 ; Standley et al. , 2019 ) . In this paper , we aim to take a step towards quantifying transference , or the dynamics of information transfer , and understanding its effect on multi-task training efficiency . As both the input data and state of model convergence are fundamental to transference ( Wu et al. , 2020 ) , we develop a parameter-free approach to measure this effect at a per-minibatch level of granularity . Moreover , our quantity makes no assumptions regarding model architecture , and is applicable to any paradigm in which shared parameters are updated with respect to multiple task losses . By analyzing multi-task training dynamics through the lens of transference , we present the following observations . First , information transfer is highly dependent on model convergence and varies significantly throughout training . Second , and perhaps surprisingly , excluding certain task gradients from the multi-task gradient update for select minibatches can improve learning efficiency . Our Under review as a conference paper at ICLR 2021 Transference in CelebA Transference in MetaWorld A0 A8 A7 A6 A5 A4 A3 A2 A1 -0.4 -0.3 -0.2 -0.1 1.0 Transference in CelebA Gradient Update A0 A1 A2 A3 A4 A5 A6 A7 A8 ( a ) reach push press button top open window close window -0.8 -0.6 -0.4 -0.2 1.0 Transference in MetaWorld Gradient Update close window open window press button top push reach ( b ) Figure 1 : Transference in ( a ) CelebA for a subset of 9 attributes ; ( b ) Meta-World for “ push ” , “ reach ” , “ press button top ” , and “ open window ” . To determine task groupings , we compute the transference of each task i on all other tasks j , i.e . Zt { i } →j and average over time . For the purpose of illustration , we normalize the transference along each axis . Notice the majority of the tasks in ( a ) concentrate around a single value for each attribute . Tasks which exhibit transference above this value are considered to have relatively high transference . For instance , A3 exhibits higher-than-average transference on A0 , A4 , and A5 . A similar effect is observed in ( b ) , with “ close window ” manifesting high transference on “ push ” and “ reach ” . analysis suggests this is due to large variation in loss landscapes for different tasks as illustrated in Figure 4 . Building on these observations , we propose two methods to utilize transference in multitask learning algorithms – to choose which tasks to train together as well as determining which gradients to apply at each minibatch . Our experiments indicate the former can identify promising task groupings , while the latter can improve learning performance over prior methods . In summary , our main contributions are three-fold : we ( 1 ) propose the first measure ( to our knowledge ) which quantifies information transfer among tasks in multi-task learning ; ( 2 ) demonstrate how transference can be used as a heuristic to select task groupings ; ( 3 ) present a method which leverages minibatch-level transference to augment network performance . 2 RELATED WORK . Multi-Task Formulation . The most prevalent formulation of MTL is hard parameter sharing of hidden layers ( Ruder , 2017 ; Caruana , 1993 ) . In this design , a subset of the hidden layers are typically shared among all tasks , and task-specific layers are stacked on top of the shared base to output a prediction value . Each task is assigned a weight , and the loss of the entire model is a linear combination of each task ’ s loss multiplied by its respective loss weight . This particular design enables parameter efficiency by sharing hidden layers across tasks , reduces overfitting , and can facilitate transfer learning effects among tasks ( Ruder , 2017 ; Baxter , 2000 ; Zhang & Yang , 2017 ) . Information Sharing . Prevailing wisdom suggests tasks which are similar or share a similar underlying structure may benefit from co-training in a multi-task system ( Caruana , 1993 ; 1997 ) . A plethora of multi-task methods addressing what to share have been developed , such as Neural Architecture Search ( Guo et al. , 2020 ; Sun et al. , 2019 ; Vandenhende et al. , 2019 ; Rusu et al. , 2016 ; Huang et al. , 2018 ; Lu et al. , 2017 ) and Soft-Parameter Sharing ( Misra et al. , 2016 ; Duong et al. , 2015 ; Yang & Hospedales , 2016 ) , to improve multi-task performance . Though our measure of transference is complementary with these methods , we direct our focus towards which tasks should be trained together rather than architecture modifications to maximize the benefits of co-training . While deciding which tasks to train together has traditionally been addressed with costly crossvalidation techniques or high variance human intuition , recent advances have developed increasingly efficient algorithms to assess co-training performance . Swirszcz & Lozano ( 2012 ) and Bingel & Søgaard ( 2017 ) approximate multi-task performance by analyzing single-task learning characteristics . An altogether different approach may leverage recent advances in transfer learning focused on understanding task relationships ( Zamir et al. , 2018 ; Achille et al. , 2019b ; Dwivedi & Roig , 2019 ; Zhuang et al. , 2020 ; Achille et al. , 2019a ) ; however , Standley et al . ( 2019 ) show transfer learning algorithms which determine task similarity do not carry over to the multi-task learning domain and instead propose a multi-task specific framework . Training Dynamics . Significant effort has also been invested to improve the training dynamics of MTL systems . In particular , dynamic loss reweighing has achieved performance superior to using fixed loss weights found with extensive hyperparameter search ( Kendall et al. , 2018 ; Guo et al. , 2018 ; Liu et al. , 2019 ; Chen et al. , 2017 ; Sener & Koltun , 2018 ; Lin et al. , 2019 ) . Another set of methods seeks to mitigate the optimization challenges in multi-task learning by manipulating the task gradients in a number of ways such as ( 1 ) modifying the direction of task gradients with the underlying assumption that directional inconsistency of gradients on the shared parameters are detrimental to model convergence and performance ( Zhao et al. , 2018 ; Suteu & Guo , 2019 ) , and ( 2 ) altering both the direction and the magnitude of the task gradients ( Yu et al. , 2020 ; Chen et al. , 2020 ; Wang et al. , 2020b ) . Instead of directly modifying the task gradients during optimization , our work builds upon these approaches by quantifying how a gradient update to the shared parameters would affect training loss and choosing the combination of gradients which maximizes positive information transfer . Looking into the Future . Looking at what could happen to determine what should happen has been used extensively in both the meta-learning ( Finn et al. , 2017 ; Nichol et al. , 2018 ; Brinkmeyer et al. , 2019 ; Grant et al. , 2018 ; Kim et al. , 2018 ) as well as optimization domains ( Nesterov , 1983 ; Hinton & Plaut , 1987 ; Zhang et al. , 2019 ; Izmailov et al. , 2018 ; Johnson & Zhang , 2013 ) . Lookahead metalearning algorithms focusing on validation loss have also been used to improve generalization in multi-task learning systems ( Wang et al. , 2020a ) , and our work further adapts this central concept to multi-task learning to both quantify and improve information transfer . 3 TRANSFERENCE IN MULTI-TASK LEARNING . Within the context of a hard-parameter sharing paradigm , tasks collaborate to build a shared feature representation which is then specialized by individual task-specific heads to output a prediction . Accordingly , tasks implicitly transfer information to each other by updating this shared feature representation with successive gradient updates . We can then view transference , or information transfer in multi-task learning , as the effect of a task ’ s gradient update to the shared parameters on another task ’ s loss during training . While the the shared parameter update using a task ’ s gradient , often but not always , increases the losses of the other tasks in the network , we find the extent to which these losses change to be highly task specific . This indicates certain tasks interact more constructively than others . Further , we notice this effect to be reproducible and nearly unchanged across successive training runs with varying parameter initializations . Motivated by these observations , we derive a quantitative measure of transference , describe how it can be used to determine which tasks should be trained together , and provide empirical analysis of these claims . Later , we will build upon these ideas to derive a new multi-task learning algorithm . 3.1 MEASURING TRANSFERENCE . Consider an m-multitask loss function parameterized by { θs } ∪ { θi| i ∈ [ m ] } where θs represents the shared parameters and θi represents the task i ∈ [ m ] specific parameters . Let Ltotal ( X , θs , { θi } ) = ∑ i∈ [ m ] Li ( X , θs , θi ) , denote the total loss where Li represents the non-negative loss of task i . For simplicity of notation , we set the loss weight of each task to be equal to 1 , though our construction generalizes to arbitrary weightings . For a given training batch X t at time-step t , we can first update the task specific parameters { θt+1i } using standard gradient updates . We can now define the quantity θt+1s|ξ to represent the updated shared parameters after a gradient step with respect to the tasks in the non-empty subset ∅ ⊂ ξ ⊆ [ m ] . Assuming SGD for simplicity , we have1 θt+1s|ξ : = θ t s − η ∑ i∈ξ ∇θsLi ( X t , θts , θti ) . This quantity allows us to calculate a lookahead loss using the updated shared parameters while keeping the task-specific parameters as well as the input batch unchanged across different subsets of task gradients . That is , in order to assess the effect of the gradient update of tasks in ξ on a given task j , we can compare the loss of task j before and after applying the gradient update on the shared parameters with respect to ξ . In order to eliminate the scale discrepancy among different task losses , we consider the ratio of a task ’ s loss before and after the gradient step on the shared parameters as a scale invariant measure of relative progress . We can then define an asymmetric measure for calculating the transference of the tasks in ξ at a given time-step t on a single task j as Ztξ j = 1− Lj ( X t , θt+1s|ξ , θ t+1 j ) Lj ( X t , θts , θtj ) . ( 1 ) Notice that a positive value of Ztξ j indicates that the update on the shared parameters results in a lower loss on task j than the original parameter values , while a negative value of Ztξ j indicates that the shared parameter update is antagonistic for this task ’ s performance . Also , note that for ξ = { j } , our definition of transference encompasses a notion of self-transference , i.e . the effect of a task ’ s gradient update on its own loss . This quantity is particularly useful as a baseline to determine whether a subset of gradient updates can result in improved performance when compared with a task ’ s own self-transference . As we discuss in the next section , transference provides an effective guideline for choosing the subset of tasks to train together in a multi-task setting .
This paper studies the transferability in multi-task learning. They propose a metric, transference, to evaluate how tasks affect each other during multi-task training, and a method called IT-MTL which utilizes this metric to compute and improve lookahead loss changes. Although the proposed metric and method are interesting from a scientific point of view, there are a few key downsides (as the author themselves summarized in the conclusion) that require further investigation/improvements.
SP:14a10829b5d4b5fcdf1c02720b767e6af2733a48
Measuring and Harnessing Transference in Multi-Task Learning
1 INTRODUCTION . Deciding if two or more objectives should be trained together in a multi-task model , as well as choosing how that model ’ s parameters should be shared , is an inherently complex issue often left to human experts ( Zhang & Yang , 2017 ) . However , a human ’ s understanding of similarity is motivated by their intuition and experience rather than a prescient knowledge of the underlying structures learned by a neural network . To further complicate matters , the benefit or detriment induced from co-training relies on many non-trivial decisions including , but not limited to , dataset characteristics , model architecture , hyperparameters , capacity , and convergence ( Wu et al. , 2020 ; Vandenhende et al. , 2019 ; Standley et al. , 2019 ; Sun et al. , 2019 ) . As a result , a quantifiable measure which conveys the effect of information transfer in a neural network would be valuable to practitioners and researchers alike to better construct or understand multi-task learning paradigms ( Baxter , 2000 ; Ben-David & Schuller , 2003 ) . The training dynamics specific to multitask neural networks , namely cross-task interactions at the shared parameters ( Zhao et al. , 2018 ) , are difficult to predict and only fully manifest at the completion of training . Given the cost , both with regards to time and resources , of fully training a deep neural network , an exhaustive search over the 2m−1 possible combinations ofm tasks to determine ideal task groupings can be infeasible . This search is only complicated by the irreproducibility inherent in traversing a loss landscape with high curvature ; an effect which appears especially pronounced in multi-task learning paradigms ( Yu et al. , 2020 ; Standley et al. , 2019 ) . In this paper , we aim to take a step towards quantifying transference , or the dynamics of information transfer , and understanding its effect on multi-task training efficiency . As both the input data and state of model convergence are fundamental to transference ( Wu et al. , 2020 ) , we develop a parameter-free approach to measure this effect at a per-minibatch level of granularity . Moreover , our quantity makes no assumptions regarding model architecture , and is applicable to any paradigm in which shared parameters are updated with respect to multiple task losses . By analyzing multi-task training dynamics through the lens of transference , we present the following observations . First , information transfer is highly dependent on model convergence and varies significantly throughout training . Second , and perhaps surprisingly , excluding certain task gradients from the multi-task gradient update for select minibatches can improve learning efficiency . Our Under review as a conference paper at ICLR 2021 Transference in CelebA Transference in MetaWorld A0 A8 A7 A6 A5 A4 A3 A2 A1 -0.4 -0.3 -0.2 -0.1 1.0 Transference in CelebA Gradient Update A0 A1 A2 A3 A4 A5 A6 A7 A8 ( a ) reach push press button top open window close window -0.8 -0.6 -0.4 -0.2 1.0 Transference in MetaWorld Gradient Update close window open window press button top push reach ( b ) Figure 1 : Transference in ( a ) CelebA for a subset of 9 attributes ; ( b ) Meta-World for “ push ” , “ reach ” , “ press button top ” , and “ open window ” . To determine task groupings , we compute the transference of each task i on all other tasks j , i.e . Zt { i } →j and average over time . For the purpose of illustration , we normalize the transference along each axis . Notice the majority of the tasks in ( a ) concentrate around a single value for each attribute . Tasks which exhibit transference above this value are considered to have relatively high transference . For instance , A3 exhibits higher-than-average transference on A0 , A4 , and A5 . A similar effect is observed in ( b ) , with “ close window ” manifesting high transference on “ push ” and “ reach ” . analysis suggests this is due to large variation in loss landscapes for different tasks as illustrated in Figure 4 . Building on these observations , we propose two methods to utilize transference in multitask learning algorithms – to choose which tasks to train together as well as determining which gradients to apply at each minibatch . Our experiments indicate the former can identify promising task groupings , while the latter can improve learning performance over prior methods . In summary , our main contributions are three-fold : we ( 1 ) propose the first measure ( to our knowledge ) which quantifies information transfer among tasks in multi-task learning ; ( 2 ) demonstrate how transference can be used as a heuristic to select task groupings ; ( 3 ) present a method which leverages minibatch-level transference to augment network performance . 2 RELATED WORK . Multi-Task Formulation . The most prevalent formulation of MTL is hard parameter sharing of hidden layers ( Ruder , 2017 ; Caruana , 1993 ) . In this design , a subset of the hidden layers are typically shared among all tasks , and task-specific layers are stacked on top of the shared base to output a prediction value . Each task is assigned a weight , and the loss of the entire model is a linear combination of each task ’ s loss multiplied by its respective loss weight . This particular design enables parameter efficiency by sharing hidden layers across tasks , reduces overfitting , and can facilitate transfer learning effects among tasks ( Ruder , 2017 ; Baxter , 2000 ; Zhang & Yang , 2017 ) . Information Sharing . Prevailing wisdom suggests tasks which are similar or share a similar underlying structure may benefit from co-training in a multi-task system ( Caruana , 1993 ; 1997 ) . A plethora of multi-task methods addressing what to share have been developed , such as Neural Architecture Search ( Guo et al. , 2020 ; Sun et al. , 2019 ; Vandenhende et al. , 2019 ; Rusu et al. , 2016 ; Huang et al. , 2018 ; Lu et al. , 2017 ) and Soft-Parameter Sharing ( Misra et al. , 2016 ; Duong et al. , 2015 ; Yang & Hospedales , 2016 ) , to improve multi-task performance . Though our measure of transference is complementary with these methods , we direct our focus towards which tasks should be trained together rather than architecture modifications to maximize the benefits of co-training . While deciding which tasks to train together has traditionally been addressed with costly crossvalidation techniques or high variance human intuition , recent advances have developed increasingly efficient algorithms to assess co-training performance . Swirszcz & Lozano ( 2012 ) and Bingel & Søgaard ( 2017 ) approximate multi-task performance by analyzing single-task learning characteristics . An altogether different approach may leverage recent advances in transfer learning focused on understanding task relationships ( Zamir et al. , 2018 ; Achille et al. , 2019b ; Dwivedi & Roig , 2019 ; Zhuang et al. , 2020 ; Achille et al. , 2019a ) ; however , Standley et al . ( 2019 ) show transfer learning algorithms which determine task similarity do not carry over to the multi-task learning domain and instead propose a multi-task specific framework . Training Dynamics . Significant effort has also been invested to improve the training dynamics of MTL systems . In particular , dynamic loss reweighing has achieved performance superior to using fixed loss weights found with extensive hyperparameter search ( Kendall et al. , 2018 ; Guo et al. , 2018 ; Liu et al. , 2019 ; Chen et al. , 2017 ; Sener & Koltun , 2018 ; Lin et al. , 2019 ) . Another set of methods seeks to mitigate the optimization challenges in multi-task learning by manipulating the task gradients in a number of ways such as ( 1 ) modifying the direction of task gradients with the underlying assumption that directional inconsistency of gradients on the shared parameters are detrimental to model convergence and performance ( Zhao et al. , 2018 ; Suteu & Guo , 2019 ) , and ( 2 ) altering both the direction and the magnitude of the task gradients ( Yu et al. , 2020 ; Chen et al. , 2020 ; Wang et al. , 2020b ) . Instead of directly modifying the task gradients during optimization , our work builds upon these approaches by quantifying how a gradient update to the shared parameters would affect training loss and choosing the combination of gradients which maximizes positive information transfer . Looking into the Future . Looking at what could happen to determine what should happen has been used extensively in both the meta-learning ( Finn et al. , 2017 ; Nichol et al. , 2018 ; Brinkmeyer et al. , 2019 ; Grant et al. , 2018 ; Kim et al. , 2018 ) as well as optimization domains ( Nesterov , 1983 ; Hinton & Plaut , 1987 ; Zhang et al. , 2019 ; Izmailov et al. , 2018 ; Johnson & Zhang , 2013 ) . Lookahead metalearning algorithms focusing on validation loss have also been used to improve generalization in multi-task learning systems ( Wang et al. , 2020a ) , and our work further adapts this central concept to multi-task learning to both quantify and improve information transfer . 3 TRANSFERENCE IN MULTI-TASK LEARNING . Within the context of a hard-parameter sharing paradigm , tasks collaborate to build a shared feature representation which is then specialized by individual task-specific heads to output a prediction . Accordingly , tasks implicitly transfer information to each other by updating this shared feature representation with successive gradient updates . We can then view transference , or information transfer in multi-task learning , as the effect of a task ’ s gradient update to the shared parameters on another task ’ s loss during training . While the the shared parameter update using a task ’ s gradient , often but not always , increases the losses of the other tasks in the network , we find the extent to which these losses change to be highly task specific . This indicates certain tasks interact more constructively than others . Further , we notice this effect to be reproducible and nearly unchanged across successive training runs with varying parameter initializations . Motivated by these observations , we derive a quantitative measure of transference , describe how it can be used to determine which tasks should be trained together , and provide empirical analysis of these claims . Later , we will build upon these ideas to derive a new multi-task learning algorithm . 3.1 MEASURING TRANSFERENCE . Consider an m-multitask loss function parameterized by { θs } ∪ { θi| i ∈ [ m ] } where θs represents the shared parameters and θi represents the task i ∈ [ m ] specific parameters . Let Ltotal ( X , θs , { θi } ) = ∑ i∈ [ m ] Li ( X , θs , θi ) , denote the total loss where Li represents the non-negative loss of task i . For simplicity of notation , we set the loss weight of each task to be equal to 1 , though our construction generalizes to arbitrary weightings . For a given training batch X t at time-step t , we can first update the task specific parameters { θt+1i } using standard gradient updates . We can now define the quantity θt+1s|ξ to represent the updated shared parameters after a gradient step with respect to the tasks in the non-empty subset ∅ ⊂ ξ ⊆ [ m ] . Assuming SGD for simplicity , we have1 θt+1s|ξ : = θ t s − η ∑ i∈ξ ∇θsLi ( X t , θts , θti ) . This quantity allows us to calculate a lookahead loss using the updated shared parameters while keeping the task-specific parameters as well as the input batch unchanged across different subsets of task gradients . That is , in order to assess the effect of the gradient update of tasks in ξ on a given task j , we can compare the loss of task j before and after applying the gradient update on the shared parameters with respect to ξ . In order to eliminate the scale discrepancy among different task losses , we consider the ratio of a task ’ s loss before and after the gradient step on the shared parameters as a scale invariant measure of relative progress . We can then define an asymmetric measure for calculating the transference of the tasks in ξ at a given time-step t on a single task j as Ztξ j = 1− Lj ( X t , θt+1s|ξ , θ t+1 j ) Lj ( X t , θts , θtj ) . ( 1 ) Notice that a positive value of Ztξ j indicates that the update on the shared parameters results in a lower loss on task j than the original parameter values , while a negative value of Ztξ j indicates that the shared parameter update is antagonistic for this task ’ s performance . Also , note that for ξ = { j } , our definition of transference encompasses a notion of self-transference , i.e . the effect of a task ’ s gradient update on its own loss . This quantity is particularly useful as a baseline to determine whether a subset of gradient updates can result in improved performance when compared with a task ’ s own self-transference . As we discuss in the next section , transference provides an effective guideline for choosing the subset of tasks to train together in a multi-task setting .
[Summary] This paper studies the problem of task relationship/transference in multi-task learning, by introducing a quantifiable measurement based on relative loss updates. A (nonsymmetric) task transference between task $i$ and task $j$ then can be computed by measuring the relative change of training loss of task $j$, with the updated shared parameters from the training loss of task $i$. By finding a subset of tasks that achieves maximal total transference over every single task, multi-task learning performance can be further improved.
SP:14a10829b5d4b5fcdf1c02720b767e6af2733a48
Pareto Adversarial Robustness: Balancing Spatial Robustness and Sensitivity-based Robustness
1 INTRODUCTION . Robust generalization can serve as an extension of tradition generalization , i.e. , Empirical Risk Minimization in the case of i.i.d . data ( Vapnik & Chervonenkis , 2015 ) , where the test environments might differ slightly or dramatically from the training environment ( Krueger et al. , 2020 ) . Improving the robustness of deep neural networks has been one of the crucial research topics , with various different threads of research , including adversarial robustness ( Goodfellow et al. , 2014 ; Szegedy et al. , 2013 ) , non-adversarial robustness ( Hendrycks & Dietterich , 2019 ; Yin et al. , 2019 ) , Bayesian deep learning ( Neal , 2012 ; Gal , 2016 ) and causality ( Arjovsky et al. , 2019 ) . In this paper , we focus on the adversarial robustness where adversarial examples are carefully manipulated by human to drastically fool the machine learning models , e.g. , deep neural networks , posing a serious threat especially on safety-critical applications . Currently , adversarial training ( Goodfellow et al. , 2014 ; Madry et al. , 2017 ; Ding et al. , 2018 ) is regarded as one promising and widely accepted strategy to address this issue . However , similar to Out-of-Distribution ( OoD ) robustness , one crucial issue is that adversarial robustness also has many aspects ( Hendrycks et al. , 2020 ) , mainly including sensitivity-based robustness ( Tramèr et al. , 2020 ) , i.e . robustness against pixel-wise perturbations ( normally within the constraints of an lp ball ) , and spatial robustness , i.e. , robustness against multiple spatial transformations . Firstly , in the computer vision and graphics literature , there are two main factors that determine the appearance of a pictured object ( Xiao et al. , 2018 ; Szeliski , 2010 ) : ( 1 ) the lighting and materials , and ( 2 ) geometry . Most previous adversarial robustness focus on the ( 1 ) factor ( Xiao et al. , 2018 ) based on pixel-wise perturbations , e.g. , Projected Gradient Descent ( PGD ) attacks , assuming the underlying geometry stays the same after the adversarial perturbation . The other rising research branch tackled with the second factor , such as Flow-based ( Xiao et al. , 2018 ) and RotationTranslation ( RT ) -based attacks ( Engstrom et al. , 2017 ; 2019 ) . Secondly , by explicitly exploring the human perception , Sharif et al . ( 2018 ) pointed out that sensitivity-based robustness , i.e. , lp-distance measured robustness , is not sufficient to adversarial robustness in order to maintain the perceptual similarity . This is owing to the fact that although spatial attacks or geometric transformations also result in small perceptual differences , they yield large lp distances . In order to head towards the comprehensive adversarial robustness , we find that the crucial issue to investigate the aforementioned whole part of adversarial robustness is the relationships among accuracy , sensitivity-based robustness and spatial robustness . Prior to our work , a clear trade-off between sensitivity-based robustness and accuracy has been revealed by a series of works ( Zhang et al. , 2019 ; Tsipras et al. , 2018 ; Raghunathan et al. , 2020 ) . Besides , recent work ( Tramèr & Boneh , 2019 ; Kamath et al. , 2020 ) exhibited that there seems to exist an obscure trade-off between RotationTranslation and sensitivity-based robustness . However , this conclusion lacks considering Flowbased attacks ( Xiao et al. , 2018 ; Zhang & Wang , 2019 ) , another non-negligible part in the spatial robustness evaluation , making the previous conclusion less comprehensive or reliable . As such , the comprehensive relationships among all the quantities mentioned above are still unclear and remain to be further explored . More importantly , new robust strategy that can harmonize all the considered correlations is needed , in order to achieve optimal balance within the comprehensive robustness . In this paper , in order to design a new approach towards comprehensive robustness , we firstly explore the two main branches in the spatial robustness , i.e. , Flow-based spatial attack ( Xiao et al. , 2018 ) and Rotation-Translation ( RT ) attack ( Engstrom et al. , 2019 ) . By investigating the different impacts of these two attacks on the spatial sensitivity , we propose an integrated differentiable spatial attack framework , considering both local and global spatial vulnerability . Based on that , we present a comprehensive relationship among accuracy , sensitivity-based robustness and two branches of spatial robustness . Especially we show that the trade-off between sensitivity-based and RT robustness is fundamental trade-off as opposed to the highly interwoven correlation between sensitivity-based and Flow-based spatial robustness . We further provide strong evidence based on their different saliency maps from the perspectives of shape-bias , sparse or dense representation . Lastly , to balance these different kinds of mutual impacts within a unified adversarial training framework , we introduce the Pareto criterion ( Kim & De Weck , 2005 ; 2006 ; Zeleny , 2012 ) in the multi-objective optimization , thus developing an optimal balance between the interplay of natural accuracy and different adversarial robustness . By additionally incorporating the two-moment term capturing the interaction between losses of accuracy and different robustness , we finally propose a bi-level optimization framework called Pareto Adversarial Training . The resulting Pareto front provides the set of optimal solutions that balance perfectly all the considered relationships , outperforming other existing strategies . Our contributions are summarized as follows : • We propose an integrated spatial attack framework that incorporates both local and global spatial vulnerability based on Flow-based and RT attacks , paving the way towards the comprehensive spatial robustness analysis in the future . • We present comprehensive relationships within accuracy , sensitivity-based , different spatial robustness , supported by strong evidence from the perspective of representation . • We incorporate the Pareto criterion into adversarial robustness analysis , and are the first attempt to consider multiple adversarial robustness via the multi-objective optimization . 2 TOWARDS COMPREHENSIVE SPATIAL ROBUSTNESS . 2.1 MOTIVATION . In order to better investigate the relationships between accuracy and different kinds of adversarial robustness , we need to firstly provide a fine-grained understanding of spatial robustness , which has been less studied as opposed to sensitivity-based robustness . We summarize two major branches among a flurry of related work about spatial robustness ( Engstrom et al. , 2017 ; 2019 ; Xiao et al. , 2018 ; Zhang & Wang , 2019 ; Tramèr & Boneh , 2019 ; Kamath et al. , 2020 ) : ( 1 ) Flow-based Attacks , and ( 2 ) Rotation-Translation ( RT ) Attacks . Specifically , we find that the former mainly focuses on the local spatial vulnerability while the latter tends to capture the global spatial sensitivity . Our motivation is to firstly shed light on the fundamental difference between these two approaches , and then propose an integrated spatial robustness evaluation metric . 2.2 INTEGRATED SPATIAL ATTACK : COMBING LOCAL AND GLOBAL SPATIAL SENSITIVITY . Local Spatial Robustness : Flow-based Attacks The most representative Flow-based Attack is Spatial Transformed Attack ( Xiao et al. , 2018 ) , in which a differentiable flow vector wF = ( ∆µ , ∆v ) is defined in the 2D coordinate ( µ , v ) to craft adversarial spatial transformation . The vanilla targeted Flow-based attack ( Xiao et al. , 2018 ) ( κ = 0 ) follows the optimization manner : w∗F = arg min wF max i6=t f iθ ( xwF ) − f tθ ( xwF ) + τLflow ( wF ) , ( 1 ) where fθ ( x ) = ( f1θ ( x ) , . . . , f K θ ( x ) ) is the classifier in the K-classification problem . xwF is Flowbased adversarial example parameterized by flow vector wF . Lflow measures the local smoothness of spatial transformation further balanced by τ . Interestingly , in our empirical study shown in the left part of Figure 1 , we find that Flow-based attack tends to yield local permutations among pixels in some specific regions irrespective of the option of τ , rather than the global spatial transformation based on their shapes . We analyze that this phenomenon is owing to two factors : 1 ) Local permutations , especially in regions where colors of pixels change dramatically , are already sufficiently sensitive to manipulate , demonstrated by our empirical results shown above . 2 ) The optimization manner does not incorporate any sort of shape transformation information , e.g. , a parameter equation of rotation , as opposed to vanilla RotationTranslation attack , which we present in the following . Thus , Flow-based attacks tend to capture the local spatial vulnerability . Further , for the need to design the integrated spatial attack , we transform Eq 1 into its untargeted version under cross entropy loss with flow vector bounded by an F -ball : w∗F = arg max wF LCEθ ( xwF , y ) s.t . ‖wF ‖ ≤ F ( 2 ) where LCEθ ( x , y ) = log ∑ j exp ( f jθ ( x ) ) − fyθ ( x ) . One difference compared with Eq . 1 is that we replace local smoothness term Lflow with our familiar lp constraint . Moreover , vanilla Flowbased attack ( Xiao et al. , 2018 ) follows the max operation suggested in ( Carlini & Wagner , 2017 ) . However we leverage cross entropy loss instead in pursuit of a uniform optimization form in our integrated spatial attack . Proposition 1 reveals the correlation between the two loss , indicating that the smooth approximation version ofmax operation in Eq . 1 , denoted as LSθ , has a parallel updating direction with Cross Entropy loss regarding wF . Proof can be found in Appendix A.2 . Proposition 1 . For a fixed ( xwF , y ) and θ , consider LSθ ( x , y ) = log ∑ i 6=y exp ( f iθ ( x ) ) − fyθ ( x ) , the smooth version loss of Eq . 1 without local smoothness term , then we have ∇wFLCEθ ( xwF , y ) = r ( xwF , y ) ∇wFLSθ ( xwF , y ) , where r ( xwF , y ) = ∑ i6=y exp ( f iθ ( xwF ) ) ∑ i exp ( f iθ ( xwF ) ) . ( 3 ) Global Spatial Robustness : Rotation-Translation ( RT ) -based Attacks The original RotationTranslation attack ( Engstrom et al. , 2017 ; 2019 ) applies parameter equations constraint on the 2D coordinate , thus capturing the global spatial information : [ u′ v′ ] = [ cos θ − sin θ sin θ cos θ ] · [ u v ] + [ δu δv ] . ( 4 ) To design a generic spatial transformation matrix that can simultaneously consider rotation , translation , cropping and scaling , we re-parameterize the transform matrix as a generic 6-dimensional affine transformation matrix , inspired by ( Jaderberg et al. , 2015 ) : [ u′ v′ ] = ( [ 1 0 0 0 1 0 ] + [ w11RT w 12 RT w 13 RT w21RT w 22 RT w 23 RT ] ) · [ u v 1 ] , ( 5 ) where we denote AwRT as the generic 6-dimensional affine transformation matrix , in which each wRT indicates the increment on different spatial aspects . For example , ( w13RT , w 23 RT ) determines the translation . Finally , the optimization form of the resulting generic and differentiable RT-based attack bounded by RT -ball is exhibited as : w∗RT = arg max wRT LCEθ ( xwRT , y ) s.t . ‖wRT ‖ ≤ RT . ( 6 ) Integrated Spatial Robustness The key to achieve this goal is to design an integrated parameterized sampling grid TwRT , wF ( G ) that can warp the regular grid with both affine and flow transformation , where G is the generated grid . We show our integrated approach as follows : TwRT , wF ( G ) = AwRT [ u v 1 ] + [ wF 1 ] , xadv = TwRT , wF ( G ) ◦ x . ( 7 ) Then we sample new xadv by TwRT , wF ( G ) via differentiable bilinear interpolation ( Jaderberg et al. , 2015 ) . Then the loss function of the differentiable integrated spatial attack can be presented as : w∗ = arg max w LCEθ ( x+ ηw , y ) , s.t . ‖w‖ ≤ , ( 8 ) where w = [ wF , wRT ] T and ηw is the crafted integrated spatial perturbation . Note that ηw itself does not necessarily satisfy the lp constraint directly . For the implementation , we follow the PGD procedure ( Madry et al. , 2017 ) , a common practice in sensitivity-based attacks . We consider the infinity norm of w and different learning rates for the two sorts of spatial robustness : [ wt+1F wt+1RT ] = [ wtF wtRT ] + [ αF αRT ] clip ( sign ( ∇wLCEθ ( xtwt , y ) ) ) , xt+1wt+1 = Twt+1 ( G ) ◦ x t wt , ( 9 ) where we denote wt+1 = [ wt+1F , w t+1 RT ] T and = [ F , RT ] T . From Figure 1 , we can observe that our Integrated Spatial Attack can construct both local and global spatial transformations on images . Then , we visualize the loss surface under this Integrated Spatial Attack leveraging “ filter normalization ” ( Li et al. , 2018 ) as illustrated in Figure 2 . It is worth noting that the highly nonconcave loss landscape with respect to only rotation and translation raised by ( Engstrom et al. , 2019 ) has been largely alleviated by considering both local and global spatial vulnerability , verifying the efficiency of our Integrated Spatial Attack . Remote-look of Initial Landscape Close-look of Initial Landscape Landscape around the maxima example
This paper first studies the tradeoffs between two forms of spatial robustness, including robustness against Flow-based spatial attack and Rotation-Translation (RT) attack. In particular, it proposes an approach to account for both local and global spatial transformations in an integrated framework. In addition, the paper investigates the relationship between the sensitivity-based (lp-norm based) and spatial robustness, and proposes a training method called ‘Pareto Adversarial Training’ to find optimal combination between natural accuracy, sensitivity-based and spatial robustness.
SP:e70a869dc8d81a0338d382ea6a761145ed8e59bd
Pareto Adversarial Robustness: Balancing Spatial Robustness and Sensitivity-based Robustness
1 INTRODUCTION . Robust generalization can serve as an extension of tradition generalization , i.e. , Empirical Risk Minimization in the case of i.i.d . data ( Vapnik & Chervonenkis , 2015 ) , where the test environments might differ slightly or dramatically from the training environment ( Krueger et al. , 2020 ) . Improving the robustness of deep neural networks has been one of the crucial research topics , with various different threads of research , including adversarial robustness ( Goodfellow et al. , 2014 ; Szegedy et al. , 2013 ) , non-adversarial robustness ( Hendrycks & Dietterich , 2019 ; Yin et al. , 2019 ) , Bayesian deep learning ( Neal , 2012 ; Gal , 2016 ) and causality ( Arjovsky et al. , 2019 ) . In this paper , we focus on the adversarial robustness where adversarial examples are carefully manipulated by human to drastically fool the machine learning models , e.g. , deep neural networks , posing a serious threat especially on safety-critical applications . Currently , adversarial training ( Goodfellow et al. , 2014 ; Madry et al. , 2017 ; Ding et al. , 2018 ) is regarded as one promising and widely accepted strategy to address this issue . However , similar to Out-of-Distribution ( OoD ) robustness , one crucial issue is that adversarial robustness also has many aspects ( Hendrycks et al. , 2020 ) , mainly including sensitivity-based robustness ( Tramèr et al. , 2020 ) , i.e . robustness against pixel-wise perturbations ( normally within the constraints of an lp ball ) , and spatial robustness , i.e. , robustness against multiple spatial transformations . Firstly , in the computer vision and graphics literature , there are two main factors that determine the appearance of a pictured object ( Xiao et al. , 2018 ; Szeliski , 2010 ) : ( 1 ) the lighting and materials , and ( 2 ) geometry . Most previous adversarial robustness focus on the ( 1 ) factor ( Xiao et al. , 2018 ) based on pixel-wise perturbations , e.g. , Projected Gradient Descent ( PGD ) attacks , assuming the underlying geometry stays the same after the adversarial perturbation . The other rising research branch tackled with the second factor , such as Flow-based ( Xiao et al. , 2018 ) and RotationTranslation ( RT ) -based attacks ( Engstrom et al. , 2017 ; 2019 ) . Secondly , by explicitly exploring the human perception , Sharif et al . ( 2018 ) pointed out that sensitivity-based robustness , i.e. , lp-distance measured robustness , is not sufficient to adversarial robustness in order to maintain the perceptual similarity . This is owing to the fact that although spatial attacks or geometric transformations also result in small perceptual differences , they yield large lp distances . In order to head towards the comprehensive adversarial robustness , we find that the crucial issue to investigate the aforementioned whole part of adversarial robustness is the relationships among accuracy , sensitivity-based robustness and spatial robustness . Prior to our work , a clear trade-off between sensitivity-based robustness and accuracy has been revealed by a series of works ( Zhang et al. , 2019 ; Tsipras et al. , 2018 ; Raghunathan et al. , 2020 ) . Besides , recent work ( Tramèr & Boneh , 2019 ; Kamath et al. , 2020 ) exhibited that there seems to exist an obscure trade-off between RotationTranslation and sensitivity-based robustness . However , this conclusion lacks considering Flowbased attacks ( Xiao et al. , 2018 ; Zhang & Wang , 2019 ) , another non-negligible part in the spatial robustness evaluation , making the previous conclusion less comprehensive or reliable . As such , the comprehensive relationships among all the quantities mentioned above are still unclear and remain to be further explored . More importantly , new robust strategy that can harmonize all the considered correlations is needed , in order to achieve optimal balance within the comprehensive robustness . In this paper , in order to design a new approach towards comprehensive robustness , we firstly explore the two main branches in the spatial robustness , i.e. , Flow-based spatial attack ( Xiao et al. , 2018 ) and Rotation-Translation ( RT ) attack ( Engstrom et al. , 2019 ) . By investigating the different impacts of these two attacks on the spatial sensitivity , we propose an integrated differentiable spatial attack framework , considering both local and global spatial vulnerability . Based on that , we present a comprehensive relationship among accuracy , sensitivity-based robustness and two branches of spatial robustness . Especially we show that the trade-off between sensitivity-based and RT robustness is fundamental trade-off as opposed to the highly interwoven correlation between sensitivity-based and Flow-based spatial robustness . We further provide strong evidence based on their different saliency maps from the perspectives of shape-bias , sparse or dense representation . Lastly , to balance these different kinds of mutual impacts within a unified adversarial training framework , we introduce the Pareto criterion ( Kim & De Weck , 2005 ; 2006 ; Zeleny , 2012 ) in the multi-objective optimization , thus developing an optimal balance between the interplay of natural accuracy and different adversarial robustness . By additionally incorporating the two-moment term capturing the interaction between losses of accuracy and different robustness , we finally propose a bi-level optimization framework called Pareto Adversarial Training . The resulting Pareto front provides the set of optimal solutions that balance perfectly all the considered relationships , outperforming other existing strategies . Our contributions are summarized as follows : • We propose an integrated spatial attack framework that incorporates both local and global spatial vulnerability based on Flow-based and RT attacks , paving the way towards the comprehensive spatial robustness analysis in the future . • We present comprehensive relationships within accuracy , sensitivity-based , different spatial robustness , supported by strong evidence from the perspective of representation . • We incorporate the Pareto criterion into adversarial robustness analysis , and are the first attempt to consider multiple adversarial robustness via the multi-objective optimization . 2 TOWARDS COMPREHENSIVE SPATIAL ROBUSTNESS . 2.1 MOTIVATION . In order to better investigate the relationships between accuracy and different kinds of adversarial robustness , we need to firstly provide a fine-grained understanding of spatial robustness , which has been less studied as opposed to sensitivity-based robustness . We summarize two major branches among a flurry of related work about spatial robustness ( Engstrom et al. , 2017 ; 2019 ; Xiao et al. , 2018 ; Zhang & Wang , 2019 ; Tramèr & Boneh , 2019 ; Kamath et al. , 2020 ) : ( 1 ) Flow-based Attacks , and ( 2 ) Rotation-Translation ( RT ) Attacks . Specifically , we find that the former mainly focuses on the local spatial vulnerability while the latter tends to capture the global spatial sensitivity . Our motivation is to firstly shed light on the fundamental difference between these two approaches , and then propose an integrated spatial robustness evaluation metric . 2.2 INTEGRATED SPATIAL ATTACK : COMBING LOCAL AND GLOBAL SPATIAL SENSITIVITY . Local Spatial Robustness : Flow-based Attacks The most representative Flow-based Attack is Spatial Transformed Attack ( Xiao et al. , 2018 ) , in which a differentiable flow vector wF = ( ∆µ , ∆v ) is defined in the 2D coordinate ( µ , v ) to craft adversarial spatial transformation . The vanilla targeted Flow-based attack ( Xiao et al. , 2018 ) ( κ = 0 ) follows the optimization manner : w∗F = arg min wF max i6=t f iθ ( xwF ) − f tθ ( xwF ) + τLflow ( wF ) , ( 1 ) where fθ ( x ) = ( f1θ ( x ) , . . . , f K θ ( x ) ) is the classifier in the K-classification problem . xwF is Flowbased adversarial example parameterized by flow vector wF . Lflow measures the local smoothness of spatial transformation further balanced by τ . Interestingly , in our empirical study shown in the left part of Figure 1 , we find that Flow-based attack tends to yield local permutations among pixels in some specific regions irrespective of the option of τ , rather than the global spatial transformation based on their shapes . We analyze that this phenomenon is owing to two factors : 1 ) Local permutations , especially in regions where colors of pixels change dramatically , are already sufficiently sensitive to manipulate , demonstrated by our empirical results shown above . 2 ) The optimization manner does not incorporate any sort of shape transformation information , e.g. , a parameter equation of rotation , as opposed to vanilla RotationTranslation attack , which we present in the following . Thus , Flow-based attacks tend to capture the local spatial vulnerability . Further , for the need to design the integrated spatial attack , we transform Eq 1 into its untargeted version under cross entropy loss with flow vector bounded by an F -ball : w∗F = arg max wF LCEθ ( xwF , y ) s.t . ‖wF ‖ ≤ F ( 2 ) where LCEθ ( x , y ) = log ∑ j exp ( f jθ ( x ) ) − fyθ ( x ) . One difference compared with Eq . 1 is that we replace local smoothness term Lflow with our familiar lp constraint . Moreover , vanilla Flowbased attack ( Xiao et al. , 2018 ) follows the max operation suggested in ( Carlini & Wagner , 2017 ) . However we leverage cross entropy loss instead in pursuit of a uniform optimization form in our integrated spatial attack . Proposition 1 reveals the correlation between the two loss , indicating that the smooth approximation version ofmax operation in Eq . 1 , denoted as LSθ , has a parallel updating direction with Cross Entropy loss regarding wF . Proof can be found in Appendix A.2 . Proposition 1 . For a fixed ( xwF , y ) and θ , consider LSθ ( x , y ) = log ∑ i 6=y exp ( f iθ ( x ) ) − fyθ ( x ) , the smooth version loss of Eq . 1 without local smoothness term , then we have ∇wFLCEθ ( xwF , y ) = r ( xwF , y ) ∇wFLSθ ( xwF , y ) , where r ( xwF , y ) = ∑ i6=y exp ( f iθ ( xwF ) ) ∑ i exp ( f iθ ( xwF ) ) . ( 3 ) Global Spatial Robustness : Rotation-Translation ( RT ) -based Attacks The original RotationTranslation attack ( Engstrom et al. , 2017 ; 2019 ) applies parameter equations constraint on the 2D coordinate , thus capturing the global spatial information : [ u′ v′ ] = [ cos θ − sin θ sin θ cos θ ] · [ u v ] + [ δu δv ] . ( 4 ) To design a generic spatial transformation matrix that can simultaneously consider rotation , translation , cropping and scaling , we re-parameterize the transform matrix as a generic 6-dimensional affine transformation matrix , inspired by ( Jaderberg et al. , 2015 ) : [ u′ v′ ] = ( [ 1 0 0 0 1 0 ] + [ w11RT w 12 RT w 13 RT w21RT w 22 RT w 23 RT ] ) · [ u v 1 ] , ( 5 ) where we denote AwRT as the generic 6-dimensional affine transformation matrix , in which each wRT indicates the increment on different spatial aspects . For example , ( w13RT , w 23 RT ) determines the translation . Finally , the optimization form of the resulting generic and differentiable RT-based attack bounded by RT -ball is exhibited as : w∗RT = arg max wRT LCEθ ( xwRT , y ) s.t . ‖wRT ‖ ≤ RT . ( 6 ) Integrated Spatial Robustness The key to achieve this goal is to design an integrated parameterized sampling grid TwRT , wF ( G ) that can warp the regular grid with both affine and flow transformation , where G is the generated grid . We show our integrated approach as follows : TwRT , wF ( G ) = AwRT [ u v 1 ] + [ wF 1 ] , xadv = TwRT , wF ( G ) ◦ x . ( 7 ) Then we sample new xadv by TwRT , wF ( G ) via differentiable bilinear interpolation ( Jaderberg et al. , 2015 ) . Then the loss function of the differentiable integrated spatial attack can be presented as : w∗ = arg max w LCEθ ( x+ ηw , y ) , s.t . ‖w‖ ≤ , ( 8 ) where w = [ wF , wRT ] T and ηw is the crafted integrated spatial perturbation . Note that ηw itself does not necessarily satisfy the lp constraint directly . For the implementation , we follow the PGD procedure ( Madry et al. , 2017 ) , a common practice in sensitivity-based attacks . We consider the infinity norm of w and different learning rates for the two sorts of spatial robustness : [ wt+1F wt+1RT ] = [ wtF wtRT ] + [ αF αRT ] clip ( sign ( ∇wLCEθ ( xtwt , y ) ) ) , xt+1wt+1 = Twt+1 ( G ) ◦ x t wt , ( 9 ) where we denote wt+1 = [ wt+1F , w t+1 RT ] T and = [ F , RT ] T . From Figure 1 , we can observe that our Integrated Spatial Attack can construct both local and global spatial transformations on images . Then , we visualize the loss surface under this Integrated Spatial Attack leveraging “ filter normalization ” ( Li et al. , 2018 ) as illustrated in Figure 2 . It is worth noting that the highly nonconcave loss landscape with respect to only rotation and translation raised by ( Engstrom et al. , 2019 ) has been largely alleviated by considering both local and global spatial vulnerability , verifying the efficiency of our Integrated Spatial Attack . Remote-look of Initial Landscape Close-look of Initial Landscape Landscape around the maxima example
This paper first provides explanations to the inherent tradeoff between rotation adversarial attack and sensitivity attacks/spatial transform attacks, through their differences in saliency maps. Further, the authors proposed to utilize pareto training to find the best tradeoff among the four dimensions: natural accuracy, robustness against sensitivity/rotation/spatial transformation attacks. Experimental results show the proposed pareto adversarial training achieves better tradeoff between clean accuracy and adversarial robustness averaged across three types of attacks.
SP:e70a869dc8d81a0338d382ea6a761145ed8e59bd
Generative Language-Grounded Policy in Vision-and-Language Navigation with Bayes' Rule
1 INTRODUCTION . Vision-and-language navigation ( Anderson et al. , 2018b ) is a task in which a computational model follows an instruction and performs a sequence of actions to reach the final objective . An agent is embodied in a realistic 3D environment , such as that from the Matterport 3D Simulator ( Chang et al. , 2017 ) and asked to follow an instruction . The agent observes the surrounding environment and moves around . This embodied agent receives a textual instruction to follow before execution . The success of this task is measured by how accurately and quickly the agent could reach the destination specified in the instruction . VLN is a sequential decision making problem : the embodied agent makes a decision each step considering the current observation , transition history and the initial instruction . Previous studies address this problem of VLN by building a language grounded policy which computes a distribution over all possible actions given the current state and the language instruction . In this paper , we notice there are two ways to formulate the relationship between the action and instruction . First , the action is assumed to be generated from the instruction , similarly to most of the existing approaches ( Anderson et al. , 2018b ; Ma et al. , 2019 ; Wang et al. , 2019 ; Hu et al. , 2019 ; Huang et al. , 2019 ) . This is often called a follower model ( Fried et al. , 2018 ) . We call it a discriminative approach analogous to logistic regression in binary classification . On the other hand , the action may be assumed to generate the instruction . In this case , we build a neural network to compute the distribution over all possible instructions given an action and the transition history . With this neural network , we use Bayes ’ rule to build a language-grounded policy . We call this generative approach , similarly to naı̈ve Bayes in binary classification . The generative language-grounded policy only considers what is available at each time step and chooses one of the potential actions to generate the instruction . We then apply Bayes ’ rule to obtain the posterior distribution over actions given the instruction . Despite its similarity to the speaker model of Fried et al . ( 2018 ) , there is a stark difference that the speaker model of Fried et al . ( 2018 ) can not be used for navigation on its own due to its formulation , while our generative languagegrounded policy can be used for it by its own . The speaker model of Fried et al . ( 2018 ) takes as input the entire sequence of actions and predicts the entire instruction , which is not the case in ours . Given these discriminative and generative parameterizations of the language-grounded policy , we hypothesize that the generative parameterization works better than discriminative parameterization does , because the former benefits from richer learning signal arising from scoring the entire instruction rather than predicting a single action . Such rich learning signal arises , because the generative policy must learn to associate all salient features of a language instruction with an intended action , in order to learn the distribution over the language instructions . This is unlike the discriminative policy which may rely on only a minimal subset of salient features of the language instruction in order to model the distribution over a much smaller set of actions . Furthermore , the generative policy enables us to more readily encode our prior about the action distribution when it deemed necessary . We empirically show that indeed the proposed generative approach outperforms the discriminative approach in both the R2R and R4R datasets , especially in the unseen environments . Figure 1 illustrates the proposed generative approach on VLN . Furthermore , we show that the combination of the generative and discriminative policies results in near state-of-the art results in R2R and R4R , demonstrating that they capture two different aspects of VLN . We demonstrate that the proposed generative policy is more interpretable than the conventional discriminative policy , by introducing a token-level prediction entropy as a way to measure the influence of each token in the instruction on the policy ’ s decision . The source code is available at https : //github.com/shuheikurita/glgp . 2 DISCRIMINATIVE AND GENERATIVE PARAMETERIZATIONS OF LANGUAGE-GROUNDED POLICY . Vision-and-language navigation ( VLN ) is a sequential decision making task , where an agent performs a series of actions based on the initially-given instruction , visual features , and past actions . Given the instructionX , past and current observations s : t and past actions a : t−1 , the agent computes the distribution p ( at|X , s : t , a : t−1 ) at time t. For brevity , we write the current state that consists of the current and past scene observations , and past actions as ht = { s : t , a : t−1 } , and the next action prediction as p ( at|X , ht ) . The instruction X is a sequence of tokens X = ( w0 , w1 , ... , wk , ... ) . The relationship between these notations are also presented in Appendix B . In VLN , the goal is to model p ( at|ht , X ) so as to maximize the success rate of reaching the goal while faithfully following the instruction X . In doing so , there are two approaches : generative and discriminative , analogous to solving classification with either logistic regression or naive Bayes . In the discriminative approach , we build a neural network to directly estimate p ( at|ht , X ) . This neural network takes as input the current state ht and the language instruction X and outputs a distribution over the action set . Learning corresponds to max θ N∑ n=1 Tn∑ t=1 log p ( ant |hnt , Xn ) , ( 1 ) where N is the number of training trajectories . In the generative approach , on the other hand , we first rewrite the action distribution as p ( at|ht , X ) = p ( X|at , ht ) p′ ( at|ht ) ∑ a′t∈A p ( X|a′t , ht ) p′ ( a′t|ht ) = p ( X|at , ht ) ∑ a′t∈A p ( X|a′t , ht ) , ( 2 ) assuming p′ ( at|ht ) = 1/|A| , where A is the action set . This assumption implies that the action is independent of the state without the language instruction , which is a reasonable assumption as the goal is specified using the instructionX . p ( X|at , ht ) = Πkp ( wk|at , ht , w : k−1 ) is a language model conditioned on an action at and the current hidden state ht , and outputs the distribution over all possible sequences of vocabulary tokens . Learning is then equivalent to solving max θ N∑ n=1 Tn∑ t=1 ( log p ( Xn|ant , hnt ) − log ∑ a′nt ∈A p ( Xn|a′nt , hnt ) ) . ( 3 ) log p ( Xn|ant , hnt ) is the language model loss conditioned on the reference action ant , while the second term log ∑ a′t∈A p ( Xn|a′nt , hnt ) penalizes all the actions . Both terms of Eq . 3 are critical for learning the generative language-grounded policy . When we train the model only with the language model term log p ( Xn|ant , hnt ) of Eq . 3 , the resulting neural network may not learn how to distinguish different actions rather than simply focusing on generating the instruction from the state observation . For navigation , we use the model to capture the probability of the instruction conditioned on each action at ∈ A . The agent takes the action that maximizes the probability of generating the instruction : arg maxat p ( X|at , ht ) . In other words , the language-conditional generative policy has a language model inside and navigates the environment by choosing an action that maximizes the probability of the entire instruction . 3 RELATED WORK . While most of previous studies ( Anderson et al. , 2018b ; Ma et al. , 2019 ; Wang et al. , 2019 ; Li et al. , 2019 ; Hao et al. , 2020 ) have relied on the discriminative approach p ( at|X , ht ) , a few of previous studies ( Fried et al. , 2018 ; Tan et al. , 2019 ; Ke et al. , 2019 ) have proposed the so-called speaker model which scores the instruction against the entire trajectory . Such speaker models are mainly used for two purposes ; ( i ) data augmentation with automatically generated trajectories ( Fried et al. , 2018 ; Tan et al. , 2019 ) and ( ii ) reranking the complete trajectories in beam decoding ( Fried et al. , 2018 ; Tan et al. , 2019 ; Ke et al. , 2019 ) . They however have not been used for selecting local actions directly in either training or decoding . To the best of our knowledge , this paper is the first work that propose a standalone generative language-grounded policy for vision-and-language-navigation , that does not need the full state-action sequence nor to look ahead into the next state , before taking the action at each step . Some of the previous studies ( Thomason et al. , 2019a ; Hu et al. , 2019 ) discuss the ablation studies from the multimodal baselines . These studies suggest there are some action biases in the environments . Although it is possible to model these action biases in the action prior of Eq . 2 from the training environment , we choose not to do so in order to avoid overfitting our policy to the training environments . If we know the target environment beforehand , the engineering on the action prior is possibly effective . Inspired by the the success of the embodied navigation datasets ( Wu et al. , 2018 ; Chang et al. , 2017 ; Chen et al. , 2019 ) , new experimental settings and navigation tasks in realistic 3D modeling have been proposed , such as dialog-based navigation tasks which include vision-and-dialog navigation ( Thomason et al. , 2019b ) , vision-based navigation withlanguage-based assistanc ( Nguyen et al. , 2019 ) , and HANNA ( Nguyen & Daumé III , 2019 ) . Embodied question answering ( Das et al. , 2018 ; Wijmans et al. , 2019 ) , interactive visual question answering ( Gordon et al. , 2018 ) and ALFRED ( Shridhar et al. , 2020 ) for the navigation and object interaction are quite interesting task variants . The proposed generative language-grounded policy is applicable to these tasks where an agent solves a problem by following an instruction or having a conversation with another agent . 4 EXPERIMENTAL SETTINGS . 4.1 DATASETS . We conduct our experiments on the R2R navigation task ( Anderson et al. , 2018b ) , which is widely used for evaluating language-grounded navigation models and R4R ( Jain et al. , 2019 ) , which consists of longer and more complex paths when compared to R2R . R2R contains four splits of data : train , validation-seen , validation-unseen and test-unseen . From the 90 scenes of Matterport 3D modelings ( Chang et al. , 2017 ) , 61 scenes are pooled together and used as seen environments in both the training and validation-seen sets . Among the remaining scenes , 11 scenes form the validationunseen set and 18 scenes the test-unseen set . This setup tests the agent ’ s ability to navigate in unseen environments in the test phase . Some of previous studies make use of augmented datasets ( Fried et al. , 2018 ; Ma et al. , 2019 ; Tan et al. , 2019 ; Ke et al. , 2019 ) in R2R experiments . We use the same augmented dataset from Fried et al . ( 2018 ) which has been used in recent studies ( Ma et al. , 2019 ; Ke et al. , 2019 ) for comparison . R4R was created based on R2R . In R4R , paths are composed of two paths drawn from R2R , implying that each reference path in R4R is not necessarily the shortest path between the starting point and the goal point . R4R is more suitable for evaluating how closely the agent follows a given instruction that corresponds to a long and complex path . R4R consists of train , validation-seen and validationunseen sets , but does not contain the test-unseen set , unlike R2R . We provide more detailed statistics of R2R and R4R in Appendix C .
The paper addresses the problem of vision-and-language navigation (Anderson et al., 2018). The idea of the paper is to use a generative policy where a distribution over all instruction tokens given the previous actions is computed. The agent takes the action that maximizes the probability of the current instruction. The paper reports the results on R2R and R4R datasets.
SP:737ec0b9d0df72ef8c1db34a89773a627105b240
Generative Language-Grounded Policy in Vision-and-Language Navigation with Bayes' Rule
1 INTRODUCTION . Vision-and-language navigation ( Anderson et al. , 2018b ) is a task in which a computational model follows an instruction and performs a sequence of actions to reach the final objective . An agent is embodied in a realistic 3D environment , such as that from the Matterport 3D Simulator ( Chang et al. , 2017 ) and asked to follow an instruction . The agent observes the surrounding environment and moves around . This embodied agent receives a textual instruction to follow before execution . The success of this task is measured by how accurately and quickly the agent could reach the destination specified in the instruction . VLN is a sequential decision making problem : the embodied agent makes a decision each step considering the current observation , transition history and the initial instruction . Previous studies address this problem of VLN by building a language grounded policy which computes a distribution over all possible actions given the current state and the language instruction . In this paper , we notice there are two ways to formulate the relationship between the action and instruction . First , the action is assumed to be generated from the instruction , similarly to most of the existing approaches ( Anderson et al. , 2018b ; Ma et al. , 2019 ; Wang et al. , 2019 ; Hu et al. , 2019 ; Huang et al. , 2019 ) . This is often called a follower model ( Fried et al. , 2018 ) . We call it a discriminative approach analogous to logistic regression in binary classification . On the other hand , the action may be assumed to generate the instruction . In this case , we build a neural network to compute the distribution over all possible instructions given an action and the transition history . With this neural network , we use Bayes ’ rule to build a language-grounded policy . We call this generative approach , similarly to naı̈ve Bayes in binary classification . The generative language-grounded policy only considers what is available at each time step and chooses one of the potential actions to generate the instruction . We then apply Bayes ’ rule to obtain the posterior distribution over actions given the instruction . Despite its similarity to the speaker model of Fried et al . ( 2018 ) , there is a stark difference that the speaker model of Fried et al . ( 2018 ) can not be used for navigation on its own due to its formulation , while our generative languagegrounded policy can be used for it by its own . The speaker model of Fried et al . ( 2018 ) takes as input the entire sequence of actions and predicts the entire instruction , which is not the case in ours . Given these discriminative and generative parameterizations of the language-grounded policy , we hypothesize that the generative parameterization works better than discriminative parameterization does , because the former benefits from richer learning signal arising from scoring the entire instruction rather than predicting a single action . Such rich learning signal arises , because the generative policy must learn to associate all salient features of a language instruction with an intended action , in order to learn the distribution over the language instructions . This is unlike the discriminative policy which may rely on only a minimal subset of salient features of the language instruction in order to model the distribution over a much smaller set of actions . Furthermore , the generative policy enables us to more readily encode our prior about the action distribution when it deemed necessary . We empirically show that indeed the proposed generative approach outperforms the discriminative approach in both the R2R and R4R datasets , especially in the unseen environments . Figure 1 illustrates the proposed generative approach on VLN . Furthermore , we show that the combination of the generative and discriminative policies results in near state-of-the art results in R2R and R4R , demonstrating that they capture two different aspects of VLN . We demonstrate that the proposed generative policy is more interpretable than the conventional discriminative policy , by introducing a token-level prediction entropy as a way to measure the influence of each token in the instruction on the policy ’ s decision . The source code is available at https : //github.com/shuheikurita/glgp . 2 DISCRIMINATIVE AND GENERATIVE PARAMETERIZATIONS OF LANGUAGE-GROUNDED POLICY . Vision-and-language navigation ( VLN ) is a sequential decision making task , where an agent performs a series of actions based on the initially-given instruction , visual features , and past actions . Given the instructionX , past and current observations s : t and past actions a : t−1 , the agent computes the distribution p ( at|X , s : t , a : t−1 ) at time t. For brevity , we write the current state that consists of the current and past scene observations , and past actions as ht = { s : t , a : t−1 } , and the next action prediction as p ( at|X , ht ) . The instruction X is a sequence of tokens X = ( w0 , w1 , ... , wk , ... ) . The relationship between these notations are also presented in Appendix B . In VLN , the goal is to model p ( at|ht , X ) so as to maximize the success rate of reaching the goal while faithfully following the instruction X . In doing so , there are two approaches : generative and discriminative , analogous to solving classification with either logistic regression or naive Bayes . In the discriminative approach , we build a neural network to directly estimate p ( at|ht , X ) . This neural network takes as input the current state ht and the language instruction X and outputs a distribution over the action set . Learning corresponds to max θ N∑ n=1 Tn∑ t=1 log p ( ant |hnt , Xn ) , ( 1 ) where N is the number of training trajectories . In the generative approach , on the other hand , we first rewrite the action distribution as p ( at|ht , X ) = p ( X|at , ht ) p′ ( at|ht ) ∑ a′t∈A p ( X|a′t , ht ) p′ ( a′t|ht ) = p ( X|at , ht ) ∑ a′t∈A p ( X|a′t , ht ) , ( 2 ) assuming p′ ( at|ht ) = 1/|A| , where A is the action set . This assumption implies that the action is independent of the state without the language instruction , which is a reasonable assumption as the goal is specified using the instructionX . p ( X|at , ht ) = Πkp ( wk|at , ht , w : k−1 ) is a language model conditioned on an action at and the current hidden state ht , and outputs the distribution over all possible sequences of vocabulary tokens . Learning is then equivalent to solving max θ N∑ n=1 Tn∑ t=1 ( log p ( Xn|ant , hnt ) − log ∑ a′nt ∈A p ( Xn|a′nt , hnt ) ) . ( 3 ) log p ( Xn|ant , hnt ) is the language model loss conditioned on the reference action ant , while the second term log ∑ a′t∈A p ( Xn|a′nt , hnt ) penalizes all the actions . Both terms of Eq . 3 are critical for learning the generative language-grounded policy . When we train the model only with the language model term log p ( Xn|ant , hnt ) of Eq . 3 , the resulting neural network may not learn how to distinguish different actions rather than simply focusing on generating the instruction from the state observation . For navigation , we use the model to capture the probability of the instruction conditioned on each action at ∈ A . The agent takes the action that maximizes the probability of generating the instruction : arg maxat p ( X|at , ht ) . In other words , the language-conditional generative policy has a language model inside and navigates the environment by choosing an action that maximizes the probability of the entire instruction . 3 RELATED WORK . While most of previous studies ( Anderson et al. , 2018b ; Ma et al. , 2019 ; Wang et al. , 2019 ; Li et al. , 2019 ; Hao et al. , 2020 ) have relied on the discriminative approach p ( at|X , ht ) , a few of previous studies ( Fried et al. , 2018 ; Tan et al. , 2019 ; Ke et al. , 2019 ) have proposed the so-called speaker model which scores the instruction against the entire trajectory . Such speaker models are mainly used for two purposes ; ( i ) data augmentation with automatically generated trajectories ( Fried et al. , 2018 ; Tan et al. , 2019 ) and ( ii ) reranking the complete trajectories in beam decoding ( Fried et al. , 2018 ; Tan et al. , 2019 ; Ke et al. , 2019 ) . They however have not been used for selecting local actions directly in either training or decoding . To the best of our knowledge , this paper is the first work that propose a standalone generative language-grounded policy for vision-and-language-navigation , that does not need the full state-action sequence nor to look ahead into the next state , before taking the action at each step . Some of the previous studies ( Thomason et al. , 2019a ; Hu et al. , 2019 ) discuss the ablation studies from the multimodal baselines . These studies suggest there are some action biases in the environments . Although it is possible to model these action biases in the action prior of Eq . 2 from the training environment , we choose not to do so in order to avoid overfitting our policy to the training environments . If we know the target environment beforehand , the engineering on the action prior is possibly effective . Inspired by the the success of the embodied navigation datasets ( Wu et al. , 2018 ; Chang et al. , 2017 ; Chen et al. , 2019 ) , new experimental settings and navigation tasks in realistic 3D modeling have been proposed , such as dialog-based navigation tasks which include vision-and-dialog navigation ( Thomason et al. , 2019b ) , vision-based navigation withlanguage-based assistanc ( Nguyen et al. , 2019 ) , and HANNA ( Nguyen & Daumé III , 2019 ) . Embodied question answering ( Das et al. , 2018 ; Wijmans et al. , 2019 ) , interactive visual question answering ( Gordon et al. , 2018 ) and ALFRED ( Shridhar et al. , 2020 ) for the navigation and object interaction are quite interesting task variants . The proposed generative language-grounded policy is applicable to these tasks where an agent solves a problem by following an instruction or having a conversation with another agent . 4 EXPERIMENTAL SETTINGS . 4.1 DATASETS . We conduct our experiments on the R2R navigation task ( Anderson et al. , 2018b ) , which is widely used for evaluating language-grounded navigation models and R4R ( Jain et al. , 2019 ) , which consists of longer and more complex paths when compared to R2R . R2R contains four splits of data : train , validation-seen , validation-unseen and test-unseen . From the 90 scenes of Matterport 3D modelings ( Chang et al. , 2017 ) , 61 scenes are pooled together and used as seen environments in both the training and validation-seen sets . Among the remaining scenes , 11 scenes form the validationunseen set and 18 scenes the test-unseen set . This setup tests the agent ’ s ability to navigate in unseen environments in the test phase . Some of previous studies make use of augmented datasets ( Fried et al. , 2018 ; Ma et al. , 2019 ; Tan et al. , 2019 ; Ke et al. , 2019 ) in R2R experiments . We use the same augmented dataset from Fried et al . ( 2018 ) which has been used in recent studies ( Ma et al. , 2019 ; Ke et al. , 2019 ) for comparison . R4R was created based on R2R . In R4R , paths are composed of two paths drawn from R2R , implying that each reference path in R4R is not necessarily the shortest path between the starting point and the goal point . R4R is more suitable for evaluating how closely the agent follows a given instruction that corresponds to a long and complex path . R4R consists of train , validation-seen and validationunseen sets , but does not contain the test-unseen set , unlike R2R . We provide more detailed statistics of R2R and R4R in Appendix C .
The paper focuses on learning a navigation policy for a vision-and-language navigation problem. In this problem, the agent are given a language instruction and are asked to follow the instruction to navigation in a simulated 3D room. Unlike baselines which maximize the probability of selecting an action given an instruction, the authors proposed to apply the Bayes rule to maximize the probability of generating the instruction given an action. The authors claim that this gives better generalization in unseen environments.
SP:737ec0b9d0df72ef8c1db34a89773a627105b240
Reset-Free Lifelong Learning with Skill-Space Planning
1 INTRODUCTION . Intelligent agents , such as humans , continuously interact with the real world and make decisions to maximize their utility over the course of their lifetime . This is broadly the goal of lifelong reinforcement learning ( RL ) , which seeks to automatically learn artificial agents that can mimic the continuous learning capabilities of real-world agents . This goal is challenging for current RL algorithms as real-world environments can be non-stationary , requiring the agents to continuously adapt to changing goals and dynamics in robust fashions . In contrast to much of prior work in lifelong RL , our focus is on developing RL algorithms that can operate in non-episodic or “ reset-free ” settings and learn from both online and offline interactions . This setup approximates real-world learning where we might have plentiful logs of offline data but resets to a fixed start distribution are not viable and our goals and environment change . Performing well in this setting is key for developing autonomous agents that can learn without laborious human supervision in non-stationary , high-stakes scenarios . However , the performance of standard RL algorithms drops significantly in non-episodic settings . To illustrate this issue , we first pre-train agents to convergence in the episodic Hopper environment ( Brockman et al. , 2016 ) with state-of-the-art model-free and model-based RL algorithms : Soft Actor Critic ( SAC ) ( Haarnoja et al. , 2018 ) and Model-Based Policy Optimization ( MBPO ) ( Janner et al. , 2019 ) , respectively . These agents are then trained further in a reset-free setting , representing a real-world scenario where agents seek to improve generalization via continuing to adapt at a test time where resets are more expensive . The learning curves are shown in Figure 1 . In spite of near-perfect initialization , all agents proceed to fail catastrophically , suggesting that current gradientbased RL methods are inherently unstable in non-episodic settings . 1Project website and materials : https : //sites.google.com/berkeley.edu/reset-free-lifelong-learning This illustrative experiment complements prior work highlighting other failures of RL algorithms in non-stationary and non-episodic environments : Co-Reyes et al . ( 2020 ) find current RL algorithms fail to learn in a simple gridworld environment without resets and Lu et al . ( 2019 ) find modelfree RL algorithms struggle to learn and adapt to nonstationarity even with access to the ground truth dynamics model . We can attribute these failures to RL algorithms succumbing to sink states . Intuitively , these are states from which agents struggle to escape , have low rewards , and suggest a catastrophic halting of learning progress ( Lyapunov , 1992 ) . For example , an upright walking agent may fall over and fail to return to a standing position , possibly because of underactuated joints . A less obvious notion of sink state we use is that the agent simply fails to escape from it due to low learning signal , which is almost equally undesirable . A lifelong agent must seek to avoid such disabling sink states , especially in the absence of resets . We introduce Lifelong Skill Planning ( LiSP ) , an algorithmic framework for reset-free , lifelong RL that uses long-horizon , decision-time planning in an abstract space of skills to overcome the above challenges . LiSP employs a synergistic combination of model-free policy networks and model-based planning , wherein we use a policy to execute certain skills , planning directly in the skill space . This combination offers two benefits : ( 1 ) skills constrain the search space to aid the planner in finding solutions to long-horizon problems and ( 2 ) skills mitigate errors in the dynamics model by constraining the distribution of behaviors . We demonstrate that agents learned via LiSP can effectively plan for longer horizons than prior work , enabling better long-term reasoning and adaptation . Another key component of the LiSP framework is the flexibility to learn skills from both online and offline interactions . For online learning , we extend Dynamics-Aware Discovery of Skills ( DADS ) , an algorithm for unsupervised skill discovery ( Sharma et al. , 2019 ) , with a skill-practice proposal distribution and a primitive dynamics model for generating rollouts for training . We demonstrate that the use of this proposal distribution significantly amplifies the signal for learning skills in resetfree settings . For offline learning from logged interactions , we employ a similar approach as above but with a modification of the reward function to correspond to the extent of disagreement amongst the models in a probabilistic ensemble ( Kidambi et al. , 2020 ) . Our key contributions can be summarized as follows : • We identify skills as a key ingredient for overcoming the challenges to achieve effective lifelong RL in reset-free environments . • We propose Lifelong Skill Planning ( LiSP ) , an algorithmic framework for reset-free lifelong RL with two novel components : ( a ) a skill learning module that can learn from both online and offline interactions , and ( b ) a long-horizon , skill-space planning algorithm . • We propose new challenging benchmarks for reset-free , lifelong RL by extending gridworld and MuJoCo OpenAI Gym benchmarks ( Brockman et al. , 2016 ) . We demonstrate the effectiveness of LiSP over prior approaches on these benchmarks in a variety of nonstationary , multi-task settings , involving both online and offline interactions . 2 BACKGROUND . Problem Setup . We represent the lifelong environment as a sequence of Markov decision processes ( MDPs ) . The lifelong MDPM is the concatenation of several MDPs ( Mi , Ti ) , where Ti denotes the length of time for which the dynamics of Mi are activated . Without loss of generality , we assume the sum of the Ti ( i.e. , the total environment time ) is greater than the agent ’ s lifetime . The properties of the MDPMi are defined by the tuple ( S , A , Pi , ri , γ ) , where S is the state space , A is the action space , Pi : S ×A×S → R are the transition dynamics , ri : S ×A → R is the reward function , and γ ∈ [ 0 , 1 ) is the discount factor . Consistent with prior work , we assume ri is always known to the agent specifying the task ; it is also easy to learn for settings where it is not known . We use P and r as shorthand to refer to the currentMi with respect to the agent . The agent is denoted by a policy π : S → A and seeks to maximize its expected return starting from the current state s0 : argmaxπ Est+1∼P , at∼π [ ∑∞ t=0 γ tr ( st , at ) ] . The policy π may be implemented as a parameterized function or an action-generating procedure . We expect the agent to optimize for the currentMi , rather than trying to predict the future dynamics ; e.g. , a robot may be moved to an arbitrary new MDP and expected to perform well , without anticipating this change in advance . Skill Discovery . Traditional single-task RL learns a single parametrized policy πθ ( ·|s ) . For an agent to succeed at multiple tasks , we can increase the flexibility of the agent by introducing a set of latent skills z ∈ [ −1 , 1 ] dim ( z ) and learning a skill conditional policy πθ ( ·|s , z ) . As in standard latent variable modeling , we assume a fixed , simple prior over the skills p ( z ) , e.g. , uniform . The learning objective of the skill policy is to maximize some intrinsic notion of reward . We denote the intrinsic reward as r̃ ( s , z , s′ ) to distinguish it from the task-specific reward defined previously . One such intrinsic reward , proposed in DADS ( Sharma et al. , 2019 ) , can be derived from a variational approximation to the mutual information between the skills and next states I ( s′ ; z|s ) as : r̃ ( s , z , s′ ) = log qν ( s ′|s , z ) 1 L ∑L i=1 qν ( s ′|s , zi ) where zi ∼ p ( z ) . ( 1 ) Here qν ( s′|s , z ) is a tractable variational approximation for the intractable posterior p ( s′|s , z ) . Intuitively , this r̃ learns predictable ( via the numerator ) and distinguishable ( via the denominator ) skills . Due to the mutual information objective , DADS also learns skills with high empowerment , which is useful for constraining the space of options for planning ; we discuss this in Appendix C. Model-Based Planning . Whereas RL methods act in the environment according to a parameterized policy , model-based planning methods learn a dynamics model fφ ( st+1|st , at ) to approximate P and use Model Predictive Control ( MPC ) to generate an action via search over the model ( Nagabandi et al. , 2018b ; Chua et al. , 2018 ) . At every timestep , MPC selects the policy π that maximizes the predicted H-horizon expected return from the current state s0 for a specified reward function r : πMPC = argmax π Eat∼π , st+1∼fφ [ H−1∑ t=0 γtr ( st , at ) ] . ( 2 ) We use Model Path Predictive Integral ( MPPI ) ( Williams et al. , 2015 ) as our optimizer . MPPI is a gradient-free optimization method that : ( 1 ) samples policies according to Gaussian noise on the optimization parameters , ( 2 ) estimates the policy returns , and ( 3 ) reweighs policies according to a Boltzmann distribution on the predicted returns . For more details , see Nagabandi et al . ( 2020 ) . For all dynamics models used in this work , we use a probabilistic ensemble ofN models { fφi } N−1i=0 , where each model predicts the mean and variance of the next state . For MPC planning , the returns are estimated via trajectory sampling ( Chua et al. , 2018 ) , where each policy is evaluated on each individual model for the entire H-length rollout and the returns are averaged . For policy optimization , each transition is generated by sampling from a member of the ensemble uniformly at random . 3 LIFELONG SKILL-SPACE PLANNING . In this section , we present Lifelong Skill Planning ( LiSP ) , our proposed approach for reset-free lifelong RL . We provide an outline of LiSP in Algorithm 1 . The agent initially learns a dynamics model fφ and a skill policy πθ from any available offline data . Thereafter , the agent continuously updates the model and policy based on online interactions in the reset-free lifelong environment . The agent uses skill-space planning to act in the environment and avoid sink states . In particular , LiSP learns the following distributions as neural networks : • A primitive dynamics model fφ used for both planning and policy optimization • A low-level skill policy πθ trained from generated model rollouts on intrinsic rewards • A discriminator qν for learning the intrinsic reward using Sharma et al . ( 2019 ) • A skill-practice distribution pψ to generate a curriculum for training skills 3.1 MODEL-BASED SKILL DISCOVERY . Our goal is to learn a skill-conditioned policy πθ ( a|s , z ) . In order to minimize interactions with the environment , we first learn a model fφ to generate synthetic rollouts for policy training . Since there is no start state distribution , the initialization of these rollouts is an important design choice . Algorithm 1 : Lifelong Skill Planning ( LiSP ) Initialize true replay buffer D , generated replay buffer D̂ , dynamics model ensemble { fφi } N−1i=0 , policy πθ , discriminator qν , and skill-practice distribution pψ if performing offline pretraining then Learn dynamics model fφ and train policy πθ with UpdatePolicy until convergence while agent is alive at current state s do Update dynamics model to maximize the log probability of transitions of D Update policy models with UpdatePolicy ( D , D̂ , fφ , πθ , qν , pψ ) Execute action from GetAction ( s , fφ , πθ ) and add environment transition to D We propose to learn a skill-practice distribution pψ ( z|s ) to define which skills to use at a particular state . pψ acts as a “ teacher ” for πθ , automatically generating a curriculum for skill learning . We include visualizations of the learned skills on 2D gridworld environments in Appendix E.2 . To actually learn the policy , we use the model to generate short rollouts , optimizing πθ with SAC , similar to model-based policy learning works that find long rollouts to destabilize learning due to compounding model errors ( Janner et al. , 2019 ) . To initialize the rollout , we sample a state from the replay buffer D and a skill to practice via pψ . The next state is predicted by the dynamics model fφ , where the model used to make the prediction is uniformly sampled from the ensemble . The transition is added to a generated replay buffer D̂ ; gradients do not propagate through fφ . Given minibatches sampled from D̂ , both πθ and pψ are independently trained using SAC to optimize the intrinsic reward r̃adjusted . Intuitively pψ only selects skills which are most useful from the current state , instead of arbitrary skills . This is summarized in Algorithm 2 . Algorithm 2 : Learning Latent Skills Hyperparameters : number of rollouts M , disagreement threshold αthres Function UpdatePolicy ( replay buffer D , generated replay buffer D̂ , dynamics model fφ , policy πθ , discriminator qν , skill-practice distribution pψ ) : for i = 1 to M do Sample si0 uniformly from D and latent zi from skill-practice pψ ( ·|si0 ) Generate si1 : = fφ ( ·|si0 , πθ ( ·|si0 , zi ) ) and add transition ( si0 , ai , zi , si1 ) to D̂ Update discriminator qν on { si0 , ai , zi , si1 } Mi=1 to maximize log qν ( s1|s0 , z ) Calculate intrinsic rewards r̃adjusted for D̂ with qν , αthres using Equations 1 and 3 Update πθ , qν , pψ using SAC with minibatches from D̂
The authors propose LiSP, a model-based planning method that performs model-predictive control using learned skills rather than actions. The skills are learned using DADS, with a modified reward function that additionally encourages all skills to stay within the support of training data to avoid sink states. The experiment results show stable learning progress on reset-free and ever-changing targets, compared to other baselines.
SP:6cad092c66273cdb0065834ee4459f1b76f8929d
Reset-Free Lifelong Learning with Skill-Space Planning
1 INTRODUCTION . Intelligent agents , such as humans , continuously interact with the real world and make decisions to maximize their utility over the course of their lifetime . This is broadly the goal of lifelong reinforcement learning ( RL ) , which seeks to automatically learn artificial agents that can mimic the continuous learning capabilities of real-world agents . This goal is challenging for current RL algorithms as real-world environments can be non-stationary , requiring the agents to continuously adapt to changing goals and dynamics in robust fashions . In contrast to much of prior work in lifelong RL , our focus is on developing RL algorithms that can operate in non-episodic or “ reset-free ” settings and learn from both online and offline interactions . This setup approximates real-world learning where we might have plentiful logs of offline data but resets to a fixed start distribution are not viable and our goals and environment change . Performing well in this setting is key for developing autonomous agents that can learn without laborious human supervision in non-stationary , high-stakes scenarios . However , the performance of standard RL algorithms drops significantly in non-episodic settings . To illustrate this issue , we first pre-train agents to convergence in the episodic Hopper environment ( Brockman et al. , 2016 ) with state-of-the-art model-free and model-based RL algorithms : Soft Actor Critic ( SAC ) ( Haarnoja et al. , 2018 ) and Model-Based Policy Optimization ( MBPO ) ( Janner et al. , 2019 ) , respectively . These agents are then trained further in a reset-free setting , representing a real-world scenario where agents seek to improve generalization via continuing to adapt at a test time where resets are more expensive . The learning curves are shown in Figure 1 . In spite of near-perfect initialization , all agents proceed to fail catastrophically , suggesting that current gradientbased RL methods are inherently unstable in non-episodic settings . 1Project website and materials : https : //sites.google.com/berkeley.edu/reset-free-lifelong-learning This illustrative experiment complements prior work highlighting other failures of RL algorithms in non-stationary and non-episodic environments : Co-Reyes et al . ( 2020 ) find current RL algorithms fail to learn in a simple gridworld environment without resets and Lu et al . ( 2019 ) find modelfree RL algorithms struggle to learn and adapt to nonstationarity even with access to the ground truth dynamics model . We can attribute these failures to RL algorithms succumbing to sink states . Intuitively , these are states from which agents struggle to escape , have low rewards , and suggest a catastrophic halting of learning progress ( Lyapunov , 1992 ) . For example , an upright walking agent may fall over and fail to return to a standing position , possibly because of underactuated joints . A less obvious notion of sink state we use is that the agent simply fails to escape from it due to low learning signal , which is almost equally undesirable . A lifelong agent must seek to avoid such disabling sink states , especially in the absence of resets . We introduce Lifelong Skill Planning ( LiSP ) , an algorithmic framework for reset-free , lifelong RL that uses long-horizon , decision-time planning in an abstract space of skills to overcome the above challenges . LiSP employs a synergistic combination of model-free policy networks and model-based planning , wherein we use a policy to execute certain skills , planning directly in the skill space . This combination offers two benefits : ( 1 ) skills constrain the search space to aid the planner in finding solutions to long-horizon problems and ( 2 ) skills mitigate errors in the dynamics model by constraining the distribution of behaviors . We demonstrate that agents learned via LiSP can effectively plan for longer horizons than prior work , enabling better long-term reasoning and adaptation . Another key component of the LiSP framework is the flexibility to learn skills from both online and offline interactions . For online learning , we extend Dynamics-Aware Discovery of Skills ( DADS ) , an algorithm for unsupervised skill discovery ( Sharma et al. , 2019 ) , with a skill-practice proposal distribution and a primitive dynamics model for generating rollouts for training . We demonstrate that the use of this proposal distribution significantly amplifies the signal for learning skills in resetfree settings . For offline learning from logged interactions , we employ a similar approach as above but with a modification of the reward function to correspond to the extent of disagreement amongst the models in a probabilistic ensemble ( Kidambi et al. , 2020 ) . Our key contributions can be summarized as follows : • We identify skills as a key ingredient for overcoming the challenges to achieve effective lifelong RL in reset-free environments . • We propose Lifelong Skill Planning ( LiSP ) , an algorithmic framework for reset-free lifelong RL with two novel components : ( a ) a skill learning module that can learn from both online and offline interactions , and ( b ) a long-horizon , skill-space planning algorithm . • We propose new challenging benchmarks for reset-free , lifelong RL by extending gridworld and MuJoCo OpenAI Gym benchmarks ( Brockman et al. , 2016 ) . We demonstrate the effectiveness of LiSP over prior approaches on these benchmarks in a variety of nonstationary , multi-task settings , involving both online and offline interactions . 2 BACKGROUND . Problem Setup . We represent the lifelong environment as a sequence of Markov decision processes ( MDPs ) . The lifelong MDPM is the concatenation of several MDPs ( Mi , Ti ) , where Ti denotes the length of time for which the dynamics of Mi are activated . Without loss of generality , we assume the sum of the Ti ( i.e. , the total environment time ) is greater than the agent ’ s lifetime . The properties of the MDPMi are defined by the tuple ( S , A , Pi , ri , γ ) , where S is the state space , A is the action space , Pi : S ×A×S → R are the transition dynamics , ri : S ×A → R is the reward function , and γ ∈ [ 0 , 1 ) is the discount factor . Consistent with prior work , we assume ri is always known to the agent specifying the task ; it is also easy to learn for settings where it is not known . We use P and r as shorthand to refer to the currentMi with respect to the agent . The agent is denoted by a policy π : S → A and seeks to maximize its expected return starting from the current state s0 : argmaxπ Est+1∼P , at∼π [ ∑∞ t=0 γ tr ( st , at ) ] . The policy π may be implemented as a parameterized function or an action-generating procedure . We expect the agent to optimize for the currentMi , rather than trying to predict the future dynamics ; e.g. , a robot may be moved to an arbitrary new MDP and expected to perform well , without anticipating this change in advance . Skill Discovery . Traditional single-task RL learns a single parametrized policy πθ ( ·|s ) . For an agent to succeed at multiple tasks , we can increase the flexibility of the agent by introducing a set of latent skills z ∈ [ −1 , 1 ] dim ( z ) and learning a skill conditional policy πθ ( ·|s , z ) . As in standard latent variable modeling , we assume a fixed , simple prior over the skills p ( z ) , e.g. , uniform . The learning objective of the skill policy is to maximize some intrinsic notion of reward . We denote the intrinsic reward as r̃ ( s , z , s′ ) to distinguish it from the task-specific reward defined previously . One such intrinsic reward , proposed in DADS ( Sharma et al. , 2019 ) , can be derived from a variational approximation to the mutual information between the skills and next states I ( s′ ; z|s ) as : r̃ ( s , z , s′ ) = log qν ( s ′|s , z ) 1 L ∑L i=1 qν ( s ′|s , zi ) where zi ∼ p ( z ) . ( 1 ) Here qν ( s′|s , z ) is a tractable variational approximation for the intractable posterior p ( s′|s , z ) . Intuitively , this r̃ learns predictable ( via the numerator ) and distinguishable ( via the denominator ) skills . Due to the mutual information objective , DADS also learns skills with high empowerment , which is useful for constraining the space of options for planning ; we discuss this in Appendix C. Model-Based Planning . Whereas RL methods act in the environment according to a parameterized policy , model-based planning methods learn a dynamics model fφ ( st+1|st , at ) to approximate P and use Model Predictive Control ( MPC ) to generate an action via search over the model ( Nagabandi et al. , 2018b ; Chua et al. , 2018 ) . At every timestep , MPC selects the policy π that maximizes the predicted H-horizon expected return from the current state s0 for a specified reward function r : πMPC = argmax π Eat∼π , st+1∼fφ [ H−1∑ t=0 γtr ( st , at ) ] . ( 2 ) We use Model Path Predictive Integral ( MPPI ) ( Williams et al. , 2015 ) as our optimizer . MPPI is a gradient-free optimization method that : ( 1 ) samples policies according to Gaussian noise on the optimization parameters , ( 2 ) estimates the policy returns , and ( 3 ) reweighs policies according to a Boltzmann distribution on the predicted returns . For more details , see Nagabandi et al . ( 2020 ) . For all dynamics models used in this work , we use a probabilistic ensemble ofN models { fφi } N−1i=0 , where each model predicts the mean and variance of the next state . For MPC planning , the returns are estimated via trajectory sampling ( Chua et al. , 2018 ) , where each policy is evaluated on each individual model for the entire H-length rollout and the returns are averaged . For policy optimization , each transition is generated by sampling from a member of the ensemble uniformly at random . 3 LIFELONG SKILL-SPACE PLANNING . In this section , we present Lifelong Skill Planning ( LiSP ) , our proposed approach for reset-free lifelong RL . We provide an outline of LiSP in Algorithm 1 . The agent initially learns a dynamics model fφ and a skill policy πθ from any available offline data . Thereafter , the agent continuously updates the model and policy based on online interactions in the reset-free lifelong environment . The agent uses skill-space planning to act in the environment and avoid sink states . In particular , LiSP learns the following distributions as neural networks : • A primitive dynamics model fφ used for both planning and policy optimization • A low-level skill policy πθ trained from generated model rollouts on intrinsic rewards • A discriminator qν for learning the intrinsic reward using Sharma et al . ( 2019 ) • A skill-practice distribution pψ to generate a curriculum for training skills 3.1 MODEL-BASED SKILL DISCOVERY . Our goal is to learn a skill-conditioned policy πθ ( a|s , z ) . In order to minimize interactions with the environment , we first learn a model fφ to generate synthetic rollouts for policy training . Since there is no start state distribution , the initialization of these rollouts is an important design choice . Algorithm 1 : Lifelong Skill Planning ( LiSP ) Initialize true replay buffer D , generated replay buffer D̂ , dynamics model ensemble { fφi } N−1i=0 , policy πθ , discriminator qν , and skill-practice distribution pψ if performing offline pretraining then Learn dynamics model fφ and train policy πθ with UpdatePolicy until convergence while agent is alive at current state s do Update dynamics model to maximize the log probability of transitions of D Update policy models with UpdatePolicy ( D , D̂ , fφ , πθ , qν , pψ ) Execute action from GetAction ( s , fφ , πθ ) and add environment transition to D We propose to learn a skill-practice distribution pψ ( z|s ) to define which skills to use at a particular state . pψ acts as a “ teacher ” for πθ , automatically generating a curriculum for skill learning . We include visualizations of the learned skills on 2D gridworld environments in Appendix E.2 . To actually learn the policy , we use the model to generate short rollouts , optimizing πθ with SAC , similar to model-based policy learning works that find long rollouts to destabilize learning due to compounding model errors ( Janner et al. , 2019 ) . To initialize the rollout , we sample a state from the replay buffer D and a skill to practice via pψ . The next state is predicted by the dynamics model fφ , where the model used to make the prediction is uniformly sampled from the ensemble . The transition is added to a generated replay buffer D̂ ; gradients do not propagate through fφ . Given minibatches sampled from D̂ , both πθ and pψ are independently trained using SAC to optimize the intrinsic reward r̃adjusted . Intuitively pψ only selects skills which are most useful from the current state , instead of arbitrary skills . This is summarized in Algorithm 2 . Algorithm 2 : Learning Latent Skills Hyperparameters : number of rollouts M , disagreement threshold αthres Function UpdatePolicy ( replay buffer D , generated replay buffer D̂ , dynamics model fφ , policy πθ , discriminator qν , skill-practice distribution pψ ) : for i = 1 to M do Sample si0 uniformly from D and latent zi from skill-practice pψ ( ·|si0 ) Generate si1 : = fφ ( ·|si0 , πθ ( ·|si0 , zi ) ) and add transition ( si0 , ai , zi , si1 ) to D̂ Update discriminator qν on { si0 , ai , zi , si1 } Mi=1 to maximize log qν ( s1|s0 , z ) Calculate intrinsic rewards r̃adjusted for D̂ with qν , αthres using Equations 1 and 3 Update πθ , qν , pψ using SAC with minibatches from D̂
This paper presents a lifelong reinforcement learning framework in a non-stationary environment with non-episodic interactions. The proposed approach is to 1) learn "skills" - a world model - to maximize the intrinsic rewards using both online and offline data, and to 2) make best plans based on the learned world model. This approach is evaluated with Hopper and Ant tasks.
SP:6cad092c66273cdb0065834ee4459f1b76f8929d
On Learning Universal Representations Across Languages
1 INTRODUCTION . Pre-trained models ( PTMs ) like ELMo ( Peters et al. , 2018 ) , GPT ( Radford et al. , 2018 ) and BERT ( Devlin et al. , 2019 ) have shown remarkable success of effectively transferring knowledge learned from large-scale unlabeled data to downstream NLP tasks , such as text classification ( Socher et al. , 2013 ) and natural language inference ( Bowman et al. , 2015 ; Williams et al. , 2018 ) , with limited or no training data . To extend such pretraining-finetuning paradigm to multiple languages , some endeavors such as multilingual BERT ( Devlin et al. , 2019 ) and XLM ( Conneau & Lample , 2019 ) have been made for learning cross-lingual representation . More recently , Conneau et al . ( 2020 ) present XLM-R to study the effects of training unsupervised cross-lingual representations at a huge scale and demonstrate promising progress on cross-lingual tasks . However , all of these studies only perform a masked language model ( MLM ) with token-level ( i.e. , subword ) cross entropy , which limits PTMs to capture the co-occurrence among tokens and consequently fail to understand the whole sentence . It leads to two major shortcomings for current cross-lingual PTMs , i.e. , the acquisition of sentence-level representations and semantic alignments among parallel sentences in different languages . Considering the former , Devlin et al . ( 2019 ) introduced the next sentence prediction ( NSP ) task to distinguish whether two input sentences are continuous segments from the training corpus . However , this simple binary classification task is not enough to model sentence-level representations ( Joshi et al. , 2020 ; Yang et al. , 2019 ; Liu et al. , 2019 ; Lan et al. , 2020 ; Conneau et al. , 2020 ) . For the latter , ( Huang et al. , 2019 ) defined the cross-lingual paraphrase classification task , which concatenates two sentences from different languages as input ∗Work done at Alibaba Group . Yue Hu and Heng Yu are the co-corresponding authors . We also made an official submission to XTREME ( https : //sites.research.google/xtreme ) , with several improved techniques used in ( Fang et al. , 2020 ; Luo et al. , 2020 ) . and classifies whether they are with the same meaning . This task learns patterns of sentence-pairs well but fails to distinguish the exact meaning of each sentence . In response to these problems , we propose to strengthen PTMs through learning universal representations among semantically-equivalent sentences distributed in different languages . We introduce a novel Hierarchical Contrastive Learning ( HICTL ) framework to learn language invariant sentence representations via self-supervised non-parametric instance discrimination . Specifically , we use a BERT-style model to encode two sentences separately , and the representation of the first token ( e.g. , [ CLS ] in BERT ) will be treated as the sentence representation . Then , we conduct instance-wise comparison at both sentence-level and word-level , which are complementary to each other . At the sentence level , we maximize the similarity between two parallel sentences while minimizing which among non-parallel ones . At the word-level , we maintain a bag-of-words for each sentence-pair , each word in which is considered as a positive sample while the rest words in vocabulary are negative ones . To reduce the space of negative samples , we conduct negative sampling for word-level contrastive learning . With the HICTL framework , the PTMs are encouraged to learn language-agnostic representation , thereby bridging the semantic discrepancy among cross-lingual sentences . The HICTL is conducted on the basis of XLM-R ( Conneau et al. , 2020 ) and experiments are performed on several challenging cross-lingual tasks : language understanding tasks ( e.g. , XNLI , XQuAD , and MLQA ) in the XTREME ( Hu et al. , 2020 ) benchmark , and machine translation in the IWSLT and WMT benchmarks . Extensive empirical evidence demonstrates that our approach can achieve consistent improvements over baselines on various tasks of both cross-lingual language understanding and generation . In more detail , our HICTL obtains absolute gains of 4.2 % ( up to 6.0 % on zero-shot sentence retrieval tasks , e.g . BUCC and Tatoeba ) accuracy on XTREME over XLM-R. For machine translation , our HICTL achieves substantial improvements over baselines on both low-resource ( IWSLT English→X ) and high-resource ( WMT English→X ) translation tasks . 2 RELATED WORK . Pre-trained Language Models . Recently , substantial work has shown that pre-trained models ( PTMs ) ( Peters et al. , 2018 ; Radford et al. , 2018 ; Devlin et al. , 2019 ) on the large corpus are beneficial for downstream NLP tasks . The application scheme is to fine-tune the pre-trained model using the limited labeled data of specific target tasks . For cross-lingual pre-training , both Devlin et al . ( 2019 ) and Conneau & Lample ( 2019 ) trained a transformer-based model on multilingual Wikipedia which covers various languages , while XLM-R ( Conneau et al. , 2020 ) studied the effects of training unsupervised cross-lingual representations on a very large scale . For sequence-to-sequence pre-training , UniLM ( Dong et al. , 2019 ) fine-tuned BERT with an ensemble of masks , which employs a shared Transformer network and utilizing specific self-attention mask to control what context the prediction conditions on . Song et al . ( 2019 ) extended BERT-style models by jointly training the encoder-decoder framework . XLNet ( Yang et al. , 2019 ) trained by predicting masked tokens auto-regressively in a permuted order , which allows predictions to condition on both left and right context . Raffel et al . ( 2019 ) unified every NLP problem as a text-to-text problem and pre-trained a denoising sequence-to-sequence model at scale . Concurrently , BART ( Lewis et al. , 2020 ) pre-trained a denoising sequence-to-sequence model , in which spans are masked from the input but the complete output is auto-regressively predicted . Previous works have explored using pre-trained models to improve text generation , such as pretraining both the encoder and decoder on several languages ( Song et al. , 2019 ; Conneau & Lample , 2019 ; Raffel et al. , 2019 ) or using pre-trained models to initialize encoders ( Edunov et al. , 2019 ; Zhang et al. , 2019a ; Guo et al. , 2020 ) . Zhu et al . ( 2020 ) and Weng et al . ( 2020 ) proposed a BERTfused NMT model , in which the representations from BERT are treated as context and fed into all layers of both the encoder and decoder . Zhong et al . ( 2020 ) formulated the extractive summarization task as a semantic text matching problem and proposed a Siamese-BERT architecture to compute the similarity between the source document and the candidate summary , which leverages the pre-trained BERT in a Siamese network structure . Our approach also belongs to the contextual pre-training so it could be applied to various downstream NLU and NLG tasks . Contrastive Learning . Contrastive learning ( CTL ) ( Saunshi et al. , 2019 ) aims at maximizing the similarity between the encoded query q and its matched key k+ while keeping randomly sampled keys { k−0 , k − 1 , k − 2 , ... } faraway from it . With similarity measured by a score function s ( q , k ) , a form of a contrastive loss function , called InfoNCE ( Oord et al. , 2018 ) , is considered in this paper : Lctl = − log exp ( s ( q , k+ ) ) exp ( s ( q , k+ ) ) + ∑ i exp ( s ( q , k − i ) ) , ( 1 ) where the score function s ( q , k ) is essentially implemented as the cosine similarity q T k ‖q‖·‖k‖ . q and k are often encoded by a learnable neural encoder , such as BERT ( Devlin et al. , 2019 ) or ResNet ( He et al. , 2016 ) . k+ and k− are typically called positive and negative samples . In addition to the form illustrated in Eq . ( 1 ) , contrastive losses can also be based on other forms , such as margin-based loses ( Hadsell et al. , 2006 ) and variants of NCE losses ( Mnih & Kavukcuoglu , 2013 ) . Contrastive learning is at the core of several recent work on unsupervised or self-supervised learning from computer vision ( Wu et al. , 2018 ; Oord et al. , 2018 ; Ye et al. , 2019 ; He et al. , 2019 ; Chen et al. , 2020 ; Tian et al. , 2020 ) to natural language processing ( Mikolov et al. , 2013 ; Mnih & Kavukcuoglu , 2013 ; Devlin et al. , 2019 ; Clark et al. , 2020b ; Feng et al. , 2020 ; Chi et al. , 2020 ) . Kong et al . ( 2020 ) improved language representation learning by maximizing the mutual information between a masked sentence representation and local n-gram spans . Clark et al . ( 2020b ) utilized a discriminator to predict whether a token is replaced by a generator given its surrounding context . Iter et al . ( 2020 ) proposed to pre-train language models with contrastive sentence objectives that predict the surrounding sentences given an anchor sentence . In this paper , we propose HICTL to encourage parallel cross-lingual sentences to have the identical semantic representation and distinguish whether a word is contained in them as well , which can naturally improve the capability of cross-lingual understanding and generation for PTMs . 3 METHODOLOGY . 3.1 HIERARCHICAL CONTRASTIVE LEARNING . We propose hierarchical contrastive learning ( HICTL ) , a novel comparison learning framework that unifies cross-lingual sentences as well as related words . HICTL can learn from both non-parallel and parallel multilingual data , and the overall architecture of HICTL is illustrated in Figure 1 . We represent a training batch of the original sentences as x = { x1 , x2 , ... , xn } and its aligned counterpart is denoted as y = { y1 , y2 , ... , yn } , where n is the batch size . For each pair 〈xi , yi〉 , yi is either the translation in the other language of xi when using parallel data or the perturbation through reordering tokens in xi when only monolingual data is available.x\i is denoted as a modified version of x where the i-th instance is removed . Sentence-Level CTL . As illustrated in Figure 1a , we apply the XLM-R as the encoder to represent sentences into hidden representations . The first token of every sequence is always a special token ( e.g. , [ CLS ] ) , and the final hidden state corresponding to this token is used as the aggregate sentence representation for pre-training , that is , rx = f ◦ g ( M ( x ) ) where g ( · ) is the aggregate function and f ( · ) is a linear projection , ◦ denotes the composition of operations . To obtain universal representation among semantically-equivalent sentences , we encourage rxi ( the query , denoted as q ) to be as similar as possible to ryi ( the positive sample , denoted as k + ) but dissimilar to all other instances ( i.e. , y\i ∪ x\i , considered as a series of negative samples , denoted as { k−1 , k − 2 , ... , k − 2n−2 } ) in a training batch . Formally , the sentence-level contrastive loss for xi is defined as Lsctl ( xi ) = − log exp ◦s ( q , k+ ) exp ◦s ( q , k+ ) + ∑|y\i∪x\i| j=1 exp ◦s ( q , k − j ) . ( 2 ) Symmetrically , we also expect ryi ( the query , denoted as q̃ ) to be as similar as possible to rxi ( the positive sample , denoted as k̃+ ) but dissimilar to all other instances in the same training batch , thus , Lsctl ( yi ) = − log exp ◦s ( q̃ , k̃+ ) exp ◦s ( q̃ , k̃+ ) + ∑|y\i∪x\i| j=1 exp ◦s ( q̃ , k̃ − j ) . ( 3 ) The sentence-level contrastive loss over the training batch can be formulated as LS = 1 2n n∑ i=1 { Lsctl ( xi ) + Lsctl ( yi ) } . ( 4 ) For sentence-level contrastive learning , we treat other instances contained in the training batch as negative samples for the current instance . However , such randomly selected negative samples are often uninformative , which poses a challenge of distinguishing very similar but nonequivalent samples . To address this issue , we employ smoothed linear interpolation ( Bowman et al. , 2016 ; Zheng et al. , 2019 ) between sentences in the embedding space to alleviate the lack of informative samples for pre-training , as shown in Figure 2 . Given a training batch { 〈xi , yi〉 } ni=1 , where n is the batch size . In this context , having obtained the embeddings of a triplet , an anchor q and a positive k+ as well as a negative k− ( supposing q , k+ and k− are representations of sentences xi , yi and y−i ∈ x\i ∪ y\i , respectively ) , we construct a harder negative sample k̂− to replace k − j : k̂− = { q + λ ( k− − q ) , λ ∈ ( d + d− , 1 ] if d − > d+ ; k− if d− ≤ d+ . ( 5 ) where d+ =‖ k+− q ‖2 and d− =‖ k−− q ‖2 . For the first condition , the hardness of k̂− increases when λ becomes smaller . To this end , we intuitively set λ as λ = ( d+ d− ) ζ·p+avg , ζ ∈ ( 0 , 1 ) ( 6 ) where p+avg = 1 100 ∑ ∈ [ −100 , −1 ] e −L ( ) S is the average log-probability over the last 100 training batches and LS formulated in Eq . ( 4 ) is the sentence-level contrastive loss of one training batch . During pre-training , when the model tends to distinguish positive samples easily , which means negative samples are not informative already . At this time , p+avg ↑ and d + d− ↓ , which leads λ ↓ and harder negative samples are adaptively synthesized in the following training steps , vice versa . As hard negative samples usually result in significant changes of the model parameters , we introduce the slack coefficient ζ to prevent the model from being trained in the wrong direction , when it accidentally switch from random negative samples to very hard ones . In practice , we empirically set ζ = 0.9 . Word-Level CTL . Intuitively , predicting the related words in other languages for each sentence can bridge the representations of words in different languages . As shown in Figure 1b , we concatenate the sentence pair 〈xi , yi〉 as xi ◦ yi : [ CLS ] xi [ SEP ] yi [ SEP ] and the bag-of-words of which is denoted as B . For word-level contrastive learning , the final state of the first token is treated as the query ( q̄ ) , each word wt ∈ B is considered as the positive sample and all the other words ( V\B , i.e. , the words in V that are not in B where V indicates the overall vocabulary of all languages ) are negative samples . As the vocabulary usually with large space , we propose to only use a subset S ⊂ V\B sampled according to the normalized similarities between q̄ and the embeddings of the words . As a result , the subset S naturally contains the hard negative samples which are beneficial for learning high-quality representations ( Ye et al. , 2019 ) . Specifically , the word-level contrastive loss for 〈xi , yi〉 is defined as Lwctl ( xi , yi ) = − 1 |B| |B|∑ t=1 log exp ◦s ( q̄ , e ( wt ) ) exp ◦s ( q̄ , e ( wt ) ) + ∑ wj∈S exp ◦s ( q̄ , e ( wj ) ) . ( 7 ) where e ( · ) is the embedding lookup function and |B| is the number of unique words in the concatenated sequence xi ◦ yi . The overall word-level contrastive loss can be formulated as : LW = 1 n n∑ i=1 Lwctl ( xi , yi ) . ( 8 ) Multi-Task Pre-training . Both MLM and translation language model ( TLM ) are combined with HICTL by default , as the prior work ( Conneau & Lample , 2019 ) has verified the effectiveness of them in XLM . In summary , the model can be optimized by minimizing the entire training loss : L = LLM + LS + LW , ( 9 ) where LLM is implemented as either the TLM when using parallel data or the MLM when only monolingual data is available to recover the original words of masked positions given the contexts .
The work applies and adjusts contrastive learning in the subject area of pre-training language models. The work first identifies the challenges with the current landscape of Masked Language Models with limits to learning sentence-level representations and semantic alignments in sentences of different languages. To take care of these gaps, the authors propose using HCTL as an approach that can learn more universal representations for sentences across different languages. The work builds on top of the BERT models, with the adjusted contrastive learning objective goal.
SP:a17218a21d8f69f2848a248c8658df81c8a68924
On Learning Universal Representations Across Languages
1 INTRODUCTION . Pre-trained models ( PTMs ) like ELMo ( Peters et al. , 2018 ) , GPT ( Radford et al. , 2018 ) and BERT ( Devlin et al. , 2019 ) have shown remarkable success of effectively transferring knowledge learned from large-scale unlabeled data to downstream NLP tasks , such as text classification ( Socher et al. , 2013 ) and natural language inference ( Bowman et al. , 2015 ; Williams et al. , 2018 ) , with limited or no training data . To extend such pretraining-finetuning paradigm to multiple languages , some endeavors such as multilingual BERT ( Devlin et al. , 2019 ) and XLM ( Conneau & Lample , 2019 ) have been made for learning cross-lingual representation . More recently , Conneau et al . ( 2020 ) present XLM-R to study the effects of training unsupervised cross-lingual representations at a huge scale and demonstrate promising progress on cross-lingual tasks . However , all of these studies only perform a masked language model ( MLM ) with token-level ( i.e. , subword ) cross entropy , which limits PTMs to capture the co-occurrence among tokens and consequently fail to understand the whole sentence . It leads to two major shortcomings for current cross-lingual PTMs , i.e. , the acquisition of sentence-level representations and semantic alignments among parallel sentences in different languages . Considering the former , Devlin et al . ( 2019 ) introduced the next sentence prediction ( NSP ) task to distinguish whether two input sentences are continuous segments from the training corpus . However , this simple binary classification task is not enough to model sentence-level representations ( Joshi et al. , 2020 ; Yang et al. , 2019 ; Liu et al. , 2019 ; Lan et al. , 2020 ; Conneau et al. , 2020 ) . For the latter , ( Huang et al. , 2019 ) defined the cross-lingual paraphrase classification task , which concatenates two sentences from different languages as input ∗Work done at Alibaba Group . Yue Hu and Heng Yu are the co-corresponding authors . We also made an official submission to XTREME ( https : //sites.research.google/xtreme ) , with several improved techniques used in ( Fang et al. , 2020 ; Luo et al. , 2020 ) . and classifies whether they are with the same meaning . This task learns patterns of sentence-pairs well but fails to distinguish the exact meaning of each sentence . In response to these problems , we propose to strengthen PTMs through learning universal representations among semantically-equivalent sentences distributed in different languages . We introduce a novel Hierarchical Contrastive Learning ( HICTL ) framework to learn language invariant sentence representations via self-supervised non-parametric instance discrimination . Specifically , we use a BERT-style model to encode two sentences separately , and the representation of the first token ( e.g. , [ CLS ] in BERT ) will be treated as the sentence representation . Then , we conduct instance-wise comparison at both sentence-level and word-level , which are complementary to each other . At the sentence level , we maximize the similarity between two parallel sentences while minimizing which among non-parallel ones . At the word-level , we maintain a bag-of-words for each sentence-pair , each word in which is considered as a positive sample while the rest words in vocabulary are negative ones . To reduce the space of negative samples , we conduct negative sampling for word-level contrastive learning . With the HICTL framework , the PTMs are encouraged to learn language-agnostic representation , thereby bridging the semantic discrepancy among cross-lingual sentences . The HICTL is conducted on the basis of XLM-R ( Conneau et al. , 2020 ) and experiments are performed on several challenging cross-lingual tasks : language understanding tasks ( e.g. , XNLI , XQuAD , and MLQA ) in the XTREME ( Hu et al. , 2020 ) benchmark , and machine translation in the IWSLT and WMT benchmarks . Extensive empirical evidence demonstrates that our approach can achieve consistent improvements over baselines on various tasks of both cross-lingual language understanding and generation . In more detail , our HICTL obtains absolute gains of 4.2 % ( up to 6.0 % on zero-shot sentence retrieval tasks , e.g . BUCC and Tatoeba ) accuracy on XTREME over XLM-R. For machine translation , our HICTL achieves substantial improvements over baselines on both low-resource ( IWSLT English→X ) and high-resource ( WMT English→X ) translation tasks . 2 RELATED WORK . Pre-trained Language Models . Recently , substantial work has shown that pre-trained models ( PTMs ) ( Peters et al. , 2018 ; Radford et al. , 2018 ; Devlin et al. , 2019 ) on the large corpus are beneficial for downstream NLP tasks . The application scheme is to fine-tune the pre-trained model using the limited labeled data of specific target tasks . For cross-lingual pre-training , both Devlin et al . ( 2019 ) and Conneau & Lample ( 2019 ) trained a transformer-based model on multilingual Wikipedia which covers various languages , while XLM-R ( Conneau et al. , 2020 ) studied the effects of training unsupervised cross-lingual representations on a very large scale . For sequence-to-sequence pre-training , UniLM ( Dong et al. , 2019 ) fine-tuned BERT with an ensemble of masks , which employs a shared Transformer network and utilizing specific self-attention mask to control what context the prediction conditions on . Song et al . ( 2019 ) extended BERT-style models by jointly training the encoder-decoder framework . XLNet ( Yang et al. , 2019 ) trained by predicting masked tokens auto-regressively in a permuted order , which allows predictions to condition on both left and right context . Raffel et al . ( 2019 ) unified every NLP problem as a text-to-text problem and pre-trained a denoising sequence-to-sequence model at scale . Concurrently , BART ( Lewis et al. , 2020 ) pre-trained a denoising sequence-to-sequence model , in which spans are masked from the input but the complete output is auto-regressively predicted . Previous works have explored using pre-trained models to improve text generation , such as pretraining both the encoder and decoder on several languages ( Song et al. , 2019 ; Conneau & Lample , 2019 ; Raffel et al. , 2019 ) or using pre-trained models to initialize encoders ( Edunov et al. , 2019 ; Zhang et al. , 2019a ; Guo et al. , 2020 ) . Zhu et al . ( 2020 ) and Weng et al . ( 2020 ) proposed a BERTfused NMT model , in which the representations from BERT are treated as context and fed into all layers of both the encoder and decoder . Zhong et al . ( 2020 ) formulated the extractive summarization task as a semantic text matching problem and proposed a Siamese-BERT architecture to compute the similarity between the source document and the candidate summary , which leverages the pre-trained BERT in a Siamese network structure . Our approach also belongs to the contextual pre-training so it could be applied to various downstream NLU and NLG tasks . Contrastive Learning . Contrastive learning ( CTL ) ( Saunshi et al. , 2019 ) aims at maximizing the similarity between the encoded query q and its matched key k+ while keeping randomly sampled keys { k−0 , k − 1 , k − 2 , ... } faraway from it . With similarity measured by a score function s ( q , k ) , a form of a contrastive loss function , called InfoNCE ( Oord et al. , 2018 ) , is considered in this paper : Lctl = − log exp ( s ( q , k+ ) ) exp ( s ( q , k+ ) ) + ∑ i exp ( s ( q , k − i ) ) , ( 1 ) where the score function s ( q , k ) is essentially implemented as the cosine similarity q T k ‖q‖·‖k‖ . q and k are often encoded by a learnable neural encoder , such as BERT ( Devlin et al. , 2019 ) or ResNet ( He et al. , 2016 ) . k+ and k− are typically called positive and negative samples . In addition to the form illustrated in Eq . ( 1 ) , contrastive losses can also be based on other forms , such as margin-based loses ( Hadsell et al. , 2006 ) and variants of NCE losses ( Mnih & Kavukcuoglu , 2013 ) . Contrastive learning is at the core of several recent work on unsupervised or self-supervised learning from computer vision ( Wu et al. , 2018 ; Oord et al. , 2018 ; Ye et al. , 2019 ; He et al. , 2019 ; Chen et al. , 2020 ; Tian et al. , 2020 ) to natural language processing ( Mikolov et al. , 2013 ; Mnih & Kavukcuoglu , 2013 ; Devlin et al. , 2019 ; Clark et al. , 2020b ; Feng et al. , 2020 ; Chi et al. , 2020 ) . Kong et al . ( 2020 ) improved language representation learning by maximizing the mutual information between a masked sentence representation and local n-gram spans . Clark et al . ( 2020b ) utilized a discriminator to predict whether a token is replaced by a generator given its surrounding context . Iter et al . ( 2020 ) proposed to pre-train language models with contrastive sentence objectives that predict the surrounding sentences given an anchor sentence . In this paper , we propose HICTL to encourage parallel cross-lingual sentences to have the identical semantic representation and distinguish whether a word is contained in them as well , which can naturally improve the capability of cross-lingual understanding and generation for PTMs . 3 METHODOLOGY . 3.1 HIERARCHICAL CONTRASTIVE LEARNING . We propose hierarchical contrastive learning ( HICTL ) , a novel comparison learning framework that unifies cross-lingual sentences as well as related words . HICTL can learn from both non-parallel and parallel multilingual data , and the overall architecture of HICTL is illustrated in Figure 1 . We represent a training batch of the original sentences as x = { x1 , x2 , ... , xn } and its aligned counterpart is denoted as y = { y1 , y2 , ... , yn } , where n is the batch size . For each pair 〈xi , yi〉 , yi is either the translation in the other language of xi when using parallel data or the perturbation through reordering tokens in xi when only monolingual data is available.x\i is denoted as a modified version of x where the i-th instance is removed . Sentence-Level CTL . As illustrated in Figure 1a , we apply the XLM-R as the encoder to represent sentences into hidden representations . The first token of every sequence is always a special token ( e.g. , [ CLS ] ) , and the final hidden state corresponding to this token is used as the aggregate sentence representation for pre-training , that is , rx = f ◦ g ( M ( x ) ) where g ( · ) is the aggregate function and f ( · ) is a linear projection , ◦ denotes the composition of operations . To obtain universal representation among semantically-equivalent sentences , we encourage rxi ( the query , denoted as q ) to be as similar as possible to ryi ( the positive sample , denoted as k + ) but dissimilar to all other instances ( i.e. , y\i ∪ x\i , considered as a series of negative samples , denoted as { k−1 , k − 2 , ... , k − 2n−2 } ) in a training batch . Formally , the sentence-level contrastive loss for xi is defined as Lsctl ( xi ) = − log exp ◦s ( q , k+ ) exp ◦s ( q , k+ ) + ∑|y\i∪x\i| j=1 exp ◦s ( q , k − j ) . ( 2 ) Symmetrically , we also expect ryi ( the query , denoted as q̃ ) to be as similar as possible to rxi ( the positive sample , denoted as k̃+ ) but dissimilar to all other instances in the same training batch , thus , Lsctl ( yi ) = − log exp ◦s ( q̃ , k̃+ ) exp ◦s ( q̃ , k̃+ ) + ∑|y\i∪x\i| j=1 exp ◦s ( q̃ , k̃ − j ) . ( 3 ) The sentence-level contrastive loss over the training batch can be formulated as LS = 1 2n n∑ i=1 { Lsctl ( xi ) + Lsctl ( yi ) } . ( 4 ) For sentence-level contrastive learning , we treat other instances contained in the training batch as negative samples for the current instance . However , such randomly selected negative samples are often uninformative , which poses a challenge of distinguishing very similar but nonequivalent samples . To address this issue , we employ smoothed linear interpolation ( Bowman et al. , 2016 ; Zheng et al. , 2019 ) between sentences in the embedding space to alleviate the lack of informative samples for pre-training , as shown in Figure 2 . Given a training batch { 〈xi , yi〉 } ni=1 , where n is the batch size . In this context , having obtained the embeddings of a triplet , an anchor q and a positive k+ as well as a negative k− ( supposing q , k+ and k− are representations of sentences xi , yi and y−i ∈ x\i ∪ y\i , respectively ) , we construct a harder negative sample k̂− to replace k − j : k̂− = { q + λ ( k− − q ) , λ ∈ ( d + d− , 1 ] if d − > d+ ; k− if d− ≤ d+ . ( 5 ) where d+ =‖ k+− q ‖2 and d− =‖ k−− q ‖2 . For the first condition , the hardness of k̂− increases when λ becomes smaller . To this end , we intuitively set λ as λ = ( d+ d− ) ζ·p+avg , ζ ∈ ( 0 , 1 ) ( 6 ) where p+avg = 1 100 ∑ ∈ [ −100 , −1 ] e −L ( ) S is the average log-probability over the last 100 training batches and LS formulated in Eq . ( 4 ) is the sentence-level contrastive loss of one training batch . During pre-training , when the model tends to distinguish positive samples easily , which means negative samples are not informative already . At this time , p+avg ↑ and d + d− ↓ , which leads λ ↓ and harder negative samples are adaptively synthesized in the following training steps , vice versa . As hard negative samples usually result in significant changes of the model parameters , we introduce the slack coefficient ζ to prevent the model from being trained in the wrong direction , when it accidentally switch from random negative samples to very hard ones . In practice , we empirically set ζ = 0.9 . Word-Level CTL . Intuitively , predicting the related words in other languages for each sentence can bridge the representations of words in different languages . As shown in Figure 1b , we concatenate the sentence pair 〈xi , yi〉 as xi ◦ yi : [ CLS ] xi [ SEP ] yi [ SEP ] and the bag-of-words of which is denoted as B . For word-level contrastive learning , the final state of the first token is treated as the query ( q̄ ) , each word wt ∈ B is considered as the positive sample and all the other words ( V\B , i.e. , the words in V that are not in B where V indicates the overall vocabulary of all languages ) are negative samples . As the vocabulary usually with large space , we propose to only use a subset S ⊂ V\B sampled according to the normalized similarities between q̄ and the embeddings of the words . As a result , the subset S naturally contains the hard negative samples which are beneficial for learning high-quality representations ( Ye et al. , 2019 ) . Specifically , the word-level contrastive loss for 〈xi , yi〉 is defined as Lwctl ( xi , yi ) = − 1 |B| |B|∑ t=1 log exp ◦s ( q̄ , e ( wt ) ) exp ◦s ( q̄ , e ( wt ) ) + ∑ wj∈S exp ◦s ( q̄ , e ( wj ) ) . ( 7 ) where e ( · ) is the embedding lookup function and |B| is the number of unique words in the concatenated sequence xi ◦ yi . The overall word-level contrastive loss can be formulated as : LW = 1 n n∑ i=1 Lwctl ( xi , yi ) . ( 8 ) Multi-Task Pre-training . Both MLM and translation language model ( TLM ) are combined with HICTL by default , as the prior work ( Conneau & Lample , 2019 ) has verified the effectiveness of them in XLM . In summary , the model can be optimized by minimizing the entire training loss : L = LLM + LS + LW , ( 9 ) where LLM is implemented as either the TLM when using parallel data or the MLM when only monolingual data is available to recover the original words of masked positions given the contexts .
The paper proposes a pre-trained language model variant which extends XLM-R (multilingual masked model) with two new objectives. The main difference to most other models is that the new losses are contrastive losses (however, as pointed out by the authors, other contrastive losses had been used before in e.g. ELECTRA). The first additional loss is a sentence-level one - where a [CLS] token is trained to be close to the positive sample, the paired sentence, with other sentences as negative samples. The same is done at word level, where the bag of words constructed from two sentences becomes the set of positive samples and other vocabulary words are negative samples.
SP:a17218a21d8f69f2848a248c8658df81c8a68924
Diversity Actor-Critic: Sample-Aware Entropy Regularization for Sample-Efficient Exploration
Policy entropy regularization is commonly used for better exploration in deep reinforcement learning ( RL ) . However , policy entropy regularization is sampleinefficient in off-policy learning since it does not take the distribution of previous samples stored in the replay buffer into account . In order to take advantage of the previous sample distribution from the replay buffer for sample-efficient exploration , we propose sample-aware entropy regularization which maximizes the entropy of weighted sum of the policy action distribution and the sample action distribution from the replay buffer . We formulate the problem of sample-aware entropy regularized policy iteration , prove its convergence , and provide a practical algorithm named diversity actor-critic ( DAC ) which is a generalization of soft actor-critic ( SAC ) . Numerical results show that DAC significantly outperforms SAC baselines and other state-of-the-art RL algorithms . 1 INTRODUCTION . Reinforcement learning ( RL ) aims to maximize the expectation of the discounted reward sum under Markov decision process ( MDP ) environments ( Sutton & Barto , 1998 ) . When the given task is complex , i.e . the environment has high action-dimensions or sparse rewards , it is important to well explore state-action pairs for high performance ( Agre & Rosenschein , 1996 ) . For better exploration , recent RL considers various methods : maximizing the policy entropy to take actions more uniformly ( Ziebart et al. , 2008 ; Fox et al. , 2015 ; Haarnoja et al. , 2017 ) , maximizing diversity gain that yields intrinsic rewards to explore rare states by counting the number of visiting states ( Strehl & Littman , 2008 ; Lopes et al. , 2012 ) , maximizing information gain ( Houthooft et al. , 2016 ; Hong et al. , 2018 ) , maximizing model prediction error ( Achiam & Sastry , 2017 ; Pathak et al. , 2017 ) , and so on . In particular , based on policy iteration for soft Q-learning , ( Haarnoja et al. , 2018a ) considered an offpolicy actor-critic framework for maximum entropy RL and proposed the soft actor-critic ( SAC ) algorithm , which has competitive performance for challenging continuous control tasks . In this paper , we reconsider the problem of policy entropy regularization in off-policy learning and propose a generalized approach to policy entropy regularization . In off-policy learning , we store and reuse old samples to update the current policy ( Mnih et al. , 2015 ) , and it is preferable that the old sample distribution in the replay buffer is uniformly distributed for better performance . However , the simple policy entropy regularization tries to maximize the entropy of the current policy irrespective of the distribution of previous samples . Since the uniform distribution has maximum entropy , the current policy will choose previously less-sampled actions and more-sampled actions with the same probability and hence the simple policy entropy regularization is sample-unaware and sample-inefficient . In order to overcome this drawback , we propose sample-aware entropy regularization , which tries to maximize the weighted sum of the current policy action distribution and the sample action distribution from the replay buffer . We will show that the proposed sampleaware entropy regularization reduces to maximizing the sum of the policy entropy and the α-skewed Jensen-Shannon divergence ( Nielsen , 2019 ) between the policy distribution and the buffer sample action distribution , and hence it generalizes SAC . We will also show that properly exploiting the sample action distribution in addition to the policy entropy over learning phases will yield far better performance . 2 RELATED WORKS . Entropy regularization : Entropy regularization maximizes the sum of the expected return and the policy action entropy . It encourages the agent to visit the action space uniformly for each given state , and the regularized policy is robust to modeling error ( Ziebart , 2010 ) . Entropy regularization is considered in various domains for better optimization : inverse reinforcement learning ( Ziebart et al. , 2008 ) , stochastic optimal control problems ( Todorov , 2008 ; Toussaint , 2009 ; Rawlik et al. , 2013 ) , and off-policy reinforcement learning ( Fox et al. , 2015 ; Haarnoja et al. , 2017 ) . ( Lee et al. , 2019 ) shows that Tsallis entropy regularization that generalizes usual Shannon-entropy regularization is helpful . ( Nachum et al. , 2017a ) shows that there exists a connection between value-based and policybased RL under entropy regularization . ( O ’ Donoghue et al. , 2016 ) proposed an algorithm combining them , and it is proven that they are equivalent ( Schulman et al. , 2017a ) . The entropy of state mixture distribution is better for pure exploration than a simple random policy ( Hazan et al. , 2019 ) . Diversity gain : Diversity gain is used to provide a guidance for exploration to the agent . To achieve diversity gain , many intrinsically-motivated approaches and intrinsic reward design methods have been considered , e.g. , intrinsic reward based on curiosity ( Chentanez et al. , 2005 ; Baldassarre & Mirolli , 2013 ) , model prediction error ( Achiam & Sastry , 2017 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , divergence/information gain ( Houthooft et al. , 2016 ; Hong et al. , 2018 ) , counting ( Strehl & Littman , 2008 ; Lopes et al. , 2012 ; Tang et al. , 2017 ; Martin et al. , 2017 ) , and unification of them ( Bellemare et al. , 2016 ) . For self-imitation learning , ( Gangwani et al. , 2018 ) considered the Steinvariational gradient decent with the Jensen-Shannon kennel . Off-policy learning : Off-policy learning can reuse any samples generated from behaviour policies for the policy update ( Sutton & Barto , 1998 ; Degris et al. , 2012 ) , so it is sample-efficient as compared to on-policy learning . In order to reuse old samples , a replay buffer that stores trajectories generated by previous policies is used for Q-learning ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018a ) . To enhance both stability and sample-efficiency , several methods are considered , e.g. , combining on-policy and off-policy ( Wang et al. , 2016 ; Gu et al. , 2016 ; 2017 ) , and generalization from on-policy to off-policy ( Nachum et al. , 2017b ; Han & Sung , 2019 ) . In order to guarantee the convergence of Q-learning , there is a key assumption : Each state-action pair must be visited infinitely often ( Watkins & Dayan , 1992 ) . If the policy does not visit diverse state-action pairs many times , it converges to local optima . Therefore , exploration for visiting different state-action pairs is important for RL , and the original policy entropy regularization encourages exploration ( Ahmed et al. , 2019 ) . However , we found that the simple policy entropy regularization can be sample-inefficient in off-policy RL , so we aim to propose a new entropy regularization method that significantly enhances the sample-efficiency for exploration by considering the previous sample distribution in the buffer . 3 BACKGROUND . In this section , we briefly introduce the basic setup and the soft actor-critic ( SAC ) algorithm . 3.1 SETUP . We assume a basic RL setup composed of an environment and an agent . The environment follows an infinite horizon Markov decision process ( S , A , P , γ , r ) , where S is the state space , A is the action space , P is the transition probability , γ is the discount factor , and r : S × A → R is the reward function . In this paper , we consider a continuous state-action space . The agent has a policy distribution π : S × A → [ 0 , ∞ ) which selects an action at for a given state st at each time step t , and the agent interacts with the environment and receives reward rt : = r ( st , at ) from the environment . Standard RL aims to maximize the discounted return Es0∼p0 , τ0∼π [ ∑∞ t=0 γ trt ] , where τt = ( st , at , st+1 , at+1 · · · ) is an episode trajectory . 3.2 SOFT ACTOR-CRITIC . Soft actor-critic ( SAC ) ( Haarnoja et al. , 2018a ) includes a policy entropy regularization term in the objective function for better exploration by visiting the action space uniformly for each given state . The entropy-augmented policy objective function of SAC is given by JSAC ( π ) = Eτ0∼π [ ∞∑ t=0 γt ( rt + βH ( π ( ·|st ) ) ) ] , ( 1 ) where H is the entropy function and β ∈ ( 0 , ∞ ) is the entropy coefficient . SAC is a practical offpolicy actor-critic based on soft policy iteration ( SPI ) that alternates soft policy evaluation to estimate the true soft Q-function and soft policy improvement to find the optimal policy that maximizes ( 1 ) . In addition , SPI theoretically guarantees convergence to the optimal policy that maximizes ( 1 ) . 4 THE DIVERSITY ACTOR-CRITIC ALGORITHM . 4.1 MOTIVATION OF THE SAMPLE-AWARE ENTROPY . As explained in Section 2 , the policy should visit diverse samples to learn the policy without converging to the local optima . In off-policy learning , we can reuse previous samples stored in the replay buffer to learn the policy , so it is efficient to draw diverse samples while avoiding frequently selected samples before . The policy entropy maximization enhances exploration to yield better performance , but it is sample-inefficient for off-policy RL because it does not take advantage of the previous sample action distribution obtainable from the replay buffer : If we assume bounded action space , the simple policy entropy maximization will choose all actions with the equal probability without considering the previous action samples because maxπH ( π ) = minπ DKL ( π||U ) is achieved when π = U , where U is a uniform distribution and DKL is the Kullback-Leibler ( KL ) divergence . In order to overcome the limitation of the simple policy entropy maximization , we consider maximizing a sample-aware entropy defined as the entropy of a mixture distribution of the policy distribution π and the current sample action distribution q in the replay buffer . Here , q is defined as q ( ·|s ) : = ∑ a∈DN ( s , a ) δa ( · ) ∑ a′∈DN ( s , a ′ ) , ( 2 ) where D is the replay buffer that stores previous samples ( st , at , rt , st+1 ) at each time t , δa ( · ) is the Dirac measure at a ∈ A , and N ( s , a ) is the number of state-action pair ( s , a ) in D. Then , we define a target distribution qπ , αtarget as the mixture distribution of π and q , which is expressed as qπ , αtarget : = απ + ( 1 − α ) q , where α ∈ [ 0 , 1 ] is the weighting factor . Note that we draw samples from policy π and store them in the replay buffer , so the target distribution can be viewed as the updated sample action distribution in the future replay buffer . Then , maximizing the sample-aware entropy H ( qπ , αtarget ) can encourage sample-efficient exploration because π will choose actions rare in the buffer with high probability and actions stored many times in the buffer with low probability in order to make the target distribution uniform . We provide a simple example below : Let us consider a simple 1-step MDP in which s0 is the unique initial state , there exist Na actions ( A = { A0 , · · · , ANa−1 } ) , s1 is the terminal state , and r is a deterministic reward function . Then , there exist Na state-action pairs in total and let us assume that we already have Na − 1 state-action samples in the replay buffer as R = { ( s0 , A0 , r ( s0 , A0 ) ) , · · · , ( s0 , ANa−2 , r ( s0 , ANa−2 ) ) } . In order to estimate the Q-function for all state-action pairs , the policy should sample the last action ANa−1 ( After then , we can reuse all samples infinitely to estimate Q ) . Here , we will compare two exploration methods . 1 ) First , if we consider the simple entropy maximization , the policy that maximizes its entropy will choose all actions with equal probability 1/Na ( uniformly ) . Then , Na samples should be taken on average by the policy to visit the action ANa−1 . 2 ) Consider the sample-aware entropy maximization . Here , the sample action distribution q in the buffer becomes q ( a0|s0 ) = 1/ ( Na − 1 ) for a0 ∈ { A0 , · · · , ANa−2 } and q ( ANa−1|s0 ) = 0 , the target distribution becomes qπ , αtarget = απ + ( 1 − α ) q , and we set α = 1/Na . Then , the policy that maximizes the sample-aware entropy becomes π ( ANa−1|s0 ) = 1 to make q π , α target uniform because maxπH ( qπ , αtarget ) = minπ DKL ( q π , α target||U ) . In this case , we only needs one sample to visit the action ANa−1 . In this way , the simple entropy maximization is sample-inefficient for off-policy RL , and the proposed sample-aware entropy maximization can enhance the sample-efficiency for exploration by using the previous sample distribution and choosing a proper α . With this motivation , we propose the sample-aware entropy regularization for off-policy RL and the corresponding αadaptation method .
The paper proposes DAC, an actor-critic method exploiting the replay buffer to do policy entropy regularisation. The main idea of DAC is to use the data from the replay buffer to induce a distribution $q(\cdot, s_t)$ and replace the entropy part of the Soft Actor-Critic objective with a convex combination of $q$ and $\pi$. This results positively on exploration properties and leads to sample-efficiency gains on some of the considered MuJoCo benchmarks.
SP:cc6c0eb769a3da3f0e311fe6a4b96286f1f98d01
Diversity Actor-Critic: Sample-Aware Entropy Regularization for Sample-Efficient Exploration
Policy entropy regularization is commonly used for better exploration in deep reinforcement learning ( RL ) . However , policy entropy regularization is sampleinefficient in off-policy learning since it does not take the distribution of previous samples stored in the replay buffer into account . In order to take advantage of the previous sample distribution from the replay buffer for sample-efficient exploration , we propose sample-aware entropy regularization which maximizes the entropy of weighted sum of the policy action distribution and the sample action distribution from the replay buffer . We formulate the problem of sample-aware entropy regularized policy iteration , prove its convergence , and provide a practical algorithm named diversity actor-critic ( DAC ) which is a generalization of soft actor-critic ( SAC ) . Numerical results show that DAC significantly outperforms SAC baselines and other state-of-the-art RL algorithms . 1 INTRODUCTION . Reinforcement learning ( RL ) aims to maximize the expectation of the discounted reward sum under Markov decision process ( MDP ) environments ( Sutton & Barto , 1998 ) . When the given task is complex , i.e . the environment has high action-dimensions or sparse rewards , it is important to well explore state-action pairs for high performance ( Agre & Rosenschein , 1996 ) . For better exploration , recent RL considers various methods : maximizing the policy entropy to take actions more uniformly ( Ziebart et al. , 2008 ; Fox et al. , 2015 ; Haarnoja et al. , 2017 ) , maximizing diversity gain that yields intrinsic rewards to explore rare states by counting the number of visiting states ( Strehl & Littman , 2008 ; Lopes et al. , 2012 ) , maximizing information gain ( Houthooft et al. , 2016 ; Hong et al. , 2018 ) , maximizing model prediction error ( Achiam & Sastry , 2017 ; Pathak et al. , 2017 ) , and so on . In particular , based on policy iteration for soft Q-learning , ( Haarnoja et al. , 2018a ) considered an offpolicy actor-critic framework for maximum entropy RL and proposed the soft actor-critic ( SAC ) algorithm , which has competitive performance for challenging continuous control tasks . In this paper , we reconsider the problem of policy entropy regularization in off-policy learning and propose a generalized approach to policy entropy regularization . In off-policy learning , we store and reuse old samples to update the current policy ( Mnih et al. , 2015 ) , and it is preferable that the old sample distribution in the replay buffer is uniformly distributed for better performance . However , the simple policy entropy regularization tries to maximize the entropy of the current policy irrespective of the distribution of previous samples . Since the uniform distribution has maximum entropy , the current policy will choose previously less-sampled actions and more-sampled actions with the same probability and hence the simple policy entropy regularization is sample-unaware and sample-inefficient . In order to overcome this drawback , we propose sample-aware entropy regularization , which tries to maximize the weighted sum of the current policy action distribution and the sample action distribution from the replay buffer . We will show that the proposed sampleaware entropy regularization reduces to maximizing the sum of the policy entropy and the α-skewed Jensen-Shannon divergence ( Nielsen , 2019 ) between the policy distribution and the buffer sample action distribution , and hence it generalizes SAC . We will also show that properly exploiting the sample action distribution in addition to the policy entropy over learning phases will yield far better performance . 2 RELATED WORKS . Entropy regularization : Entropy regularization maximizes the sum of the expected return and the policy action entropy . It encourages the agent to visit the action space uniformly for each given state , and the regularized policy is robust to modeling error ( Ziebart , 2010 ) . Entropy regularization is considered in various domains for better optimization : inverse reinforcement learning ( Ziebart et al. , 2008 ) , stochastic optimal control problems ( Todorov , 2008 ; Toussaint , 2009 ; Rawlik et al. , 2013 ) , and off-policy reinforcement learning ( Fox et al. , 2015 ; Haarnoja et al. , 2017 ) . ( Lee et al. , 2019 ) shows that Tsallis entropy regularization that generalizes usual Shannon-entropy regularization is helpful . ( Nachum et al. , 2017a ) shows that there exists a connection between value-based and policybased RL under entropy regularization . ( O ’ Donoghue et al. , 2016 ) proposed an algorithm combining them , and it is proven that they are equivalent ( Schulman et al. , 2017a ) . The entropy of state mixture distribution is better for pure exploration than a simple random policy ( Hazan et al. , 2019 ) . Diversity gain : Diversity gain is used to provide a guidance for exploration to the agent . To achieve diversity gain , many intrinsically-motivated approaches and intrinsic reward design methods have been considered , e.g. , intrinsic reward based on curiosity ( Chentanez et al. , 2005 ; Baldassarre & Mirolli , 2013 ) , model prediction error ( Achiam & Sastry , 2017 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , divergence/information gain ( Houthooft et al. , 2016 ; Hong et al. , 2018 ) , counting ( Strehl & Littman , 2008 ; Lopes et al. , 2012 ; Tang et al. , 2017 ; Martin et al. , 2017 ) , and unification of them ( Bellemare et al. , 2016 ) . For self-imitation learning , ( Gangwani et al. , 2018 ) considered the Steinvariational gradient decent with the Jensen-Shannon kennel . Off-policy learning : Off-policy learning can reuse any samples generated from behaviour policies for the policy update ( Sutton & Barto , 1998 ; Degris et al. , 2012 ) , so it is sample-efficient as compared to on-policy learning . In order to reuse old samples , a replay buffer that stores trajectories generated by previous policies is used for Q-learning ( Mnih et al. , 2015 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018a ) . To enhance both stability and sample-efficiency , several methods are considered , e.g. , combining on-policy and off-policy ( Wang et al. , 2016 ; Gu et al. , 2016 ; 2017 ) , and generalization from on-policy to off-policy ( Nachum et al. , 2017b ; Han & Sung , 2019 ) . In order to guarantee the convergence of Q-learning , there is a key assumption : Each state-action pair must be visited infinitely often ( Watkins & Dayan , 1992 ) . If the policy does not visit diverse state-action pairs many times , it converges to local optima . Therefore , exploration for visiting different state-action pairs is important for RL , and the original policy entropy regularization encourages exploration ( Ahmed et al. , 2019 ) . However , we found that the simple policy entropy regularization can be sample-inefficient in off-policy RL , so we aim to propose a new entropy regularization method that significantly enhances the sample-efficiency for exploration by considering the previous sample distribution in the buffer . 3 BACKGROUND . In this section , we briefly introduce the basic setup and the soft actor-critic ( SAC ) algorithm . 3.1 SETUP . We assume a basic RL setup composed of an environment and an agent . The environment follows an infinite horizon Markov decision process ( S , A , P , γ , r ) , where S is the state space , A is the action space , P is the transition probability , γ is the discount factor , and r : S × A → R is the reward function . In this paper , we consider a continuous state-action space . The agent has a policy distribution π : S × A → [ 0 , ∞ ) which selects an action at for a given state st at each time step t , and the agent interacts with the environment and receives reward rt : = r ( st , at ) from the environment . Standard RL aims to maximize the discounted return Es0∼p0 , τ0∼π [ ∑∞ t=0 γ trt ] , where τt = ( st , at , st+1 , at+1 · · · ) is an episode trajectory . 3.2 SOFT ACTOR-CRITIC . Soft actor-critic ( SAC ) ( Haarnoja et al. , 2018a ) includes a policy entropy regularization term in the objective function for better exploration by visiting the action space uniformly for each given state . The entropy-augmented policy objective function of SAC is given by JSAC ( π ) = Eτ0∼π [ ∞∑ t=0 γt ( rt + βH ( π ( ·|st ) ) ) ] , ( 1 ) where H is the entropy function and β ∈ ( 0 , ∞ ) is the entropy coefficient . SAC is a practical offpolicy actor-critic based on soft policy iteration ( SPI ) that alternates soft policy evaluation to estimate the true soft Q-function and soft policy improvement to find the optimal policy that maximizes ( 1 ) . In addition , SPI theoretically guarantees convergence to the optimal policy that maximizes ( 1 ) . 4 THE DIVERSITY ACTOR-CRITIC ALGORITHM . 4.1 MOTIVATION OF THE SAMPLE-AWARE ENTROPY . As explained in Section 2 , the policy should visit diverse samples to learn the policy without converging to the local optima . In off-policy learning , we can reuse previous samples stored in the replay buffer to learn the policy , so it is efficient to draw diverse samples while avoiding frequently selected samples before . The policy entropy maximization enhances exploration to yield better performance , but it is sample-inefficient for off-policy RL because it does not take advantage of the previous sample action distribution obtainable from the replay buffer : If we assume bounded action space , the simple policy entropy maximization will choose all actions with the equal probability without considering the previous action samples because maxπH ( π ) = minπ DKL ( π||U ) is achieved when π = U , where U is a uniform distribution and DKL is the Kullback-Leibler ( KL ) divergence . In order to overcome the limitation of the simple policy entropy maximization , we consider maximizing a sample-aware entropy defined as the entropy of a mixture distribution of the policy distribution π and the current sample action distribution q in the replay buffer . Here , q is defined as q ( ·|s ) : = ∑ a∈DN ( s , a ) δa ( · ) ∑ a′∈DN ( s , a ′ ) , ( 2 ) where D is the replay buffer that stores previous samples ( st , at , rt , st+1 ) at each time t , δa ( · ) is the Dirac measure at a ∈ A , and N ( s , a ) is the number of state-action pair ( s , a ) in D. Then , we define a target distribution qπ , αtarget as the mixture distribution of π and q , which is expressed as qπ , αtarget : = απ + ( 1 − α ) q , where α ∈ [ 0 , 1 ] is the weighting factor . Note that we draw samples from policy π and store them in the replay buffer , so the target distribution can be viewed as the updated sample action distribution in the future replay buffer . Then , maximizing the sample-aware entropy H ( qπ , αtarget ) can encourage sample-efficient exploration because π will choose actions rare in the buffer with high probability and actions stored many times in the buffer with low probability in order to make the target distribution uniform . We provide a simple example below : Let us consider a simple 1-step MDP in which s0 is the unique initial state , there exist Na actions ( A = { A0 , · · · , ANa−1 } ) , s1 is the terminal state , and r is a deterministic reward function . Then , there exist Na state-action pairs in total and let us assume that we already have Na − 1 state-action samples in the replay buffer as R = { ( s0 , A0 , r ( s0 , A0 ) ) , · · · , ( s0 , ANa−2 , r ( s0 , ANa−2 ) ) } . In order to estimate the Q-function for all state-action pairs , the policy should sample the last action ANa−1 ( After then , we can reuse all samples infinitely to estimate Q ) . Here , we will compare two exploration methods . 1 ) First , if we consider the simple entropy maximization , the policy that maximizes its entropy will choose all actions with equal probability 1/Na ( uniformly ) . Then , Na samples should be taken on average by the policy to visit the action ANa−1 . 2 ) Consider the sample-aware entropy maximization . Here , the sample action distribution q in the buffer becomes q ( a0|s0 ) = 1/ ( Na − 1 ) for a0 ∈ { A0 , · · · , ANa−2 } and q ( ANa−1|s0 ) = 0 , the target distribution becomes qπ , αtarget = απ + ( 1 − α ) q , and we set α = 1/Na . Then , the policy that maximizes the sample-aware entropy becomes π ( ANa−1|s0 ) = 1 to make q π , α target uniform because maxπH ( qπ , αtarget ) = minπ DKL ( q π , α target||U ) . In this case , we only needs one sample to visit the action ANa−1 . In this way , the simple entropy maximization is sample-inefficient for off-policy RL , and the proposed sample-aware entropy maximization can enhance the sample-efficiency for exploration by using the previous sample distribution and choosing a proper α . With this motivation , we propose the sample-aware entropy regularization for off-policy RL and the corresponding αadaptation method .
This paper considers the exploration efficiency issues in off-policy deep reinforcement learning (DRL). The authors identify a sample efficiency limitation in the classical entropy regularization, which does not take into account the existing samples in the replay buffer. To avoid repeated sampling of previously seen scenarios/actions, the authors propose to replace the current policy in the entropy term with a mixture of the empirical policy estimation from the replay buffer and the current policy, and term this approach as sample-aware entropy regularization. The authors then propose a theoretical algorithm called sample-aware entropy regularized policy iteration, which is a generalization of the soft policy iteration (SPI) algorithm, and show that it converges assuming that the empirical policy estimation is fixed. A practical algorithm based on the sample-aware entropy regularized policy iteration, called Diversity Actor-Critic (DAC), is then proposed. This algorithm is a generalization of the well-known soft actor-critic (SAC) algorithm. Finally, numerical experiments show that DAC outperforms SAC and other SOTA RL algorithms, and some ablation studies are also provided to demonstrate the effect of hyper-parameter choices in DAC.
SP:cc6c0eb769a3da3f0e311fe6a4b96286f1f98d01
A Strong On-Policy Competitor To PPO
1 INTRODUCTION . With the development of deep reinforcement learning , lots of impressive results have been produced in a wide range of fields such as playing Atari game ( Mnih et al. , 2015 ; Hessel et al. , 2018 ) , controlling robotics ( Lillicrap et al. , 2015 ) , Go ( Silver et al. , 2017 ) , neural architecture search ( Tan et al. , 2019 ; Pham et al. , 2018 ) . The basis of a reinforcement learning algorithm is generalized policy iteration ( Sutton & Barto , 2018 ) , which states two essential iterative steps : policy evaluation and improvement . Among various algorithms , policy gradient is an active branch of reinforcement learning whose foundations are Policy Gradient Theorem and the most classical algorithm REINFORCEMENT ( Sutton & Barto , 2018 ) . Since then , handfuls of policy gradient variants have been proposed , such as Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) , Asynchronous Advantage Actor-Critic ( A3C ) ( Mnih et al. , 2016 ) , Actor-Critic using Kronecker-factored Trust Region ( ACKTR ) ( Wu et al. , 2017 ) , and Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) . Improving the strategy monotonically had been nontrivial until Schulman et al . ( 2015 ) proposed Trust Region Policy Optimization ( TRPO ) , in which Fisher vector product is utilized to cut down the computing burden . Specifically , Kullback–Leibler divergence ( KLD ) acts as a hard constraint in place of objective , because its corresponding coefficient is difficult to set for different problems . However , TRPO still has several drawbacks : too complicated , inefficient data usage . Quite a lot of efforts have been devoted to improving TRPO since then and the most commonly used one is PPO . PPO can be regarded as a first-order variant of TRPO and have obvious improvements in several facets . In particular , a pessimistic clipped surrogate objective is proposed where TRPO ’ s hard constraint is replaced by the clipped action probability ratio . In such a way , it constructs an unconstrained optimization problem so that any first-order stochastic gradient optimizer can be directly applied . Besides , it ’ s easier to be implemented and more robust against various problems , achieving an impressive result on Atari games ( Brockman et al. , 2016 ) . However , the cost of data sampling is not always cheap . Haarnoja et al . ( 2018 ) design an off-policy algorithm called Soft Actor-Critic and achieves the state of the art result by encouraging better exploration using maximum entropy . In this paper , we focus on the on-policy improvement to improve PPO and answer the question : how to successfully leverage penalized optimization to solve the constrained one which is formulated by Schulman et al . ( 2015 ) . 1 . It proposes a simple variant of TRPO called POP3D along with a new surrogate objective containing a point probability penalty item , which is symmetric lower bound to the square of the total variance divergence of policy distributions . Specifically , it helps to stabilize the learning process and encourage exploration . Furthermore , it escapes from penalty item setting headache along with penalized version TRPO , where is arduous to select one fixed value for various environments . 2 . It achieves state-of-the-art results among on-policy algorithms with a clear margin on 49 Atari games within 40 million frame steps based on two shared metrics . Moreover , it also achieves competitive results compared with PPO in the continuous domain . It dives into the mechanism of PPO ’ s improvement over TRPO from the perspective of solution manifold , which also plays an important role in our method . 3 . It enjoys almost all PPO ’ s advantages such as easy implementation , fast learning ability . We provide the code and training logs to make our work reproducible . 2 PRELIMINARY KNOWLEDGE AND RELATED WORK . 2.1 POLICY GRADIENT . Agents interact with the environment and receive rewards which are used to adjust their policy in turn . At state st , one agent takes strategy π and transfers to a new state st+1 , rewarded rt by the environment . Maximizing discounted return ( accumulated rewards ) Rt is its objective . In particular , given a policy π , Rt is defined as Rt = ∞∑ n=0 ( rt + γrt+1 + γ 2rt+2 + ... + γ nrt+n ) . ( 1 ) γ is the discounted coefficient to control future rewards , which lies in the range ( 0 , 1 ) . Regarding a neural network with parameter θ , the policy πθ ( a|s ) can be learned by maximizing Equation 1 using the back-propagation algorithm . Particularly , given Q ( s , a ) which represents the agent ’ s return in state s after taking action a , the objective function can be written as max θ Es , a log πθ ( a|s ) Q ( s , a ) . ( 2 ) Equation 2 lays the foundation for handfuls of policy gradient based algorithms . Another variant can be deduced by using A ( s , a ) = Q ( s , a ) − V ( s ) ( 3 ) to replace Q ( s , a ) in Equation 2 equivalently , V ( s ) can be any function so long as V depends on s but not a . In most cases , state value function is used for V , which not only helps to reduce variations but has clear physical meaning . Formally , it can be written as max θ Es , a log πθ ( a|s ) A ( s , a ) . ( 4 ) 2.2 ADVANTAGE ESTIMATE . A commonly used method for advantage calculation is one-step estimation , which follows A ( st , at ) = Q ( st , at ) − V ( st ) = rt + γV ( st+1 ) − V ( st ) . ( 5 ) However , a more accurate method called generalized advantage estimation is proposed in Schulman et al . ( 2016 ) , where all time steps of estimation are combined and summarized using λ-based weights , . The generalized advantage estimator ÂGAE ( γ , λ ) t is defined by Schulman et al . ( 2016 ) as  GAE ( γ , λ ) t : = ( 1− λ ) ∗ (  ( 1 ) t + λ ( 2 ) t + λ 2 ( 3 ) t + . . . ) = ∞∑ l=0 ( γλ ) lδVt+l δVt+l = rt+l + γV ( st+l+1 ) − V ( st+l ) .  ( k ) t : = k−1∑ l=0 γlδVt+l = −V ( st ) + rt + γrt+1 + · · ·+ γk−1rt+k−1 + γkV ( st+k ) ( 6 ) The parameter λ meets 0 ≤ λ ≤ 1 , which controls the trade-off between bias and variance . All methods in this paper utilize ÂGAE ( γ , λ ) t to estimate the advantage . 2.3 TRUST REGION POLICY OPTIMIZATION . Schulman et al . ( 2015 ) propose TRPO to update the policy monotonically . In particular , its mathematical form is max θ Et [ πθ ( at|st ) πθold ( at|st ) Ât ] − CEt [ KL [ πθold ( ·|st ) , πθ ( ·|st ) ] ] = max s Ea∼πθ ( a|s ) [ Aπθold ( s , a ) ] ) ( 7 ) where C is the penalty coefficient , C = 2 γ ( 1−γ ) 2 . In practice , the policy update steps would be too small if C is valued as Equation 7 . In fact , it ’ s intractable to calculate C beforehand since it requires traversing all states to reach the maximum . Moreover , inevitable bias and variance will be introduced by estimating the advantages of old policy while training . Instead , a surrogate objective is maximized based on the KLD constraint between the old and new policy , which can be written as below , max θ Et [ πθ ( at|st ) πθold ( at|st ) Ât ] s.t . Et [ KL [ πθold ( ·|st ) , πθ ( ·|st ) ] ] ≤ δ ( 8 ) where δ is the KLD upper limitation . In addition , the conjugate gradient algorithm is applied to solve Equation 8 more efficiently . Two major problems have yet to be addressed : one is its complexity even using the conjugate gradient approach , another is compatibility with architectures that involve noise or parameter sharing tricks ( Schulman et al. , 2017 ) . 2.4 PROXIMAL POLICY OPTIMIZATION . To overcome the shortcomings of TRPO , PPO replaces the original constrained problem with a pessimistic clipped surrogate objective where KL constraint is implicitly imposed . The loss function can be written as LCLIP ( θ ) = Et [ min ( rt ( θ ) Ât , clip ( rt ( θ ) , 1− , 1 + ) Ât ) ] rt ( θ ) = πθ ( at|st ) πθold ( at|st ) , ( 9 ) where is a hyper-parameter to control the clipping ratio . Except for the clipped PPO version , KL penalty versions including fixed and adaptive KLD . Besides , their simulation results convince that clipped PPO performs best with an obvious margin across various domains . 3 POLICY OPTIMIZATION WITH PENALIZED POINT PROBABILITY DISTANCE . Before diving into the details of POP3D , we review some drawbacks of several methods , which partly motivate us . 3.1 DISADVANTAGES OF KULLBACK-LEIBLER DIVERGENCE . TRPO ( Schulman et al. , 2015 ) induced the following inequality1 , η ( πθ ) ≤ Lπθold ( πθ ) + 2 γ ( 1− γ ) 2 α2 α = DmaxTV ( πθold , πθ ) DmaxTV ( πθold , πθ ) = maxs DTV ( πθold ||πθ ) ( 10 ) TRPO replaces the square of total variation divergence DmaxTV ( πθold , πθ ) by D max KL ( πθold , πθ ) = maxsDKL ( πθold ||πθ ) . 1Note that η means loss instead of return as the ICML version ( Schulman et al. , 2015 ) . Given a discrete distribution p and q , their total variation divergence DTV ( p||q ) is defined as DTV ( p||q ) : = 1 2 ∑ i |pi − qi| ( 11 ) in TRPO ( Schulman et al. , 2015 ) . Obviously , DTV is symmetric by definition , while KLD is asymmetric . Formally , given state s , KLD of πθold ( ·|s ) for πθ ( ·|s ) can be written as DKL ( πθold ( ·|s ) ||πθ ( ·|s ) ) : = ∑ a πθold ( a|s ) ln πθold ( a|s ) πθ ( a|s ) . ( 12 ) Similarly , KLD in the continuous domain can be defined simply by replacing summation with integration . The consequence of KLD ’ s asymmetry leads to a non-negligible difference of whether choose DKL ( πθold ||πθ ) or DKL ( πθ||πθold ) . Sometimes , those two choices result in quite different solutions . Robert compared the forward and reverse KL on a distribution , one solution matches only one of the modes , and another covers both modes ( Murphy , 2012 ) . Therefore , KLD is not an ideal bound or approximation for the expected discounted cost .
The authors replace the divergence-based constraint in trust region policy optimization model with an alternate distance measure, which is added to the objective function with a multiplier (beta). In fact, the parameter beta plays a role that is similar to a Lagrange multiplier, if the new distance measure is introduced as a constraint. The authors explain the shortcomings of KL-divergence and the solutions obtained with other methods but they do not provide a sufficient discussion how and why their simple approach overcomes those concerns. For instance, why would the new measure encourage exploration and what is the effect of large beta value on this?
SP:7286d578f6acf486a688b7631e16c483efb6a540
A Strong On-Policy Competitor To PPO
1 INTRODUCTION . With the development of deep reinforcement learning , lots of impressive results have been produced in a wide range of fields such as playing Atari game ( Mnih et al. , 2015 ; Hessel et al. , 2018 ) , controlling robotics ( Lillicrap et al. , 2015 ) , Go ( Silver et al. , 2017 ) , neural architecture search ( Tan et al. , 2019 ; Pham et al. , 2018 ) . The basis of a reinforcement learning algorithm is generalized policy iteration ( Sutton & Barto , 2018 ) , which states two essential iterative steps : policy evaluation and improvement . Among various algorithms , policy gradient is an active branch of reinforcement learning whose foundations are Policy Gradient Theorem and the most classical algorithm REINFORCEMENT ( Sutton & Barto , 2018 ) . Since then , handfuls of policy gradient variants have been proposed , such as Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) , Asynchronous Advantage Actor-Critic ( A3C ) ( Mnih et al. , 2016 ) , Actor-Critic using Kronecker-factored Trust Region ( ACKTR ) ( Wu et al. , 2017 ) , and Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) . Improving the strategy monotonically had been nontrivial until Schulman et al . ( 2015 ) proposed Trust Region Policy Optimization ( TRPO ) , in which Fisher vector product is utilized to cut down the computing burden . Specifically , Kullback–Leibler divergence ( KLD ) acts as a hard constraint in place of objective , because its corresponding coefficient is difficult to set for different problems . However , TRPO still has several drawbacks : too complicated , inefficient data usage . Quite a lot of efforts have been devoted to improving TRPO since then and the most commonly used one is PPO . PPO can be regarded as a first-order variant of TRPO and have obvious improvements in several facets . In particular , a pessimistic clipped surrogate objective is proposed where TRPO ’ s hard constraint is replaced by the clipped action probability ratio . In such a way , it constructs an unconstrained optimization problem so that any first-order stochastic gradient optimizer can be directly applied . Besides , it ’ s easier to be implemented and more robust against various problems , achieving an impressive result on Atari games ( Brockman et al. , 2016 ) . However , the cost of data sampling is not always cheap . Haarnoja et al . ( 2018 ) design an off-policy algorithm called Soft Actor-Critic and achieves the state of the art result by encouraging better exploration using maximum entropy . In this paper , we focus on the on-policy improvement to improve PPO and answer the question : how to successfully leverage penalized optimization to solve the constrained one which is formulated by Schulman et al . ( 2015 ) . 1 . It proposes a simple variant of TRPO called POP3D along with a new surrogate objective containing a point probability penalty item , which is symmetric lower bound to the square of the total variance divergence of policy distributions . Specifically , it helps to stabilize the learning process and encourage exploration . Furthermore , it escapes from penalty item setting headache along with penalized version TRPO , where is arduous to select one fixed value for various environments . 2 . It achieves state-of-the-art results among on-policy algorithms with a clear margin on 49 Atari games within 40 million frame steps based on two shared metrics . Moreover , it also achieves competitive results compared with PPO in the continuous domain . It dives into the mechanism of PPO ’ s improvement over TRPO from the perspective of solution manifold , which also plays an important role in our method . 3 . It enjoys almost all PPO ’ s advantages such as easy implementation , fast learning ability . We provide the code and training logs to make our work reproducible . 2 PRELIMINARY KNOWLEDGE AND RELATED WORK . 2.1 POLICY GRADIENT . Agents interact with the environment and receive rewards which are used to adjust their policy in turn . At state st , one agent takes strategy π and transfers to a new state st+1 , rewarded rt by the environment . Maximizing discounted return ( accumulated rewards ) Rt is its objective . In particular , given a policy π , Rt is defined as Rt = ∞∑ n=0 ( rt + γrt+1 + γ 2rt+2 + ... + γ nrt+n ) . ( 1 ) γ is the discounted coefficient to control future rewards , which lies in the range ( 0 , 1 ) . Regarding a neural network with parameter θ , the policy πθ ( a|s ) can be learned by maximizing Equation 1 using the back-propagation algorithm . Particularly , given Q ( s , a ) which represents the agent ’ s return in state s after taking action a , the objective function can be written as max θ Es , a log πθ ( a|s ) Q ( s , a ) . ( 2 ) Equation 2 lays the foundation for handfuls of policy gradient based algorithms . Another variant can be deduced by using A ( s , a ) = Q ( s , a ) − V ( s ) ( 3 ) to replace Q ( s , a ) in Equation 2 equivalently , V ( s ) can be any function so long as V depends on s but not a . In most cases , state value function is used for V , which not only helps to reduce variations but has clear physical meaning . Formally , it can be written as max θ Es , a log πθ ( a|s ) A ( s , a ) . ( 4 ) 2.2 ADVANTAGE ESTIMATE . A commonly used method for advantage calculation is one-step estimation , which follows A ( st , at ) = Q ( st , at ) − V ( st ) = rt + γV ( st+1 ) − V ( st ) . ( 5 ) However , a more accurate method called generalized advantage estimation is proposed in Schulman et al . ( 2016 ) , where all time steps of estimation are combined and summarized using λ-based weights , . The generalized advantage estimator ÂGAE ( γ , λ ) t is defined by Schulman et al . ( 2016 ) as  GAE ( γ , λ ) t : = ( 1− λ ) ∗ (  ( 1 ) t + λ ( 2 ) t + λ 2 ( 3 ) t + . . . ) = ∞∑ l=0 ( γλ ) lδVt+l δVt+l = rt+l + γV ( st+l+1 ) − V ( st+l ) .  ( k ) t : = k−1∑ l=0 γlδVt+l = −V ( st ) + rt + γrt+1 + · · ·+ γk−1rt+k−1 + γkV ( st+k ) ( 6 ) The parameter λ meets 0 ≤ λ ≤ 1 , which controls the trade-off between bias and variance . All methods in this paper utilize ÂGAE ( γ , λ ) t to estimate the advantage . 2.3 TRUST REGION POLICY OPTIMIZATION . Schulman et al . ( 2015 ) propose TRPO to update the policy monotonically . In particular , its mathematical form is max θ Et [ πθ ( at|st ) πθold ( at|st ) Ât ] − CEt [ KL [ πθold ( ·|st ) , πθ ( ·|st ) ] ] = max s Ea∼πθ ( a|s ) [ Aπθold ( s , a ) ] ) ( 7 ) where C is the penalty coefficient , C = 2 γ ( 1−γ ) 2 . In practice , the policy update steps would be too small if C is valued as Equation 7 . In fact , it ’ s intractable to calculate C beforehand since it requires traversing all states to reach the maximum . Moreover , inevitable bias and variance will be introduced by estimating the advantages of old policy while training . Instead , a surrogate objective is maximized based on the KLD constraint between the old and new policy , which can be written as below , max θ Et [ πθ ( at|st ) πθold ( at|st ) Ât ] s.t . Et [ KL [ πθold ( ·|st ) , πθ ( ·|st ) ] ] ≤ δ ( 8 ) where δ is the KLD upper limitation . In addition , the conjugate gradient algorithm is applied to solve Equation 8 more efficiently . Two major problems have yet to be addressed : one is its complexity even using the conjugate gradient approach , another is compatibility with architectures that involve noise or parameter sharing tricks ( Schulman et al. , 2017 ) . 2.4 PROXIMAL POLICY OPTIMIZATION . To overcome the shortcomings of TRPO , PPO replaces the original constrained problem with a pessimistic clipped surrogate objective where KL constraint is implicitly imposed . The loss function can be written as LCLIP ( θ ) = Et [ min ( rt ( θ ) Ât , clip ( rt ( θ ) , 1− , 1 + ) Ât ) ] rt ( θ ) = πθ ( at|st ) πθold ( at|st ) , ( 9 ) where is a hyper-parameter to control the clipping ratio . Except for the clipped PPO version , KL penalty versions including fixed and adaptive KLD . Besides , their simulation results convince that clipped PPO performs best with an obvious margin across various domains . 3 POLICY OPTIMIZATION WITH PENALIZED POINT PROBABILITY DISTANCE . Before diving into the details of POP3D , we review some drawbacks of several methods , which partly motivate us . 3.1 DISADVANTAGES OF KULLBACK-LEIBLER DIVERGENCE . TRPO ( Schulman et al. , 2015 ) induced the following inequality1 , η ( πθ ) ≤ Lπθold ( πθ ) + 2 γ ( 1− γ ) 2 α2 α = DmaxTV ( πθold , πθ ) DmaxTV ( πθold , πθ ) = maxs DTV ( πθold ||πθ ) ( 10 ) TRPO replaces the square of total variation divergence DmaxTV ( πθold , πθ ) by D max KL ( πθold , πθ ) = maxsDKL ( πθold ||πθ ) . 1Note that η means loss instead of return as the ICML version ( Schulman et al. , 2015 ) . Given a discrete distribution p and q , their total variation divergence DTV ( p||q ) is defined as DTV ( p||q ) : = 1 2 ∑ i |pi − qi| ( 11 ) in TRPO ( Schulman et al. , 2015 ) . Obviously , DTV is symmetric by definition , while KLD is asymmetric . Formally , given state s , KLD of πθold ( ·|s ) for πθ ( ·|s ) can be written as DKL ( πθold ( ·|s ) ||πθ ( ·|s ) ) : = ∑ a πθold ( a|s ) ln πθold ( a|s ) πθ ( a|s ) . ( 12 ) Similarly , KLD in the continuous domain can be defined simply by replacing summation with integration . The consequence of KLD ’ s asymmetry leads to a non-negligible difference of whether choose DKL ( πθold ||πθ ) or DKL ( πθ||πθold ) . Sometimes , those two choices result in quite different solutions . Robert compared the forward and reverse KL on a distribution , one solution matches only one of the modes , and another covers both modes ( Murphy , 2012 ) . Therefore , KLD is not an ideal bound or approximation for the expected discounted cost .
This paper introduces POP3D, an on-policy policy gradient algorithm that is a variant of TRPO and PPO. While TRPO uses a particular penalty function to keep the policy from being updated too aggressively, POP3D uses an alternative objective function that lower bounds the square of the total variance divergence between two policy distributions. The authors argue that this alternative formulation results in an algorithm that is sample-efficient, like PPO, but that is more effective at keeping policy updates from overshooting. The authors also argue that this new formulation helps users to avoid the arguably challenging process of selecting penalty constants, as required (for instance) by TRPO.
SP:7286d578f6acf486a688b7631e16c483efb6a540
Connection- and Node-Sparse Deep Learning: Statistical Guarantees
Neural networks are becoming increasingly popular in applications , but a comprehensive mathematical understanding of their potentials and limitations is still missing . In this paper , we study the prediction accuracies of neural networks from a statistical point of view . In particular , we establish statistical guarantees for deep learning with different types of sparsity-inducing regularization . Our bounds feature a mild dependence on network widths and depths , and , therefore , support the current trend toward wide and deep networks . The tools that we use in our derivations are uncommon in deep learning and , hence , might be of additional interest . 1 INTRODUCTION . Sparsity reduces network complexities and , consequently , lowers the demands on memory and computation , reduces overfitting , and improves interpretability ( Changpinyo et al. , 2017 ; Han et al. , 2016 ; Kim et al. , 2016 ; Liu et al. , 2015 ; Wen et al. , 2016 ) . Three common notions of sparsity are connection sparsity , which means that there is only a small number of nonzero connections between nodes , node sparsity , which means that there is only a small number of active nodes ( Alvarez & Salzmann , 2016 ; Changpinyo et al. , 2017 ; Feng & Simon , 2017 ; Kim et al. , 2016 ; Lee et al. , 2008 ; Liu et al. , 2015 ; Nie et al. , 2015 ; Scardapane et al. , 2017 ; Wen et al. , 2016 ) , and layer sparsity , which means that there is only a small number of active layers ( Hebiri & Lederer , 2020 ) . Approaches to achieving sparsity include augmenting small networks ( Ash , 1989 ; Bello , 1992 ) , pruning large networks ( Simonyan & Zisserman , 2015 ; Han et al. , 2016 ) , constraint estimation ( Ledent et al. , 2019 ; Neyshabur et al. , 2015 ; Schmidt-Hieber , 2020 ) , and statistical regularization ( Taheri et al. , 2020 ) . The many empirical observations of the benefits of sparsity have sparked interest in mathematical support in the form of statistical theories . But such theories are still scarce and , in any case , have severe limitations . For example , statistical guarantees for deep learning with connection-sparse regularization have been established in Taheri et al . ( 2020 ) , but they do not cover node sparsity , which , in view of the removal of entire nodes , has become especially popular . Moreover , their estimator involves an additional parameter , their theory is limited to a single output node , and their results have a suboptimal dependence on the input vectors . Statistical guarantees for constraint estimation over connection- and node-sparse networks follow from combining results in Neyshabur et al . ( 2015 ) and Bartlett & Mendelson ( 2002 ) . But for computational and practical reasons , regularized estimation is typically preferred over constraint estimation in deep learning as well as in machine learning at large ( Hastie et al. , 2015 ) . Moreover , their theory is limited to a single output node and ReLU activation , scales exponentially in the number of layers , and requires bounded loss functions . Statistical prediction guarantees for constraint estimation over connection-sparse networks have been derived in Schmidt-Hieber ( 2020 ) , but their theory is limited to a single output node and ReLU activation and assumes bounded weights . In short , the existing statistical theory for deep learning with connection and node sparsity is still deficient . The goal of this paper is to provide an improved theory for sparse deep learning . We focus on regression-type settings with layered , feedforward neural networks . The estimators under consideration consist of a standard least-squares estimator with additional regularizers that induce connection or node sparsity . We then derive our guarantees by using techniques from high-dimensional statistics ( Dalalyan et al. , 2017 ) and empirical process theory ( van de Geer , 2000 ) . In the case of subgaussian noise , we find the rates√ l ( log [ mnp ] ) 3 n and √ mlp ( log [ mnp ] ) 3 n for the connection-sparse and node-sparse estimators , respectively , where l is the number of hidden layers , m the number of output nodes , n the number of samples , p the total number of parameters , and p the maximal width of the network . The rates suggest that sparsity-inducing approaches can provide accurate prediction even in very wide ( with connection sparsity ) and very deep ( with either type of sparsity ) networks while , at the same time , ensuring low network complexities . These findings underpin the current trend toward sparse but wide and especially deep networks from a statistical perspective . Outline of the paper Section 2 recapitulates the notions of connection and node sparsity and introduces the corresponding deep learning framework and estimators . Section 3 confirms the empirically-observed accuracies of connection- and node-sparse estimation in theory . Section 4 summarizes the key features and limitations of our work . The Appendix contains all proofs . 2 CONNECTION- AND NODE-SPARSE DEEP LEARNING . We consider data ( y1 , x1 ) , . . . , ( yn , xn ) ∈ Rm × Rd that are related via yi = g∗ [ xi ] + ui for i ∈ { 1 , . . . , n } ( 1 ) for an unknown data-generating function g∗ : Rd → Rm and unknown , random noise u1 , . . . , un ∈ Rm . We allow all aspects , namely yi , g∗ , xi , and ui , to be unbounded . Our goal is to model the data-generating function with a feedforward neural network of the form gΘ [ x ] ··= Θlf l [ Θl−1 · · ·f1 [ Θ0x ] ] for x ∈ Rd ( 2 ) indexed by the parameter space M ··= { Θ = ( Θl , . . . , Θ0 ) : Θj ∈ Rp j+1×pj } . The functions f j : Rpj → Rpj are called the activation functions , and p0 ··= d and pl+1 ··= m are called the input and output dimensions , respectively . The depth of the network is l , the maximal width is p ··= maxj∈ { 0 , ... , l−1 } pj+1 , and the total number of parameters is p ··= ∑l j=0 p j+1pj . In practice , the total number of parameters often rivals or exceeds the number of samples : p ≈ n or p n. We then speak of high dimensionality . A common technique for avoiding overfitting in high-dimensional settings is regularization that induces additional structures , such as sparsity . Sparsity has the interesting side-effect of reducing the networks ’ complexities , which can facilitate interpretations and reduce demands on energy and memory . Our first sparse estimator is Θ̂con ∈ arg min Θ∈M1 { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon|||Θl|||1 } ( 3 ) for a tuning parameter rcon ∈ [ 0 , ∞ ) , a nonempty set of parameters M1 ⊂ { Θ ∈M : max j∈ { 0 , ... , l−1 } |||Θj |||1 ≤ 1 } , and the ` 1-norm |||Θj |||1 ··= pj+1∑ i=1 pj∑ k=1 | ( Θj ) ik| for j ∈ { 0 , . . . , l } , Θj ∈ Rp j+1×pj . This estimator is an analog of the lasso estimator in linear regression ( Tibshirani , 1996 ) . It induces sparsity on the level of connections : the larger the tuning parameter rcon , the fewer connections among the nodes . Deep learning with ` 1-regularization has become common in theory and practice ( Kim et al. , 2016 ; Taheri et al. , 2020 ) . Our estimator ( 3 ) specifies one way to formulate this type of regularization . The estimator is indeed a regularized estimator ( rather than a constraint estimator ) , because the complexity is regulated entirely through the tuning parameter rcon in the objective function ( rather than through a tuning parameter in the set over which the objective function is optimized ) . But ` 1-regularization could also be formulated slightly differently . For example , one could consider the estimators Θcon ∈ arg min Θ∈M { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon l∏ j=0 |||Θj |||1 } ( 4 ) or Θ̃con ∈ arg min Θ∈M { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon l∑ j=0 |||Θj |||1 } . ( 5 ) The differences among the estimators ( 3 ) – ( 5 ) are small : for example , our theory can be adjusted for ( 4 ) with almost no changes of the derivations . The differences among the estimators mainly concern the normalizations of the parameters ; we illustrate this in the following proposition . Proposition 1 ( Scaling of Norms ) . Assume that the all-zeros parameter ( 0pl+1×pl , . . . ,0p1×p0 ) ∈ M1 is neither a solution of ( 3 ) nor of ( 5 ) , that rcon > 0 , and that the activation functions are nonnegative homogenous : f j [ ab ] = af j [ b ] for all j ∈ { 1 , . . . , l } , a ∈ [ 0 , ∞ ) , and b ∈ Rpj . Then , ||| ( Θ̂con ) 0|||1 , . . . , ||| ( Θ̂con ) l−1|||1 = 1 ( concerns the inner layers ) for all solutions of ( 3 ) , while ||| ( Θ̃con ) 0|||1 = · · · = ||| ( Θ̃con ) l|||1 ( concerns all layers ) for at least one solution of ( 5 ) . Another way to formulate ` 1-regularization was proposed in Taheri et al . ( 2020 ) : they reparametrize the networks through a scale parameter and a constraint version ofM and then to focus the regularization on the scale parameter only . Our above-stated estimator ( 3 ) is more elegant in that it avoids the reparametrization and the additional parameter . The factor |||Θl|||1 in the regularization term of ( 3 ) measures the complexity of the network over the set M1 , and the factor rcon regulates the complexity of the resulting estimator . This provides a convenient lever for data-adaptive complexity regularization through well-established calibration schemes for the tuning parameter , such as cross-validation . This practical aspect is an advantage of regularized formulations like ours as compared to constraint estimation over sets with a predefined complexity . The constraints in the setM1 of the estimator ( 3 ) can also retain the expressiveness of the full parameterization that corresponds to the setM : for example , assuming again nonnegative-homogeneous activation , one can check that for every Γ ∈M , there is a Γ′ ∈ { Θ ∈M : maxj∈ { 0 , ... , l−1 } |||Θj |||1 ≤ 1 } such that gΓ = gΓ′—cf . Taheri et al . ( 2020 , Proposition 1 ) . In contrast , existing theories on neural networks often require the parameter space to be bounded , which limits the expressiveness of the networks . Our regularization approach is , therefore , closer to practical setups than constraint approaches . The price is that to develop prediction theories , we have to use different tools than those typically used in theoretical deep learning . For example , we can not use established risk bounds such as Bartlett & Mendelson ( 2002 , Theorem 8 ) ( because Rademacher complexities over classes of unbounded functions are unbounded ) or Lederer ( 2020a , Theorem 1 ) ( because our loss function is not Lipschitz continuous ) or established concentration bounds such as McDiarmid ’ s inequality in McDiarmid ( 1989 , Lemma ( 3.3 ) ) ( because that would require a bounded loss ) . We instead invoke ideas from high-dimensional statistics , prove Lipschitz properties for neural networks , and use empirical process theory that is based on chaining ( see the Appendix ) . Our second estimator is Θ̂node ∈ arg min Θ∈M2,1 { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rnode|||Θl|||2,1 } ( 6 ) for a tuning parameter rnode ∈ [ 0 , ∞ ) , a nonempty set of parameters M2,1 ⊂ { Θ ∈M : max j∈ { 0 , ... , l−1 } |||Θj |||2,1 ≤ 1 } , and the ` 2/ ` 1-norm |||Θj |||2,1 ··= pj∑ k=1 √√√√pj+1∑ i=1 | ( Θj ) ik|2 for j ∈ { 0 , . . . , l − 1 } , Θj ∈ Rp j+1×pj . This estimator is an analog of the group-lasso estimator in linear regression ( Bakin , 1999 ) . Again , to avoid ambiguities in the regularization , our formulation is slightly different from the standard formulations in the literature , but the fact that group-lasso regularizers leads to node-sparse networks has been discussed extensively before ( Alvarez & Salzmann , 2016 ; Liu et al. , 2015 ; Scardapane et al. , 2017 ) : the larger the tuning parameter rnode , the fewer active nodes in the network . The above-stated comments about the specific form of the connection-sparse estimator also apply to the node-sparse estimator . An illustration of connection and node sparsity is given in Figure 1 . Connection-sparse networks have only a small number of active connections between nodes ( left panel of Figure 1 ) ; node-sparse networks have inactive nodes , that is , completely unconnected nodes ( right panel of Figure 1 ) . The two notions of sparsity are connected : for example , connection sparsity can render entire nodes inactive “ by accident ” ( see the layer that follows the input layer in the left panel of the figure ) . In general , node sparsity is the weaker assumption , because it allows for highly connected nodes ; this observation is reflected in the theoretical guarantees in the following section . The optimal network architecture for given data ( such as the optimal width ) is hardly known beforehand in a data analysis . A main feature of sparsity-inducing regularization is , therefore , that it adjusts parts of the network architecture to the data . In other words , sparsity-inducing regularization is a data-driven approach to adapting the complexity of the network . While versions of the estimators ( 3 ) and ( 6 ) are popular in deep learning , statistical analyses , especially of node-sparse deep learning , are scarce . Such a statistical analysis is , therefore , the goal of the following section .
This paper studies the problem of estimating a vector valued regression function by neural networks. They provide a bound on the in-sample prediction error for a neural network estimator under two types of regularizations; one that induces connection sparsity and another that induces node sparsity. The in-sample error is bounded by the in sample error of an estimator computed in the noiseless case.
SP:f6b70565d5b35e145ed9f8cae717dee238f0086c
Connection- and Node-Sparse Deep Learning: Statistical Guarantees
Neural networks are becoming increasingly popular in applications , but a comprehensive mathematical understanding of their potentials and limitations is still missing . In this paper , we study the prediction accuracies of neural networks from a statistical point of view . In particular , we establish statistical guarantees for deep learning with different types of sparsity-inducing regularization . Our bounds feature a mild dependence on network widths and depths , and , therefore , support the current trend toward wide and deep networks . The tools that we use in our derivations are uncommon in deep learning and , hence , might be of additional interest . 1 INTRODUCTION . Sparsity reduces network complexities and , consequently , lowers the demands on memory and computation , reduces overfitting , and improves interpretability ( Changpinyo et al. , 2017 ; Han et al. , 2016 ; Kim et al. , 2016 ; Liu et al. , 2015 ; Wen et al. , 2016 ) . Three common notions of sparsity are connection sparsity , which means that there is only a small number of nonzero connections between nodes , node sparsity , which means that there is only a small number of active nodes ( Alvarez & Salzmann , 2016 ; Changpinyo et al. , 2017 ; Feng & Simon , 2017 ; Kim et al. , 2016 ; Lee et al. , 2008 ; Liu et al. , 2015 ; Nie et al. , 2015 ; Scardapane et al. , 2017 ; Wen et al. , 2016 ) , and layer sparsity , which means that there is only a small number of active layers ( Hebiri & Lederer , 2020 ) . Approaches to achieving sparsity include augmenting small networks ( Ash , 1989 ; Bello , 1992 ) , pruning large networks ( Simonyan & Zisserman , 2015 ; Han et al. , 2016 ) , constraint estimation ( Ledent et al. , 2019 ; Neyshabur et al. , 2015 ; Schmidt-Hieber , 2020 ) , and statistical regularization ( Taheri et al. , 2020 ) . The many empirical observations of the benefits of sparsity have sparked interest in mathematical support in the form of statistical theories . But such theories are still scarce and , in any case , have severe limitations . For example , statistical guarantees for deep learning with connection-sparse regularization have been established in Taheri et al . ( 2020 ) , but they do not cover node sparsity , which , in view of the removal of entire nodes , has become especially popular . Moreover , their estimator involves an additional parameter , their theory is limited to a single output node , and their results have a suboptimal dependence on the input vectors . Statistical guarantees for constraint estimation over connection- and node-sparse networks follow from combining results in Neyshabur et al . ( 2015 ) and Bartlett & Mendelson ( 2002 ) . But for computational and practical reasons , regularized estimation is typically preferred over constraint estimation in deep learning as well as in machine learning at large ( Hastie et al. , 2015 ) . Moreover , their theory is limited to a single output node and ReLU activation , scales exponentially in the number of layers , and requires bounded loss functions . Statistical prediction guarantees for constraint estimation over connection-sparse networks have been derived in Schmidt-Hieber ( 2020 ) , but their theory is limited to a single output node and ReLU activation and assumes bounded weights . In short , the existing statistical theory for deep learning with connection and node sparsity is still deficient . The goal of this paper is to provide an improved theory for sparse deep learning . We focus on regression-type settings with layered , feedforward neural networks . The estimators under consideration consist of a standard least-squares estimator with additional regularizers that induce connection or node sparsity . We then derive our guarantees by using techniques from high-dimensional statistics ( Dalalyan et al. , 2017 ) and empirical process theory ( van de Geer , 2000 ) . In the case of subgaussian noise , we find the rates√ l ( log [ mnp ] ) 3 n and √ mlp ( log [ mnp ] ) 3 n for the connection-sparse and node-sparse estimators , respectively , where l is the number of hidden layers , m the number of output nodes , n the number of samples , p the total number of parameters , and p the maximal width of the network . The rates suggest that sparsity-inducing approaches can provide accurate prediction even in very wide ( with connection sparsity ) and very deep ( with either type of sparsity ) networks while , at the same time , ensuring low network complexities . These findings underpin the current trend toward sparse but wide and especially deep networks from a statistical perspective . Outline of the paper Section 2 recapitulates the notions of connection and node sparsity and introduces the corresponding deep learning framework and estimators . Section 3 confirms the empirically-observed accuracies of connection- and node-sparse estimation in theory . Section 4 summarizes the key features and limitations of our work . The Appendix contains all proofs . 2 CONNECTION- AND NODE-SPARSE DEEP LEARNING . We consider data ( y1 , x1 ) , . . . , ( yn , xn ) ∈ Rm × Rd that are related via yi = g∗ [ xi ] + ui for i ∈ { 1 , . . . , n } ( 1 ) for an unknown data-generating function g∗ : Rd → Rm and unknown , random noise u1 , . . . , un ∈ Rm . We allow all aspects , namely yi , g∗ , xi , and ui , to be unbounded . Our goal is to model the data-generating function with a feedforward neural network of the form gΘ [ x ] ··= Θlf l [ Θl−1 · · ·f1 [ Θ0x ] ] for x ∈ Rd ( 2 ) indexed by the parameter space M ··= { Θ = ( Θl , . . . , Θ0 ) : Θj ∈ Rp j+1×pj } . The functions f j : Rpj → Rpj are called the activation functions , and p0 ··= d and pl+1 ··= m are called the input and output dimensions , respectively . The depth of the network is l , the maximal width is p ··= maxj∈ { 0 , ... , l−1 } pj+1 , and the total number of parameters is p ··= ∑l j=0 p j+1pj . In practice , the total number of parameters often rivals or exceeds the number of samples : p ≈ n or p n. We then speak of high dimensionality . A common technique for avoiding overfitting in high-dimensional settings is regularization that induces additional structures , such as sparsity . Sparsity has the interesting side-effect of reducing the networks ’ complexities , which can facilitate interpretations and reduce demands on energy and memory . Our first sparse estimator is Θ̂con ∈ arg min Θ∈M1 { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon|||Θl|||1 } ( 3 ) for a tuning parameter rcon ∈ [ 0 , ∞ ) , a nonempty set of parameters M1 ⊂ { Θ ∈M : max j∈ { 0 , ... , l−1 } |||Θj |||1 ≤ 1 } , and the ` 1-norm |||Θj |||1 ··= pj+1∑ i=1 pj∑ k=1 | ( Θj ) ik| for j ∈ { 0 , . . . , l } , Θj ∈ Rp j+1×pj . This estimator is an analog of the lasso estimator in linear regression ( Tibshirani , 1996 ) . It induces sparsity on the level of connections : the larger the tuning parameter rcon , the fewer connections among the nodes . Deep learning with ` 1-regularization has become common in theory and practice ( Kim et al. , 2016 ; Taheri et al. , 2020 ) . Our estimator ( 3 ) specifies one way to formulate this type of regularization . The estimator is indeed a regularized estimator ( rather than a constraint estimator ) , because the complexity is regulated entirely through the tuning parameter rcon in the objective function ( rather than through a tuning parameter in the set over which the objective function is optimized ) . But ` 1-regularization could also be formulated slightly differently . For example , one could consider the estimators Θcon ∈ arg min Θ∈M { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon l∏ j=0 |||Θj |||1 } ( 4 ) or Θ̃con ∈ arg min Θ∈M { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rcon l∑ j=0 |||Θj |||1 } . ( 5 ) The differences among the estimators ( 3 ) – ( 5 ) are small : for example , our theory can be adjusted for ( 4 ) with almost no changes of the derivations . The differences among the estimators mainly concern the normalizations of the parameters ; we illustrate this in the following proposition . Proposition 1 ( Scaling of Norms ) . Assume that the all-zeros parameter ( 0pl+1×pl , . . . ,0p1×p0 ) ∈ M1 is neither a solution of ( 3 ) nor of ( 5 ) , that rcon > 0 , and that the activation functions are nonnegative homogenous : f j [ ab ] = af j [ b ] for all j ∈ { 1 , . . . , l } , a ∈ [ 0 , ∞ ) , and b ∈ Rpj . Then , ||| ( Θ̂con ) 0|||1 , . . . , ||| ( Θ̂con ) l−1|||1 = 1 ( concerns the inner layers ) for all solutions of ( 3 ) , while ||| ( Θ̃con ) 0|||1 = · · · = ||| ( Θ̃con ) l|||1 ( concerns all layers ) for at least one solution of ( 5 ) . Another way to formulate ` 1-regularization was proposed in Taheri et al . ( 2020 ) : they reparametrize the networks through a scale parameter and a constraint version ofM and then to focus the regularization on the scale parameter only . Our above-stated estimator ( 3 ) is more elegant in that it avoids the reparametrization and the additional parameter . The factor |||Θl|||1 in the regularization term of ( 3 ) measures the complexity of the network over the set M1 , and the factor rcon regulates the complexity of the resulting estimator . This provides a convenient lever for data-adaptive complexity regularization through well-established calibration schemes for the tuning parameter , such as cross-validation . This practical aspect is an advantage of regularized formulations like ours as compared to constraint estimation over sets with a predefined complexity . The constraints in the setM1 of the estimator ( 3 ) can also retain the expressiveness of the full parameterization that corresponds to the setM : for example , assuming again nonnegative-homogeneous activation , one can check that for every Γ ∈M , there is a Γ′ ∈ { Θ ∈M : maxj∈ { 0 , ... , l−1 } |||Θj |||1 ≤ 1 } such that gΓ = gΓ′—cf . Taheri et al . ( 2020 , Proposition 1 ) . In contrast , existing theories on neural networks often require the parameter space to be bounded , which limits the expressiveness of the networks . Our regularization approach is , therefore , closer to practical setups than constraint approaches . The price is that to develop prediction theories , we have to use different tools than those typically used in theoretical deep learning . For example , we can not use established risk bounds such as Bartlett & Mendelson ( 2002 , Theorem 8 ) ( because Rademacher complexities over classes of unbounded functions are unbounded ) or Lederer ( 2020a , Theorem 1 ) ( because our loss function is not Lipschitz continuous ) or established concentration bounds such as McDiarmid ’ s inequality in McDiarmid ( 1989 , Lemma ( 3.3 ) ) ( because that would require a bounded loss ) . We instead invoke ideas from high-dimensional statistics , prove Lipschitz properties for neural networks , and use empirical process theory that is based on chaining ( see the Appendix ) . Our second estimator is Θ̂node ∈ arg min Θ∈M2,1 { n∑ i=1 ∣∣∣∣yi − gΘ [ xi ] ∣∣∣∣22 + rnode|||Θl|||2,1 } ( 6 ) for a tuning parameter rnode ∈ [ 0 , ∞ ) , a nonempty set of parameters M2,1 ⊂ { Θ ∈M : max j∈ { 0 , ... , l−1 } |||Θj |||2,1 ≤ 1 } , and the ` 2/ ` 1-norm |||Θj |||2,1 ··= pj∑ k=1 √√√√pj+1∑ i=1 | ( Θj ) ik|2 for j ∈ { 0 , . . . , l − 1 } , Θj ∈ Rp j+1×pj . This estimator is an analog of the group-lasso estimator in linear regression ( Bakin , 1999 ) . Again , to avoid ambiguities in the regularization , our formulation is slightly different from the standard formulations in the literature , but the fact that group-lasso regularizers leads to node-sparse networks has been discussed extensively before ( Alvarez & Salzmann , 2016 ; Liu et al. , 2015 ; Scardapane et al. , 2017 ) : the larger the tuning parameter rnode , the fewer active nodes in the network . The above-stated comments about the specific form of the connection-sparse estimator also apply to the node-sparse estimator . An illustration of connection and node sparsity is given in Figure 1 . Connection-sparse networks have only a small number of active connections between nodes ( left panel of Figure 1 ) ; node-sparse networks have inactive nodes , that is , completely unconnected nodes ( right panel of Figure 1 ) . The two notions of sparsity are connected : for example , connection sparsity can render entire nodes inactive “ by accident ” ( see the layer that follows the input layer in the left panel of the figure ) . In general , node sparsity is the weaker assumption , because it allows for highly connected nodes ; this observation is reflected in the theoretical guarantees in the following section . The optimal network architecture for given data ( such as the optimal width ) is hardly known beforehand in a data analysis . A main feature of sparsity-inducing regularization is , therefore , that it adjusts parts of the network architecture to the data . In other words , sparsity-inducing regularization is a data-driven approach to adapting the complexity of the network . While versions of the estimators ( 3 ) and ( 6 ) are popular in deep learning , statistical analyses , especially of node-sparse deep learning , are scarce . Such a statistical analysis is , therefore , the goal of the following section .
This paper studies mean-squared-error bounds for neural networks with small $\ell_1$-norm. The use of $\ell_1$-norm constraint is analogous to the use of LASSO in sparse linear regression. They give a "mean-squared-error" bound because they only analyze a fixed-design setting (where the goal is only to analyze the effect of noise) instead of the random-design setting which requires an additional analysis of generalization to fresh data.
SP:f6b70565d5b35e145ed9f8cae717dee238f0086c
Neural Topic Model via Optimal Transport
1 INTRODUCTION . As an unsupervised approach , topic modelling has enjoyed great success in automatic text analysis . In general , a topic model aims to discover a set of latent topics from a collection of documents , each of which describes an interpretable semantic concept . Topic models like Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) and its hierarchical/Bayesian extensions , e.g. , in Blei et al . ( 2010 ) ; Paisley et al . ( 2015 ) ; Gan et al . ( 2015 ) ; Zhou et al . ( 2016 ) have achieved impressive performance for document analysis . Recently , the developments of Variational AutoEncoders ( VAEs ) and Autoencoding Variational Inference ( AVI ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) have facilitated the proposal of Neural Topic Models ( NTMs ) such as in Miao et al . ( 2016 ) ; Srivastava & Sutton ( 2017 ) ; Krishnan et al . ( 2018 ) ; Burkhardt & Kramer ( 2019 ) . Inspired by VAE , many NTMs use an encoder that takes the Bag-of-Words ( BoW ) representation of a document as input and approximates the posterior distribution of the latent topics . The posterior samples are further input into a decoder to reconstruct the BoW representation . Compared with conventional topic models , NTMs usually enjoy better flexibility and scalability , which are important for the applications on large-scale data . Despite the promising performance and recent popularity , there are several shortcomings for existing NTMs , which could hinder their usefulness and further extensions . i ) The training and inference processes of NTMs are typically complex due to the prior and posterior constructions of latent topics . To encourage topic sparsity and smoothness , Dirichlet ( Burkhardt & Kramer , 2019 ) or gamma ( Zhang et al. , 2018 ) distributions are usually used as the prior and posterior of topics , but reparameterisation is inapplicable to them , thus , complex sampling schemes or approximations have to be used , which could limit the model flexibility . ii ) A desideratum of a topic model is to generate better topical representations of documents with more coherent and diverse topics ; but for many existing NTMs , it is hard to achieve good document representation and coherent/diverse topics at the same time . This is because the objective of NTMs is to achieve lower reconstruction error , which usually means topics are less coherent and diverse , as observed and analysed in Srivastava & Sutton ( 2017 ) ; Burkhardt & Kramer ( 2019 ) . iii ) It is well-known that topic models degrade their performance severely on short documents such as tweets , news headlines and product reviews , as each individual document contains insufficient word co-occurrence information . This issue can be exacerbated for NTMs because of the use of the encoder and decoder networks , which are usually more vulnerable to data sparsity . To address the above shortcomings for NTMs , we in this paper propose a neural topic model , which is built upon a novel Optimal Transport ( OT ) framework derived from a new view of topic modelling . For a document , we consider its content to be encoded by two representations : the observed representation , x , a distribution over all the words in the vocabulary and the latent representation , z , a distribution over all the topics . x can be obtained by normalising a document ’ s word count vector while z needs to be learned by a model . For a document collection , the vocabulary size ( i.e. , the number of unique words ) can be very large but one individual document usually consists of a tiny subset of the words . Therefore , x is a sparse and low-level representation of the semantic information of a document . As the number of topics is much smaller than the vocabulary size , z is the relatively dense and high-level representation of the same content . Therefore , the learning of a topic model can be viewed as the process of learning the distribution z to be as close to the distribution x as possible . Accordingly , it is crucial to investigate how to measure the distance between two distributions with different supports ( i.e. , words to x and topics to z ) . As optimal transport is a powerful tool for measuring the distance travelled in transporting the mass in one distribution to match another given a specific cost function , and recent development on computational OT ( e.g. , in Cuturi ( 2013 ) ; Frogner et al . ( 2015 ) ; Seguy et al . ( 2018 ) ; Peyré et al . ( 2019 ) ) has shown the promising feasibility to efficiently compute OT for large-scale problems , it is natural for us to develop a new NTM based on the minimisation of OT . Specifically , our model leverages an encoder that outputs topic distribution z of a document by taking its word count vector as input like standard NTMs , but we minimise the OT distance between x and z , which are two discrete distributions on the support of words and topics , respectively . Notably , the cost function of the OT distance specifies the weights between topics and words , which we define as the distance in an embedding space . To represent their semantics , all the topics and words are embedded in this space . By leveraging the pretrained word embeddings , the cost function is then a function of topic embeddings , which will be learned jointly with the encoder . With the advanced properties of OT on modelling geometric structures on spaces of probability distributions , our model is able to achieve a better balance between obtaining good document representation and generating coherent/diverse topics . In addition , our model eases the burden of designing complex sampling schemes for the posterior of NTMs . More interestingly , our model is a natural way of incorporating pretrained word embeddings , which have been demonstrated to alleviate the issue of insufficient word co-occurrence information in short texts ( Zhao et al. , 2017 ; Dieng et al. , 2020 ) . With extensive experiments , our model can be shown to enjoy the state-of-the-art performance in terms of both topic quality and document representations for both regular and short texts . 2 BACKGROUND . In this section , we recap the essential background of neural topic models and optimal transport . 2.1 NEURAL TOPIC MODELS . Most of existing NTMs can be viewed as the extensions of the framework of VAEs where the latent variables can be interpreted as topics . Suppose the document collection to be analysed has V unique words ( i.e. , vocabulary size ) . Each document consists of a word count vector denoted as x ∈ NV and a latent distribution over K topics : z ∈ RK . An NTM assumes that z for a document is generated from a prior distribution p ( z ) and x is generated by the conditional distribution pφ ( x|z ) that is modelled by a decoder φ . The model ’ s goal is to infer the topic distribution given the word counts , i.e. , to calculate the posterior p ( z|x ) , which is approximated by the variational distribution qθ ( z|x ) modelled by an encoder θ . Similar to VAEs , the training objective of NTMs is the maximisation of the Evidence Lower BOund ( ELBO ) : max θ , φ ( Eqθ ( z|x ) [ log pφ ( x|z ) ] −KL [ qθ ( z|x ) ‖ p ( z ) ] ) . ( 1 ) The first term above is the expected log-likelihood or reconstruction error . As x is a count-valued vector , it is usually assumed to be generated from the multinomial distribution : pφ ( x|z ) : = Multi ( φ ( z ) ) , where φ ( z ) is a probability vector output from the decoder . Therefore , the expected log-likelihood is proportional to xT log φ ( z ) . The second term is the Kullback–Leibler ( KL ) divergence that regularises qθ ( z|x ) to be close to its prior p ( z ) . To interpret topics with words , φ ( z ) is usually constructed by a single-layer network ( Srivastava & Sutton , 2017 ) : φ ( z ) : = softmax ( Wz ) , where W ∈ RV×K indicates the weights between topics and words . Different NTMs may vary in the prior and the posterior of z , for example , the model in Miao et al . ( 2017 ) applies Gaussian distributions for them and Srivastava & Sutton ( 2017 ) ; Burkhardt & Kramer ( 2019 ) show that Dirichlet is a better choice . However , reparameterisation can not be directly applied to a Dirichlet , so various approximations and sampling schemes have been proposed . 2.2 OPTIMAL TRANSPORT . OT distances have been widely used for the comparison of probabilities . Here we limit our discussion to OT for discrete distributions , although it applies for continuous distributions as well . Specifically , let us consider two probability vectors r ∈ ∆Dr and c ∈ ∆Dc , where ∆D denotes a D − 1 simplex . The OT distance1 between the two probability vectors can be defined as : dM ( r , c ) : = min P∈U ( r , c ) 〈P , M〉 , ( 2 ) where 〈· , ·〉 denotes the Frobenius dot-product ; M ∈ RDr×Dc≥0 is the cost matrix/function of the transport ; P ∈ RDr×Dc > 0 is the transport matrix/plan ; U ( r , c ) denotes the transport polytope of r and c , which is the polyhedral set of Dr × Dc matrices : U ( r , c ) : = { P ∈ RDr×Dc > 0 |P1Dc = r , PT1Dr = c } ; and 1D is the D dimensional vector of ones . Intuitively , if we consider two discrete random variables X ∼ Categorical ( r ) and Y ∼ Categorical ( c ) , the transport matrix P is a joint probability of ( X , Y ) , i.e. , p ( X = i , Y = j ) = pij and U ( r , c ) is the set of all the joint probabilities . The above optimal transport distance can be computed by finding the optimal transport matrix P∗ . It is also noteworthy that the Wasserstein distance can be viewed as a specific case of the OT distances . As directly optimising Eq . ( 2 ) can be time-consuming for large-scale problems , a regularised optimal transport distance with an entropic constraint is introduced in Cuturi ( 2013 ) , named the Sinkhorn distance : dM , α ( r , c ) : = min P∈Uα ( r , c ) 〈P , M〉 , ( 3 ) where Uα ( r , c ) : = { P ∈ U ( r , c ) |h ( P ) ≥ h ( r ) + h ( c ) − α } , h ( · ) is the entropy function , and α ∈ [ 0 , ∞ ) . To compute the Sinkhorn distance , a Lagrange multiplier is introduced for the entropy constraint to minimise Eq . ( 3 ) , resulting in the Sinkhorn algorithm , widely-used for discrete OT problems .
The paper proposes a neural topic model which log-likelihood is regularized by Sinkhorn distance, instead of following Variational AutoEncoder (VAE) approach. The proposed model is hence cannot be interpreted as a probabilistic generative model. Still, with respect to metrics such as Topic Coherence and Topic Diversity which don't require probabilistic interpretation of topic model, the proposed model performs very well across five standard benchmark datasets for topic modeling.
SP:a020f6bca5d85f83d595e5b724e32394009dcd7e