paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Introducing Sample Robustness
1 INTRODUCTION : . In the age of automated machine learning , we shift our focus evermore towards regarding metahyperparameters such as model-type or training- and validation budget as variables of a loss function in the most abstract sense . For training sets , however , the mere number of samples often determines how well suited it is perceived for a particular task . The motivation of this work is to introduce a concept allowing for the use of datasets as variables of such a generalised loss function as well . Imagine , for example , patients who share almost identical medical records , but react differently to some prescribed treatment . They may pose a challenge to machine learning models similar to what is known as natural adversarial examples in vision tasks , see Hendrycks et al . ( 2019 ) . The relationship between medical features and appropriate personal treatments may be sensitive towards small input variations , i.e . not robust towards perturbations . In this work , we are to the best of our knowledge the first to introduce and analyse a model-agnostic measure for the robustness of data . We show that knowledge about the robustness distribution of a specific test ( sub ) set can allow for choosing a more appropriate training ( sub ) set in terms of performance optimisation . Finally , we discover that the optimal choice of hyperparameters may also depend on the robustness distributions of both training- and test data . Let us motivate the concept of sample robustness first on a high level . When collecting and processing a dataset for a pre-defined task , we identify certain features and expressive samples such that a model may be able to abstract and generalise from these finite points to the whole space of possible inputs . Assume we have a certain rectangle-shaped data-distribution in a circle-shaped feature space and a dataset labelled according to two distinct ground truth maps y∗ ∈ { × , ∗ } and z∗ ∈ { ◦ , } ( comp . Figure 1 ) . Here , one can imagine classifying images of horses and cats ( assuming ground truth y∗ ) and classifying images of animal-human pairs ( assuming ground truth z∗ ) . Evidently , the distance between differently labelled samples depends on the ground truth map labelling them . For every sample in a dataset , the intrinsic information of closeness to a differently labelled sample can be considered a feature itself . For regression tasks and label distributions which are not necessarily categorical one may also include the distance of the corresponding labels as additional information . By taking the quotient of these two and maximising it over the dataset , i.e . calculating a point-wise Lipschitz constant of the label map , one can measure how sensitive a sample is to label- changing perturbations . Precisely this is the non-formal basis of the concept we propose , namely sample robustness . Our work aims to analyse the connection between both model performance and aligning the robustness distributions of training- and test sets . 1.1 OUTLINE . After citing and discussing related work concerned with decision boundaries , model robustness and Lipschitz calculus in section 2 , we introduce the mathematical framework and the measure of sample robustness in section 3 . We also motivate the concept theoretically and show some natural relations to K-Nearest Neighbour models . Section 4 is completely devoted to the evaluation using different datasets ( CIFAR-10 , Online News Popularity Dataset ) and models ( Convolutional Neural Networks , K-Nearest Neighbour , Random Forest ) . Section 5 finally concludes the findings and discusses other research approaches . Letters A - F refer to sections in the appendix . 2 RELATED WORK : . Analysing the data-distribution before training yields a way to investigate ( and boost ) model performance from an earlier stage as is done by unsupervised pre-training ( Erhan et al. , 2010 ) ) . Many algorithms stemming from the unsupervised setting ( Chigirev & Bialek , 2003 ; Cayton , 2005 ) are devoted to extract information about the so-called data-manifold ( Fefferman et al. , 2013 ; Bernstein & Kuleshov , 2014 ) . Decoding the latent features which determine the data-distribution ( Bengio et al. , 2013 ) provides valuable insight and helps to understand the decision boundaries which a model learns throughout the training phase . Furthermore , understanding the data-manifold may provide a view into the ” black box ” transforming inputs to outputs ( Fawzi et al. , 2016 ; Liu et al. , 2017 ; Biggio et al. , 2013 ) . In this work , we want to use the intrinsic information of distance between samples in feature space and relate it to the distance of the corresponding labels to introduce a new dataset-dependent feature . The robustness of a sample can be regarded as its susceptibility to label-changing perturbations . Here , one is immediately reminded of adversarial examples ( Szegedy et al. , 2013 ) in the context of model robustness . The difference to our proposed concept , however , is that we only use the pre-defined labels instead of model predictions as additional input . The term robustness itself is one of the most prominent throughout the recent literature in many different contexts , from robust attacks to robust models/defences ( Evtimov et al. , 2017 ; Beggel et al. , 2019 ; Madry et al. , 2017 ; Weng et al. , 2018 ; Tsuzuku et al. , 2018 ) . State-of-the-art machine learning models are susceptible to noise , especially so when crafted purposefully ( Fawzi et al. , 2016 ) . It leaves these powerful machines vulnerable to attacks either at training- ( Zhu et al. , 2019 ) or at test stage ( Biggio et al. , 2013 ) , independent of the architecture used ( Papernot et al. , 2016b ) . We follow the idea that models are extensions of the label map from the ( metric ) subspace defined by a dataset to the whole feature space . Hence , they will inherit critical properties from the data . In this work we analyse the robustness distribution of datasets and the thereon dependent performances of models , but plan on investigating the connection to model-robustness in the future . Lipschitz calculus yields a mathematically well-understood approach to describe and measure model robustness as in Weng et al . ( 2018 ) or Tsuzuku et al . ( 2018 ) . Framing machine learning theory in terms of metric spaces ( and also building robustness concepts thereon ) has been done before in Wang et al . ( 2016 ) , however , not explicitly connecting it to Lipschitz calculus . In this work , we build the concept of sample robustness based on a point-wise Lipschitz constant of the label map for metric- and Banach spaces such that it applies to a wide range of different feature- and label spaces including an ample variety of metrics . Finally , investigating the dependence of model-hyperparameters on data has been done previously ( Nakkiran et al. , 2020 ) . The authors also showed that more data could sometimes decrease model performance . In this work , we will see similar results regarding these two aspects with the difference that we could identify such data even before training using the proposed measure of sample robustness . 3 SAMPLE ROBUSTNESS . Now we will introduce the primary concept of this work , namely sample robustness . It measures how sensitive samples are to label-changing perturbations relative to the magnitude of the label map . 3.1 DEFINITION : ( FRAMEWORK ) . Let FS be a feature space , i.e . a metric space with metric d : = dFS , let T S be a target- or label space , i.e . a real Banach space with norm ‖ · ‖ : = ‖ · ‖T S , let x , t ⊆ FS be finite ( data ) sets with # x , # t ≥ 2 and let y : x ∪ t→ T S be a map of labels with # y ( x ) = # y ( t ) ≥ 2 . 3.2 DEFINITION : ( REACH ) . Let x ∈ FS be a sample with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) : = { x̃ ∈ x | y ( x ) 6= y ( x̃ ) } . The reach of x is defined as the distance of x to Γx ( x ) : rx ( x ) : = dist ( x , Γx ( x ) ) = min x̃∈Γx ( x ) d ( x , x̃ ) In other words : Γx ( x ) is the set of samples x̃ in the dataset x that are labelled differently from x . One may notice that x̃ ∈ Γx ( x ) ⇔ x ∈ Γx ( x̃ ) . The reach of x ∈ x is exactly the minimal distance of the point representing the image of a ” cat ” to a differently labelled ( coloured ) point in Figure . 1 . If x is ” close ” to x̃ , one would expect their labels y ( x ) and y ( x̃ ) to be ” close ” as well . Taking the quotient then gives a measure of this error ( comp . 3.3 ) and normalising the latter with respect to the magnitude of y ( using ‖y‖∞ : = max x∈x ‖y ( x ) ‖ ) yields the main concept of sample robustness in 3.4 . 3.3 DEFINITION : ( POINT-WISE LIPSCHITZ CONSTANT ) . For x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 one defines a point-wise Lipschitz constant of y as : Qx ( x ) : = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) 3.4 DEFINITION AND PROPOSITION : ( SAMPLE ROBUSTNESS ) . Let x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 . The robustness of the sample x in x with respect to d is defined as : Rx ( x ) : = ‖y‖∞ Qx ( x ) + ‖y‖∞ ∈ ( 0 , 1 ) It is independent of rescaling the label map y ( comp . A.2 ) . Coming back to the example in the introduction , we can see now that the almost identical medical records of patients reacting differently to the same treatment are considered as less robust samples in the above sense . 3.5 THEORETIC MOTIVATION AND BACKGROUND . Assume we have datasets x and t where both are labelled using the same label map y with max x∈x ‖y ( x ) ‖ = max t∈t ‖y ( t ) ‖ . For any z ∈ x ∪ t it holds that : Qx ∪ t ( z ) = max { Qx ( z ) , Qt ( z ) } ⇔ Rx ∪ t ( z ) = min { Rx ( z ) , Rt ( z ) } In other words : the closerRx ( z ) is toRt ( z ) , the closer both values are to the robustness of z in the union x ∪ t. It follows : Rx ( z ) ≈ Rt ( z ) ⇒ Rx ( z ) ≈ Rx ∪ t ( z ) ≈ Rt ( z ) , where at least one side is an equality . For convenience , we write x ∼R t : ⇔ Rx ( z ) ≈ Rt ( z ) ∀ z ∈ x ∪ t. Assume now that F is an extension of the label map y from x to x ∪ t1 . For given t one can downsize the set x to x̃ ⊂ x in order to align both robustness distributions ; however , there will likely be a trade-off between this alignment and the distance of F to y as maps on t , because there are less points to extend from ( therefore allowing for a higher variance ) . For such an extension F it holds that F|x ≡ y|x , thus : Qx ( x ) = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) = max x̃∈Γx ( x ) ‖F ( x ) − F ( x̃ ) ‖ d ( x , x̃ ) ∀ x ∈ x Assuming x ∼R t then enables the following conclusion for z ∈ x ∪ t : ( ∗ ) Qx ∪ t ( z ) ≈ Qx ( z ) = max z̃∈Γx ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ( z ) ‖ ( F ( z ) − y ( z̃ ) ) + z‖ d ( z , z̃ ) , where z : = y ( z ) −F ( z ) . Notably , the rights side depends at most on one point outside x . Therefore it includes at most one z compared to the naive approach including both z and z̃ : Qx ∪ t ( z ) = max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ∪ t ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + ( z − z̃ ) ‖ d ( z , z̃ ) To summarize : by assuming x ∼R t one can find a small γz such thatQx ∪ t ( z ) = Qx ( z ) + γz and trade z̃ ∈ T S for γz ∈ R. But whereas the first depends on the extension F , the latter only depends on the data . Let now L ( F − y ) be the Lipschitz constant of the map F − y on x ∪ t. Using ( ∗ ) and the reverse triangle inequality one can derive the following ( comp . A.4 ) : L ( F − y ) ≥ max z∈x ∪ t ∣∣∣ max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ = max z∈x ∪ t ∣∣∣ max z̃∈Γx ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + z‖ d ( z , z̃ ) + γz − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ Hence , z̃ and γz determine a lower bound on L ( F − y ) and decreasing it a priori may allow for finding an extension F that minimizes both ‖F − y‖∞ and L ( F − y ) at the same time . By aligning the robustness distributions of x and t this bound will not only depend on the extension F , but on the data ( trading the possibly uncontrollable for the controllable ) . Finally , the true motive for such an approach stems from functional analysis : the space of Lipschitz functions from x ∪ t to T S , i.e . Lip ( x ∪ t , T S ) , is a Banach space with respect to the norm ‖ · ‖sum : = ‖ · ‖∞ + L ( · ) ( comp . Cobzaş et al . ( 2019 ) ) . So by regarding extensions F of y that minimise ‖F − y‖sum we a priori restrict the size of the hypothesis space from arbitrary maps to Lipschitz maps . The completeness of Lip ( x ∪ t , T S ) is of importance as it prevents sequences of extensions ( Fn ) with ‖Fn−y‖sum → 0 to exit this smaller space2 . 1One may think of a machine learning model F trained on x making predictions on t. 2Training a machine learning model produces exactly such a sequence Fn .
This work introduces the concept of sample robustness – based on computing the pointwise Lipschitz constant of a data point – and use it to empirically analyze the effects of training on least and most robust training subsets on the performance for different models. This is done for both classification and regression setups. It is shown that the model performance can be sometimes improved by choosing particular training subsets and hyperparameters depending on the robustness distribution of the test (sub)sets.
SP:4b6f04ff09138f33a9e9bf6434d1ee1ad04b4daf
Introducing Sample Robustness
1 INTRODUCTION : . In the age of automated machine learning , we shift our focus evermore towards regarding metahyperparameters such as model-type or training- and validation budget as variables of a loss function in the most abstract sense . For training sets , however , the mere number of samples often determines how well suited it is perceived for a particular task . The motivation of this work is to introduce a concept allowing for the use of datasets as variables of such a generalised loss function as well . Imagine , for example , patients who share almost identical medical records , but react differently to some prescribed treatment . They may pose a challenge to machine learning models similar to what is known as natural adversarial examples in vision tasks , see Hendrycks et al . ( 2019 ) . The relationship between medical features and appropriate personal treatments may be sensitive towards small input variations , i.e . not robust towards perturbations . In this work , we are to the best of our knowledge the first to introduce and analyse a model-agnostic measure for the robustness of data . We show that knowledge about the robustness distribution of a specific test ( sub ) set can allow for choosing a more appropriate training ( sub ) set in terms of performance optimisation . Finally , we discover that the optimal choice of hyperparameters may also depend on the robustness distributions of both training- and test data . Let us motivate the concept of sample robustness first on a high level . When collecting and processing a dataset for a pre-defined task , we identify certain features and expressive samples such that a model may be able to abstract and generalise from these finite points to the whole space of possible inputs . Assume we have a certain rectangle-shaped data-distribution in a circle-shaped feature space and a dataset labelled according to two distinct ground truth maps y∗ ∈ { × , ∗ } and z∗ ∈ { ◦ , } ( comp . Figure 1 ) . Here , one can imagine classifying images of horses and cats ( assuming ground truth y∗ ) and classifying images of animal-human pairs ( assuming ground truth z∗ ) . Evidently , the distance between differently labelled samples depends on the ground truth map labelling them . For every sample in a dataset , the intrinsic information of closeness to a differently labelled sample can be considered a feature itself . For regression tasks and label distributions which are not necessarily categorical one may also include the distance of the corresponding labels as additional information . By taking the quotient of these two and maximising it over the dataset , i.e . calculating a point-wise Lipschitz constant of the label map , one can measure how sensitive a sample is to label- changing perturbations . Precisely this is the non-formal basis of the concept we propose , namely sample robustness . Our work aims to analyse the connection between both model performance and aligning the robustness distributions of training- and test sets . 1.1 OUTLINE . After citing and discussing related work concerned with decision boundaries , model robustness and Lipschitz calculus in section 2 , we introduce the mathematical framework and the measure of sample robustness in section 3 . We also motivate the concept theoretically and show some natural relations to K-Nearest Neighbour models . Section 4 is completely devoted to the evaluation using different datasets ( CIFAR-10 , Online News Popularity Dataset ) and models ( Convolutional Neural Networks , K-Nearest Neighbour , Random Forest ) . Section 5 finally concludes the findings and discusses other research approaches . Letters A - F refer to sections in the appendix . 2 RELATED WORK : . Analysing the data-distribution before training yields a way to investigate ( and boost ) model performance from an earlier stage as is done by unsupervised pre-training ( Erhan et al. , 2010 ) ) . Many algorithms stemming from the unsupervised setting ( Chigirev & Bialek , 2003 ; Cayton , 2005 ) are devoted to extract information about the so-called data-manifold ( Fefferman et al. , 2013 ; Bernstein & Kuleshov , 2014 ) . Decoding the latent features which determine the data-distribution ( Bengio et al. , 2013 ) provides valuable insight and helps to understand the decision boundaries which a model learns throughout the training phase . Furthermore , understanding the data-manifold may provide a view into the ” black box ” transforming inputs to outputs ( Fawzi et al. , 2016 ; Liu et al. , 2017 ; Biggio et al. , 2013 ) . In this work , we want to use the intrinsic information of distance between samples in feature space and relate it to the distance of the corresponding labels to introduce a new dataset-dependent feature . The robustness of a sample can be regarded as its susceptibility to label-changing perturbations . Here , one is immediately reminded of adversarial examples ( Szegedy et al. , 2013 ) in the context of model robustness . The difference to our proposed concept , however , is that we only use the pre-defined labels instead of model predictions as additional input . The term robustness itself is one of the most prominent throughout the recent literature in many different contexts , from robust attacks to robust models/defences ( Evtimov et al. , 2017 ; Beggel et al. , 2019 ; Madry et al. , 2017 ; Weng et al. , 2018 ; Tsuzuku et al. , 2018 ) . State-of-the-art machine learning models are susceptible to noise , especially so when crafted purposefully ( Fawzi et al. , 2016 ) . It leaves these powerful machines vulnerable to attacks either at training- ( Zhu et al. , 2019 ) or at test stage ( Biggio et al. , 2013 ) , independent of the architecture used ( Papernot et al. , 2016b ) . We follow the idea that models are extensions of the label map from the ( metric ) subspace defined by a dataset to the whole feature space . Hence , they will inherit critical properties from the data . In this work we analyse the robustness distribution of datasets and the thereon dependent performances of models , but plan on investigating the connection to model-robustness in the future . Lipschitz calculus yields a mathematically well-understood approach to describe and measure model robustness as in Weng et al . ( 2018 ) or Tsuzuku et al . ( 2018 ) . Framing machine learning theory in terms of metric spaces ( and also building robustness concepts thereon ) has been done before in Wang et al . ( 2016 ) , however , not explicitly connecting it to Lipschitz calculus . In this work , we build the concept of sample robustness based on a point-wise Lipschitz constant of the label map for metric- and Banach spaces such that it applies to a wide range of different feature- and label spaces including an ample variety of metrics . Finally , investigating the dependence of model-hyperparameters on data has been done previously ( Nakkiran et al. , 2020 ) . The authors also showed that more data could sometimes decrease model performance . In this work , we will see similar results regarding these two aspects with the difference that we could identify such data even before training using the proposed measure of sample robustness . 3 SAMPLE ROBUSTNESS . Now we will introduce the primary concept of this work , namely sample robustness . It measures how sensitive samples are to label-changing perturbations relative to the magnitude of the label map . 3.1 DEFINITION : ( FRAMEWORK ) . Let FS be a feature space , i.e . a metric space with metric d : = dFS , let T S be a target- or label space , i.e . a real Banach space with norm ‖ · ‖ : = ‖ · ‖T S , let x , t ⊆ FS be finite ( data ) sets with # x , # t ≥ 2 and let y : x ∪ t→ T S be a map of labels with # y ( x ) = # y ( t ) ≥ 2 . 3.2 DEFINITION : ( REACH ) . Let x ∈ FS be a sample with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) : = { x̃ ∈ x | y ( x ) 6= y ( x̃ ) } . The reach of x is defined as the distance of x to Γx ( x ) : rx ( x ) : = dist ( x , Γx ( x ) ) = min x̃∈Γx ( x ) d ( x , x̃ ) In other words : Γx ( x ) is the set of samples x̃ in the dataset x that are labelled differently from x . One may notice that x̃ ∈ Γx ( x ) ⇔ x ∈ Γx ( x̃ ) . The reach of x ∈ x is exactly the minimal distance of the point representing the image of a ” cat ” to a differently labelled ( coloured ) point in Figure . 1 . If x is ” close ” to x̃ , one would expect their labels y ( x ) and y ( x̃ ) to be ” close ” as well . Taking the quotient then gives a measure of this error ( comp . 3.3 ) and normalising the latter with respect to the magnitude of y ( using ‖y‖∞ : = max x∈x ‖y ( x ) ‖ ) yields the main concept of sample robustness in 3.4 . 3.3 DEFINITION : ( POINT-WISE LIPSCHITZ CONSTANT ) . For x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 one defines a point-wise Lipschitz constant of y as : Qx ( x ) : = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) 3.4 DEFINITION AND PROPOSITION : ( SAMPLE ROBUSTNESS ) . Let x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 . The robustness of the sample x in x with respect to d is defined as : Rx ( x ) : = ‖y‖∞ Qx ( x ) + ‖y‖∞ ∈ ( 0 , 1 ) It is independent of rescaling the label map y ( comp . A.2 ) . Coming back to the example in the introduction , we can see now that the almost identical medical records of patients reacting differently to the same treatment are considered as less robust samples in the above sense . 3.5 THEORETIC MOTIVATION AND BACKGROUND . Assume we have datasets x and t where both are labelled using the same label map y with max x∈x ‖y ( x ) ‖ = max t∈t ‖y ( t ) ‖ . For any z ∈ x ∪ t it holds that : Qx ∪ t ( z ) = max { Qx ( z ) , Qt ( z ) } ⇔ Rx ∪ t ( z ) = min { Rx ( z ) , Rt ( z ) } In other words : the closerRx ( z ) is toRt ( z ) , the closer both values are to the robustness of z in the union x ∪ t. It follows : Rx ( z ) ≈ Rt ( z ) ⇒ Rx ( z ) ≈ Rx ∪ t ( z ) ≈ Rt ( z ) , where at least one side is an equality . For convenience , we write x ∼R t : ⇔ Rx ( z ) ≈ Rt ( z ) ∀ z ∈ x ∪ t. Assume now that F is an extension of the label map y from x to x ∪ t1 . For given t one can downsize the set x to x̃ ⊂ x in order to align both robustness distributions ; however , there will likely be a trade-off between this alignment and the distance of F to y as maps on t , because there are less points to extend from ( therefore allowing for a higher variance ) . For such an extension F it holds that F|x ≡ y|x , thus : Qx ( x ) = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) = max x̃∈Γx ( x ) ‖F ( x ) − F ( x̃ ) ‖ d ( x , x̃ ) ∀ x ∈ x Assuming x ∼R t then enables the following conclusion for z ∈ x ∪ t : ( ∗ ) Qx ∪ t ( z ) ≈ Qx ( z ) = max z̃∈Γx ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ( z ) ‖ ( F ( z ) − y ( z̃ ) ) + z‖ d ( z , z̃ ) , where z : = y ( z ) −F ( z ) . Notably , the rights side depends at most on one point outside x . Therefore it includes at most one z compared to the naive approach including both z and z̃ : Qx ∪ t ( z ) = max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ∪ t ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + ( z − z̃ ) ‖ d ( z , z̃ ) To summarize : by assuming x ∼R t one can find a small γz such thatQx ∪ t ( z ) = Qx ( z ) + γz and trade z̃ ∈ T S for γz ∈ R. But whereas the first depends on the extension F , the latter only depends on the data . Let now L ( F − y ) be the Lipschitz constant of the map F − y on x ∪ t. Using ( ∗ ) and the reverse triangle inequality one can derive the following ( comp . A.4 ) : L ( F − y ) ≥ max z∈x ∪ t ∣∣∣ max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ = max z∈x ∪ t ∣∣∣ max z̃∈Γx ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + z‖ d ( z , z̃ ) + γz − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ Hence , z̃ and γz determine a lower bound on L ( F − y ) and decreasing it a priori may allow for finding an extension F that minimizes both ‖F − y‖∞ and L ( F − y ) at the same time . By aligning the robustness distributions of x and t this bound will not only depend on the extension F , but on the data ( trading the possibly uncontrollable for the controllable ) . Finally , the true motive for such an approach stems from functional analysis : the space of Lipschitz functions from x ∪ t to T S , i.e . Lip ( x ∪ t , T S ) , is a Banach space with respect to the norm ‖ · ‖sum : = ‖ · ‖∞ + L ( · ) ( comp . Cobzaş et al . ( 2019 ) ) . So by regarding extensions F of y that minimise ‖F − y‖sum we a priori restrict the size of the hypothesis space from arbitrary maps to Lipschitz maps . The completeness of Lip ( x ∪ t , T S ) is of importance as it prevents sequences of extensions ( Fn ) with ‖Fn−y‖sum → 0 to exit this smaller space2 . 1One may think of a machine learning model F trained on x making predictions on t. 2Training a machine learning model produces exactly such a sequence Fn .
The authors introduce sample robustness, a pointwise measure of the sensitivity of the label map to perturbations in the feature space. They do so by taking the pointwise Lipschitz constant of the label map and normalizing it by the label norm. The authors show that training on samples that are / are not sensitive helps on a test set that is / is not sensitive.
SP:4b6f04ff09138f33a9e9bf6434d1ee1ad04b4daf
Introducing Sample Robustness
1 INTRODUCTION : . In the age of automated machine learning , we shift our focus evermore towards regarding metahyperparameters such as model-type or training- and validation budget as variables of a loss function in the most abstract sense . For training sets , however , the mere number of samples often determines how well suited it is perceived for a particular task . The motivation of this work is to introduce a concept allowing for the use of datasets as variables of such a generalised loss function as well . Imagine , for example , patients who share almost identical medical records , but react differently to some prescribed treatment . They may pose a challenge to machine learning models similar to what is known as natural adversarial examples in vision tasks , see Hendrycks et al . ( 2019 ) . The relationship between medical features and appropriate personal treatments may be sensitive towards small input variations , i.e . not robust towards perturbations . In this work , we are to the best of our knowledge the first to introduce and analyse a model-agnostic measure for the robustness of data . We show that knowledge about the robustness distribution of a specific test ( sub ) set can allow for choosing a more appropriate training ( sub ) set in terms of performance optimisation . Finally , we discover that the optimal choice of hyperparameters may also depend on the robustness distributions of both training- and test data . Let us motivate the concept of sample robustness first on a high level . When collecting and processing a dataset for a pre-defined task , we identify certain features and expressive samples such that a model may be able to abstract and generalise from these finite points to the whole space of possible inputs . Assume we have a certain rectangle-shaped data-distribution in a circle-shaped feature space and a dataset labelled according to two distinct ground truth maps y∗ ∈ { × , ∗ } and z∗ ∈ { ◦ , } ( comp . Figure 1 ) . Here , one can imagine classifying images of horses and cats ( assuming ground truth y∗ ) and classifying images of animal-human pairs ( assuming ground truth z∗ ) . Evidently , the distance between differently labelled samples depends on the ground truth map labelling them . For every sample in a dataset , the intrinsic information of closeness to a differently labelled sample can be considered a feature itself . For regression tasks and label distributions which are not necessarily categorical one may also include the distance of the corresponding labels as additional information . By taking the quotient of these two and maximising it over the dataset , i.e . calculating a point-wise Lipschitz constant of the label map , one can measure how sensitive a sample is to label- changing perturbations . Precisely this is the non-formal basis of the concept we propose , namely sample robustness . Our work aims to analyse the connection between both model performance and aligning the robustness distributions of training- and test sets . 1.1 OUTLINE . After citing and discussing related work concerned with decision boundaries , model robustness and Lipschitz calculus in section 2 , we introduce the mathematical framework and the measure of sample robustness in section 3 . We also motivate the concept theoretically and show some natural relations to K-Nearest Neighbour models . Section 4 is completely devoted to the evaluation using different datasets ( CIFAR-10 , Online News Popularity Dataset ) and models ( Convolutional Neural Networks , K-Nearest Neighbour , Random Forest ) . Section 5 finally concludes the findings and discusses other research approaches . Letters A - F refer to sections in the appendix . 2 RELATED WORK : . Analysing the data-distribution before training yields a way to investigate ( and boost ) model performance from an earlier stage as is done by unsupervised pre-training ( Erhan et al. , 2010 ) ) . Many algorithms stemming from the unsupervised setting ( Chigirev & Bialek , 2003 ; Cayton , 2005 ) are devoted to extract information about the so-called data-manifold ( Fefferman et al. , 2013 ; Bernstein & Kuleshov , 2014 ) . Decoding the latent features which determine the data-distribution ( Bengio et al. , 2013 ) provides valuable insight and helps to understand the decision boundaries which a model learns throughout the training phase . Furthermore , understanding the data-manifold may provide a view into the ” black box ” transforming inputs to outputs ( Fawzi et al. , 2016 ; Liu et al. , 2017 ; Biggio et al. , 2013 ) . In this work , we want to use the intrinsic information of distance between samples in feature space and relate it to the distance of the corresponding labels to introduce a new dataset-dependent feature . The robustness of a sample can be regarded as its susceptibility to label-changing perturbations . Here , one is immediately reminded of adversarial examples ( Szegedy et al. , 2013 ) in the context of model robustness . The difference to our proposed concept , however , is that we only use the pre-defined labels instead of model predictions as additional input . The term robustness itself is one of the most prominent throughout the recent literature in many different contexts , from robust attacks to robust models/defences ( Evtimov et al. , 2017 ; Beggel et al. , 2019 ; Madry et al. , 2017 ; Weng et al. , 2018 ; Tsuzuku et al. , 2018 ) . State-of-the-art machine learning models are susceptible to noise , especially so when crafted purposefully ( Fawzi et al. , 2016 ) . It leaves these powerful machines vulnerable to attacks either at training- ( Zhu et al. , 2019 ) or at test stage ( Biggio et al. , 2013 ) , independent of the architecture used ( Papernot et al. , 2016b ) . We follow the idea that models are extensions of the label map from the ( metric ) subspace defined by a dataset to the whole feature space . Hence , they will inherit critical properties from the data . In this work we analyse the robustness distribution of datasets and the thereon dependent performances of models , but plan on investigating the connection to model-robustness in the future . Lipschitz calculus yields a mathematically well-understood approach to describe and measure model robustness as in Weng et al . ( 2018 ) or Tsuzuku et al . ( 2018 ) . Framing machine learning theory in terms of metric spaces ( and also building robustness concepts thereon ) has been done before in Wang et al . ( 2016 ) , however , not explicitly connecting it to Lipschitz calculus . In this work , we build the concept of sample robustness based on a point-wise Lipschitz constant of the label map for metric- and Banach spaces such that it applies to a wide range of different feature- and label spaces including an ample variety of metrics . Finally , investigating the dependence of model-hyperparameters on data has been done previously ( Nakkiran et al. , 2020 ) . The authors also showed that more data could sometimes decrease model performance . In this work , we will see similar results regarding these two aspects with the difference that we could identify such data even before training using the proposed measure of sample robustness . 3 SAMPLE ROBUSTNESS . Now we will introduce the primary concept of this work , namely sample robustness . It measures how sensitive samples are to label-changing perturbations relative to the magnitude of the label map . 3.1 DEFINITION : ( FRAMEWORK ) . Let FS be a feature space , i.e . a metric space with metric d : = dFS , let T S be a target- or label space , i.e . a real Banach space with norm ‖ · ‖ : = ‖ · ‖T S , let x , t ⊆ FS be finite ( data ) sets with # x , # t ≥ 2 and let y : x ∪ t→ T S be a map of labels with # y ( x ) = # y ( t ) ≥ 2 . 3.2 DEFINITION : ( REACH ) . Let x ∈ FS be a sample with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) : = { x̃ ∈ x | y ( x ) 6= y ( x̃ ) } . The reach of x is defined as the distance of x to Γx ( x ) : rx ( x ) : = dist ( x , Γx ( x ) ) = min x̃∈Γx ( x ) d ( x , x̃ ) In other words : Γx ( x ) is the set of samples x̃ in the dataset x that are labelled differently from x . One may notice that x̃ ∈ Γx ( x ) ⇔ x ∈ Γx ( x̃ ) . The reach of x ∈ x is exactly the minimal distance of the point representing the image of a ” cat ” to a differently labelled ( coloured ) point in Figure . 1 . If x is ” close ” to x̃ , one would expect their labels y ( x ) and y ( x̃ ) to be ” close ” as well . Taking the quotient then gives a measure of this error ( comp . 3.3 ) and normalising the latter with respect to the magnitude of y ( using ‖y‖∞ : = max x∈x ‖y ( x ) ‖ ) yields the main concept of sample robustness in 3.4 . 3.3 DEFINITION : ( POINT-WISE LIPSCHITZ CONSTANT ) . For x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 one defines a point-wise Lipschitz constant of y as : Qx ( x ) : = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) 3.4 DEFINITION AND PROPOSITION : ( SAMPLE ROBUSTNESS ) . Let x ∈ FS with label y ( x ) , ‖y ( x ) ‖ ≤ ‖y‖∞ , and Γx ( x ) as in 3.2 . The robustness of the sample x in x with respect to d is defined as : Rx ( x ) : = ‖y‖∞ Qx ( x ) + ‖y‖∞ ∈ ( 0 , 1 ) It is independent of rescaling the label map y ( comp . A.2 ) . Coming back to the example in the introduction , we can see now that the almost identical medical records of patients reacting differently to the same treatment are considered as less robust samples in the above sense . 3.5 THEORETIC MOTIVATION AND BACKGROUND . Assume we have datasets x and t where both are labelled using the same label map y with max x∈x ‖y ( x ) ‖ = max t∈t ‖y ( t ) ‖ . For any z ∈ x ∪ t it holds that : Qx ∪ t ( z ) = max { Qx ( z ) , Qt ( z ) } ⇔ Rx ∪ t ( z ) = min { Rx ( z ) , Rt ( z ) } In other words : the closerRx ( z ) is toRt ( z ) , the closer both values are to the robustness of z in the union x ∪ t. It follows : Rx ( z ) ≈ Rt ( z ) ⇒ Rx ( z ) ≈ Rx ∪ t ( z ) ≈ Rt ( z ) , where at least one side is an equality . For convenience , we write x ∼R t : ⇔ Rx ( z ) ≈ Rt ( z ) ∀ z ∈ x ∪ t. Assume now that F is an extension of the label map y from x to x ∪ t1 . For given t one can downsize the set x to x̃ ⊂ x in order to align both robustness distributions ; however , there will likely be a trade-off between this alignment and the distance of F to y as maps on t , because there are less points to extend from ( therefore allowing for a higher variance ) . For such an extension F it holds that F|x ≡ y|x , thus : Qx ( x ) = max x̃∈Γx ( x ) ‖y ( x ) − y ( x̃ ) ‖ d ( x , x̃ ) = max x̃∈Γx ( x ) ‖F ( x ) − F ( x̃ ) ‖ d ( x , x̃ ) ∀ x ∈ x Assuming x ∼R t then enables the following conclusion for z ∈ x ∪ t : ( ∗ ) Qx ∪ t ( z ) ≈ Qx ( z ) = max z̃∈Γx ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ( z ) ‖ ( F ( z ) − y ( z̃ ) ) + z‖ d ( z , z̃ ) , where z : = y ( z ) −F ( z ) . Notably , the rights side depends at most on one point outside x . Therefore it includes at most one z compared to the naive approach including both z and z̃ : Qx ∪ t ( z ) = max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) = max z̃∈Γx ∪ t ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + ( z − z̃ ) ‖ d ( z , z̃ ) To summarize : by assuming x ∼R t one can find a small γz such thatQx ∪ t ( z ) = Qx ( z ) + γz and trade z̃ ∈ T S for γz ∈ R. But whereas the first depends on the extension F , the latter only depends on the data . Let now L ( F − y ) be the Lipschitz constant of the map F − y on x ∪ t. Using ( ∗ ) and the reverse triangle inequality one can derive the following ( comp . A.4 ) : L ( F − y ) ≥ max z∈x ∪ t ∣∣∣ max z̃∈Γx ∪ t ( z ) ‖y ( z ) − y ( z̃ ) ‖ d ( z , z̃ ) − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ = max z∈x ∪ t ∣∣∣ max z̃∈Γx ( z ) ‖ ( F ( z ) − F ( z̃ ) ) + z‖ d ( z , z̃ ) + γz − max z̃∈Γx ∪ t ( z ) ‖F ( z ) − F ( z̃ ) ‖ d ( z , z̃ ) ∣∣∣ Hence , z̃ and γz determine a lower bound on L ( F − y ) and decreasing it a priori may allow for finding an extension F that minimizes both ‖F − y‖∞ and L ( F − y ) at the same time . By aligning the robustness distributions of x and t this bound will not only depend on the extension F , but on the data ( trading the possibly uncontrollable for the controllable ) . Finally , the true motive for such an approach stems from functional analysis : the space of Lipschitz functions from x ∪ t to T S , i.e . Lip ( x ∪ t , T S ) , is a Banach space with respect to the norm ‖ · ‖sum : = ‖ · ‖∞ + L ( · ) ( comp . Cobzaş et al . ( 2019 ) ) . So by regarding extensions F of y that minimise ‖F − y‖sum we a priori restrict the size of the hypothesis space from arbitrary maps to Lipschitz maps . The completeness of Lip ( x ∪ t , T S ) is of importance as it prevents sequences of extensions ( Fn ) with ‖Fn−y‖sum → 0 to exit this smaller space2 . 1One may think of a machine learning model F trained on x making predictions on t. 2Training a machine learning model produces exactly such a sequence Fn .
This work investigates how to choose the right training set and hyper-parameter for a test set. The authors claim that they introduce a concept of sample robustness based on the Lipschitz constant of the label map. The authors then empirically evaluate the robustness distribution of two datasets and investigate the model performance when using training subsets from different parts of the robustness distribution.
SP:4b6f04ff09138f33a9e9bf6434d1ee1ad04b4daf
Mutual Information State Intrinsic Control
1 INTRODUCTION . Reinforcement learning ( RL ) allows an agent to learn meaningful skills by interacting with an environment and optimizing some reward function , provided by the environment . Although RL has achieved impressive achievements on various tasks ( Silver et al. , 2017 ; Mnih et al. , 2015 ; Berner et al. , 2019 ) , it is very expensive to provide dense rewards for every task we want the robot to learn . Intrinsically motivated reinforcement learning encourages the agent to explore by providing an “ internal motivation ” instead , such as curiosity ( Schmidhuber , 1991 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , diversity ( Gregor et al. , 2016 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2019 ) and empowerment ( Klyubin et al. , 2005 ; Salge et al. , 2014 ; Mohamed & Rezende , 2015 ) . Those internal motivations can be computed on the fly when the agent is interacting with the environment , without any human engineered reward . We hope to extract useful “ skills ” from those internally motivated agents , which could later be used to solve downstream tasks , or simply augment the sparse reward with those intrinsic rewards to solve a given task faster . Most of the previous works in RL model the environment as a Markov Decision Process ( MDP ) . In an MDP , we use a single state vector to describe the current state of the whole environment , without explicitly distinguishing the agent itself from its surrounding . However , in the physical world , there is a clear boundary between an intelligent agent and its surrounding . The skin of any mammal is an example of such boundary . The separation of the agent and its surrounding also holds true for most of the man-made agents , such as any mechanical robot . This agent-surrounding separation has been studied for a long time in psychology under the concept of self-consciousness . Self-consciousness refers that a subject knows itself is the object of awareness ( Smith , 2020 ) , effectively treating the agent itself differently from everything else . Gallup ( 1970 ) has shown that self-consciousness widely exists in chimpanzees , dolphins , some elephants and human infants . To equally emphasize the agent and its surrounding , we name this separation as agent-surrounding separation in this paper . The widely adopted MDP formulation ignores the natural agent-surrounding separation , but simply stacks the agent state and its surrounding state together as a single state vector . Although this formulation is mathematically concise , we argue that it is over-simplistic , and as a result , it makes the learning harder . With this agent-surrounding separation in mind , we are able to design a much more efficient intrinsically motivated RL algorithm . We propose a new intrinsic motivation by encouraging the agent to ∗Correspondence to : Rui Zhao { zhaorui.in.germany @ gmail.com } . perform actions such that the resulting agent state should have high Mutual Information ( MI ) with the surrounding state . Intuitively , the higher the MI , the more control the agent could have on its surrounding . We name the proposed method “ MUtual information-based State Intrinsic Control ” , or MUSIC in short . With the proposed MUSIC method , we are able to learn many complex skills in an unsupervised manner , such as learning to pick up an object without any task reward . We can also augment a sparse reward with the dense MUSIC intrinsic reward , to accelerate the learning process . Our contributions are three-fold . First , we propose a novel intrinsic motivation ( MUSIC ) that encourages the agent to have maximum control on its surrounding , based on the natural agentsurrounding separation assumption . Secondly , we propose scalable objectives that make the MUSIC intrinsic reward easy to optimize . Last but not least , we show MUSIC ’ s superior performance , by comparing it with other competitive intrinsic rewards on multiple environments . Noticeably , with our method , for the first time the pick-and-place task can be solved without any task reward . 2 PRELIMINARIES . For environments , we consider four robotic tasks , including push , slide , pick-and-place , and navigation , as shown in Figure 2 . The goal in the manipulation task is to move the target object to a desired position . For the navigation task , the goal is to navigate to a target ball . In the following , we define some terminologies . 2.1 AGENT STATE , SURROUNDING STATE , AND REINFORCEMENT LEARNING SETTINGS . In this paper , the agent state sa means literally the state variable of the agent . The surrounding state ss refers to the state variable that describes the surrounding of the agent , for example , the state variable of an object . For multi-goal environments , we use the same assumption as previous works ( Andrychowicz et al. , 2017 ; Plappert et al. , 2018 ) , which consider that the goals can be represented as states and we denote the goal variable as g. For example , in the manipulation task , a goal is a particular desired position of the object in the episode . These desired positions , i.e. , goals , are sampled from the environment . The division between the agent state and the surrounding state is naturally defined by the agentsurrounding separation concept introduced in Section 1 . From a biology point of view , a human can naturally distinguish its own parts , like hands or legs from the environments . Analog to this , when we design a robotic system , we can easily know what is the agent state and what is its surrounding state . In this paper , we use upper letters , such as S , to denote random variables and the corresponding lower case letter , such as s , to represent the values of random variables . We assume the world is fully observable , including a set of states S , a set of actionsA , a distribution of initial states p ( s0 ) , transition probabilities p ( st+1 | st , at ) , a reward function r : S ×A → R , and a discount factor γ ∈ [ 0 , 1 ] . These components formulate a Markov Decision Process represented as a tuple , ( S , A , p , r , γ ) . We use τ to denote a trajectory , which contains a series of agent states and surrounding states . Its random variable is denoted as T . 3 METHOD . We focus on agent learning to control its surrounding purely by using its observations and actions without supervision . Motivated by the idea that when an agent takes control of its surrounding , then there is a high MI between the agent state and the surrounding state , we formulate the problem of learning without external supervision as one of learning a policy πθ ( at | st ) with parameters θ to maximize intrinsic MI rewards , r = I ( Sa ; Ss ) . In this section , we formally describe our method , mutual information-based state intrinsic control ( MUSIC ) . 3.1 MUTUAL INFORMATION REWARD FUNCTION . Our framework simultaneously learns a policy and an intrinsic reward function by maximizing the MI between the surrounding state and the agent state . Mathematically , the MI between the surround- ing state random variable Ss and the agent state random variable Sa is represented as follows : I ( Ss ; Sa ) = KL ( PSsSa || PSs ⊗ PSa ) ( 1 ) = sup T : Ω→R EPSsSa [ T ] − log ( EPSs⊗PSa [ e T ] ) ( 2 ) ≥ sup φ∈Φ EPSsSa [ Tφ ] − log ( EPSs⊗PSa [ e Tφ ] ) : = IΦ ( S s ; Sa ) , ( 3 ) where PSsSa is the joint probability distribution ; PSs ⊗ PSa is the product of the marginal distributions PSs and PSa ; KL denotes the Kullback-Leibler ( KL ) divergence . MI is notoriously difficult to compute in real-world settings ( Hjelm et al. , 2019 ) . Compared to the variational information maximizing-based approaches ( Barber & Agakov , 2003 ; Alemi et al. , 2016 ; Chalk et al. , 2016 ; Kolchinsky et al. , 2017 ) , the recent MINE-based approaches have shown superior performance ( Belghazi et al. , 2018 ; Hjelm et al. , 2019 ; Velickovic et al. , 2019 ) . Motivated by MINE ( Belghazi et al. , 2018 ) , we use a lower bound to approximate the MI quantity I ( Ss ; Sa ) . First , we rewrite Equation ( 1 ) , the KL formulation of the MI objective , using the Donsker-Varadhan representation , to Equation ( 2 ) ( Donsker & Varadhan , 1975 ) . The input space Ω is a compact domain of Rd , i.e. , Ω ⊂ Rd , and the supremum is taken over all functions T such that the two expectations are finite . Secondly , we lower bound the MI in the Donsker-Varadhan representation with the compression lemma in the PAC-Bayes literature and derive Equation ( 3 ) ( Banerjee , 2006 ; Belghazi et al. , 2018 ) . The expectations in Equation ( 3 ) are estimated by using empirical samples from PSsSa and PSs ⊗ PSa . The statistics model Tφ is parameterized by a deep neural network with parameters φ ∈ Φ , whose inputs are the empirical samples . 3.2 EFFECTIVELY COMPUTING THE MUTUAL INFORMATION REWARD IN PRACTICE . Lemma 1 . There is a monotonically increasing relationship between Iφ ( Ss ; Sa | T ) and EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , mathematically , Iφ ( S s ; Sa | T ) n EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , ( 4 ) where Ss , Sa , and T denote the surrounding state , the agent state , and the trajectory , respectively . The trajectory fractions are defined as the adjacent state pairs , namely T ′ = { St , St+1 } . The symbol n denotes a monotonically increasing relationship between two variables and φ represents the parameter of the statistics model in MINE . Proof . See Appendix A . We define the reward for each transition at a given time-step as the mutual information of the pair of adjacent states at that time-step , see Equation ( 4 ) Right-Hand Side ( RHS ) . However , in practice , we find that it is not very efficient to train the MI estimator using state pairs . To counter this issue , we use all the states in the same trajectory in a batch to train the MI estimator , see Equation ( 4 ) LeftHand Side ( LHS ) , since more empirical samples help to reduce variance and therefore accelerate learning . In Lemma 1 , we prove the monotonically increasing relationship between Equation ( 4 ) RHS and Equation ( 4 ) LHS . In more detail , we divide the process of computing rewards into two phases , i.e. , the training phase and the evaluation phase . In the training phase , we efficiently train the MI estimator with a large batch of samples from the whole trajectory . For training the MI estimator network , we first randomly sample the trajectory τ from the replay buffer . Then , the states sat used for calculating the product of marginal distributions are sampled by shuffling the states sat from the joint distribution along the temporal axis t within the trajectory . We use back-propagation to optimize the parameter ( φ ) to maximize the MI lower bound , see Equation ( 4 ) LHS . For evaluating the MI reward , we use a pair of transitions to calculate the transition reward , see Equation ( 4 ) RHS and Equation ( 5 ) , instead of using the complete trajectory . Each time , to calculate the MI reward for the transition , the reward is calculated over a small fraction of the complete trajectory τ ′ , namely r = Iφ ( Ss ; Sa | T ′ ) . The trajectory fraction , τ ′ , is defined as adjacent state pairs , τ ′ = { st , st+1 } , and T ′ represents its corresponding random variable . The derived Lemma 1 brings us two important benefits . First , it enables us to efficiently train the MI estimator using all the states in the same trajectory . And a large batch of empirical samples reduce the variance of the gradients . Secondly , it allows us to estimate the MI reward for each transition with only the relevant state pair . This way of estimating MI enables us to assign rewards more accurately at the transition level . Based on Lemma 1 , we calculate the transition reward as the MI of each trajectory fraction , namely rφ ( at , st ) : = Iφ ( S s ; Sa|T ′ ) = 0.5 ∑t+1 i=tTφ ( s s i , s a i ) − log ( 0.5 ∑t+1 i=t e Tφ ( s s i , s̄ a i ) ) , ( 5 ) where ( ssi , s a i ) ∼ PSsSa|T ′ , s̄ai ∼ PSa|T ′ , and τ ′ = { st , st+1 } . In case that the estimated MI value is particularly small , we scale the reward with a hyper-parameter α and clip the reward between 0 and 1 . MUSIC can be combined with any off-the-shelf reinforcement learning methods , such as deep deterministic policy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) and soft actor-critic ( SAC ) ( Haarnoja et al. , 2018 ) . We summarize the complete training algorithm in Algorithm 1 and in Figure 1 . MUSIC Variants with Task Rewards : The introduced MUSIC method is an unsupervised reinforcement learning approach , which is denoted as “ MUSIC-u ” , where “ -u ” stands for unsupervised learning . We propose three ways of using MUSIC to accelerate learning . The first method is using the MUSIC-u pretrained policy as the parameter initialization and then fine-tuning the agent with the task rewards . We denote this variant as “ MUSIC-f ” , where “ -f ” stands for fine-tuning . The second variant is to use the MI intrinsic reward to help the agent to explore more efficiently . Here , the MI reward and the task reward are added together . We name this method as “ MUSIC-r ” , where “ -r ” stands for reward . The third approach is to use the MI quantity from MUSIC to prioritize trajectories for replay . The approach is similar to the TD-error-based prioritized experience replay ( PER ) ( Schaul et al. , 2016 ) . The only difference is that we use the estimated MI instead of the TD-error as the priority for sampling . We name this method as “ MUSIC-p ” , where “ -p ” stands for prioritization . Skill Discovery with MUSIC and DIAYN : One of the relevant works on unsupervised RL , DIAYN ( Eysenbach et al. , 2019 ) , introduces an information-theoretical objective FDIAYN , which learns diverse discriminable skills indexed by the latent variable Z , mathematically , FDIAYN = I ( S ; Z ) + H ( A | S , Z ) . The first term , I ( S ; Z ) , in the objective , FDIAYN , is implemented via a skill discriminator , which serves as a variational lower bound of the original objective ( Barber & Agakov , 2003 ; Eysenbach et al. , 2019 ) . The skill discriminator assigns high rewards to the agent , if it can predict the skill-options , Z , given the states , S. Here , we substitute the full state S with the surrounding state Ss to encourage the agent to learn control skills . DIAYN and MUSIC can be combined as follows : FMUSIC+DIAYN = I ( Sa ; Ss ) +I ( Ss ; Z ) +H ( A | S , Z ) . The combined version enables the agent to learn diverse control primitives via skill-conditioned policy ( Eysenbach et al. , 2019 ) in an unsupervised fashion . Comparison and Combination with DISCERN : Another relevant work is Discriminative Embedding Reward Networks ( DISCERN ) ( Warde-Farley et al. , 2019 ) , whose objective is to maximize the MI between the state S and the goal G , namely I ( S ; G ) . While MUSIC ’ s objective is to maximize the MI between the agent state Sa and the surrounding state Ss , namely I ( Sa ; Ss ) . Intuitively , DISCERN attempts to reach a particular goal in each episode , while our method tries to manipulate the surrounding state to any different value . MUSIC and DISCERN can be combined as FMUSIC+DISCERN = I ( Sa ; Ss ) + I ( S ; G ) . Optionally , we can replace the full states S with Ss , since it performs better than with S empirically . Through this combination , MUSIC helps DISCERN to learn its discriminative objective .
The paper propose MUSIC, an RL algorithm for learning controllers in a unsupervised way. They key idea of the proposed algorithm is to separate the state of the robot like joint angles from the state of the environments such as location of an external object and optimize the mutual information between the two set of states. By maximizing this mutual information, the resulting policy learns to better control the environment and can be used to train downstream tasks. The paper experimented with different ways of training the downstream tasks and demonstrated favorable results compared to prior methods.
SP:611076294a9cdaec02976c2de7df7292fcb88d2b
Mutual Information State Intrinsic Control
1 INTRODUCTION . Reinforcement learning ( RL ) allows an agent to learn meaningful skills by interacting with an environment and optimizing some reward function , provided by the environment . Although RL has achieved impressive achievements on various tasks ( Silver et al. , 2017 ; Mnih et al. , 2015 ; Berner et al. , 2019 ) , it is very expensive to provide dense rewards for every task we want the robot to learn . Intrinsically motivated reinforcement learning encourages the agent to explore by providing an “ internal motivation ” instead , such as curiosity ( Schmidhuber , 1991 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , diversity ( Gregor et al. , 2016 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2019 ) and empowerment ( Klyubin et al. , 2005 ; Salge et al. , 2014 ; Mohamed & Rezende , 2015 ) . Those internal motivations can be computed on the fly when the agent is interacting with the environment , without any human engineered reward . We hope to extract useful “ skills ” from those internally motivated agents , which could later be used to solve downstream tasks , or simply augment the sparse reward with those intrinsic rewards to solve a given task faster . Most of the previous works in RL model the environment as a Markov Decision Process ( MDP ) . In an MDP , we use a single state vector to describe the current state of the whole environment , without explicitly distinguishing the agent itself from its surrounding . However , in the physical world , there is a clear boundary between an intelligent agent and its surrounding . The skin of any mammal is an example of such boundary . The separation of the agent and its surrounding also holds true for most of the man-made agents , such as any mechanical robot . This agent-surrounding separation has been studied for a long time in psychology under the concept of self-consciousness . Self-consciousness refers that a subject knows itself is the object of awareness ( Smith , 2020 ) , effectively treating the agent itself differently from everything else . Gallup ( 1970 ) has shown that self-consciousness widely exists in chimpanzees , dolphins , some elephants and human infants . To equally emphasize the agent and its surrounding , we name this separation as agent-surrounding separation in this paper . The widely adopted MDP formulation ignores the natural agent-surrounding separation , but simply stacks the agent state and its surrounding state together as a single state vector . Although this formulation is mathematically concise , we argue that it is over-simplistic , and as a result , it makes the learning harder . With this agent-surrounding separation in mind , we are able to design a much more efficient intrinsically motivated RL algorithm . We propose a new intrinsic motivation by encouraging the agent to ∗Correspondence to : Rui Zhao { zhaorui.in.germany @ gmail.com } . perform actions such that the resulting agent state should have high Mutual Information ( MI ) with the surrounding state . Intuitively , the higher the MI , the more control the agent could have on its surrounding . We name the proposed method “ MUtual information-based State Intrinsic Control ” , or MUSIC in short . With the proposed MUSIC method , we are able to learn many complex skills in an unsupervised manner , such as learning to pick up an object without any task reward . We can also augment a sparse reward with the dense MUSIC intrinsic reward , to accelerate the learning process . Our contributions are three-fold . First , we propose a novel intrinsic motivation ( MUSIC ) that encourages the agent to have maximum control on its surrounding , based on the natural agentsurrounding separation assumption . Secondly , we propose scalable objectives that make the MUSIC intrinsic reward easy to optimize . Last but not least , we show MUSIC ’ s superior performance , by comparing it with other competitive intrinsic rewards on multiple environments . Noticeably , with our method , for the first time the pick-and-place task can be solved without any task reward . 2 PRELIMINARIES . For environments , we consider four robotic tasks , including push , slide , pick-and-place , and navigation , as shown in Figure 2 . The goal in the manipulation task is to move the target object to a desired position . For the navigation task , the goal is to navigate to a target ball . In the following , we define some terminologies . 2.1 AGENT STATE , SURROUNDING STATE , AND REINFORCEMENT LEARNING SETTINGS . In this paper , the agent state sa means literally the state variable of the agent . The surrounding state ss refers to the state variable that describes the surrounding of the agent , for example , the state variable of an object . For multi-goal environments , we use the same assumption as previous works ( Andrychowicz et al. , 2017 ; Plappert et al. , 2018 ) , which consider that the goals can be represented as states and we denote the goal variable as g. For example , in the manipulation task , a goal is a particular desired position of the object in the episode . These desired positions , i.e. , goals , are sampled from the environment . The division between the agent state and the surrounding state is naturally defined by the agentsurrounding separation concept introduced in Section 1 . From a biology point of view , a human can naturally distinguish its own parts , like hands or legs from the environments . Analog to this , when we design a robotic system , we can easily know what is the agent state and what is its surrounding state . In this paper , we use upper letters , such as S , to denote random variables and the corresponding lower case letter , such as s , to represent the values of random variables . We assume the world is fully observable , including a set of states S , a set of actionsA , a distribution of initial states p ( s0 ) , transition probabilities p ( st+1 | st , at ) , a reward function r : S ×A → R , and a discount factor γ ∈ [ 0 , 1 ] . These components formulate a Markov Decision Process represented as a tuple , ( S , A , p , r , γ ) . We use τ to denote a trajectory , which contains a series of agent states and surrounding states . Its random variable is denoted as T . 3 METHOD . We focus on agent learning to control its surrounding purely by using its observations and actions without supervision . Motivated by the idea that when an agent takes control of its surrounding , then there is a high MI between the agent state and the surrounding state , we formulate the problem of learning without external supervision as one of learning a policy πθ ( at | st ) with parameters θ to maximize intrinsic MI rewards , r = I ( Sa ; Ss ) . In this section , we formally describe our method , mutual information-based state intrinsic control ( MUSIC ) . 3.1 MUTUAL INFORMATION REWARD FUNCTION . Our framework simultaneously learns a policy and an intrinsic reward function by maximizing the MI between the surrounding state and the agent state . Mathematically , the MI between the surround- ing state random variable Ss and the agent state random variable Sa is represented as follows : I ( Ss ; Sa ) = KL ( PSsSa || PSs ⊗ PSa ) ( 1 ) = sup T : Ω→R EPSsSa [ T ] − log ( EPSs⊗PSa [ e T ] ) ( 2 ) ≥ sup φ∈Φ EPSsSa [ Tφ ] − log ( EPSs⊗PSa [ e Tφ ] ) : = IΦ ( S s ; Sa ) , ( 3 ) where PSsSa is the joint probability distribution ; PSs ⊗ PSa is the product of the marginal distributions PSs and PSa ; KL denotes the Kullback-Leibler ( KL ) divergence . MI is notoriously difficult to compute in real-world settings ( Hjelm et al. , 2019 ) . Compared to the variational information maximizing-based approaches ( Barber & Agakov , 2003 ; Alemi et al. , 2016 ; Chalk et al. , 2016 ; Kolchinsky et al. , 2017 ) , the recent MINE-based approaches have shown superior performance ( Belghazi et al. , 2018 ; Hjelm et al. , 2019 ; Velickovic et al. , 2019 ) . Motivated by MINE ( Belghazi et al. , 2018 ) , we use a lower bound to approximate the MI quantity I ( Ss ; Sa ) . First , we rewrite Equation ( 1 ) , the KL formulation of the MI objective , using the Donsker-Varadhan representation , to Equation ( 2 ) ( Donsker & Varadhan , 1975 ) . The input space Ω is a compact domain of Rd , i.e. , Ω ⊂ Rd , and the supremum is taken over all functions T such that the two expectations are finite . Secondly , we lower bound the MI in the Donsker-Varadhan representation with the compression lemma in the PAC-Bayes literature and derive Equation ( 3 ) ( Banerjee , 2006 ; Belghazi et al. , 2018 ) . The expectations in Equation ( 3 ) are estimated by using empirical samples from PSsSa and PSs ⊗ PSa . The statistics model Tφ is parameterized by a deep neural network with parameters φ ∈ Φ , whose inputs are the empirical samples . 3.2 EFFECTIVELY COMPUTING THE MUTUAL INFORMATION REWARD IN PRACTICE . Lemma 1 . There is a monotonically increasing relationship between Iφ ( Ss ; Sa | T ) and EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , mathematically , Iφ ( S s ; Sa | T ) n EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , ( 4 ) where Ss , Sa , and T denote the surrounding state , the agent state , and the trajectory , respectively . The trajectory fractions are defined as the adjacent state pairs , namely T ′ = { St , St+1 } . The symbol n denotes a monotonically increasing relationship between two variables and φ represents the parameter of the statistics model in MINE . Proof . See Appendix A . We define the reward for each transition at a given time-step as the mutual information of the pair of adjacent states at that time-step , see Equation ( 4 ) Right-Hand Side ( RHS ) . However , in practice , we find that it is not very efficient to train the MI estimator using state pairs . To counter this issue , we use all the states in the same trajectory in a batch to train the MI estimator , see Equation ( 4 ) LeftHand Side ( LHS ) , since more empirical samples help to reduce variance and therefore accelerate learning . In Lemma 1 , we prove the monotonically increasing relationship between Equation ( 4 ) RHS and Equation ( 4 ) LHS . In more detail , we divide the process of computing rewards into two phases , i.e. , the training phase and the evaluation phase . In the training phase , we efficiently train the MI estimator with a large batch of samples from the whole trajectory . For training the MI estimator network , we first randomly sample the trajectory τ from the replay buffer . Then , the states sat used for calculating the product of marginal distributions are sampled by shuffling the states sat from the joint distribution along the temporal axis t within the trajectory . We use back-propagation to optimize the parameter ( φ ) to maximize the MI lower bound , see Equation ( 4 ) LHS . For evaluating the MI reward , we use a pair of transitions to calculate the transition reward , see Equation ( 4 ) RHS and Equation ( 5 ) , instead of using the complete trajectory . Each time , to calculate the MI reward for the transition , the reward is calculated over a small fraction of the complete trajectory τ ′ , namely r = Iφ ( Ss ; Sa | T ′ ) . The trajectory fraction , τ ′ , is defined as adjacent state pairs , τ ′ = { st , st+1 } , and T ′ represents its corresponding random variable . The derived Lemma 1 brings us two important benefits . First , it enables us to efficiently train the MI estimator using all the states in the same trajectory . And a large batch of empirical samples reduce the variance of the gradients . Secondly , it allows us to estimate the MI reward for each transition with only the relevant state pair . This way of estimating MI enables us to assign rewards more accurately at the transition level . Based on Lemma 1 , we calculate the transition reward as the MI of each trajectory fraction , namely rφ ( at , st ) : = Iφ ( S s ; Sa|T ′ ) = 0.5 ∑t+1 i=tTφ ( s s i , s a i ) − log ( 0.5 ∑t+1 i=t e Tφ ( s s i , s̄ a i ) ) , ( 5 ) where ( ssi , s a i ) ∼ PSsSa|T ′ , s̄ai ∼ PSa|T ′ , and τ ′ = { st , st+1 } . In case that the estimated MI value is particularly small , we scale the reward with a hyper-parameter α and clip the reward between 0 and 1 . MUSIC can be combined with any off-the-shelf reinforcement learning methods , such as deep deterministic policy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) and soft actor-critic ( SAC ) ( Haarnoja et al. , 2018 ) . We summarize the complete training algorithm in Algorithm 1 and in Figure 1 . MUSIC Variants with Task Rewards : The introduced MUSIC method is an unsupervised reinforcement learning approach , which is denoted as “ MUSIC-u ” , where “ -u ” stands for unsupervised learning . We propose three ways of using MUSIC to accelerate learning . The first method is using the MUSIC-u pretrained policy as the parameter initialization and then fine-tuning the agent with the task rewards . We denote this variant as “ MUSIC-f ” , where “ -f ” stands for fine-tuning . The second variant is to use the MI intrinsic reward to help the agent to explore more efficiently . Here , the MI reward and the task reward are added together . We name this method as “ MUSIC-r ” , where “ -r ” stands for reward . The third approach is to use the MI quantity from MUSIC to prioritize trajectories for replay . The approach is similar to the TD-error-based prioritized experience replay ( PER ) ( Schaul et al. , 2016 ) . The only difference is that we use the estimated MI instead of the TD-error as the priority for sampling . We name this method as “ MUSIC-p ” , where “ -p ” stands for prioritization . Skill Discovery with MUSIC and DIAYN : One of the relevant works on unsupervised RL , DIAYN ( Eysenbach et al. , 2019 ) , introduces an information-theoretical objective FDIAYN , which learns diverse discriminable skills indexed by the latent variable Z , mathematically , FDIAYN = I ( S ; Z ) + H ( A | S , Z ) . The first term , I ( S ; Z ) , in the objective , FDIAYN , is implemented via a skill discriminator , which serves as a variational lower bound of the original objective ( Barber & Agakov , 2003 ; Eysenbach et al. , 2019 ) . The skill discriminator assigns high rewards to the agent , if it can predict the skill-options , Z , given the states , S. Here , we substitute the full state S with the surrounding state Ss to encourage the agent to learn control skills . DIAYN and MUSIC can be combined as follows : FMUSIC+DIAYN = I ( Sa ; Ss ) +I ( Ss ; Z ) +H ( A | S , Z ) . The combined version enables the agent to learn diverse control primitives via skill-conditioned policy ( Eysenbach et al. , 2019 ) in an unsupervised fashion . Comparison and Combination with DISCERN : Another relevant work is Discriminative Embedding Reward Networks ( DISCERN ) ( Warde-Farley et al. , 2019 ) , whose objective is to maximize the MI between the state S and the goal G , namely I ( S ; G ) . While MUSIC ’ s objective is to maximize the MI between the agent state Sa and the surrounding state Ss , namely I ( Sa ; Ss ) . Intuitively , DISCERN attempts to reach a particular goal in each episode , while our method tries to manipulate the surrounding state to any different value . MUSIC and DISCERN can be combined as FMUSIC+DISCERN = I ( Sa ; Ss ) + I ( S ; G ) . Optionally , we can replace the full states S with Ss , since it performs better than with S empirically . Through this combination , MUSIC helps DISCERN to learn its discriminative objective .
This work introduces MUSIC, a framework for intrinsically motivated RL, where the intrinsic reward comes from maximizing the mutual information between the agent's state and the surrounding environment's state. The authors motivate and describe this approach, explain its incorporation into various training modes, exhaustively characterize its properties, and compare to numerous related past approaches. Although it is somewhat specific to particular environment domains, MUSIC offers a compelling addition to the family of intrinsically motivated RL algorithms based on concepts of mutual information.
SP:611076294a9cdaec02976c2de7df7292fcb88d2b
Mutual Information State Intrinsic Control
1 INTRODUCTION . Reinforcement learning ( RL ) allows an agent to learn meaningful skills by interacting with an environment and optimizing some reward function , provided by the environment . Although RL has achieved impressive achievements on various tasks ( Silver et al. , 2017 ; Mnih et al. , 2015 ; Berner et al. , 2019 ) , it is very expensive to provide dense rewards for every task we want the robot to learn . Intrinsically motivated reinforcement learning encourages the agent to explore by providing an “ internal motivation ” instead , such as curiosity ( Schmidhuber , 1991 ; Pathak et al. , 2017 ; Burda et al. , 2018 ) , diversity ( Gregor et al. , 2016 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2019 ) and empowerment ( Klyubin et al. , 2005 ; Salge et al. , 2014 ; Mohamed & Rezende , 2015 ) . Those internal motivations can be computed on the fly when the agent is interacting with the environment , without any human engineered reward . We hope to extract useful “ skills ” from those internally motivated agents , which could later be used to solve downstream tasks , or simply augment the sparse reward with those intrinsic rewards to solve a given task faster . Most of the previous works in RL model the environment as a Markov Decision Process ( MDP ) . In an MDP , we use a single state vector to describe the current state of the whole environment , without explicitly distinguishing the agent itself from its surrounding . However , in the physical world , there is a clear boundary between an intelligent agent and its surrounding . The skin of any mammal is an example of such boundary . The separation of the agent and its surrounding also holds true for most of the man-made agents , such as any mechanical robot . This agent-surrounding separation has been studied for a long time in psychology under the concept of self-consciousness . Self-consciousness refers that a subject knows itself is the object of awareness ( Smith , 2020 ) , effectively treating the agent itself differently from everything else . Gallup ( 1970 ) has shown that self-consciousness widely exists in chimpanzees , dolphins , some elephants and human infants . To equally emphasize the agent and its surrounding , we name this separation as agent-surrounding separation in this paper . The widely adopted MDP formulation ignores the natural agent-surrounding separation , but simply stacks the agent state and its surrounding state together as a single state vector . Although this formulation is mathematically concise , we argue that it is over-simplistic , and as a result , it makes the learning harder . With this agent-surrounding separation in mind , we are able to design a much more efficient intrinsically motivated RL algorithm . We propose a new intrinsic motivation by encouraging the agent to ∗Correspondence to : Rui Zhao { zhaorui.in.germany @ gmail.com } . perform actions such that the resulting agent state should have high Mutual Information ( MI ) with the surrounding state . Intuitively , the higher the MI , the more control the agent could have on its surrounding . We name the proposed method “ MUtual information-based State Intrinsic Control ” , or MUSIC in short . With the proposed MUSIC method , we are able to learn many complex skills in an unsupervised manner , such as learning to pick up an object without any task reward . We can also augment a sparse reward with the dense MUSIC intrinsic reward , to accelerate the learning process . Our contributions are three-fold . First , we propose a novel intrinsic motivation ( MUSIC ) that encourages the agent to have maximum control on its surrounding , based on the natural agentsurrounding separation assumption . Secondly , we propose scalable objectives that make the MUSIC intrinsic reward easy to optimize . Last but not least , we show MUSIC ’ s superior performance , by comparing it with other competitive intrinsic rewards on multiple environments . Noticeably , with our method , for the first time the pick-and-place task can be solved without any task reward . 2 PRELIMINARIES . For environments , we consider four robotic tasks , including push , slide , pick-and-place , and navigation , as shown in Figure 2 . The goal in the manipulation task is to move the target object to a desired position . For the navigation task , the goal is to navigate to a target ball . In the following , we define some terminologies . 2.1 AGENT STATE , SURROUNDING STATE , AND REINFORCEMENT LEARNING SETTINGS . In this paper , the agent state sa means literally the state variable of the agent . The surrounding state ss refers to the state variable that describes the surrounding of the agent , for example , the state variable of an object . For multi-goal environments , we use the same assumption as previous works ( Andrychowicz et al. , 2017 ; Plappert et al. , 2018 ) , which consider that the goals can be represented as states and we denote the goal variable as g. For example , in the manipulation task , a goal is a particular desired position of the object in the episode . These desired positions , i.e. , goals , are sampled from the environment . The division between the agent state and the surrounding state is naturally defined by the agentsurrounding separation concept introduced in Section 1 . From a biology point of view , a human can naturally distinguish its own parts , like hands or legs from the environments . Analog to this , when we design a robotic system , we can easily know what is the agent state and what is its surrounding state . In this paper , we use upper letters , such as S , to denote random variables and the corresponding lower case letter , such as s , to represent the values of random variables . We assume the world is fully observable , including a set of states S , a set of actionsA , a distribution of initial states p ( s0 ) , transition probabilities p ( st+1 | st , at ) , a reward function r : S ×A → R , and a discount factor γ ∈ [ 0 , 1 ] . These components formulate a Markov Decision Process represented as a tuple , ( S , A , p , r , γ ) . We use τ to denote a trajectory , which contains a series of agent states and surrounding states . Its random variable is denoted as T . 3 METHOD . We focus on agent learning to control its surrounding purely by using its observations and actions without supervision . Motivated by the idea that when an agent takes control of its surrounding , then there is a high MI between the agent state and the surrounding state , we formulate the problem of learning without external supervision as one of learning a policy πθ ( at | st ) with parameters θ to maximize intrinsic MI rewards , r = I ( Sa ; Ss ) . In this section , we formally describe our method , mutual information-based state intrinsic control ( MUSIC ) . 3.1 MUTUAL INFORMATION REWARD FUNCTION . Our framework simultaneously learns a policy and an intrinsic reward function by maximizing the MI between the surrounding state and the agent state . Mathematically , the MI between the surround- ing state random variable Ss and the agent state random variable Sa is represented as follows : I ( Ss ; Sa ) = KL ( PSsSa || PSs ⊗ PSa ) ( 1 ) = sup T : Ω→R EPSsSa [ T ] − log ( EPSs⊗PSa [ e T ] ) ( 2 ) ≥ sup φ∈Φ EPSsSa [ Tφ ] − log ( EPSs⊗PSa [ e Tφ ] ) : = IΦ ( S s ; Sa ) , ( 3 ) where PSsSa is the joint probability distribution ; PSs ⊗ PSa is the product of the marginal distributions PSs and PSa ; KL denotes the Kullback-Leibler ( KL ) divergence . MI is notoriously difficult to compute in real-world settings ( Hjelm et al. , 2019 ) . Compared to the variational information maximizing-based approaches ( Barber & Agakov , 2003 ; Alemi et al. , 2016 ; Chalk et al. , 2016 ; Kolchinsky et al. , 2017 ) , the recent MINE-based approaches have shown superior performance ( Belghazi et al. , 2018 ; Hjelm et al. , 2019 ; Velickovic et al. , 2019 ) . Motivated by MINE ( Belghazi et al. , 2018 ) , we use a lower bound to approximate the MI quantity I ( Ss ; Sa ) . First , we rewrite Equation ( 1 ) , the KL formulation of the MI objective , using the Donsker-Varadhan representation , to Equation ( 2 ) ( Donsker & Varadhan , 1975 ) . The input space Ω is a compact domain of Rd , i.e. , Ω ⊂ Rd , and the supremum is taken over all functions T such that the two expectations are finite . Secondly , we lower bound the MI in the Donsker-Varadhan representation with the compression lemma in the PAC-Bayes literature and derive Equation ( 3 ) ( Banerjee , 2006 ; Belghazi et al. , 2018 ) . The expectations in Equation ( 3 ) are estimated by using empirical samples from PSsSa and PSs ⊗ PSa . The statistics model Tφ is parameterized by a deep neural network with parameters φ ∈ Φ , whose inputs are the empirical samples . 3.2 EFFECTIVELY COMPUTING THE MUTUAL INFORMATION REWARD IN PRACTICE . Lemma 1 . There is a monotonically increasing relationship between Iφ ( Ss ; Sa | T ) and EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , mathematically , Iφ ( S s ; Sa | T ) n EPT ′ [ Iφ ( S s ; Sa | T ′ ) ] , ( 4 ) where Ss , Sa , and T denote the surrounding state , the agent state , and the trajectory , respectively . The trajectory fractions are defined as the adjacent state pairs , namely T ′ = { St , St+1 } . The symbol n denotes a monotonically increasing relationship between two variables and φ represents the parameter of the statistics model in MINE . Proof . See Appendix A . We define the reward for each transition at a given time-step as the mutual information of the pair of adjacent states at that time-step , see Equation ( 4 ) Right-Hand Side ( RHS ) . However , in practice , we find that it is not very efficient to train the MI estimator using state pairs . To counter this issue , we use all the states in the same trajectory in a batch to train the MI estimator , see Equation ( 4 ) LeftHand Side ( LHS ) , since more empirical samples help to reduce variance and therefore accelerate learning . In Lemma 1 , we prove the monotonically increasing relationship between Equation ( 4 ) RHS and Equation ( 4 ) LHS . In more detail , we divide the process of computing rewards into two phases , i.e. , the training phase and the evaluation phase . In the training phase , we efficiently train the MI estimator with a large batch of samples from the whole trajectory . For training the MI estimator network , we first randomly sample the trajectory τ from the replay buffer . Then , the states sat used for calculating the product of marginal distributions are sampled by shuffling the states sat from the joint distribution along the temporal axis t within the trajectory . We use back-propagation to optimize the parameter ( φ ) to maximize the MI lower bound , see Equation ( 4 ) LHS . For evaluating the MI reward , we use a pair of transitions to calculate the transition reward , see Equation ( 4 ) RHS and Equation ( 5 ) , instead of using the complete trajectory . Each time , to calculate the MI reward for the transition , the reward is calculated over a small fraction of the complete trajectory τ ′ , namely r = Iφ ( Ss ; Sa | T ′ ) . The trajectory fraction , τ ′ , is defined as adjacent state pairs , τ ′ = { st , st+1 } , and T ′ represents its corresponding random variable . The derived Lemma 1 brings us two important benefits . First , it enables us to efficiently train the MI estimator using all the states in the same trajectory . And a large batch of empirical samples reduce the variance of the gradients . Secondly , it allows us to estimate the MI reward for each transition with only the relevant state pair . This way of estimating MI enables us to assign rewards more accurately at the transition level . Based on Lemma 1 , we calculate the transition reward as the MI of each trajectory fraction , namely rφ ( at , st ) : = Iφ ( S s ; Sa|T ′ ) = 0.5 ∑t+1 i=tTφ ( s s i , s a i ) − log ( 0.5 ∑t+1 i=t e Tφ ( s s i , s̄ a i ) ) , ( 5 ) where ( ssi , s a i ) ∼ PSsSa|T ′ , s̄ai ∼ PSa|T ′ , and τ ′ = { st , st+1 } . In case that the estimated MI value is particularly small , we scale the reward with a hyper-parameter α and clip the reward between 0 and 1 . MUSIC can be combined with any off-the-shelf reinforcement learning methods , such as deep deterministic policy gradient ( DDPG ) ( Lillicrap et al. , 2016 ) and soft actor-critic ( SAC ) ( Haarnoja et al. , 2018 ) . We summarize the complete training algorithm in Algorithm 1 and in Figure 1 . MUSIC Variants with Task Rewards : The introduced MUSIC method is an unsupervised reinforcement learning approach , which is denoted as “ MUSIC-u ” , where “ -u ” stands for unsupervised learning . We propose three ways of using MUSIC to accelerate learning . The first method is using the MUSIC-u pretrained policy as the parameter initialization and then fine-tuning the agent with the task rewards . We denote this variant as “ MUSIC-f ” , where “ -f ” stands for fine-tuning . The second variant is to use the MI intrinsic reward to help the agent to explore more efficiently . Here , the MI reward and the task reward are added together . We name this method as “ MUSIC-r ” , where “ -r ” stands for reward . The third approach is to use the MI quantity from MUSIC to prioritize trajectories for replay . The approach is similar to the TD-error-based prioritized experience replay ( PER ) ( Schaul et al. , 2016 ) . The only difference is that we use the estimated MI instead of the TD-error as the priority for sampling . We name this method as “ MUSIC-p ” , where “ -p ” stands for prioritization . Skill Discovery with MUSIC and DIAYN : One of the relevant works on unsupervised RL , DIAYN ( Eysenbach et al. , 2019 ) , introduces an information-theoretical objective FDIAYN , which learns diverse discriminable skills indexed by the latent variable Z , mathematically , FDIAYN = I ( S ; Z ) + H ( A | S , Z ) . The first term , I ( S ; Z ) , in the objective , FDIAYN , is implemented via a skill discriminator , which serves as a variational lower bound of the original objective ( Barber & Agakov , 2003 ; Eysenbach et al. , 2019 ) . The skill discriminator assigns high rewards to the agent , if it can predict the skill-options , Z , given the states , S. Here , we substitute the full state S with the surrounding state Ss to encourage the agent to learn control skills . DIAYN and MUSIC can be combined as follows : FMUSIC+DIAYN = I ( Sa ; Ss ) +I ( Ss ; Z ) +H ( A | S , Z ) . The combined version enables the agent to learn diverse control primitives via skill-conditioned policy ( Eysenbach et al. , 2019 ) in an unsupervised fashion . Comparison and Combination with DISCERN : Another relevant work is Discriminative Embedding Reward Networks ( DISCERN ) ( Warde-Farley et al. , 2019 ) , whose objective is to maximize the MI between the state S and the goal G , namely I ( S ; G ) . While MUSIC ’ s objective is to maximize the MI between the agent state Sa and the surrounding state Ss , namely I ( Sa ; Ss ) . Intuitively , DISCERN attempts to reach a particular goal in each episode , while our method tries to manipulate the surrounding state to any different value . MUSIC and DISCERN can be combined as FMUSIC+DISCERN = I ( Sa ; Ss ) + I ( S ; G ) . Optionally , we can replace the full states S with Ss , since it performs better than with S empirically . Through this combination , MUSIC helps DISCERN to learn its discriminative objective .
This paper proposes the use of state control as intrinsic motivation. It does so by separating the overall state into an agent state and a surrounding state. The idea then is to maximize the mutual information between the agent's internal state and the environment state. This mutual information is given as a reward to the agent which it attempts to maximize using policy gradient algorithms. Experiments attempt to validate the usefulness of such an intrinsic reward signal for pre-training an agent, or for augmenting a given task reward.
SP:611076294a9cdaec02976c2de7df7292fcb88d2b
Jumpy Recurrent Neural Networks
1 INTRODUCTION . It is said that change happens slowly and then all at once . Billiards balls move across a table before colliding and changing trajectories ; water molecules cool slowly and then undergo a rapid phase transition into ice ; and economic systems enjoy periods of stability interspersed with abrupt market downturns . That is to say , many time series exhibit periods of relatively homogeneous change divided by important events . Despite this , recurrent neural networks ( RNNs ) , popular for time series modeling , treat time in uniform intervals – potentially wasting prediction resources on long intervals of relatively constant change . One reason for this is that standard RNNs are sequence models without an explicit notion of time . Instead , the amount of time represented by a single RNN update is implicitly set by the training data . For example , a model trained on sequences of daily average temperatures has an implicit time step of a day . For a fixed computational budget , this introduces a trade-off between fidelity and temporal range . A model trained at a resolution of one time step per minute would require over 10K iterations to make a prediction for one week in the future . At the other end of the spectrum , a one-week resolution model could achieve this in a single step but could not provide information about the intervening days . As such , selecting a point on this spectrum is a troublesome design decision . In this work , we present Jumpy RNNs , a simple recurrent architecture that takes update steps at variable , data-dependent time-scales while being able to provide dense predictions at intervening points . The core innovation is to define the hidden state as a continuous , piece-wise linear function of time . Specifically , each Jumpy RNN step predicts not only a hidden state hi , but also a hidden velocity ḣi and a span of time ∆ over which the linear latent dynamics h ( t ) = hi + ḣi ( t− i ) should be applied . Our model then jumps forward in time by ∆ before updating again . Any intermediate time step can be produced by decoding the corresponding hidden state h ( t ) . During training , our model learns to use these functions to span the non-uniform time durations between key events , where key events emerge as time points where linear latent extrapolation is FC Jumpy RNN Prediction GRU FC FC GRU Baseline RNN Prediction 111 … 111 5 2 10 1.5 True Dynamics FC GRU Figure 1 : Predicting the dynamics of two billiards balls ( left ) using a baseline RNN cell ( center ) and a Jumpy RNN cell ( right ) . Whereas the baseline model produces a hidden state ht at each time step , our jumpy model predicts a continuous-time hidden state , over a predicted interval ∆i . This allows it to skip over long spans of predictable motion and focus on key events such as collisions . ineffective . In Figure 1 , for example , we see that our model updates at the collision points between the two balls and the walls . During time spans when the balls are undergoing constant motion , our model does not perform cell updates . In contrast , a standard RNN must tick uniformly through time . We demonstrate our proposed model in several physical dynamics prediction tasks . We show Jumpy RNNs achieve comparable performance to the baseline while being between three and twenty times more efficient to sample . This includes settings with non-linear pixel-based observations . Further , we show that our model outperforms RNNs with any fixed step length , showing the importance of data-dependent step sizes . Finally , we demonstrate that a learned Jumpy RNN dynamics model can be leveraged as an efficient forward predictor in a planning domain . Our key contributions are to : – Identify a trade-off between temporal resolution and the computational expense of RNNs , – Propose Jumpy RNNs , which make jumpy predictions and interpolate between them , – Show empirically that Jumpy RNNs are efficient and effective at jumpy time series prediction . 2 JUMPY RECURRENT NEURAL NETWORKS . Consider a continuous-time function x ( t ) sampled at uniform time steps to form the sequence x0 , x1 , . . . , xT . We study the problem of generative modeling , where given an initial set of observations , the goal is to auto-regressively predict a likely continuation . Standard RNN . The per-step RNN computation during auto-regressive sequence generation is : ht = RNNCell ( ht−1 , φ ( x̂t ) ) , x̂t+1 = f ( ht ) where φ ( · ) and f ( · ) are observation encoders and decoders respectively , and ht is the hidden state . This computation is performed at each time-step even when the dynamics of x ( t ) are simple ( or even constant ) for long stretches of time . One way to linearly reduce the computation required to predict into the future is to increase the time-span ∆ between RNN ticks . Standard RNNs , however , then lose the ability to predict at clock times in between the ∆ time steps . This introduces a trade-off between predictive resolution and the computational cost of predicting far into the future . 2.1 JUMPY RNN ARCHITECTURE . Continuous Hidden Dynamics with Constant Jumps . Our first step toward resolving the trade-off is to upgrade the standard RNN so that it can learn to linearly interpolate a continuous-time hidden state h ( t ) between updates . Let ∆ be the time between RNN ticks such that RNN tick i ( starting at i = 0 ) corresponds to continuous time point τi = i∆ . For update i , the RNN predicts both a hidden state hi and hidden velocity ḣi that describes how the hidden state h ( t ) evolves over the time interval [ τi , τi + ∆ ] . Specifically , the operation of this linear-dynamics RNN with constant jump is given by : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆ ] , φ ( x̂ ( τi ) ) ) ( 1 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆ ] ( 2 ) x̂ ( t ) = f ( h ( t ) ) ( 3 ) where [ · , · ] denotes concatenation and x̂ ( t ) is the continuous time output prediction that can be immediately produced on demand for any time in between ticks . Under this model , the hidden state evolves as a piece-wise linear function of time , with transitions between linear functions occurring at RNN updates . This linearity constraint provides a strong and natural inductive bias and allows for fast interpolation . Importantly , the hidden-state linearity does not translate to linearity in output space , as the learned decoder f ( · ) can be an arbitrarily complex non-linear function . While the above model can interpolate between time steps , it is still constrained by a constant jump width ∆ . Manually selecting ∆ is difficult since the ideal value depends on the complexity of x ( t ) and the encoder and decoder capacity . Further , x ( t ) may vary in complexity over time such that a single jump width is insufficient . Jumpy RNNs . The Jumpy RNN upgrades the above model to dynamically adjust ∆ throughout the sequence as shown in Figure 2 . Specifically , we now predict a duration ∆i in addition to linear latent dynamics [ hi , ḣi ] at each RNN step . This duration encodes the time span over which the corresponding linear latent dynamics accurately approximate x ( t ) . RNN ticks now occur at variable points in time so that RNN step i occurs at time point τi = ∑i−1 j=0 ∆j . Now our update is : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆i−1 ] , φ ( x̂ ( τi ) ) ) ( 4 ) ∆i = LeakyReLU ( Whi + b ) + 1 ( 5 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆i ] ( 6 ) where again x̂ ( t ) = f ( h ( t ) ) . In practice , this approach can be implemented on top of any existing RNN variant , for example , GRUs . Training the jumpy model , however , introduces new complications since the optimal dynamic steps ∆∗i are unknown and interact with the rest of the hidden state . This is partly addressed by the inductive bias of Eq . 5 , which encourages our model to always jump forward in time by at least one time step . The next section details our approach to effective training . 2.2 TRAINING JUMPY RNNS . Even though our model is defined over continuous time , the training data for time-series models typically consists of observation sequences of the form x0 , x1 , x2 , . . . , xT . For the remainder we will assume that there is one time unit between each sample , i.e . xt = x ( t ) . We now describe how to train Jumpy RNNs in this setting by constructing a loss function specifically suited to our jumpy model . Supervising Predictions . Supervising for prediction accuracy simply requires evaluating the model at each discrete time step and applying the loss : Lx = ∑T t=0 ` ( xt , x̂ ( t ) ) , where ` ( · , · ) is a loss between predicted and actual values . In concept , this loss alone may be sufficient for optimizing accuracy , however , it does not encourage the model to take large jumps ( predict large ∆i ) when possible . In fact , it may encourage small jumps as an easier optimization path . Thus , below we augment the loss to encourage jumpiness . Supervising Dynamic Jumps . We interpret the the jump width ∆i as the duration that the linear dynamics can accurately approximate x ( t ) . To formalize this , we say a training point xt is accurately approximated if ` ( xt , x̂ ( t ) ) < , where is a hyperparameter . Ideally , we would like the Jumpy RNN to produce the maximum jump width that maintains this constraint . More formally , given fixed network weights the optimal jump width ∆∗i at step i is the solution to : max ∆i≥1 ∆i s.t . ` ( xt , x̂ ( t ) ) < ∀ { xt | t ∈ [ τi , τi + ∆i ] } , ( 7 ) which seeks the largest jump that does not violate the loss threshold for any intervening observation . This can be solved using a simple forward line search that starts at τi and moves forward through the samples until our model ’ s prediction loss under the current dynamics exceeds . If this occurs on the first step ( implying no time passes between ticks ) , we set ∆∗i to 1 . In Appendix A.1 we show this can be efficiently vectorized for an entire batch as part of a single pass through the sequence . We compute the optimal ∆∗i on-the-fly during training and jump forward accordingly – effectively ignoring the predicted ∆i as in standard teacher-forcing style training . To update the model to predict the correct ∆i , we augment the prediction loss Lx with a jump size loss L∆ = ∑ i ||∆i −∆∗i ||22 . At inference , the predicted ∆i is used to determine jump length . Interpreting Error Threshold . The error threshold is a key hyperparameter introduced in our approach . Examining Equation 7 , acts as a trade-off between jumpiness and approximation error . In the extreme of setting = 0 , the model predictions will likely never be below , ∆i will remain at 1 , and our model will reduce back to a standard RNN that updates at each time step . At the other extreme , choosing =∞ forces our model to predict the entire time series with a single linear latent transition . In practice , we found that setting to the final training loss of the baseline model yields 3-10x jumpy models with the same test error as the baseline model .
This paper proposes a recurrent network architecture for future prediction where the hidden states (and the outputs) aren't updated step by step as done traditionally. Instead, the network models the hidden state dynamics as being piecewise linear over varying time spans. It learns to produce the linear dynamics together with each time span, and can "jump" to the next time span according to its own predictions. Hidden states for any time step within a span can be easily obtained by interpolation using the predicted linear dynamics. Experiments on a series of synthetic benchmarks are used to demonstrate that the model can learn to utilize this structure to reduce the amount of computation.
SP:2a2f4f5c8cb0759b0c16a577171313d9499f969b
Jumpy Recurrent Neural Networks
1 INTRODUCTION . It is said that change happens slowly and then all at once . Billiards balls move across a table before colliding and changing trajectories ; water molecules cool slowly and then undergo a rapid phase transition into ice ; and economic systems enjoy periods of stability interspersed with abrupt market downturns . That is to say , many time series exhibit periods of relatively homogeneous change divided by important events . Despite this , recurrent neural networks ( RNNs ) , popular for time series modeling , treat time in uniform intervals – potentially wasting prediction resources on long intervals of relatively constant change . One reason for this is that standard RNNs are sequence models without an explicit notion of time . Instead , the amount of time represented by a single RNN update is implicitly set by the training data . For example , a model trained on sequences of daily average temperatures has an implicit time step of a day . For a fixed computational budget , this introduces a trade-off between fidelity and temporal range . A model trained at a resolution of one time step per minute would require over 10K iterations to make a prediction for one week in the future . At the other end of the spectrum , a one-week resolution model could achieve this in a single step but could not provide information about the intervening days . As such , selecting a point on this spectrum is a troublesome design decision . In this work , we present Jumpy RNNs , a simple recurrent architecture that takes update steps at variable , data-dependent time-scales while being able to provide dense predictions at intervening points . The core innovation is to define the hidden state as a continuous , piece-wise linear function of time . Specifically , each Jumpy RNN step predicts not only a hidden state hi , but also a hidden velocity ḣi and a span of time ∆ over which the linear latent dynamics h ( t ) = hi + ḣi ( t− i ) should be applied . Our model then jumps forward in time by ∆ before updating again . Any intermediate time step can be produced by decoding the corresponding hidden state h ( t ) . During training , our model learns to use these functions to span the non-uniform time durations between key events , where key events emerge as time points where linear latent extrapolation is FC Jumpy RNN Prediction GRU FC FC GRU Baseline RNN Prediction 111 … 111 5 2 10 1.5 True Dynamics FC GRU Figure 1 : Predicting the dynamics of two billiards balls ( left ) using a baseline RNN cell ( center ) and a Jumpy RNN cell ( right ) . Whereas the baseline model produces a hidden state ht at each time step , our jumpy model predicts a continuous-time hidden state , over a predicted interval ∆i . This allows it to skip over long spans of predictable motion and focus on key events such as collisions . ineffective . In Figure 1 , for example , we see that our model updates at the collision points between the two balls and the walls . During time spans when the balls are undergoing constant motion , our model does not perform cell updates . In contrast , a standard RNN must tick uniformly through time . We demonstrate our proposed model in several physical dynamics prediction tasks . We show Jumpy RNNs achieve comparable performance to the baseline while being between three and twenty times more efficient to sample . This includes settings with non-linear pixel-based observations . Further , we show that our model outperforms RNNs with any fixed step length , showing the importance of data-dependent step sizes . Finally , we demonstrate that a learned Jumpy RNN dynamics model can be leveraged as an efficient forward predictor in a planning domain . Our key contributions are to : – Identify a trade-off between temporal resolution and the computational expense of RNNs , – Propose Jumpy RNNs , which make jumpy predictions and interpolate between them , – Show empirically that Jumpy RNNs are efficient and effective at jumpy time series prediction . 2 JUMPY RECURRENT NEURAL NETWORKS . Consider a continuous-time function x ( t ) sampled at uniform time steps to form the sequence x0 , x1 , . . . , xT . We study the problem of generative modeling , where given an initial set of observations , the goal is to auto-regressively predict a likely continuation . Standard RNN . The per-step RNN computation during auto-regressive sequence generation is : ht = RNNCell ( ht−1 , φ ( x̂t ) ) , x̂t+1 = f ( ht ) where φ ( · ) and f ( · ) are observation encoders and decoders respectively , and ht is the hidden state . This computation is performed at each time-step even when the dynamics of x ( t ) are simple ( or even constant ) for long stretches of time . One way to linearly reduce the computation required to predict into the future is to increase the time-span ∆ between RNN ticks . Standard RNNs , however , then lose the ability to predict at clock times in between the ∆ time steps . This introduces a trade-off between predictive resolution and the computational cost of predicting far into the future . 2.1 JUMPY RNN ARCHITECTURE . Continuous Hidden Dynamics with Constant Jumps . Our first step toward resolving the trade-off is to upgrade the standard RNN so that it can learn to linearly interpolate a continuous-time hidden state h ( t ) between updates . Let ∆ be the time between RNN ticks such that RNN tick i ( starting at i = 0 ) corresponds to continuous time point τi = i∆ . For update i , the RNN predicts both a hidden state hi and hidden velocity ḣi that describes how the hidden state h ( t ) evolves over the time interval [ τi , τi + ∆ ] . Specifically , the operation of this linear-dynamics RNN with constant jump is given by : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆ ] , φ ( x̂ ( τi ) ) ) ( 1 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆ ] ( 2 ) x̂ ( t ) = f ( h ( t ) ) ( 3 ) where [ · , · ] denotes concatenation and x̂ ( t ) is the continuous time output prediction that can be immediately produced on demand for any time in between ticks . Under this model , the hidden state evolves as a piece-wise linear function of time , with transitions between linear functions occurring at RNN updates . This linearity constraint provides a strong and natural inductive bias and allows for fast interpolation . Importantly , the hidden-state linearity does not translate to linearity in output space , as the learned decoder f ( · ) can be an arbitrarily complex non-linear function . While the above model can interpolate between time steps , it is still constrained by a constant jump width ∆ . Manually selecting ∆ is difficult since the ideal value depends on the complexity of x ( t ) and the encoder and decoder capacity . Further , x ( t ) may vary in complexity over time such that a single jump width is insufficient . Jumpy RNNs . The Jumpy RNN upgrades the above model to dynamically adjust ∆ throughout the sequence as shown in Figure 2 . Specifically , we now predict a duration ∆i in addition to linear latent dynamics [ hi , ḣi ] at each RNN step . This duration encodes the time span over which the corresponding linear latent dynamics accurately approximate x ( t ) . RNN ticks now occur at variable points in time so that RNN step i occurs at time point τi = ∑i−1 j=0 ∆j . Now our update is : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆i−1 ] , φ ( x̂ ( τi ) ) ) ( 4 ) ∆i = LeakyReLU ( Whi + b ) + 1 ( 5 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆i ] ( 6 ) where again x̂ ( t ) = f ( h ( t ) ) . In practice , this approach can be implemented on top of any existing RNN variant , for example , GRUs . Training the jumpy model , however , introduces new complications since the optimal dynamic steps ∆∗i are unknown and interact with the rest of the hidden state . This is partly addressed by the inductive bias of Eq . 5 , which encourages our model to always jump forward in time by at least one time step . The next section details our approach to effective training . 2.2 TRAINING JUMPY RNNS . Even though our model is defined over continuous time , the training data for time-series models typically consists of observation sequences of the form x0 , x1 , x2 , . . . , xT . For the remainder we will assume that there is one time unit between each sample , i.e . xt = x ( t ) . We now describe how to train Jumpy RNNs in this setting by constructing a loss function specifically suited to our jumpy model . Supervising Predictions . Supervising for prediction accuracy simply requires evaluating the model at each discrete time step and applying the loss : Lx = ∑T t=0 ` ( xt , x̂ ( t ) ) , where ` ( · , · ) is a loss between predicted and actual values . In concept , this loss alone may be sufficient for optimizing accuracy , however , it does not encourage the model to take large jumps ( predict large ∆i ) when possible . In fact , it may encourage small jumps as an easier optimization path . Thus , below we augment the loss to encourage jumpiness . Supervising Dynamic Jumps . We interpret the the jump width ∆i as the duration that the linear dynamics can accurately approximate x ( t ) . To formalize this , we say a training point xt is accurately approximated if ` ( xt , x̂ ( t ) ) < , where is a hyperparameter . Ideally , we would like the Jumpy RNN to produce the maximum jump width that maintains this constraint . More formally , given fixed network weights the optimal jump width ∆∗i at step i is the solution to : max ∆i≥1 ∆i s.t . ` ( xt , x̂ ( t ) ) < ∀ { xt | t ∈ [ τi , τi + ∆i ] } , ( 7 ) which seeks the largest jump that does not violate the loss threshold for any intervening observation . This can be solved using a simple forward line search that starts at τi and moves forward through the samples until our model ’ s prediction loss under the current dynamics exceeds . If this occurs on the first step ( implying no time passes between ticks ) , we set ∆∗i to 1 . In Appendix A.1 we show this can be efficiently vectorized for an entire batch as part of a single pass through the sequence . We compute the optimal ∆∗i on-the-fly during training and jump forward accordingly – effectively ignoring the predicted ∆i as in standard teacher-forcing style training . To update the model to predict the correct ∆i , we augment the prediction loss Lx with a jump size loss L∆ = ∑ i ||∆i −∆∗i ||22 . At inference , the predicted ∆i is used to determine jump length . Interpreting Error Threshold . The error threshold is a key hyperparameter introduced in our approach . Examining Equation 7 , acts as a trade-off between jumpiness and approximation error . In the extreme of setting = 0 , the model predictions will likely never be below , ∆i will remain at 1 , and our model will reduce back to a standard RNN that updates at each time step . At the other extreme , choosing =∞ forces our model to predict the entire time series with a single linear latent transition . In practice , we found that setting to the final training loss of the baseline model yields 3-10x jumpy models with the same test error as the baseline model .
This work presents Jumpy RNNs, a recurrent network that learns to take variable length steps based on time-scales of the data. The core idea of the paper is to learn a hidden velocity and time span, along with the standard hidden state. The hidden velocity is then used to linearly interpolate the hidden state within the learned time span. This leads the proposed model to update the hidden state only at the end of time span thus allowing the model to jump over by certain steps proportional to time span. The model has flexibility to produce fine-grained or continuous-time predictions as well as predicting far into the future. Since, Jumpy RNNs do not update the hidden state at every time step, they are computationally efficient than standard RNNs.
SP:2a2f4f5c8cb0759b0c16a577171313d9499f969b
Jumpy Recurrent Neural Networks
1 INTRODUCTION . It is said that change happens slowly and then all at once . Billiards balls move across a table before colliding and changing trajectories ; water molecules cool slowly and then undergo a rapid phase transition into ice ; and economic systems enjoy periods of stability interspersed with abrupt market downturns . That is to say , many time series exhibit periods of relatively homogeneous change divided by important events . Despite this , recurrent neural networks ( RNNs ) , popular for time series modeling , treat time in uniform intervals – potentially wasting prediction resources on long intervals of relatively constant change . One reason for this is that standard RNNs are sequence models without an explicit notion of time . Instead , the amount of time represented by a single RNN update is implicitly set by the training data . For example , a model trained on sequences of daily average temperatures has an implicit time step of a day . For a fixed computational budget , this introduces a trade-off between fidelity and temporal range . A model trained at a resolution of one time step per minute would require over 10K iterations to make a prediction for one week in the future . At the other end of the spectrum , a one-week resolution model could achieve this in a single step but could not provide information about the intervening days . As such , selecting a point on this spectrum is a troublesome design decision . In this work , we present Jumpy RNNs , a simple recurrent architecture that takes update steps at variable , data-dependent time-scales while being able to provide dense predictions at intervening points . The core innovation is to define the hidden state as a continuous , piece-wise linear function of time . Specifically , each Jumpy RNN step predicts not only a hidden state hi , but also a hidden velocity ḣi and a span of time ∆ over which the linear latent dynamics h ( t ) = hi + ḣi ( t− i ) should be applied . Our model then jumps forward in time by ∆ before updating again . Any intermediate time step can be produced by decoding the corresponding hidden state h ( t ) . During training , our model learns to use these functions to span the non-uniform time durations between key events , where key events emerge as time points where linear latent extrapolation is FC Jumpy RNN Prediction GRU FC FC GRU Baseline RNN Prediction 111 … 111 5 2 10 1.5 True Dynamics FC GRU Figure 1 : Predicting the dynamics of two billiards balls ( left ) using a baseline RNN cell ( center ) and a Jumpy RNN cell ( right ) . Whereas the baseline model produces a hidden state ht at each time step , our jumpy model predicts a continuous-time hidden state , over a predicted interval ∆i . This allows it to skip over long spans of predictable motion and focus on key events such as collisions . ineffective . In Figure 1 , for example , we see that our model updates at the collision points between the two balls and the walls . During time spans when the balls are undergoing constant motion , our model does not perform cell updates . In contrast , a standard RNN must tick uniformly through time . We demonstrate our proposed model in several physical dynamics prediction tasks . We show Jumpy RNNs achieve comparable performance to the baseline while being between three and twenty times more efficient to sample . This includes settings with non-linear pixel-based observations . Further , we show that our model outperforms RNNs with any fixed step length , showing the importance of data-dependent step sizes . Finally , we demonstrate that a learned Jumpy RNN dynamics model can be leveraged as an efficient forward predictor in a planning domain . Our key contributions are to : – Identify a trade-off between temporal resolution and the computational expense of RNNs , – Propose Jumpy RNNs , which make jumpy predictions and interpolate between them , – Show empirically that Jumpy RNNs are efficient and effective at jumpy time series prediction . 2 JUMPY RECURRENT NEURAL NETWORKS . Consider a continuous-time function x ( t ) sampled at uniform time steps to form the sequence x0 , x1 , . . . , xT . We study the problem of generative modeling , where given an initial set of observations , the goal is to auto-regressively predict a likely continuation . Standard RNN . The per-step RNN computation during auto-regressive sequence generation is : ht = RNNCell ( ht−1 , φ ( x̂t ) ) , x̂t+1 = f ( ht ) where φ ( · ) and f ( · ) are observation encoders and decoders respectively , and ht is the hidden state . This computation is performed at each time-step even when the dynamics of x ( t ) are simple ( or even constant ) for long stretches of time . One way to linearly reduce the computation required to predict into the future is to increase the time-span ∆ between RNN ticks . Standard RNNs , however , then lose the ability to predict at clock times in between the ∆ time steps . This introduces a trade-off between predictive resolution and the computational cost of predicting far into the future . 2.1 JUMPY RNN ARCHITECTURE . Continuous Hidden Dynamics with Constant Jumps . Our first step toward resolving the trade-off is to upgrade the standard RNN so that it can learn to linearly interpolate a continuous-time hidden state h ( t ) between updates . Let ∆ be the time between RNN ticks such that RNN tick i ( starting at i = 0 ) corresponds to continuous time point τi = i∆ . For update i , the RNN predicts both a hidden state hi and hidden velocity ḣi that describes how the hidden state h ( t ) evolves over the time interval [ τi , τi + ∆ ] . Specifically , the operation of this linear-dynamics RNN with constant jump is given by : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆ ] , φ ( x̂ ( τi ) ) ) ( 1 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆ ] ( 2 ) x̂ ( t ) = f ( h ( t ) ) ( 3 ) where [ · , · ] denotes concatenation and x̂ ( t ) is the continuous time output prediction that can be immediately produced on demand for any time in between ticks . Under this model , the hidden state evolves as a piece-wise linear function of time , with transitions between linear functions occurring at RNN updates . This linearity constraint provides a strong and natural inductive bias and allows for fast interpolation . Importantly , the hidden-state linearity does not translate to linearity in output space , as the learned decoder f ( · ) can be an arbitrarily complex non-linear function . While the above model can interpolate between time steps , it is still constrained by a constant jump width ∆ . Manually selecting ∆ is difficult since the ideal value depends on the complexity of x ( t ) and the encoder and decoder capacity . Further , x ( t ) may vary in complexity over time such that a single jump width is insufficient . Jumpy RNNs . The Jumpy RNN upgrades the above model to dynamically adjust ∆ throughout the sequence as shown in Figure 2 . Specifically , we now predict a duration ∆i in addition to linear latent dynamics [ hi , ḣi ] at each RNN step . This duration encodes the time span over which the corresponding linear latent dynamics accurately approximate x ( t ) . RNN ticks now occur at variable points in time so that RNN step i occurs at time point τi = ∑i−1 j=0 ∆j . Now our update is : hi , ḣi = RNNCell ( [ hi−1 , ḣi−1∆i−1 ] , φ ( x̂ ( τi ) ) ) ( 4 ) ∆i = LeakyReLU ( Whi + b ) + 1 ( 5 ) h ( t ) = hi + ( t− τi ) ḣi for t ∈ [ τi , τi + ∆i ] ( 6 ) where again x̂ ( t ) = f ( h ( t ) ) . In practice , this approach can be implemented on top of any existing RNN variant , for example , GRUs . Training the jumpy model , however , introduces new complications since the optimal dynamic steps ∆∗i are unknown and interact with the rest of the hidden state . This is partly addressed by the inductive bias of Eq . 5 , which encourages our model to always jump forward in time by at least one time step . The next section details our approach to effective training . 2.2 TRAINING JUMPY RNNS . Even though our model is defined over continuous time , the training data for time-series models typically consists of observation sequences of the form x0 , x1 , x2 , . . . , xT . For the remainder we will assume that there is one time unit between each sample , i.e . xt = x ( t ) . We now describe how to train Jumpy RNNs in this setting by constructing a loss function specifically suited to our jumpy model . Supervising Predictions . Supervising for prediction accuracy simply requires evaluating the model at each discrete time step and applying the loss : Lx = ∑T t=0 ` ( xt , x̂ ( t ) ) , where ` ( · , · ) is a loss between predicted and actual values . In concept , this loss alone may be sufficient for optimizing accuracy , however , it does not encourage the model to take large jumps ( predict large ∆i ) when possible . In fact , it may encourage small jumps as an easier optimization path . Thus , below we augment the loss to encourage jumpiness . Supervising Dynamic Jumps . We interpret the the jump width ∆i as the duration that the linear dynamics can accurately approximate x ( t ) . To formalize this , we say a training point xt is accurately approximated if ` ( xt , x̂ ( t ) ) < , where is a hyperparameter . Ideally , we would like the Jumpy RNN to produce the maximum jump width that maintains this constraint . More formally , given fixed network weights the optimal jump width ∆∗i at step i is the solution to : max ∆i≥1 ∆i s.t . ` ( xt , x̂ ( t ) ) < ∀ { xt | t ∈ [ τi , τi + ∆i ] } , ( 7 ) which seeks the largest jump that does not violate the loss threshold for any intervening observation . This can be solved using a simple forward line search that starts at τi and moves forward through the samples until our model ’ s prediction loss under the current dynamics exceeds . If this occurs on the first step ( implying no time passes between ticks ) , we set ∆∗i to 1 . In Appendix A.1 we show this can be efficiently vectorized for an entire batch as part of a single pass through the sequence . We compute the optimal ∆∗i on-the-fly during training and jump forward accordingly – effectively ignoring the predicted ∆i as in standard teacher-forcing style training . To update the model to predict the correct ∆i , we augment the prediction loss Lx with a jump size loss L∆ = ∑ i ||∆i −∆∗i ||22 . At inference , the predicted ∆i is used to determine jump length . Interpreting Error Threshold . The error threshold is a key hyperparameter introduced in our approach . Examining Equation 7 , acts as a trade-off between jumpiness and approximation error . In the extreme of setting = 0 , the model predictions will likely never be below , ∆i will remain at 1 , and our model will reduce back to a standard RNN that updates at each time step . At the other extreme , choosing =∞ forces our model to predict the entire time series with a single linear latent transition . In practice , we found that setting to the final training loss of the baseline model yields 3-10x jumpy models with the same test error as the baseline model .
This paper proposes Jumpy Recurrent Neural Network, an RNN model with non-uniform time steps. To train this model, the authors propose to use a greedy supervision to determine optimal time intervals. The experiments on linear dynamics prediction and planning show comparable performance of proposed model against standard RNNs. The advantage is that the proposed model can significantly speed up RNNs under relatively linear dynamics prediction tasks. Even though non-uniform time step RNNs have been studied in many literature, this proposed training supervision method seems novel.
SP:2a2f4f5c8cb0759b0c16a577171313d9499f969b
On the Latent Space of Flow-based Models
1 INTRODUCTION . Normalizing flows ( Rezende and Mohamed , 2015 ; Kobyzev et al. , 2020 ) have shown considerable potential for the tasks of modelling and inferring expressive distributions through the learning of well-specified probabilistic models . Contemporary flow-based approaches define a latent space with dimensionality identical to the data space , typically by parameterizing a complex model pX ( x|θ ) using an invertible neural network fθ . Samples drawn from an initial , simple distribution pZ ( z ) ( e.g . Gaussian ) can be mapped to a complex distribution as x = fθ ( z ) . The process results in a tractable density that inhabits the full data space . However , contemporary flow models may make for an inappropriate choice to represent data that resides in a lower-dimensional manifold and thus does not populate the full ambient space . In such cases , the estimated model will necessarily have mass lying off the data manifold , which may result in under-fitting and poor generation qualities . Furthermore , principal objectives such as Maximum Likelihood Estimation ( MLE ) and Kullback-Leibler ( KL ) divergence minimization are ill-defined , bringing additional challenges for model training . In this work , we propose a principled strategy to model a data distribution that lies on a continuous manifold and we additionally identify the intrinsic dimension of the data manifold . Specifically , by using the connection between MLE and KL divergence minimization in Z space , we can address the important problem of ill-defined KL divergence under typical flow based assumptions . Flow models are based on the idea of “ change of variable ” . Assume a random variable Z with distribution PZ and probability density pZ ( z ) . We can transform Z to get a random variable X : X = f ( Z ) , where f : RD → RD is an invertible function with inverse f−1 = g. Suppose X has distribution PX and density function pX ( x ) , then log pX ( x ) will have the following form log pX ( x ) = log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ , ( 1 ) where log ∣∣∣det ( ∂g∂x ) ∣∣∣ is the log determinant of the Jacobian matrix . We call f ( or g ) a volumepreserving function if the log determinant is equal to 0 . Training of flow models typically makes use of MLE . We denote Xd as the random variable of the data with distribution Pd and density pd ( x ) . In addition to the well-known connection between MLE and minimization of the KL divergence KL ( pd ( x ) ||pX ( x ) ) in X space ( see Appendix A for detail ) , MLE is also ( approximately ) equivalent to minimizing the KL divergence in Z space , this is due to the KL divergence is invariant under invertible transformation ( Yeung , 2008 ; Papamakarios et al. , 2019 ) . Specifically , we define ZQ : ZQ = g ( Xd ) with distribution QZ and density function q ( z ) , the KL divergence in Z space can be written as KL ( q ( z ) ||p ( z ) ) = ∫ q ( z ) log q ( z ) dz − ∫ q ( z ) log p ( z ) dz ( 2 ) = − ∫ pd ( x ) ( log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ ) dx+ const. , ( 3 ) The full derivation can be found in Appendix A . Since we can only access samples x1 , x2 , . . . , xN from pd ( x ) , we approximate the integral by Monte Carlo sampling KL ( q ( z ) ||p ( z ) ) ≈ − 1 N N∑ n=1 log pX ( xn ) + const .. ( 4 ) We thus highlight the connection between MLE and KL divergence minimization , in Z space , for flow based models . The prior distribution p ( z ) is usually chosen to be a D-dimensional Gaussian distribution . However , if the data distribution Pd is singular , for example a measure on a low dimensional manifold , the induced latent distribution QZ is also singular . In this case , the KL divergence in equation 2 is typically not well-defined under the considered flow based model assumptions . This issue brings both theoretical and practical challenges that we will discuss in the following section . 2 FLOW MODELS WITH MANIFOLD DATA . We assume a data sample x ∼ Pd to be a D dimensional vector x ∈ RD and define the ambient dimensionality of Pd , denoted by Amdim ( Pd ) , to be D. However for many datasets of interest , e.g . natural images , the data distribution Pd is commonly believed to be supported on a lower dimensional manifold ( Beymer and Poggio , 1996 ) . We assume the dimensionality of the manifold to beK where K < D , and define the intrinsic dimension of Pd , denoted by Indim ( Pd ) , to be the dimension of this manifold . Figure 1a provides an example of this setting where Pd is a 1D distribution in 2D space . Specifically , each data sample x ∼ Pd is a 2D vector x = { x1 , x2 } where x1 ∼ N ( 0 , 1 ) and x2 = sin ( 2x1 ) . Therefore , this example results in Amdim ( Pd ) = 2 and Indim ( Pd ) = 1 . In flow-based models , function f is constructed such that it is both bijective and differentiable . When the prior PZ is a distribution whose support is RD ( e.g . Multivariate Gaussian distribution ) , the marginal distribution PX will also have support RD and Amdim ( PX ) = Indim ( PX ) = D. When the support of the data distribution lies on aK-dimensional manifold andK < D , Pd and PX are constrained to have different support . That is , the intrinsic dimensions of PX and Pd are always different ; Indim ( PX ) 6= Indim ( Pd ) . In this case it is impossible to learn a model distribution PX identical to the data distribution Pd . Nevertheless , flow-based models have shown strong empirical success in real-world problem domains such as the ability to generate high quality and realistic images ( Kingma and Dhariwal , 2018 ) . Towards investigating the cause and explaining this disparity between theory and practice , we employ a toy example to provide intuition for the effects and consequences resulting from model and data distributions that possess differing intrinsic dimension . Consider the toy dataset introduced previously ; a 1D distribution lying in a 2D space ( Figure 1a ) . The prior density p ( z ) is a standard 2D Gaussian p ( z ) = N ( 0 , IZ ) and the function f is a nonvolume preserving flow with two coupling layers ( see Appendix C.1 ) . In Figure 1b we plot samples from the flow model ; the sample x is generated by first sampling a 2D datapoint z ∼ N ( 0 , IZ ) and then letting x = f ( z ) . Figure 1c shows samples from the prior distributions PZ and QZ . QZ is defined as the transformation of Pd using the bijective function g , such that QZ is constrained to support a 1D manifold in 2D space , and Indim ( QZ ) = Indim ( Pd ) = 1 . Training of QZ to match PZ ( which has intrinsic dimension 2 ) , can be seen in Figure 1c to result in curling up of the manifold in the latent space , contorting it towards satisfying a distribution that has intrinsic dimension 2 . This ill-behaved phenomenon causes several potential problems for contemporary flow models : 1 . Poor sample quality . Figure 1b shows examples where incorrect assumptions in turn result in the model generating bad samples . 2 . Low quality data representations . The discussed characteristic that results in “ curling up ” of the latent space may cause degradations of the representation quality . 3 . Inefficient use of network capacity . Neural network capacity is spent on contorting the distribution QZ to satisfy imposed dimensionality constraints . A natural solution to the problem of intrinsic dimension mismatch is to select a prior distribution PZ with the same dimensionality as the intrinsic dimension of the data distribution such that : Indim ( PZ ) = Indim ( Pd ) . However , since we do not know Indim ( Pd ) explicitly , one option involves to instead learn it from the data distribution . In the following section , we will introduce a parameterization approach that enables us to learn Indim ( Pd ) . 3 LEARNING A MANIFOLD PRIOR . Consider a data vector x ∈ RD , then a flow based model prior PZ is usually given by a Ddimensional Gaussian distribution or alternative simple distribution that is also absolutely continuous ( a.c. ) in RD . Therefore , the intrinsic dimension Indim ( PZ ) = D. To allow a prior to have intrinsic dimension strictly less than D , we let PZ have the ‘ generalized density ’ 1 p ( z ) with the form p ( z ) = N ( 0 , AAT ) , ( 5 ) where z ∈ RD and A is a D×D lower triangular matrix with D ( D+1 ) 2 parameters , such that AA T is constrained to be a positive semi-definite matrix . When AAT has full rank D , then PZ is a ( nondegenerate ) multivariate Gaussian on RD . When Rank ( AAT ) = K and K < D , then PZ will degenerate to a Gaussian supported on a K-dimensional manifold , such that the intrinsic dimension Indim ( PZ ) = K. Figure 2 illustrates a sketch of this scenario . In practice , we initialize A to be an identity matrix , so AAT will also be an identity matrix and PZ is initialized as a standard Gaussian . When Rank ( AAT ) < D , the degenerate covariance AAT is no longer invertible and we are unable to evaluate the density value of p ( z ) for a given random vector z . Furthermore , when the data distribution Pd is supported on a K-dimensional manifold , QZ will also be supported on a Kdimensional manifold and no longer has a valid density function . Using equation 2 to train the flow model then becomes impossible as the KL divergence between PZ and QZ is not well defined2 . Recent work by Zhang et al . ( 2020 ) proposed a new family of divergence to address this problem . In the following section we briefly review the key concepts pertaining to this family of divergences . 1We use the generalized density to include the case that AAT is not full rank . 2The KL divergence KL ( Q||P ) is well defined when Q and P have valid densities and their densities have the same support ( Ali and Silvey , 1966 ) . 4 FIX THE ILL-DEFINED KL DIVERGENCE . random Let ZQ and ZP be two random variables with distribution QZ and PZ . The KL divergence between QZ and PZ is not defined if QZ or PZ does not have valid density function . Let K be an a.c. random variable that is independent of ZQ and ZP and has density pK , We define ZP̃ = ZP +K ; ZQ̃ = ZQ +K with distributions P̃Z and Q̃Z respectively . Then P̃Z and Q̃Z are a.c. with density functions q ( z̃ ) = ∫ z pK ( z̃− z ) dQZ p ( z̃ ) = ∫ z pK ( z̃− z ) dPZ . ( 6 ) We can thus define the spread KL divergence between QZ and PZ as the KL divergence between Q̃Z and P̃Z as : K̃L ( QZ ||PZ ) ≡ KL ( Q̃Z ||P̃Z ) ≡ KL ( q ( z̃ ) ||p ( z̃ ) ) . ( 7 ) In this work we letK be a Gaussian with diagonal covariance σ2ZI to satisfy the sufficient conditions such that K̃L is a valid divergence ( see Zhang et al . ( 2020 ) for details ) and has the properties : K̃L ( QZ ||PZ ) ≥ 0 , K̃L ( QZ ||PZ ) = 0⇔ QZ = PZ . ( 8 ) Since QZ and PZ are transformed from Pd and PX using an invertible function g , we have QZ = PZ ⇔ Pd = PX . ( 9 ) Therefore , the spread KL divergence can be used to train flow based models with a manifold prior in order to fit a dataset that lies on a lower-dimensional manifold .
This paper proposes a new method to train flow models on data from low dimensional manifolds embedded in high dimensional ambient spaces. The basic idea is based on minimizing the KL divergence in the latent space, which is equivalent to maximizing expected log-likelihood over the data distribution. Since the KL between two low-dimensional distributions are often undefined, authors propose to use spread divergence as a surrogate. Experiments demonstrate that the authors' technique can successfully model the distributions on low-dimensional manifolds without knowing the manifold beforehand. In particular, the proposed method can recover the intrinsic dimensionality of data manifolds.
SP:74b9886e22662058748cc0cde4ba88f29f340f55
On the Latent Space of Flow-based Models
1 INTRODUCTION . Normalizing flows ( Rezende and Mohamed , 2015 ; Kobyzev et al. , 2020 ) have shown considerable potential for the tasks of modelling and inferring expressive distributions through the learning of well-specified probabilistic models . Contemporary flow-based approaches define a latent space with dimensionality identical to the data space , typically by parameterizing a complex model pX ( x|θ ) using an invertible neural network fθ . Samples drawn from an initial , simple distribution pZ ( z ) ( e.g . Gaussian ) can be mapped to a complex distribution as x = fθ ( z ) . The process results in a tractable density that inhabits the full data space . However , contemporary flow models may make for an inappropriate choice to represent data that resides in a lower-dimensional manifold and thus does not populate the full ambient space . In such cases , the estimated model will necessarily have mass lying off the data manifold , which may result in under-fitting and poor generation qualities . Furthermore , principal objectives such as Maximum Likelihood Estimation ( MLE ) and Kullback-Leibler ( KL ) divergence minimization are ill-defined , bringing additional challenges for model training . In this work , we propose a principled strategy to model a data distribution that lies on a continuous manifold and we additionally identify the intrinsic dimension of the data manifold . Specifically , by using the connection between MLE and KL divergence minimization in Z space , we can address the important problem of ill-defined KL divergence under typical flow based assumptions . Flow models are based on the idea of “ change of variable ” . Assume a random variable Z with distribution PZ and probability density pZ ( z ) . We can transform Z to get a random variable X : X = f ( Z ) , where f : RD → RD is an invertible function with inverse f−1 = g. Suppose X has distribution PX and density function pX ( x ) , then log pX ( x ) will have the following form log pX ( x ) = log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ , ( 1 ) where log ∣∣∣det ( ∂g∂x ) ∣∣∣ is the log determinant of the Jacobian matrix . We call f ( or g ) a volumepreserving function if the log determinant is equal to 0 . Training of flow models typically makes use of MLE . We denote Xd as the random variable of the data with distribution Pd and density pd ( x ) . In addition to the well-known connection between MLE and minimization of the KL divergence KL ( pd ( x ) ||pX ( x ) ) in X space ( see Appendix A for detail ) , MLE is also ( approximately ) equivalent to minimizing the KL divergence in Z space , this is due to the KL divergence is invariant under invertible transformation ( Yeung , 2008 ; Papamakarios et al. , 2019 ) . Specifically , we define ZQ : ZQ = g ( Xd ) with distribution QZ and density function q ( z ) , the KL divergence in Z space can be written as KL ( q ( z ) ||p ( z ) ) = ∫ q ( z ) log q ( z ) dz − ∫ q ( z ) log p ( z ) dz ( 2 ) = − ∫ pd ( x ) ( log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ ) dx+ const. , ( 3 ) The full derivation can be found in Appendix A . Since we can only access samples x1 , x2 , . . . , xN from pd ( x ) , we approximate the integral by Monte Carlo sampling KL ( q ( z ) ||p ( z ) ) ≈ − 1 N N∑ n=1 log pX ( xn ) + const .. ( 4 ) We thus highlight the connection between MLE and KL divergence minimization , in Z space , for flow based models . The prior distribution p ( z ) is usually chosen to be a D-dimensional Gaussian distribution . However , if the data distribution Pd is singular , for example a measure on a low dimensional manifold , the induced latent distribution QZ is also singular . In this case , the KL divergence in equation 2 is typically not well-defined under the considered flow based model assumptions . This issue brings both theoretical and practical challenges that we will discuss in the following section . 2 FLOW MODELS WITH MANIFOLD DATA . We assume a data sample x ∼ Pd to be a D dimensional vector x ∈ RD and define the ambient dimensionality of Pd , denoted by Amdim ( Pd ) , to be D. However for many datasets of interest , e.g . natural images , the data distribution Pd is commonly believed to be supported on a lower dimensional manifold ( Beymer and Poggio , 1996 ) . We assume the dimensionality of the manifold to beK where K < D , and define the intrinsic dimension of Pd , denoted by Indim ( Pd ) , to be the dimension of this manifold . Figure 1a provides an example of this setting where Pd is a 1D distribution in 2D space . Specifically , each data sample x ∼ Pd is a 2D vector x = { x1 , x2 } where x1 ∼ N ( 0 , 1 ) and x2 = sin ( 2x1 ) . Therefore , this example results in Amdim ( Pd ) = 2 and Indim ( Pd ) = 1 . In flow-based models , function f is constructed such that it is both bijective and differentiable . When the prior PZ is a distribution whose support is RD ( e.g . Multivariate Gaussian distribution ) , the marginal distribution PX will also have support RD and Amdim ( PX ) = Indim ( PX ) = D. When the support of the data distribution lies on aK-dimensional manifold andK < D , Pd and PX are constrained to have different support . That is , the intrinsic dimensions of PX and Pd are always different ; Indim ( PX ) 6= Indim ( Pd ) . In this case it is impossible to learn a model distribution PX identical to the data distribution Pd . Nevertheless , flow-based models have shown strong empirical success in real-world problem domains such as the ability to generate high quality and realistic images ( Kingma and Dhariwal , 2018 ) . Towards investigating the cause and explaining this disparity between theory and practice , we employ a toy example to provide intuition for the effects and consequences resulting from model and data distributions that possess differing intrinsic dimension . Consider the toy dataset introduced previously ; a 1D distribution lying in a 2D space ( Figure 1a ) . The prior density p ( z ) is a standard 2D Gaussian p ( z ) = N ( 0 , IZ ) and the function f is a nonvolume preserving flow with two coupling layers ( see Appendix C.1 ) . In Figure 1b we plot samples from the flow model ; the sample x is generated by first sampling a 2D datapoint z ∼ N ( 0 , IZ ) and then letting x = f ( z ) . Figure 1c shows samples from the prior distributions PZ and QZ . QZ is defined as the transformation of Pd using the bijective function g , such that QZ is constrained to support a 1D manifold in 2D space , and Indim ( QZ ) = Indim ( Pd ) = 1 . Training of QZ to match PZ ( which has intrinsic dimension 2 ) , can be seen in Figure 1c to result in curling up of the manifold in the latent space , contorting it towards satisfying a distribution that has intrinsic dimension 2 . This ill-behaved phenomenon causes several potential problems for contemporary flow models : 1 . Poor sample quality . Figure 1b shows examples where incorrect assumptions in turn result in the model generating bad samples . 2 . Low quality data representations . The discussed characteristic that results in “ curling up ” of the latent space may cause degradations of the representation quality . 3 . Inefficient use of network capacity . Neural network capacity is spent on contorting the distribution QZ to satisfy imposed dimensionality constraints . A natural solution to the problem of intrinsic dimension mismatch is to select a prior distribution PZ with the same dimensionality as the intrinsic dimension of the data distribution such that : Indim ( PZ ) = Indim ( Pd ) . However , since we do not know Indim ( Pd ) explicitly , one option involves to instead learn it from the data distribution . In the following section , we will introduce a parameterization approach that enables us to learn Indim ( Pd ) . 3 LEARNING A MANIFOLD PRIOR . Consider a data vector x ∈ RD , then a flow based model prior PZ is usually given by a Ddimensional Gaussian distribution or alternative simple distribution that is also absolutely continuous ( a.c. ) in RD . Therefore , the intrinsic dimension Indim ( PZ ) = D. To allow a prior to have intrinsic dimension strictly less than D , we let PZ have the ‘ generalized density ’ 1 p ( z ) with the form p ( z ) = N ( 0 , AAT ) , ( 5 ) where z ∈ RD and A is a D×D lower triangular matrix with D ( D+1 ) 2 parameters , such that AA T is constrained to be a positive semi-definite matrix . When AAT has full rank D , then PZ is a ( nondegenerate ) multivariate Gaussian on RD . When Rank ( AAT ) = K and K < D , then PZ will degenerate to a Gaussian supported on a K-dimensional manifold , such that the intrinsic dimension Indim ( PZ ) = K. Figure 2 illustrates a sketch of this scenario . In practice , we initialize A to be an identity matrix , so AAT will also be an identity matrix and PZ is initialized as a standard Gaussian . When Rank ( AAT ) < D , the degenerate covariance AAT is no longer invertible and we are unable to evaluate the density value of p ( z ) for a given random vector z . Furthermore , when the data distribution Pd is supported on a K-dimensional manifold , QZ will also be supported on a Kdimensional manifold and no longer has a valid density function . Using equation 2 to train the flow model then becomes impossible as the KL divergence between PZ and QZ is not well defined2 . Recent work by Zhang et al . ( 2020 ) proposed a new family of divergence to address this problem . In the following section we briefly review the key concepts pertaining to this family of divergences . 1We use the generalized density to include the case that AAT is not full rank . 2The KL divergence KL ( Q||P ) is well defined when Q and P have valid densities and their densities have the same support ( Ali and Silvey , 1966 ) . 4 FIX THE ILL-DEFINED KL DIVERGENCE . random Let ZQ and ZP be two random variables with distribution QZ and PZ . The KL divergence between QZ and PZ is not defined if QZ or PZ does not have valid density function . Let K be an a.c. random variable that is independent of ZQ and ZP and has density pK , We define ZP̃ = ZP +K ; ZQ̃ = ZQ +K with distributions P̃Z and Q̃Z respectively . Then P̃Z and Q̃Z are a.c. with density functions q ( z̃ ) = ∫ z pK ( z̃− z ) dQZ p ( z̃ ) = ∫ z pK ( z̃− z ) dPZ . ( 6 ) We can thus define the spread KL divergence between QZ and PZ as the KL divergence between Q̃Z and P̃Z as : K̃L ( QZ ||PZ ) ≡ KL ( Q̃Z ||P̃Z ) ≡ KL ( q ( z̃ ) ||p ( z̃ ) ) . ( 7 ) In this work we letK be a Gaussian with diagonal covariance σ2ZI to satisfy the sufficient conditions such that K̃L is a valid divergence ( see Zhang et al . ( 2020 ) for details ) and has the properties : K̃L ( QZ ||PZ ) ≥ 0 , K̃L ( QZ ||PZ ) = 0⇔ QZ = PZ . ( 8 ) Since QZ and PZ are transformed from Pd and PX using an invertible function g , we have QZ = PZ ⇔ Pd = PX . ( 9 ) Therefore , the spread KL divergence can be used to train flow based models with a manifold prior in order to fit a dataset that lies on a lower-dimensional manifold .
This paper proposes a modification to the latent distribution of a flow model, replacing the commonly used full-rank Normal with a low-rank one which has the form N(0, AA^T). To train this degenerate model, the spread divergence from Zhang et al. (2020) is used and some approximation is made (e.g., ignoring the first entropy term). Experiments on toy data (with 1d intrinsic dimension) and mnist digits generated from a GAN (with 5-10 intrinsic dimension) demonstrated that the proposed model can identify the intrinsic dimension through the rank of AA^T.
SP:74b9886e22662058748cc0cde4ba88f29f340f55
On the Latent Space of Flow-based Models
1 INTRODUCTION . Normalizing flows ( Rezende and Mohamed , 2015 ; Kobyzev et al. , 2020 ) have shown considerable potential for the tasks of modelling and inferring expressive distributions through the learning of well-specified probabilistic models . Contemporary flow-based approaches define a latent space with dimensionality identical to the data space , typically by parameterizing a complex model pX ( x|θ ) using an invertible neural network fθ . Samples drawn from an initial , simple distribution pZ ( z ) ( e.g . Gaussian ) can be mapped to a complex distribution as x = fθ ( z ) . The process results in a tractable density that inhabits the full data space . However , contemporary flow models may make for an inappropriate choice to represent data that resides in a lower-dimensional manifold and thus does not populate the full ambient space . In such cases , the estimated model will necessarily have mass lying off the data manifold , which may result in under-fitting and poor generation qualities . Furthermore , principal objectives such as Maximum Likelihood Estimation ( MLE ) and Kullback-Leibler ( KL ) divergence minimization are ill-defined , bringing additional challenges for model training . In this work , we propose a principled strategy to model a data distribution that lies on a continuous manifold and we additionally identify the intrinsic dimension of the data manifold . Specifically , by using the connection between MLE and KL divergence minimization in Z space , we can address the important problem of ill-defined KL divergence under typical flow based assumptions . Flow models are based on the idea of “ change of variable ” . Assume a random variable Z with distribution PZ and probability density pZ ( z ) . We can transform Z to get a random variable X : X = f ( Z ) , where f : RD → RD is an invertible function with inverse f−1 = g. Suppose X has distribution PX and density function pX ( x ) , then log pX ( x ) will have the following form log pX ( x ) = log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ , ( 1 ) where log ∣∣∣det ( ∂g∂x ) ∣∣∣ is the log determinant of the Jacobian matrix . We call f ( or g ) a volumepreserving function if the log determinant is equal to 0 . Training of flow models typically makes use of MLE . We denote Xd as the random variable of the data with distribution Pd and density pd ( x ) . In addition to the well-known connection between MLE and minimization of the KL divergence KL ( pd ( x ) ||pX ( x ) ) in X space ( see Appendix A for detail ) , MLE is also ( approximately ) equivalent to minimizing the KL divergence in Z space , this is due to the KL divergence is invariant under invertible transformation ( Yeung , 2008 ; Papamakarios et al. , 2019 ) . Specifically , we define ZQ : ZQ = g ( Xd ) with distribution QZ and density function q ( z ) , the KL divergence in Z space can be written as KL ( q ( z ) ||p ( z ) ) = ∫ q ( z ) log q ( z ) dz − ∫ q ( z ) log p ( z ) dz ( 2 ) = − ∫ pd ( x ) ( log pZ ( g ( x ) ) + log ∣∣∣∣det ( ∂g∂x ) ∣∣∣∣ ) dx+ const. , ( 3 ) The full derivation can be found in Appendix A . Since we can only access samples x1 , x2 , . . . , xN from pd ( x ) , we approximate the integral by Monte Carlo sampling KL ( q ( z ) ||p ( z ) ) ≈ − 1 N N∑ n=1 log pX ( xn ) + const .. ( 4 ) We thus highlight the connection between MLE and KL divergence minimization , in Z space , for flow based models . The prior distribution p ( z ) is usually chosen to be a D-dimensional Gaussian distribution . However , if the data distribution Pd is singular , for example a measure on a low dimensional manifold , the induced latent distribution QZ is also singular . In this case , the KL divergence in equation 2 is typically not well-defined under the considered flow based model assumptions . This issue brings both theoretical and practical challenges that we will discuss in the following section . 2 FLOW MODELS WITH MANIFOLD DATA . We assume a data sample x ∼ Pd to be a D dimensional vector x ∈ RD and define the ambient dimensionality of Pd , denoted by Amdim ( Pd ) , to be D. However for many datasets of interest , e.g . natural images , the data distribution Pd is commonly believed to be supported on a lower dimensional manifold ( Beymer and Poggio , 1996 ) . We assume the dimensionality of the manifold to beK where K < D , and define the intrinsic dimension of Pd , denoted by Indim ( Pd ) , to be the dimension of this manifold . Figure 1a provides an example of this setting where Pd is a 1D distribution in 2D space . Specifically , each data sample x ∼ Pd is a 2D vector x = { x1 , x2 } where x1 ∼ N ( 0 , 1 ) and x2 = sin ( 2x1 ) . Therefore , this example results in Amdim ( Pd ) = 2 and Indim ( Pd ) = 1 . In flow-based models , function f is constructed such that it is both bijective and differentiable . When the prior PZ is a distribution whose support is RD ( e.g . Multivariate Gaussian distribution ) , the marginal distribution PX will also have support RD and Amdim ( PX ) = Indim ( PX ) = D. When the support of the data distribution lies on aK-dimensional manifold andK < D , Pd and PX are constrained to have different support . That is , the intrinsic dimensions of PX and Pd are always different ; Indim ( PX ) 6= Indim ( Pd ) . In this case it is impossible to learn a model distribution PX identical to the data distribution Pd . Nevertheless , flow-based models have shown strong empirical success in real-world problem domains such as the ability to generate high quality and realistic images ( Kingma and Dhariwal , 2018 ) . Towards investigating the cause and explaining this disparity between theory and practice , we employ a toy example to provide intuition for the effects and consequences resulting from model and data distributions that possess differing intrinsic dimension . Consider the toy dataset introduced previously ; a 1D distribution lying in a 2D space ( Figure 1a ) . The prior density p ( z ) is a standard 2D Gaussian p ( z ) = N ( 0 , IZ ) and the function f is a nonvolume preserving flow with two coupling layers ( see Appendix C.1 ) . In Figure 1b we plot samples from the flow model ; the sample x is generated by first sampling a 2D datapoint z ∼ N ( 0 , IZ ) and then letting x = f ( z ) . Figure 1c shows samples from the prior distributions PZ and QZ . QZ is defined as the transformation of Pd using the bijective function g , such that QZ is constrained to support a 1D manifold in 2D space , and Indim ( QZ ) = Indim ( Pd ) = 1 . Training of QZ to match PZ ( which has intrinsic dimension 2 ) , can be seen in Figure 1c to result in curling up of the manifold in the latent space , contorting it towards satisfying a distribution that has intrinsic dimension 2 . This ill-behaved phenomenon causes several potential problems for contemporary flow models : 1 . Poor sample quality . Figure 1b shows examples where incorrect assumptions in turn result in the model generating bad samples . 2 . Low quality data representations . The discussed characteristic that results in “ curling up ” of the latent space may cause degradations of the representation quality . 3 . Inefficient use of network capacity . Neural network capacity is spent on contorting the distribution QZ to satisfy imposed dimensionality constraints . A natural solution to the problem of intrinsic dimension mismatch is to select a prior distribution PZ with the same dimensionality as the intrinsic dimension of the data distribution such that : Indim ( PZ ) = Indim ( Pd ) . However , since we do not know Indim ( Pd ) explicitly , one option involves to instead learn it from the data distribution . In the following section , we will introduce a parameterization approach that enables us to learn Indim ( Pd ) . 3 LEARNING A MANIFOLD PRIOR . Consider a data vector x ∈ RD , then a flow based model prior PZ is usually given by a Ddimensional Gaussian distribution or alternative simple distribution that is also absolutely continuous ( a.c. ) in RD . Therefore , the intrinsic dimension Indim ( PZ ) = D. To allow a prior to have intrinsic dimension strictly less than D , we let PZ have the ‘ generalized density ’ 1 p ( z ) with the form p ( z ) = N ( 0 , AAT ) , ( 5 ) where z ∈ RD and A is a D×D lower triangular matrix with D ( D+1 ) 2 parameters , such that AA T is constrained to be a positive semi-definite matrix . When AAT has full rank D , then PZ is a ( nondegenerate ) multivariate Gaussian on RD . When Rank ( AAT ) = K and K < D , then PZ will degenerate to a Gaussian supported on a K-dimensional manifold , such that the intrinsic dimension Indim ( PZ ) = K. Figure 2 illustrates a sketch of this scenario . In practice , we initialize A to be an identity matrix , so AAT will also be an identity matrix and PZ is initialized as a standard Gaussian . When Rank ( AAT ) < D , the degenerate covariance AAT is no longer invertible and we are unable to evaluate the density value of p ( z ) for a given random vector z . Furthermore , when the data distribution Pd is supported on a K-dimensional manifold , QZ will also be supported on a Kdimensional manifold and no longer has a valid density function . Using equation 2 to train the flow model then becomes impossible as the KL divergence between PZ and QZ is not well defined2 . Recent work by Zhang et al . ( 2020 ) proposed a new family of divergence to address this problem . In the following section we briefly review the key concepts pertaining to this family of divergences . 1We use the generalized density to include the case that AAT is not full rank . 2The KL divergence KL ( Q||P ) is well defined when Q and P have valid densities and their densities have the same support ( Ali and Silvey , 1966 ) . 4 FIX THE ILL-DEFINED KL DIVERGENCE . random Let ZQ and ZP be two random variables with distribution QZ and PZ . The KL divergence between QZ and PZ is not defined if QZ or PZ does not have valid density function . Let K be an a.c. random variable that is independent of ZQ and ZP and has density pK , We define ZP̃ = ZP +K ; ZQ̃ = ZQ +K with distributions P̃Z and Q̃Z respectively . Then P̃Z and Q̃Z are a.c. with density functions q ( z̃ ) = ∫ z pK ( z̃− z ) dQZ p ( z̃ ) = ∫ z pK ( z̃− z ) dPZ . ( 6 ) We can thus define the spread KL divergence between QZ and PZ as the KL divergence between Q̃Z and P̃Z as : K̃L ( QZ ||PZ ) ≡ KL ( Q̃Z ||P̃Z ) ≡ KL ( q ( z̃ ) ||p ( z̃ ) ) . ( 7 ) In this work we letK be a Gaussian with diagonal covariance σ2ZI to satisfy the sufficient conditions such that K̃L is a valid divergence ( see Zhang et al . ( 2020 ) for details ) and has the properties : K̃L ( QZ ||PZ ) ≥ 0 , K̃L ( QZ ||PZ ) = 0⇔ QZ = PZ . ( 8 ) Since QZ and PZ are transformed from Pd and PX using an invertible function g , we have QZ = PZ ⇔ Pd = PX . ( 9 ) Therefore , the spread KL divergence can be used to train flow based models with a manifold prior in order to fit a dataset that lies on a lower-dimensional manifold .
This paper proposes a new method of training flow models, instead of minimizing KL divergence in the data space X, the paper proposes to minimize the KL divergence in the latent space Z. However, the problem of this is dimension mismatch, so the KL divergence is ill-defined. The proposed solution is to add noise, such that the KL divergence can be well defined again. In addition, this paper proposes learning a low dimensional prior p(Z) by a Gaussian distribution with low rank covariance matrix.
SP:74b9886e22662058748cc0cde4ba88f29f340f55
CT-Net: Channel Tensorization Network for Video Classification
3D convolution is powerful for video classification but often computationally expensive , recent studies mainly focus on decomposing it on spatial-temporal and/or channel dimensions . Unfortunately , most approaches fail to achieve a preferable balance between convolutional efficiency and feature-interaction sufficiency . For this reason , we propose a concise and novel Channel Tensorization Network ( CTNet ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions . On one hand , it naturally factorizes convolution in a multiple dimension way , leading to a light computation burden . On the other hand , it can effectively enhance feature interaction from different channels , and progressively enlarge the 3D receptive field of such interaction to boost classification accuracy . Furthermore , we equip our CT-Module with a Tensor Excitation ( TE ) mechanism . It can learn to exploit spatial , temporal and channel attention in a high-dimensional manner , to improve the cooperative power of all the feature dimensions in our CT-Module . Finally , we flexibly adapt ResNet as our CT-Net . Extensive experiments are conducted on several challenging video benchmarks , e.g. , Kinetics-400 , Something-Something V1 and V2 . Our CT-Net outperforms a number of recent SOTA approaches , in terms of accuracy and/or efficiency . 1 INTRODUCTION . 3D convolution has been widely used to learn spatial-temporal representation for video classification ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ) . However , over parameterization often makes it computationally expensive and hard to train . To alleviate such difficulty , recent studies mainly focus on decomposing 3D convolution ( Tran et al. , 2018 ; 2019 ) . One popular approach is spatial-temporal factorization ( Qiu et al. , 2017 ; Tran et al. , 2018 ; Xie et al. , 2018 ) , which can reduce overfitting by replacing 3D convolution with 2D spatial convolution and 1D temporal convolution . But it still introduces unnecessary computation burden , since both spatial convolution and temporal convolution are performed over all the feature channels . To further decrease such computation cost , channel separation has been recently developed via operating 3D convolution in the depth-wise manner ( Tran et al. , 2019 ) . However , it inevitably loses accuracy due to the lack of feature interaction between different channels . For compensation , it has to introduce point-wise convolution to preserve interaction with extra computation . So there is a natural question : How to construct effective 3D convolution to achieve a preferable trade-off between efficiency and accuracy for video classification ? ∗Equally-contributed first authors ( { kc.li , yl.wang } @ siat.ac.cn , xianhangli @ knights.ucf.edu ) †Corresponding author ( yu.qiao @ siat.ac.cn ) This paper attempts to address this question by investigating two design principles . ( 1 ) Convolutional Efficiency . As shown in Table 1 , current designs of spatial-temporal convolution mainly focus on decomposition from either spatial-temporal ( Tran et al. , 2018 ) or channel dimension ( Tran et al. , 2019 ) . To enhance convolutional efficiency , we consider decomposing convolution in a higher dimension with a novel representation of feature tensor . ( 2 ) Feature-Interaction Sufficiency . Table 1 clearly shows that , for current decomposition approaches ( Tran et al. , 2018 ; 2019 ) , feature interaction only contains one or two of spatial , temporal and channel dimensions at each sub-operation . Such a partial interaction manner would reduce classification accuracy . On one hand , it decreases the discriminative power of video representation , due to the lack of joint learning on all the dimensions . On the other hand , it restricts feature interaction in a limited receptive field , which ignores rich context from a larger 3D region . Hence , to boost classification accuracy , each sub-operation should achieve feature interaction on all the dimensions , and the receptive field of such interaction should be progressively enlarged as the number of sub-operations increases . Based on these desirable principles , we design a novel and concise Channel Tensorization Module ( CT-Module ) . Specifically , we propose to tensorize the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Via performing spatial/temporal separable convolution along each sub-dimension , we can effectively achieve convolutional efficiency and feature-interaction sufficiency . For better understanding , we use the case of K = 2 as a simple illustration in Figure 1 . First , we tensorize the input channel into C = C1×C2 . Naturally , we separate the convolution into distinct ones along each sub-dimension , e.g. , for the 1st sub-dimension , we apply our spatial-temporal tensor separable convolution with the size C1×1×t×h×w , which allows us to achieve convolutional efficiency on all the spatial , temporal and channel dimensions . After that , we sequentially perform the tensor separable convolution sub-dimension by sub-dimension . As a result , we can progressively achieve feature interaction on all the channels , and enlarge the spatialtemporal receptive field . For example , after operating 1st tensor separable convolution on the 1st sub-dimension , C1 channels interact , and 3D receptive field of such interaction is 3 × 3 × 3 . Via further operating 2nd tensor separable convolution on the 2nd sub-dimension , all C1 × C2 = C channels have feature interaction , and 3D receptive field of such interaction becomes 5×5×5 . This clearly satisfies our principle of feature-interaction sufficiency . We summarize our contributions in the following . First , we design a novel Channel Tensorized Module ( CT-Module ) , which can achieve convolutional efficiency and feature-interaction sufficiency , via progressively performing spatial/temporal tensor separable convolution along each sub-dimension of the tensorized channel . Second , we equip CT-Module with a distinct Tensor Excitation ( TE ) mechanism , which can further activate the video features of each sub-operation by spatial , temporal and channel attention in a tensor-wise manner . Subsequently , we apply this full module in a residual block , and flexibly adopt 2D ResNet as our Channel Tensorized Network ( CT-Net ) . In this case , we can gradually enhance feature interaction from a broader 3D receptive field , and learn the key spatial-temporal representation with light computation . Finally , we conduct extensive experiments on a number of popular and challenging benchmarks , e.g. , Kinetics ( Carreira & Zisserman , 2017 ) , Something-Something V1 and V2 ( Goyal et al. , 2017b ) . Our CT-Net outperforms the state-of-the-art methods in terms of classification accuracy and/or computation cost . 2 RELATED WORKS . 2D CNN for video classification . 2D CNN is a straightforward but useful method for video classification ( Karpathy et al. , 2014 ; Simonyan & Zisserman , 2014 ; Wang et al. , 2016 ; Liu et al. , 2020 ; Jiang et al. , 2019 ) . For example , Two-stream methods ( Simonyan & Zisserman , 2014 ) learn video representations by fusing the features from RGB and optical flow respectively . Instead of sampling a single RGB frame , TSN ( Wang et al. , 2016 ) proposes a sparse temporal sampling strategy to learn video representations . To further improve accuracy , TSM ( Lin et al. , 2019 ) proposes a zeroparameter temporal shift module to exchange information with adjacent frames . However , these methods may lack the capacity of learning spatial-temporal interaction comprehensively , which often reduces their discriminative power to recognize complex human actions . 3D CNN for video classification . 3D CNN has been widely used to learn a rich spatial-temporal context better ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ; Feichtenhofer et al. , 2019 ; Sudhakaran et al. , 2020 ; Feichtenhofer , 2020 ) . However , it introduces a lot of parameters , which leads to a difficult optimization problem and large computational load . To resolve this issue , I3D ( Carreira & Zisserman , 2017 ) inflates all the 2D convolution kernels pre-trained on ImageNet , which is helpful for optimizing . Other works also try to factorize 3D convolution kernel to reduce complexity , such as P3D ( Qiu et al. , 2017 ) and R ( 2+1 ) D ( Tran et al. , 2018 ) . Recently , CSN ( Tran et al. , 2019 ) operates 3D convolution in the depth-wise manner . Nevertheless , all these methods still do not achieve a good trade-off between accuracy and efficiency . To tackle this challenge , we propose CT-Net which learns on spatial-temporal and channel dimensions jointly with lower computation than previous methods . 3 METHODS . In this section , we describe our Channel Tensorization Network ( CT-Net ) in detail . First , we formally introduce our CT-Module in a generic manner . Second , we design a Tensor Excitation ( TE ) mechanism to enhance CT-Module . Finally , we flexibly adapt ResNet as our CT-Net to achieve a preferable trade-off between accuracy and efficiency for video classification . 3.1 CHANNEL TENSORIZATION MODULE . As discussed in the introduction , the previous approaches have problems in convolutional efficiency or feature-interaction sufficiency . To tackle such a problem , we introduce a generic Channel Tensorization Module ( CT-Module ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Naturally , this tensor representation allows to tensorize the kernel size of convolution TConv ( ) as a multiplication of K sub-dimensions , too . To simplify the notation , the channel dimension of the output is omitted by default . The output Xout can be calculated as follows : Xout = TConv ( Xin , W C1×C2×···×CK×t×h×w ) ( 1 ) where Xin and W denote the tensorized input and kernel respectively . However , such an operation requires large computation , so we introduce the tensor separable convolution to alleviate the issue . Tensor Separable Convolution . We propose to factorize TConv ( ) along K channel sub-dimensions . Specifically , we decompose TConv ( ) as K tensor separable convolutions TSConv ( ) , and apply TSConv ( ) sub-dimension by sub-dimension as follows : Xk = TSConv ( Xk−1 , W 1×···×Ck×···×1×t×h×w ) ( 2 ) where X0 = Xin and Xout = XK . On one hand , the kernel size of the kth TSConv ( ) is ( 1× · · · × Ck × · · · × 1× t× h× w ) . It illustrates that only Ck channels interact in the kth suboperation , which leads to convolution efficiency . On the other hand , as we stack the TSConv ( ) , each convolution performs on the output features of the previous convolution . Therefore , the spatialtemporal receptive field is enlarged . Besides , interactions first occur in C1 channels , second in C1×C2 channels and so on . Finally , C1×C2×· · ·×CK = C channels can progressively interact . This clearly satisfies our principle of feature-interaction sufficiency . Spatial-Temporal Tensor Separable Convolution . To further improve convolution efficiency , we factorize the 3D TSConv ( ) into 2D spatial TSConv ( ) and 1D temporal TSConv ( ) . Thus , we can obtain the output features XSk and X T k as follows : XSk = S-TSConv ( Xk−1 , W 1×···×Ck×···×1×1×h×w ) ( 3 ) XTk = T-TSConv ( Xk−1 , W 1×···×Ck×···×1×t×1×1 ) ( 4 ) where S-TSConv ( ) and T-TSConv ( ) represent spatial and temporal tensor separable convolution respectively . Finally , we attempt to aggregate spatial and temporal convolution . There are various connection types of spatial and temporal tensor separable convolution , e.g. , parallel and serial types . According to the results of the experiments in Section 4 , we utilize the parallel method , which illustrates that we sum the spatial feature XSk and temporal feature X T k : Xk = X S k +X T k ( 5 )
The paper proposes a new architecture for lightweight action classification networks, named Channel Tensorization Network (CT-Net). The idea of this architecture is the tensorization of mid-level input features in combination with an attention mechanism that allows to select relevant features. the channel tensorization can be used as intermediate building block e.g. in a ResNet alternately with a Res block.
SP:022d5186d69b73d9083ab192b5dd240a1cc61406
CT-Net: Channel Tensorization Network for Video Classification
3D convolution is powerful for video classification but often computationally expensive , recent studies mainly focus on decomposing it on spatial-temporal and/or channel dimensions . Unfortunately , most approaches fail to achieve a preferable balance between convolutional efficiency and feature-interaction sufficiency . For this reason , we propose a concise and novel Channel Tensorization Network ( CTNet ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions . On one hand , it naturally factorizes convolution in a multiple dimension way , leading to a light computation burden . On the other hand , it can effectively enhance feature interaction from different channels , and progressively enlarge the 3D receptive field of such interaction to boost classification accuracy . Furthermore , we equip our CT-Module with a Tensor Excitation ( TE ) mechanism . It can learn to exploit spatial , temporal and channel attention in a high-dimensional manner , to improve the cooperative power of all the feature dimensions in our CT-Module . Finally , we flexibly adapt ResNet as our CT-Net . Extensive experiments are conducted on several challenging video benchmarks , e.g. , Kinetics-400 , Something-Something V1 and V2 . Our CT-Net outperforms a number of recent SOTA approaches , in terms of accuracy and/or efficiency . 1 INTRODUCTION . 3D convolution has been widely used to learn spatial-temporal representation for video classification ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ) . However , over parameterization often makes it computationally expensive and hard to train . To alleviate such difficulty , recent studies mainly focus on decomposing 3D convolution ( Tran et al. , 2018 ; 2019 ) . One popular approach is spatial-temporal factorization ( Qiu et al. , 2017 ; Tran et al. , 2018 ; Xie et al. , 2018 ) , which can reduce overfitting by replacing 3D convolution with 2D spatial convolution and 1D temporal convolution . But it still introduces unnecessary computation burden , since both spatial convolution and temporal convolution are performed over all the feature channels . To further decrease such computation cost , channel separation has been recently developed via operating 3D convolution in the depth-wise manner ( Tran et al. , 2019 ) . However , it inevitably loses accuracy due to the lack of feature interaction between different channels . For compensation , it has to introduce point-wise convolution to preserve interaction with extra computation . So there is a natural question : How to construct effective 3D convolution to achieve a preferable trade-off between efficiency and accuracy for video classification ? ∗Equally-contributed first authors ( { kc.li , yl.wang } @ siat.ac.cn , xianhangli @ knights.ucf.edu ) †Corresponding author ( yu.qiao @ siat.ac.cn ) This paper attempts to address this question by investigating two design principles . ( 1 ) Convolutional Efficiency . As shown in Table 1 , current designs of spatial-temporal convolution mainly focus on decomposition from either spatial-temporal ( Tran et al. , 2018 ) or channel dimension ( Tran et al. , 2019 ) . To enhance convolutional efficiency , we consider decomposing convolution in a higher dimension with a novel representation of feature tensor . ( 2 ) Feature-Interaction Sufficiency . Table 1 clearly shows that , for current decomposition approaches ( Tran et al. , 2018 ; 2019 ) , feature interaction only contains one or two of spatial , temporal and channel dimensions at each sub-operation . Such a partial interaction manner would reduce classification accuracy . On one hand , it decreases the discriminative power of video representation , due to the lack of joint learning on all the dimensions . On the other hand , it restricts feature interaction in a limited receptive field , which ignores rich context from a larger 3D region . Hence , to boost classification accuracy , each sub-operation should achieve feature interaction on all the dimensions , and the receptive field of such interaction should be progressively enlarged as the number of sub-operations increases . Based on these desirable principles , we design a novel and concise Channel Tensorization Module ( CT-Module ) . Specifically , we propose to tensorize the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Via performing spatial/temporal separable convolution along each sub-dimension , we can effectively achieve convolutional efficiency and feature-interaction sufficiency . For better understanding , we use the case of K = 2 as a simple illustration in Figure 1 . First , we tensorize the input channel into C = C1×C2 . Naturally , we separate the convolution into distinct ones along each sub-dimension , e.g. , for the 1st sub-dimension , we apply our spatial-temporal tensor separable convolution with the size C1×1×t×h×w , which allows us to achieve convolutional efficiency on all the spatial , temporal and channel dimensions . After that , we sequentially perform the tensor separable convolution sub-dimension by sub-dimension . As a result , we can progressively achieve feature interaction on all the channels , and enlarge the spatialtemporal receptive field . For example , after operating 1st tensor separable convolution on the 1st sub-dimension , C1 channels interact , and 3D receptive field of such interaction is 3 × 3 × 3 . Via further operating 2nd tensor separable convolution on the 2nd sub-dimension , all C1 × C2 = C channels have feature interaction , and 3D receptive field of such interaction becomes 5×5×5 . This clearly satisfies our principle of feature-interaction sufficiency . We summarize our contributions in the following . First , we design a novel Channel Tensorized Module ( CT-Module ) , which can achieve convolutional efficiency and feature-interaction sufficiency , via progressively performing spatial/temporal tensor separable convolution along each sub-dimension of the tensorized channel . Second , we equip CT-Module with a distinct Tensor Excitation ( TE ) mechanism , which can further activate the video features of each sub-operation by spatial , temporal and channel attention in a tensor-wise manner . Subsequently , we apply this full module in a residual block , and flexibly adopt 2D ResNet as our Channel Tensorized Network ( CT-Net ) . In this case , we can gradually enhance feature interaction from a broader 3D receptive field , and learn the key spatial-temporal representation with light computation . Finally , we conduct extensive experiments on a number of popular and challenging benchmarks , e.g. , Kinetics ( Carreira & Zisserman , 2017 ) , Something-Something V1 and V2 ( Goyal et al. , 2017b ) . Our CT-Net outperforms the state-of-the-art methods in terms of classification accuracy and/or computation cost . 2 RELATED WORKS . 2D CNN for video classification . 2D CNN is a straightforward but useful method for video classification ( Karpathy et al. , 2014 ; Simonyan & Zisserman , 2014 ; Wang et al. , 2016 ; Liu et al. , 2020 ; Jiang et al. , 2019 ) . For example , Two-stream methods ( Simonyan & Zisserman , 2014 ) learn video representations by fusing the features from RGB and optical flow respectively . Instead of sampling a single RGB frame , TSN ( Wang et al. , 2016 ) proposes a sparse temporal sampling strategy to learn video representations . To further improve accuracy , TSM ( Lin et al. , 2019 ) proposes a zeroparameter temporal shift module to exchange information with adjacent frames . However , these methods may lack the capacity of learning spatial-temporal interaction comprehensively , which often reduces their discriminative power to recognize complex human actions . 3D CNN for video classification . 3D CNN has been widely used to learn a rich spatial-temporal context better ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ; Feichtenhofer et al. , 2019 ; Sudhakaran et al. , 2020 ; Feichtenhofer , 2020 ) . However , it introduces a lot of parameters , which leads to a difficult optimization problem and large computational load . To resolve this issue , I3D ( Carreira & Zisserman , 2017 ) inflates all the 2D convolution kernels pre-trained on ImageNet , which is helpful for optimizing . Other works also try to factorize 3D convolution kernel to reduce complexity , such as P3D ( Qiu et al. , 2017 ) and R ( 2+1 ) D ( Tran et al. , 2018 ) . Recently , CSN ( Tran et al. , 2019 ) operates 3D convolution in the depth-wise manner . Nevertheless , all these methods still do not achieve a good trade-off between accuracy and efficiency . To tackle this challenge , we propose CT-Net which learns on spatial-temporal and channel dimensions jointly with lower computation than previous methods . 3 METHODS . In this section , we describe our Channel Tensorization Network ( CT-Net ) in detail . First , we formally introduce our CT-Module in a generic manner . Second , we design a Tensor Excitation ( TE ) mechanism to enhance CT-Module . Finally , we flexibly adapt ResNet as our CT-Net to achieve a preferable trade-off between accuracy and efficiency for video classification . 3.1 CHANNEL TENSORIZATION MODULE . As discussed in the introduction , the previous approaches have problems in convolutional efficiency or feature-interaction sufficiency . To tackle such a problem , we introduce a generic Channel Tensorization Module ( CT-Module ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Naturally , this tensor representation allows to tensorize the kernel size of convolution TConv ( ) as a multiplication of K sub-dimensions , too . To simplify the notation , the channel dimension of the output is omitted by default . The output Xout can be calculated as follows : Xout = TConv ( Xin , W C1×C2×···×CK×t×h×w ) ( 1 ) where Xin and W denote the tensorized input and kernel respectively . However , such an operation requires large computation , so we introduce the tensor separable convolution to alleviate the issue . Tensor Separable Convolution . We propose to factorize TConv ( ) along K channel sub-dimensions . Specifically , we decompose TConv ( ) as K tensor separable convolutions TSConv ( ) , and apply TSConv ( ) sub-dimension by sub-dimension as follows : Xk = TSConv ( Xk−1 , W 1×···×Ck×···×1×t×h×w ) ( 2 ) where X0 = Xin and Xout = XK . On one hand , the kernel size of the kth TSConv ( ) is ( 1× · · · × Ck × · · · × 1× t× h× w ) . It illustrates that only Ck channels interact in the kth suboperation , which leads to convolution efficiency . On the other hand , as we stack the TSConv ( ) , each convolution performs on the output features of the previous convolution . Therefore , the spatialtemporal receptive field is enlarged . Besides , interactions first occur in C1 channels , second in C1×C2 channels and so on . Finally , C1×C2×· · ·×CK = C channels can progressively interact . This clearly satisfies our principle of feature-interaction sufficiency . Spatial-Temporal Tensor Separable Convolution . To further improve convolution efficiency , we factorize the 3D TSConv ( ) into 2D spatial TSConv ( ) and 1D temporal TSConv ( ) . Thus , we can obtain the output features XSk and X T k as follows : XSk = S-TSConv ( Xk−1 , W 1×···×Ck×···×1×1×h×w ) ( 3 ) XTk = T-TSConv ( Xk−1 , W 1×···×Ck×···×1×t×1×1 ) ( 4 ) where S-TSConv ( ) and T-TSConv ( ) represent spatial and temporal tensor separable convolution respectively . Finally , we attempt to aggregate spatial and temporal convolution . There are various connection types of spatial and temporal tensor separable convolution , e.g. , parallel and serial types . According to the results of the experiments in Section 4 , we utilize the parallel method , which illustrates that we sum the spatial feature XSk and temporal feature X T k : Xk = X S k +X T k ( 5 )
This manuscript proposes a novel convolutional operation for learning representations from video data. By decomposing the channel dimension into sub dimensions in the typically 4D video data (Time, Channel, Width, Height), one defines spatial-temporal separable convolution for each sub-dimension. This could improve the representation learning in term of efficiency and modeling quality.
SP:022d5186d69b73d9083ab192b5dd240a1cc61406
CT-Net: Channel Tensorization Network for Video Classification
3D convolution is powerful for video classification but often computationally expensive , recent studies mainly focus on decomposing it on spatial-temporal and/or channel dimensions . Unfortunately , most approaches fail to achieve a preferable balance between convolutional efficiency and feature-interaction sufficiency . For this reason , we propose a concise and novel Channel Tensorization Network ( CTNet ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions . On one hand , it naturally factorizes convolution in a multiple dimension way , leading to a light computation burden . On the other hand , it can effectively enhance feature interaction from different channels , and progressively enlarge the 3D receptive field of such interaction to boost classification accuracy . Furthermore , we equip our CT-Module with a Tensor Excitation ( TE ) mechanism . It can learn to exploit spatial , temporal and channel attention in a high-dimensional manner , to improve the cooperative power of all the feature dimensions in our CT-Module . Finally , we flexibly adapt ResNet as our CT-Net . Extensive experiments are conducted on several challenging video benchmarks , e.g. , Kinetics-400 , Something-Something V1 and V2 . Our CT-Net outperforms a number of recent SOTA approaches , in terms of accuracy and/or efficiency . 1 INTRODUCTION . 3D convolution has been widely used to learn spatial-temporal representation for video classification ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ) . However , over parameterization often makes it computationally expensive and hard to train . To alleviate such difficulty , recent studies mainly focus on decomposing 3D convolution ( Tran et al. , 2018 ; 2019 ) . One popular approach is spatial-temporal factorization ( Qiu et al. , 2017 ; Tran et al. , 2018 ; Xie et al. , 2018 ) , which can reduce overfitting by replacing 3D convolution with 2D spatial convolution and 1D temporal convolution . But it still introduces unnecessary computation burden , since both spatial convolution and temporal convolution are performed over all the feature channels . To further decrease such computation cost , channel separation has been recently developed via operating 3D convolution in the depth-wise manner ( Tran et al. , 2019 ) . However , it inevitably loses accuracy due to the lack of feature interaction between different channels . For compensation , it has to introduce point-wise convolution to preserve interaction with extra computation . So there is a natural question : How to construct effective 3D convolution to achieve a preferable trade-off between efficiency and accuracy for video classification ? ∗Equally-contributed first authors ( { kc.li , yl.wang } @ siat.ac.cn , xianhangli @ knights.ucf.edu ) †Corresponding author ( yu.qiao @ siat.ac.cn ) This paper attempts to address this question by investigating two design principles . ( 1 ) Convolutional Efficiency . As shown in Table 1 , current designs of spatial-temporal convolution mainly focus on decomposition from either spatial-temporal ( Tran et al. , 2018 ) or channel dimension ( Tran et al. , 2019 ) . To enhance convolutional efficiency , we consider decomposing convolution in a higher dimension with a novel representation of feature tensor . ( 2 ) Feature-Interaction Sufficiency . Table 1 clearly shows that , for current decomposition approaches ( Tran et al. , 2018 ; 2019 ) , feature interaction only contains one or two of spatial , temporal and channel dimensions at each sub-operation . Such a partial interaction manner would reduce classification accuracy . On one hand , it decreases the discriminative power of video representation , due to the lack of joint learning on all the dimensions . On the other hand , it restricts feature interaction in a limited receptive field , which ignores rich context from a larger 3D region . Hence , to boost classification accuracy , each sub-operation should achieve feature interaction on all the dimensions , and the receptive field of such interaction should be progressively enlarged as the number of sub-operations increases . Based on these desirable principles , we design a novel and concise Channel Tensorization Module ( CT-Module ) . Specifically , we propose to tensorize the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Via performing spatial/temporal separable convolution along each sub-dimension , we can effectively achieve convolutional efficiency and feature-interaction sufficiency . For better understanding , we use the case of K = 2 as a simple illustration in Figure 1 . First , we tensorize the input channel into C = C1×C2 . Naturally , we separate the convolution into distinct ones along each sub-dimension , e.g. , for the 1st sub-dimension , we apply our spatial-temporal tensor separable convolution with the size C1×1×t×h×w , which allows us to achieve convolutional efficiency on all the spatial , temporal and channel dimensions . After that , we sequentially perform the tensor separable convolution sub-dimension by sub-dimension . As a result , we can progressively achieve feature interaction on all the channels , and enlarge the spatialtemporal receptive field . For example , after operating 1st tensor separable convolution on the 1st sub-dimension , C1 channels interact , and 3D receptive field of such interaction is 3 × 3 × 3 . Via further operating 2nd tensor separable convolution on the 2nd sub-dimension , all C1 × C2 = C channels have feature interaction , and 3D receptive field of such interaction becomes 5×5×5 . This clearly satisfies our principle of feature-interaction sufficiency . We summarize our contributions in the following . First , we design a novel Channel Tensorized Module ( CT-Module ) , which can achieve convolutional efficiency and feature-interaction sufficiency , via progressively performing spatial/temporal tensor separable convolution along each sub-dimension of the tensorized channel . Second , we equip CT-Module with a distinct Tensor Excitation ( TE ) mechanism , which can further activate the video features of each sub-operation by spatial , temporal and channel attention in a tensor-wise manner . Subsequently , we apply this full module in a residual block , and flexibly adopt 2D ResNet as our Channel Tensorized Network ( CT-Net ) . In this case , we can gradually enhance feature interaction from a broader 3D receptive field , and learn the key spatial-temporal representation with light computation . Finally , we conduct extensive experiments on a number of popular and challenging benchmarks , e.g. , Kinetics ( Carreira & Zisserman , 2017 ) , Something-Something V1 and V2 ( Goyal et al. , 2017b ) . Our CT-Net outperforms the state-of-the-art methods in terms of classification accuracy and/or computation cost . 2 RELATED WORKS . 2D CNN for video classification . 2D CNN is a straightforward but useful method for video classification ( Karpathy et al. , 2014 ; Simonyan & Zisserman , 2014 ; Wang et al. , 2016 ; Liu et al. , 2020 ; Jiang et al. , 2019 ) . For example , Two-stream methods ( Simonyan & Zisserman , 2014 ) learn video representations by fusing the features from RGB and optical flow respectively . Instead of sampling a single RGB frame , TSN ( Wang et al. , 2016 ) proposes a sparse temporal sampling strategy to learn video representations . To further improve accuracy , TSM ( Lin et al. , 2019 ) proposes a zeroparameter temporal shift module to exchange information with adjacent frames . However , these methods may lack the capacity of learning spatial-temporal interaction comprehensively , which often reduces their discriminative power to recognize complex human actions . 3D CNN for video classification . 3D CNN has been widely used to learn a rich spatial-temporal context better ( Tran et al. , 2015 ; Carreira & Zisserman , 2017 ; Feichtenhofer et al. , 2019 ; Sudhakaran et al. , 2020 ; Feichtenhofer , 2020 ) . However , it introduces a lot of parameters , which leads to a difficult optimization problem and large computational load . To resolve this issue , I3D ( Carreira & Zisserman , 2017 ) inflates all the 2D convolution kernels pre-trained on ImageNet , which is helpful for optimizing . Other works also try to factorize 3D convolution kernel to reduce complexity , such as P3D ( Qiu et al. , 2017 ) and R ( 2+1 ) D ( Tran et al. , 2018 ) . Recently , CSN ( Tran et al. , 2019 ) operates 3D convolution in the depth-wise manner . Nevertheless , all these methods still do not achieve a good trade-off between accuracy and efficiency . To tackle this challenge , we propose CT-Net which learns on spatial-temporal and channel dimensions jointly with lower computation than previous methods . 3 METHODS . In this section , we describe our Channel Tensorization Network ( CT-Net ) in detail . First , we formally introduce our CT-Module in a generic manner . Second , we design a Tensor Excitation ( TE ) mechanism to enhance CT-Module . Finally , we flexibly adapt ResNet as our CT-Net to achieve a preferable trade-off between accuracy and efficiency for video classification . 3.1 CHANNEL TENSORIZATION MODULE . As discussed in the introduction , the previous approaches have problems in convolutional efficiency or feature-interaction sufficiency . To tackle such a problem , we introduce a generic Channel Tensorization Module ( CT-Module ) , by treating the channel dimension of input feature as a multiplication of K sub-dimensions , i.e. , C = C1 × C2 × · · · × CK . Naturally , this tensor representation allows to tensorize the kernel size of convolution TConv ( ) as a multiplication of K sub-dimensions , too . To simplify the notation , the channel dimension of the output is omitted by default . The output Xout can be calculated as follows : Xout = TConv ( Xin , W C1×C2×···×CK×t×h×w ) ( 1 ) where Xin and W denote the tensorized input and kernel respectively . However , such an operation requires large computation , so we introduce the tensor separable convolution to alleviate the issue . Tensor Separable Convolution . We propose to factorize TConv ( ) along K channel sub-dimensions . Specifically , we decompose TConv ( ) as K tensor separable convolutions TSConv ( ) , and apply TSConv ( ) sub-dimension by sub-dimension as follows : Xk = TSConv ( Xk−1 , W 1×···×Ck×···×1×t×h×w ) ( 2 ) where X0 = Xin and Xout = XK . On one hand , the kernel size of the kth TSConv ( ) is ( 1× · · · × Ck × · · · × 1× t× h× w ) . It illustrates that only Ck channels interact in the kth suboperation , which leads to convolution efficiency . On the other hand , as we stack the TSConv ( ) , each convolution performs on the output features of the previous convolution . Therefore , the spatialtemporal receptive field is enlarged . Besides , interactions first occur in C1 channels , second in C1×C2 channels and so on . Finally , C1×C2×· · ·×CK = C channels can progressively interact . This clearly satisfies our principle of feature-interaction sufficiency . Spatial-Temporal Tensor Separable Convolution . To further improve convolution efficiency , we factorize the 3D TSConv ( ) into 2D spatial TSConv ( ) and 1D temporal TSConv ( ) . Thus , we can obtain the output features XSk and X T k as follows : XSk = S-TSConv ( Xk−1 , W 1×···×Ck×···×1×1×h×w ) ( 3 ) XTk = T-TSConv ( Xk−1 , W 1×···×Ck×···×1×t×1×1 ) ( 4 ) where S-TSConv ( ) and T-TSConv ( ) represent spatial and temporal tensor separable convolution respectively . Finally , we attempt to aggregate spatial and temporal convolution . There are various connection types of spatial and temporal tensor separable convolution , e.g. , parallel and serial types . According to the results of the experiments in Section 4 , we utilize the parallel method , which illustrates that we sum the spatial feature XSk and temporal feature X T k : Xk = X S k +X T k ( 5 )
This paper presents a new CNN module to learn video feature representations for action recognition, with a particular focus on increasing channel interactions for spatio-temporal modeling. To achieve that, the authors propose to divide feature channels into several sub-dimensions (called channel tensorization) and then perform group convolutions at each sub-dimension sequentially to improve channel interactions. An SE-like attention mechanism is also applied to further enhance feature representation. The proposed approach achieves competitive results on Kinetics400 and Something-Something, compared to some existing SOTA results. The paper also provides detailed ablation studies on the approach.
SP:022d5186d69b73d9083ab192b5dd240a1cc61406
Deformable DETR: Deformable Transformers for End-to-End Object Detection
DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance . However , it suffers from slow convergence and limited feature spatial resolution , due to the limitation of Transformer attention modules in processing image feature maps . To mitigate these issues , we proposed Deformable DETR , whose attention modules only attend to a small set of key sampling points around a reference . Deformable DETR can achieve better performance than DETR ( especially on small objects ) with 10× less training epochs . Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach . Code is released at https : // github.com/fundamentalvision/Deformable-DETR . 1 INTRODUCTION . Modern object detectors employ many hand-crafted components ( Liu et al. , 2020 ) , e.g. , anchor generation , rule-based training target assignment , non-maximum suppression ( NMS ) post-processing . They are not fully end-to-end . Recently , Carion et al . ( 2020 ) proposed DETR to eliminate the need for such hand-crafted components , and built the first fully end-to-end object detector , achieving very competitive performance . DETR utilizes a simple architecture , by combining convolutional neural networks ( CNNs ) and Transformer ( Vaswani et al. , 2017 ) encoder-decoders . They exploit the versatile and powerful relation modeling capability of Transformers to replace the hand-crafted rules , under properly designed training signals . Despite its interesting design and good performance , DETR has its own issues : ( 1 ) It requires much longer training epochs to converge than the existing object detectors . For example , on the COCO ( Lin et al. , 2014 ) benchmark , DETR needs 500 epochs to converge , which is around 10 to 20 times slower than Faster R-CNN ( Ren et al. , 2015 ) . ( 2 ) DETR delivers relatively low performance at detecting small objects . Modern object detectors usually exploit multi-scale features , where small objects are detected from high-resolution feature maps . Meanwhile , high-resolution feature maps lead to unacceptable complexities for DETR . The above-mentioned issues can be mainly attributed to the deficit of Transformer components in processing image feature maps . At initialization , the attention modules cast nearly uniform attention weights to all the pixels in the feature maps . Long training epoches is necessary for the attention weights to be learned to focus on sparse meaningful locations . On the other hand , the attention weights computation in Transformer encoder is of quadratic computation w.r.t . pixel numbers . Thus , it is of very high computational and memory complexities to process high-resolution feature maps . In the image domain , deformable convolution ( Dai et al. , 2017 ) is of a powerful and efficient mechanism to attend to sparse spatial locations . It naturally avoids the above-mentioned issues . While it lacks the element relation modeling mechanism , which is the key for the success of DETR . ∗Equal contribution . †Corresponding author . ‡Work is done during an internship at SenseTime Research . In this paper , we propose Deformable DETR , which mitigates the slow convergence and high complexity issues of DETR . It combines the best of the sparse spatial sampling of deformable convolution , and the relation modeling capability of Transformers . We propose the deformable attention module , which attends to a small set of sampling locations as a pre-filter for prominent key elements out of all the feature map pixels . The module can be naturally extended to aggregating multi-scale features , without the help of FPN ( Lin et al. , 2017a ) . In Deformable DETR , we utilize ( multi-scale ) deformable attention modules to replace the Transformer attention modules processing feature maps , as shown in Fig . 1 . Deformable DETR opens up possibilities for us to exploit variants of end-to-end object detectors , thanks to its fast convergence , and computational and memory efficiency . We explore a simple and effective iterative bounding box refinement mechanism to improve the detection performance . We also try a two-stage Deformable DETR , where the region proposals are also generated by a vaiant of Deformable DETR , which are further fed into the decoder for iterative bounding box refinement . Extensive experiments on the COCO ( Lin et al. , 2014 ) benchmark demonstrate the effectiveness of our approach . Compared with DETR , Deformable DETR can achieve better performance ( especially on small objects ) with 10× less training epochs . The proposed variant of two-stage Deformable DETR can further improve the performance . Code is released at https : //github . com/fundamentalvision/Deformable-DETR . 2 RELATED WORK . Efficient Attention Mechanism . Transformers ( Vaswani et al. , 2017 ) involve both self-attention and cross-attention mechanisms . One of the most well-known concern of Transformers is the high time and memory complexity at vast key element numbers , which hinders model scalability in many cases . Recently , many efforts have been made to address this problem ( Tay et al. , 2020b ) , which can be roughly divided into three categories in practice . The first category is to use pre-defined sparse attention patterns on keys . The most straightforward paradigm is restricting the attention pattern to be fixed local windows . Most works ( Liu et al. , 2018a ; Parmar et al. , 2018 ; Child et al. , 2019 ; Huang et al. , 2019 ; Ho et al. , 2019 ; Wang et al. , 2020a ; Hu et al. , 2019 ; Ramachandran et al. , 2019 ; Qiu et al. , 2019 ; Beltagy et al. , 2020 ; Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) follow this paradigm . Although restricting the attention pattern to a local neighborhood can decrease the complexity , it loses global information . To compensate , Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) attend key elements at fixed intervals to significantly increase the receptive field on keys . Beltagy et al . ( 2020 ) ; Ainslie et al . ( 2020 ) ; Zaheer et al . ( 2020 ) allow a small number of special tokens having access to all key elements . Zaheer et al . ( 2020 ) ; Qiu et al . ( 2019 ) also add some pre-fixed sparse attention patterns to attend distant key elements directly . The second category is to learn data-dependent sparse attention . Kitaev et al . ( 2020 ) proposes a locality sensitive hashing ( LSH ) based attention , which hashes both the query and key elements to different bins . A similar idea is proposed by Roy et al . ( 2020 ) , where k-means finds out the most related keys . Tay et al . ( 2020a ) learns block permutation for block-wise sparse attention . The third category is to explore the low-rank property in self-attention . Wang et al . ( 2020b ) reduces the number of key elements through a linear projection on the size dimension instead of the channel dimension . Katharopoulos et al . ( 2020 ) ; Choromanski et al . ( 2020 ) rewrite the calculation of selfattention through kernelization approximation . In the image domain , the designs of efficient attention mechanism ( e.g. , Parmar et al . ( 2018 ) ; Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) ; Hu et al . ( 2019 ) ; Ramachandran et al . ( 2019 ) ) are still limited to the first category . Despite the theoretically reduced complexity , Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) admit such approaches are much slower in implementation than traditional convolution with the same FLOPs ( at least 3× slower ) , due to the intrinsic limitation in memory access patterns . On the other hand , as discussed in Zhu et al . ( 2019a ) , there are variants of convolution , such as deformable convolution ( Dai et al. , 2017 ; Zhu et al. , 2019b ) and dynamic convolution ( Wu et al. , 2019 ) , that also can be viewed as self-attention mechanisms . Especially , deformable convolution operates much more effectively and efficiently on image recognition than Transformer self-attention . Meanwhile , it lacks the element relation modeling mechanism . Our proposed deformable attention module is inspired by deformable convolution , and belongs to the second category . It only focuses on a small fixed set of sampling points predicted from the feature of query elements . Different from Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) , deformable attention is just slightly slower than the traditional convolution under the same FLOPs . Multi-scale Feature Representation for Object Detection . One of the main difficulties in object detection is to effectively represent objects at vastly different scales . Modern object detectors usually exploit multi-scale features to accommodate this . As one of the pioneering works , FPN ( Lin et al. , 2017a ) proposes a top-down path to combine multi-scale features . PANet ( Liu et al. , 2018b ) further adds an bottom-up path on the top of FPN . Kong et al . ( 2018 ) combines features from all scales by a global attention operation . Zhao et al . ( 2019 ) proposes a U-shape module to fuse multi-scale features . Recently , NAS-FPN ( Ghiasi et al. , 2019 ) and Auto-FPN ( Xu et al. , 2019 ) are proposed to automatically design cross-scale connections via neural architecture search . Tan et al . ( 2020 ) proposes the BiFPN , which is a repeated simplified version of PANet . Our proposed multi-scale deformable attention module can naturally aggregate multi-scale feature maps via attention mechanism , without the help of these feature pyramid networks . 3 REVISITING TRANSFORMERS AND DETR . Multi-Head Attention in Transformers . Transformers ( Vaswani et al. , 2017 ) are of a network architecture based on attention mechanisms for machine translation . Given a query element ( e.g. , a target word in the output sentence ) and a set of key elements ( e.g. , source words in the input sentence ) , the multi-head attention module adaptively aggregates the key contents according to the attention weights that measure the compatibility of query-key pairs . To allow the model focusing on contents from different representation subspaces and different positions , the outputs of different attention heads are linearly aggregated with learnable weights . Let q ∈ Ωq indexes a query element with representation feature zq ∈ RC , and k ∈ Ωk indexes a key element with representation feature xk ∈ RC , where C is the feature dimension , Ωq and Ωk specify the set of query and key elements , respectively . Then the multi-head attention feature is calculated by MultiHeadAttn ( zq , x ) = M∑ m=1 Wm [ ∑ k∈Ωk Amqk ·W ′mxk ] , ( 1 ) where m indexes the attention head , W ′m ∈ RCv×C and Wm ∈ RC×Cv are of learnable weights ( Cv = C/M by default ) . The attention weights Amqk ∝ exp { zTq U T m Vmxk√ Cv } are normalized as∑ k∈Ωk Amqk = 1 , in which Um , Vm ∈ R Cv×C are also learnable weights . To disambiguate different spatial positions , the representation features zq and xk are usually of the concatenation/summation of element contents and positional embeddings . There are two known issues with Transformers . One is Transformers need long training schedules before convergence . Suppose the number of query and key elements are of Nq and Nk , respectively . Typically , with proper parameter initialization , Umzq and Vmxk follow distribution with mean of 0 and variance of 1 , which makes attention weights Amqk ≈ 1Nk , when Nk is large . It will lead to ambiguous gradients for input features . Thus , long training schedules are required so that the attention weights can focus on specific keys . In the image domain , where the key elements are usually of image pixels , Nk can be very large and the convergence is tedious . On the other hand , the computational and memory complexity for multi-head attention can be very high with numerous query and key elements . The computational complexity of Eq . 1 is of O ( NqC 2 +NkC 2 +NqNkC ) . In the image domain , where the query and key elements are both of pixels , Nq = Nk C , the complexity is dominated by the third term , as O ( NqNkC ) . Thus , the multi-head attention module suffers from a quadratic complexity growth with the feature map size . DETR . DETR ( Carion et al. , 2020 ) is built upon the Transformer encoder-decoder architecture , combined with a set-based Hungarian loss that forces unique predictions for each ground-truth bounding box via bipartite matching . We briefly review the network architecture as follows . Given the input feature maps x ∈ RC×H×W extracted by a CNN backbone ( e.g. , ResNet ( He et al. , 2016 ) ) , DETR exploits a standard Transformer encoder-decoder architecture to transform the input feature maps to be features of a set of object queries . A 3-layer feed-forward neural network ( FFN ) and a linear projection are added on top of the object query features ( produced by the decoder ) as the detection head . The FFN acts as the regression branch to predict the bounding box coordinates b ∈ [ 0 , 1 ] 4 , where b = { bx , by , bw , bh } encodes the normalized box center coordinates , box height and width ( relative to the image size ) . The linear projection acts as the classification branch to produce the classification results . For the Transformer encoder in DETR , both query and key elements are of pixels in the feature maps . The inputs are of ResNet feature maps ( with encoded positional embeddings ) . Let H and W denote the feature map height and width , respectively . The computational complexity of self-attention is of O ( H2W 2C ) , which grows quadratically with the spatial size . For the Transformer decoder in DETR , the input includes both feature maps from the encoder , and N object queries represented by learnable positional embeddings ( e.g. , N = 100 ) . There are two types of attention modules in the decoder , namely , cross-attention and self-attention modules . In the cross-attention modules , object queries extract features from the feature maps . The query elements are of the object queries , and key elements are of the output feature maps from the encoder . In it , Nq = N , Nk = H ×W and the complexity of the cross-attention is of O ( HWC2 + NHWC ) . The complexity grows linearly with the spatial size of feature maps . In the self-attention modules , object queries interact with each other , so as to capture their relations . The query and key elements are both of the object queries . In it , Nq = Nk = N , and the complexity of the self-attention module is of O ( 2NC2 +N2C ) . The complexity is acceptable with moderate number of object queries . DETR is an attractive design for object detection , which removes the need for many hand-designed components . However , it also has its own issues . These issues can be mainly attributed to the deficits of Transformer attention in handling image feature maps as key elements : ( 1 ) DETR has relatively low performance in detecting small objects . Modern object detectors use high-resolution feature maps to better detect small objects . However , high-resolution feature maps would lead to an unacceptable complexity for the self-attention module in the Transformer encoder of DETR , which has a quadratic complexity with the spatial size of input feature maps . ( 2 ) Compared with modern object detectors , DETR requires many more training epochs to converge . This is mainly because the attention modules processing image features are difficult to train . For example , at initialization , the cross-attention modules are almost of average attention on the whole feature maps . While , at the end of the training , the attention maps are learned to be very sparse , focusing only on the object extremities . It seems that DETR requires a long training schedule to learn such significant changes in the attention maps .
This paper aims to improve a very recent detection model -- DETR, which suffers from two issues: long training time and limited feature spatial resolution. Targeting these issues, this paper proposes (1) deformable attention (2) multi-scale processing (inputs/attention) for DETR, which have greatly reduced the training time and improved the performance. Moreover, it develops two additional modules "iterative bounding box refinement" and "two-stage framework", which help to achieve the SOTA detection results on COCO.
SP:5c52d6d7c8754492dbfe1d786a7f15b76390c1fa
Deformable DETR: Deformable Transformers for End-to-End Object Detection
DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance . However , it suffers from slow convergence and limited feature spatial resolution , due to the limitation of Transformer attention modules in processing image feature maps . To mitigate these issues , we proposed Deformable DETR , whose attention modules only attend to a small set of key sampling points around a reference . Deformable DETR can achieve better performance than DETR ( especially on small objects ) with 10× less training epochs . Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach . Code is released at https : // github.com/fundamentalvision/Deformable-DETR . 1 INTRODUCTION . Modern object detectors employ many hand-crafted components ( Liu et al. , 2020 ) , e.g. , anchor generation , rule-based training target assignment , non-maximum suppression ( NMS ) post-processing . They are not fully end-to-end . Recently , Carion et al . ( 2020 ) proposed DETR to eliminate the need for such hand-crafted components , and built the first fully end-to-end object detector , achieving very competitive performance . DETR utilizes a simple architecture , by combining convolutional neural networks ( CNNs ) and Transformer ( Vaswani et al. , 2017 ) encoder-decoders . They exploit the versatile and powerful relation modeling capability of Transformers to replace the hand-crafted rules , under properly designed training signals . Despite its interesting design and good performance , DETR has its own issues : ( 1 ) It requires much longer training epochs to converge than the existing object detectors . For example , on the COCO ( Lin et al. , 2014 ) benchmark , DETR needs 500 epochs to converge , which is around 10 to 20 times slower than Faster R-CNN ( Ren et al. , 2015 ) . ( 2 ) DETR delivers relatively low performance at detecting small objects . Modern object detectors usually exploit multi-scale features , where small objects are detected from high-resolution feature maps . Meanwhile , high-resolution feature maps lead to unacceptable complexities for DETR . The above-mentioned issues can be mainly attributed to the deficit of Transformer components in processing image feature maps . At initialization , the attention modules cast nearly uniform attention weights to all the pixels in the feature maps . Long training epoches is necessary for the attention weights to be learned to focus on sparse meaningful locations . On the other hand , the attention weights computation in Transformer encoder is of quadratic computation w.r.t . pixel numbers . Thus , it is of very high computational and memory complexities to process high-resolution feature maps . In the image domain , deformable convolution ( Dai et al. , 2017 ) is of a powerful and efficient mechanism to attend to sparse spatial locations . It naturally avoids the above-mentioned issues . While it lacks the element relation modeling mechanism , which is the key for the success of DETR . ∗Equal contribution . †Corresponding author . ‡Work is done during an internship at SenseTime Research . In this paper , we propose Deformable DETR , which mitigates the slow convergence and high complexity issues of DETR . It combines the best of the sparse spatial sampling of deformable convolution , and the relation modeling capability of Transformers . We propose the deformable attention module , which attends to a small set of sampling locations as a pre-filter for prominent key elements out of all the feature map pixels . The module can be naturally extended to aggregating multi-scale features , without the help of FPN ( Lin et al. , 2017a ) . In Deformable DETR , we utilize ( multi-scale ) deformable attention modules to replace the Transformer attention modules processing feature maps , as shown in Fig . 1 . Deformable DETR opens up possibilities for us to exploit variants of end-to-end object detectors , thanks to its fast convergence , and computational and memory efficiency . We explore a simple and effective iterative bounding box refinement mechanism to improve the detection performance . We also try a two-stage Deformable DETR , where the region proposals are also generated by a vaiant of Deformable DETR , which are further fed into the decoder for iterative bounding box refinement . Extensive experiments on the COCO ( Lin et al. , 2014 ) benchmark demonstrate the effectiveness of our approach . Compared with DETR , Deformable DETR can achieve better performance ( especially on small objects ) with 10× less training epochs . The proposed variant of two-stage Deformable DETR can further improve the performance . Code is released at https : //github . com/fundamentalvision/Deformable-DETR . 2 RELATED WORK . Efficient Attention Mechanism . Transformers ( Vaswani et al. , 2017 ) involve both self-attention and cross-attention mechanisms . One of the most well-known concern of Transformers is the high time and memory complexity at vast key element numbers , which hinders model scalability in many cases . Recently , many efforts have been made to address this problem ( Tay et al. , 2020b ) , which can be roughly divided into three categories in practice . The first category is to use pre-defined sparse attention patterns on keys . The most straightforward paradigm is restricting the attention pattern to be fixed local windows . Most works ( Liu et al. , 2018a ; Parmar et al. , 2018 ; Child et al. , 2019 ; Huang et al. , 2019 ; Ho et al. , 2019 ; Wang et al. , 2020a ; Hu et al. , 2019 ; Ramachandran et al. , 2019 ; Qiu et al. , 2019 ; Beltagy et al. , 2020 ; Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) follow this paradigm . Although restricting the attention pattern to a local neighborhood can decrease the complexity , it loses global information . To compensate , Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) attend key elements at fixed intervals to significantly increase the receptive field on keys . Beltagy et al . ( 2020 ) ; Ainslie et al . ( 2020 ) ; Zaheer et al . ( 2020 ) allow a small number of special tokens having access to all key elements . Zaheer et al . ( 2020 ) ; Qiu et al . ( 2019 ) also add some pre-fixed sparse attention patterns to attend distant key elements directly . The second category is to learn data-dependent sparse attention . Kitaev et al . ( 2020 ) proposes a locality sensitive hashing ( LSH ) based attention , which hashes both the query and key elements to different bins . A similar idea is proposed by Roy et al . ( 2020 ) , where k-means finds out the most related keys . Tay et al . ( 2020a ) learns block permutation for block-wise sparse attention . The third category is to explore the low-rank property in self-attention . Wang et al . ( 2020b ) reduces the number of key elements through a linear projection on the size dimension instead of the channel dimension . Katharopoulos et al . ( 2020 ) ; Choromanski et al . ( 2020 ) rewrite the calculation of selfattention through kernelization approximation . In the image domain , the designs of efficient attention mechanism ( e.g. , Parmar et al . ( 2018 ) ; Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) ; Hu et al . ( 2019 ) ; Ramachandran et al . ( 2019 ) ) are still limited to the first category . Despite the theoretically reduced complexity , Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) admit such approaches are much slower in implementation than traditional convolution with the same FLOPs ( at least 3× slower ) , due to the intrinsic limitation in memory access patterns . On the other hand , as discussed in Zhu et al . ( 2019a ) , there are variants of convolution , such as deformable convolution ( Dai et al. , 2017 ; Zhu et al. , 2019b ) and dynamic convolution ( Wu et al. , 2019 ) , that also can be viewed as self-attention mechanisms . Especially , deformable convolution operates much more effectively and efficiently on image recognition than Transformer self-attention . Meanwhile , it lacks the element relation modeling mechanism . Our proposed deformable attention module is inspired by deformable convolution , and belongs to the second category . It only focuses on a small fixed set of sampling points predicted from the feature of query elements . Different from Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) , deformable attention is just slightly slower than the traditional convolution under the same FLOPs . Multi-scale Feature Representation for Object Detection . One of the main difficulties in object detection is to effectively represent objects at vastly different scales . Modern object detectors usually exploit multi-scale features to accommodate this . As one of the pioneering works , FPN ( Lin et al. , 2017a ) proposes a top-down path to combine multi-scale features . PANet ( Liu et al. , 2018b ) further adds an bottom-up path on the top of FPN . Kong et al . ( 2018 ) combines features from all scales by a global attention operation . Zhao et al . ( 2019 ) proposes a U-shape module to fuse multi-scale features . Recently , NAS-FPN ( Ghiasi et al. , 2019 ) and Auto-FPN ( Xu et al. , 2019 ) are proposed to automatically design cross-scale connections via neural architecture search . Tan et al . ( 2020 ) proposes the BiFPN , which is a repeated simplified version of PANet . Our proposed multi-scale deformable attention module can naturally aggregate multi-scale feature maps via attention mechanism , without the help of these feature pyramid networks . 3 REVISITING TRANSFORMERS AND DETR . Multi-Head Attention in Transformers . Transformers ( Vaswani et al. , 2017 ) are of a network architecture based on attention mechanisms for machine translation . Given a query element ( e.g. , a target word in the output sentence ) and a set of key elements ( e.g. , source words in the input sentence ) , the multi-head attention module adaptively aggregates the key contents according to the attention weights that measure the compatibility of query-key pairs . To allow the model focusing on contents from different representation subspaces and different positions , the outputs of different attention heads are linearly aggregated with learnable weights . Let q ∈ Ωq indexes a query element with representation feature zq ∈ RC , and k ∈ Ωk indexes a key element with representation feature xk ∈ RC , where C is the feature dimension , Ωq and Ωk specify the set of query and key elements , respectively . Then the multi-head attention feature is calculated by MultiHeadAttn ( zq , x ) = M∑ m=1 Wm [ ∑ k∈Ωk Amqk ·W ′mxk ] , ( 1 ) where m indexes the attention head , W ′m ∈ RCv×C and Wm ∈ RC×Cv are of learnable weights ( Cv = C/M by default ) . The attention weights Amqk ∝ exp { zTq U T m Vmxk√ Cv } are normalized as∑ k∈Ωk Amqk = 1 , in which Um , Vm ∈ R Cv×C are also learnable weights . To disambiguate different spatial positions , the representation features zq and xk are usually of the concatenation/summation of element contents and positional embeddings . There are two known issues with Transformers . One is Transformers need long training schedules before convergence . Suppose the number of query and key elements are of Nq and Nk , respectively . Typically , with proper parameter initialization , Umzq and Vmxk follow distribution with mean of 0 and variance of 1 , which makes attention weights Amqk ≈ 1Nk , when Nk is large . It will lead to ambiguous gradients for input features . Thus , long training schedules are required so that the attention weights can focus on specific keys . In the image domain , where the key elements are usually of image pixels , Nk can be very large and the convergence is tedious . On the other hand , the computational and memory complexity for multi-head attention can be very high with numerous query and key elements . The computational complexity of Eq . 1 is of O ( NqC 2 +NkC 2 +NqNkC ) . In the image domain , where the query and key elements are both of pixels , Nq = Nk C , the complexity is dominated by the third term , as O ( NqNkC ) . Thus , the multi-head attention module suffers from a quadratic complexity growth with the feature map size . DETR . DETR ( Carion et al. , 2020 ) is built upon the Transformer encoder-decoder architecture , combined with a set-based Hungarian loss that forces unique predictions for each ground-truth bounding box via bipartite matching . We briefly review the network architecture as follows . Given the input feature maps x ∈ RC×H×W extracted by a CNN backbone ( e.g. , ResNet ( He et al. , 2016 ) ) , DETR exploits a standard Transformer encoder-decoder architecture to transform the input feature maps to be features of a set of object queries . A 3-layer feed-forward neural network ( FFN ) and a linear projection are added on top of the object query features ( produced by the decoder ) as the detection head . The FFN acts as the regression branch to predict the bounding box coordinates b ∈ [ 0 , 1 ] 4 , where b = { bx , by , bw , bh } encodes the normalized box center coordinates , box height and width ( relative to the image size ) . The linear projection acts as the classification branch to produce the classification results . For the Transformer encoder in DETR , both query and key elements are of pixels in the feature maps . The inputs are of ResNet feature maps ( with encoded positional embeddings ) . Let H and W denote the feature map height and width , respectively . The computational complexity of self-attention is of O ( H2W 2C ) , which grows quadratically with the spatial size . For the Transformer decoder in DETR , the input includes both feature maps from the encoder , and N object queries represented by learnable positional embeddings ( e.g. , N = 100 ) . There are two types of attention modules in the decoder , namely , cross-attention and self-attention modules . In the cross-attention modules , object queries extract features from the feature maps . The query elements are of the object queries , and key elements are of the output feature maps from the encoder . In it , Nq = N , Nk = H ×W and the complexity of the cross-attention is of O ( HWC2 + NHWC ) . The complexity grows linearly with the spatial size of feature maps . In the self-attention modules , object queries interact with each other , so as to capture their relations . The query and key elements are both of the object queries . In it , Nq = Nk = N , and the complexity of the self-attention module is of O ( 2NC2 +N2C ) . The complexity is acceptable with moderate number of object queries . DETR is an attractive design for object detection , which removes the need for many hand-designed components . However , it also has its own issues . These issues can be mainly attributed to the deficits of Transformer attention in handling image feature maps as key elements : ( 1 ) DETR has relatively low performance in detecting small objects . Modern object detectors use high-resolution feature maps to better detect small objects . However , high-resolution feature maps would lead to an unacceptable complexity for the self-attention module in the Transformer encoder of DETR , which has a quadratic complexity with the spatial size of input feature maps . ( 2 ) Compared with modern object detectors , DETR requires many more training epochs to converge . This is mainly because the attention modules processing image features are difficult to train . For example , at initialization , the cross-attention modules are almost of average attention on the whole feature maps . While , at the end of the training , the attention maps are learned to be very sparse , focusing only on the object extremities . It seems that DETR requires a long training schedule to learn such significant changes in the attention maps .
The main contribution is a new attention module called deformable attention module. Like deformable convolution, it adds a translation term into the expression of the transformer, allowing a sparse spatial sampling. The resulting model is very interesting in terms of convergence and complexity compared to the original DETR. A Multi-scale deformable attention module is also proposed. it needs to add a scale function in the attention module equation. Experiments shows that it increases the AP detection rate on MSCOCO compared to FasterR-CNN and DETR.
SP:5c52d6d7c8754492dbfe1d786a7f15b76390c1fa
Deformable DETR: Deformable Transformers for End-to-End Object Detection
DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance . However , it suffers from slow convergence and limited feature spatial resolution , due to the limitation of Transformer attention modules in processing image feature maps . To mitigate these issues , we proposed Deformable DETR , whose attention modules only attend to a small set of key sampling points around a reference . Deformable DETR can achieve better performance than DETR ( especially on small objects ) with 10× less training epochs . Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach . Code is released at https : // github.com/fundamentalvision/Deformable-DETR . 1 INTRODUCTION . Modern object detectors employ many hand-crafted components ( Liu et al. , 2020 ) , e.g. , anchor generation , rule-based training target assignment , non-maximum suppression ( NMS ) post-processing . They are not fully end-to-end . Recently , Carion et al . ( 2020 ) proposed DETR to eliminate the need for such hand-crafted components , and built the first fully end-to-end object detector , achieving very competitive performance . DETR utilizes a simple architecture , by combining convolutional neural networks ( CNNs ) and Transformer ( Vaswani et al. , 2017 ) encoder-decoders . They exploit the versatile and powerful relation modeling capability of Transformers to replace the hand-crafted rules , under properly designed training signals . Despite its interesting design and good performance , DETR has its own issues : ( 1 ) It requires much longer training epochs to converge than the existing object detectors . For example , on the COCO ( Lin et al. , 2014 ) benchmark , DETR needs 500 epochs to converge , which is around 10 to 20 times slower than Faster R-CNN ( Ren et al. , 2015 ) . ( 2 ) DETR delivers relatively low performance at detecting small objects . Modern object detectors usually exploit multi-scale features , where small objects are detected from high-resolution feature maps . Meanwhile , high-resolution feature maps lead to unacceptable complexities for DETR . The above-mentioned issues can be mainly attributed to the deficit of Transformer components in processing image feature maps . At initialization , the attention modules cast nearly uniform attention weights to all the pixels in the feature maps . Long training epoches is necessary for the attention weights to be learned to focus on sparse meaningful locations . On the other hand , the attention weights computation in Transformer encoder is of quadratic computation w.r.t . pixel numbers . Thus , it is of very high computational and memory complexities to process high-resolution feature maps . In the image domain , deformable convolution ( Dai et al. , 2017 ) is of a powerful and efficient mechanism to attend to sparse spatial locations . It naturally avoids the above-mentioned issues . While it lacks the element relation modeling mechanism , which is the key for the success of DETR . ∗Equal contribution . †Corresponding author . ‡Work is done during an internship at SenseTime Research . In this paper , we propose Deformable DETR , which mitigates the slow convergence and high complexity issues of DETR . It combines the best of the sparse spatial sampling of deformable convolution , and the relation modeling capability of Transformers . We propose the deformable attention module , which attends to a small set of sampling locations as a pre-filter for prominent key elements out of all the feature map pixels . The module can be naturally extended to aggregating multi-scale features , without the help of FPN ( Lin et al. , 2017a ) . In Deformable DETR , we utilize ( multi-scale ) deformable attention modules to replace the Transformer attention modules processing feature maps , as shown in Fig . 1 . Deformable DETR opens up possibilities for us to exploit variants of end-to-end object detectors , thanks to its fast convergence , and computational and memory efficiency . We explore a simple and effective iterative bounding box refinement mechanism to improve the detection performance . We also try a two-stage Deformable DETR , where the region proposals are also generated by a vaiant of Deformable DETR , which are further fed into the decoder for iterative bounding box refinement . Extensive experiments on the COCO ( Lin et al. , 2014 ) benchmark demonstrate the effectiveness of our approach . Compared with DETR , Deformable DETR can achieve better performance ( especially on small objects ) with 10× less training epochs . The proposed variant of two-stage Deformable DETR can further improve the performance . Code is released at https : //github . com/fundamentalvision/Deformable-DETR . 2 RELATED WORK . Efficient Attention Mechanism . Transformers ( Vaswani et al. , 2017 ) involve both self-attention and cross-attention mechanisms . One of the most well-known concern of Transformers is the high time and memory complexity at vast key element numbers , which hinders model scalability in many cases . Recently , many efforts have been made to address this problem ( Tay et al. , 2020b ) , which can be roughly divided into three categories in practice . The first category is to use pre-defined sparse attention patterns on keys . The most straightforward paradigm is restricting the attention pattern to be fixed local windows . Most works ( Liu et al. , 2018a ; Parmar et al. , 2018 ; Child et al. , 2019 ; Huang et al. , 2019 ; Ho et al. , 2019 ; Wang et al. , 2020a ; Hu et al. , 2019 ; Ramachandran et al. , 2019 ; Qiu et al. , 2019 ; Beltagy et al. , 2020 ; Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) follow this paradigm . Although restricting the attention pattern to a local neighborhood can decrease the complexity , it loses global information . To compensate , Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) attend key elements at fixed intervals to significantly increase the receptive field on keys . Beltagy et al . ( 2020 ) ; Ainslie et al . ( 2020 ) ; Zaheer et al . ( 2020 ) allow a small number of special tokens having access to all key elements . Zaheer et al . ( 2020 ) ; Qiu et al . ( 2019 ) also add some pre-fixed sparse attention patterns to attend distant key elements directly . The second category is to learn data-dependent sparse attention . Kitaev et al . ( 2020 ) proposes a locality sensitive hashing ( LSH ) based attention , which hashes both the query and key elements to different bins . A similar idea is proposed by Roy et al . ( 2020 ) , where k-means finds out the most related keys . Tay et al . ( 2020a ) learns block permutation for block-wise sparse attention . The third category is to explore the low-rank property in self-attention . Wang et al . ( 2020b ) reduces the number of key elements through a linear projection on the size dimension instead of the channel dimension . Katharopoulos et al . ( 2020 ) ; Choromanski et al . ( 2020 ) rewrite the calculation of selfattention through kernelization approximation . In the image domain , the designs of efficient attention mechanism ( e.g. , Parmar et al . ( 2018 ) ; Child et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Ho et al . ( 2019 ) ; Wang et al . ( 2020a ) ; Hu et al . ( 2019 ) ; Ramachandran et al . ( 2019 ) ) are still limited to the first category . Despite the theoretically reduced complexity , Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) admit such approaches are much slower in implementation than traditional convolution with the same FLOPs ( at least 3× slower ) , due to the intrinsic limitation in memory access patterns . On the other hand , as discussed in Zhu et al . ( 2019a ) , there are variants of convolution , such as deformable convolution ( Dai et al. , 2017 ; Zhu et al. , 2019b ) and dynamic convolution ( Wu et al. , 2019 ) , that also can be viewed as self-attention mechanisms . Especially , deformable convolution operates much more effectively and efficiently on image recognition than Transformer self-attention . Meanwhile , it lacks the element relation modeling mechanism . Our proposed deformable attention module is inspired by deformable convolution , and belongs to the second category . It only focuses on a small fixed set of sampling points predicted from the feature of query elements . Different from Ramachandran et al . ( 2019 ) ; Hu et al . ( 2019 ) , deformable attention is just slightly slower than the traditional convolution under the same FLOPs . Multi-scale Feature Representation for Object Detection . One of the main difficulties in object detection is to effectively represent objects at vastly different scales . Modern object detectors usually exploit multi-scale features to accommodate this . As one of the pioneering works , FPN ( Lin et al. , 2017a ) proposes a top-down path to combine multi-scale features . PANet ( Liu et al. , 2018b ) further adds an bottom-up path on the top of FPN . Kong et al . ( 2018 ) combines features from all scales by a global attention operation . Zhao et al . ( 2019 ) proposes a U-shape module to fuse multi-scale features . Recently , NAS-FPN ( Ghiasi et al. , 2019 ) and Auto-FPN ( Xu et al. , 2019 ) are proposed to automatically design cross-scale connections via neural architecture search . Tan et al . ( 2020 ) proposes the BiFPN , which is a repeated simplified version of PANet . Our proposed multi-scale deformable attention module can naturally aggregate multi-scale feature maps via attention mechanism , without the help of these feature pyramid networks . 3 REVISITING TRANSFORMERS AND DETR . Multi-Head Attention in Transformers . Transformers ( Vaswani et al. , 2017 ) are of a network architecture based on attention mechanisms for machine translation . Given a query element ( e.g. , a target word in the output sentence ) and a set of key elements ( e.g. , source words in the input sentence ) , the multi-head attention module adaptively aggregates the key contents according to the attention weights that measure the compatibility of query-key pairs . To allow the model focusing on contents from different representation subspaces and different positions , the outputs of different attention heads are linearly aggregated with learnable weights . Let q ∈ Ωq indexes a query element with representation feature zq ∈ RC , and k ∈ Ωk indexes a key element with representation feature xk ∈ RC , where C is the feature dimension , Ωq and Ωk specify the set of query and key elements , respectively . Then the multi-head attention feature is calculated by MultiHeadAttn ( zq , x ) = M∑ m=1 Wm [ ∑ k∈Ωk Amqk ·W ′mxk ] , ( 1 ) where m indexes the attention head , W ′m ∈ RCv×C and Wm ∈ RC×Cv are of learnable weights ( Cv = C/M by default ) . The attention weights Amqk ∝ exp { zTq U T m Vmxk√ Cv } are normalized as∑ k∈Ωk Amqk = 1 , in which Um , Vm ∈ R Cv×C are also learnable weights . To disambiguate different spatial positions , the representation features zq and xk are usually of the concatenation/summation of element contents and positional embeddings . There are two known issues with Transformers . One is Transformers need long training schedules before convergence . Suppose the number of query and key elements are of Nq and Nk , respectively . Typically , with proper parameter initialization , Umzq and Vmxk follow distribution with mean of 0 and variance of 1 , which makes attention weights Amqk ≈ 1Nk , when Nk is large . It will lead to ambiguous gradients for input features . Thus , long training schedules are required so that the attention weights can focus on specific keys . In the image domain , where the key elements are usually of image pixels , Nk can be very large and the convergence is tedious . On the other hand , the computational and memory complexity for multi-head attention can be very high with numerous query and key elements . The computational complexity of Eq . 1 is of O ( NqC 2 +NkC 2 +NqNkC ) . In the image domain , where the query and key elements are both of pixels , Nq = Nk C , the complexity is dominated by the third term , as O ( NqNkC ) . Thus , the multi-head attention module suffers from a quadratic complexity growth with the feature map size . DETR . DETR ( Carion et al. , 2020 ) is built upon the Transformer encoder-decoder architecture , combined with a set-based Hungarian loss that forces unique predictions for each ground-truth bounding box via bipartite matching . We briefly review the network architecture as follows . Given the input feature maps x ∈ RC×H×W extracted by a CNN backbone ( e.g. , ResNet ( He et al. , 2016 ) ) , DETR exploits a standard Transformer encoder-decoder architecture to transform the input feature maps to be features of a set of object queries . A 3-layer feed-forward neural network ( FFN ) and a linear projection are added on top of the object query features ( produced by the decoder ) as the detection head . The FFN acts as the regression branch to predict the bounding box coordinates b ∈ [ 0 , 1 ] 4 , where b = { bx , by , bw , bh } encodes the normalized box center coordinates , box height and width ( relative to the image size ) . The linear projection acts as the classification branch to produce the classification results . For the Transformer encoder in DETR , both query and key elements are of pixels in the feature maps . The inputs are of ResNet feature maps ( with encoded positional embeddings ) . Let H and W denote the feature map height and width , respectively . The computational complexity of self-attention is of O ( H2W 2C ) , which grows quadratically with the spatial size . For the Transformer decoder in DETR , the input includes both feature maps from the encoder , and N object queries represented by learnable positional embeddings ( e.g. , N = 100 ) . There are two types of attention modules in the decoder , namely , cross-attention and self-attention modules . In the cross-attention modules , object queries extract features from the feature maps . The query elements are of the object queries , and key elements are of the output feature maps from the encoder . In it , Nq = N , Nk = H ×W and the complexity of the cross-attention is of O ( HWC2 + NHWC ) . The complexity grows linearly with the spatial size of feature maps . In the self-attention modules , object queries interact with each other , so as to capture their relations . The query and key elements are both of the object queries . In it , Nq = Nk = N , and the complexity of the self-attention module is of O ( 2NC2 +N2C ) . The complexity is acceptable with moderate number of object queries . DETR is an attractive design for object detection , which removes the need for many hand-designed components . However , it also has its own issues . These issues can be mainly attributed to the deficits of Transformer attention in handling image feature maps as key elements : ( 1 ) DETR has relatively low performance in detecting small objects . Modern object detectors use high-resolution feature maps to better detect small objects . However , high-resolution feature maps would lead to an unacceptable complexity for the self-attention module in the Transformer encoder of DETR , which has a quadratic complexity with the spatial size of input feature maps . ( 2 ) Compared with modern object detectors , DETR requires many more training epochs to converge . This is mainly because the attention modules processing image features are difficult to train . For example , at initialization , the cross-attention modules are almost of average attention on the whole feature maps . While , at the end of the training , the attention maps are learned to be very sparse , focusing only on the object extremities . It seems that DETR requires a long training schedule to learn such significant changes in the attention maps .
As a new framework for object detection, DETR is very important. However, it suffers from slow convergence and limited feature spatial resolution. This paper proposes deformable attention, which attends to a small set of sampling locations rather than all the locations in the original DETR. Besides, the paper applies multi-scale deformable attention for better results.
SP:5c52d6d7c8754492dbfe1d786a7f15b76390c1fa
Parrot: Data-Driven Behavioral Priors for Reinforcement Learning
1 INTRODUCTION . Reinforcement Learning ( RL ) is an attractive paradigm for robotic learning because of its flexibility in being able to learn a diverse range of skills and its capacity to continuously improve . However , RL algorithms typically require a large amount of data to solve each individual task , including simple ones . Since an RL agent is generally initialized without any prior knowledge , it must try many largely unproductive behaviors before it discovers a high-reward outcome . In contrast , humans rarely attempt to solve new tasks in this way : they draw on their prior experience of what is useful when they attempt a new task , which substantially shrinks the task search space . For example , faced with a new task involving objects on a table , a person might grasp an object , stack multiple objects , or explore other object rearrangements , rather than re-learning how to move their arms and fingers . Can we endow RL agents with a similar sort of behavioral prior from past experience ? In other fields of machine learning , the use of large prior datasets to bootstrap acquisition of new capabilities has been studied extensively to good effect . For example , language models trained on large , diverse datasets offer representations that drastically improve the efficiency of learning downstream tasks ( Devlin et al. , 2019 ) . What would be the analogue of this kind of pre-training in robotics and RL ? One way we can approach this problem is to leverage successful trials from a wide range of previously seen tasks to improve learning for new tasks . The data could come from previously learned policies , from human demonstrations , or even unstructured teleoperation of robots ( Lynch et al. , 2019 ) . In this paper , we show that behavioral priors can be obtained through representation learning , and the representation in question must not only be a representation of inputs , but actually a representation of input-output relationships – a space of possible and likely mappings from states to actions among which the learning process can interpolate when confronted with a new task . What makes for a good representation for RL ? Given a new task , a good representation must ( a ) provide an effective exploration strategy , ( b ) simplify the policy learning problem for the RL algorithm , and ( c ) allow the RL agent to retain full control over the environment . In this paper , we address ∗Equal contribution . Correspondence to Avi Singh ( avisingh @ berkeley.edu ) . Trial 1 Trial 2 Trial n-1 Trial n Transfer Behavioral Prior Learning New Tasks all of these challenges through learning an invertible function that maps noise vectors to complex , high-dimensional environment actions . Building on prior work in normalizing flows ( Dinh et al. , 2017 ) , we train this mapping to maximize the ( conditional ) log-likelihood of actions observed in successful trials from past tasks . When dropped into a new MDP , the RL agent can now sample from a unit Gaussian , and use the learned mapping ( which we refer to as the behavioral prior ) to generate likely environment actions , conditional on the current observation . This learned mapping essentially transforms the original MDP into a simpler one for the RL agent , as long as the original MDP shares ( partial ) structure with previously seen MDPs ( see Section 3 ) . Furthermore , since this mapping is invertible , the RL agent still retains full control over the original MDP : for every possible environment action , there exists a point within the support of the Gaussian distribution that maps to that action . This allows the RL agent to still try out new behaviors that are distinct from what was previously observed . Our main contribution is a framework for pre-training in RL from a diverse multi-task dataset , which produces a behavioral prior that accelerates acquisition of new skills . We present an instantiation of this framework in robotic manipulation , where we utilize manipulation data from a diverse range of prior tasks to train our behavioral prior , and then use it to bootstrap exploration for new tasks . By making it possible to pre-train action representations on large prior datasets for robotics and RL , we hope that our method provides a path toward leveraging large datasets in the RL and robotics settings , much like language models can leverage large text corpora in NLP and unsupervised pretraining can leverage large image datasets in computer vision . Our method , which we call Prior AcceleRated ReinfOrcemenT ( PARROT ) , is able to quickly learn tasks that involve manipulating previously unseen objects , from image observations and sparse rewards , in settings where RL from scratch fails to learn a policy at all . We also compare against prior works that incorporate prior data for RL , and show that PARROT substantially outperforms these prior works . 2 RELATED WORK . Combining RL with demonstrations . Our work is related to methods for learning from demonstrations ( Pomerleau , 1989 ; Schaal et al. , 2003 ; Ratliff et al. , 2007 ; Pastor et al. , 2009 ; Ho & Ermon , 2016 ; Finn et al. , 2017b ; Giusti et al. , 2016 ; Sun et al. , 2017 ; Zhang et al. , 2017 ; Lynch et al. , 2019 ) . While demonstrations can also be used to speed up RL ( Schaal , 1996 ; Peters & Schaal , 2006 ; Kormushev et al. , 2010 ; Hester et al. , 2017 ; Vecerı́k et al. , 2017 ; Nair et al. , 2018 ; Rajeswaran et al. , 2018 ; Silver et al. , 2018 ; Peng et al. , 2018 ; Johannink et al. , 2019 ; Gupta et al. , 2019 ) , this usually requires collecting demonstrations for the specific task that is being learned . In contrast , we use data from a wide range of other prior tasks to speed up RL for a new task . As we show in our experiments , PARROT is better suited to this problem setting when compared to prior methods that combine imitation and RL for the same task . Generative modeling and RL . Several prior works model multi-modal action distributions using expert trajectories from different tasks . IntentionGAN ( Hausman et al . ) and InfoGAIL ( Li et al. , 2017 ) learn multi-modal policies via interaction with an environment using an adversarial imitation approach ( Ho & Ermon , 2016 ) , but we learn these distributions only from data . Other works learn these distributions from data ( Xie et al. , 2019 ; Rhinehart et al. , 2020 ) and utilize them for planning at test time to optimize a user-provided cost function . In contrast , we use the behavioral prior to augment model-free RL of a new task . This allows us to learn policies for new tasks that may be substantially different from prior tasks , since we can collect data specific to the new task at hand , and we do not explicitly need to model the environment , which can be complicated for high-dimensional state and action spaces , such as when performing continuous control from images observations . Another line of work ( Ghadirzadeh et al. , 2017 ; Hämäläinen et al. , 2019 ; Ghadirzadeh et al. , 2020 ) explores using generative models for RL , using a variational autoencoder ( Kingma & Welling , 2014 ) to model entire trajectories in an observation-independent manner , and then learning an open-loop , single-step policy using RL to solve the downstream task . Our approach differs in several key aspects : ( 1 ) our model is observation-conditioned , allowing it to prioritize actions that are relevant to the current scene or environment , ( 2 ) our model allows for closed-loop feedback control , and ( 3 ) our model is invertible , allowing the high-level policy to retain full control over the action space . Our experiments demonstrate these aspects are crucial for solving harder tasks . Hierarchical learning . Our method can be interpreted as training a hierarchical model : the lowlevel policy is the behavioral prior trained on prior data , while the high-level policy is trained using RL and controls the low-level policy . This structure is similar to prior work in hierarchical RL ( Dayan & Hinton , 1992 ; Parr & Russell , 1997 ; Dietterich , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ) . We divide prior work in hierarchical learning into two categories : methods that seek to learn both the low-level and high-level policies through active interaction with an environment ( Kupcsik et al. , 2013 ; Heess et al. , 2016 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Haarnoja et al. , 2018a ; Nachum et al. , 2018 ; Chandak et al. , 2019 ; Peng et al. , 2019 ) , and methods that learn temporally extended actions , also known as options , from demonstrations , and then recompose them to perform long-horizon tasks through RL or planning ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Kipf et al. , 2019 ; Shankar et al. , 2020 ; Shankar & Gupta , 2020 ) . Our work shares similarities with the data-driven approach of the latter methods , but work on options focuses on modeling the temporal structure in demonstrations for a small number of long-horizon tasks , while our behavioral prior is not concerned with temporally-extended abstractions , but rather with transforming the original MDP into one where potentially useful behaviors are more likely , and useless behaviors are less likely . Meta-learning . Our goal in this paper is to utilize data from previously seen tasks to speed up RL for new tasks . Meta-RL ( Duan et al. , 2016 ; Wang et al. , 2016 ; Finn et al. , 2017a ; Mishra et al. , 2017 ; Rakelly et al. , 2019 ; Mendonca et al. , 2019 ; Zintgraf et al. , 2020 ; Fakoor et al. , 2020 ) and meta-imitation methods ( Duan et al. , 2017 ; Finn et al. , 2017c ; Huang et al. , 2018 ; James et al. , 2018 ; Paine et al. , 2018 ; Yu et al. , 2018 ; Huang et al. , 2019 ; Zhou et al. , 2020 ) also seek to speed up learning for new tasks by leveraging experience from previously seen tasks . While meta-learning provides an appealing and principled framework to accelerate acquisition of future tasks , we focus on a more lightweight approach with relaxed assumptions that make our method more practically applicable , and we discuss these assumptions in detail in the next section . 3 PROBLEM SETUP . Our goal is to improve an agent ’ s ability to learn new tasks by incorporating a behavioral prior , which it can acquire from previously seen tasks . Each task can be considered a Markov decision process ( MDP ) , which is defined by a tuple ( S , A , T , r , γ ) , where S and A represent state and action spaces , T ( s′|s , a ) and r ( s , a ) represent the dynamics and reward functions , and γ ∈ ( 0 , 1 ) represents the discount factor . Let p ( M ) denote a distribution over such MDPs , with the constraint that the state and action spaces are fixed . In our experiments , we treat high-dimensional images as s , which means that this constraint is not very restrictive in practice . In order for the behavioral prior to be able to accelerate the acquisition of new skills , we assume the behavioral prior is trained on data that structurally resembles potential optimal policies for all or part of the new task . For example , if the new task requires placing a bottle in a tray , the prior data might include some behaviors that involve picking up objects . There are many ways to formalize this assumption . One way to state this formally is to assume that prior data consists of executions of near-optimal policies for MDPs f ( z ; s ) pi ( z|s ) a s Z0 Z1 Z2 Z3=a drawn according to M ∼ p ( M ) , and the new task M ? is likewise drawn from p ( M ) . In this case , the generative process for the prior data can be expressed as : M ∼ p ( M ) , πM ( τ ) = argmax π Eπ , M [ RM ] , τM ∼ πM ( τ ) , ( 1 ) where τM = ( s1 , a1 , s2 , a2 , . . . , sT , aT ) is a sequence of state and actions , πM ( τ ) denotes a nearoptimal policy ( Kearns & Singh , 2002 ) for MDPM andRM = ∑∞ t=0 γ trt . When incorporating the behavioral prior for learning a new task M ? , our goal is the same as standard RL : to find a policy π that maximizes the expected return argmaxπ Eπ , M ? [ RM ? ] . Our assumption on tasks being drawn from a distribution p ( M ) shares similarities with the meta-RL problem ( Wang et al. , 2016 ; Duan et al. , 2016 ) , but our setup is different : it does not require accessing any task in p ( M ) except the new task we are learning , M ? . Meta-RL methods need to interact with the tasks in p ( M ) during meta-training , with access to rewards and additional samples , whereas we learn our behavioral prior simply from data , without even requiring this data to be labeled with rewards . This is of particular importance for real-world problem settings such as robotics : it is much easier to store data from prior tasks ( e.g. , different environments ) than to have a robot physically revisit those prior settings and retry those tasks , and not requiring known rewards makes it possible to use data from a variety of sources , including human-provided demonstrations . In our setting , RL is performed in only one environment , while the prior data can come from many environments . Our setting is related to meta-imitation learning ( Duan et al. , 2017 ; Finn et al. , 2017c ) , as we speed up learning new tasks using data collected from past tasks . However , meta-imitation learning methods require at least one demonstration for each new task , whereas our method can learn new tasks without any demonstrations . Further , our data requirements are less stringent : meta-imitation learning methods require all demonstrations to be optimal , require all trajectories in the dataset to have a task label , and requires “ paired demonstrations ” , i.e . at least two demonstrations for each task ( since meta-imitation methods maximize the likelihood of actions from one demonstration after conditioning the policy on another demonstration from the same task ) . Relaxing these requirements increases the scalability of our method : we can incorporate data from a wider range of sources , and we do not need to explicitly organize it into specific tasks .
This paper proposes PARROT, a method for learning a policy prior from a dataset of expert state-action pairs that have been derived from multiple similar tasks. The policy prior is parameterized as a deep conditional generative model that maps a noise input and a state to an action. The latter map can be inverted, which is important to guarantee that the prior assigns nonzero probability to the full action space for all states. Given a new task, the policy prior is used to parameterize a new policy; the new policy outputs noise inputs to the policy prior’s invertible mapping, which in turn outputs an action in the original action space. This parameterization of the new policy leads to much more targeted exploration versus sampling actions uniformly from the original action space. Experiments are on a suite of pick-and-place robotic tasks in simulation.
SP:91db871c227488ddc9fedf066795935bd6472e18
Parrot: Data-Driven Behavioral Priors for Reinforcement Learning
1 INTRODUCTION . Reinforcement Learning ( RL ) is an attractive paradigm for robotic learning because of its flexibility in being able to learn a diverse range of skills and its capacity to continuously improve . However , RL algorithms typically require a large amount of data to solve each individual task , including simple ones . Since an RL agent is generally initialized without any prior knowledge , it must try many largely unproductive behaviors before it discovers a high-reward outcome . In contrast , humans rarely attempt to solve new tasks in this way : they draw on their prior experience of what is useful when they attempt a new task , which substantially shrinks the task search space . For example , faced with a new task involving objects on a table , a person might grasp an object , stack multiple objects , or explore other object rearrangements , rather than re-learning how to move their arms and fingers . Can we endow RL agents with a similar sort of behavioral prior from past experience ? In other fields of machine learning , the use of large prior datasets to bootstrap acquisition of new capabilities has been studied extensively to good effect . For example , language models trained on large , diverse datasets offer representations that drastically improve the efficiency of learning downstream tasks ( Devlin et al. , 2019 ) . What would be the analogue of this kind of pre-training in robotics and RL ? One way we can approach this problem is to leverage successful trials from a wide range of previously seen tasks to improve learning for new tasks . The data could come from previously learned policies , from human demonstrations , or even unstructured teleoperation of robots ( Lynch et al. , 2019 ) . In this paper , we show that behavioral priors can be obtained through representation learning , and the representation in question must not only be a representation of inputs , but actually a representation of input-output relationships – a space of possible and likely mappings from states to actions among which the learning process can interpolate when confronted with a new task . What makes for a good representation for RL ? Given a new task , a good representation must ( a ) provide an effective exploration strategy , ( b ) simplify the policy learning problem for the RL algorithm , and ( c ) allow the RL agent to retain full control over the environment . In this paper , we address ∗Equal contribution . Correspondence to Avi Singh ( avisingh @ berkeley.edu ) . Trial 1 Trial 2 Trial n-1 Trial n Transfer Behavioral Prior Learning New Tasks all of these challenges through learning an invertible function that maps noise vectors to complex , high-dimensional environment actions . Building on prior work in normalizing flows ( Dinh et al. , 2017 ) , we train this mapping to maximize the ( conditional ) log-likelihood of actions observed in successful trials from past tasks . When dropped into a new MDP , the RL agent can now sample from a unit Gaussian , and use the learned mapping ( which we refer to as the behavioral prior ) to generate likely environment actions , conditional on the current observation . This learned mapping essentially transforms the original MDP into a simpler one for the RL agent , as long as the original MDP shares ( partial ) structure with previously seen MDPs ( see Section 3 ) . Furthermore , since this mapping is invertible , the RL agent still retains full control over the original MDP : for every possible environment action , there exists a point within the support of the Gaussian distribution that maps to that action . This allows the RL agent to still try out new behaviors that are distinct from what was previously observed . Our main contribution is a framework for pre-training in RL from a diverse multi-task dataset , which produces a behavioral prior that accelerates acquisition of new skills . We present an instantiation of this framework in robotic manipulation , where we utilize manipulation data from a diverse range of prior tasks to train our behavioral prior , and then use it to bootstrap exploration for new tasks . By making it possible to pre-train action representations on large prior datasets for robotics and RL , we hope that our method provides a path toward leveraging large datasets in the RL and robotics settings , much like language models can leverage large text corpora in NLP and unsupervised pretraining can leverage large image datasets in computer vision . Our method , which we call Prior AcceleRated ReinfOrcemenT ( PARROT ) , is able to quickly learn tasks that involve manipulating previously unseen objects , from image observations and sparse rewards , in settings where RL from scratch fails to learn a policy at all . We also compare against prior works that incorporate prior data for RL , and show that PARROT substantially outperforms these prior works . 2 RELATED WORK . Combining RL with demonstrations . Our work is related to methods for learning from demonstrations ( Pomerleau , 1989 ; Schaal et al. , 2003 ; Ratliff et al. , 2007 ; Pastor et al. , 2009 ; Ho & Ermon , 2016 ; Finn et al. , 2017b ; Giusti et al. , 2016 ; Sun et al. , 2017 ; Zhang et al. , 2017 ; Lynch et al. , 2019 ) . While demonstrations can also be used to speed up RL ( Schaal , 1996 ; Peters & Schaal , 2006 ; Kormushev et al. , 2010 ; Hester et al. , 2017 ; Vecerı́k et al. , 2017 ; Nair et al. , 2018 ; Rajeswaran et al. , 2018 ; Silver et al. , 2018 ; Peng et al. , 2018 ; Johannink et al. , 2019 ; Gupta et al. , 2019 ) , this usually requires collecting demonstrations for the specific task that is being learned . In contrast , we use data from a wide range of other prior tasks to speed up RL for a new task . As we show in our experiments , PARROT is better suited to this problem setting when compared to prior methods that combine imitation and RL for the same task . Generative modeling and RL . Several prior works model multi-modal action distributions using expert trajectories from different tasks . IntentionGAN ( Hausman et al . ) and InfoGAIL ( Li et al. , 2017 ) learn multi-modal policies via interaction with an environment using an adversarial imitation approach ( Ho & Ermon , 2016 ) , but we learn these distributions only from data . Other works learn these distributions from data ( Xie et al. , 2019 ; Rhinehart et al. , 2020 ) and utilize them for planning at test time to optimize a user-provided cost function . In contrast , we use the behavioral prior to augment model-free RL of a new task . This allows us to learn policies for new tasks that may be substantially different from prior tasks , since we can collect data specific to the new task at hand , and we do not explicitly need to model the environment , which can be complicated for high-dimensional state and action spaces , such as when performing continuous control from images observations . Another line of work ( Ghadirzadeh et al. , 2017 ; Hämäläinen et al. , 2019 ; Ghadirzadeh et al. , 2020 ) explores using generative models for RL , using a variational autoencoder ( Kingma & Welling , 2014 ) to model entire trajectories in an observation-independent manner , and then learning an open-loop , single-step policy using RL to solve the downstream task . Our approach differs in several key aspects : ( 1 ) our model is observation-conditioned , allowing it to prioritize actions that are relevant to the current scene or environment , ( 2 ) our model allows for closed-loop feedback control , and ( 3 ) our model is invertible , allowing the high-level policy to retain full control over the action space . Our experiments demonstrate these aspects are crucial for solving harder tasks . Hierarchical learning . Our method can be interpreted as training a hierarchical model : the lowlevel policy is the behavioral prior trained on prior data , while the high-level policy is trained using RL and controls the low-level policy . This structure is similar to prior work in hierarchical RL ( Dayan & Hinton , 1992 ; Parr & Russell , 1997 ; Dietterich , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ) . We divide prior work in hierarchical learning into two categories : methods that seek to learn both the low-level and high-level policies through active interaction with an environment ( Kupcsik et al. , 2013 ; Heess et al. , 2016 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Haarnoja et al. , 2018a ; Nachum et al. , 2018 ; Chandak et al. , 2019 ; Peng et al. , 2019 ) , and methods that learn temporally extended actions , also known as options , from demonstrations , and then recompose them to perform long-horizon tasks through RL or planning ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Kipf et al. , 2019 ; Shankar et al. , 2020 ; Shankar & Gupta , 2020 ) . Our work shares similarities with the data-driven approach of the latter methods , but work on options focuses on modeling the temporal structure in demonstrations for a small number of long-horizon tasks , while our behavioral prior is not concerned with temporally-extended abstractions , but rather with transforming the original MDP into one where potentially useful behaviors are more likely , and useless behaviors are less likely . Meta-learning . Our goal in this paper is to utilize data from previously seen tasks to speed up RL for new tasks . Meta-RL ( Duan et al. , 2016 ; Wang et al. , 2016 ; Finn et al. , 2017a ; Mishra et al. , 2017 ; Rakelly et al. , 2019 ; Mendonca et al. , 2019 ; Zintgraf et al. , 2020 ; Fakoor et al. , 2020 ) and meta-imitation methods ( Duan et al. , 2017 ; Finn et al. , 2017c ; Huang et al. , 2018 ; James et al. , 2018 ; Paine et al. , 2018 ; Yu et al. , 2018 ; Huang et al. , 2019 ; Zhou et al. , 2020 ) also seek to speed up learning for new tasks by leveraging experience from previously seen tasks . While meta-learning provides an appealing and principled framework to accelerate acquisition of future tasks , we focus on a more lightweight approach with relaxed assumptions that make our method more practically applicable , and we discuss these assumptions in detail in the next section . 3 PROBLEM SETUP . Our goal is to improve an agent ’ s ability to learn new tasks by incorporating a behavioral prior , which it can acquire from previously seen tasks . Each task can be considered a Markov decision process ( MDP ) , which is defined by a tuple ( S , A , T , r , γ ) , where S and A represent state and action spaces , T ( s′|s , a ) and r ( s , a ) represent the dynamics and reward functions , and γ ∈ ( 0 , 1 ) represents the discount factor . Let p ( M ) denote a distribution over such MDPs , with the constraint that the state and action spaces are fixed . In our experiments , we treat high-dimensional images as s , which means that this constraint is not very restrictive in practice . In order for the behavioral prior to be able to accelerate the acquisition of new skills , we assume the behavioral prior is trained on data that structurally resembles potential optimal policies for all or part of the new task . For example , if the new task requires placing a bottle in a tray , the prior data might include some behaviors that involve picking up objects . There are many ways to formalize this assumption . One way to state this formally is to assume that prior data consists of executions of near-optimal policies for MDPs f ( z ; s ) pi ( z|s ) a s Z0 Z1 Z2 Z3=a drawn according to M ∼ p ( M ) , and the new task M ? is likewise drawn from p ( M ) . In this case , the generative process for the prior data can be expressed as : M ∼ p ( M ) , πM ( τ ) = argmax π Eπ , M [ RM ] , τM ∼ πM ( τ ) , ( 1 ) where τM = ( s1 , a1 , s2 , a2 , . . . , sT , aT ) is a sequence of state and actions , πM ( τ ) denotes a nearoptimal policy ( Kearns & Singh , 2002 ) for MDPM andRM = ∑∞ t=0 γ trt . When incorporating the behavioral prior for learning a new task M ? , our goal is the same as standard RL : to find a policy π that maximizes the expected return argmaxπ Eπ , M ? [ RM ? ] . Our assumption on tasks being drawn from a distribution p ( M ) shares similarities with the meta-RL problem ( Wang et al. , 2016 ; Duan et al. , 2016 ) , but our setup is different : it does not require accessing any task in p ( M ) except the new task we are learning , M ? . Meta-RL methods need to interact with the tasks in p ( M ) during meta-training , with access to rewards and additional samples , whereas we learn our behavioral prior simply from data , without even requiring this data to be labeled with rewards . This is of particular importance for real-world problem settings such as robotics : it is much easier to store data from prior tasks ( e.g. , different environments ) than to have a robot physically revisit those prior settings and retry those tasks , and not requiring known rewards makes it possible to use data from a variety of sources , including human-provided demonstrations . In our setting , RL is performed in only one environment , while the prior data can come from many environments . Our setting is related to meta-imitation learning ( Duan et al. , 2017 ; Finn et al. , 2017c ) , as we speed up learning new tasks using data collected from past tasks . However , meta-imitation learning methods require at least one demonstration for each new task , whereas our method can learn new tasks without any demonstrations . Further , our data requirements are less stringent : meta-imitation learning methods require all demonstrations to be optimal , require all trajectories in the dataset to have a task label , and requires “ paired demonstrations ” , i.e . at least two demonstrations for each task ( since meta-imitation methods maximize the likelihood of actions from one demonstration after conditioning the policy on another demonstration from the same task ) . Relaxing these requirements increases the scalability of our method : we can incorporate data from a wider range of sources , and we do not need to explicitly organize it into specific tasks .
This work proposes a method, PARROT, to learn data-driven priors for deep reinforcement learning agents. Motivated by the idea of pre-training with existing data of similar tasks, the authors propose to learn state-conditional behavioral priors from a set of similar tasks for reinforcement learning agents, such that a learning agent explores its environment in a meaningful way. Successful trials from past tasks are used as training data to learn a mapping from pixel-level state input to actions. Experiments in simulated robotic manipulator domain demonstrate the benefit of learning behavioral priors, comparing PARROT against algorithms learning from scratch as well as agents pre-trained with behavioral cloning.
SP:91db871c227488ddc9fedf066795935bd6472e18
Parrot: Data-Driven Behavioral Priors for Reinforcement Learning
1 INTRODUCTION . Reinforcement Learning ( RL ) is an attractive paradigm for robotic learning because of its flexibility in being able to learn a diverse range of skills and its capacity to continuously improve . However , RL algorithms typically require a large amount of data to solve each individual task , including simple ones . Since an RL agent is generally initialized without any prior knowledge , it must try many largely unproductive behaviors before it discovers a high-reward outcome . In contrast , humans rarely attempt to solve new tasks in this way : they draw on their prior experience of what is useful when they attempt a new task , which substantially shrinks the task search space . For example , faced with a new task involving objects on a table , a person might grasp an object , stack multiple objects , or explore other object rearrangements , rather than re-learning how to move their arms and fingers . Can we endow RL agents with a similar sort of behavioral prior from past experience ? In other fields of machine learning , the use of large prior datasets to bootstrap acquisition of new capabilities has been studied extensively to good effect . For example , language models trained on large , diverse datasets offer representations that drastically improve the efficiency of learning downstream tasks ( Devlin et al. , 2019 ) . What would be the analogue of this kind of pre-training in robotics and RL ? One way we can approach this problem is to leverage successful trials from a wide range of previously seen tasks to improve learning for new tasks . The data could come from previously learned policies , from human demonstrations , or even unstructured teleoperation of robots ( Lynch et al. , 2019 ) . In this paper , we show that behavioral priors can be obtained through representation learning , and the representation in question must not only be a representation of inputs , but actually a representation of input-output relationships – a space of possible and likely mappings from states to actions among which the learning process can interpolate when confronted with a new task . What makes for a good representation for RL ? Given a new task , a good representation must ( a ) provide an effective exploration strategy , ( b ) simplify the policy learning problem for the RL algorithm , and ( c ) allow the RL agent to retain full control over the environment . In this paper , we address ∗Equal contribution . Correspondence to Avi Singh ( avisingh @ berkeley.edu ) . Trial 1 Trial 2 Trial n-1 Trial n Transfer Behavioral Prior Learning New Tasks all of these challenges through learning an invertible function that maps noise vectors to complex , high-dimensional environment actions . Building on prior work in normalizing flows ( Dinh et al. , 2017 ) , we train this mapping to maximize the ( conditional ) log-likelihood of actions observed in successful trials from past tasks . When dropped into a new MDP , the RL agent can now sample from a unit Gaussian , and use the learned mapping ( which we refer to as the behavioral prior ) to generate likely environment actions , conditional on the current observation . This learned mapping essentially transforms the original MDP into a simpler one for the RL agent , as long as the original MDP shares ( partial ) structure with previously seen MDPs ( see Section 3 ) . Furthermore , since this mapping is invertible , the RL agent still retains full control over the original MDP : for every possible environment action , there exists a point within the support of the Gaussian distribution that maps to that action . This allows the RL agent to still try out new behaviors that are distinct from what was previously observed . Our main contribution is a framework for pre-training in RL from a diverse multi-task dataset , which produces a behavioral prior that accelerates acquisition of new skills . We present an instantiation of this framework in robotic manipulation , where we utilize manipulation data from a diverse range of prior tasks to train our behavioral prior , and then use it to bootstrap exploration for new tasks . By making it possible to pre-train action representations on large prior datasets for robotics and RL , we hope that our method provides a path toward leveraging large datasets in the RL and robotics settings , much like language models can leverage large text corpora in NLP and unsupervised pretraining can leverage large image datasets in computer vision . Our method , which we call Prior AcceleRated ReinfOrcemenT ( PARROT ) , is able to quickly learn tasks that involve manipulating previously unseen objects , from image observations and sparse rewards , in settings where RL from scratch fails to learn a policy at all . We also compare against prior works that incorporate prior data for RL , and show that PARROT substantially outperforms these prior works . 2 RELATED WORK . Combining RL with demonstrations . Our work is related to methods for learning from demonstrations ( Pomerleau , 1989 ; Schaal et al. , 2003 ; Ratliff et al. , 2007 ; Pastor et al. , 2009 ; Ho & Ermon , 2016 ; Finn et al. , 2017b ; Giusti et al. , 2016 ; Sun et al. , 2017 ; Zhang et al. , 2017 ; Lynch et al. , 2019 ) . While demonstrations can also be used to speed up RL ( Schaal , 1996 ; Peters & Schaal , 2006 ; Kormushev et al. , 2010 ; Hester et al. , 2017 ; Vecerı́k et al. , 2017 ; Nair et al. , 2018 ; Rajeswaran et al. , 2018 ; Silver et al. , 2018 ; Peng et al. , 2018 ; Johannink et al. , 2019 ; Gupta et al. , 2019 ) , this usually requires collecting demonstrations for the specific task that is being learned . In contrast , we use data from a wide range of other prior tasks to speed up RL for a new task . As we show in our experiments , PARROT is better suited to this problem setting when compared to prior methods that combine imitation and RL for the same task . Generative modeling and RL . Several prior works model multi-modal action distributions using expert trajectories from different tasks . IntentionGAN ( Hausman et al . ) and InfoGAIL ( Li et al. , 2017 ) learn multi-modal policies via interaction with an environment using an adversarial imitation approach ( Ho & Ermon , 2016 ) , but we learn these distributions only from data . Other works learn these distributions from data ( Xie et al. , 2019 ; Rhinehart et al. , 2020 ) and utilize them for planning at test time to optimize a user-provided cost function . In contrast , we use the behavioral prior to augment model-free RL of a new task . This allows us to learn policies for new tasks that may be substantially different from prior tasks , since we can collect data specific to the new task at hand , and we do not explicitly need to model the environment , which can be complicated for high-dimensional state and action spaces , such as when performing continuous control from images observations . Another line of work ( Ghadirzadeh et al. , 2017 ; Hämäläinen et al. , 2019 ; Ghadirzadeh et al. , 2020 ) explores using generative models for RL , using a variational autoencoder ( Kingma & Welling , 2014 ) to model entire trajectories in an observation-independent manner , and then learning an open-loop , single-step policy using RL to solve the downstream task . Our approach differs in several key aspects : ( 1 ) our model is observation-conditioned , allowing it to prioritize actions that are relevant to the current scene or environment , ( 2 ) our model allows for closed-loop feedback control , and ( 3 ) our model is invertible , allowing the high-level policy to retain full control over the action space . Our experiments demonstrate these aspects are crucial for solving harder tasks . Hierarchical learning . Our method can be interpreted as training a hierarchical model : the lowlevel policy is the behavioral prior trained on prior data , while the high-level policy is trained using RL and controls the low-level policy . This structure is similar to prior work in hierarchical RL ( Dayan & Hinton , 1992 ; Parr & Russell , 1997 ; Dietterich , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ) . We divide prior work in hierarchical learning into two categories : methods that seek to learn both the low-level and high-level policies through active interaction with an environment ( Kupcsik et al. , 2013 ; Heess et al. , 2016 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Haarnoja et al. , 2018a ; Nachum et al. , 2018 ; Chandak et al. , 2019 ; Peng et al. , 2019 ) , and methods that learn temporally extended actions , also known as options , from demonstrations , and then recompose them to perform long-horizon tasks through RL or planning ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Kipf et al. , 2019 ; Shankar et al. , 2020 ; Shankar & Gupta , 2020 ) . Our work shares similarities with the data-driven approach of the latter methods , but work on options focuses on modeling the temporal structure in demonstrations for a small number of long-horizon tasks , while our behavioral prior is not concerned with temporally-extended abstractions , but rather with transforming the original MDP into one where potentially useful behaviors are more likely , and useless behaviors are less likely . Meta-learning . Our goal in this paper is to utilize data from previously seen tasks to speed up RL for new tasks . Meta-RL ( Duan et al. , 2016 ; Wang et al. , 2016 ; Finn et al. , 2017a ; Mishra et al. , 2017 ; Rakelly et al. , 2019 ; Mendonca et al. , 2019 ; Zintgraf et al. , 2020 ; Fakoor et al. , 2020 ) and meta-imitation methods ( Duan et al. , 2017 ; Finn et al. , 2017c ; Huang et al. , 2018 ; James et al. , 2018 ; Paine et al. , 2018 ; Yu et al. , 2018 ; Huang et al. , 2019 ; Zhou et al. , 2020 ) also seek to speed up learning for new tasks by leveraging experience from previously seen tasks . While meta-learning provides an appealing and principled framework to accelerate acquisition of future tasks , we focus on a more lightweight approach with relaxed assumptions that make our method more practically applicable , and we discuss these assumptions in detail in the next section . 3 PROBLEM SETUP . Our goal is to improve an agent ’ s ability to learn new tasks by incorporating a behavioral prior , which it can acquire from previously seen tasks . Each task can be considered a Markov decision process ( MDP ) , which is defined by a tuple ( S , A , T , r , γ ) , where S and A represent state and action spaces , T ( s′|s , a ) and r ( s , a ) represent the dynamics and reward functions , and γ ∈ ( 0 , 1 ) represents the discount factor . Let p ( M ) denote a distribution over such MDPs , with the constraint that the state and action spaces are fixed . In our experiments , we treat high-dimensional images as s , which means that this constraint is not very restrictive in practice . In order for the behavioral prior to be able to accelerate the acquisition of new skills , we assume the behavioral prior is trained on data that structurally resembles potential optimal policies for all or part of the new task . For example , if the new task requires placing a bottle in a tray , the prior data might include some behaviors that involve picking up objects . There are many ways to formalize this assumption . One way to state this formally is to assume that prior data consists of executions of near-optimal policies for MDPs f ( z ; s ) pi ( z|s ) a s Z0 Z1 Z2 Z3=a drawn according to M ∼ p ( M ) , and the new task M ? is likewise drawn from p ( M ) . In this case , the generative process for the prior data can be expressed as : M ∼ p ( M ) , πM ( τ ) = argmax π Eπ , M [ RM ] , τM ∼ πM ( τ ) , ( 1 ) where τM = ( s1 , a1 , s2 , a2 , . . . , sT , aT ) is a sequence of state and actions , πM ( τ ) denotes a nearoptimal policy ( Kearns & Singh , 2002 ) for MDPM andRM = ∑∞ t=0 γ trt . When incorporating the behavioral prior for learning a new task M ? , our goal is the same as standard RL : to find a policy π that maximizes the expected return argmaxπ Eπ , M ? [ RM ? ] . Our assumption on tasks being drawn from a distribution p ( M ) shares similarities with the meta-RL problem ( Wang et al. , 2016 ; Duan et al. , 2016 ) , but our setup is different : it does not require accessing any task in p ( M ) except the new task we are learning , M ? . Meta-RL methods need to interact with the tasks in p ( M ) during meta-training , with access to rewards and additional samples , whereas we learn our behavioral prior simply from data , without even requiring this data to be labeled with rewards . This is of particular importance for real-world problem settings such as robotics : it is much easier to store data from prior tasks ( e.g. , different environments ) than to have a robot physically revisit those prior settings and retry those tasks , and not requiring known rewards makes it possible to use data from a variety of sources , including human-provided demonstrations . In our setting , RL is performed in only one environment , while the prior data can come from many environments . Our setting is related to meta-imitation learning ( Duan et al. , 2017 ; Finn et al. , 2017c ) , as we speed up learning new tasks using data collected from past tasks . However , meta-imitation learning methods require at least one demonstration for each new task , whereas our method can learn new tasks without any demonstrations . Further , our data requirements are less stringent : meta-imitation learning methods require all demonstrations to be optimal , require all trajectories in the dataset to have a task label , and requires “ paired demonstrations ” , i.e . at least two demonstrations for each task ( since meta-imitation methods maximize the likelihood of actions from one demonstration after conditioning the policy on another demonstration from the same task ) . Relaxing these requirements increases the scalability of our method : we can incorporate data from a wider range of sources , and we do not need to explicitly organize it into specific tasks .
This paper introduces PARROT, a novel approach for pretraining a reinforcement learning agent on near-optimal trajectories by learning a behavioral prior. Essentially, the authors learn a word2vec style embedding of actions for a simple virtual single-arm environment. This embedding will naturally place more common examples from its training data towards the center of the gaussian, making sampling them during training time more likely. The authors demonstrate that this approach outperforms existing pretraining methods in this domain.
SP:91db871c227488ddc9fedf066795935bd6472e18
On Alignment in Deep Linear Neural Networks
1 INTRODUCTION . Although overparameterized deep networks can interpolate randomly labeled training data ( Du et al. , 2019 ; Wu et al. , 2019 ) , training overparameterized networks with modern optimizers often leads to solutions that generalize well . This suggests that there is a form of implicit regularization occurring through training ( Zhang et al. , 2017 ) . As an example of implicit regularization , the authors in Ji & Telgarsky ( 2018 ) proved that the layers of linear neural networks used for binary classification on linearly separable datasets become aligned in the limit of training . That is , for a linear network parameterized by the matrix product WdWd−1 . . .W1 , the top left/right singular vectors ui and vi of layer Wi satisfy |vTi+1ui| → 1 as the number of gradient descent steps goes to infinity . Alignment of singular vector spaces between adjacent layers allows for the network representation to be drastically simplified ( see Equation 3 ) ; namely , the product of all layers becomes a product of diagonal matrices with the exception of the outermost unitary matrices . If alignment is an invariant of training , then optimization over the set of weight matrices reduces to optimization over the set of singular values of weight matrices . Thus , importantly , alignment of singular vector spaces allows for the gradient descent update rule to be simplified significantly , which was used in Ji & Telgarsky ( 2018 ) to show convergence to a max-margin solution . In this work , we generalize the definition of alignment to the multidimensional setting . We study when alignment can occur and moreover , under which conditions it is an invariant of training in linear neural networks under gradient descent . Prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) have implicitly relied on invariance of alignment as an assumption on initialization to simplify training dynamics for 2 layer networks . In this work , we provide necessary and sufficient conditions for when alignment is an invariant for networks of arbitrary depth . Our main contributions are as follows : 1 . We extend the definition of alignment from the 1-dimensional classification setting to the multi-dimensional setting ( Definition 2 ) and characterize when alignment is an invariant of training in linear fully connected networks with multi-dimensional outputs ( Theorem 1 ) . 2 . We demonstrate that alignment is an invariant for fully connected networks with multidimensional outputs only in special problem classes including autoencoding , matrix factorization and matrix sensing . This is in contrast to networks with 1-dimensional outputs , where there exists an initialization such that adjacent layers remain aligned throughout training under any real-valued loss function and any training dataset . 3 . Alignment largely simplifies the analysis of training linear networks : We provide an explicit learning rate under which gradient descent converges linearly to a global minimum under alignment in the squared loss setting ( Proposition 1 ) . 4 . We prove that alignment can not occur , let alone be invariant , in networks with constrained layer structure ( such as convolutional networks ) , when the amount of training data dominates the dimension of the layer structure ( Theorem 3 ) . 5 . We support our theoretical findings via experiments in Section 6 . As a consequence , our characterization of the invariance properties of alignment provides settings under which the gradient descent dynamics can be simplified and the implicit regularization properties can be fully understood , yet also shows that further results are required to explain implicit regularization in linear neural networks more generally . 2 RELATED WORK . Implicit regularization in overparameterized networks has become a subject of significant interest ( Gunasekar et al. , 2018a ; b ; Martin & Mahoney , 2018 ; Neyshabur et al. , 2014 ) . In order to characterize the specific form of implicit regularization , several works have focused on analyzing deep linear networks ( Arora et al. , 2019b ; Gunasekar et al. , 2018b ; 2017 ; Soudry et al. , 2018 ) . Even though such networks can only express linear maps , parameter optimization in linear networks is non-convex and is studied in order to obtain intuition about optimization of deep networks more generally . One such form of implicit regularization is alignment , identified by Ji & Telgarsky ( 2018 ) to analyze linear fully connected networks with 1-dimensional outputs trained on linearly separable data . They proved that in the limit of training , each layer , after normalization , approaches a rank 1 matrix , i.e . lim t→∞ W ( t ) i ‖W ( t ) i ‖F = uiv T i and that adjacent layers , Wi+1 and Wi become aligned , i.e . |vTi+1ui| → 1 . In addition , Ji & Telgarsky ( 2018 ) proved that alignment in this setting occurs concurrently with convergence to the max-margin solution . Follow-up work mainly focused on this convergence phenomenon and gave explicit convergence rates for overparameterized networks trained with gradient descent ( Arora et al. , 2019c ; Zou et al. , 2018 ) . Our definition of invariance of alignment extends assumptions on initialization appearing in various prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) . While the connection to alignment was not mentioned in their work , the authors in Gidel et al . ( 2019 ) begin to generalize alignment to multidimensional outputs by considering two-layer networks initialized so that layers are aligned with each other and to the data . We generalize this to networks of any depth , showing that our definition of alignment corresponds to the initialization considered in Gidel et al . ( 2019 ) . Moreover , we establish necessary and sufficient conditions for when alignment is an invariant of training in Theorem 1 instead of assuming these conditions . Furthermore , their result on sequential learning of components can be derived via our singular value update rule in Corollary 1 . Balancedness is another closely related form of implicit regularization in linear neural networks . It was introduced in Arora et al . ( 2018 ) and defined as the property that if WTi Wi = Wi+1W T i+1 for all i at initialization , then this property is invariant under gradient flow . Du et al . ( 2018 ) present a more general form , that WTi Wi −Wi+1WTi+1 is constant under gradient flow . In practice , analyses rely on this quantity being close to or exactly zero . In this exact setting , balancedness indeed implies alignment of singular vector spaces between consecutive layers . To study gradient descent , slightly more general notions such as approximate balancedness ( Arora et al. , 2019a ) and -balancedness have been introduced . Du et al . ( 2018 ) also defined balancedness with respect to convolutional networks , showing that under gradient flow , the difference in the norm of the weights of consecutive layers is an invariant . Generally , the goal of identifying invariants of training such as balancedness or alignment is to help understand both the dynamics of training and properties of solutions at the end of training . 3 DEFINITION OF ALIGNMENT IN THE MULTI-DIMENSIONAL SETTING . In this section , we first define alignment for linear neural networks with multi-dimensional outputs . We then define when alignment is an invariant of training . We consider linear neural networks . Let f : Rk0 → Rkd denote such a d-layer network , i.e . f ( x ) = WdWd−1 . . .W1x , ( 1 ) where Wi ∈ Rki×ki−1 for i ∈ [ d ] , where we follow the convention that [ d ] = { 1 , 2 , . . . d } . Let ( X , Y ) ∈ Rk0×n × Rkd×n denote the set of training data pairs { ( x ( i ) , y ( i ) ) } for i ∈ [ n ] . Gradient descent with learning rate γ is used to find a solution to the following optimization problem : arg min f∈F 1 2n n∑ i=1 ` ( f ( x ( i ) ) , y ( i ) ) , ( 2 ) where F is the set of linear functions represented by f and ` is a real-valued loss function . When not stated otherwise , we assume ` ( f ( x ( i ) ) , y ( i ) ) = ‖y ( i ) − f ( x ( i ) ) ‖22 , which is the squared loss ( MSE ) . In addition , we denote by W ( t ) i for t ∈ Z≥0 the weight matrix Wi after t steps of gradient descent . When there are no additional constraints on the matrices Wi , then f is a fully connected network . We next introduce a generalized form of the singular value decomposition : Definition 1 . An unsorted , signed singular value decomposition ( usSVD ) of a matrix A ∈ Rm×n is a triple U ∈ Rm×m , Σ ∈ Rm×n , V ∈ Rn×n such that U , V are orthonormal matrices , Σ is diagonal , and A = UΣV T . In contrast to the usual definition of singular value decomposition ( SVD ) of a matrix , the diagonal entries of Σ may be in any order and take negative values . Throughout , we will refer to the entries of Σ in a usSVD as singular values and the vectors in U , V as singular vectors . Using the usSVD , we now generalize the notion of alignment from Ji & Telgarsky ( 2018 ) to the multi-dimensional setting . Definition 2 . Let f = WdWd−1 . . .W1 be a linear network . We say that f is aligned if there exists a usSVD Wi = UiΣiV Ti with Ui = Vi+1 for all i ∈ [ d− 1 ] . ( We also say that a matrix A is aligned with another matrix B if there exist usSVD ’ s A = UAΣAV TA , B = UBΣBV T B such that VA = UB . ) Note that if Wi and Wi+1 are rank 1 matrices in an aligned network f , then the inner product of the first columns of Vi+1 and Ui is 1 in absolute value . Hence Definition 2 is consistent with alignment in the 1-dimensional setting from Ji & Telgarsky ( 2018 ) . We next define when alignment is an invariant of training for deep linear networks . Again , such invariants are of interest since they may provide insights into properties of trained networks and significantly simplify the dynamics of gradient descent . Definition 3 . Alignment is an invariant of training for a linear neural network f if there exists an initialization { W ( 0 ) j } dj=1 such that W ( ∞ ) 1 , W ( ∞ ) 2 , . . . , W ( ∞ ) d achieves zero training error 1 and for all gradient descent steps t ∈ Z≥0 ( a ) the network f is aligned ; ( b ) W ( t ) i = UiΣ ( t ) i V T i for all i ∈ { 2 , . . . d− 1 } , that is , Ui , Vi are not updated ; ( c ) W ( t ) 1 = U1Σ ( t ) 1 V ( t ) 1 T and W ( t ) d = U ( t ) d Σ ( t ) d V T d , that is , U1 and Vd are not updated . If additionally , V1 and Ud are not updated for any t ∈ Z≥0 , then we say that strong alignment is an invariant of training . When alignment is an invariant of training , there are important consequences for training . In particular , note that when the network f is aligned with usSVDs Wi = UiΣiV Ti for all 1 ≤ i ≤ d , then f ( x ) = Wd · · ·W1x = Ud ( d−1∏ i=0 Σd−i ) V T1 x . ( 3 ) 1The interpolation condition in this definition ( i.e. , achieving zero training error ) is important in ruling out several architectures where the layers are trivially aligned . For example , if all layers are constrained to be diagonal matrices throughout training , then the layers are all trivially aligned , but can not interpolate datasets where the target is not the product of a diagonal matrix with the input . Hence if alignment is an invariant of training , then the singular vectors of layers 2 through d− 1 are never updated and the analysis of gradient descent can be limited to the singular values of the layers and the matrices V1 and Ud . Remarks . For the remainder of the paper , we assume that the gradient of the loss function at initialization { W ( 0 ) i } di=1 is non-zero . Otherwise , training with gradient descent would not proceed . We also only consider datasets ( X , Y ) for which there is a linear network that achieves loss zero . This is consistent with the assumptions in Ji & Telgarsky ( 2018 ) .
This article extends the notion of alignment [Ji and Telgarsky, 2018] to linear neural networks with multiple output nodes, which requires the consecutive layers (i+1, i) to have the same (right, left) singular spaces. The authors identify necessary and sufficient conditions under which, alignment is an invariant of the gradient descent iterates (Definition 3), which in particular means that the gradient descent iterates only update the singular values of the layers, and not their singular vectors. The authors studied alignment for several shallow and deep linear architectures, and specify learning rates for which gradient descent enjoys exponential convergence.
SP:d3d113911e8ca3b6c36942c593c1f2cbffe6deb7
On Alignment in Deep Linear Neural Networks
1 INTRODUCTION . Although overparameterized deep networks can interpolate randomly labeled training data ( Du et al. , 2019 ; Wu et al. , 2019 ) , training overparameterized networks with modern optimizers often leads to solutions that generalize well . This suggests that there is a form of implicit regularization occurring through training ( Zhang et al. , 2017 ) . As an example of implicit regularization , the authors in Ji & Telgarsky ( 2018 ) proved that the layers of linear neural networks used for binary classification on linearly separable datasets become aligned in the limit of training . That is , for a linear network parameterized by the matrix product WdWd−1 . . .W1 , the top left/right singular vectors ui and vi of layer Wi satisfy |vTi+1ui| → 1 as the number of gradient descent steps goes to infinity . Alignment of singular vector spaces between adjacent layers allows for the network representation to be drastically simplified ( see Equation 3 ) ; namely , the product of all layers becomes a product of diagonal matrices with the exception of the outermost unitary matrices . If alignment is an invariant of training , then optimization over the set of weight matrices reduces to optimization over the set of singular values of weight matrices . Thus , importantly , alignment of singular vector spaces allows for the gradient descent update rule to be simplified significantly , which was used in Ji & Telgarsky ( 2018 ) to show convergence to a max-margin solution . In this work , we generalize the definition of alignment to the multidimensional setting . We study when alignment can occur and moreover , under which conditions it is an invariant of training in linear neural networks under gradient descent . Prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) have implicitly relied on invariance of alignment as an assumption on initialization to simplify training dynamics for 2 layer networks . In this work , we provide necessary and sufficient conditions for when alignment is an invariant for networks of arbitrary depth . Our main contributions are as follows : 1 . We extend the definition of alignment from the 1-dimensional classification setting to the multi-dimensional setting ( Definition 2 ) and characterize when alignment is an invariant of training in linear fully connected networks with multi-dimensional outputs ( Theorem 1 ) . 2 . We demonstrate that alignment is an invariant for fully connected networks with multidimensional outputs only in special problem classes including autoencoding , matrix factorization and matrix sensing . This is in contrast to networks with 1-dimensional outputs , where there exists an initialization such that adjacent layers remain aligned throughout training under any real-valued loss function and any training dataset . 3 . Alignment largely simplifies the analysis of training linear networks : We provide an explicit learning rate under which gradient descent converges linearly to a global minimum under alignment in the squared loss setting ( Proposition 1 ) . 4 . We prove that alignment can not occur , let alone be invariant , in networks with constrained layer structure ( such as convolutional networks ) , when the amount of training data dominates the dimension of the layer structure ( Theorem 3 ) . 5 . We support our theoretical findings via experiments in Section 6 . As a consequence , our characterization of the invariance properties of alignment provides settings under which the gradient descent dynamics can be simplified and the implicit regularization properties can be fully understood , yet also shows that further results are required to explain implicit regularization in linear neural networks more generally . 2 RELATED WORK . Implicit regularization in overparameterized networks has become a subject of significant interest ( Gunasekar et al. , 2018a ; b ; Martin & Mahoney , 2018 ; Neyshabur et al. , 2014 ) . In order to characterize the specific form of implicit regularization , several works have focused on analyzing deep linear networks ( Arora et al. , 2019b ; Gunasekar et al. , 2018b ; 2017 ; Soudry et al. , 2018 ) . Even though such networks can only express linear maps , parameter optimization in linear networks is non-convex and is studied in order to obtain intuition about optimization of deep networks more generally . One such form of implicit regularization is alignment , identified by Ji & Telgarsky ( 2018 ) to analyze linear fully connected networks with 1-dimensional outputs trained on linearly separable data . They proved that in the limit of training , each layer , after normalization , approaches a rank 1 matrix , i.e . lim t→∞ W ( t ) i ‖W ( t ) i ‖F = uiv T i and that adjacent layers , Wi+1 and Wi become aligned , i.e . |vTi+1ui| → 1 . In addition , Ji & Telgarsky ( 2018 ) proved that alignment in this setting occurs concurrently with convergence to the max-margin solution . Follow-up work mainly focused on this convergence phenomenon and gave explicit convergence rates for overparameterized networks trained with gradient descent ( Arora et al. , 2019c ; Zou et al. , 2018 ) . Our definition of invariance of alignment extends assumptions on initialization appearing in various prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) . While the connection to alignment was not mentioned in their work , the authors in Gidel et al . ( 2019 ) begin to generalize alignment to multidimensional outputs by considering two-layer networks initialized so that layers are aligned with each other and to the data . We generalize this to networks of any depth , showing that our definition of alignment corresponds to the initialization considered in Gidel et al . ( 2019 ) . Moreover , we establish necessary and sufficient conditions for when alignment is an invariant of training in Theorem 1 instead of assuming these conditions . Furthermore , their result on sequential learning of components can be derived via our singular value update rule in Corollary 1 . Balancedness is another closely related form of implicit regularization in linear neural networks . It was introduced in Arora et al . ( 2018 ) and defined as the property that if WTi Wi = Wi+1W T i+1 for all i at initialization , then this property is invariant under gradient flow . Du et al . ( 2018 ) present a more general form , that WTi Wi −Wi+1WTi+1 is constant under gradient flow . In practice , analyses rely on this quantity being close to or exactly zero . In this exact setting , balancedness indeed implies alignment of singular vector spaces between consecutive layers . To study gradient descent , slightly more general notions such as approximate balancedness ( Arora et al. , 2019a ) and -balancedness have been introduced . Du et al . ( 2018 ) also defined balancedness with respect to convolutional networks , showing that under gradient flow , the difference in the norm of the weights of consecutive layers is an invariant . Generally , the goal of identifying invariants of training such as balancedness or alignment is to help understand both the dynamics of training and properties of solutions at the end of training . 3 DEFINITION OF ALIGNMENT IN THE MULTI-DIMENSIONAL SETTING . In this section , we first define alignment for linear neural networks with multi-dimensional outputs . We then define when alignment is an invariant of training . We consider linear neural networks . Let f : Rk0 → Rkd denote such a d-layer network , i.e . f ( x ) = WdWd−1 . . .W1x , ( 1 ) where Wi ∈ Rki×ki−1 for i ∈ [ d ] , where we follow the convention that [ d ] = { 1 , 2 , . . . d } . Let ( X , Y ) ∈ Rk0×n × Rkd×n denote the set of training data pairs { ( x ( i ) , y ( i ) ) } for i ∈ [ n ] . Gradient descent with learning rate γ is used to find a solution to the following optimization problem : arg min f∈F 1 2n n∑ i=1 ` ( f ( x ( i ) ) , y ( i ) ) , ( 2 ) where F is the set of linear functions represented by f and ` is a real-valued loss function . When not stated otherwise , we assume ` ( f ( x ( i ) ) , y ( i ) ) = ‖y ( i ) − f ( x ( i ) ) ‖22 , which is the squared loss ( MSE ) . In addition , we denote by W ( t ) i for t ∈ Z≥0 the weight matrix Wi after t steps of gradient descent . When there are no additional constraints on the matrices Wi , then f is a fully connected network . We next introduce a generalized form of the singular value decomposition : Definition 1 . An unsorted , signed singular value decomposition ( usSVD ) of a matrix A ∈ Rm×n is a triple U ∈ Rm×m , Σ ∈ Rm×n , V ∈ Rn×n such that U , V are orthonormal matrices , Σ is diagonal , and A = UΣV T . In contrast to the usual definition of singular value decomposition ( SVD ) of a matrix , the diagonal entries of Σ may be in any order and take negative values . Throughout , we will refer to the entries of Σ in a usSVD as singular values and the vectors in U , V as singular vectors . Using the usSVD , we now generalize the notion of alignment from Ji & Telgarsky ( 2018 ) to the multi-dimensional setting . Definition 2 . Let f = WdWd−1 . . .W1 be a linear network . We say that f is aligned if there exists a usSVD Wi = UiΣiV Ti with Ui = Vi+1 for all i ∈ [ d− 1 ] . ( We also say that a matrix A is aligned with another matrix B if there exist usSVD ’ s A = UAΣAV TA , B = UBΣBV T B such that VA = UB . ) Note that if Wi and Wi+1 are rank 1 matrices in an aligned network f , then the inner product of the first columns of Vi+1 and Ui is 1 in absolute value . Hence Definition 2 is consistent with alignment in the 1-dimensional setting from Ji & Telgarsky ( 2018 ) . We next define when alignment is an invariant of training for deep linear networks . Again , such invariants are of interest since they may provide insights into properties of trained networks and significantly simplify the dynamics of gradient descent . Definition 3 . Alignment is an invariant of training for a linear neural network f if there exists an initialization { W ( 0 ) j } dj=1 such that W ( ∞ ) 1 , W ( ∞ ) 2 , . . . , W ( ∞ ) d achieves zero training error 1 and for all gradient descent steps t ∈ Z≥0 ( a ) the network f is aligned ; ( b ) W ( t ) i = UiΣ ( t ) i V T i for all i ∈ { 2 , . . . d− 1 } , that is , Ui , Vi are not updated ; ( c ) W ( t ) 1 = U1Σ ( t ) 1 V ( t ) 1 T and W ( t ) d = U ( t ) d Σ ( t ) d V T d , that is , U1 and Vd are not updated . If additionally , V1 and Ud are not updated for any t ∈ Z≥0 , then we say that strong alignment is an invariant of training . When alignment is an invariant of training , there are important consequences for training . In particular , note that when the network f is aligned with usSVDs Wi = UiΣiV Ti for all 1 ≤ i ≤ d , then f ( x ) = Wd · · ·W1x = Ud ( d−1∏ i=0 Σd−i ) V T1 x . ( 3 ) 1The interpolation condition in this definition ( i.e. , achieving zero training error ) is important in ruling out several architectures where the layers are trivially aligned . For example , if all layers are constrained to be diagonal matrices throughout training , then the layers are all trivially aligned , but can not interpolate datasets where the target is not the product of a diagonal matrix with the input . Hence if alignment is an invariant of training , then the singular vectors of layers 2 through d− 1 are never updated and the analysis of gradient descent can be limited to the singular values of the layers and the matrices V1 and Ud . Remarks . For the remainder of the paper , we assume that the gradient of the loss function at initialization { W ( 0 ) i } di=1 is non-zero . Otherwise , training with gradient descent would not proceed . We also only consider datasets ( X , Y ) for which there is a linear network that achieves loss zero . This is consistent with the assumptions in Ji & Telgarsky ( 2018 ) .
This paper considers deep linear networks trained by gradient descent with the squared loss, and characterizes when alignment happens, meaning that for any pair of adjacent weight matrices W_{i+1} and W_i, the (unsorted, signed) right singular vectors of W_{i+1} are identical to the (unsorted, signed) left singular vectors of W_i. This paper further gives a few examples where the conditions of alignment hold, and proves a convergence rate for aligned networks. For networks with constrained layer structure, such as convolutional networks, this paper shows that aligned networks in general cannot achieve zero training error with the squared loss. Finally, empirical support of the theory is provided.
SP:d3d113911e8ca3b6c36942c593c1f2cbffe6deb7
On Alignment in Deep Linear Neural Networks
1 INTRODUCTION . Although overparameterized deep networks can interpolate randomly labeled training data ( Du et al. , 2019 ; Wu et al. , 2019 ) , training overparameterized networks with modern optimizers often leads to solutions that generalize well . This suggests that there is a form of implicit regularization occurring through training ( Zhang et al. , 2017 ) . As an example of implicit regularization , the authors in Ji & Telgarsky ( 2018 ) proved that the layers of linear neural networks used for binary classification on linearly separable datasets become aligned in the limit of training . That is , for a linear network parameterized by the matrix product WdWd−1 . . .W1 , the top left/right singular vectors ui and vi of layer Wi satisfy |vTi+1ui| → 1 as the number of gradient descent steps goes to infinity . Alignment of singular vector spaces between adjacent layers allows for the network representation to be drastically simplified ( see Equation 3 ) ; namely , the product of all layers becomes a product of diagonal matrices with the exception of the outermost unitary matrices . If alignment is an invariant of training , then optimization over the set of weight matrices reduces to optimization over the set of singular values of weight matrices . Thus , importantly , alignment of singular vector spaces allows for the gradient descent update rule to be simplified significantly , which was used in Ji & Telgarsky ( 2018 ) to show convergence to a max-margin solution . In this work , we generalize the definition of alignment to the multidimensional setting . We study when alignment can occur and moreover , under which conditions it is an invariant of training in linear neural networks under gradient descent . Prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) have implicitly relied on invariance of alignment as an assumption on initialization to simplify training dynamics for 2 layer networks . In this work , we provide necessary and sufficient conditions for when alignment is an invariant for networks of arbitrary depth . Our main contributions are as follows : 1 . We extend the definition of alignment from the 1-dimensional classification setting to the multi-dimensional setting ( Definition 2 ) and characterize when alignment is an invariant of training in linear fully connected networks with multi-dimensional outputs ( Theorem 1 ) . 2 . We demonstrate that alignment is an invariant for fully connected networks with multidimensional outputs only in special problem classes including autoencoding , matrix factorization and matrix sensing . This is in contrast to networks with 1-dimensional outputs , where there exists an initialization such that adjacent layers remain aligned throughout training under any real-valued loss function and any training dataset . 3 . Alignment largely simplifies the analysis of training linear networks : We provide an explicit learning rate under which gradient descent converges linearly to a global minimum under alignment in the squared loss setting ( Proposition 1 ) . 4 . We prove that alignment can not occur , let alone be invariant , in networks with constrained layer structure ( such as convolutional networks ) , when the amount of training data dominates the dimension of the layer structure ( Theorem 3 ) . 5 . We support our theoretical findings via experiments in Section 6 . As a consequence , our characterization of the invariance properties of alignment provides settings under which the gradient descent dynamics can be simplified and the implicit regularization properties can be fully understood , yet also shows that further results are required to explain implicit regularization in linear neural networks more generally . 2 RELATED WORK . Implicit regularization in overparameterized networks has become a subject of significant interest ( Gunasekar et al. , 2018a ; b ; Martin & Mahoney , 2018 ; Neyshabur et al. , 2014 ) . In order to characterize the specific form of implicit regularization , several works have focused on analyzing deep linear networks ( Arora et al. , 2019b ; Gunasekar et al. , 2018b ; 2017 ; Soudry et al. , 2018 ) . Even though such networks can only express linear maps , parameter optimization in linear networks is non-convex and is studied in order to obtain intuition about optimization of deep networks more generally . One such form of implicit regularization is alignment , identified by Ji & Telgarsky ( 2018 ) to analyze linear fully connected networks with 1-dimensional outputs trained on linearly separable data . They proved that in the limit of training , each layer , after normalization , approaches a rank 1 matrix , i.e . lim t→∞ W ( t ) i ‖W ( t ) i ‖F = uiv T i and that adjacent layers , Wi+1 and Wi become aligned , i.e . |vTi+1ui| → 1 . In addition , Ji & Telgarsky ( 2018 ) proved that alignment in this setting occurs concurrently with convergence to the max-margin solution . Follow-up work mainly focused on this convergence phenomenon and gave explicit convergence rates for overparameterized networks trained with gradient descent ( Arora et al. , 2019c ; Zou et al. , 2018 ) . Our definition of invariance of alignment extends assumptions on initialization appearing in various prior works ( Gidel et al. , 2019 ; Saxe et al. , 2014 ; 2019 ) . While the connection to alignment was not mentioned in their work , the authors in Gidel et al . ( 2019 ) begin to generalize alignment to multidimensional outputs by considering two-layer networks initialized so that layers are aligned with each other and to the data . We generalize this to networks of any depth , showing that our definition of alignment corresponds to the initialization considered in Gidel et al . ( 2019 ) . Moreover , we establish necessary and sufficient conditions for when alignment is an invariant of training in Theorem 1 instead of assuming these conditions . Furthermore , their result on sequential learning of components can be derived via our singular value update rule in Corollary 1 . Balancedness is another closely related form of implicit regularization in linear neural networks . It was introduced in Arora et al . ( 2018 ) and defined as the property that if WTi Wi = Wi+1W T i+1 for all i at initialization , then this property is invariant under gradient flow . Du et al . ( 2018 ) present a more general form , that WTi Wi −Wi+1WTi+1 is constant under gradient flow . In practice , analyses rely on this quantity being close to or exactly zero . In this exact setting , balancedness indeed implies alignment of singular vector spaces between consecutive layers . To study gradient descent , slightly more general notions such as approximate balancedness ( Arora et al. , 2019a ) and -balancedness have been introduced . Du et al . ( 2018 ) also defined balancedness with respect to convolutional networks , showing that under gradient flow , the difference in the norm of the weights of consecutive layers is an invariant . Generally , the goal of identifying invariants of training such as balancedness or alignment is to help understand both the dynamics of training and properties of solutions at the end of training . 3 DEFINITION OF ALIGNMENT IN THE MULTI-DIMENSIONAL SETTING . In this section , we first define alignment for linear neural networks with multi-dimensional outputs . We then define when alignment is an invariant of training . We consider linear neural networks . Let f : Rk0 → Rkd denote such a d-layer network , i.e . f ( x ) = WdWd−1 . . .W1x , ( 1 ) where Wi ∈ Rki×ki−1 for i ∈ [ d ] , where we follow the convention that [ d ] = { 1 , 2 , . . . d } . Let ( X , Y ) ∈ Rk0×n × Rkd×n denote the set of training data pairs { ( x ( i ) , y ( i ) ) } for i ∈ [ n ] . Gradient descent with learning rate γ is used to find a solution to the following optimization problem : arg min f∈F 1 2n n∑ i=1 ` ( f ( x ( i ) ) , y ( i ) ) , ( 2 ) where F is the set of linear functions represented by f and ` is a real-valued loss function . When not stated otherwise , we assume ` ( f ( x ( i ) ) , y ( i ) ) = ‖y ( i ) − f ( x ( i ) ) ‖22 , which is the squared loss ( MSE ) . In addition , we denote by W ( t ) i for t ∈ Z≥0 the weight matrix Wi after t steps of gradient descent . When there are no additional constraints on the matrices Wi , then f is a fully connected network . We next introduce a generalized form of the singular value decomposition : Definition 1 . An unsorted , signed singular value decomposition ( usSVD ) of a matrix A ∈ Rm×n is a triple U ∈ Rm×m , Σ ∈ Rm×n , V ∈ Rn×n such that U , V are orthonormal matrices , Σ is diagonal , and A = UΣV T . In contrast to the usual definition of singular value decomposition ( SVD ) of a matrix , the diagonal entries of Σ may be in any order and take negative values . Throughout , we will refer to the entries of Σ in a usSVD as singular values and the vectors in U , V as singular vectors . Using the usSVD , we now generalize the notion of alignment from Ji & Telgarsky ( 2018 ) to the multi-dimensional setting . Definition 2 . Let f = WdWd−1 . . .W1 be a linear network . We say that f is aligned if there exists a usSVD Wi = UiΣiV Ti with Ui = Vi+1 for all i ∈ [ d− 1 ] . ( We also say that a matrix A is aligned with another matrix B if there exist usSVD ’ s A = UAΣAV TA , B = UBΣBV T B such that VA = UB . ) Note that if Wi and Wi+1 are rank 1 matrices in an aligned network f , then the inner product of the first columns of Vi+1 and Ui is 1 in absolute value . Hence Definition 2 is consistent with alignment in the 1-dimensional setting from Ji & Telgarsky ( 2018 ) . We next define when alignment is an invariant of training for deep linear networks . Again , such invariants are of interest since they may provide insights into properties of trained networks and significantly simplify the dynamics of gradient descent . Definition 3 . Alignment is an invariant of training for a linear neural network f if there exists an initialization { W ( 0 ) j } dj=1 such that W ( ∞ ) 1 , W ( ∞ ) 2 , . . . , W ( ∞ ) d achieves zero training error 1 and for all gradient descent steps t ∈ Z≥0 ( a ) the network f is aligned ; ( b ) W ( t ) i = UiΣ ( t ) i V T i for all i ∈ { 2 , . . . d− 1 } , that is , Ui , Vi are not updated ; ( c ) W ( t ) 1 = U1Σ ( t ) 1 V ( t ) 1 T and W ( t ) d = U ( t ) d Σ ( t ) d V T d , that is , U1 and Vd are not updated . If additionally , V1 and Ud are not updated for any t ∈ Z≥0 , then we say that strong alignment is an invariant of training . When alignment is an invariant of training , there are important consequences for training . In particular , note that when the network f is aligned with usSVDs Wi = UiΣiV Ti for all 1 ≤ i ≤ d , then f ( x ) = Wd · · ·W1x = Ud ( d−1∏ i=0 Σd−i ) V T1 x . ( 3 ) 1The interpolation condition in this definition ( i.e. , achieving zero training error ) is important in ruling out several architectures where the layers are trivially aligned . For example , if all layers are constrained to be diagonal matrices throughout training , then the layers are all trivially aligned , but can not interpolate datasets where the target is not the product of a diagonal matrix with the input . Hence if alignment is an invariant of training , then the singular vectors of layers 2 through d− 1 are never updated and the analysis of gradient descent can be limited to the singular values of the layers and the matrices V1 and Ud . Remarks . For the remainder of the paper , we assume that the gradient of the loss function at initialization { W ( 0 ) i } di=1 is non-zero . Otherwise , training with gradient descent would not proceed . We also only consider datasets ( X , Y ) for which there is a linear network that achieves loss zero . This is consistent with the assumptions in Ji & Telgarsky ( 2018 ) .
The paper presents an extension of the idea of alignment in linear neural networks, that can help in providing convergence analysis of such networks. Such a notion was previously studied for networks with a single output. The current paper extends it to networks with multi-dimensional outputs. The paper offers multiple interesting results: a) conditions on the datasets where alignment can remain invariant b) lack of alignment or invariance for networks with constrained layers
SP:d3d113911e8ca3b6c36942c593c1f2cbffe6deb7
Are all negatives created equal in contrastive instance discrimination?
1 INTRODUCTION . In recent years , there has been tremendous progress on self-supervised learning ( SSL ) , a paradigm in which representations are learned using a pre-training task that uses only unlabeled data . These representations are then used on downstream tasks , such as classification or object detection . Since SSL pre-training does not require labels , it can leverage unlabeled data , which is can be abundant and cheaper to obtain than labeled data . In computer vision , representations learned from unlabeled data have historically underperformed representations learned directly from labeled data . Recently , however , newly proposed SSL methods such as MoCo ( He et al. , 2019 ; Chen et al. , 2020c ) , SimCLR ( Chen et al. , 2020a ; b ) , SwAV ( Caron et al. , 2020 ) , and BYOL ( Grill et al. , 2020 ) have dramatically reduced this performance gap . The MoCo and SimCLR pre-training tasks use contrastive instance discrimination ( CID ) , in which a network is trained to recognize different augmented views of the same image ( sometimes called the query and the positive and discriminate between the query and the augmented views of other random images from the dataset ( called negatives ) .1 ) Despite the empirical successes of CID , the mechanisms underlying its strong performance remain unclear . Recent theoretical and empirical works have investigated the role of mutual information between augmentations ( Tian et al. , 2020 ) , analyzed properties of the learned representations such as alignment and uniformity ( Wang & Isola , 2020 ) , and proposed a theoretical framework ( Arora et al. , 2019 ) , among others . However , existing works on CID have not investigated the relative importance or semantic properties of different negatives , even though negatives play a central role in CID . In other areas , works on hard negative mining in metric learning ( Kaya & Bilge , 2019 ) and on the impact of different training examples in supervised learning ( Birodkar et al. , 2019 ) suggest that understanding the relative importance of different training data can be fruitful . 1In MoCo , these are called the query and positive and are treated slightly differently ; in SimCLR , both are treated the same and are called positives . The other SSL methods listed ( not SimCLR and MoCo ) are not CID . In this work , we empirically investigate how the difficulty of negatives affects the downstream performance of the learned representation . We measure difficulty using the dot product between the normalized contrastive-space embeddings of the query and the negative . A dot product closer to 1 suggests a negative that is more difficult to distinguish from the query . We ask how different negatives , by difficulty , affect training . Are some negatives more important than others for downstream accuracy ? If so , we ask : Which ones ? To what extent ? And what makes them different ? We focus on MoCo v2 ( Chen et al. , 2020c ) and the downstream task of linear classification on ImageNet ( Deng et al. , 2009 ) , and have similar results for SimCLR in Appendix A.2 . We make the following contributions ( see Figure 1 for summary ) : • The easiest 95 % of negatives are unnecessary and insufficient , while the top 5 % hardest negatives are necessary and sufficient : We reached within 0.7 percentage points of full accuracy by training on the 5 % of hardest negatives for each query , suggesting that the 95 % easiest negatives are unnecessary . In contrast , the easiest negatives are insufficient ( and , therefore , the hardest negatives are necessary ) : accuracy drops substantially when training on only the easiest 95 % of negatives . The hardest 5 % of negatives are especially important : training on only the next hardest 5 % lowers accuracy by 15 percentage points . • The hardest 0.1 % of negatives are unnecessary and sometimes detrimental : Downstream accuracy was unchanged or improved when we removed these hardest negatives . These negatives were more often in the same ImageNet class as the query , compared to easier negatives , suggesting that semantically identical ( but superficially dissimilar ) negatives were unhelpful or detrimental . • Properties of negatives : Based on our observations that the importance of a negative varies with its difficulty , we investigate the properties of negatives that affect their difficulty . – We found that hard negatives were more semantically similar to the query than were easy negatives : the hardest 5 % of negatives were more likely to be of the same ImageNet class as the query , compared to easier negatives . These hard negatives were also closer to the query as measured by depth of the least common ancestor for the negative and the query in the WordNet tree ( which ImageNet is built upon ) . – We also observed that the pattern is reversed for the ≈50 % of easier negatives : there , the easier the negative , the more semantically similar it is to the query . – There exist negatives that are more consistently hard across queries than would be expected by random chance . We emphasize that our primary aim is to better understand the differences between negatives and the impact of these differences on existing methods rather than to propose a new method . However , our results suggest that there may be unexploited opportunities to reduce the cost of modern CID methods ( Chen et al. , 2020c ) . For any particular query , only a small fraction of the negatives are necessary . Our observations on differences in negative importance can serve as a valuable building block for the understanding and improvement of contrastive learning methods.For example , there may be further room to choose specific examples for training , similar to hard negative mining and curriculum learning ( Chen et al. , 2020a ; Chuang et al. , 2020 ; Kaya & Bilge , 2019 ) , to reduce costs and improve performance per data sample . 2 METHODS AND PRELIMINARIES . Contrastive instance discrimination and momentum contrast . Momentum Contrast ( MoCo v2 ) is a CID method that reaches accuracy within 6 percentage points of supervised accuracy on ImageNet with ResNet-50 ( Chen et al. , 2020c ) . In MoCo , the task is to learn a representation that succeeds at the following : given a query ( an augmented view of an image ) , correctly pick a positive ( a different augmented view of the same image ) from a large set of negatives ( augmented views of randomly chosen images ) . Our experiments focus on aspects that are common between CID methods rather than those specific to MoCo . We discuss implementation details that may be specific to MoCo v2 here . The MoCo v2 encoder is a ResNet-50 network . For pre-training , the outputs of this base network are fed into a multi-layer perceptron ( MLP ) head ; we refer to the normalized output from the MLP head as the contrastive-space embedding . For downstream tasks , the MLP head is discarded and only the base network is used ; we refer to the output of the base network as the learned representation . A distinguishing feature of MoCo is that it has two encoders , one of which is actively trained ( used for the query ) and the other which is a moving average of the trained encoder ( used for the positive and negatives ) . MoCo stores the embeddings of each batch of positives in a large queue and uses them as negatives for future batches , enabling the use of more negatives than can fit in a batch . MoCo uses the InfoNCE loss ( Gutmann & Hyvärinen , 2010 ; van den Oord et al. , 2018 ) : Lq = − log exp ( q · k+/τ ) ∑K i=1 exp ( q · ki/τ ) where q is the embedding of a query ( using the learned encoder ) , k+ is the embedding of a positive ( using the momentum encoder ) , and ki are the embeddings of the negatives in the queue ( added using previous states of the momentum encoder ) . τ is a temperature hyperparameter . Difficulty of negatives . To compute the difficulty for a set of negatives given a particular query , we calculate the dot product between the normalized contrastive-space embedding of each negative with the normalized contrastive-space embedding of the query . We then sort the dot products and consider the negatives with dot products closer to 1 to be harder negatives and those with smaller dot products to be easier negatives . We use this terminology because it fits intuition : all else being equal , harder negatives increase the loss . Since embeddings are normalized , the dot product is the cosine of the angle between the embeddings of the instances and ranges from -1 to 1 . Note that difficulty is defined per query and that it is a function of the current state of the network . Thus , a negative can be easy for some queries and hard for others , and the hardness of a negative for a given query can vary over training epochs and across different training runs and configurations . Experimental setting . Our experiments focus on MoCo v2 ( Chen et al. , 2020c ) , an improved version of MoCo which combines MoCo v1 ( He et al. , 2019 ) with several features of SimCLR ( Chen et al. , 2020a ) . We use ImageNet for pre-training and evaluate performance using linear classification on ImageNet from the representation learned in the pre-training CID task . The network used , as in MoCo v2 , is a ResNet-50 with MLP head , and trained for 200 epochs . Unless otherwise noted , we run each experiment three times with different seeds ; error bars represent mean± standard deviation . 3 WHICH NEGATIVES ARE NECESSARY OR SUFFICIENT ? . We examine which negatives , by difficulty , are necessary or sufficient for learning representations that have strong downstream performance . Outside of CID , there are varying perspectives on the value of easy negatives . Research on hard negative mining suggests that harder negatives can be more important than easier negatives for relevant tasks ( Kaya & Bilge , 2019 ) . However , in some supervised contexts , much or all training data seems important for reaching the highest accuracy ( Birodkar et al. , 2019 ) . We aim to experimentally assess which of these perspectives applies when using MoCo v2 on ImageNet classification . To determine whether a set of negatives was necessary , we removed the corresponding negatives on each pre-training step ; if the resulting representations still led to accuracy close to baseline on the downstream task , then we considered those negatives to have been unnecessary . To determine whether a set of negatives was sufficient , we removed all negatives except those in that range on each pre-training step ; if the resulting representations still led to strong accuracy on the downstream task , then we considered the negatives in that range to have been sufficient.2 The easy negatives are unnecessary ; the hard negatives are sufficient . First , we asked whether the easy negatives were necessary ( or equivalently , whether the hard negatives were sufficient ) . That is , does the network maintain downstream accuracy when it is pre-trained without the easy negatives ? To test this , we evaluated how accuracy changed as different subsets of negatives were removed . Interestingly , we found that using only the hardest 5 % of negatives was largely sufficient to recover baseline accuracy ( Figure 2a-b , 95-100 % ) , suggesting that the overwhelming majority of the easier negatives were unnecessary . Moreover , the hardest 5 % ( 95-100 % ) were substantially more informative than the next 5 % ( 90-95 % ) : top-1 accuracy dropped by only 0.7 percentage points when trained on only the hardest 5 % vs. 15 percentage points for the next hardest 5 % ( 90-95 % ) and 47 percentage points for the third 5 % ( 85-90 % ; Figure 2a-b ) . Going forward , we use 5 % as a cutoff and call the negatives harder than this cutoff hard and those easier than this cutoff easy . The easy negatives are largely insufficient ; the hard negatives are necessary . We next asked whether the easy negatives were sufficient ( or , equivalently , whether the hard negatives were necessary ) . Although we found in the previous section that the easy negatives were unnecessary , that does not necessarily mean they are insufficient . For example , it could be that the easy negatives , while individually less important , collectively provide sufficient signal for learning good representations on the downstream task . Alternatively , it is possible that the information contained in all of the easy negatives still lacks enough signal ; in this case , the easy negatives , even when combined together , would still be insufficient . We found that even when the easiest 95 % of negatives were combined together , accuracy was 5.4 % below baseline ( Figure 2c-d ) . In contrast , recall that using only the hardest 5 % of negatives ( 19x fewer ) achieved top-1 performance within 0.7 % of baseline ( Figure 2a ) . Using the easiest 90 % of negatives harms accuracy even further ( 0-90 % ; Figure 2c-d ) . Together , these results demonstrate that the easiest negatives , even when they comprise the vast majority of negatives , are still insufficient . The very hardest negatives are harmful at lower temperatures . We have found that the hard negatives , i.e . the 5 % hardest , are largely necessary and sufficient for CID . However , top-1 accuracy actually improved slightly when we removed the very hardest 0.1 % of negatives ( p = 0.03 for an 2We removed sets of negatives by treating them as through they were not present in the queue . unpaired t-test ) .3 This effect was most pronounced at lower temperatures ( Figure 3 ) ; for example , at temperature 0.1 ( as opposed to baseline temperature 0.2 ) , training without the hardest 0.1 % of negatives improved downstream top-1 accuracy by 0.23 % ( p = 0.0003 ) and top-5 accuracy by 0.67 % . One might expect such a difference between temperatures because the hardest negatives are weighted more in the loss at lower temperatures . Interestingly , the effect was larger for top-5 accuracy than top-1 accuracy ( compare Figure 3b with 3a ) . One hypothesis for why the hardest negatives hurt is that because negatives are randomly sampled , some negatives can be too similar to the query ( e.g . augmentations of near-duplicates to the query ) . Because negatives are randomly sampled , they can included augmented views of images that are near-duplicates of the query or otherwise visually very similar to the query . If both the query and negative contain identical semantic content , the contrastive loss might rely on non-semantic features to distinguish between them , thus emphasizing these non-semantic features in the representation ( Figure 1 ) . These same-class negatives may thus be harmful to learning representations for downstream linear classification . If this is the case , we would expect that removing same class negatives would improve performance , perhaps even more than removing the hardest 0.1 % of negatives overall . As shown in Table 1 , removing same-class negatives indeed leads to slightly higher accuracy than removing the hardest 0.1 % of negatives . Removing only the subset of the hardest 0.1 % of negatives with the same class as the query accounts for all of the improvement from removing the hardest 0.1 % of negatives . Alternatively , removing only the subset of the 0.1 % hardest negatives with different classes shows no improvement over baseline and in fact decreases top-1 accuracy at low temperature . These results demonstrate that the accuracy benefit of removing the 0.1 % hardest negatives can entirely be accounted for by the fact that it removes many elements of the same class as the query , so that removing the 0.1 % hardest negatives approximates removing the same-class negatives without requiring access to privileged label data . This observation is also consistent with recent work which has attempted to “ debias ” contrastive learning away from same-class negatives ( Chuang et al. , 2020 ) .
This paper argues that in contrastive self-supervised learning, different negative instances have different importance. This importance is relevant to the ``difficulty" of negative instances. On ImageNet and MoCo2, the authors show that using the most difficult 5% negative instances can achieve similar performance compared with using all negative instances. However, the most difficult 0.1% of negative instances yield bad performance.
SP:857aa1392e6039808d27889d932d82ad756a12b6
Are all negatives created equal in contrastive instance discrimination?
1 INTRODUCTION . In recent years , there has been tremendous progress on self-supervised learning ( SSL ) , a paradigm in which representations are learned using a pre-training task that uses only unlabeled data . These representations are then used on downstream tasks , such as classification or object detection . Since SSL pre-training does not require labels , it can leverage unlabeled data , which is can be abundant and cheaper to obtain than labeled data . In computer vision , representations learned from unlabeled data have historically underperformed representations learned directly from labeled data . Recently , however , newly proposed SSL methods such as MoCo ( He et al. , 2019 ; Chen et al. , 2020c ) , SimCLR ( Chen et al. , 2020a ; b ) , SwAV ( Caron et al. , 2020 ) , and BYOL ( Grill et al. , 2020 ) have dramatically reduced this performance gap . The MoCo and SimCLR pre-training tasks use contrastive instance discrimination ( CID ) , in which a network is trained to recognize different augmented views of the same image ( sometimes called the query and the positive and discriminate between the query and the augmented views of other random images from the dataset ( called negatives ) .1 ) Despite the empirical successes of CID , the mechanisms underlying its strong performance remain unclear . Recent theoretical and empirical works have investigated the role of mutual information between augmentations ( Tian et al. , 2020 ) , analyzed properties of the learned representations such as alignment and uniformity ( Wang & Isola , 2020 ) , and proposed a theoretical framework ( Arora et al. , 2019 ) , among others . However , existing works on CID have not investigated the relative importance or semantic properties of different negatives , even though negatives play a central role in CID . In other areas , works on hard negative mining in metric learning ( Kaya & Bilge , 2019 ) and on the impact of different training examples in supervised learning ( Birodkar et al. , 2019 ) suggest that understanding the relative importance of different training data can be fruitful . 1In MoCo , these are called the query and positive and are treated slightly differently ; in SimCLR , both are treated the same and are called positives . The other SSL methods listed ( not SimCLR and MoCo ) are not CID . In this work , we empirically investigate how the difficulty of negatives affects the downstream performance of the learned representation . We measure difficulty using the dot product between the normalized contrastive-space embeddings of the query and the negative . A dot product closer to 1 suggests a negative that is more difficult to distinguish from the query . We ask how different negatives , by difficulty , affect training . Are some negatives more important than others for downstream accuracy ? If so , we ask : Which ones ? To what extent ? And what makes them different ? We focus on MoCo v2 ( Chen et al. , 2020c ) and the downstream task of linear classification on ImageNet ( Deng et al. , 2009 ) , and have similar results for SimCLR in Appendix A.2 . We make the following contributions ( see Figure 1 for summary ) : • The easiest 95 % of negatives are unnecessary and insufficient , while the top 5 % hardest negatives are necessary and sufficient : We reached within 0.7 percentage points of full accuracy by training on the 5 % of hardest negatives for each query , suggesting that the 95 % easiest negatives are unnecessary . In contrast , the easiest negatives are insufficient ( and , therefore , the hardest negatives are necessary ) : accuracy drops substantially when training on only the easiest 95 % of negatives . The hardest 5 % of negatives are especially important : training on only the next hardest 5 % lowers accuracy by 15 percentage points . • The hardest 0.1 % of negatives are unnecessary and sometimes detrimental : Downstream accuracy was unchanged or improved when we removed these hardest negatives . These negatives were more often in the same ImageNet class as the query , compared to easier negatives , suggesting that semantically identical ( but superficially dissimilar ) negatives were unhelpful or detrimental . • Properties of negatives : Based on our observations that the importance of a negative varies with its difficulty , we investigate the properties of negatives that affect their difficulty . – We found that hard negatives were more semantically similar to the query than were easy negatives : the hardest 5 % of negatives were more likely to be of the same ImageNet class as the query , compared to easier negatives . These hard negatives were also closer to the query as measured by depth of the least common ancestor for the negative and the query in the WordNet tree ( which ImageNet is built upon ) . – We also observed that the pattern is reversed for the ≈50 % of easier negatives : there , the easier the negative , the more semantically similar it is to the query . – There exist negatives that are more consistently hard across queries than would be expected by random chance . We emphasize that our primary aim is to better understand the differences between negatives and the impact of these differences on existing methods rather than to propose a new method . However , our results suggest that there may be unexploited opportunities to reduce the cost of modern CID methods ( Chen et al. , 2020c ) . For any particular query , only a small fraction of the negatives are necessary . Our observations on differences in negative importance can serve as a valuable building block for the understanding and improvement of contrastive learning methods.For example , there may be further room to choose specific examples for training , similar to hard negative mining and curriculum learning ( Chen et al. , 2020a ; Chuang et al. , 2020 ; Kaya & Bilge , 2019 ) , to reduce costs and improve performance per data sample . 2 METHODS AND PRELIMINARIES . Contrastive instance discrimination and momentum contrast . Momentum Contrast ( MoCo v2 ) is a CID method that reaches accuracy within 6 percentage points of supervised accuracy on ImageNet with ResNet-50 ( Chen et al. , 2020c ) . In MoCo , the task is to learn a representation that succeeds at the following : given a query ( an augmented view of an image ) , correctly pick a positive ( a different augmented view of the same image ) from a large set of negatives ( augmented views of randomly chosen images ) . Our experiments focus on aspects that are common between CID methods rather than those specific to MoCo . We discuss implementation details that may be specific to MoCo v2 here . The MoCo v2 encoder is a ResNet-50 network . For pre-training , the outputs of this base network are fed into a multi-layer perceptron ( MLP ) head ; we refer to the normalized output from the MLP head as the contrastive-space embedding . For downstream tasks , the MLP head is discarded and only the base network is used ; we refer to the output of the base network as the learned representation . A distinguishing feature of MoCo is that it has two encoders , one of which is actively trained ( used for the query ) and the other which is a moving average of the trained encoder ( used for the positive and negatives ) . MoCo stores the embeddings of each batch of positives in a large queue and uses them as negatives for future batches , enabling the use of more negatives than can fit in a batch . MoCo uses the InfoNCE loss ( Gutmann & Hyvärinen , 2010 ; van den Oord et al. , 2018 ) : Lq = − log exp ( q · k+/τ ) ∑K i=1 exp ( q · ki/τ ) where q is the embedding of a query ( using the learned encoder ) , k+ is the embedding of a positive ( using the momentum encoder ) , and ki are the embeddings of the negatives in the queue ( added using previous states of the momentum encoder ) . τ is a temperature hyperparameter . Difficulty of negatives . To compute the difficulty for a set of negatives given a particular query , we calculate the dot product between the normalized contrastive-space embedding of each negative with the normalized contrastive-space embedding of the query . We then sort the dot products and consider the negatives with dot products closer to 1 to be harder negatives and those with smaller dot products to be easier negatives . We use this terminology because it fits intuition : all else being equal , harder negatives increase the loss . Since embeddings are normalized , the dot product is the cosine of the angle between the embeddings of the instances and ranges from -1 to 1 . Note that difficulty is defined per query and that it is a function of the current state of the network . Thus , a negative can be easy for some queries and hard for others , and the hardness of a negative for a given query can vary over training epochs and across different training runs and configurations . Experimental setting . Our experiments focus on MoCo v2 ( Chen et al. , 2020c ) , an improved version of MoCo which combines MoCo v1 ( He et al. , 2019 ) with several features of SimCLR ( Chen et al. , 2020a ) . We use ImageNet for pre-training and evaluate performance using linear classification on ImageNet from the representation learned in the pre-training CID task . The network used , as in MoCo v2 , is a ResNet-50 with MLP head , and trained for 200 epochs . Unless otherwise noted , we run each experiment three times with different seeds ; error bars represent mean± standard deviation . 3 WHICH NEGATIVES ARE NECESSARY OR SUFFICIENT ? . We examine which negatives , by difficulty , are necessary or sufficient for learning representations that have strong downstream performance . Outside of CID , there are varying perspectives on the value of easy negatives . Research on hard negative mining suggests that harder negatives can be more important than easier negatives for relevant tasks ( Kaya & Bilge , 2019 ) . However , in some supervised contexts , much or all training data seems important for reaching the highest accuracy ( Birodkar et al. , 2019 ) . We aim to experimentally assess which of these perspectives applies when using MoCo v2 on ImageNet classification . To determine whether a set of negatives was necessary , we removed the corresponding negatives on each pre-training step ; if the resulting representations still led to accuracy close to baseline on the downstream task , then we considered those negatives to have been unnecessary . To determine whether a set of negatives was sufficient , we removed all negatives except those in that range on each pre-training step ; if the resulting representations still led to strong accuracy on the downstream task , then we considered the negatives in that range to have been sufficient.2 The easy negatives are unnecessary ; the hard negatives are sufficient . First , we asked whether the easy negatives were necessary ( or equivalently , whether the hard negatives were sufficient ) . That is , does the network maintain downstream accuracy when it is pre-trained without the easy negatives ? To test this , we evaluated how accuracy changed as different subsets of negatives were removed . Interestingly , we found that using only the hardest 5 % of negatives was largely sufficient to recover baseline accuracy ( Figure 2a-b , 95-100 % ) , suggesting that the overwhelming majority of the easier negatives were unnecessary . Moreover , the hardest 5 % ( 95-100 % ) were substantially more informative than the next 5 % ( 90-95 % ) : top-1 accuracy dropped by only 0.7 percentage points when trained on only the hardest 5 % vs. 15 percentage points for the next hardest 5 % ( 90-95 % ) and 47 percentage points for the third 5 % ( 85-90 % ; Figure 2a-b ) . Going forward , we use 5 % as a cutoff and call the negatives harder than this cutoff hard and those easier than this cutoff easy . The easy negatives are largely insufficient ; the hard negatives are necessary . We next asked whether the easy negatives were sufficient ( or , equivalently , whether the hard negatives were necessary ) . Although we found in the previous section that the easy negatives were unnecessary , that does not necessarily mean they are insufficient . For example , it could be that the easy negatives , while individually less important , collectively provide sufficient signal for learning good representations on the downstream task . Alternatively , it is possible that the information contained in all of the easy negatives still lacks enough signal ; in this case , the easy negatives , even when combined together , would still be insufficient . We found that even when the easiest 95 % of negatives were combined together , accuracy was 5.4 % below baseline ( Figure 2c-d ) . In contrast , recall that using only the hardest 5 % of negatives ( 19x fewer ) achieved top-1 performance within 0.7 % of baseline ( Figure 2a ) . Using the easiest 90 % of negatives harms accuracy even further ( 0-90 % ; Figure 2c-d ) . Together , these results demonstrate that the easiest negatives , even when they comprise the vast majority of negatives , are still insufficient . The very hardest negatives are harmful at lower temperatures . We have found that the hard negatives , i.e . the 5 % hardest , are largely necessary and sufficient for CID . However , top-1 accuracy actually improved slightly when we removed the very hardest 0.1 % of negatives ( p = 0.03 for an 2We removed sets of negatives by treating them as through they were not present in the queue . unpaired t-test ) .3 This effect was most pronounced at lower temperatures ( Figure 3 ) ; for example , at temperature 0.1 ( as opposed to baseline temperature 0.2 ) , training without the hardest 0.1 % of negatives improved downstream top-1 accuracy by 0.23 % ( p = 0.0003 ) and top-5 accuracy by 0.67 % . One might expect such a difference between temperatures because the hardest negatives are weighted more in the loss at lower temperatures . Interestingly , the effect was larger for top-5 accuracy than top-1 accuracy ( compare Figure 3b with 3a ) . One hypothesis for why the hardest negatives hurt is that because negatives are randomly sampled , some negatives can be too similar to the query ( e.g . augmentations of near-duplicates to the query ) . Because negatives are randomly sampled , they can included augmented views of images that are near-duplicates of the query or otherwise visually very similar to the query . If both the query and negative contain identical semantic content , the contrastive loss might rely on non-semantic features to distinguish between them , thus emphasizing these non-semantic features in the representation ( Figure 1 ) . These same-class negatives may thus be harmful to learning representations for downstream linear classification . If this is the case , we would expect that removing same class negatives would improve performance , perhaps even more than removing the hardest 0.1 % of negatives overall . As shown in Table 1 , removing same-class negatives indeed leads to slightly higher accuracy than removing the hardest 0.1 % of negatives . Removing only the subset of the hardest 0.1 % of negatives with the same class as the query accounts for all of the improvement from removing the hardest 0.1 % of negatives . Alternatively , removing only the subset of the 0.1 % hardest negatives with different classes shows no improvement over baseline and in fact decreases top-1 accuracy at low temperature . These results demonstrate that the accuracy benefit of removing the 0.1 % hardest negatives can entirely be accounted for by the fact that it removes many elements of the same class as the query , so that removing the 0.1 % hardest negatives approximates removing the same-class negatives without requiring access to privileged label data . This observation is also consistent with recent work which has attempted to “ debias ” contrastive learning away from same-class negatives ( Chuang et al. , 2020 ) .
In this paper, the authors carried out a series of experiments to analyze the impact of negative samples in contrastive learning (instance discrimination - CID). In particular, they try to identify which difficulty range is important for representation learning. Of the many recent self-supervised learning approaches, they chose MOCO V2 as the testbed. They trained the MOCO model from an ImageNet pre-trained one. Various settings, which correspond to various ways of filtering our hard or easy negatives, were used. Hardness of samples are measured based on embedding distance to the query. I.e. ones with large distance are easy. Their main findings are, for negative samples, 1) Using the 5% hardest is enough for downstream tasks, 2) the easiest 95% of them were unnecessary and insufficient, 3) The hardest 0.1% is harmful and 4) hard negatives were more semantically similar to the query.
SP:857aa1392e6039808d27889d932d82ad756a12b6
Are all negatives created equal in contrastive instance discrimination?
1 INTRODUCTION . In recent years , there has been tremendous progress on self-supervised learning ( SSL ) , a paradigm in which representations are learned using a pre-training task that uses only unlabeled data . These representations are then used on downstream tasks , such as classification or object detection . Since SSL pre-training does not require labels , it can leverage unlabeled data , which is can be abundant and cheaper to obtain than labeled data . In computer vision , representations learned from unlabeled data have historically underperformed representations learned directly from labeled data . Recently , however , newly proposed SSL methods such as MoCo ( He et al. , 2019 ; Chen et al. , 2020c ) , SimCLR ( Chen et al. , 2020a ; b ) , SwAV ( Caron et al. , 2020 ) , and BYOL ( Grill et al. , 2020 ) have dramatically reduced this performance gap . The MoCo and SimCLR pre-training tasks use contrastive instance discrimination ( CID ) , in which a network is trained to recognize different augmented views of the same image ( sometimes called the query and the positive and discriminate between the query and the augmented views of other random images from the dataset ( called negatives ) .1 ) Despite the empirical successes of CID , the mechanisms underlying its strong performance remain unclear . Recent theoretical and empirical works have investigated the role of mutual information between augmentations ( Tian et al. , 2020 ) , analyzed properties of the learned representations such as alignment and uniformity ( Wang & Isola , 2020 ) , and proposed a theoretical framework ( Arora et al. , 2019 ) , among others . However , existing works on CID have not investigated the relative importance or semantic properties of different negatives , even though negatives play a central role in CID . In other areas , works on hard negative mining in metric learning ( Kaya & Bilge , 2019 ) and on the impact of different training examples in supervised learning ( Birodkar et al. , 2019 ) suggest that understanding the relative importance of different training data can be fruitful . 1In MoCo , these are called the query and positive and are treated slightly differently ; in SimCLR , both are treated the same and are called positives . The other SSL methods listed ( not SimCLR and MoCo ) are not CID . In this work , we empirically investigate how the difficulty of negatives affects the downstream performance of the learned representation . We measure difficulty using the dot product between the normalized contrastive-space embeddings of the query and the negative . A dot product closer to 1 suggests a negative that is more difficult to distinguish from the query . We ask how different negatives , by difficulty , affect training . Are some negatives more important than others for downstream accuracy ? If so , we ask : Which ones ? To what extent ? And what makes them different ? We focus on MoCo v2 ( Chen et al. , 2020c ) and the downstream task of linear classification on ImageNet ( Deng et al. , 2009 ) , and have similar results for SimCLR in Appendix A.2 . We make the following contributions ( see Figure 1 for summary ) : • The easiest 95 % of negatives are unnecessary and insufficient , while the top 5 % hardest negatives are necessary and sufficient : We reached within 0.7 percentage points of full accuracy by training on the 5 % of hardest negatives for each query , suggesting that the 95 % easiest negatives are unnecessary . In contrast , the easiest negatives are insufficient ( and , therefore , the hardest negatives are necessary ) : accuracy drops substantially when training on only the easiest 95 % of negatives . The hardest 5 % of negatives are especially important : training on only the next hardest 5 % lowers accuracy by 15 percentage points . • The hardest 0.1 % of negatives are unnecessary and sometimes detrimental : Downstream accuracy was unchanged or improved when we removed these hardest negatives . These negatives were more often in the same ImageNet class as the query , compared to easier negatives , suggesting that semantically identical ( but superficially dissimilar ) negatives were unhelpful or detrimental . • Properties of negatives : Based on our observations that the importance of a negative varies with its difficulty , we investigate the properties of negatives that affect their difficulty . – We found that hard negatives were more semantically similar to the query than were easy negatives : the hardest 5 % of negatives were more likely to be of the same ImageNet class as the query , compared to easier negatives . These hard negatives were also closer to the query as measured by depth of the least common ancestor for the negative and the query in the WordNet tree ( which ImageNet is built upon ) . – We also observed that the pattern is reversed for the ≈50 % of easier negatives : there , the easier the negative , the more semantically similar it is to the query . – There exist negatives that are more consistently hard across queries than would be expected by random chance . We emphasize that our primary aim is to better understand the differences between negatives and the impact of these differences on existing methods rather than to propose a new method . However , our results suggest that there may be unexploited opportunities to reduce the cost of modern CID methods ( Chen et al. , 2020c ) . For any particular query , only a small fraction of the negatives are necessary . Our observations on differences in negative importance can serve as a valuable building block for the understanding and improvement of contrastive learning methods.For example , there may be further room to choose specific examples for training , similar to hard negative mining and curriculum learning ( Chen et al. , 2020a ; Chuang et al. , 2020 ; Kaya & Bilge , 2019 ) , to reduce costs and improve performance per data sample . 2 METHODS AND PRELIMINARIES . Contrastive instance discrimination and momentum contrast . Momentum Contrast ( MoCo v2 ) is a CID method that reaches accuracy within 6 percentage points of supervised accuracy on ImageNet with ResNet-50 ( Chen et al. , 2020c ) . In MoCo , the task is to learn a representation that succeeds at the following : given a query ( an augmented view of an image ) , correctly pick a positive ( a different augmented view of the same image ) from a large set of negatives ( augmented views of randomly chosen images ) . Our experiments focus on aspects that are common between CID methods rather than those specific to MoCo . We discuss implementation details that may be specific to MoCo v2 here . The MoCo v2 encoder is a ResNet-50 network . For pre-training , the outputs of this base network are fed into a multi-layer perceptron ( MLP ) head ; we refer to the normalized output from the MLP head as the contrastive-space embedding . For downstream tasks , the MLP head is discarded and only the base network is used ; we refer to the output of the base network as the learned representation . A distinguishing feature of MoCo is that it has two encoders , one of which is actively trained ( used for the query ) and the other which is a moving average of the trained encoder ( used for the positive and negatives ) . MoCo stores the embeddings of each batch of positives in a large queue and uses them as negatives for future batches , enabling the use of more negatives than can fit in a batch . MoCo uses the InfoNCE loss ( Gutmann & Hyvärinen , 2010 ; van den Oord et al. , 2018 ) : Lq = − log exp ( q · k+/τ ) ∑K i=1 exp ( q · ki/τ ) where q is the embedding of a query ( using the learned encoder ) , k+ is the embedding of a positive ( using the momentum encoder ) , and ki are the embeddings of the negatives in the queue ( added using previous states of the momentum encoder ) . τ is a temperature hyperparameter . Difficulty of negatives . To compute the difficulty for a set of negatives given a particular query , we calculate the dot product between the normalized contrastive-space embedding of each negative with the normalized contrastive-space embedding of the query . We then sort the dot products and consider the negatives with dot products closer to 1 to be harder negatives and those with smaller dot products to be easier negatives . We use this terminology because it fits intuition : all else being equal , harder negatives increase the loss . Since embeddings are normalized , the dot product is the cosine of the angle between the embeddings of the instances and ranges from -1 to 1 . Note that difficulty is defined per query and that it is a function of the current state of the network . Thus , a negative can be easy for some queries and hard for others , and the hardness of a negative for a given query can vary over training epochs and across different training runs and configurations . Experimental setting . Our experiments focus on MoCo v2 ( Chen et al. , 2020c ) , an improved version of MoCo which combines MoCo v1 ( He et al. , 2019 ) with several features of SimCLR ( Chen et al. , 2020a ) . We use ImageNet for pre-training and evaluate performance using linear classification on ImageNet from the representation learned in the pre-training CID task . The network used , as in MoCo v2 , is a ResNet-50 with MLP head , and trained for 200 epochs . Unless otherwise noted , we run each experiment three times with different seeds ; error bars represent mean± standard deviation . 3 WHICH NEGATIVES ARE NECESSARY OR SUFFICIENT ? . We examine which negatives , by difficulty , are necessary or sufficient for learning representations that have strong downstream performance . Outside of CID , there are varying perspectives on the value of easy negatives . Research on hard negative mining suggests that harder negatives can be more important than easier negatives for relevant tasks ( Kaya & Bilge , 2019 ) . However , in some supervised contexts , much or all training data seems important for reaching the highest accuracy ( Birodkar et al. , 2019 ) . We aim to experimentally assess which of these perspectives applies when using MoCo v2 on ImageNet classification . To determine whether a set of negatives was necessary , we removed the corresponding negatives on each pre-training step ; if the resulting representations still led to accuracy close to baseline on the downstream task , then we considered those negatives to have been unnecessary . To determine whether a set of negatives was sufficient , we removed all negatives except those in that range on each pre-training step ; if the resulting representations still led to strong accuracy on the downstream task , then we considered the negatives in that range to have been sufficient.2 The easy negatives are unnecessary ; the hard negatives are sufficient . First , we asked whether the easy negatives were necessary ( or equivalently , whether the hard negatives were sufficient ) . That is , does the network maintain downstream accuracy when it is pre-trained without the easy negatives ? To test this , we evaluated how accuracy changed as different subsets of negatives were removed . Interestingly , we found that using only the hardest 5 % of negatives was largely sufficient to recover baseline accuracy ( Figure 2a-b , 95-100 % ) , suggesting that the overwhelming majority of the easier negatives were unnecessary . Moreover , the hardest 5 % ( 95-100 % ) were substantially more informative than the next 5 % ( 90-95 % ) : top-1 accuracy dropped by only 0.7 percentage points when trained on only the hardest 5 % vs. 15 percentage points for the next hardest 5 % ( 90-95 % ) and 47 percentage points for the third 5 % ( 85-90 % ; Figure 2a-b ) . Going forward , we use 5 % as a cutoff and call the negatives harder than this cutoff hard and those easier than this cutoff easy . The easy negatives are largely insufficient ; the hard negatives are necessary . We next asked whether the easy negatives were sufficient ( or , equivalently , whether the hard negatives were necessary ) . Although we found in the previous section that the easy negatives were unnecessary , that does not necessarily mean they are insufficient . For example , it could be that the easy negatives , while individually less important , collectively provide sufficient signal for learning good representations on the downstream task . Alternatively , it is possible that the information contained in all of the easy negatives still lacks enough signal ; in this case , the easy negatives , even when combined together , would still be insufficient . We found that even when the easiest 95 % of negatives were combined together , accuracy was 5.4 % below baseline ( Figure 2c-d ) . In contrast , recall that using only the hardest 5 % of negatives ( 19x fewer ) achieved top-1 performance within 0.7 % of baseline ( Figure 2a ) . Using the easiest 90 % of negatives harms accuracy even further ( 0-90 % ; Figure 2c-d ) . Together , these results demonstrate that the easiest negatives , even when they comprise the vast majority of negatives , are still insufficient . The very hardest negatives are harmful at lower temperatures . We have found that the hard negatives , i.e . the 5 % hardest , are largely necessary and sufficient for CID . However , top-1 accuracy actually improved slightly when we removed the very hardest 0.1 % of negatives ( p = 0.03 for an 2We removed sets of negatives by treating them as through they were not present in the queue . unpaired t-test ) .3 This effect was most pronounced at lower temperatures ( Figure 3 ) ; for example , at temperature 0.1 ( as opposed to baseline temperature 0.2 ) , training without the hardest 0.1 % of negatives improved downstream top-1 accuracy by 0.23 % ( p = 0.0003 ) and top-5 accuracy by 0.67 % . One might expect such a difference between temperatures because the hardest negatives are weighted more in the loss at lower temperatures . Interestingly , the effect was larger for top-5 accuracy than top-1 accuracy ( compare Figure 3b with 3a ) . One hypothesis for why the hardest negatives hurt is that because negatives are randomly sampled , some negatives can be too similar to the query ( e.g . augmentations of near-duplicates to the query ) . Because negatives are randomly sampled , they can included augmented views of images that are near-duplicates of the query or otherwise visually very similar to the query . If both the query and negative contain identical semantic content , the contrastive loss might rely on non-semantic features to distinguish between them , thus emphasizing these non-semantic features in the representation ( Figure 1 ) . These same-class negatives may thus be harmful to learning representations for downstream linear classification . If this is the case , we would expect that removing same class negatives would improve performance , perhaps even more than removing the hardest 0.1 % of negatives overall . As shown in Table 1 , removing same-class negatives indeed leads to slightly higher accuracy than removing the hardest 0.1 % of negatives . Removing only the subset of the hardest 0.1 % of negatives with the same class as the query accounts for all of the improvement from removing the hardest 0.1 % of negatives . Alternatively , removing only the subset of the 0.1 % hardest negatives with different classes shows no improvement over baseline and in fact decreases top-1 accuracy at low temperature . These results demonstrate that the accuracy benefit of removing the 0.1 % hardest negatives can entirely be accounted for by the fact that it removes many elements of the same class as the query , so that removing the 0.1 % hardest negatives approximates removing the same-class negatives without requiring access to privileged label data . This observation is also consistent with recent work which has attempted to “ debias ” contrastive learning away from same-class negatives ( Chuang et al. , 2020 ) .
This paper mainly studied how the negative samples can affect the model performance in supervised learning CIO works. Through the experiments, this work has a few interesting findings, including the majority of negative samples are not important for the model learning, only a small subset of hard samples determine the model importance. These hard examples are also closely related with positive samples (more semantically similar). We can see from experiments that it's very important to fairly treat negative samples in supervised learning tasks. However, there is no frameworks proposed to help improve the learning representation or speed up the training task.  In general, the readers are more interested in the solutions after realizing the importance of negative samples treatment during the experiments. It would be necessary to include the corresponding solutions by automatically setup these negatives samples in CID related task.
SP:857aa1392e6039808d27889d932d82ad756a12b6
Cross-model Back-translated Distillation for Unsupervised Machine Translation
1 INTRODUCTION . Machine translation ( MT ) is a core task in natural language processing that involves both language understanding and generation . Recent neural approaches ( Vaswani et al. , 2017 ; Wu et al. , 2019 ) have advanced the state of the art with near human-level performance ( Hassan et al. , 2018 ) . However , they continue to rely heavily on large parallel data . As a result , the search for unsupervised alternatives using only monolingual data has been active . While Ravi & Knight ( 2011 ) and Klementiev et al . ( 2012 ) proposed various unsupervised techniques for statistical MT ( SMT ) , Lample et al . ( 2018a ; c ) established a general framework for modern unsupervised MT ( UMT ) that works for both SMT and neural MT ( NMT ) models . The framework has three main principles : model initialization , language modeling and iterative back-translation . Model initialization bootstraps the model with a knowledge prior like word-level transfer ( Lample et al. , 2018b ) . Language modeling , which takes the form of denoising auto-encoding ( DAE ) in NMT ( Lample et al. , 2018c ) , trains the model to generate plausible sentences in a language . Meanwhile , iterative back-translation ( IBT ) facilitates cross-lingual translation training by generating noisy source sentences for original target sentences . The recent approaches differ on how they apply each of these three principles . For instance , Lample et al . ( 2018a ) use an unsupervised word-translation model ( Lample et al. , 2018b ) for model initialization , while Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) . In this paper , we focus on a different aspect of the UMT framework , namely , its data diversification2 process . If we look from this view , the DAE and IBT steps of the UMT framework also perform some form of data diversification to train the model . Specifically , the noise model in the DAE process generates new , but noised , versions of the input data , which are used to train the model with a reconstruction objective . Likewise , the IBT step involves the same UMT model to create synthetic parallel pairs ( with the source being synthetic ) , which are then used to train the model . Since the NMT model is updated with DAE and IBT simultaneously , the model generates fresh translations in each back-translation step . Overall , thanks to DAE and IBT , the model gets better at translating 1Anonymized code : https : //tinyurl.com/y2ru8res . 2By diversification , we mean sentence level variations ( not expanding to other topics or genres ) . by iteratively training on the newly created and diversified data whose quality also improves over time . This argument also applies to statistical UMT , except for the lack of the DAE ( Lample et al. , 2018c ) . However , we conjecture that these diversification methods may have reached their limit as the performance does not improve further the longer we train the UMT models . In this work , we introduce a fourth principle to the standard UMT framework : Cross-model Backtranslated Distillation or CBD ( §3 ) , with the aim to induce another level of diversification that the existing UMT principles lack . CBD initially trains two UMT agents ( models ) using existing approaches . Then , one of the two agents translates the monolingual data from one language s to another t in the first level . In the second level , the generated data are back-translated from t to s by the other agent . In the final step , the synthetic parallel data created by the first and second levels are used to distill a supervised MT model . CBD is applicable to any existing UMT method and is more efficient than ensembling approaches ( Freitag et al. , 2017 ) ( §5.3 ) . In the experiments ( §4 ) , we have evaluated CBD on the WMT ’ 14 English-French , WMT ’ 16 English-German and WMT ’ 16 English-Romanian unsupervised translation tasks . CBD shows consistent improvements of 1.0-2.0 BLEU compared to the baselines in these tasks . It also boosts the performance on IWSLT ’ 14 English-German and IWSLT ’ 13 English-French tasks significantly . In our analysis , we explain with experiments why other similar variants ( §5.1 ) and other alternatives from the literature ( §5.4 ) do not work well and cross-model back-translation is crucial for our method . We further demonstrate that CBD enhances the baselines by achieving greater diversity as measured by back-translation BLEU ( §5.2 ) . 2 BACKGROUND . Ravi & Knight ( 2011 ) were among the first to propose a UMT system by framing the problem as a decipherment task that considers non-English text as a cipher for English . Nonetheless , the method is limited and may not be applicable to the current well-established NMT systems ( Luong et al. , 2015 ; Vaswani et al. , 2017 ; Wu et al. , 2019 ) . Lample et al . ( 2018a ) set the foundation for modern UMT . They propose to maintain two encoder-decoder networks simultaneously for both source and target languages , and train them via denoising auto-encoding , iterative back-translation and adversarial training . In their follow-up work , Lample et al . ( 2018c ) formulate a common UMT framework for both PBSMT and NMT with three basic principles that can be customized . The three principles are : • Initialization : A non-randomized cross- or multi-lingual initialization that represents a knowledge prior to bootstrap the UMT model . For instance , Lample et al . ( 2018a ) and Artetxe et al . ( 2019 ) use an unsupervised word-translation model MUSE ( Lample et al. , 2018b ) as initialization to promote word-to-word cross-lingual transfer . Lample et al . ( 2018c ) use a shared jointly trained sub-word ( Sennrich et al. , 2016b ) dictionary . On the other hand , Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) to initialize the unsupervised NMT model . • Language modeling : Training a language model on monolingual data helps the UMT model to generate fluent texts . The neural UMT approaches ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) use denoising auto-encoder training to achieve language modeling effects in the neural model . Meanwhile , the PBSMT variant proposed by Lample et al . ( 2018c ) uses the KenLM smoothed n-gram language models ( Heafield , 2011 ) . • Iterative back-translation : Back-translation ( Sennrich et al. , 2016a ) brings about the bridge between source and target languages by using a backward model that translates data from target to source . The ( source and target ) monolingual data is translated back and forth iteratively to progress the UMT model in both directions . During training , the initialization step is conducted once , while the denoising and back-translation steps are often executed in an alternating manner.3 It is worth noting that depending on different implementations , the parameters for backward and forward components may be separate ( Lample et al. , 2018a ) or shared ( Lample et al. , 2018c ; Conneau & Lample , 2019 ) . A parameter-shared cross-lingual NMT model has the capability to translate from either source or target , while a UMT system with parameter-separate models has to maintain two models . Either way , we deem a standard UMT system to be bidirectional , i.e . it is capable of translating from either source or target language . 3The KenLM language model in PBSMT ( Lample et al. , 2018c ) was kept fixed during the training process . Our proposed cross-model back-translated distillation ( CBD ) works outside this well-established framework . It employs two UMT agents to create extra diversified data apart from what existing methods already offer , rendering it a useful add-on to the general UMT framework . Furthermore , different implementations of UMT as discussed above can be plugged into the CBD system to achieve a performance boost , even for future methods that may potentially not employ the three principles . 3 CROSS-MODEL BACK-TRANSLATED DISTILLATION . Let Xs and Xt be the sets of monolingual data for languages s and t , respectively . We first train two UMT agents independently with two different parameter sets θ1 and θ2 using existing methods ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) .4 Since a UMT agent with parameter set θ is deemed bidirectional in our setup , we denote yt ∼ P ( ·|xs , θ ) to be the translation sample from language s to t of input sentence xs using parameters θ . In addition , for each language direction s→ t ( and vice versa for t→ s ) , we introduce a supervised MT model with parameters θ̂ that will be trained through our CBD . With these notations , we denote the following training loss L with respect to input variables θα , θβ ∈ { θ1 , θ2 } , the supervised parameters θ̂ and the learning rate η . Figure 1 also illustrates the translation flows of function L. L ( θα , θβ , θ̂ ) = −Ezs∼P ( ·|yt , θβ ) , yt∼P ( ·|xs , θα ) , xs∼Xs [ logP ( yt|xs , θ̂ ) + logP ( yt|zs , θ̂ ) ] − Ezt∼P ( ·|ys , θβ ) , ys∼P ( ·|xt , θα ) , xt∼Xt [ logP ( xt|ys , θ̂ ) + logP ( zt|ys , θ̂ ) ] ( 1 ) In the CBD strategy ( Algorithm 1 , Eq . 1 ) , at each step , each agent θ ∈ { θ1 , θ2 } samples translations from the monolingual data of both languages s and t to acquire the first level of synthetic parallel data ( xs , yt ) and ( xt , ys ) . In the second level , the other agent { θ1 , θ2 } \ θ is used to sample the translation zs of the translation yt of xs ( and similarly for zt from the translation ys of xt ) . This process is basically back-translation , but with the backward model coming from a different regime than that of the forward model . The fact that the first level agent must be different from the second level agent is crucial to achieve the desirable level of diversity in data generation . After this , we update the final model θ̂ using all the synthetic pairs ( x , y ) and ( y , z ) with maximum likelihood estimation ( MLE ) . Algorithm 1 Cross-model Back-translated Distillation : Given monolingual data Xs and Xt of languages s and t , return a s→ t UMT model with parameters θ̂ . 1 : procedure CBD ( s , t ) 2 : Train the 1st UMT agent with parameters θ1 3 : Train the 2nd UMT agent with parameters θ2 4 : Randomly initialize the parameters for MT model , θ̂ 5 : while until convergence do 6 : θ̂ ← θ̂ − η∇θ̂L ( θ1 , θ2 , θ̂ ) 7 : θ̂ ← θ̂ − η∇θ̂L ( θ2 , θ1 , θ̂ ) 8 : return θ̂ In this way , the model θ̂ first gets trained on the translated products ( x − y ) of the UMT teachers , making it as capable as the teachers . Secondly , the model θ̂ is also trained on the second-level data ( y − z ) , which is slightly different from the first-level data . Thus , this mechanism provides extra data diversification to the system θ̂ in addition to what the UMT teachers already offer , resulting in our final model outperforming the UMT baselines ( §4 ) . However , one may argue that since θ1 and θ2 are trained in a similar fashion , z will be the same as x , resulting in a duplicate pair . In our experiments , on the contrary , the back-translated dataset contains only around 14 % duplicates across different language pairs , as shown in our analysis on data diversity in §5.2.In Appendix §8.1 , we provide a more generalized version of CBD with n ( ≥ 2 ) UMT agents , where we also analyze its effectiveness on the IWSLT translation tasks . 4For neural approaches , changing the random seeds would do the trick , while PBSMT methods would need to randomize the initial embeddings and/or subsample the training data .
In this paper, two unsupervised agents are utilized at cross-model by using the dual nature of the unsupervised machine translation model, in which forward translation of agent_1 is combined with the backward translation of agent_2, more synthetic translation pairs are obtained to train a new supervised machine translation model. The result is improved on multiple unsupervised machine translation, and this paper claims that more diversity is brought to the synthetic data, so a better translation model can be trained. This paper uses a reconstruction BLEU or BT BLEU [1] metric to compare the effect of the inside-model with that of cross-model, and finds that cross model translation has a lower back-translation effect, which shows that the diversity is enhanced. Furthermore, CBD is compared with the ensemble method and achieves better performance. The proposed method is quite simple yet effective, but it is also a kind of data enhancement.
SP:da47e8e2ec5533446d5f341b7e12afec02412473
Cross-model Back-translated Distillation for Unsupervised Machine Translation
1 INTRODUCTION . Machine translation ( MT ) is a core task in natural language processing that involves both language understanding and generation . Recent neural approaches ( Vaswani et al. , 2017 ; Wu et al. , 2019 ) have advanced the state of the art with near human-level performance ( Hassan et al. , 2018 ) . However , they continue to rely heavily on large parallel data . As a result , the search for unsupervised alternatives using only monolingual data has been active . While Ravi & Knight ( 2011 ) and Klementiev et al . ( 2012 ) proposed various unsupervised techniques for statistical MT ( SMT ) , Lample et al . ( 2018a ; c ) established a general framework for modern unsupervised MT ( UMT ) that works for both SMT and neural MT ( NMT ) models . The framework has three main principles : model initialization , language modeling and iterative back-translation . Model initialization bootstraps the model with a knowledge prior like word-level transfer ( Lample et al. , 2018b ) . Language modeling , which takes the form of denoising auto-encoding ( DAE ) in NMT ( Lample et al. , 2018c ) , trains the model to generate plausible sentences in a language . Meanwhile , iterative back-translation ( IBT ) facilitates cross-lingual translation training by generating noisy source sentences for original target sentences . The recent approaches differ on how they apply each of these three principles . For instance , Lample et al . ( 2018a ) use an unsupervised word-translation model ( Lample et al. , 2018b ) for model initialization , while Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) . In this paper , we focus on a different aspect of the UMT framework , namely , its data diversification2 process . If we look from this view , the DAE and IBT steps of the UMT framework also perform some form of data diversification to train the model . Specifically , the noise model in the DAE process generates new , but noised , versions of the input data , which are used to train the model with a reconstruction objective . Likewise , the IBT step involves the same UMT model to create synthetic parallel pairs ( with the source being synthetic ) , which are then used to train the model . Since the NMT model is updated with DAE and IBT simultaneously , the model generates fresh translations in each back-translation step . Overall , thanks to DAE and IBT , the model gets better at translating 1Anonymized code : https : //tinyurl.com/y2ru8res . 2By diversification , we mean sentence level variations ( not expanding to other topics or genres ) . by iteratively training on the newly created and diversified data whose quality also improves over time . This argument also applies to statistical UMT , except for the lack of the DAE ( Lample et al. , 2018c ) . However , we conjecture that these diversification methods may have reached their limit as the performance does not improve further the longer we train the UMT models . In this work , we introduce a fourth principle to the standard UMT framework : Cross-model Backtranslated Distillation or CBD ( §3 ) , with the aim to induce another level of diversification that the existing UMT principles lack . CBD initially trains two UMT agents ( models ) using existing approaches . Then , one of the two agents translates the monolingual data from one language s to another t in the first level . In the second level , the generated data are back-translated from t to s by the other agent . In the final step , the synthetic parallel data created by the first and second levels are used to distill a supervised MT model . CBD is applicable to any existing UMT method and is more efficient than ensembling approaches ( Freitag et al. , 2017 ) ( §5.3 ) . In the experiments ( §4 ) , we have evaluated CBD on the WMT ’ 14 English-French , WMT ’ 16 English-German and WMT ’ 16 English-Romanian unsupervised translation tasks . CBD shows consistent improvements of 1.0-2.0 BLEU compared to the baselines in these tasks . It also boosts the performance on IWSLT ’ 14 English-German and IWSLT ’ 13 English-French tasks significantly . In our analysis , we explain with experiments why other similar variants ( §5.1 ) and other alternatives from the literature ( §5.4 ) do not work well and cross-model back-translation is crucial for our method . We further demonstrate that CBD enhances the baselines by achieving greater diversity as measured by back-translation BLEU ( §5.2 ) . 2 BACKGROUND . Ravi & Knight ( 2011 ) were among the first to propose a UMT system by framing the problem as a decipherment task that considers non-English text as a cipher for English . Nonetheless , the method is limited and may not be applicable to the current well-established NMT systems ( Luong et al. , 2015 ; Vaswani et al. , 2017 ; Wu et al. , 2019 ) . Lample et al . ( 2018a ) set the foundation for modern UMT . They propose to maintain two encoder-decoder networks simultaneously for both source and target languages , and train them via denoising auto-encoding , iterative back-translation and adversarial training . In their follow-up work , Lample et al . ( 2018c ) formulate a common UMT framework for both PBSMT and NMT with three basic principles that can be customized . The three principles are : • Initialization : A non-randomized cross- or multi-lingual initialization that represents a knowledge prior to bootstrap the UMT model . For instance , Lample et al . ( 2018a ) and Artetxe et al . ( 2019 ) use an unsupervised word-translation model MUSE ( Lample et al. , 2018b ) as initialization to promote word-to-word cross-lingual transfer . Lample et al . ( 2018c ) use a shared jointly trained sub-word ( Sennrich et al. , 2016b ) dictionary . On the other hand , Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) to initialize the unsupervised NMT model . • Language modeling : Training a language model on monolingual data helps the UMT model to generate fluent texts . The neural UMT approaches ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) use denoising auto-encoder training to achieve language modeling effects in the neural model . Meanwhile , the PBSMT variant proposed by Lample et al . ( 2018c ) uses the KenLM smoothed n-gram language models ( Heafield , 2011 ) . • Iterative back-translation : Back-translation ( Sennrich et al. , 2016a ) brings about the bridge between source and target languages by using a backward model that translates data from target to source . The ( source and target ) monolingual data is translated back and forth iteratively to progress the UMT model in both directions . During training , the initialization step is conducted once , while the denoising and back-translation steps are often executed in an alternating manner.3 It is worth noting that depending on different implementations , the parameters for backward and forward components may be separate ( Lample et al. , 2018a ) or shared ( Lample et al. , 2018c ; Conneau & Lample , 2019 ) . A parameter-shared cross-lingual NMT model has the capability to translate from either source or target , while a UMT system with parameter-separate models has to maintain two models . Either way , we deem a standard UMT system to be bidirectional , i.e . it is capable of translating from either source or target language . 3The KenLM language model in PBSMT ( Lample et al. , 2018c ) was kept fixed during the training process . Our proposed cross-model back-translated distillation ( CBD ) works outside this well-established framework . It employs two UMT agents to create extra diversified data apart from what existing methods already offer , rendering it a useful add-on to the general UMT framework . Furthermore , different implementations of UMT as discussed above can be plugged into the CBD system to achieve a performance boost , even for future methods that may potentially not employ the three principles . 3 CROSS-MODEL BACK-TRANSLATED DISTILLATION . Let Xs and Xt be the sets of monolingual data for languages s and t , respectively . We first train two UMT agents independently with two different parameter sets θ1 and θ2 using existing methods ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) .4 Since a UMT agent with parameter set θ is deemed bidirectional in our setup , we denote yt ∼ P ( ·|xs , θ ) to be the translation sample from language s to t of input sentence xs using parameters θ . In addition , for each language direction s→ t ( and vice versa for t→ s ) , we introduce a supervised MT model with parameters θ̂ that will be trained through our CBD . With these notations , we denote the following training loss L with respect to input variables θα , θβ ∈ { θ1 , θ2 } , the supervised parameters θ̂ and the learning rate η . Figure 1 also illustrates the translation flows of function L. L ( θα , θβ , θ̂ ) = −Ezs∼P ( ·|yt , θβ ) , yt∼P ( ·|xs , θα ) , xs∼Xs [ logP ( yt|xs , θ̂ ) + logP ( yt|zs , θ̂ ) ] − Ezt∼P ( ·|ys , θβ ) , ys∼P ( ·|xt , θα ) , xt∼Xt [ logP ( xt|ys , θ̂ ) + logP ( zt|ys , θ̂ ) ] ( 1 ) In the CBD strategy ( Algorithm 1 , Eq . 1 ) , at each step , each agent θ ∈ { θ1 , θ2 } samples translations from the monolingual data of both languages s and t to acquire the first level of synthetic parallel data ( xs , yt ) and ( xt , ys ) . In the second level , the other agent { θ1 , θ2 } \ θ is used to sample the translation zs of the translation yt of xs ( and similarly for zt from the translation ys of xt ) . This process is basically back-translation , but with the backward model coming from a different regime than that of the forward model . The fact that the first level agent must be different from the second level agent is crucial to achieve the desirable level of diversity in data generation . After this , we update the final model θ̂ using all the synthetic pairs ( x , y ) and ( y , z ) with maximum likelihood estimation ( MLE ) . Algorithm 1 Cross-model Back-translated Distillation : Given monolingual data Xs and Xt of languages s and t , return a s→ t UMT model with parameters θ̂ . 1 : procedure CBD ( s , t ) 2 : Train the 1st UMT agent with parameters θ1 3 : Train the 2nd UMT agent with parameters θ2 4 : Randomly initialize the parameters for MT model , θ̂ 5 : while until convergence do 6 : θ̂ ← θ̂ − η∇θ̂L ( θ1 , θ2 , θ̂ ) 7 : θ̂ ← θ̂ − η∇θ̂L ( θ2 , θ1 , θ̂ ) 8 : return θ̂ In this way , the model θ̂ first gets trained on the translated products ( x − y ) of the UMT teachers , making it as capable as the teachers . Secondly , the model θ̂ is also trained on the second-level data ( y − z ) , which is slightly different from the first-level data . Thus , this mechanism provides extra data diversification to the system θ̂ in addition to what the UMT teachers already offer , resulting in our final model outperforming the UMT baselines ( §4 ) . However , one may argue that since θ1 and θ2 are trained in a similar fashion , z will be the same as x , resulting in a duplicate pair . In our experiments , on the contrary , the back-translated dataset contains only around 14 % duplicates across different language pairs , as shown in our analysis on data diversity in §5.2.In Appendix §8.1 , we provide a more generalized version of CBD with n ( ≥ 2 ) UMT agents , where we also analyze its effectiveness on the IWSLT translation tasks . 4For neural approaches , changing the random seeds would do the trick , while PBSMT methods would need to randomize the initial embeddings and/or subsample the training data .
The paper proposes an additional stage of training for unsupervised NMT models utilizing synthetic data generated from multiple independently trained models. The generated synthetic data uses two stages of back-translation, with different models, in order to "diversify" the set of training data used for fine-tuning the models. This is similar to the approach in [1], but uses an additional stage of back-translation with a different model. The authors add this additional stage of training to unsupervised NMT models using different pipelines (PB unsupervised MT, Neural Unsupervised MT, XLM) and show that their approach improves all of these approaches by 1.5-2 Bleu on WMT En-Fr, De-En and En-Ro.
SP:da47e8e2ec5533446d5f341b7e12afec02412473
Cross-model Back-translated Distillation for Unsupervised Machine Translation
1 INTRODUCTION . Machine translation ( MT ) is a core task in natural language processing that involves both language understanding and generation . Recent neural approaches ( Vaswani et al. , 2017 ; Wu et al. , 2019 ) have advanced the state of the art with near human-level performance ( Hassan et al. , 2018 ) . However , they continue to rely heavily on large parallel data . As a result , the search for unsupervised alternatives using only monolingual data has been active . While Ravi & Knight ( 2011 ) and Klementiev et al . ( 2012 ) proposed various unsupervised techniques for statistical MT ( SMT ) , Lample et al . ( 2018a ; c ) established a general framework for modern unsupervised MT ( UMT ) that works for both SMT and neural MT ( NMT ) models . The framework has three main principles : model initialization , language modeling and iterative back-translation . Model initialization bootstraps the model with a knowledge prior like word-level transfer ( Lample et al. , 2018b ) . Language modeling , which takes the form of denoising auto-encoding ( DAE ) in NMT ( Lample et al. , 2018c ) , trains the model to generate plausible sentences in a language . Meanwhile , iterative back-translation ( IBT ) facilitates cross-lingual translation training by generating noisy source sentences for original target sentences . The recent approaches differ on how they apply each of these three principles . For instance , Lample et al . ( 2018a ) use an unsupervised word-translation model ( Lample et al. , 2018b ) for model initialization , while Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) . In this paper , we focus on a different aspect of the UMT framework , namely , its data diversification2 process . If we look from this view , the DAE and IBT steps of the UMT framework also perform some form of data diversification to train the model . Specifically , the noise model in the DAE process generates new , but noised , versions of the input data , which are used to train the model with a reconstruction objective . Likewise , the IBT step involves the same UMT model to create synthetic parallel pairs ( with the source being synthetic ) , which are then used to train the model . Since the NMT model is updated with DAE and IBT simultaneously , the model generates fresh translations in each back-translation step . Overall , thanks to DAE and IBT , the model gets better at translating 1Anonymized code : https : //tinyurl.com/y2ru8res . 2By diversification , we mean sentence level variations ( not expanding to other topics or genres ) . by iteratively training on the newly created and diversified data whose quality also improves over time . This argument also applies to statistical UMT , except for the lack of the DAE ( Lample et al. , 2018c ) . However , we conjecture that these diversification methods may have reached their limit as the performance does not improve further the longer we train the UMT models . In this work , we introduce a fourth principle to the standard UMT framework : Cross-model Backtranslated Distillation or CBD ( §3 ) , with the aim to induce another level of diversification that the existing UMT principles lack . CBD initially trains two UMT agents ( models ) using existing approaches . Then , one of the two agents translates the monolingual data from one language s to another t in the first level . In the second level , the generated data are back-translated from t to s by the other agent . In the final step , the synthetic parallel data created by the first and second levels are used to distill a supervised MT model . CBD is applicable to any existing UMT method and is more efficient than ensembling approaches ( Freitag et al. , 2017 ) ( §5.3 ) . In the experiments ( §4 ) , we have evaluated CBD on the WMT ’ 14 English-French , WMT ’ 16 English-German and WMT ’ 16 English-Romanian unsupervised translation tasks . CBD shows consistent improvements of 1.0-2.0 BLEU compared to the baselines in these tasks . It also boosts the performance on IWSLT ’ 14 English-German and IWSLT ’ 13 English-French tasks significantly . In our analysis , we explain with experiments why other similar variants ( §5.1 ) and other alternatives from the literature ( §5.4 ) do not work well and cross-model back-translation is crucial for our method . We further demonstrate that CBD enhances the baselines by achieving greater diversity as measured by back-translation BLEU ( §5.2 ) . 2 BACKGROUND . Ravi & Knight ( 2011 ) were among the first to propose a UMT system by framing the problem as a decipherment task that considers non-English text as a cipher for English . Nonetheless , the method is limited and may not be applicable to the current well-established NMT systems ( Luong et al. , 2015 ; Vaswani et al. , 2017 ; Wu et al. , 2019 ) . Lample et al . ( 2018a ) set the foundation for modern UMT . They propose to maintain two encoder-decoder networks simultaneously for both source and target languages , and train them via denoising auto-encoding , iterative back-translation and adversarial training . In their follow-up work , Lample et al . ( 2018c ) formulate a common UMT framework for both PBSMT and NMT with three basic principles that can be customized . The three principles are : • Initialization : A non-randomized cross- or multi-lingual initialization that represents a knowledge prior to bootstrap the UMT model . For instance , Lample et al . ( 2018a ) and Artetxe et al . ( 2019 ) use an unsupervised word-translation model MUSE ( Lample et al. , 2018b ) as initialization to promote word-to-word cross-lingual transfer . Lample et al . ( 2018c ) use a shared jointly trained sub-word ( Sennrich et al. , 2016b ) dictionary . On the other hand , Conneau & Lample ( 2019 ) use a pretrained cross-lingual masked language model ( XLM ) to initialize the unsupervised NMT model . • Language modeling : Training a language model on monolingual data helps the UMT model to generate fluent texts . The neural UMT approaches ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) use denoising auto-encoder training to achieve language modeling effects in the neural model . Meanwhile , the PBSMT variant proposed by Lample et al . ( 2018c ) uses the KenLM smoothed n-gram language models ( Heafield , 2011 ) . • Iterative back-translation : Back-translation ( Sennrich et al. , 2016a ) brings about the bridge between source and target languages by using a backward model that translates data from target to source . The ( source and target ) monolingual data is translated back and forth iteratively to progress the UMT model in both directions . During training , the initialization step is conducted once , while the denoising and back-translation steps are often executed in an alternating manner.3 It is worth noting that depending on different implementations , the parameters for backward and forward components may be separate ( Lample et al. , 2018a ) or shared ( Lample et al. , 2018c ; Conneau & Lample , 2019 ) . A parameter-shared cross-lingual NMT model has the capability to translate from either source or target , while a UMT system with parameter-separate models has to maintain two models . Either way , we deem a standard UMT system to be bidirectional , i.e . it is capable of translating from either source or target language . 3The KenLM language model in PBSMT ( Lample et al. , 2018c ) was kept fixed during the training process . Our proposed cross-model back-translated distillation ( CBD ) works outside this well-established framework . It employs two UMT agents to create extra diversified data apart from what existing methods already offer , rendering it a useful add-on to the general UMT framework . Furthermore , different implementations of UMT as discussed above can be plugged into the CBD system to achieve a performance boost , even for future methods that may potentially not employ the three principles . 3 CROSS-MODEL BACK-TRANSLATED DISTILLATION . Let Xs and Xt be the sets of monolingual data for languages s and t , respectively . We first train two UMT agents independently with two different parameter sets θ1 and θ2 using existing methods ( Lample et al. , 2018a ; c ; Conneau & Lample , 2019 ) .4 Since a UMT agent with parameter set θ is deemed bidirectional in our setup , we denote yt ∼ P ( ·|xs , θ ) to be the translation sample from language s to t of input sentence xs using parameters θ . In addition , for each language direction s→ t ( and vice versa for t→ s ) , we introduce a supervised MT model with parameters θ̂ that will be trained through our CBD . With these notations , we denote the following training loss L with respect to input variables θα , θβ ∈ { θ1 , θ2 } , the supervised parameters θ̂ and the learning rate η . Figure 1 also illustrates the translation flows of function L. L ( θα , θβ , θ̂ ) = −Ezs∼P ( ·|yt , θβ ) , yt∼P ( ·|xs , θα ) , xs∼Xs [ logP ( yt|xs , θ̂ ) + logP ( yt|zs , θ̂ ) ] − Ezt∼P ( ·|ys , θβ ) , ys∼P ( ·|xt , θα ) , xt∼Xt [ logP ( xt|ys , θ̂ ) + logP ( zt|ys , θ̂ ) ] ( 1 ) In the CBD strategy ( Algorithm 1 , Eq . 1 ) , at each step , each agent θ ∈ { θ1 , θ2 } samples translations from the monolingual data of both languages s and t to acquire the first level of synthetic parallel data ( xs , yt ) and ( xt , ys ) . In the second level , the other agent { θ1 , θ2 } \ θ is used to sample the translation zs of the translation yt of xs ( and similarly for zt from the translation ys of xt ) . This process is basically back-translation , but with the backward model coming from a different regime than that of the forward model . The fact that the first level agent must be different from the second level agent is crucial to achieve the desirable level of diversity in data generation . After this , we update the final model θ̂ using all the synthetic pairs ( x , y ) and ( y , z ) with maximum likelihood estimation ( MLE ) . Algorithm 1 Cross-model Back-translated Distillation : Given monolingual data Xs and Xt of languages s and t , return a s→ t UMT model with parameters θ̂ . 1 : procedure CBD ( s , t ) 2 : Train the 1st UMT agent with parameters θ1 3 : Train the 2nd UMT agent with parameters θ2 4 : Randomly initialize the parameters for MT model , θ̂ 5 : while until convergence do 6 : θ̂ ← θ̂ − η∇θ̂L ( θ1 , θ2 , θ̂ ) 7 : θ̂ ← θ̂ − η∇θ̂L ( θ2 , θ1 , θ̂ ) 8 : return θ̂ In this way , the model θ̂ first gets trained on the translated products ( x − y ) of the UMT teachers , making it as capable as the teachers . Secondly , the model θ̂ is also trained on the second-level data ( y − z ) , which is slightly different from the first-level data . Thus , this mechanism provides extra data diversification to the system θ̂ in addition to what the UMT teachers already offer , resulting in our final model outperforming the UMT baselines ( §4 ) . However , one may argue that since θ1 and θ2 are trained in a similar fashion , z will be the same as x , resulting in a duplicate pair . In our experiments , on the contrary , the back-translated dataset contains only around 14 % duplicates across different language pairs , as shown in our analysis on data diversity in §5.2.In Appendix §8.1 , we provide a more generalized version of CBD with n ( ≥ 2 ) UMT agents , where we also analyze its effectiveness on the IWSLT translation tasks . 4For neural approaches , changing the random seeds would do the trick , while PBSMT methods would need to randomize the initial embeddings and/or subsample the training data .
This paper describes a method to enhance unsupervised machine translation through data augmentation. The idea is pretty straight-forward, if not altogether intuitive, you begin by training two bidirectional (i.e.: they can translate source to target and target to source) unsupervised MT systems A and B. The tested scenarios always have A and B be identical architectures trained with different initializations. They then produce synthetic source-target pairs by first having A (source->target) translate the provided source sentence x to y, and then having B (target->source) translate y back to z. They then train supervised MT on both x,y and z,y. The same procedure can be repeated with source and target reversed. The authors show substantial (1-2) BLEU improvements with 3 different UMT systems in 5 low-data scenarios (En-Fr, Fr-En, En-De, En-Ro, Ro-En), all subsampled to 5M monolingual sentences for each language. In En-Fr and Fr-En and En-De, they are able to match reported XLM results from Conneau and Lample 2019, despite using much less data.
SP:da47e8e2ec5533446d5f341b7e12afec02412473
A Critique of Self-Expressive Deep Subspace Clustering
1 INTRODUCTION AND BACKGROUND . Subspace clustering is a classical unsupervised learning problem , where one wishes to segment a given dataset into a prescribed number of clusters , and each cluster is defined as a linear ( or affine ) subspace with dimension lower than the ambient space . There have been a wide variety of approaches proposed in the literature to solve this problem ( Vidal et al. , 2016 ) , but a large family of state-of-the-art approaches are based on exploiting the self-expressive property of linear subspaces . That is , if a point lies in a linear subspace , then it can be represented as a linear combination of other points within the subspace . Based on this fact , a wide variety of methods have been proposed which , given a dataset Z ∈ Rd×N of N d-dimensional points , find a matrix of coefficients C ∈ RN×N by solving the problem : min C∈RN×N { F ( Z , C ) ≡ 1 2 ‖ZC− Z‖2F + λθ ( C ) = 1 2 〈Z > Z , ( C− I ) ( C− I ) > 〉+ λθ ( C ) } . ( 1 ) Here , the first term ‖ZC − C‖2F captures the self-expressive property by requiring every datapoint to represent itself as an approximate linear combination of other points , i.e. , Zi ≈ ZCi , where Zi and Ci are the ith columns of Z and C , respectively . The second term , θ ( C ) , is some regularization function designed to encourage each data point to only select other points within the correct subspace in its representation and to avoid trivial solutions ( such as C = I ) . Once the C matrix has been solved for , one can then define a graph affinity between data points , typically based on the magnitudes of the entries of C , and use an appropriate graph-based clustering method ( e.g. , spectral clustering ( von Luxburg , 2007 ) ) to produce the final clustering of the data points . One of the first methods to utilize this approach was Sparse Subspace Clustering ( SSC ) ( Elhamifar & Vidal , 2009 ; 2013 ) , where θ takes the form θSSC ( C ) = ‖C‖1 + δ ( diag ( C ) = 0 ) , with ‖ · ‖1 denoting the ` 1 norm and δ an indicator function which takes value∞ if an element of the diagonal of C is non-zero and 0 otherwise . By regularizing C to be sparse , a point must represent itself using the smallest number of other points within the dataset , which in turn ideally requires a point to only select other points within its own subspace in the representation . Likewise other variants , with Low-Rank Representation ( LRR ) ( Liu et al. , 2013 ) , Low-Rank Subspace Clustering ( LRSC ) ( Vidal & Favaro , 2014 ) and Elastic-net Subspace Clustering ( EnSC ) ( You et al. , 2016 ) being wellknown examples , take the same form as ( 1 ) with different choices of regularization . For example , θLRR ( C ) = ‖C‖∗ and θEnSC ( C ) = ‖C‖1 + τ‖C‖2F + δ ( diag ( C ) = 0 ) , where ‖ · ‖∗ denotes the nuclear norm ( sum of the singular values ) . A significant advantage of the majority of these methods is that it can be proven ( typically subject to some technical assumptions regarding the angles between the underlying subspaces and the distribution of the sampled data points within the subspaces ) that the optimal C matrix in ( 1 ) will be “ correct ” in the sense that if Ci , j is non-zero then the ith and jth columns of Z lie in the same linear subspace ( Soltanolkotabi & Candès , 2012 ; Lu et al. , 2012 ; Elhamifar & Vidal , 2013 ; Soltanolkotabi et al. , 2014 ; Wang et al. , 2015 ; Wang & Xu , 2016 ; You & Vidal , 2015a ; b ; Yang et al. , 2016 ; Tsakiris & Vidal , 2018 ; Li et al. , 2018 ; You et al. , 2019 ; Robinson et al. , 2019 ) , which has led to these methods achieving state-of-the-art performance in many applications . 1.1 SELF-EXPRESSIVE DEEP SUBSPACE CLUSTERING . Although subspace clustering techniques based on self-expression display strong empirical performance and provide theoretical guarantees , a significant limitation of these techniques is the requirement that the underlying dataset needs to be approximately supported on a union of linear subspaces . This has led to a strong motivation to extend these techniques to more general datasets , such as data supported on a union of non-linear low-dimensional manifolds . From inspection of the right side of ( 1 ) , one can observe that the only dependence on the data Z comes in the form of the Gram matrix Z > Z . As a result , self-expressive subspace clustering techniques are amendable to the “ kerneltrick ” , where instead of taking an inner product kernel between data points , one can instead use a general kernel κ ( · , · ) ( Patel & Vidal , 2014 ) . Of course , such an approach comes with the traditional challenge of how to select an appropriate kernel so that the embedding of the data in the Hilbert space associated with the choice of kernel results in a union of linear subspaces . The first approach to propose learning an appropriate embedding of an initial dataset X ∈ Rdx×N ( which does not necessarily have a union of subspaces structure ) was given by Patel et al . ( 2013 ; 2015 ) who proposed first projecting the data into a lower dimensional space via a learned linear projector , Z = PlX , where Pl ∈ Rd×dx ( d < dx ) is also optimized over in addition to C in ( 1 ) . To ensure that sufficient information about the original data X is preserved in the low-dimensional embedding Z , the authors further required that the linear projector satisfy the constraint that PlP > l = I and added an additional term to the objective with form ‖X−P > l PlX‖2F . However , since the projector is linear , the approach is not well suited for nonlinear manifolds , unless it is augmented with a kernel embedding , which again requires choosing a suitable kernel . More recently , given the success of deep neural networks , a large number of studies Peng et al . ( 2017 ) ; Ji et al . ( 2017 ) ; Zeng et al . ( 2019b ; a ) ; Xie et al . ( 2020 ) ; Sun et al . ( 2019 ) ; Li et al . ( 2019 ) ; Yang et al . ( 2019 ) ; Jiang et al . ( 2019 ) ; Tang et al . ( 2018 ) ; Kheirandishfard et al . ( 2020b ) ; Zhou et al . ( 2019 ) ; Jiang et al . ( 2018 ) ; Abavisani & Patel ( 2018 ) ; Zhou et al . ( 2018 ) ; Zhang et al . ( 2018 ; 2019b ; a ) ; Kheirandishfard et al . ( 2020a ) have attempted to learn an appropriate embedding of the data ( which ideally would have a union of linear subspaces structure ) via a neural network , ΦE ( X , We ) , whereWe denotes the parameters of a network mapping defined by ΦE , which takes a dataset X ∈ Rdx×N as input . In an attempt to encourage the embedding of the data , ΦE ( X , We ) , to have this union of subspaces structure , these approaches minimize a self-expressive loss term , with form given in ( 1 ) , on the embedded data , and a large majority of these proposed techniques can be described by the general form : min We , C γF ( Z , C ) + g ( Z , X , C ) subject to Z = ΦE ( X , We ) ( 2 ) where g is some function designed to discourage trivial solutions ( for example ΦE ( X , We ) = 0 ) and γ > 0 is some hyper-parameter to balance the terms . Several different choices of g have been proposed in the literature . The first is to place some form of normalization directly on Z . For example , Peng et al . ( 2017 ) propose an Instance Normalization regularization , g ( Z , X , C ) = ∑N i=1 ( Z > i Zi − 1 ) 2 , which attempts to constrain the norm of the embedded data points to be 1 . Likewise , one could also consider Dataset Normalization schemes , which bound the norm of the entire embedded representation ‖Z‖2F ≥ τ or Channel/Batch Normalization schemes , which bound the norm of a channel of the embedded representation ( i.e. , a row of Z ) , ‖Zi‖2F ≥ τ , ∀i . We note that this is quite similar to the common Batch Norm operator ( Ioffe & Szegedy , 2015 ) used in neural network training which attempts to constrain each row of Z to have zero mean and constant norm . Another popular form of g is to also train a decoding network ΦD ( · , Wd ) with parameters Wd to map the self-expressive representation , ΦE ( X , We ) C , back to the original data to ensure that sufficient information is preserved in the self-expressive representation to recover the original data . We will refer to this as Autoencoder Regularization . This idea is essentially a generalization of the previously discussed work , which considered constrained linear encoder/decoder mappings ( Patel et al. , 2013 ; Patel & Vidal , 2014 ; Patel et al. , 2015 ) , to non-linear autoencodering neural networks and was first proposed by the authors of Ji et al . ( 2017 ) . The problem takes the general form : min We , Wd , C γF ( Z , C ) + ` ( X , ΦD ( ZC , Wd ) ) subject to Z = ΦE ( X , We ) , ( 3 ) where the first term is the standard self-expressive subspace clustering loss applied to the embedded representation , and the second term is a standard auto-encoder loss , with ` typically chosen to be the squared loss . Note that here both the encoding/decoding network and the optimal self-expression encoding , C , are trained jointly , and once problem ( 3 ) is solved one can use the recovered C matrix directly for clustering . Using the general formulation in ( 2 ) and the popular specific case in ( 3 ) , Self-Expressive Deep Subspace Clustering ( SEDSC ) has been applied to a variety of applications , but there is relatively little that it known about it from a theoretical standpoint . Initial formulations for SEDSC were guided by the intuition that if the dataset is drawn from a union of linear subspaces , then solving problem ( 1 ) is known to induce desirable properties in C for clustering . By extension one might assume that if one also optimizes over the geometry of the learned embedding ( Z ) this objective might induce a desirable geometry in the embedded space ( e.g. , a union of linear subspaces ) . However , a vast majority of the prior theoretical analysis for problems of the form in ( 1 ) only considers the case where the data is held fixed and analyzes the properties of the optimal C matrix . Due to the well-known fact that neural networks are capable of producing highly-expressive mapping functions ( and hence a network could produce many potential values for Z ) , the use of a model such as ( 2 ) / ( 3 ) is essentially using ( 1 ) as a regularization function on Z to encourage a union of subspaces geometry . To date , however , models such as ( 2 ) / ( 3 ) have been guided largely by intuition and significant questions remain regarding what type of data geometry is encouraged by F ( Z , C ) when one optimizes over both the encoding matrix , C , and the network producing the embedded data representation , Z .
This paper studies the flaws associated with extending subspace clustering methods to the nonlinear manifolds scenario. In particular, the authors demonstrate that the optimization problem solved due to the extension can be ill-posed and thus lead to solutions which are degenerate/trivial in nature. The paper also showed that the performance benefits often associated with the Self-Expressive Deep Subspace Clustering techniques are potentially due to post-processing steps and other factors rather than due to the efficacy of these methods themselves.
SP:6ceb9378033da5eab4af5ebe84e1f9f5b99b4c38
A Critique of Self-Expressive Deep Subspace Clustering
1 INTRODUCTION AND BACKGROUND . Subspace clustering is a classical unsupervised learning problem , where one wishes to segment a given dataset into a prescribed number of clusters , and each cluster is defined as a linear ( or affine ) subspace with dimension lower than the ambient space . There have been a wide variety of approaches proposed in the literature to solve this problem ( Vidal et al. , 2016 ) , but a large family of state-of-the-art approaches are based on exploiting the self-expressive property of linear subspaces . That is , if a point lies in a linear subspace , then it can be represented as a linear combination of other points within the subspace . Based on this fact , a wide variety of methods have been proposed which , given a dataset Z ∈ Rd×N of N d-dimensional points , find a matrix of coefficients C ∈ RN×N by solving the problem : min C∈RN×N { F ( Z , C ) ≡ 1 2 ‖ZC− Z‖2F + λθ ( C ) = 1 2 〈Z > Z , ( C− I ) ( C− I ) > 〉+ λθ ( C ) } . ( 1 ) Here , the first term ‖ZC − C‖2F captures the self-expressive property by requiring every datapoint to represent itself as an approximate linear combination of other points , i.e. , Zi ≈ ZCi , where Zi and Ci are the ith columns of Z and C , respectively . The second term , θ ( C ) , is some regularization function designed to encourage each data point to only select other points within the correct subspace in its representation and to avoid trivial solutions ( such as C = I ) . Once the C matrix has been solved for , one can then define a graph affinity between data points , typically based on the magnitudes of the entries of C , and use an appropriate graph-based clustering method ( e.g. , spectral clustering ( von Luxburg , 2007 ) ) to produce the final clustering of the data points . One of the first methods to utilize this approach was Sparse Subspace Clustering ( SSC ) ( Elhamifar & Vidal , 2009 ; 2013 ) , where θ takes the form θSSC ( C ) = ‖C‖1 + δ ( diag ( C ) = 0 ) , with ‖ · ‖1 denoting the ` 1 norm and δ an indicator function which takes value∞ if an element of the diagonal of C is non-zero and 0 otherwise . By regularizing C to be sparse , a point must represent itself using the smallest number of other points within the dataset , which in turn ideally requires a point to only select other points within its own subspace in the representation . Likewise other variants , with Low-Rank Representation ( LRR ) ( Liu et al. , 2013 ) , Low-Rank Subspace Clustering ( LRSC ) ( Vidal & Favaro , 2014 ) and Elastic-net Subspace Clustering ( EnSC ) ( You et al. , 2016 ) being wellknown examples , take the same form as ( 1 ) with different choices of regularization . For example , θLRR ( C ) = ‖C‖∗ and θEnSC ( C ) = ‖C‖1 + τ‖C‖2F + δ ( diag ( C ) = 0 ) , where ‖ · ‖∗ denotes the nuclear norm ( sum of the singular values ) . A significant advantage of the majority of these methods is that it can be proven ( typically subject to some technical assumptions regarding the angles between the underlying subspaces and the distribution of the sampled data points within the subspaces ) that the optimal C matrix in ( 1 ) will be “ correct ” in the sense that if Ci , j is non-zero then the ith and jth columns of Z lie in the same linear subspace ( Soltanolkotabi & Candès , 2012 ; Lu et al. , 2012 ; Elhamifar & Vidal , 2013 ; Soltanolkotabi et al. , 2014 ; Wang et al. , 2015 ; Wang & Xu , 2016 ; You & Vidal , 2015a ; b ; Yang et al. , 2016 ; Tsakiris & Vidal , 2018 ; Li et al. , 2018 ; You et al. , 2019 ; Robinson et al. , 2019 ) , which has led to these methods achieving state-of-the-art performance in many applications . 1.1 SELF-EXPRESSIVE DEEP SUBSPACE CLUSTERING . Although subspace clustering techniques based on self-expression display strong empirical performance and provide theoretical guarantees , a significant limitation of these techniques is the requirement that the underlying dataset needs to be approximately supported on a union of linear subspaces . This has led to a strong motivation to extend these techniques to more general datasets , such as data supported on a union of non-linear low-dimensional manifolds . From inspection of the right side of ( 1 ) , one can observe that the only dependence on the data Z comes in the form of the Gram matrix Z > Z . As a result , self-expressive subspace clustering techniques are amendable to the “ kerneltrick ” , where instead of taking an inner product kernel between data points , one can instead use a general kernel κ ( · , · ) ( Patel & Vidal , 2014 ) . Of course , such an approach comes with the traditional challenge of how to select an appropriate kernel so that the embedding of the data in the Hilbert space associated with the choice of kernel results in a union of linear subspaces . The first approach to propose learning an appropriate embedding of an initial dataset X ∈ Rdx×N ( which does not necessarily have a union of subspaces structure ) was given by Patel et al . ( 2013 ; 2015 ) who proposed first projecting the data into a lower dimensional space via a learned linear projector , Z = PlX , where Pl ∈ Rd×dx ( d < dx ) is also optimized over in addition to C in ( 1 ) . To ensure that sufficient information about the original data X is preserved in the low-dimensional embedding Z , the authors further required that the linear projector satisfy the constraint that PlP > l = I and added an additional term to the objective with form ‖X−P > l PlX‖2F . However , since the projector is linear , the approach is not well suited for nonlinear manifolds , unless it is augmented with a kernel embedding , which again requires choosing a suitable kernel . More recently , given the success of deep neural networks , a large number of studies Peng et al . ( 2017 ) ; Ji et al . ( 2017 ) ; Zeng et al . ( 2019b ; a ) ; Xie et al . ( 2020 ) ; Sun et al . ( 2019 ) ; Li et al . ( 2019 ) ; Yang et al . ( 2019 ) ; Jiang et al . ( 2019 ) ; Tang et al . ( 2018 ) ; Kheirandishfard et al . ( 2020b ) ; Zhou et al . ( 2019 ) ; Jiang et al . ( 2018 ) ; Abavisani & Patel ( 2018 ) ; Zhou et al . ( 2018 ) ; Zhang et al . ( 2018 ; 2019b ; a ) ; Kheirandishfard et al . ( 2020a ) have attempted to learn an appropriate embedding of the data ( which ideally would have a union of linear subspaces structure ) via a neural network , ΦE ( X , We ) , whereWe denotes the parameters of a network mapping defined by ΦE , which takes a dataset X ∈ Rdx×N as input . In an attempt to encourage the embedding of the data , ΦE ( X , We ) , to have this union of subspaces structure , these approaches minimize a self-expressive loss term , with form given in ( 1 ) , on the embedded data , and a large majority of these proposed techniques can be described by the general form : min We , C γF ( Z , C ) + g ( Z , X , C ) subject to Z = ΦE ( X , We ) ( 2 ) where g is some function designed to discourage trivial solutions ( for example ΦE ( X , We ) = 0 ) and γ > 0 is some hyper-parameter to balance the terms . Several different choices of g have been proposed in the literature . The first is to place some form of normalization directly on Z . For example , Peng et al . ( 2017 ) propose an Instance Normalization regularization , g ( Z , X , C ) = ∑N i=1 ( Z > i Zi − 1 ) 2 , which attempts to constrain the norm of the embedded data points to be 1 . Likewise , one could also consider Dataset Normalization schemes , which bound the norm of the entire embedded representation ‖Z‖2F ≥ τ or Channel/Batch Normalization schemes , which bound the norm of a channel of the embedded representation ( i.e. , a row of Z ) , ‖Zi‖2F ≥ τ , ∀i . We note that this is quite similar to the common Batch Norm operator ( Ioffe & Szegedy , 2015 ) used in neural network training which attempts to constrain each row of Z to have zero mean and constant norm . Another popular form of g is to also train a decoding network ΦD ( · , Wd ) with parameters Wd to map the self-expressive representation , ΦE ( X , We ) C , back to the original data to ensure that sufficient information is preserved in the self-expressive representation to recover the original data . We will refer to this as Autoencoder Regularization . This idea is essentially a generalization of the previously discussed work , which considered constrained linear encoder/decoder mappings ( Patel et al. , 2013 ; Patel & Vidal , 2014 ; Patel et al. , 2015 ) , to non-linear autoencodering neural networks and was first proposed by the authors of Ji et al . ( 2017 ) . The problem takes the general form : min We , Wd , C γF ( Z , C ) + ` ( X , ΦD ( ZC , Wd ) ) subject to Z = ΦE ( X , We ) , ( 3 ) where the first term is the standard self-expressive subspace clustering loss applied to the embedded representation , and the second term is a standard auto-encoder loss , with ` typically chosen to be the squared loss . Note that here both the encoding/decoding network and the optimal self-expression encoding , C , are trained jointly , and once problem ( 3 ) is solved one can use the recovered C matrix directly for clustering . Using the general formulation in ( 2 ) and the popular specific case in ( 3 ) , Self-Expressive Deep Subspace Clustering ( SEDSC ) has been applied to a variety of applications , but there is relatively little that it known about it from a theoretical standpoint . Initial formulations for SEDSC were guided by the intuition that if the dataset is drawn from a union of linear subspaces , then solving problem ( 1 ) is known to induce desirable properties in C for clustering . By extension one might assume that if one also optimizes over the geometry of the learned embedding ( Z ) this objective might induce a desirable geometry in the embedded space ( e.g. , a union of linear subspaces ) . However , a vast majority of the prior theoretical analysis for problems of the form in ( 1 ) only considers the case where the data is held fixed and analyzes the properties of the optimal C matrix . Due to the well-known fact that neural networks are capable of producing highly-expressive mapping functions ( and hence a network could produce many potential values for Z ) , the use of a model such as ( 2 ) / ( 3 ) is essentially using ( 1 ) as a regularization function on Z to encourage a union of subspaces geometry . To date , however , models such as ( 2 ) / ( 3 ) have been guided largely by intuition and significant questions remain regarding what type of data geometry is encouraged by F ( Z , C ) when one optimizes over both the encoding matrix , C , and the network producing the embedded data representation , Z .
This paper critiques the commonly-used self-expressive cost function used to learn embeddings for deep subspace clustering. The authors point out that the empirical improvements obtained by deep self-expressive subspace clustering may be artifacts of post processing on the learned affinity matrix. They then theoretically characterize the optimal solutions to a variety of cost functions/normalization procedures used within the deep subspace clustering literature, showing that these encourage points to be mapped to a singleton set up to a sign change.
SP:6ceb9378033da5eab4af5ebe84e1f9f5b99b4c38
A Critique of Self-Expressive Deep Subspace Clustering
1 INTRODUCTION AND BACKGROUND . Subspace clustering is a classical unsupervised learning problem , where one wishes to segment a given dataset into a prescribed number of clusters , and each cluster is defined as a linear ( or affine ) subspace with dimension lower than the ambient space . There have been a wide variety of approaches proposed in the literature to solve this problem ( Vidal et al. , 2016 ) , but a large family of state-of-the-art approaches are based on exploiting the self-expressive property of linear subspaces . That is , if a point lies in a linear subspace , then it can be represented as a linear combination of other points within the subspace . Based on this fact , a wide variety of methods have been proposed which , given a dataset Z ∈ Rd×N of N d-dimensional points , find a matrix of coefficients C ∈ RN×N by solving the problem : min C∈RN×N { F ( Z , C ) ≡ 1 2 ‖ZC− Z‖2F + λθ ( C ) = 1 2 〈Z > Z , ( C− I ) ( C− I ) > 〉+ λθ ( C ) } . ( 1 ) Here , the first term ‖ZC − C‖2F captures the self-expressive property by requiring every datapoint to represent itself as an approximate linear combination of other points , i.e. , Zi ≈ ZCi , where Zi and Ci are the ith columns of Z and C , respectively . The second term , θ ( C ) , is some regularization function designed to encourage each data point to only select other points within the correct subspace in its representation and to avoid trivial solutions ( such as C = I ) . Once the C matrix has been solved for , one can then define a graph affinity between data points , typically based on the magnitudes of the entries of C , and use an appropriate graph-based clustering method ( e.g. , spectral clustering ( von Luxburg , 2007 ) ) to produce the final clustering of the data points . One of the first methods to utilize this approach was Sparse Subspace Clustering ( SSC ) ( Elhamifar & Vidal , 2009 ; 2013 ) , where θ takes the form θSSC ( C ) = ‖C‖1 + δ ( diag ( C ) = 0 ) , with ‖ · ‖1 denoting the ` 1 norm and δ an indicator function which takes value∞ if an element of the diagonal of C is non-zero and 0 otherwise . By regularizing C to be sparse , a point must represent itself using the smallest number of other points within the dataset , which in turn ideally requires a point to only select other points within its own subspace in the representation . Likewise other variants , with Low-Rank Representation ( LRR ) ( Liu et al. , 2013 ) , Low-Rank Subspace Clustering ( LRSC ) ( Vidal & Favaro , 2014 ) and Elastic-net Subspace Clustering ( EnSC ) ( You et al. , 2016 ) being wellknown examples , take the same form as ( 1 ) with different choices of regularization . For example , θLRR ( C ) = ‖C‖∗ and θEnSC ( C ) = ‖C‖1 + τ‖C‖2F + δ ( diag ( C ) = 0 ) , where ‖ · ‖∗ denotes the nuclear norm ( sum of the singular values ) . A significant advantage of the majority of these methods is that it can be proven ( typically subject to some technical assumptions regarding the angles between the underlying subspaces and the distribution of the sampled data points within the subspaces ) that the optimal C matrix in ( 1 ) will be “ correct ” in the sense that if Ci , j is non-zero then the ith and jth columns of Z lie in the same linear subspace ( Soltanolkotabi & Candès , 2012 ; Lu et al. , 2012 ; Elhamifar & Vidal , 2013 ; Soltanolkotabi et al. , 2014 ; Wang et al. , 2015 ; Wang & Xu , 2016 ; You & Vidal , 2015a ; b ; Yang et al. , 2016 ; Tsakiris & Vidal , 2018 ; Li et al. , 2018 ; You et al. , 2019 ; Robinson et al. , 2019 ) , which has led to these methods achieving state-of-the-art performance in many applications . 1.1 SELF-EXPRESSIVE DEEP SUBSPACE CLUSTERING . Although subspace clustering techniques based on self-expression display strong empirical performance and provide theoretical guarantees , a significant limitation of these techniques is the requirement that the underlying dataset needs to be approximately supported on a union of linear subspaces . This has led to a strong motivation to extend these techniques to more general datasets , such as data supported on a union of non-linear low-dimensional manifolds . From inspection of the right side of ( 1 ) , one can observe that the only dependence on the data Z comes in the form of the Gram matrix Z > Z . As a result , self-expressive subspace clustering techniques are amendable to the “ kerneltrick ” , where instead of taking an inner product kernel between data points , one can instead use a general kernel κ ( · , · ) ( Patel & Vidal , 2014 ) . Of course , such an approach comes with the traditional challenge of how to select an appropriate kernel so that the embedding of the data in the Hilbert space associated with the choice of kernel results in a union of linear subspaces . The first approach to propose learning an appropriate embedding of an initial dataset X ∈ Rdx×N ( which does not necessarily have a union of subspaces structure ) was given by Patel et al . ( 2013 ; 2015 ) who proposed first projecting the data into a lower dimensional space via a learned linear projector , Z = PlX , where Pl ∈ Rd×dx ( d < dx ) is also optimized over in addition to C in ( 1 ) . To ensure that sufficient information about the original data X is preserved in the low-dimensional embedding Z , the authors further required that the linear projector satisfy the constraint that PlP > l = I and added an additional term to the objective with form ‖X−P > l PlX‖2F . However , since the projector is linear , the approach is not well suited for nonlinear manifolds , unless it is augmented with a kernel embedding , which again requires choosing a suitable kernel . More recently , given the success of deep neural networks , a large number of studies Peng et al . ( 2017 ) ; Ji et al . ( 2017 ) ; Zeng et al . ( 2019b ; a ) ; Xie et al . ( 2020 ) ; Sun et al . ( 2019 ) ; Li et al . ( 2019 ) ; Yang et al . ( 2019 ) ; Jiang et al . ( 2019 ) ; Tang et al . ( 2018 ) ; Kheirandishfard et al . ( 2020b ) ; Zhou et al . ( 2019 ) ; Jiang et al . ( 2018 ) ; Abavisani & Patel ( 2018 ) ; Zhou et al . ( 2018 ) ; Zhang et al . ( 2018 ; 2019b ; a ) ; Kheirandishfard et al . ( 2020a ) have attempted to learn an appropriate embedding of the data ( which ideally would have a union of linear subspaces structure ) via a neural network , ΦE ( X , We ) , whereWe denotes the parameters of a network mapping defined by ΦE , which takes a dataset X ∈ Rdx×N as input . In an attempt to encourage the embedding of the data , ΦE ( X , We ) , to have this union of subspaces structure , these approaches minimize a self-expressive loss term , with form given in ( 1 ) , on the embedded data , and a large majority of these proposed techniques can be described by the general form : min We , C γF ( Z , C ) + g ( Z , X , C ) subject to Z = ΦE ( X , We ) ( 2 ) where g is some function designed to discourage trivial solutions ( for example ΦE ( X , We ) = 0 ) and γ > 0 is some hyper-parameter to balance the terms . Several different choices of g have been proposed in the literature . The first is to place some form of normalization directly on Z . For example , Peng et al . ( 2017 ) propose an Instance Normalization regularization , g ( Z , X , C ) = ∑N i=1 ( Z > i Zi − 1 ) 2 , which attempts to constrain the norm of the embedded data points to be 1 . Likewise , one could also consider Dataset Normalization schemes , which bound the norm of the entire embedded representation ‖Z‖2F ≥ τ or Channel/Batch Normalization schemes , which bound the norm of a channel of the embedded representation ( i.e. , a row of Z ) , ‖Zi‖2F ≥ τ , ∀i . We note that this is quite similar to the common Batch Norm operator ( Ioffe & Szegedy , 2015 ) used in neural network training which attempts to constrain each row of Z to have zero mean and constant norm . Another popular form of g is to also train a decoding network ΦD ( · , Wd ) with parameters Wd to map the self-expressive representation , ΦE ( X , We ) C , back to the original data to ensure that sufficient information is preserved in the self-expressive representation to recover the original data . We will refer to this as Autoencoder Regularization . This idea is essentially a generalization of the previously discussed work , which considered constrained linear encoder/decoder mappings ( Patel et al. , 2013 ; Patel & Vidal , 2014 ; Patel et al. , 2015 ) , to non-linear autoencodering neural networks and was first proposed by the authors of Ji et al . ( 2017 ) . The problem takes the general form : min We , Wd , C γF ( Z , C ) + ` ( X , ΦD ( ZC , Wd ) ) subject to Z = ΦE ( X , We ) , ( 3 ) where the first term is the standard self-expressive subspace clustering loss applied to the embedded representation , and the second term is a standard auto-encoder loss , with ` typically chosen to be the squared loss . Note that here both the encoding/decoding network and the optimal self-expression encoding , C , are trained jointly , and once problem ( 3 ) is solved one can use the recovered C matrix directly for clustering . Using the general formulation in ( 2 ) and the popular specific case in ( 3 ) , Self-Expressive Deep Subspace Clustering ( SEDSC ) has been applied to a variety of applications , but there is relatively little that it known about it from a theoretical standpoint . Initial formulations for SEDSC were guided by the intuition that if the dataset is drawn from a union of linear subspaces , then solving problem ( 1 ) is known to induce desirable properties in C for clustering . By extension one might assume that if one also optimizes over the geometry of the learned embedding ( Z ) this objective might induce a desirable geometry in the embedded space ( e.g. , a union of linear subspaces ) . However , a vast majority of the prior theoretical analysis for problems of the form in ( 1 ) only considers the case where the data is held fixed and analyzes the properties of the optimal C matrix . Due to the well-known fact that neural networks are capable of producing highly-expressive mapping functions ( and hence a network could produce many potential values for Z ) , the use of a model such as ( 2 ) / ( 3 ) is essentially using ( 1 ) as a regularization function on Z to encourage a union of subspaces geometry . To date , however , models such as ( 2 ) / ( 3 ) have been guided largely by intuition and significant questions remain regarding what type of data geometry is encouraged by F ( Z , C ) when one optimizes over both the encoding matrix , C , and the network producing the embedded data representation , Z .
The paper calls into question the significance of previous results on Self-Expressive Deep Subspace Clustering (SEDSC) models, which are touted as successful extensions of the linear subspace clustering (using the self-expressive property) to non-linear data structures. The authors present a set of theoretical results that indicate that the standard formulations of SEDSC are generally ill-posed. Even with added regularizations, it is shown that such formulations could very well yield trivial geometries that are not conducive to successful subspace clustering.
SP:6ceb9378033da5eab4af5ebe84e1f9f5b99b4c38
Revisiting the Stability of Stochastic Gradient Descent: A Tightness Analysis
1 INTRODUCTION . Stochastic gradient descent ( SGD ) has gained great popularity in solving machine learning optimization problems ( Kingma & Ba , 2014 ; Johnson & Zhang , 2013 ) . SGD leverages the finite-sum structure of the objective function , avoids the expensive computation of exact gradients , and thus provides a feasible and efficient optimization solution in large-scale settings ( Bottou , 2012 ) . The convergence and the optimality of SGD have been thoroughly studied ( Ge et al. , 2015 ; Rakhlin et al. , 2012 ; Reddi et al. , 2018 ; Zhou & Gu , 2019 ; Carmon et al. , 2019a ; b ; Shamir & Zhang , 2013 ) . In recent years , new research questions have been raised regarding SGD ’ s impact on a model ’ s generalization power . The seminal work ( Hardt et al. , 2016 ) tackled the problem using the algorithmic stability of SGD , i.e. , the progressive sensitivity of the trained model w.r.t . the replacement of a single ( test ) datum in the training set . The stability-based analysis of the generalization gap allows one to bypass classical model capacity theorems ( Vapnik , 1998 ; Koltchinskii & Panchenko , 2000 ) or weight-based complexity theorems ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Arora et al. , 2018 ) . This framework also provides theoretical insights into many phenomena observed in practice , e.g. , the “ train faster , generalize better ” phenomenon , the power of regularization techniques such as weight decay ( Krogh & Hertz , 1992 ) , Dropout ( Srivastava et al. , 2014 ) , and gradient clipping . Other works have applied the stability analysis to more sophisticated settings such as Stochastic Gradient Langevin Dynamics and momentum SGD ( Mou et al. , 2018 ; Chaudhari et al. , 2019 ; Chen et al. , 2018 ) . Despite the promises of this stability-based analysis , it remains open whether this framework can explain the strong generalization performance of deep neural networks in practice . Existing theoretical upper bounds of the stability ( and thus , generalization ) ( Hardt et al. , 2016 ) are ideal for strongly convex loss functions : the upper bound remains constant even as the number of training iterations increases . However , the same bound deteriorates significantly when we relax to more general and realistic settings . In particular , for convex ( but not strongly convex ) and non-convex loss functions , if SGD has constant step size , then the upper bound grows linearly and exponentially with the number of training iterations . This bound fails to match the superior generalization performance of deep neural networks , and leads to the following question : Question 1 : Can we find a better stability upper bound for convex or non-convex loss functions ? In this paper , we first address the question above and investigate the tightness of the algorithmic stability analysis for stochastic gradient methods ( SGM ) proposed by ( Hardt et al. , 2016 ) . R1 . We show in Theorem 1 that the analysis in ( Hardt et al. , 2016 ) is tight for convex and smooth objective functions ; in other words , there is a convex loss function whose stability grows linearly with the number of training iterations , with constant step size ( αt = α ) in SGD . R2 . We show that in Theorem 2 that for linear models , the analysis in the convex case can be tightened to show that stab does not increase with t. R3 . In Theorem 3 we show that the analysis in ( Hardt et al. , 2016 ) for decreasing step size ( αt = O ( 1/t ) ) is loose for non-convex objective functions by providing a tighter upper bound on the stability ( and hence generalization error ) . R4 . The bound on the stability of SGD by ( Hardt et al. , 2016 ) is achieved by bounding the divergence at time t , defined as δt : = E||wt − w ′ t|| , where wt is the model trained on data set S and w ′ t is the model trained on a data set S′ that differs from S in exactly one sample . In Theorem 4 we provide evidence that our new upper bound in the non-convex case is tight , by showing a non-convex loss function whose divergence matches the upper bound for our divergence . R5 . Although it is not derived formally , the techniques in ( Hardt et al. , 2016 ) can be employed to show an exponential upper bound for non-convex loss functions minimized using SGD with constant-size step . In Theorem 5 , we give evidence that this abysmal upper bound is likely tight for non-convex loss functions , by exhibiting a non-convex loss function for which the divergence δt increases exponentially . Thus the only functions whose stability provably does not increase with the number of iterations when a constant step-size during SGD is employed , are strongly convex functions . However , a ) it has been empirically observed that for deep neural network loss , near the local minima , the Hessians are usually low rank ( Chaudhari et al. , 2017 ; Yao et al. , 2019 ) , and b ) neural networks trained with constant step-size SGD do generalize well in practice ( Lin & Jegelka , 2018 ; Huang et al. , 2017 ; Smith et al. , 2017 ) . Combined with our lower bounds on convex and non-convex functions , we seem to hit an obstacle on the way to explaining generalization using the stability framework . Question 2 : What is it that makes constant-step SGD on deep learning loss function generalize well ? Realizing the limitation of the current state of stability analysis , we investigate whether a strongerthan-convex , but weaker-than-strongly-convex assumption of the loss function can be made , at least near local minima . If we can show algorithmic stability near local minima , we can still show the stability using similar argument as ( Du et al. , 2019 ; Allen-Zhu et al. , 2019 ) . Aiming towards a characterization of loss functions exhibiting good stability , we propose a new condition for loss near local minima . This condition , called Hessian contractive , is slightly stronger than a general convex condition , but considerably weaker than strongly convex . Formally , the Hessian contractive condition stipulates that near any local minima , ( 1 ) the function is convex ; and ( 2 ) a data dependent Hessian is positive definite in the gradient direction . Theoretically , we show that such a condition is sufficient to guarantee a constant stability bound for SGD ( constant step size ) near the local minima , while allowing the Hessian to be low rank . We also provide examples showing Hessian Contractive is a reasonable condition for several loss functions . Empirically , we verify the Hessian Contractive condition near a local minima of the loss while training deep neural networks . We sample points from a neighborhood of current iterates by adding Gaussian noise and verify the HC condition locally by Hessian product approximation . Summarizing our second set of contributions : R6 . In Observation 1 we show that the family of widely used ( convex ) linear model loss functions will satisfy the Hessian Contractive condition . One typical example of such linear model loss is the regression loss function . These observation suggests that Hessian Contractive is a condition satisfied by ( potentially many ) machine learning loss functions . R7 . In Theorem 6 we show that the Hessian Contractive condition will localize SGD iterates in a neighborhood of minima , which implies a constant stability bound for SGD near the local minima . 1.1 RELATED WORKS . Stability and generalization . The stability framework suggests that a stable machine learning algorithm results in models with good generalization performance ( Kearns & Ron , 1999 ; Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ; Shalev-Shwartz et al. , 2010 ; Devroye & Wagner , 1979a ; b ; Rogers & Wagner , 1978 ) . It serves as a mechanism for provable learnability when uniform convergence fails ( Shalev-Shwartz et al. , 2010 ; Nagarajan & Kolter , 2019 ) . The concept of uniform stability was introduced in order to derive high probability bounds on the generalization error ( Bousquet & Elisseeff , 2002 ) . Uniform stability describes the worst case change in the loss of a model trained on an algorithm when a single data point in the dataset is replaced . In ( Hardt et al. , 2016 ) , a uniform stability analysis for iterative algorithms is proposed to analyze SGD , generalizing the one-shot version in ( Bousquet & Elisseeff , 2002 ) . Algorithmic uniform stability is widely used in analyzing the generalization performance of SGD ( Mou et al. , 2018 ; Feldman & Vondrak , 2019 ; Chen et al. , 2018 ) . The worst case leave-one-out type bounds also closely connect uniform stability with differential private learning ( Feldman et al. , 2018 ; 2020 ; Dwork et al. , 2006 ; Wu et al. , 2017b ) , where the uniform stability can lead to provable privacy guarantee . While the upper bounds of algorithmic stability of SGD have been extensively studied , the tightness of those bounds remains open . In addition to uniform stability , an average stability of the SGD is studied in Kuzborskij & Lampert ( 2018 ) where the authors provide data-dependent upper bounds on stability1 . In this work , we report for the first time lower bounds on the uniform stability of SGD . Our tightness analysis suggests necessity of additional assumptions for analyzing the generalization of SGD on deep learning . Geometry of local minima . The geometry of local minima plays an important role in the generalization performance of deep neural networks ( Hochreiter & Schmidhuber , 1995 ; Wu et al. , 2017a ) . The flat minima , i.e. , minima whose Hessians have a large portion of zero-valued eigenvalues , are believed to attain better generalization ( Keskar et al. , 2016 ; Li et al. , 2018 ) . In ( Chaudhari et al. , 2019 ) , the authors construct a local entropy-based objective function which converges to a solution with good generalization in a flat region , where “ flatness ” means that the Hessian matrix has a large portion of nearly-zero eigenvalues . However , these observations have not been supported theoretically . In this paper , we propose the Hessian contractive condition that is slight stronger than flat minima . Such condition suggests that the minima is sharp only in the gradient direction while remains flat in other directions , which unifies the geometrical interpretation of flat minima and uniform stability analysis . 2 PRELIMINARIES . In this section we introduce the notion of uniform stability and establish our notations . We first introduce the quantities Empirical and Population Risk and Generalization Gap . Given an unknown distribution D on labeled sample space Z = X × { −1 , +1 } , let S = { z1 , ... , zn } denote a set of n samples zi = ( xi , yi ) drawn i.i.d . from D. Let w ∈ Rd be the parameter ( s ) of a model that tries to predict y given x , and let f be a loss function where f ( w ; z ) denotes the loss of the model with parameter w on sample z . Let f ( w ; S ) denote the empirical risk f ( w ; S ) = Ez∼S [ f ( w ; z ) ] = 1While it is an interesting open problem to get data-dependent lower bounds by lower bounding the average stability , we construct lower bounds on the worst-case stability . Thus our lower bounds are general and not data-dependent . 1 n ∑n i=1 f ( w ; zi ) with corresponding population risk Ez∼D [ f ( w ; z ) ] . The generalization error of the model with parameter w is defined as the difference between the empirical and population risks : |Ez∼D [ f ( w ; z ) ] − Ez∼S [ f ( w ; z ) ] | . Next we introduce the Stochastic Gradient Descent ( SGD ) method . We follow the setting of ( Hardt et al. , 2016 ) , and starting with some initialization w0 ∈ Rd , consider the following SGD update step : wt+1 = wt − αt∇wf ( w ; zit ) , where it is drawn from [ n ] : = { 1 , 2 , · · · , n } uniformly and independently in each round . The analysis of SGD requires the following crucial properties of the loss function f ( . , z ) at any fixed point z , viewed solely as a function of the parameter w : Definition 1 ( L-Lipschitz ) . A function f ( w ) is L-Lipschitz if ∀u , v ∈ Rd : |f ( u ) −f ( v ) | ≤ L‖u−v‖ . Definition 2 ( β-smooth ) . A function f ( w ) is β-smooth if ∀u , v ∈ Rd : |∇f ( u ) −∇f ( v ) | ≤ β‖u−v‖ . Definition 3 ( γ-strongly convex ) . A function f ( w ) is γ strongly convex if ∀u , v ∈ Rd : f ( u ) > f ( v ) +∇f ( v ) > [ u− v ] + γ 2 ‖u− v‖2 . Algorithmic Stability Next we define the key concept of algorithmic stability , which was introduced by ( Bousquet & Elisseeff , 2002 ) and adopted by ( Hardt et al. , 2016 ) . Informally , an algorithm is stable if its output only varies slightly when we change a single sample in the input dataset . When this stability is uniform over all datasets differing at a single point , this leads to an upper bound on the generalization gap . More formally : Definition 4 . Two sets of samples S , S′ are twin datasets if they differ at a single entry , i.e. , S = { z1 , ... zi , ... , zn } and S′ = { z1 , ... , z′i , ... , zn } . Consider a possibly randomized algorithm A that given a sample S of size n outputs a parameter A ( S ) . Define the algorithmic stability parameter of A by : εstab ( A , n ) : = inf { ε : sup z∈Z , S , S′ EA|f ( A ( S ) ; z ) − f ( A ( S′ ) ; z ) | ≤ ε } . Here EA denote expectation over the random coins of A . Also , for such an algorithm , one can define its expected generalization error as : GE ( A , n ) : = ES , A [ Ez∼D [ f ( A ( S ) ; z ) ] − Ez∼S [ f ( A ( S ) ; z ) ] ] . Stability and generalization : It was proved in ( Hardt et al. , 2016 ) that GE ( A , n ) ≤ εstab ( A , n ) . Furthermore , the authors observed that an L-Lipschitz condition on the loss function f enforces a uniform upper bound : supz |f ( w ; z ) − f ( w′ ; z ) | ≤ L‖w − w′‖ . This implies that for Lipschitz loss , the algorithmic stability εstab ( A , n ) ( and hence the generalization error GE ( A , n ) ) can be bounded by obtaining bounds on ‖w − w′‖ . Let wT and w ′ T be the parameters obtained by running SGD starting on twin datasets S and S ′ , respectively . Throughout this paper we will focus on the divergence quantity δT : = EA||wT − w ′ T || . While ( Hardt et al. , 2016 ) reports upper bounds on δT with different types of loss functions , e.g. , convex and non-convex loss functions , we investigate the tightness of those bounds .
This paper considers the stability of the stochastic gradient decent algorithm under different conditions. They show a lower bound for the stability of SGD in the smooth and convex case, and show that the bound can be tightened for linear models. They give a tight bound for the stability of SGD with decreasing step size in the non-convex case. Then they propose the Hessian Contractive condition, and under this condition a tight bound for the stability of SGD with constant step size is given.
SP:27d27fbdba1259a29d0c538ebb873c444a6a4c11
Revisiting the Stability of Stochastic Gradient Descent: A Tightness Analysis
1 INTRODUCTION . Stochastic gradient descent ( SGD ) has gained great popularity in solving machine learning optimization problems ( Kingma & Ba , 2014 ; Johnson & Zhang , 2013 ) . SGD leverages the finite-sum structure of the objective function , avoids the expensive computation of exact gradients , and thus provides a feasible and efficient optimization solution in large-scale settings ( Bottou , 2012 ) . The convergence and the optimality of SGD have been thoroughly studied ( Ge et al. , 2015 ; Rakhlin et al. , 2012 ; Reddi et al. , 2018 ; Zhou & Gu , 2019 ; Carmon et al. , 2019a ; b ; Shamir & Zhang , 2013 ) . In recent years , new research questions have been raised regarding SGD ’ s impact on a model ’ s generalization power . The seminal work ( Hardt et al. , 2016 ) tackled the problem using the algorithmic stability of SGD , i.e. , the progressive sensitivity of the trained model w.r.t . the replacement of a single ( test ) datum in the training set . The stability-based analysis of the generalization gap allows one to bypass classical model capacity theorems ( Vapnik , 1998 ; Koltchinskii & Panchenko , 2000 ) or weight-based complexity theorems ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Arora et al. , 2018 ) . This framework also provides theoretical insights into many phenomena observed in practice , e.g. , the “ train faster , generalize better ” phenomenon , the power of regularization techniques such as weight decay ( Krogh & Hertz , 1992 ) , Dropout ( Srivastava et al. , 2014 ) , and gradient clipping . Other works have applied the stability analysis to more sophisticated settings such as Stochastic Gradient Langevin Dynamics and momentum SGD ( Mou et al. , 2018 ; Chaudhari et al. , 2019 ; Chen et al. , 2018 ) . Despite the promises of this stability-based analysis , it remains open whether this framework can explain the strong generalization performance of deep neural networks in practice . Existing theoretical upper bounds of the stability ( and thus , generalization ) ( Hardt et al. , 2016 ) are ideal for strongly convex loss functions : the upper bound remains constant even as the number of training iterations increases . However , the same bound deteriorates significantly when we relax to more general and realistic settings . In particular , for convex ( but not strongly convex ) and non-convex loss functions , if SGD has constant step size , then the upper bound grows linearly and exponentially with the number of training iterations . This bound fails to match the superior generalization performance of deep neural networks , and leads to the following question : Question 1 : Can we find a better stability upper bound for convex or non-convex loss functions ? In this paper , we first address the question above and investigate the tightness of the algorithmic stability analysis for stochastic gradient methods ( SGM ) proposed by ( Hardt et al. , 2016 ) . R1 . We show in Theorem 1 that the analysis in ( Hardt et al. , 2016 ) is tight for convex and smooth objective functions ; in other words , there is a convex loss function whose stability grows linearly with the number of training iterations , with constant step size ( αt = α ) in SGD . R2 . We show that in Theorem 2 that for linear models , the analysis in the convex case can be tightened to show that stab does not increase with t. R3 . In Theorem 3 we show that the analysis in ( Hardt et al. , 2016 ) for decreasing step size ( αt = O ( 1/t ) ) is loose for non-convex objective functions by providing a tighter upper bound on the stability ( and hence generalization error ) . R4 . The bound on the stability of SGD by ( Hardt et al. , 2016 ) is achieved by bounding the divergence at time t , defined as δt : = E||wt − w ′ t|| , where wt is the model trained on data set S and w ′ t is the model trained on a data set S′ that differs from S in exactly one sample . In Theorem 4 we provide evidence that our new upper bound in the non-convex case is tight , by showing a non-convex loss function whose divergence matches the upper bound for our divergence . R5 . Although it is not derived formally , the techniques in ( Hardt et al. , 2016 ) can be employed to show an exponential upper bound for non-convex loss functions minimized using SGD with constant-size step . In Theorem 5 , we give evidence that this abysmal upper bound is likely tight for non-convex loss functions , by exhibiting a non-convex loss function for which the divergence δt increases exponentially . Thus the only functions whose stability provably does not increase with the number of iterations when a constant step-size during SGD is employed , are strongly convex functions . However , a ) it has been empirically observed that for deep neural network loss , near the local minima , the Hessians are usually low rank ( Chaudhari et al. , 2017 ; Yao et al. , 2019 ) , and b ) neural networks trained with constant step-size SGD do generalize well in practice ( Lin & Jegelka , 2018 ; Huang et al. , 2017 ; Smith et al. , 2017 ) . Combined with our lower bounds on convex and non-convex functions , we seem to hit an obstacle on the way to explaining generalization using the stability framework . Question 2 : What is it that makes constant-step SGD on deep learning loss function generalize well ? Realizing the limitation of the current state of stability analysis , we investigate whether a strongerthan-convex , but weaker-than-strongly-convex assumption of the loss function can be made , at least near local minima . If we can show algorithmic stability near local minima , we can still show the stability using similar argument as ( Du et al. , 2019 ; Allen-Zhu et al. , 2019 ) . Aiming towards a characterization of loss functions exhibiting good stability , we propose a new condition for loss near local minima . This condition , called Hessian contractive , is slightly stronger than a general convex condition , but considerably weaker than strongly convex . Formally , the Hessian contractive condition stipulates that near any local minima , ( 1 ) the function is convex ; and ( 2 ) a data dependent Hessian is positive definite in the gradient direction . Theoretically , we show that such a condition is sufficient to guarantee a constant stability bound for SGD ( constant step size ) near the local minima , while allowing the Hessian to be low rank . We also provide examples showing Hessian Contractive is a reasonable condition for several loss functions . Empirically , we verify the Hessian Contractive condition near a local minima of the loss while training deep neural networks . We sample points from a neighborhood of current iterates by adding Gaussian noise and verify the HC condition locally by Hessian product approximation . Summarizing our second set of contributions : R6 . In Observation 1 we show that the family of widely used ( convex ) linear model loss functions will satisfy the Hessian Contractive condition . One typical example of such linear model loss is the regression loss function . These observation suggests that Hessian Contractive is a condition satisfied by ( potentially many ) machine learning loss functions . R7 . In Theorem 6 we show that the Hessian Contractive condition will localize SGD iterates in a neighborhood of minima , which implies a constant stability bound for SGD near the local minima . 1.1 RELATED WORKS . Stability and generalization . The stability framework suggests that a stable machine learning algorithm results in models with good generalization performance ( Kearns & Ron , 1999 ; Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ; Shalev-Shwartz et al. , 2010 ; Devroye & Wagner , 1979a ; b ; Rogers & Wagner , 1978 ) . It serves as a mechanism for provable learnability when uniform convergence fails ( Shalev-Shwartz et al. , 2010 ; Nagarajan & Kolter , 2019 ) . The concept of uniform stability was introduced in order to derive high probability bounds on the generalization error ( Bousquet & Elisseeff , 2002 ) . Uniform stability describes the worst case change in the loss of a model trained on an algorithm when a single data point in the dataset is replaced . In ( Hardt et al. , 2016 ) , a uniform stability analysis for iterative algorithms is proposed to analyze SGD , generalizing the one-shot version in ( Bousquet & Elisseeff , 2002 ) . Algorithmic uniform stability is widely used in analyzing the generalization performance of SGD ( Mou et al. , 2018 ; Feldman & Vondrak , 2019 ; Chen et al. , 2018 ) . The worst case leave-one-out type bounds also closely connect uniform stability with differential private learning ( Feldman et al. , 2018 ; 2020 ; Dwork et al. , 2006 ; Wu et al. , 2017b ) , where the uniform stability can lead to provable privacy guarantee . While the upper bounds of algorithmic stability of SGD have been extensively studied , the tightness of those bounds remains open . In addition to uniform stability , an average stability of the SGD is studied in Kuzborskij & Lampert ( 2018 ) where the authors provide data-dependent upper bounds on stability1 . In this work , we report for the first time lower bounds on the uniform stability of SGD . Our tightness analysis suggests necessity of additional assumptions for analyzing the generalization of SGD on deep learning . Geometry of local minima . The geometry of local minima plays an important role in the generalization performance of deep neural networks ( Hochreiter & Schmidhuber , 1995 ; Wu et al. , 2017a ) . The flat minima , i.e. , minima whose Hessians have a large portion of zero-valued eigenvalues , are believed to attain better generalization ( Keskar et al. , 2016 ; Li et al. , 2018 ) . In ( Chaudhari et al. , 2019 ) , the authors construct a local entropy-based objective function which converges to a solution with good generalization in a flat region , where “ flatness ” means that the Hessian matrix has a large portion of nearly-zero eigenvalues . However , these observations have not been supported theoretically . In this paper , we propose the Hessian contractive condition that is slight stronger than flat minima . Such condition suggests that the minima is sharp only in the gradient direction while remains flat in other directions , which unifies the geometrical interpretation of flat minima and uniform stability analysis . 2 PRELIMINARIES . In this section we introduce the notion of uniform stability and establish our notations . We first introduce the quantities Empirical and Population Risk and Generalization Gap . Given an unknown distribution D on labeled sample space Z = X × { −1 , +1 } , let S = { z1 , ... , zn } denote a set of n samples zi = ( xi , yi ) drawn i.i.d . from D. Let w ∈ Rd be the parameter ( s ) of a model that tries to predict y given x , and let f be a loss function where f ( w ; z ) denotes the loss of the model with parameter w on sample z . Let f ( w ; S ) denote the empirical risk f ( w ; S ) = Ez∼S [ f ( w ; z ) ] = 1While it is an interesting open problem to get data-dependent lower bounds by lower bounding the average stability , we construct lower bounds on the worst-case stability . Thus our lower bounds are general and not data-dependent . 1 n ∑n i=1 f ( w ; zi ) with corresponding population risk Ez∼D [ f ( w ; z ) ] . The generalization error of the model with parameter w is defined as the difference between the empirical and population risks : |Ez∼D [ f ( w ; z ) ] − Ez∼S [ f ( w ; z ) ] | . Next we introduce the Stochastic Gradient Descent ( SGD ) method . We follow the setting of ( Hardt et al. , 2016 ) , and starting with some initialization w0 ∈ Rd , consider the following SGD update step : wt+1 = wt − αt∇wf ( w ; zit ) , where it is drawn from [ n ] : = { 1 , 2 , · · · , n } uniformly and independently in each round . The analysis of SGD requires the following crucial properties of the loss function f ( . , z ) at any fixed point z , viewed solely as a function of the parameter w : Definition 1 ( L-Lipschitz ) . A function f ( w ) is L-Lipschitz if ∀u , v ∈ Rd : |f ( u ) −f ( v ) | ≤ L‖u−v‖ . Definition 2 ( β-smooth ) . A function f ( w ) is β-smooth if ∀u , v ∈ Rd : |∇f ( u ) −∇f ( v ) | ≤ β‖u−v‖ . Definition 3 ( γ-strongly convex ) . A function f ( w ) is γ strongly convex if ∀u , v ∈ Rd : f ( u ) > f ( v ) +∇f ( v ) > [ u− v ] + γ 2 ‖u− v‖2 . Algorithmic Stability Next we define the key concept of algorithmic stability , which was introduced by ( Bousquet & Elisseeff , 2002 ) and adopted by ( Hardt et al. , 2016 ) . Informally , an algorithm is stable if its output only varies slightly when we change a single sample in the input dataset . When this stability is uniform over all datasets differing at a single point , this leads to an upper bound on the generalization gap . More formally : Definition 4 . Two sets of samples S , S′ are twin datasets if they differ at a single entry , i.e. , S = { z1 , ... zi , ... , zn } and S′ = { z1 , ... , z′i , ... , zn } . Consider a possibly randomized algorithm A that given a sample S of size n outputs a parameter A ( S ) . Define the algorithmic stability parameter of A by : εstab ( A , n ) : = inf { ε : sup z∈Z , S , S′ EA|f ( A ( S ) ; z ) − f ( A ( S′ ) ; z ) | ≤ ε } . Here EA denote expectation over the random coins of A . Also , for such an algorithm , one can define its expected generalization error as : GE ( A , n ) : = ES , A [ Ez∼D [ f ( A ( S ) ; z ) ] − Ez∼S [ f ( A ( S ) ; z ) ] ] . Stability and generalization : It was proved in ( Hardt et al. , 2016 ) that GE ( A , n ) ≤ εstab ( A , n ) . Furthermore , the authors observed that an L-Lipschitz condition on the loss function f enforces a uniform upper bound : supz |f ( w ; z ) − f ( w′ ; z ) | ≤ L‖w − w′‖ . This implies that for Lipschitz loss , the algorithmic stability εstab ( A , n ) ( and hence the generalization error GE ( A , n ) ) can be bounded by obtaining bounds on ‖w − w′‖ . Let wT and w ′ T be the parameters obtained by running SGD starting on twin datasets S and S ′ , respectively . Throughout this paper we will focus on the divergence quantity δT : = EA||wT − w ′ T || . While ( Hardt et al. , 2016 ) reports upper bounds on δT with different types of loss functions , e.g. , convex and non-convex loss functions , we investigate the tightness of those bounds .
This paper studies stability of SGD which is a popular optimization algorithm. The authors aim to build a tight stability analysis. In particular, the authors show by constructing specific problems that the existing stability bounds for SGD applied to convex problems are tight within a constant factor. Then, the authors refine the stability analysis in non-convex case by presenting new bounds, and show the new bounds are tight. The authors also provide new conditions weaker than strongly convex assumption in both convex and non-convex case. The paper is clearly written and is easy to follow.
SP:27d27fbdba1259a29d0c538ebb873c444a6a4c11
Revisiting the Stability of Stochastic Gradient Descent: A Tightness Analysis
1 INTRODUCTION . Stochastic gradient descent ( SGD ) has gained great popularity in solving machine learning optimization problems ( Kingma & Ba , 2014 ; Johnson & Zhang , 2013 ) . SGD leverages the finite-sum structure of the objective function , avoids the expensive computation of exact gradients , and thus provides a feasible and efficient optimization solution in large-scale settings ( Bottou , 2012 ) . The convergence and the optimality of SGD have been thoroughly studied ( Ge et al. , 2015 ; Rakhlin et al. , 2012 ; Reddi et al. , 2018 ; Zhou & Gu , 2019 ; Carmon et al. , 2019a ; b ; Shamir & Zhang , 2013 ) . In recent years , new research questions have been raised regarding SGD ’ s impact on a model ’ s generalization power . The seminal work ( Hardt et al. , 2016 ) tackled the problem using the algorithmic stability of SGD , i.e. , the progressive sensitivity of the trained model w.r.t . the replacement of a single ( test ) datum in the training set . The stability-based analysis of the generalization gap allows one to bypass classical model capacity theorems ( Vapnik , 1998 ; Koltchinskii & Panchenko , 2000 ) or weight-based complexity theorems ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Arora et al. , 2018 ) . This framework also provides theoretical insights into many phenomena observed in practice , e.g. , the “ train faster , generalize better ” phenomenon , the power of regularization techniques such as weight decay ( Krogh & Hertz , 1992 ) , Dropout ( Srivastava et al. , 2014 ) , and gradient clipping . Other works have applied the stability analysis to more sophisticated settings such as Stochastic Gradient Langevin Dynamics and momentum SGD ( Mou et al. , 2018 ; Chaudhari et al. , 2019 ; Chen et al. , 2018 ) . Despite the promises of this stability-based analysis , it remains open whether this framework can explain the strong generalization performance of deep neural networks in practice . Existing theoretical upper bounds of the stability ( and thus , generalization ) ( Hardt et al. , 2016 ) are ideal for strongly convex loss functions : the upper bound remains constant even as the number of training iterations increases . However , the same bound deteriorates significantly when we relax to more general and realistic settings . In particular , for convex ( but not strongly convex ) and non-convex loss functions , if SGD has constant step size , then the upper bound grows linearly and exponentially with the number of training iterations . This bound fails to match the superior generalization performance of deep neural networks , and leads to the following question : Question 1 : Can we find a better stability upper bound for convex or non-convex loss functions ? In this paper , we first address the question above and investigate the tightness of the algorithmic stability analysis for stochastic gradient methods ( SGM ) proposed by ( Hardt et al. , 2016 ) . R1 . We show in Theorem 1 that the analysis in ( Hardt et al. , 2016 ) is tight for convex and smooth objective functions ; in other words , there is a convex loss function whose stability grows linearly with the number of training iterations , with constant step size ( αt = α ) in SGD . R2 . We show that in Theorem 2 that for linear models , the analysis in the convex case can be tightened to show that stab does not increase with t. R3 . In Theorem 3 we show that the analysis in ( Hardt et al. , 2016 ) for decreasing step size ( αt = O ( 1/t ) ) is loose for non-convex objective functions by providing a tighter upper bound on the stability ( and hence generalization error ) . R4 . The bound on the stability of SGD by ( Hardt et al. , 2016 ) is achieved by bounding the divergence at time t , defined as δt : = E||wt − w ′ t|| , where wt is the model trained on data set S and w ′ t is the model trained on a data set S′ that differs from S in exactly one sample . In Theorem 4 we provide evidence that our new upper bound in the non-convex case is tight , by showing a non-convex loss function whose divergence matches the upper bound for our divergence . R5 . Although it is not derived formally , the techniques in ( Hardt et al. , 2016 ) can be employed to show an exponential upper bound for non-convex loss functions minimized using SGD with constant-size step . In Theorem 5 , we give evidence that this abysmal upper bound is likely tight for non-convex loss functions , by exhibiting a non-convex loss function for which the divergence δt increases exponentially . Thus the only functions whose stability provably does not increase with the number of iterations when a constant step-size during SGD is employed , are strongly convex functions . However , a ) it has been empirically observed that for deep neural network loss , near the local minima , the Hessians are usually low rank ( Chaudhari et al. , 2017 ; Yao et al. , 2019 ) , and b ) neural networks trained with constant step-size SGD do generalize well in practice ( Lin & Jegelka , 2018 ; Huang et al. , 2017 ; Smith et al. , 2017 ) . Combined with our lower bounds on convex and non-convex functions , we seem to hit an obstacle on the way to explaining generalization using the stability framework . Question 2 : What is it that makes constant-step SGD on deep learning loss function generalize well ? Realizing the limitation of the current state of stability analysis , we investigate whether a strongerthan-convex , but weaker-than-strongly-convex assumption of the loss function can be made , at least near local minima . If we can show algorithmic stability near local minima , we can still show the stability using similar argument as ( Du et al. , 2019 ; Allen-Zhu et al. , 2019 ) . Aiming towards a characterization of loss functions exhibiting good stability , we propose a new condition for loss near local minima . This condition , called Hessian contractive , is slightly stronger than a general convex condition , but considerably weaker than strongly convex . Formally , the Hessian contractive condition stipulates that near any local minima , ( 1 ) the function is convex ; and ( 2 ) a data dependent Hessian is positive definite in the gradient direction . Theoretically , we show that such a condition is sufficient to guarantee a constant stability bound for SGD ( constant step size ) near the local minima , while allowing the Hessian to be low rank . We also provide examples showing Hessian Contractive is a reasonable condition for several loss functions . Empirically , we verify the Hessian Contractive condition near a local minima of the loss while training deep neural networks . We sample points from a neighborhood of current iterates by adding Gaussian noise and verify the HC condition locally by Hessian product approximation . Summarizing our second set of contributions : R6 . In Observation 1 we show that the family of widely used ( convex ) linear model loss functions will satisfy the Hessian Contractive condition . One typical example of such linear model loss is the regression loss function . These observation suggests that Hessian Contractive is a condition satisfied by ( potentially many ) machine learning loss functions . R7 . In Theorem 6 we show that the Hessian Contractive condition will localize SGD iterates in a neighborhood of minima , which implies a constant stability bound for SGD near the local minima . 1.1 RELATED WORKS . Stability and generalization . The stability framework suggests that a stable machine learning algorithm results in models with good generalization performance ( Kearns & Ron , 1999 ; Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ; Shalev-Shwartz et al. , 2010 ; Devroye & Wagner , 1979a ; b ; Rogers & Wagner , 1978 ) . It serves as a mechanism for provable learnability when uniform convergence fails ( Shalev-Shwartz et al. , 2010 ; Nagarajan & Kolter , 2019 ) . The concept of uniform stability was introduced in order to derive high probability bounds on the generalization error ( Bousquet & Elisseeff , 2002 ) . Uniform stability describes the worst case change in the loss of a model trained on an algorithm when a single data point in the dataset is replaced . In ( Hardt et al. , 2016 ) , a uniform stability analysis for iterative algorithms is proposed to analyze SGD , generalizing the one-shot version in ( Bousquet & Elisseeff , 2002 ) . Algorithmic uniform stability is widely used in analyzing the generalization performance of SGD ( Mou et al. , 2018 ; Feldman & Vondrak , 2019 ; Chen et al. , 2018 ) . The worst case leave-one-out type bounds also closely connect uniform stability with differential private learning ( Feldman et al. , 2018 ; 2020 ; Dwork et al. , 2006 ; Wu et al. , 2017b ) , where the uniform stability can lead to provable privacy guarantee . While the upper bounds of algorithmic stability of SGD have been extensively studied , the tightness of those bounds remains open . In addition to uniform stability , an average stability of the SGD is studied in Kuzborskij & Lampert ( 2018 ) where the authors provide data-dependent upper bounds on stability1 . In this work , we report for the first time lower bounds on the uniform stability of SGD . Our tightness analysis suggests necessity of additional assumptions for analyzing the generalization of SGD on deep learning . Geometry of local minima . The geometry of local minima plays an important role in the generalization performance of deep neural networks ( Hochreiter & Schmidhuber , 1995 ; Wu et al. , 2017a ) . The flat minima , i.e. , minima whose Hessians have a large portion of zero-valued eigenvalues , are believed to attain better generalization ( Keskar et al. , 2016 ; Li et al. , 2018 ) . In ( Chaudhari et al. , 2019 ) , the authors construct a local entropy-based objective function which converges to a solution with good generalization in a flat region , where “ flatness ” means that the Hessian matrix has a large portion of nearly-zero eigenvalues . However , these observations have not been supported theoretically . In this paper , we propose the Hessian contractive condition that is slight stronger than flat minima . Such condition suggests that the minima is sharp only in the gradient direction while remains flat in other directions , which unifies the geometrical interpretation of flat minima and uniform stability analysis . 2 PRELIMINARIES . In this section we introduce the notion of uniform stability and establish our notations . We first introduce the quantities Empirical and Population Risk and Generalization Gap . Given an unknown distribution D on labeled sample space Z = X × { −1 , +1 } , let S = { z1 , ... , zn } denote a set of n samples zi = ( xi , yi ) drawn i.i.d . from D. Let w ∈ Rd be the parameter ( s ) of a model that tries to predict y given x , and let f be a loss function where f ( w ; z ) denotes the loss of the model with parameter w on sample z . Let f ( w ; S ) denote the empirical risk f ( w ; S ) = Ez∼S [ f ( w ; z ) ] = 1While it is an interesting open problem to get data-dependent lower bounds by lower bounding the average stability , we construct lower bounds on the worst-case stability . Thus our lower bounds are general and not data-dependent . 1 n ∑n i=1 f ( w ; zi ) with corresponding population risk Ez∼D [ f ( w ; z ) ] . The generalization error of the model with parameter w is defined as the difference between the empirical and population risks : |Ez∼D [ f ( w ; z ) ] − Ez∼S [ f ( w ; z ) ] | . Next we introduce the Stochastic Gradient Descent ( SGD ) method . We follow the setting of ( Hardt et al. , 2016 ) , and starting with some initialization w0 ∈ Rd , consider the following SGD update step : wt+1 = wt − αt∇wf ( w ; zit ) , where it is drawn from [ n ] : = { 1 , 2 , · · · , n } uniformly and independently in each round . The analysis of SGD requires the following crucial properties of the loss function f ( . , z ) at any fixed point z , viewed solely as a function of the parameter w : Definition 1 ( L-Lipschitz ) . A function f ( w ) is L-Lipschitz if ∀u , v ∈ Rd : |f ( u ) −f ( v ) | ≤ L‖u−v‖ . Definition 2 ( β-smooth ) . A function f ( w ) is β-smooth if ∀u , v ∈ Rd : |∇f ( u ) −∇f ( v ) | ≤ β‖u−v‖ . Definition 3 ( γ-strongly convex ) . A function f ( w ) is γ strongly convex if ∀u , v ∈ Rd : f ( u ) > f ( v ) +∇f ( v ) > [ u− v ] + γ 2 ‖u− v‖2 . Algorithmic Stability Next we define the key concept of algorithmic stability , which was introduced by ( Bousquet & Elisseeff , 2002 ) and adopted by ( Hardt et al. , 2016 ) . Informally , an algorithm is stable if its output only varies slightly when we change a single sample in the input dataset . When this stability is uniform over all datasets differing at a single point , this leads to an upper bound on the generalization gap . More formally : Definition 4 . Two sets of samples S , S′ are twin datasets if they differ at a single entry , i.e. , S = { z1 , ... zi , ... , zn } and S′ = { z1 , ... , z′i , ... , zn } . Consider a possibly randomized algorithm A that given a sample S of size n outputs a parameter A ( S ) . Define the algorithmic stability parameter of A by : εstab ( A , n ) : = inf { ε : sup z∈Z , S , S′ EA|f ( A ( S ) ; z ) − f ( A ( S′ ) ; z ) | ≤ ε } . Here EA denote expectation over the random coins of A . Also , for such an algorithm , one can define its expected generalization error as : GE ( A , n ) : = ES , A [ Ez∼D [ f ( A ( S ) ; z ) ] − Ez∼S [ f ( A ( S ) ; z ) ] ] . Stability and generalization : It was proved in ( Hardt et al. , 2016 ) that GE ( A , n ) ≤ εstab ( A , n ) . Furthermore , the authors observed that an L-Lipschitz condition on the loss function f enforces a uniform upper bound : supz |f ( w ; z ) − f ( w′ ; z ) | ≤ L‖w − w′‖ . This implies that for Lipschitz loss , the algorithmic stability εstab ( A , n ) ( and hence the generalization error GE ( A , n ) ) can be bounded by obtaining bounds on ‖w − w′‖ . Let wT and w ′ T be the parameters obtained by running SGD starting on twin datasets S and S ′ , respectively . Throughout this paper we will focus on the divergence quantity δT : = EA||wT − w ′ T || . While ( Hardt et al. , 2016 ) reports upper bounds on δT with different types of loss functions , e.g. , convex and non-convex loss functions , we investigate the tightness of those bounds .
The paper studies the stability of stochastic gradient descent (SGD), which is one of the framework used for explaining generalization. More specifically, the paper investigates the tightness of the algorithmic stability bounds for SGD given by Hardt et al. (2016). Furthermore, the authors propose the Hessian contractive condition, which characterizes deep learning loss functions with good generalization properties, when being trained with SGD.
SP:27d27fbdba1259a29d0c538ebb873c444a6a4c11
The impacts of known and unknown demonstrator irrationality on reward inference
1 INTRODUCTION . Motivated by difficulty in reward specification ( Lehman et al. , 2018 ) , inverse reinforcement learning ( IRL ) methods estimate a reward function from human demonstrations ( Ng et al. , 2000 ; Abbeel and Ng , 2004 ; Kalman , 1964 ; Jameson and Kreindler , 1973 ; Mombaur et al. , 2010 ) . The central assumption behind these methods is that human behavior is rational , i.e. , optimal with respect to their reward ( cumulative , in expectation ) . Unfortunately , decades of research in behavioral economics and cognitive science ( Chipman , 2014 ) have unearthed a deluge of irrationalities , i.e. , of ways in which people deviate from optimal decision making : hyperbolic discounting , scope insensitivity , illusion of control , decision noise , loss aversion , to name a few . While as a community we are starting to account for some possible irrationalities plaguing demonstrations in different ways ( Ziebart et al. , 2008 ; 2010 ; Singh et al. , 2017 ; Reddy et al. , 2018 ; Evans et al. , 2016 ; Shah et al. , 2019 ) , we understand relatively little about what effect irrationalities have on the difficulty of inferring the reward . In this work , we seek a systematic analysis of this effect . Do irrationalities make it harder to infer the reward ? Is it the case that the more irrational someone is , the harder it is to infer the reward ? Do we need to account for the specific irrationality type during learning , or can we get away with the standard noisy-rationality model ? The answers to these questions are important in deciding how to move forward with reward inference . If irrationality , even when well modelled , still makes reward inference very difficult , then we will need alternate ways to specify behaviors . If well-modelled irrationality leads to decent reward inference but we run into problems when we just make a noisy-rational assumption , that suggests we need to start accounting for irrationality more explicitly , or at least seek assumptions or models that are robust to many different types of biases people might present . Finally , if the noisy-rational model leads to decent inference even when the demonstrator is irrational , then we need not dedicate significant resources to addressing irrationality . One challenge with conducting such an analysis is that there are many irrationalities in the psychology and behavioral economics literature , with varying degrees of mathematical formalization versus empirical description . To structure the space for our analysis , we operationalize irrationalities in the language of MDPs by systematically enumerating possible deviations from the Bellman equation – imperfect maximization , deviations from the true transition function , etc . This gives us a formal framework in which we can simulate irrational behavior , run reward inference , and study its performance . Armed with this formalism , we then explore the various impacts of irrationality on reward learning in three families of environments : small random MDPs , a more legible gridworld MDP , and an autonomous driving domain drawn from the robotics literature ( Sadigh et al. , 2016 ) . Irrationality can help , rather than hinder reward inference – if it is modelled correctly . We first explore the impacts of demonstrator irrationality when the irrationality is known to the reward inference algorithm . Surprisingly , we find that certain irrationalities actually improve the quality of reward inference - that is , they make reward easier to learn . Importantly , this is not compared to assuming the wrong model of the human : our finding is that humans who exhibit ( correctly modelled ) irrationality are more informative than humans who exhibit ( correctly modelled ) rationality ! This is consistent in all three domains . We explain this theoretically from the perspective of the mutual information between the demonstrator behavior and the reward parameters , proving that some irrationalities are arbitrarily more informative than rational behavior . Unmodelled irrationality leads to remarkably poor reward inference . It might seem that we can ’ t immediately benefit from the knowledge that irrationalities help inference unless we have a comprehensive understanding of human decision-making , and so we should just stick to the status quo of modeling people as rational . However , we find that modeling irrational demonstrators as noisily-rational can lead to worse outcomes than not performing inference at all and just using the prior ( section 5 ) . Encouragingly , we also find evidence that even just modeling the demonstrator ’ s irrationality approximately allows a learner to outperform modeling the demonstrator as noisilyrational ( section E ) . Overall , we contribute 1 ) a theoretical and empirical analysis of the effects of different irrationalities on reward inference , 2 ) a way to systematically formalize and cover the space of irrationalities in order to conduct such an analysis , and 3 ) evidence for the importance and benefit of accounting for irrationality irrationality during inference . Our results suggest that modeling people as noisily rational leads to poor reward inference , and that it is important to model the irrationalities of human demonstrators . Our good news is that if we manage to do that well , we might be better off even compared to a counterfactual world in which people are actually rational ! Of course , modeling irrationality is a long term endeavour . Our near-term good news is two fold : first , irrationalities can be an ally for teaching . For example , we could ask human demonstrators to act more myopically to better communicate their reward to the learners . Second , we need not get the biases perfectly correct to do better than assuming noisy-rationality . Instead , using slightly more realistic models of human irrationality could lead to better inference . 2 FRAMEWORK : BIASES AS DEVIATIONS FROM THE BELLMAN UPDATE . 2.1 EXPLORING BIASES THROUGH SIMULATION . While ideally we would recruit human subjects with different irrationalities and measure how well we can learn rewards , this is prohibitive because we do not get to dictate someone ’ s irrationality type : people exhibit a mix of them , some yet to be discovered . Further , measuring the accuracy of inference from observing real humans is complicated by the fact that we do not have ground truth access to the human ’ s reward function . For instance , suppose we asked subjects to produce a set of ( behavior , reward function ) pairs . We could then try to predict the reward functions from the behaviors . But how did we , the experimenters , infer the reward functions from the people ? If we are wrong in our assumptions about which irrationalities are affecting their behavior and/or explicit reports of rewards , we would remain deluded about the subjects ’ true intentions and preferences . To address these issues , we simulate demonstrator behavior subject to different irrationalities , run reward inference , and measure the performance against the ground truth , i.e. , the accuracy of a Bayesian posterior on the reward parameter given the ( simulated ) demonstrator ’ s inputs . 2.2 BACKGROUND AND FORMALISM . Consider an Uncertain-Reward MDP ( URMDP ) ( Bagnell et al. , 2001 ; Regan and Boutilier , 2011 ; Desai , 2017 ) M = ( S , A , { Ps , a } , γ , Θ , p , r ) , consisting of finite state and action sets S and A , distributions over states { Ps , a } representing the result of taking action a in state s , discount rate γ ∈ [ 0 , 1 ) , a ( finite ) set of reward parameters Θ , a prior distribution p ∈ ∆ ( S×Θ ) over starting states and reward parameters , and a parameterized state-action reward function r : Θ× S ×A× S → R , where rθ ( s , a , s′ ) represents the reward received . We assume that the human demonstrator ’ s policy π satisfies π = d ( θ ) , where d is an ( environmentspecific ) planner d : Θ → Π that returns a ( possibly stochastic ) policy given a particular reward parameter θ . The rational demonstrator uses a planner dRational that , given a reward parameter θ , returns a policy that maximizes its expected value . On the other hand , we say that an demonstrator is irrational if its planner returns policies with lower expected value than the optimal policy , for at least one θ ∈ Θ . 2.3 TYPES AND DEGREES OF IRRATIONALITY . There are many possible irrationalities that people exhibit ( Chipman , 2014 ) , far more than what we could study in one paper . To provide good coverage of this space , we start from the Bellman update , and systematically manipulate its terms and operators to produce a variety of different irrationalities that deviate from the optimal MDP policy in complementary ways . For instance , operating on the discount factor can model myopic behavior , while operating on the transition function can model optimism or the illusion of control . We parametrize each irrationality so that we can manipulate its “ intensity '' or deviation from rationality . Figure 2 summarizes our approach , which we detail below . 2.3.1 RATIONAL DEMONSTRATOR . In our setup , the rational demonstrator does value iteration using the Bellman update from Fig . 2 . Our models change this update to produce different types of non-rational behavior . 2.3.2 MODIFYING THE MAX OPERATOR : BOLTZMANN . Boltzmann-rationality modifies the maximum over actions maxa with a Boltzmann operator with a parameter β : Vi+1 ( s ) = Boltzβa ∑ s′∈S Ps , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) , where Boltzβ ( x ) = ∑ i xie βxi/ ∑ i e βxi ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ) . This is the most popular stochastic model used in reward inference ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ; Fisac et al. , 2017 ) . After computing the value function , the Boltzmann-rational planner dBoltz returns a policy where the probability of an action is proportional to the exponential of the Q-value of the action : π ( a|s ) ∝ eβQθ ( s , a ) . The constant β is called the rationality constant , because as β →∞ , the human choices approach perfect rationality ( optimality ) , whereas β = 0 produces uniformly random choices . 2.3.3 MODIFYING THE TRANSITION FUNCTION . Our next set of irrationalities manipulate the transition function away from reality . Illusion of Control . People often overestimate their ability to control random events ( Thompson , 1999 ) . To model this , we consider demonstrators that use the Bellman update : Vi+1 ( s ) = max a ∑ s′∈S Pns , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pns , a ( s ′ ) ∝ ( Ps , a ( s′ ) ) n. As n → ∞ , the demonstrator acts as if it exists in a deterministic environment . As n→ 0 , the demonstrator acts as if it had an equal chance of transitioning to every possible successor state . Optimism/Pessimism . Many people systematically overestimate or underestimate their chance experiencing of positive over negative events ( Sharot et al. , 2007 ) . We model this using demonstrators that modify the probability they get outcomes based on the value of those outcomes : Vi+1 ( s ) = max a ∑ s′∈S Pωs , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pωs , a ( s ′ ) ∝ Ps , a ( s′ ) eω ( rθ ( s , a , s ′ ) +γVi ( s ) ) . ω controls how pessimistic or optimistic the demonstrator is . As ω → +∞ ( respectively , ω → −∞ ) , the demonstrator becomes increasingly certain that good ( bad ) transitions will happen . As ω → 0 , the demonstrator approaches the rational demonstrator .
This paper investigates the effect different irrationality types have on reward inference. The irrationality types are modelled in the context of an Uncertain-Reward Markov Decision Process (URMDP) that is similar to an ordinary MDP but with a prior distribution over reward functions. Different irrationality types are expressed through different modifications of Bellman's optimality principle. In simple environment settings, given trajectories of an irrational agent with an optimal irrational policy (under the respective modified Bellman principle), Bayesian inference is feasible in order to identify a posterior over reward functions given the data (i.e. agent trajectories).
SP:c785f992a8e83a23d07148729b18a37e1c294f6d
The impacts of known and unknown demonstrator irrationality on reward inference
1 INTRODUCTION . Motivated by difficulty in reward specification ( Lehman et al. , 2018 ) , inverse reinforcement learning ( IRL ) methods estimate a reward function from human demonstrations ( Ng et al. , 2000 ; Abbeel and Ng , 2004 ; Kalman , 1964 ; Jameson and Kreindler , 1973 ; Mombaur et al. , 2010 ) . The central assumption behind these methods is that human behavior is rational , i.e. , optimal with respect to their reward ( cumulative , in expectation ) . Unfortunately , decades of research in behavioral economics and cognitive science ( Chipman , 2014 ) have unearthed a deluge of irrationalities , i.e. , of ways in which people deviate from optimal decision making : hyperbolic discounting , scope insensitivity , illusion of control , decision noise , loss aversion , to name a few . While as a community we are starting to account for some possible irrationalities plaguing demonstrations in different ways ( Ziebart et al. , 2008 ; 2010 ; Singh et al. , 2017 ; Reddy et al. , 2018 ; Evans et al. , 2016 ; Shah et al. , 2019 ) , we understand relatively little about what effect irrationalities have on the difficulty of inferring the reward . In this work , we seek a systematic analysis of this effect . Do irrationalities make it harder to infer the reward ? Is it the case that the more irrational someone is , the harder it is to infer the reward ? Do we need to account for the specific irrationality type during learning , or can we get away with the standard noisy-rationality model ? The answers to these questions are important in deciding how to move forward with reward inference . If irrationality , even when well modelled , still makes reward inference very difficult , then we will need alternate ways to specify behaviors . If well-modelled irrationality leads to decent reward inference but we run into problems when we just make a noisy-rational assumption , that suggests we need to start accounting for irrationality more explicitly , or at least seek assumptions or models that are robust to many different types of biases people might present . Finally , if the noisy-rational model leads to decent inference even when the demonstrator is irrational , then we need not dedicate significant resources to addressing irrationality . One challenge with conducting such an analysis is that there are many irrationalities in the psychology and behavioral economics literature , with varying degrees of mathematical formalization versus empirical description . To structure the space for our analysis , we operationalize irrationalities in the language of MDPs by systematically enumerating possible deviations from the Bellman equation – imperfect maximization , deviations from the true transition function , etc . This gives us a formal framework in which we can simulate irrational behavior , run reward inference , and study its performance . Armed with this formalism , we then explore the various impacts of irrationality on reward learning in three families of environments : small random MDPs , a more legible gridworld MDP , and an autonomous driving domain drawn from the robotics literature ( Sadigh et al. , 2016 ) . Irrationality can help , rather than hinder reward inference – if it is modelled correctly . We first explore the impacts of demonstrator irrationality when the irrationality is known to the reward inference algorithm . Surprisingly , we find that certain irrationalities actually improve the quality of reward inference - that is , they make reward easier to learn . Importantly , this is not compared to assuming the wrong model of the human : our finding is that humans who exhibit ( correctly modelled ) irrationality are more informative than humans who exhibit ( correctly modelled ) rationality ! This is consistent in all three domains . We explain this theoretically from the perspective of the mutual information between the demonstrator behavior and the reward parameters , proving that some irrationalities are arbitrarily more informative than rational behavior . Unmodelled irrationality leads to remarkably poor reward inference . It might seem that we can ’ t immediately benefit from the knowledge that irrationalities help inference unless we have a comprehensive understanding of human decision-making , and so we should just stick to the status quo of modeling people as rational . However , we find that modeling irrational demonstrators as noisily-rational can lead to worse outcomes than not performing inference at all and just using the prior ( section 5 ) . Encouragingly , we also find evidence that even just modeling the demonstrator ’ s irrationality approximately allows a learner to outperform modeling the demonstrator as noisilyrational ( section E ) . Overall , we contribute 1 ) a theoretical and empirical analysis of the effects of different irrationalities on reward inference , 2 ) a way to systematically formalize and cover the space of irrationalities in order to conduct such an analysis , and 3 ) evidence for the importance and benefit of accounting for irrationality irrationality during inference . Our results suggest that modeling people as noisily rational leads to poor reward inference , and that it is important to model the irrationalities of human demonstrators . Our good news is that if we manage to do that well , we might be better off even compared to a counterfactual world in which people are actually rational ! Of course , modeling irrationality is a long term endeavour . Our near-term good news is two fold : first , irrationalities can be an ally for teaching . For example , we could ask human demonstrators to act more myopically to better communicate their reward to the learners . Second , we need not get the biases perfectly correct to do better than assuming noisy-rationality . Instead , using slightly more realistic models of human irrationality could lead to better inference . 2 FRAMEWORK : BIASES AS DEVIATIONS FROM THE BELLMAN UPDATE . 2.1 EXPLORING BIASES THROUGH SIMULATION . While ideally we would recruit human subjects with different irrationalities and measure how well we can learn rewards , this is prohibitive because we do not get to dictate someone ’ s irrationality type : people exhibit a mix of them , some yet to be discovered . Further , measuring the accuracy of inference from observing real humans is complicated by the fact that we do not have ground truth access to the human ’ s reward function . For instance , suppose we asked subjects to produce a set of ( behavior , reward function ) pairs . We could then try to predict the reward functions from the behaviors . But how did we , the experimenters , infer the reward functions from the people ? If we are wrong in our assumptions about which irrationalities are affecting their behavior and/or explicit reports of rewards , we would remain deluded about the subjects ’ true intentions and preferences . To address these issues , we simulate demonstrator behavior subject to different irrationalities , run reward inference , and measure the performance against the ground truth , i.e. , the accuracy of a Bayesian posterior on the reward parameter given the ( simulated ) demonstrator ’ s inputs . 2.2 BACKGROUND AND FORMALISM . Consider an Uncertain-Reward MDP ( URMDP ) ( Bagnell et al. , 2001 ; Regan and Boutilier , 2011 ; Desai , 2017 ) M = ( S , A , { Ps , a } , γ , Θ , p , r ) , consisting of finite state and action sets S and A , distributions over states { Ps , a } representing the result of taking action a in state s , discount rate γ ∈ [ 0 , 1 ) , a ( finite ) set of reward parameters Θ , a prior distribution p ∈ ∆ ( S×Θ ) over starting states and reward parameters , and a parameterized state-action reward function r : Θ× S ×A× S → R , where rθ ( s , a , s′ ) represents the reward received . We assume that the human demonstrator ’ s policy π satisfies π = d ( θ ) , where d is an ( environmentspecific ) planner d : Θ → Π that returns a ( possibly stochastic ) policy given a particular reward parameter θ . The rational demonstrator uses a planner dRational that , given a reward parameter θ , returns a policy that maximizes its expected value . On the other hand , we say that an demonstrator is irrational if its planner returns policies with lower expected value than the optimal policy , for at least one θ ∈ Θ . 2.3 TYPES AND DEGREES OF IRRATIONALITY . There are many possible irrationalities that people exhibit ( Chipman , 2014 ) , far more than what we could study in one paper . To provide good coverage of this space , we start from the Bellman update , and systematically manipulate its terms and operators to produce a variety of different irrationalities that deviate from the optimal MDP policy in complementary ways . For instance , operating on the discount factor can model myopic behavior , while operating on the transition function can model optimism or the illusion of control . We parametrize each irrationality so that we can manipulate its “ intensity '' or deviation from rationality . Figure 2 summarizes our approach , which we detail below . 2.3.1 RATIONAL DEMONSTRATOR . In our setup , the rational demonstrator does value iteration using the Bellman update from Fig . 2 . Our models change this update to produce different types of non-rational behavior . 2.3.2 MODIFYING THE MAX OPERATOR : BOLTZMANN . Boltzmann-rationality modifies the maximum over actions maxa with a Boltzmann operator with a parameter β : Vi+1 ( s ) = Boltzβa ∑ s′∈S Ps , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) , where Boltzβ ( x ) = ∑ i xie βxi/ ∑ i e βxi ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ) . This is the most popular stochastic model used in reward inference ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ; Fisac et al. , 2017 ) . After computing the value function , the Boltzmann-rational planner dBoltz returns a policy where the probability of an action is proportional to the exponential of the Q-value of the action : π ( a|s ) ∝ eβQθ ( s , a ) . The constant β is called the rationality constant , because as β →∞ , the human choices approach perfect rationality ( optimality ) , whereas β = 0 produces uniformly random choices . 2.3.3 MODIFYING THE TRANSITION FUNCTION . Our next set of irrationalities manipulate the transition function away from reality . Illusion of Control . People often overestimate their ability to control random events ( Thompson , 1999 ) . To model this , we consider demonstrators that use the Bellman update : Vi+1 ( s ) = max a ∑ s′∈S Pns , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pns , a ( s ′ ) ∝ ( Ps , a ( s′ ) ) n. As n → ∞ , the demonstrator acts as if it exists in a deterministic environment . As n→ 0 , the demonstrator acts as if it had an equal chance of transitioning to every possible successor state . Optimism/Pessimism . Many people systematically overestimate or underestimate their chance experiencing of positive over negative events ( Sharot et al. , 2007 ) . We model this using demonstrators that modify the probability they get outcomes based on the value of those outcomes : Vi+1 ( s ) = max a ∑ s′∈S Pωs , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pωs , a ( s ′ ) ∝ Ps , a ( s′ ) eω ( rθ ( s , a , s ′ ) +γVi ( s ) ) . ω controls how pessimistic or optimistic the demonstrator is . As ω → +∞ ( respectively , ω → −∞ ) , the demonstrator becomes increasingly certain that good ( bad ) transitions will happen . As ω → 0 , the demonstrator approaches the rational demonstrator .
This work studies the effect of modeling systematic irrationality of the demonstrator for reward learning problems. By manipulating different factors of Bellman update, the authors simulate different irrational behavior in demonstrations. Experiments in gridworld and a 2D driving domain demonstrate that modeling irrationality helps reward inference. The authors also demonstrate that knowing the general/approximate type of irrationality, instead of knowing the exact irrationality model, might be enough to improve reward inference.
SP:c785f992a8e83a23d07148729b18a37e1c294f6d
The impacts of known and unknown demonstrator irrationality on reward inference
1 INTRODUCTION . Motivated by difficulty in reward specification ( Lehman et al. , 2018 ) , inverse reinforcement learning ( IRL ) methods estimate a reward function from human demonstrations ( Ng et al. , 2000 ; Abbeel and Ng , 2004 ; Kalman , 1964 ; Jameson and Kreindler , 1973 ; Mombaur et al. , 2010 ) . The central assumption behind these methods is that human behavior is rational , i.e. , optimal with respect to their reward ( cumulative , in expectation ) . Unfortunately , decades of research in behavioral economics and cognitive science ( Chipman , 2014 ) have unearthed a deluge of irrationalities , i.e. , of ways in which people deviate from optimal decision making : hyperbolic discounting , scope insensitivity , illusion of control , decision noise , loss aversion , to name a few . While as a community we are starting to account for some possible irrationalities plaguing demonstrations in different ways ( Ziebart et al. , 2008 ; 2010 ; Singh et al. , 2017 ; Reddy et al. , 2018 ; Evans et al. , 2016 ; Shah et al. , 2019 ) , we understand relatively little about what effect irrationalities have on the difficulty of inferring the reward . In this work , we seek a systematic analysis of this effect . Do irrationalities make it harder to infer the reward ? Is it the case that the more irrational someone is , the harder it is to infer the reward ? Do we need to account for the specific irrationality type during learning , or can we get away with the standard noisy-rationality model ? The answers to these questions are important in deciding how to move forward with reward inference . If irrationality , even when well modelled , still makes reward inference very difficult , then we will need alternate ways to specify behaviors . If well-modelled irrationality leads to decent reward inference but we run into problems when we just make a noisy-rational assumption , that suggests we need to start accounting for irrationality more explicitly , or at least seek assumptions or models that are robust to many different types of biases people might present . Finally , if the noisy-rational model leads to decent inference even when the demonstrator is irrational , then we need not dedicate significant resources to addressing irrationality . One challenge with conducting such an analysis is that there are many irrationalities in the psychology and behavioral economics literature , with varying degrees of mathematical formalization versus empirical description . To structure the space for our analysis , we operationalize irrationalities in the language of MDPs by systematically enumerating possible deviations from the Bellman equation – imperfect maximization , deviations from the true transition function , etc . This gives us a formal framework in which we can simulate irrational behavior , run reward inference , and study its performance . Armed with this formalism , we then explore the various impacts of irrationality on reward learning in three families of environments : small random MDPs , a more legible gridworld MDP , and an autonomous driving domain drawn from the robotics literature ( Sadigh et al. , 2016 ) . Irrationality can help , rather than hinder reward inference – if it is modelled correctly . We first explore the impacts of demonstrator irrationality when the irrationality is known to the reward inference algorithm . Surprisingly , we find that certain irrationalities actually improve the quality of reward inference - that is , they make reward easier to learn . Importantly , this is not compared to assuming the wrong model of the human : our finding is that humans who exhibit ( correctly modelled ) irrationality are more informative than humans who exhibit ( correctly modelled ) rationality ! This is consistent in all three domains . We explain this theoretically from the perspective of the mutual information between the demonstrator behavior and the reward parameters , proving that some irrationalities are arbitrarily more informative than rational behavior . Unmodelled irrationality leads to remarkably poor reward inference . It might seem that we can ’ t immediately benefit from the knowledge that irrationalities help inference unless we have a comprehensive understanding of human decision-making , and so we should just stick to the status quo of modeling people as rational . However , we find that modeling irrational demonstrators as noisily-rational can lead to worse outcomes than not performing inference at all and just using the prior ( section 5 ) . Encouragingly , we also find evidence that even just modeling the demonstrator ’ s irrationality approximately allows a learner to outperform modeling the demonstrator as noisilyrational ( section E ) . Overall , we contribute 1 ) a theoretical and empirical analysis of the effects of different irrationalities on reward inference , 2 ) a way to systematically formalize and cover the space of irrationalities in order to conduct such an analysis , and 3 ) evidence for the importance and benefit of accounting for irrationality irrationality during inference . Our results suggest that modeling people as noisily rational leads to poor reward inference , and that it is important to model the irrationalities of human demonstrators . Our good news is that if we manage to do that well , we might be better off even compared to a counterfactual world in which people are actually rational ! Of course , modeling irrationality is a long term endeavour . Our near-term good news is two fold : first , irrationalities can be an ally for teaching . For example , we could ask human demonstrators to act more myopically to better communicate their reward to the learners . Second , we need not get the biases perfectly correct to do better than assuming noisy-rationality . Instead , using slightly more realistic models of human irrationality could lead to better inference . 2 FRAMEWORK : BIASES AS DEVIATIONS FROM THE BELLMAN UPDATE . 2.1 EXPLORING BIASES THROUGH SIMULATION . While ideally we would recruit human subjects with different irrationalities and measure how well we can learn rewards , this is prohibitive because we do not get to dictate someone ’ s irrationality type : people exhibit a mix of them , some yet to be discovered . Further , measuring the accuracy of inference from observing real humans is complicated by the fact that we do not have ground truth access to the human ’ s reward function . For instance , suppose we asked subjects to produce a set of ( behavior , reward function ) pairs . We could then try to predict the reward functions from the behaviors . But how did we , the experimenters , infer the reward functions from the people ? If we are wrong in our assumptions about which irrationalities are affecting their behavior and/or explicit reports of rewards , we would remain deluded about the subjects ’ true intentions and preferences . To address these issues , we simulate demonstrator behavior subject to different irrationalities , run reward inference , and measure the performance against the ground truth , i.e. , the accuracy of a Bayesian posterior on the reward parameter given the ( simulated ) demonstrator ’ s inputs . 2.2 BACKGROUND AND FORMALISM . Consider an Uncertain-Reward MDP ( URMDP ) ( Bagnell et al. , 2001 ; Regan and Boutilier , 2011 ; Desai , 2017 ) M = ( S , A , { Ps , a } , γ , Θ , p , r ) , consisting of finite state and action sets S and A , distributions over states { Ps , a } representing the result of taking action a in state s , discount rate γ ∈ [ 0 , 1 ) , a ( finite ) set of reward parameters Θ , a prior distribution p ∈ ∆ ( S×Θ ) over starting states and reward parameters , and a parameterized state-action reward function r : Θ× S ×A× S → R , where rθ ( s , a , s′ ) represents the reward received . We assume that the human demonstrator ’ s policy π satisfies π = d ( θ ) , where d is an ( environmentspecific ) planner d : Θ → Π that returns a ( possibly stochastic ) policy given a particular reward parameter θ . The rational demonstrator uses a planner dRational that , given a reward parameter θ , returns a policy that maximizes its expected value . On the other hand , we say that an demonstrator is irrational if its planner returns policies with lower expected value than the optimal policy , for at least one θ ∈ Θ . 2.3 TYPES AND DEGREES OF IRRATIONALITY . There are many possible irrationalities that people exhibit ( Chipman , 2014 ) , far more than what we could study in one paper . To provide good coverage of this space , we start from the Bellman update , and systematically manipulate its terms and operators to produce a variety of different irrationalities that deviate from the optimal MDP policy in complementary ways . For instance , operating on the discount factor can model myopic behavior , while operating on the transition function can model optimism or the illusion of control . We parametrize each irrationality so that we can manipulate its “ intensity '' or deviation from rationality . Figure 2 summarizes our approach , which we detail below . 2.3.1 RATIONAL DEMONSTRATOR . In our setup , the rational demonstrator does value iteration using the Bellman update from Fig . 2 . Our models change this update to produce different types of non-rational behavior . 2.3.2 MODIFYING THE MAX OPERATOR : BOLTZMANN . Boltzmann-rationality modifies the maximum over actions maxa with a Boltzmann operator with a parameter β : Vi+1 ( s ) = Boltzβa ∑ s′∈S Ps , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) , where Boltzβ ( x ) = ∑ i xie βxi/ ∑ i e βxi ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ) . This is the most popular stochastic model used in reward inference ( Ziebart et al. , 2010 ; Asadi and Littman , 2017 ; Fisac et al. , 2017 ) . After computing the value function , the Boltzmann-rational planner dBoltz returns a policy where the probability of an action is proportional to the exponential of the Q-value of the action : π ( a|s ) ∝ eβQθ ( s , a ) . The constant β is called the rationality constant , because as β →∞ , the human choices approach perfect rationality ( optimality ) , whereas β = 0 produces uniformly random choices . 2.3.3 MODIFYING THE TRANSITION FUNCTION . Our next set of irrationalities manipulate the transition function away from reality . Illusion of Control . People often overestimate their ability to control random events ( Thompson , 1999 ) . To model this , we consider demonstrators that use the Bellman update : Vi+1 ( s ) = max a ∑ s′∈S Pns , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pns , a ( s ′ ) ∝ ( Ps , a ( s′ ) ) n. As n → ∞ , the demonstrator acts as if it exists in a deterministic environment . As n→ 0 , the demonstrator acts as if it had an equal chance of transitioning to every possible successor state . Optimism/Pessimism . Many people systematically overestimate or underestimate their chance experiencing of positive over negative events ( Sharot et al. , 2007 ) . We model this using demonstrators that modify the probability they get outcomes based on the value of those outcomes : Vi+1 ( s ) = max a ∑ s′∈S Pωs , a ( s ′ ) ( rθ ( s , a , s ′ ) + γVi ( s ′ ) ) where Pωs , a ( s ′ ) ∝ Ps , a ( s′ ) eω ( rθ ( s , a , s ′ ) +γVi ( s ) ) . ω controls how pessimistic or optimistic the demonstrator is . As ω → +∞ ( respectively , ω → −∞ ) , the demonstrator becomes increasingly certain that good ( bad ) transitions will happen . As ω → 0 , the demonstrator approaches the rational demonstrator .
This paper proposed modifications to the Bellman equation to capture known human irrationalities and showed that the reward under some conditions (the type of irrationality and parameter settings) can be better inferred compared to a rational agent. The authors demonstrated this through simulations in three different environments with different complexities and provided theoretical analyses to support this empirical finding. The authors further showed and discussed the effects on reward inference when the assumed parameter and assumed type of irrationality is misspecified.
SP:c785f992a8e83a23d07148729b18a37e1c294f6d
Overinterpretation reveals image classification model pathologies
1 Introduction . Well-founded decisions by machine learning ( ML ) systems are critical for high-stakes applications such as autonomous vehicles and medical diagnosis . Pathologies in models and their respective training datasets can result in unintended behavior during deployment if the systems are confronted with novel situations . For example , a medical image classifier for cancer detection attained high accuracy in benchmark test data , but was found to base decisions upon presence of rulers in an image ( present when dermatologists already suspected cancer ) [ 1 ] . We define model overinterpretation to occur when a classifier finds strong class-evidence in regions of an image that contain no semantically salient features . Overinterpretation is related to overfitting , but overfitting can be diagnosed via reduced test accuracy . Overinterpretation can stem from true statistical signals in the underlying dataset distribution that happen to arise from particular properties of the data source ( e.g. , dermatologists ’ rulers ) . Thus , overinterpretation can be harder to diagnose as it admits decisions that are made by statistically valid criteria , and models that use such criteria can excel at benchmarks . We demonstrate overinterpretation occurs with unmodified subsets of the original images . In contrast to adversarial examples that modify images with extra information , overinterpretation is based on real patterns already present in the training data that also generalize to the test distribution . Hidden statistical signals of benchmark datasets can result in models that overinterpret or do not generalize to new data from a different distribution . Computer vision ( CV ) research relies on datasets like CIFAR-10 [ 2 ] and ImageNet [ 3 ] to provide standardized performance benchmarks . Here , we analyze the overinterpretation of popular CNN architectures on these benchmarks to characterize pathologies . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . Revealing overinterpretation requires a systematic way to identify which features are used by a model to reach its decision . Feature attribution is addressed by a large number of interpretability methods , although they propose differing explanations for the decisions of a model . One natural explanation for image classification lies in the set of pixels that is sufficient for the model to make a confident prediction , even in the absence of information about the rest of the image . In the example of the medical image classifier for cancer detection , one might identify the pathological behavior by finding pixels depicting the ruler alone suffice for the model to confidently output the same classifications . This idea of Sufficient Input Subsets ( SIS ) has been proposed to help humans interpret the decisions of black-box models [ 4 ] . An SIS subset is a minimal subset of features ( e.g. , pixels ) that suffices to yield a class probability above a certain threshold with all other features masked . We demonstrate that classifiers trained on CIFAR-10 and ImageNet can base their decisions on SIS subsets that contain few pixels and lack human understandable semantic content . Nevertheless , these SIS subsets contain statistical signals that generalize across the benchmark data distribution , and we are able to train classifiers on CIFAR-10 images missing 95 % of their pixels and ImageNet images missing 90 % of their pixels with minimal loss of test accuracy . Thus , these benchmarks contain inherent statistical shortcuts that classifiers optimized for accuracy can learn to exploit , instead of learning more complex semantic relationships between the image pixels and the assigned class label . While recent work suggests adversarially robust models base their predictions on more semantically meaningful features [ 5 ] , we find these models suffer from overinterpretation as well . As we subsequently show , overinterpretation is not only a conceptual issue , but can actually harm overall classifier performance in practice . We find model ensembling and input dropout partially mitigate overinterpretation , increasing the semantic content of the resulting SIS subsets . However , this mitigation is not a substitute for better training data , and we find that overinterpretation is a statistical property of common benchmarks . Intriguingly , the number of pixels in the SIS rationale behind a particular classification is often indicative of whether the image is correctly classified . It may seem unnatural to use an interpretability method that produces feature attributions that look uninterpretable . However , we do not want to bias extracted rationales towards human visual priors when analyzing a model ’ s pathologies , but rather faithfully report the features used by a model . To our knowledge , this is the first analysis showing one can extract nonsensical features from CIFAR-10 and ImageNet that intuitively should be insufficient or irrelevant for a confident prediction , yet are alone sufficient to train classifiers with minimal loss of performance . Our contributions include : • We discover the pathology of overinterpretation and find it is a common failure mode of ML models , which latch onto non-salient but statistically valid signals in datasets ( Section 4.1 ) . • We introduce Batched Gradient SIS , a new masking algorithm to scale SIS to highdimensional inputs and apply it to characterize overinterpretation on ImageNet ( Section 3.2 ) . • We provide a pipeline for detecting overinterpretation by masking over 90 % of each image , demonstrating minimal loss of test accuracy , and establish lack of saliency in these patterns through human accuracy evaluations ( Sections 3.3 , 4.2 , 4.3 ) . • We show misclassifications often rely on smaller and more spurious feature subsets suggesting overinterpretation is a serious practical issue ( Section 4.4 ) . • We identify two strategies for mitigating overinterpretation ( Section 4.5 ) . We demonstrate that overinterpretation is caused by spurious statistical signals in training data , and thus training data must be carefully curated to eliminate overinterpretation artifacts . Code for this paper is available at : https : //github.com/gifford-lab/overinterpretation . 2 Related Work . While existing work has demonstrated numerous distinct flaws in deep image classifiers our paper demonstrates a new distinct flaw , overinterpretation , previously undocumented in the literature . There has been substantial research on understanding dataset bias in CV [ 6 , 7 ] and the fragility of image classifiers deployed outside benchmark settings . We extend previous work on sufficient input subsets ( SIS ) [ 4 ] with the Batched Gradient SIS method , and use this method to show that ImageNet sufficient input subset pixels for training and testing often exist at image borders . Many alternative interpretability methods also aim to understand models by extracting rationales ( pixel-subsets ) that provide positive evidence for a class [ 8–11 ] , and we adopt SIS throughout this work as a particularly straightforward method for producing such rationales . This prior work ( including SIS [ 4 ] ) is limited to understanding models and does not use the enhanced understanding of models to identify the overinterpretation flaw discovered in this paper . We contrast the issue of overinterpretation against other previously known model flaws below : • Image classifiers have been shown to be fragile when objects from one image are transplanted in another image [ 12 ] , and can be biased by object context [ 13 , 14 ] . In contrast , overinterpretation differs because we demonstrate that highly sparse , unmodified subsets of pixels in images suffice for image classifiers to make the same predictions as on the full images . • Lapuschkin et al . [ 15 ] demonstrate that DNNs can learn to rely on spurious signals in datasets , including source tags and artificial padding , but which are still human-interpretable . In contrast , the patterns we identify are minimal collections of pixels in images that are semantically meaningless to humans ( they do not comprise human-interpretable parts of images ) . We demonstrate such patterns generalize to the test distribution suggesting they arise from degenerate signals in popular benchmarks , and thus models trained on these datasets may fail to generalize to real-world data . • CNNs in particular have been conjectured to pick up on localized features like texture instead of more global features like object shape [ 16 , 17 ] . Brendel and Bethge [ 18 ] show CNNs trained on natural ImageNet images may rely on local features and , unlike humans , are able to classify texturized images , suggesting ImageNet alone is insufficient to force DNNs to rely on more causal representations . Our work demonstrates another source of degeneracy of popular image datasets , where sparse , unmodified subsets of training images that are meaningless to humans can enable a model to generalize to test data . We provide one explanation for why ImageNet-trained models may struggle to generalize to out-of-distribution data . • Geirhos et al . [ 19 ] discover that DNNs trained on distorted images fail to generalize as well as human observers when trained under image distortions . In contrast , overinterpretation reveals a different failure mode of DNNs , whereby models latch onto spurious but statistically valid sets of features in undistorted images . This phenomenon can limit the ability of a DNN to generalize to real-world data even when trained on natural images . • Other work has shown deep image classifiers can make confident predictions on nonsensical patterns [ 20 ] , and the susceptibility of DNNs to adversarial examples or synthetic images has been widely studied [ 5 , 21–23 ] . However , these adversarial examples synthesize artificial images or modify real images with auxiliary information . In contrast , we demonstrate overinterpretation of unmodified subsets of actual training images , indicating the patterns are already present in the original dataset . We further demonstrate that such signals in training data actually generalize to the test distribution and that adversarially robust models also suffer from overinterpretation . • Hooker et al . [ 24 ] found sparse pixel subsets suffice to attain high classification accuracy on popular image classification datasets , but evaluate interpretability methods rather than demonstrate spurious features or discover overinterpretation . • Ghorbani et al . [ 25 ] introduce principles and methods for human-understandable concept-based explanations of ML models . In contrast , overinterpretation differs because the features we identify are semantically meaningless to humans , stem from single images , and are not aggregated into interpretable concepts . The existence of such subsets stemming from unmodified subsets of images suggests degeneracies in the underlying benchmark datasets and failures of modern CNN models to rely on more robust and interpretable signals in training datasets . • Geirhos et al . [ 26 ] discuss the general problem of “ shortcut learning ” but do not recognize that 5 % ( CIFAR-10 ) or 10 % ( ImageNet ) spurious pixel-subsets are statistically valid signals in these datasets , nor characterize pixels that provide sufficient support and lead to overinterpretation . • In natural language processing ( NLP ) , Feng et al . [ 27 ] explored model pathologies using a similar technique , but did not analyze whether the semantically spurious patterns relied on are a statistical property of the dataset . Other work has demonstrated the presence of various spurious statistical shortcuts in major NLP benchmarks , showing this problem is not unique to CV [ 28 ] . 3 Methods . 3.1 Datasets and Models . CIFAR-10 [ 2 ] and ImageNet [ 3 ] have become two of the most popular image classification benchmarks . Most image classifiers are evaluated by the CV community based on their accuracy in one of these benchmarks . We also use the CIFAR-10-C dataset [ 29 ] to evaluate the extent to which our CIFAR-10 models can generalize to out-of-distribution ( OOD ) data . CIFAR-10-C contains variants of CIFAR-10 test images altered by various corruptions ( e.g. , Gaussian noise , motion blur ) . Where computing sufficient input subsets on CIFAR-10-C images , we use a uniform random sample of 2000 images across the entire CIFAR-10-C set . Additional results on CIFAR-10.1 v6 [ 30 ] are presented in Table S4 . We use the ILSVRC2012 ImageNet dataset [ 3 ] . For CIFAR-10 , we explore three common CNN architectures : a deep residual network with depth 20 ( ResNet20 ) [ 31 ] , a v2 deep residual network with depth 18 ( ResNet18 ) [ 32 ] , and VGG16 [ 33 ] . We train these networks using cross-entropy loss optimized via SGD with Nesterov momentum [ 34 ] and employ standard data augmentation strategies [ 32 ] ( Section S2 ) . After training many CIFAR-10 networks individually , we construct four different ensemble classifiers by grouping various networks together . Each ensemble outputs the average prediction over its member networks ( specifically , the arithmetic mean of their logits ) . For each of three architectures , we create a corresponding homogeneous ensemble by individually training five networks of that architecture . Each network has a different random initialization , which suffices to produce substantially different models despite having been trained on the same data [ 35 ] . Our fourth ensemble is heterogeneous , containing all 15 networks ( 5 replicates of each of 3 distinct CNN architectures ) . For ImageNet , we use a pre-trained Inception v3 model [ 36 ] that achieves 22.55 % and 6.44 % top-1 and top-5 error [ 37 ] Additional results from an ImageNet ResNet50 are presented in Section S6 .
This work reports the problem of image classification datasets (CIFAR-10 and ImageNet) which contains statistical patterns present in both training and tests that can be leveraged by neural networks to achieve high accuracy, but would not be discerned as salient features by humans. Using Sufficient Input Subsets (SIS), they show that retaining the smallest SIS to keep a confidence of 99% leads to spare sets of about 5% of the original pixels and that these subsets of pixels are not salient features for humans. Most importantly they show that training NNs on these SIS from a previously trained network achieves similar results.
SP:2cf4a3964537ff5dd1f7b600ab567b4d0b3cc03e
Overinterpretation reveals image classification model pathologies
1 Introduction . Well-founded decisions by machine learning ( ML ) systems are critical for high-stakes applications such as autonomous vehicles and medical diagnosis . Pathologies in models and their respective training datasets can result in unintended behavior during deployment if the systems are confronted with novel situations . For example , a medical image classifier for cancer detection attained high accuracy in benchmark test data , but was found to base decisions upon presence of rulers in an image ( present when dermatologists already suspected cancer ) [ 1 ] . We define model overinterpretation to occur when a classifier finds strong class-evidence in regions of an image that contain no semantically salient features . Overinterpretation is related to overfitting , but overfitting can be diagnosed via reduced test accuracy . Overinterpretation can stem from true statistical signals in the underlying dataset distribution that happen to arise from particular properties of the data source ( e.g. , dermatologists ’ rulers ) . Thus , overinterpretation can be harder to diagnose as it admits decisions that are made by statistically valid criteria , and models that use such criteria can excel at benchmarks . We demonstrate overinterpretation occurs with unmodified subsets of the original images . In contrast to adversarial examples that modify images with extra information , overinterpretation is based on real patterns already present in the training data that also generalize to the test distribution . Hidden statistical signals of benchmark datasets can result in models that overinterpret or do not generalize to new data from a different distribution . Computer vision ( CV ) research relies on datasets like CIFAR-10 [ 2 ] and ImageNet [ 3 ] to provide standardized performance benchmarks . Here , we analyze the overinterpretation of popular CNN architectures on these benchmarks to characterize pathologies . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . Revealing overinterpretation requires a systematic way to identify which features are used by a model to reach its decision . Feature attribution is addressed by a large number of interpretability methods , although they propose differing explanations for the decisions of a model . One natural explanation for image classification lies in the set of pixels that is sufficient for the model to make a confident prediction , even in the absence of information about the rest of the image . In the example of the medical image classifier for cancer detection , one might identify the pathological behavior by finding pixels depicting the ruler alone suffice for the model to confidently output the same classifications . This idea of Sufficient Input Subsets ( SIS ) has been proposed to help humans interpret the decisions of black-box models [ 4 ] . An SIS subset is a minimal subset of features ( e.g. , pixels ) that suffices to yield a class probability above a certain threshold with all other features masked . We demonstrate that classifiers trained on CIFAR-10 and ImageNet can base their decisions on SIS subsets that contain few pixels and lack human understandable semantic content . Nevertheless , these SIS subsets contain statistical signals that generalize across the benchmark data distribution , and we are able to train classifiers on CIFAR-10 images missing 95 % of their pixels and ImageNet images missing 90 % of their pixels with minimal loss of test accuracy . Thus , these benchmarks contain inherent statistical shortcuts that classifiers optimized for accuracy can learn to exploit , instead of learning more complex semantic relationships between the image pixels and the assigned class label . While recent work suggests adversarially robust models base their predictions on more semantically meaningful features [ 5 ] , we find these models suffer from overinterpretation as well . As we subsequently show , overinterpretation is not only a conceptual issue , but can actually harm overall classifier performance in practice . We find model ensembling and input dropout partially mitigate overinterpretation , increasing the semantic content of the resulting SIS subsets . However , this mitigation is not a substitute for better training data , and we find that overinterpretation is a statistical property of common benchmarks . Intriguingly , the number of pixels in the SIS rationale behind a particular classification is often indicative of whether the image is correctly classified . It may seem unnatural to use an interpretability method that produces feature attributions that look uninterpretable . However , we do not want to bias extracted rationales towards human visual priors when analyzing a model ’ s pathologies , but rather faithfully report the features used by a model . To our knowledge , this is the first analysis showing one can extract nonsensical features from CIFAR-10 and ImageNet that intuitively should be insufficient or irrelevant for a confident prediction , yet are alone sufficient to train classifiers with minimal loss of performance . Our contributions include : • We discover the pathology of overinterpretation and find it is a common failure mode of ML models , which latch onto non-salient but statistically valid signals in datasets ( Section 4.1 ) . • We introduce Batched Gradient SIS , a new masking algorithm to scale SIS to highdimensional inputs and apply it to characterize overinterpretation on ImageNet ( Section 3.2 ) . • We provide a pipeline for detecting overinterpretation by masking over 90 % of each image , demonstrating minimal loss of test accuracy , and establish lack of saliency in these patterns through human accuracy evaluations ( Sections 3.3 , 4.2 , 4.3 ) . • We show misclassifications often rely on smaller and more spurious feature subsets suggesting overinterpretation is a serious practical issue ( Section 4.4 ) . • We identify two strategies for mitigating overinterpretation ( Section 4.5 ) . We demonstrate that overinterpretation is caused by spurious statistical signals in training data , and thus training data must be carefully curated to eliminate overinterpretation artifacts . Code for this paper is available at : https : //github.com/gifford-lab/overinterpretation . 2 Related Work . While existing work has demonstrated numerous distinct flaws in deep image classifiers our paper demonstrates a new distinct flaw , overinterpretation , previously undocumented in the literature . There has been substantial research on understanding dataset bias in CV [ 6 , 7 ] and the fragility of image classifiers deployed outside benchmark settings . We extend previous work on sufficient input subsets ( SIS ) [ 4 ] with the Batched Gradient SIS method , and use this method to show that ImageNet sufficient input subset pixels for training and testing often exist at image borders . Many alternative interpretability methods also aim to understand models by extracting rationales ( pixel-subsets ) that provide positive evidence for a class [ 8–11 ] , and we adopt SIS throughout this work as a particularly straightforward method for producing such rationales . This prior work ( including SIS [ 4 ] ) is limited to understanding models and does not use the enhanced understanding of models to identify the overinterpretation flaw discovered in this paper . We contrast the issue of overinterpretation against other previously known model flaws below : • Image classifiers have been shown to be fragile when objects from one image are transplanted in another image [ 12 ] , and can be biased by object context [ 13 , 14 ] . In contrast , overinterpretation differs because we demonstrate that highly sparse , unmodified subsets of pixels in images suffice for image classifiers to make the same predictions as on the full images . • Lapuschkin et al . [ 15 ] demonstrate that DNNs can learn to rely on spurious signals in datasets , including source tags and artificial padding , but which are still human-interpretable . In contrast , the patterns we identify are minimal collections of pixels in images that are semantically meaningless to humans ( they do not comprise human-interpretable parts of images ) . We demonstrate such patterns generalize to the test distribution suggesting they arise from degenerate signals in popular benchmarks , and thus models trained on these datasets may fail to generalize to real-world data . • CNNs in particular have been conjectured to pick up on localized features like texture instead of more global features like object shape [ 16 , 17 ] . Brendel and Bethge [ 18 ] show CNNs trained on natural ImageNet images may rely on local features and , unlike humans , are able to classify texturized images , suggesting ImageNet alone is insufficient to force DNNs to rely on more causal representations . Our work demonstrates another source of degeneracy of popular image datasets , where sparse , unmodified subsets of training images that are meaningless to humans can enable a model to generalize to test data . We provide one explanation for why ImageNet-trained models may struggle to generalize to out-of-distribution data . • Geirhos et al . [ 19 ] discover that DNNs trained on distorted images fail to generalize as well as human observers when trained under image distortions . In contrast , overinterpretation reveals a different failure mode of DNNs , whereby models latch onto spurious but statistically valid sets of features in undistorted images . This phenomenon can limit the ability of a DNN to generalize to real-world data even when trained on natural images . • Other work has shown deep image classifiers can make confident predictions on nonsensical patterns [ 20 ] , and the susceptibility of DNNs to adversarial examples or synthetic images has been widely studied [ 5 , 21–23 ] . However , these adversarial examples synthesize artificial images or modify real images with auxiliary information . In contrast , we demonstrate overinterpretation of unmodified subsets of actual training images , indicating the patterns are already present in the original dataset . We further demonstrate that such signals in training data actually generalize to the test distribution and that adversarially robust models also suffer from overinterpretation . • Hooker et al . [ 24 ] found sparse pixel subsets suffice to attain high classification accuracy on popular image classification datasets , but evaluate interpretability methods rather than demonstrate spurious features or discover overinterpretation . • Ghorbani et al . [ 25 ] introduce principles and methods for human-understandable concept-based explanations of ML models . In contrast , overinterpretation differs because the features we identify are semantically meaningless to humans , stem from single images , and are not aggregated into interpretable concepts . The existence of such subsets stemming from unmodified subsets of images suggests degeneracies in the underlying benchmark datasets and failures of modern CNN models to rely on more robust and interpretable signals in training datasets . • Geirhos et al . [ 26 ] discuss the general problem of “ shortcut learning ” but do not recognize that 5 % ( CIFAR-10 ) or 10 % ( ImageNet ) spurious pixel-subsets are statistically valid signals in these datasets , nor characterize pixels that provide sufficient support and lead to overinterpretation . • In natural language processing ( NLP ) , Feng et al . [ 27 ] explored model pathologies using a similar technique , but did not analyze whether the semantically spurious patterns relied on are a statistical property of the dataset . Other work has demonstrated the presence of various spurious statistical shortcuts in major NLP benchmarks , showing this problem is not unique to CV [ 28 ] . 3 Methods . 3.1 Datasets and Models . CIFAR-10 [ 2 ] and ImageNet [ 3 ] have become two of the most popular image classification benchmarks . Most image classifiers are evaluated by the CV community based on their accuracy in one of these benchmarks . We also use the CIFAR-10-C dataset [ 29 ] to evaluate the extent to which our CIFAR-10 models can generalize to out-of-distribution ( OOD ) data . CIFAR-10-C contains variants of CIFAR-10 test images altered by various corruptions ( e.g. , Gaussian noise , motion blur ) . Where computing sufficient input subsets on CIFAR-10-C images , we use a uniform random sample of 2000 images across the entire CIFAR-10-C set . Additional results on CIFAR-10.1 v6 [ 30 ] are presented in Table S4 . We use the ILSVRC2012 ImageNet dataset [ 3 ] . For CIFAR-10 , we explore three common CNN architectures : a deep residual network with depth 20 ( ResNet20 ) [ 31 ] , a v2 deep residual network with depth 18 ( ResNet18 ) [ 32 ] , and VGG16 [ 33 ] . We train these networks using cross-entropy loss optimized via SGD with Nesterov momentum [ 34 ] and employ standard data augmentation strategies [ 32 ] ( Section S2 ) . After training many CIFAR-10 networks individually , we construct four different ensemble classifiers by grouping various networks together . Each ensemble outputs the average prediction over its member networks ( specifically , the arithmetic mean of their logits ) . For each of three architectures , we create a corresponding homogeneous ensemble by individually training five networks of that architecture . Each network has a different random initialization , which suffices to produce substantially different models despite having been trained on the same data [ 35 ] . Our fourth ensemble is heterogeneous , containing all 15 networks ( 5 replicates of each of 3 distinct CNN architectures ) . For ImageNet , we use a pre-trained Inception v3 model [ 36 ] that achieves 22.55 % and 6.44 % top-1 and top-5 error [ 37 ] Additional results from an ImageNet ResNet50 are presented in Section S6 .
This paper proposes "overinterpretation" which describes the phenomenon that CNNs could achieve high test accuracy while replying on features that lack semantic meaning. To demonstrate overinterpretation on CIFAR-10 and ImageNet, the authors use Batched Gradient SIS to select a small subset of pixels for each image and trained CNNs on the modified images. While humans can not make accurate predictions on those modified images, CNNs can still achieve high test accuracy. Lastly, the authors propose to use ensembling and input dropout to address overinterpretation.
SP:2cf4a3964537ff5dd1f7b600ab567b4d0b3cc03e
Overinterpretation reveals image classification model pathologies
1 Introduction . Well-founded decisions by machine learning ( ML ) systems are critical for high-stakes applications such as autonomous vehicles and medical diagnosis . Pathologies in models and their respective training datasets can result in unintended behavior during deployment if the systems are confronted with novel situations . For example , a medical image classifier for cancer detection attained high accuracy in benchmark test data , but was found to base decisions upon presence of rulers in an image ( present when dermatologists already suspected cancer ) [ 1 ] . We define model overinterpretation to occur when a classifier finds strong class-evidence in regions of an image that contain no semantically salient features . Overinterpretation is related to overfitting , but overfitting can be diagnosed via reduced test accuracy . Overinterpretation can stem from true statistical signals in the underlying dataset distribution that happen to arise from particular properties of the data source ( e.g. , dermatologists ’ rulers ) . Thus , overinterpretation can be harder to diagnose as it admits decisions that are made by statistically valid criteria , and models that use such criteria can excel at benchmarks . We demonstrate overinterpretation occurs with unmodified subsets of the original images . In contrast to adversarial examples that modify images with extra information , overinterpretation is based on real patterns already present in the training data that also generalize to the test distribution . Hidden statistical signals of benchmark datasets can result in models that overinterpret or do not generalize to new data from a different distribution . Computer vision ( CV ) research relies on datasets like CIFAR-10 [ 2 ] and ImageNet [ 3 ] to provide standardized performance benchmarks . Here , we analyze the overinterpretation of popular CNN architectures on these benchmarks to characterize pathologies . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . Revealing overinterpretation requires a systematic way to identify which features are used by a model to reach its decision . Feature attribution is addressed by a large number of interpretability methods , although they propose differing explanations for the decisions of a model . One natural explanation for image classification lies in the set of pixels that is sufficient for the model to make a confident prediction , even in the absence of information about the rest of the image . In the example of the medical image classifier for cancer detection , one might identify the pathological behavior by finding pixels depicting the ruler alone suffice for the model to confidently output the same classifications . This idea of Sufficient Input Subsets ( SIS ) has been proposed to help humans interpret the decisions of black-box models [ 4 ] . An SIS subset is a minimal subset of features ( e.g. , pixels ) that suffices to yield a class probability above a certain threshold with all other features masked . We demonstrate that classifiers trained on CIFAR-10 and ImageNet can base their decisions on SIS subsets that contain few pixels and lack human understandable semantic content . Nevertheless , these SIS subsets contain statistical signals that generalize across the benchmark data distribution , and we are able to train classifiers on CIFAR-10 images missing 95 % of their pixels and ImageNet images missing 90 % of their pixels with minimal loss of test accuracy . Thus , these benchmarks contain inherent statistical shortcuts that classifiers optimized for accuracy can learn to exploit , instead of learning more complex semantic relationships between the image pixels and the assigned class label . While recent work suggests adversarially robust models base their predictions on more semantically meaningful features [ 5 ] , we find these models suffer from overinterpretation as well . As we subsequently show , overinterpretation is not only a conceptual issue , but can actually harm overall classifier performance in practice . We find model ensembling and input dropout partially mitigate overinterpretation , increasing the semantic content of the resulting SIS subsets . However , this mitigation is not a substitute for better training data , and we find that overinterpretation is a statistical property of common benchmarks . Intriguingly , the number of pixels in the SIS rationale behind a particular classification is often indicative of whether the image is correctly classified . It may seem unnatural to use an interpretability method that produces feature attributions that look uninterpretable . However , we do not want to bias extracted rationales towards human visual priors when analyzing a model ’ s pathologies , but rather faithfully report the features used by a model . To our knowledge , this is the first analysis showing one can extract nonsensical features from CIFAR-10 and ImageNet that intuitively should be insufficient or irrelevant for a confident prediction , yet are alone sufficient to train classifiers with minimal loss of performance . Our contributions include : • We discover the pathology of overinterpretation and find it is a common failure mode of ML models , which latch onto non-salient but statistically valid signals in datasets ( Section 4.1 ) . • We introduce Batched Gradient SIS , a new masking algorithm to scale SIS to highdimensional inputs and apply it to characterize overinterpretation on ImageNet ( Section 3.2 ) . • We provide a pipeline for detecting overinterpretation by masking over 90 % of each image , demonstrating minimal loss of test accuracy , and establish lack of saliency in these patterns through human accuracy evaluations ( Sections 3.3 , 4.2 , 4.3 ) . • We show misclassifications often rely on smaller and more spurious feature subsets suggesting overinterpretation is a serious practical issue ( Section 4.4 ) . • We identify two strategies for mitigating overinterpretation ( Section 4.5 ) . We demonstrate that overinterpretation is caused by spurious statistical signals in training data , and thus training data must be carefully curated to eliminate overinterpretation artifacts . Code for this paper is available at : https : //github.com/gifford-lab/overinterpretation . 2 Related Work . While existing work has demonstrated numerous distinct flaws in deep image classifiers our paper demonstrates a new distinct flaw , overinterpretation , previously undocumented in the literature . There has been substantial research on understanding dataset bias in CV [ 6 , 7 ] and the fragility of image classifiers deployed outside benchmark settings . We extend previous work on sufficient input subsets ( SIS ) [ 4 ] with the Batched Gradient SIS method , and use this method to show that ImageNet sufficient input subset pixels for training and testing often exist at image borders . Many alternative interpretability methods also aim to understand models by extracting rationales ( pixel-subsets ) that provide positive evidence for a class [ 8–11 ] , and we adopt SIS throughout this work as a particularly straightforward method for producing such rationales . This prior work ( including SIS [ 4 ] ) is limited to understanding models and does not use the enhanced understanding of models to identify the overinterpretation flaw discovered in this paper . We contrast the issue of overinterpretation against other previously known model flaws below : • Image classifiers have been shown to be fragile when objects from one image are transplanted in another image [ 12 ] , and can be biased by object context [ 13 , 14 ] . In contrast , overinterpretation differs because we demonstrate that highly sparse , unmodified subsets of pixels in images suffice for image classifiers to make the same predictions as on the full images . • Lapuschkin et al . [ 15 ] demonstrate that DNNs can learn to rely on spurious signals in datasets , including source tags and artificial padding , but which are still human-interpretable . In contrast , the patterns we identify are minimal collections of pixels in images that are semantically meaningless to humans ( they do not comprise human-interpretable parts of images ) . We demonstrate such patterns generalize to the test distribution suggesting they arise from degenerate signals in popular benchmarks , and thus models trained on these datasets may fail to generalize to real-world data . • CNNs in particular have been conjectured to pick up on localized features like texture instead of more global features like object shape [ 16 , 17 ] . Brendel and Bethge [ 18 ] show CNNs trained on natural ImageNet images may rely on local features and , unlike humans , are able to classify texturized images , suggesting ImageNet alone is insufficient to force DNNs to rely on more causal representations . Our work demonstrates another source of degeneracy of popular image datasets , where sparse , unmodified subsets of training images that are meaningless to humans can enable a model to generalize to test data . We provide one explanation for why ImageNet-trained models may struggle to generalize to out-of-distribution data . • Geirhos et al . [ 19 ] discover that DNNs trained on distorted images fail to generalize as well as human observers when trained under image distortions . In contrast , overinterpretation reveals a different failure mode of DNNs , whereby models latch onto spurious but statistically valid sets of features in undistorted images . This phenomenon can limit the ability of a DNN to generalize to real-world data even when trained on natural images . • Other work has shown deep image classifiers can make confident predictions on nonsensical patterns [ 20 ] , and the susceptibility of DNNs to adversarial examples or synthetic images has been widely studied [ 5 , 21–23 ] . However , these adversarial examples synthesize artificial images or modify real images with auxiliary information . In contrast , we demonstrate overinterpretation of unmodified subsets of actual training images , indicating the patterns are already present in the original dataset . We further demonstrate that such signals in training data actually generalize to the test distribution and that adversarially robust models also suffer from overinterpretation . • Hooker et al . [ 24 ] found sparse pixel subsets suffice to attain high classification accuracy on popular image classification datasets , but evaluate interpretability methods rather than demonstrate spurious features or discover overinterpretation . • Ghorbani et al . [ 25 ] introduce principles and methods for human-understandable concept-based explanations of ML models . In contrast , overinterpretation differs because the features we identify are semantically meaningless to humans , stem from single images , and are not aggregated into interpretable concepts . The existence of such subsets stemming from unmodified subsets of images suggests degeneracies in the underlying benchmark datasets and failures of modern CNN models to rely on more robust and interpretable signals in training datasets . • Geirhos et al . [ 26 ] discuss the general problem of “ shortcut learning ” but do not recognize that 5 % ( CIFAR-10 ) or 10 % ( ImageNet ) spurious pixel-subsets are statistically valid signals in these datasets , nor characterize pixels that provide sufficient support and lead to overinterpretation . • In natural language processing ( NLP ) , Feng et al . [ 27 ] explored model pathologies using a similar technique , but did not analyze whether the semantically spurious patterns relied on are a statistical property of the dataset . Other work has demonstrated the presence of various spurious statistical shortcuts in major NLP benchmarks , showing this problem is not unique to CV [ 28 ] . 3 Methods . 3.1 Datasets and Models . CIFAR-10 [ 2 ] and ImageNet [ 3 ] have become two of the most popular image classification benchmarks . Most image classifiers are evaluated by the CV community based on their accuracy in one of these benchmarks . We also use the CIFAR-10-C dataset [ 29 ] to evaluate the extent to which our CIFAR-10 models can generalize to out-of-distribution ( OOD ) data . CIFAR-10-C contains variants of CIFAR-10 test images altered by various corruptions ( e.g. , Gaussian noise , motion blur ) . Where computing sufficient input subsets on CIFAR-10-C images , we use a uniform random sample of 2000 images across the entire CIFAR-10-C set . Additional results on CIFAR-10.1 v6 [ 30 ] are presented in Table S4 . We use the ILSVRC2012 ImageNet dataset [ 3 ] . For CIFAR-10 , we explore three common CNN architectures : a deep residual network with depth 20 ( ResNet20 ) [ 31 ] , a v2 deep residual network with depth 18 ( ResNet18 ) [ 32 ] , and VGG16 [ 33 ] . We train these networks using cross-entropy loss optimized via SGD with Nesterov momentum [ 34 ] and employ standard data augmentation strategies [ 32 ] ( Section S2 ) . After training many CIFAR-10 networks individually , we construct four different ensemble classifiers by grouping various networks together . Each ensemble outputs the average prediction over its member networks ( specifically , the arithmetic mean of their logits ) . For each of three architectures , we create a corresponding homogeneous ensemble by individually training five networks of that architecture . Each network has a different random initialization , which suffices to produce substantially different models despite having been trained on the same data [ 35 ] . Our fourth ensemble is heterogeneous , containing all 15 networks ( 5 replicates of each of 3 distinct CNN architectures ) . For ImageNet , we use a pre-trained Inception v3 model [ 36 ] that achieves 22.55 % and 6.44 % top-1 and top-5 error [ 37 ] Additional results from an ImageNet ResNet50 are presented in Section S6 .
The work utilizes the SIS (a local feature-importance method) to empirically prove that on existing benchmark datasets, the trained convnets are capable of making decisions based on a very small subset of pixels that are meaningless to the human observer but are nonetheless strong signals. Interestingly, unlike common belief, the same phenomenon is observed in adversarially trained models. The main problem with the work is the discrepancy between claims and results.
SP:2cf4a3964537ff5dd1f7b600ab567b4d0b3cc03e
REPAINT: Knowledge Transfer in Deep Actor-Critic Reinforcement Learning
1 INTRODUCTION . Most reinforcement learning methods train an agent from scratch , typically requiring a huge amount of time and computing resources . Accelerating the learning processes for complex tasks has been one of the most challenging problems in reinforcement learning ( Kaelbling et al. , 1996 ; Sutton & Barto , 2018 ) . In the past few years , deep reinforcement learning has become more ubiquitous to solve sequential decision-making problems in many real-world applications , such as game playing ( OpenAI et al. , 2019 ; Silver et al. , 2016 ) , robotics ( Kober et al. , 2013 ; OpenAI et al. , 2018 ) , and autonomous driving ( Sallab et al. , 2017 ) . The computational cost of learning grows as the task complexity increases in the real-world applications . Therefore , it is desirable for a learning algorithm to leverage knowledge acquired in one task to improve performance on other tasks . Transfer learning has achieved significant success in computer vision , natural language processing , and other knowledge engineering areas ( Pan & Yang , 2009 ) . In transfer learning , the teacher ( source ) and student ( target ) tasks are not necessarily drawn from the same distribution ( Taylor et al. , 2008a ) . The unseen student task may be a simple task which is similar to the previously trained tasks , or a complex task with traits borrowed from significantly different teacher tasks . Despite the prevalence of direct weight transfer , knowledge transfer from previously trained agents for reinforcement learning tasks has not been gaining much attention until recently ( Barreto et al. , 2019 ; Ma et al. , 2018 ; Schmitt et al. , 2018 ; Lazaric , 2012 ; Taylor & Stone , 2009 ) . In this work , we propose a knowledge transfer algorithm for deep actor-critic reinforcement learning , i.e. , REPresentation And INstance Transfer ( REPAINT ) . The algorithm can be categorized as a representation-instance transfer approach . Specifically , in representation transfer , we adopt a kickstarted training method ( Schmitt et al. , 2018 ) using a previously trained teacher policy , where the teacher policy is used for computing the auxiliary loss during training . In instance transfer , we develop a new sampling algorithm for the replay buffer collected from the teacher policy , where we only keep the transitions that have advantage estimates greater than a threshold . The experimental results across several transfer learning tasks show that , regardless of the similarity between source and target tasks , by introducing knowledge transfer with REPAINT , the number of training iterations needed by the agent to achieve some reward target can be significantly reduced when compared to training from scratch and training with only representation transfer or instance transfer . Additionally , the agent ’ s asymptotic performance is also improved by REPAINT in comparison with the baselines . 2 RELATED WORK : TRANSFER REINFORCEMENT LEARNING . Transfer learning algorithms in reinforcement learning can be characterized by the definition of transferred knowledge , which contains the parameters of the reinforcement learning algorithm , the representation of the trained policy , and the instances collected from the environment ( Lazaric , 2012 ) . When the teacher and student tasks share the same state-action space and they are similar enough ( Ferns et al. , 2004 ; Phillips , 2006 ) , parameter transfer is the most straightforward approach , namely , one can initialize the policy or value network in the student tasks by that from teacher tasks ( Mehta et al. , 2008 ; Rajendran et al. , 2015 ) . Parameter transfer with different state-action variables is more complex , where the crucial aspect is to find a suitable mapping from the teacher state-action space to the student state-action space ( Gupta et al. , 2017 ; Talvitie & Singh , 2007 ; Taylor et al. , 2008b ) . Most of the transfer learning algorithms fall into the category of representation transfer , where the reinforcement learning algorithm learns a specific representation of the task or the solution , and the transfer algorithm performs an abstraction process to fit it into the student task . Konidaris et al . ( 2012 ) uses the reward shaping approach to learn a portable shaping function for knowledge transfer , while some other works use neural networks for feature abstraction ( Duan et al. , 2016 ; Parisotto et al. , 2015 ; Zhang et al. , 2018 ) . Policy distillation ( Rusu et al. , 2015 ) or its variants is another popular choice for learning the teacher task representation , where the student policy aims to mimic the behavior of pre-trained teacher policies during its own learning process ( Schmitt et al. , 2018 ; Yin & Pan , 2017 ) . Recently , successor representation has been widely used in transfer reinforcement learning , in which the rewards are assumed to share some common features , so that the value function can be simply written as a linear combination of the successor features ( SF ) ( Barreto et al. , 2017 ; Madarasz & Behrens , 2019 ) . Barreto et al . ( 2019 ) extends the method of using SF and generalised policy improvement in Q-learning ( Sutton & Barto , 2018 ) to more general environments . Borsa et al . ( 2018 ) , Ma et al . ( 2018 ) , and Schaul et al . ( 2015a ) learn a universal SF approximator for transfer . The basic idea of instance transfer algorithms is that the transfer of teacher samples may improve the learning on student tasks . Lazaric et al . ( 2008 ) and Tirinzoni et al . ( 2018 ) selectively transfer samples on the basis of the compliance between tasks in a model-free algorithm , while Taylor et al . ( 2008a ) studies how a model-based algorithm can benefit from samples coming from the teacher task . However , most of the aforementioned algorithms either assume specific forms of reward functions or perform well only when the teacher and student tasks are similar . Additionally , very few algorithms are designated to actor-critic reinforcement learning . In this work , we propose a representationinstance transfer algorithm to handle the generic cases of task similarity , which is also naturally fitted for actor-critic algorithms and can be easily extended to other policy gradient based algorithms . 3 BACKGROUND : ACTOR-CRITIC REINFORCEMENT LEARNING . A general reinforcement learning ( RL ) agent interacting with environment can be modeled in a Markov decision process ( MDP ) , which is defined by a tuple M = ( S , A , p , r , γ ) , where S and A are sets of states and actions , respectively . The state transfer function p ( ·|s , a ) maps a state and action pair to a probability distribution over states . r : S × A× S → R denotes the reward function that determines a reward received by the agent for a transition from ( s , a ) to s′ . The discount factor , γ ∈ [ 0 , 1 ] , provides means to obtain a long-term objective . Specifically , the goal of an RL agent is to learn a policy π that maps a state to a probability distribution over actions at each time step t , so that at ∼ π ( ·|st ) maximizes the accumulated discounted return ∑ t≥0 γ tr ( st , at , st+1 ) . To address this problem , a popular choice to adopt is the model-free actor-critic architecture , e.g. , Konda & Tsitsiklis ( 2000 ) ; Degris et al . ( 2012 ) ; Mnih et al . ( 2016 ) ; Schulman et al . ( 2015a ; 2017 ) , where the critic estimates the value function and the actor updates the policy distribution in the direction suggested by the critic . The state value function at time t is defined as V π ( s ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s . ( 3.1 ) Similarly , the action value function ( also called Q function ) is defined by Qπ ( s , a ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s , at = a . ( 3.2 ) The actor-critic methods usually rely on the advantage function , which is computed as Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . ( 3.3 ) Intuitively , the advantage can be taken as the extra reward that could be obtained by taking a particular action a . The advantage is usually approximated by generalized advantage estimator ( GAE ) ( Schulman et al. , 2015b ) , which is defined as the exponentially-weighted average of the k-step discounted advantage , namely , Ât = Â GAE ( γ , λ ) t : = ∞∑ l=0 ( γλ ) l ( rt+l + γV π ( st+l+1 ) − V π ( st+l ) ) , ( 3.4 ) where the parameter 0 ≤ λ ≤ 1 allows a trade-off of the bias and variance . In deep RL , the critic and actor functions are usually parameterized by neural networks . Then the policy gradient methods can be used to update the actor network . For example , in the clipped proximal policy optimization ( Clipped PPO ) ( Schulman et al. , 2017 ) , the policy ’ s objective function is defined to be the minimum between the standard surrogate objective and an clipped objective : Lclip ( θ ) = Êt [ min ( rt ( θ ) · Ât , clip ( rt ( θ ) , 1− , 1 + ) · Ât ) ] , ( 3.5 ) where the policy π is parameterized by θ , and rt ( θ ) is the likelihood ratio that rt ( θ ) = πθ ( at|st ) πθold ( at|st ) . ( 3.6 ) Moreover , the clip function truncates rt ( θ ) to the range of ( 1− , 1 + ) . 4 REPRESENTATION AND INSTANCE TRANSFER IN ACTOR-CRITIC RL . In this section , we describe our knowledge transfer algorithm , REPAINT , for actor-critic RL framework . There are two core concepts underlying our approach , i.e. , representation transfer and instance transfer . In the representation transfer , we employ a kickstarted training approach ( Schmitt et al. , 2018 ) based on the policy distillation . Then , in the next iteration following the kickstarting , we update the student policy using an advantage-based experience replay . We do not assume that the teacher and student tasks are similar or drawn from the same distribution . The REPAINT algorithm is provided in Algorithm 1 , where the value function and policy function are parameterized by ν and θ , respectively . Without loss of generality , we demonstrate the policy update using the Clipped PPO loss stated in equation 3.5 , and use a single teacher policy in both representation and instance transfers . In practice , it can be directly applied to any advantage-based policy gradient RL algorithms , and it is straightforward to have different and multiple teacher policies in each transfer step . The more general algorithm and several variants are presented in Section A . 4.1 REPRESENTATION TRANSFER : KICKSTARTED TRAINING . In representation transfer , we use a kickstarting training pipeline ( Schmitt et al. , 2018 ) , which can be viewed as a combination of policy distillation ( Rusu et al. , 2015 ) and population based training ( Jaderberg et al. , 2017 ) . The main idea is to employ an auxiliary loss function which encourages the student policy to be close to the teacher policy on the trajectories sampled by the student . Given a teacher policy πteacher , we introduce the auxiliary loss as Ldistill ( θ ) = H ( πteacher ( a|s ) ‖πθ ( a|s ) ) , ( 4.1 ) where H ( ·‖· ) is the cross-entropy . In order for the agent to maximize its own future rewards , kickstarting adds the above loss to the Clipped PPO objective function , i.e. , equation 3.5 , weighted at optimization iteration k by the scaling βk ≥ 0 : LkRL ( θ ) = Lclip ( θ ) − βkLdistill ( θ ) . ( 4.2 ) Algorithm 1 REPAINT algorithm with Clipped PPO for iteration k = 1 , 2 , . . . do if k is odd then Collect trajectories S = { ( s , a , s′ , r ) } following πθold ( s ) Fit state value network Vν using S to update ν Compute advantage estimates Â1 , . . . , ÂT using equation 3.4 Perform gradient optimization on LkRL ( θ ) defined in equation 4.2 // representation transfer else Collect trajectories S ′ = { ( s , a , s′ ) } following πteacher ( s ) // instance transfer Compute r for each transition using current reward function and add to S ′ Compute advantage estimates Â′1 , . . . , Â ′ T ′ using equation 3.4 for t=1 , . . . , T ′ do if Â′t < ζ then Remove Â′t and the corresponding transition ( st , at , st+1 , rt ) from S ′ Perform gradient optimization on Lclip ( θ ) defined in equation 3.5 In our experiments , the weighting parameter βk is relatively large at early iterations , and vanishes as k increases , which is expected to improve the initial performance of the agent while keeping it focused on the current task in later iterations .
This paper proposes a new transfer learning approach to leverage the previously learned knowledge stored in a pre-trained teacher policy to facilitate the learning in a new task. The proposed method combines an established technique termed kickstarted training with a simple experience filtering method. The kickstarted training approach augments a policy distillation loss to the actor-critic training loss. The experience filtering simply performs thresholding to filter out transitions generated by teacher policy which have reward below some threshold, where the reward for thresholding is taken from the target task.
SP:86d5bb0c199f89e0ba8cb44a30199400add61308
REPAINT: Knowledge Transfer in Deep Actor-Critic Reinforcement Learning
1 INTRODUCTION . Most reinforcement learning methods train an agent from scratch , typically requiring a huge amount of time and computing resources . Accelerating the learning processes for complex tasks has been one of the most challenging problems in reinforcement learning ( Kaelbling et al. , 1996 ; Sutton & Barto , 2018 ) . In the past few years , deep reinforcement learning has become more ubiquitous to solve sequential decision-making problems in many real-world applications , such as game playing ( OpenAI et al. , 2019 ; Silver et al. , 2016 ) , robotics ( Kober et al. , 2013 ; OpenAI et al. , 2018 ) , and autonomous driving ( Sallab et al. , 2017 ) . The computational cost of learning grows as the task complexity increases in the real-world applications . Therefore , it is desirable for a learning algorithm to leverage knowledge acquired in one task to improve performance on other tasks . Transfer learning has achieved significant success in computer vision , natural language processing , and other knowledge engineering areas ( Pan & Yang , 2009 ) . In transfer learning , the teacher ( source ) and student ( target ) tasks are not necessarily drawn from the same distribution ( Taylor et al. , 2008a ) . The unseen student task may be a simple task which is similar to the previously trained tasks , or a complex task with traits borrowed from significantly different teacher tasks . Despite the prevalence of direct weight transfer , knowledge transfer from previously trained agents for reinforcement learning tasks has not been gaining much attention until recently ( Barreto et al. , 2019 ; Ma et al. , 2018 ; Schmitt et al. , 2018 ; Lazaric , 2012 ; Taylor & Stone , 2009 ) . In this work , we propose a knowledge transfer algorithm for deep actor-critic reinforcement learning , i.e. , REPresentation And INstance Transfer ( REPAINT ) . The algorithm can be categorized as a representation-instance transfer approach . Specifically , in representation transfer , we adopt a kickstarted training method ( Schmitt et al. , 2018 ) using a previously trained teacher policy , where the teacher policy is used for computing the auxiliary loss during training . In instance transfer , we develop a new sampling algorithm for the replay buffer collected from the teacher policy , where we only keep the transitions that have advantage estimates greater than a threshold . The experimental results across several transfer learning tasks show that , regardless of the similarity between source and target tasks , by introducing knowledge transfer with REPAINT , the number of training iterations needed by the agent to achieve some reward target can be significantly reduced when compared to training from scratch and training with only representation transfer or instance transfer . Additionally , the agent ’ s asymptotic performance is also improved by REPAINT in comparison with the baselines . 2 RELATED WORK : TRANSFER REINFORCEMENT LEARNING . Transfer learning algorithms in reinforcement learning can be characterized by the definition of transferred knowledge , which contains the parameters of the reinforcement learning algorithm , the representation of the trained policy , and the instances collected from the environment ( Lazaric , 2012 ) . When the teacher and student tasks share the same state-action space and they are similar enough ( Ferns et al. , 2004 ; Phillips , 2006 ) , parameter transfer is the most straightforward approach , namely , one can initialize the policy or value network in the student tasks by that from teacher tasks ( Mehta et al. , 2008 ; Rajendran et al. , 2015 ) . Parameter transfer with different state-action variables is more complex , where the crucial aspect is to find a suitable mapping from the teacher state-action space to the student state-action space ( Gupta et al. , 2017 ; Talvitie & Singh , 2007 ; Taylor et al. , 2008b ) . Most of the transfer learning algorithms fall into the category of representation transfer , where the reinforcement learning algorithm learns a specific representation of the task or the solution , and the transfer algorithm performs an abstraction process to fit it into the student task . Konidaris et al . ( 2012 ) uses the reward shaping approach to learn a portable shaping function for knowledge transfer , while some other works use neural networks for feature abstraction ( Duan et al. , 2016 ; Parisotto et al. , 2015 ; Zhang et al. , 2018 ) . Policy distillation ( Rusu et al. , 2015 ) or its variants is another popular choice for learning the teacher task representation , where the student policy aims to mimic the behavior of pre-trained teacher policies during its own learning process ( Schmitt et al. , 2018 ; Yin & Pan , 2017 ) . Recently , successor representation has been widely used in transfer reinforcement learning , in which the rewards are assumed to share some common features , so that the value function can be simply written as a linear combination of the successor features ( SF ) ( Barreto et al. , 2017 ; Madarasz & Behrens , 2019 ) . Barreto et al . ( 2019 ) extends the method of using SF and generalised policy improvement in Q-learning ( Sutton & Barto , 2018 ) to more general environments . Borsa et al . ( 2018 ) , Ma et al . ( 2018 ) , and Schaul et al . ( 2015a ) learn a universal SF approximator for transfer . The basic idea of instance transfer algorithms is that the transfer of teacher samples may improve the learning on student tasks . Lazaric et al . ( 2008 ) and Tirinzoni et al . ( 2018 ) selectively transfer samples on the basis of the compliance between tasks in a model-free algorithm , while Taylor et al . ( 2008a ) studies how a model-based algorithm can benefit from samples coming from the teacher task . However , most of the aforementioned algorithms either assume specific forms of reward functions or perform well only when the teacher and student tasks are similar . Additionally , very few algorithms are designated to actor-critic reinforcement learning . In this work , we propose a representationinstance transfer algorithm to handle the generic cases of task similarity , which is also naturally fitted for actor-critic algorithms and can be easily extended to other policy gradient based algorithms . 3 BACKGROUND : ACTOR-CRITIC REINFORCEMENT LEARNING . A general reinforcement learning ( RL ) agent interacting with environment can be modeled in a Markov decision process ( MDP ) , which is defined by a tuple M = ( S , A , p , r , γ ) , where S and A are sets of states and actions , respectively . The state transfer function p ( ·|s , a ) maps a state and action pair to a probability distribution over states . r : S × A× S → R denotes the reward function that determines a reward received by the agent for a transition from ( s , a ) to s′ . The discount factor , γ ∈ [ 0 , 1 ] , provides means to obtain a long-term objective . Specifically , the goal of an RL agent is to learn a policy π that maps a state to a probability distribution over actions at each time step t , so that at ∼ π ( ·|st ) maximizes the accumulated discounted return ∑ t≥0 γ tr ( st , at , st+1 ) . To address this problem , a popular choice to adopt is the model-free actor-critic architecture , e.g. , Konda & Tsitsiklis ( 2000 ) ; Degris et al . ( 2012 ) ; Mnih et al . ( 2016 ) ; Schulman et al . ( 2015a ; 2017 ) , where the critic estimates the value function and the actor updates the policy distribution in the direction suggested by the critic . The state value function at time t is defined as V π ( s ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s . ( 3.1 ) Similarly , the action value function ( also called Q function ) is defined by Qπ ( s , a ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s , at = a . ( 3.2 ) The actor-critic methods usually rely on the advantage function , which is computed as Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . ( 3.3 ) Intuitively , the advantage can be taken as the extra reward that could be obtained by taking a particular action a . The advantage is usually approximated by generalized advantage estimator ( GAE ) ( Schulman et al. , 2015b ) , which is defined as the exponentially-weighted average of the k-step discounted advantage , namely , Ât = Â GAE ( γ , λ ) t : = ∞∑ l=0 ( γλ ) l ( rt+l + γV π ( st+l+1 ) − V π ( st+l ) ) , ( 3.4 ) where the parameter 0 ≤ λ ≤ 1 allows a trade-off of the bias and variance . In deep RL , the critic and actor functions are usually parameterized by neural networks . Then the policy gradient methods can be used to update the actor network . For example , in the clipped proximal policy optimization ( Clipped PPO ) ( Schulman et al. , 2017 ) , the policy ’ s objective function is defined to be the minimum between the standard surrogate objective and an clipped objective : Lclip ( θ ) = Êt [ min ( rt ( θ ) · Ât , clip ( rt ( θ ) , 1− , 1 + ) · Ât ) ] , ( 3.5 ) where the policy π is parameterized by θ , and rt ( θ ) is the likelihood ratio that rt ( θ ) = πθ ( at|st ) πθold ( at|st ) . ( 3.6 ) Moreover , the clip function truncates rt ( θ ) to the range of ( 1− , 1 + ) . 4 REPRESENTATION AND INSTANCE TRANSFER IN ACTOR-CRITIC RL . In this section , we describe our knowledge transfer algorithm , REPAINT , for actor-critic RL framework . There are two core concepts underlying our approach , i.e. , representation transfer and instance transfer . In the representation transfer , we employ a kickstarted training approach ( Schmitt et al. , 2018 ) based on the policy distillation . Then , in the next iteration following the kickstarting , we update the student policy using an advantage-based experience replay . We do not assume that the teacher and student tasks are similar or drawn from the same distribution . The REPAINT algorithm is provided in Algorithm 1 , where the value function and policy function are parameterized by ν and θ , respectively . Without loss of generality , we demonstrate the policy update using the Clipped PPO loss stated in equation 3.5 , and use a single teacher policy in both representation and instance transfers . In practice , it can be directly applied to any advantage-based policy gradient RL algorithms , and it is straightforward to have different and multiple teacher policies in each transfer step . The more general algorithm and several variants are presented in Section A . 4.1 REPRESENTATION TRANSFER : KICKSTARTED TRAINING . In representation transfer , we use a kickstarting training pipeline ( Schmitt et al. , 2018 ) , which can be viewed as a combination of policy distillation ( Rusu et al. , 2015 ) and population based training ( Jaderberg et al. , 2017 ) . The main idea is to employ an auxiliary loss function which encourages the student policy to be close to the teacher policy on the trajectories sampled by the student . Given a teacher policy πteacher , we introduce the auxiliary loss as Ldistill ( θ ) = H ( πteacher ( a|s ) ‖πθ ( a|s ) ) , ( 4.1 ) where H ( ·‖· ) is the cross-entropy . In order for the agent to maximize its own future rewards , kickstarting adds the above loss to the Clipped PPO objective function , i.e. , equation 3.5 , weighted at optimization iteration k by the scaling βk ≥ 0 : LkRL ( θ ) = Lclip ( θ ) − βkLdistill ( θ ) . ( 4.2 ) Algorithm 1 REPAINT algorithm with Clipped PPO for iteration k = 1 , 2 , . . . do if k is odd then Collect trajectories S = { ( s , a , s′ , r ) } following πθold ( s ) Fit state value network Vν using S to update ν Compute advantage estimates Â1 , . . . , ÂT using equation 3.4 Perform gradient optimization on LkRL ( θ ) defined in equation 4.2 // representation transfer else Collect trajectories S ′ = { ( s , a , s′ ) } following πteacher ( s ) // instance transfer Compute r for each transition using current reward function and add to S ′ Compute advantage estimates Â′1 , . . . , Â ′ T ′ using equation 3.4 for t=1 , . . . , T ′ do if Â′t < ζ then Remove Â′t and the corresponding transition ( st , at , st+1 , rt ) from S ′ Perform gradient optimization on Lclip ( θ ) defined in equation 3.5 In our experiments , the weighting parameter βk is relatively large at early iterations , and vanishes as k increases , which is expected to improve the initial performance of the agent while keeping it focused on the current task in later iterations .
The proposed method relies on kickstarting, thus using policy distillation as an auxiliary loss for transferring from a source task to a target task, as a starting point. In addition, the authors add 'instance transfer', i.e., selecting some prioritized data from the source task to be used to train the target task. The combination of these two features produces fairly strong performance on various transfer experiments in four simulation environments.
SP:86d5bb0c199f89e0ba8cb44a30199400add61308
REPAINT: Knowledge Transfer in Deep Actor-Critic Reinforcement Learning
1 INTRODUCTION . Most reinforcement learning methods train an agent from scratch , typically requiring a huge amount of time and computing resources . Accelerating the learning processes for complex tasks has been one of the most challenging problems in reinforcement learning ( Kaelbling et al. , 1996 ; Sutton & Barto , 2018 ) . In the past few years , deep reinforcement learning has become more ubiquitous to solve sequential decision-making problems in many real-world applications , such as game playing ( OpenAI et al. , 2019 ; Silver et al. , 2016 ) , robotics ( Kober et al. , 2013 ; OpenAI et al. , 2018 ) , and autonomous driving ( Sallab et al. , 2017 ) . The computational cost of learning grows as the task complexity increases in the real-world applications . Therefore , it is desirable for a learning algorithm to leverage knowledge acquired in one task to improve performance on other tasks . Transfer learning has achieved significant success in computer vision , natural language processing , and other knowledge engineering areas ( Pan & Yang , 2009 ) . In transfer learning , the teacher ( source ) and student ( target ) tasks are not necessarily drawn from the same distribution ( Taylor et al. , 2008a ) . The unseen student task may be a simple task which is similar to the previously trained tasks , or a complex task with traits borrowed from significantly different teacher tasks . Despite the prevalence of direct weight transfer , knowledge transfer from previously trained agents for reinforcement learning tasks has not been gaining much attention until recently ( Barreto et al. , 2019 ; Ma et al. , 2018 ; Schmitt et al. , 2018 ; Lazaric , 2012 ; Taylor & Stone , 2009 ) . In this work , we propose a knowledge transfer algorithm for deep actor-critic reinforcement learning , i.e. , REPresentation And INstance Transfer ( REPAINT ) . The algorithm can be categorized as a representation-instance transfer approach . Specifically , in representation transfer , we adopt a kickstarted training method ( Schmitt et al. , 2018 ) using a previously trained teacher policy , where the teacher policy is used for computing the auxiliary loss during training . In instance transfer , we develop a new sampling algorithm for the replay buffer collected from the teacher policy , where we only keep the transitions that have advantage estimates greater than a threshold . The experimental results across several transfer learning tasks show that , regardless of the similarity between source and target tasks , by introducing knowledge transfer with REPAINT , the number of training iterations needed by the agent to achieve some reward target can be significantly reduced when compared to training from scratch and training with only representation transfer or instance transfer . Additionally , the agent ’ s asymptotic performance is also improved by REPAINT in comparison with the baselines . 2 RELATED WORK : TRANSFER REINFORCEMENT LEARNING . Transfer learning algorithms in reinforcement learning can be characterized by the definition of transferred knowledge , which contains the parameters of the reinforcement learning algorithm , the representation of the trained policy , and the instances collected from the environment ( Lazaric , 2012 ) . When the teacher and student tasks share the same state-action space and they are similar enough ( Ferns et al. , 2004 ; Phillips , 2006 ) , parameter transfer is the most straightforward approach , namely , one can initialize the policy or value network in the student tasks by that from teacher tasks ( Mehta et al. , 2008 ; Rajendran et al. , 2015 ) . Parameter transfer with different state-action variables is more complex , where the crucial aspect is to find a suitable mapping from the teacher state-action space to the student state-action space ( Gupta et al. , 2017 ; Talvitie & Singh , 2007 ; Taylor et al. , 2008b ) . Most of the transfer learning algorithms fall into the category of representation transfer , where the reinforcement learning algorithm learns a specific representation of the task or the solution , and the transfer algorithm performs an abstraction process to fit it into the student task . Konidaris et al . ( 2012 ) uses the reward shaping approach to learn a portable shaping function for knowledge transfer , while some other works use neural networks for feature abstraction ( Duan et al. , 2016 ; Parisotto et al. , 2015 ; Zhang et al. , 2018 ) . Policy distillation ( Rusu et al. , 2015 ) or its variants is another popular choice for learning the teacher task representation , where the student policy aims to mimic the behavior of pre-trained teacher policies during its own learning process ( Schmitt et al. , 2018 ; Yin & Pan , 2017 ) . Recently , successor representation has been widely used in transfer reinforcement learning , in which the rewards are assumed to share some common features , so that the value function can be simply written as a linear combination of the successor features ( SF ) ( Barreto et al. , 2017 ; Madarasz & Behrens , 2019 ) . Barreto et al . ( 2019 ) extends the method of using SF and generalised policy improvement in Q-learning ( Sutton & Barto , 2018 ) to more general environments . Borsa et al . ( 2018 ) , Ma et al . ( 2018 ) , and Schaul et al . ( 2015a ) learn a universal SF approximator for transfer . The basic idea of instance transfer algorithms is that the transfer of teacher samples may improve the learning on student tasks . Lazaric et al . ( 2008 ) and Tirinzoni et al . ( 2018 ) selectively transfer samples on the basis of the compliance between tasks in a model-free algorithm , while Taylor et al . ( 2008a ) studies how a model-based algorithm can benefit from samples coming from the teacher task . However , most of the aforementioned algorithms either assume specific forms of reward functions or perform well only when the teacher and student tasks are similar . Additionally , very few algorithms are designated to actor-critic reinforcement learning . In this work , we propose a representationinstance transfer algorithm to handle the generic cases of task similarity , which is also naturally fitted for actor-critic algorithms and can be easily extended to other policy gradient based algorithms . 3 BACKGROUND : ACTOR-CRITIC REINFORCEMENT LEARNING . A general reinforcement learning ( RL ) agent interacting with environment can be modeled in a Markov decision process ( MDP ) , which is defined by a tuple M = ( S , A , p , r , γ ) , where S and A are sets of states and actions , respectively . The state transfer function p ( ·|s , a ) maps a state and action pair to a probability distribution over states . r : S × A× S → R denotes the reward function that determines a reward received by the agent for a transition from ( s , a ) to s′ . The discount factor , γ ∈ [ 0 , 1 ] , provides means to obtain a long-term objective . Specifically , the goal of an RL agent is to learn a policy π that maps a state to a probability distribution over actions at each time step t , so that at ∼ π ( ·|st ) maximizes the accumulated discounted return ∑ t≥0 γ tr ( st , at , st+1 ) . To address this problem , a popular choice to adopt is the model-free actor-critic architecture , e.g. , Konda & Tsitsiklis ( 2000 ) ; Degris et al . ( 2012 ) ; Mnih et al . ( 2016 ) ; Schulman et al . ( 2015a ; 2017 ) , where the critic estimates the value function and the actor updates the policy distribution in the direction suggested by the critic . The state value function at time t is defined as V π ( s ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s . ( 3.1 ) Similarly , the action value function ( also called Q function ) is defined by Qπ ( s , a ) = Eai∼π ( ·|si ) ∑ i≥t γi−tr ( si , ai , si+1 ) ∣∣∣∣st = s , at = a . ( 3.2 ) The actor-critic methods usually rely on the advantage function , which is computed as Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . ( 3.3 ) Intuitively , the advantage can be taken as the extra reward that could be obtained by taking a particular action a . The advantage is usually approximated by generalized advantage estimator ( GAE ) ( Schulman et al. , 2015b ) , which is defined as the exponentially-weighted average of the k-step discounted advantage , namely , Ât = Â GAE ( γ , λ ) t : = ∞∑ l=0 ( γλ ) l ( rt+l + γV π ( st+l+1 ) − V π ( st+l ) ) , ( 3.4 ) where the parameter 0 ≤ λ ≤ 1 allows a trade-off of the bias and variance . In deep RL , the critic and actor functions are usually parameterized by neural networks . Then the policy gradient methods can be used to update the actor network . For example , in the clipped proximal policy optimization ( Clipped PPO ) ( Schulman et al. , 2017 ) , the policy ’ s objective function is defined to be the minimum between the standard surrogate objective and an clipped objective : Lclip ( θ ) = Êt [ min ( rt ( θ ) · Ât , clip ( rt ( θ ) , 1− , 1 + ) · Ât ) ] , ( 3.5 ) where the policy π is parameterized by θ , and rt ( θ ) is the likelihood ratio that rt ( θ ) = πθ ( at|st ) πθold ( at|st ) . ( 3.6 ) Moreover , the clip function truncates rt ( θ ) to the range of ( 1− , 1 + ) . 4 REPRESENTATION AND INSTANCE TRANSFER IN ACTOR-CRITIC RL . In this section , we describe our knowledge transfer algorithm , REPAINT , for actor-critic RL framework . There are two core concepts underlying our approach , i.e. , representation transfer and instance transfer . In the representation transfer , we employ a kickstarted training approach ( Schmitt et al. , 2018 ) based on the policy distillation . Then , in the next iteration following the kickstarting , we update the student policy using an advantage-based experience replay . We do not assume that the teacher and student tasks are similar or drawn from the same distribution . The REPAINT algorithm is provided in Algorithm 1 , where the value function and policy function are parameterized by ν and θ , respectively . Without loss of generality , we demonstrate the policy update using the Clipped PPO loss stated in equation 3.5 , and use a single teacher policy in both representation and instance transfers . In practice , it can be directly applied to any advantage-based policy gradient RL algorithms , and it is straightforward to have different and multiple teacher policies in each transfer step . The more general algorithm and several variants are presented in Section A . 4.1 REPRESENTATION TRANSFER : KICKSTARTED TRAINING . In representation transfer , we use a kickstarting training pipeline ( Schmitt et al. , 2018 ) , which can be viewed as a combination of policy distillation ( Rusu et al. , 2015 ) and population based training ( Jaderberg et al. , 2017 ) . The main idea is to employ an auxiliary loss function which encourages the student policy to be close to the teacher policy on the trajectories sampled by the student . Given a teacher policy πteacher , we introduce the auxiliary loss as Ldistill ( θ ) = H ( πteacher ( a|s ) ‖πθ ( a|s ) ) , ( 4.1 ) where H ( ·‖· ) is the cross-entropy . In order for the agent to maximize its own future rewards , kickstarting adds the above loss to the Clipped PPO objective function , i.e. , equation 3.5 , weighted at optimization iteration k by the scaling βk ≥ 0 : LkRL ( θ ) = Lclip ( θ ) − βkLdistill ( θ ) . ( 4.2 ) Algorithm 1 REPAINT algorithm with Clipped PPO for iteration k = 1 , 2 , . . . do if k is odd then Collect trajectories S = { ( s , a , s′ , r ) } following πθold ( s ) Fit state value network Vν using S to update ν Compute advantage estimates Â1 , . . . , ÂT using equation 3.4 Perform gradient optimization on LkRL ( θ ) defined in equation 4.2 // representation transfer else Collect trajectories S ′ = { ( s , a , s′ ) } following πteacher ( s ) // instance transfer Compute r for each transition using current reward function and add to S ′ Compute advantage estimates Â′1 , . . . , Â ′ T ′ using equation 3.4 for t=1 , . . . , T ′ do if Â′t < ζ then Remove Â′t and the corresponding transition ( st , at , st+1 , rt ) from S ′ Perform gradient optimization on Lclip ( θ ) defined in equation 3.5 In our experiments , the weighting parameter βk is relatively large at early iterations , and vanishes as k increases , which is expected to improve the initial performance of the agent while keeping it focused on the current task in later iterations .
This paper deals with transfer learning in RL. The problem broadly defined is to improve performance of an agent on a new task, given an agent (teacher) trained on a previous (different) task. There are multiple approaches to this from fine-tuning, distillation to instance transfer. A central question in this field is how to transfer learned useful behavior even when task similarity is low. While most methods would work well on similar tasks, naively applying, for example distillation, would hurt when training on a very different target task.
SP:86d5bb0c199f89e0ba8cb44a30199400add61308
Learning to Plan Optimistically: Uncertainty-Guided Deep Exploration via Latent Model Ensembles
1 INTRODUCTION . The ability to learn complex behaviors through interaction will enable the autonomous deployment of various robotic systems in the real world . Reinforcement learning ( RL ) provides a key framework for realizing these capabilities , but efficiency of the learning process remains a prevalent concern . Reallife applications yield complex planning problems due to high-dimensional environment states , which are further exacerbated by the agent ’ s continuous actions space . For RL to enable real-world autonomy , it therefore becomes crucial to determine efficient representations of the underlying planning problem , while formulating interaction strategies capable of exploring the resulting representation efficiently . In traditional controls , planning problems are commonly formulated based on the underlying statespace representation . This may inhibit efficient learning when the environment states are highdimensional or their dynamics are susceptible to non-smooth events such as singularities and discontinuities ( Schrittwieser et al. , 2019 ; Hwangbo et al. , 2019 ; Yang et al. , 2019 ) . It may then be desirable for the agent to abstract a latent representation that facilitates efficient learning ( Ha & Schmidhuber , 2018 ; Zhang et al. , 2019 ; Lee et al. , 2019 ) . The latent representation may then be leveraged either in a model-free or model-based setting . Model-free techniques estimate state-values directly from observed data to distill a policy mapping . Model-based techniques learn an explicit representation of the environment that is leveraged in generating fictitious interactions and enable policy learning in imagination ( Hafner et al. , 2019a ) . While the former reduces potential sources of bias , the latter offers a structured representation encoding deeper insights into underlying environment behavior . The agent should leverage the chosen representation to efficiently identify and explore informative interactions . We provide a motivational one-dimensional example of a potential action-value mapping in Figure 1 ( left ) . The true function and its samples are visualized in red with the true maximum denoted by the green dot . Relying only on the predicted mean can bias policy learning towards local optima ( orange dot ; Sutton & Barto ( 2018 ) ) , while added stochasticity can waste samples on un-informative interactions . Auxiliary information-gain objectives integrate predicted uncertainty , however , uncertain environment behavior does not equate to potential for improvement ( pink dot ) . It is desirable to focus exploration on interactions that harbor potential for improving overall performance . Combining mean performance estimates with the associated uncertainty into an upper confidence bound ( UCB ) objective provides a concise method of doing so ( blue dot ; Auer et al . ( 2002 ) ; Krause & Ong ( 2011 ) ) . The underlying uncertainty can be explicitly represented by maintaining an ensemble of hypothesis on environment behavior ( Osband et al. , 2016 ; Lakshminarayanan et al. , 2017 ) . Figure 1 ( right ) demonstrates this selective uncertainty reduction by showcasing forward predictions of a ensembled model on two motion patterns of a walker agent . The expected high-reward walking behavior has been sufficiently explored and model hypotheses strongly agree ( top ) , while little effort has been extended to reduce uncertainty over the expected low-reward falling behavior ( bottom ) . This paper demonstrates that exploring interactions through imagined positive futures can yield information-dense sampling and data-efficient learning . We present latent optimistic value exploration ( LOVE ) , an algorithm that leverages optimism in the face of uncertain long-term rewards in guiding exploration . Potential futures are imagined by an ensemble of latent variable models and their predicted infinite-horizon performance is obtained in combination with associated value function estimates . Training on a UCB objective over imagined futures yields a policy that behaves inherently optimistic and focuses on interactions with the potential to improve performance under the current world model . This provides a concise , differentiable framework for driving deep exploration while not relying on stochasticity . We present empirical results on challenging visual control tasks that highlight the necessity for deep exploration in scenarios with sparse reward signals , and demonstrate improved sample-efficiency on a selection of benchmarking environments from the DeepMind Control Suite ( Tassa et al. , 2018 ) . We compare to both Dreamer ( Hafner et al. , 2019a ) , the current state-of-the-art model-based agent , and DrQ ( Kostrikov et al. , 2020 ) , a concurrent model-free approach . 2 RELATED WORK . Problem representation Model-free approaches learn a policy by directly estimating performance from interaction data . While their asymptotic performance previously came at the cost of sample complexity ( Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) , recent advances in representation learning through contrastive methods and data augmentation have improved their efficiency ( Srinivas et al. , 2020 ; Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) . However , their implicit representation of the world can make generalization of learned behaviors under changing task specifications difficult . Model-based techniques leverage a structured representation of their environment that enables them to imagine potential interactions . The nature of the problem hereby dictates model complexity , ranging from linear ( Levine & Abbeel , 2014 ; Kumar et al. , 2016 ) , over Gaussian process models ( Deisenroth & Rasmussen , 2011 ; Kamthe & Deisenroth , 2018 ) to deep neural networks ( Chua et al. , 2018 ; Clavera et al. , 2018 ) . In high-dimensional environments , latent variable models can provide concise representations that improve efficiency of the learning process ( Watter et al. , 2015 ; Ha & Schmidhuber , 2018 ; Lee et al. , 2019 ; Hafner et al. , 2019a ) . Planning interactions Model-based approaches leverage their representation of the world in predicting the performance of action sequences . The agent may then either solve a model predictive control-style optimization ( Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Hafner et al. , 2019b ) or train a policy in simulation ( Kurutach et al. , 2018 ; Clavera et al. , 2018 ) . The resulting finite-horizon formulations can be extended by value function estimates to approximate an infinite-horizon planning problem ( Lowrey et al. , 2019 ; Hafner et al. , 2019a ; Seyde et al. , 2020 ) . When considering learned models , ensembling the model predictions may further be leveraged in debiasing the actor strategy during training ( Kurutach et al. , 2018 ; Chua et al. , 2018 ; Clavera et al. , 2018 ; Seyde et al. , 2020 ) . Both explicit and implicit model rollouts in combination with value estimates can also be utilized to accelerate model-free learning ( Oh et al. , 2017 ; Feinberg et al. , 2018 ; Buckman et al. , 2018 ) . Directed exploration Directed exploration can improve over random exploration by focusing on information-dense interactions ( Schmidhuber , 2010 ) . These methods are commonly driven by uncertainty estimates . Information gain techniques define an auxiliary objective that encourages exploration of unexpected environment behavior or model disagreement and have been applied in discrete ( Stadie et al. , 2015 ; Ostrovski et al. , 2017 ; Pathak et al. , 2017 ) and continuous actions spaces ( Still & Precup , 2012 ; Houthooft et al. , 2016 ; Henaff , 2019 ) . When driving interactions to improve knowledge of the environment dynamics , effort may be wasted on uncertain interactions that are tangential to the objective . Alternatively , exploration can be driven by uncertainty over expected performance as encoded by value functions ( Osband et al. , 2016 ; 2017 ; Chen et al. , 2017 ; O ’ Donoghue et al. , 2018 ; Lee et al. , 2020 ) , multi-step imagined returns ( Depeweg et al. , 2018 ; Henaff et al. , 2019 ) or their combination ( Lowrey et al. , 2019 ; Schrittwieser et al. , 2019 ; Seyde et al. , 2020 ) . Model-ensemble agents Related work on ensemble agents has demonstrated impressive results . We note key differences to our approach . ME-TRPO ( Kurutach et al. , 2018 ) leverages a dynamics ensemble to debias policy optimization on finite-horizon returns under a known reward function and random exploration . MAX ( Shyam et al. , 2019 ) and Amos et al . ( 2018 ) explore via finite-horizon uncertainty in a state and latent dynamics ensemble , respectively . RP1 ( Ball et al. , 2020 ) explores in reward space via finite-horizon returns , but assumes access to the nominal reward function and full proprioceptive feedback . Seyde et al . ( 2020 ) also leverage full proprioception and embed optimism into the value function , which prohibits adjustment of the exploration trade-off during policy learning and limits transferability . Exploring uncertain dynamics samples interactions orthogonal to task completion and finite-horizon objectives limit exploration locally , while full-observability and access to the reward function are strong assumptions . We learn latent dynamics , reward and value functions in partially observable settings to explore uncertainty over infinite-horizon returns . This enables backpropagation through imagined trajectories to recover analytic policy gradients , while offering a flexible framework to guide exploration based on expected potential for long-term improvement . 3 PRELIMINARIES . In the following , we first introduce the general problem definition and the associated nomenclature . We then provide an overview of the representation learning framework used to abstract environment behavior , which leverages the recurrent state space model ( RSSM ) proposed by Hafner et al . ( 2019a ) . 3.1 PROBLEM FORMULATION . We formulate the underlying optimization problem as a partially observable Markov decision process ( POMDP ) defined by the tuple { X , A , T , R , Ω , O , γ } , where X , A , O denote the state , action and observation space , respectively , T : X ×A → X signifies the transition mapping , R : X ×A → R the reward mapping , Ω : X → O the observation mapping , and γ ∈ [ 0 , 1 ) is the discount factor . We define xt and at to be the state and action at time t , respectively , and use the notation rt = R ( xt , at ) . Let πφ ( at|ot ) denote a policy parameterized by φ and define the discounted infinite horizon return Gt = ∑∞ τ=t γ τ−tR ( xτ , aτ ) , where xt+1 ∼ T ( xt+1|xt , at ) and at ∼ πφ ( at|ot ) . The goal is then to learn the optimal policy maximizing Gt under unknown nominal dynamics and reward mappings . 3.2 PLANNING FROM PIXELS . We build on the world model introduced in Hafner et al . ( 2019b ) and refined in Hafner et al . ( 2019a ) . High-dimensional image observations are first embedded into a low-dimensional latent space using a neural network encoder . An RSSM then serves as a probabilistic transition model and defines the model state s. Together , the encoder and RSSM define the representation model . The agent therefore abstracts observation ot of environment state xt into model state st , which is leveraged for planning . Consistency of the learned representations is enforced by minimizing the reconstruction error of a decoder network in the observation model and the ability to predict rewards of the reward model . For details , we refer the reader to Hafner et al . ( 2019a ) , and provide their definitions of the models as Representation model : pθ ( st|st−1 , at−1 , ot ) Transition model : qθ ( st|st−1 , at−1 ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) , ( 1 ) where p and q denote distributions in latent space , with θ as their joint parameterization . The action model πφ ( at|st ) is then trained to optimize the predicted return of imagined world model rollouts . The world model is only rolled-out over a finite horizon H , but complemented by predictions from the value model vψ ( st ) at the terminal state st+H to approximate the infinite horizon return . The policy and value function are trained jointly using policy iteration on the objective functions maxφEqθ , qφ ( ∑t+H τ=t Vλ ( sτ ) ) , minψ Eqθ , qφ ( ∑t+H τ=t 1 2‖vψ ( sτ ) − Vλ ( sτ ) ‖ 2 ) , ( 2 ) respectively . Here , Vλ ( sτ ) represents an exponentially recency-weighted average of the k-step value estimates V kN ( sτ ) along the trajectory to stabilize the learning ( Sutton & Barto , 2018 ) , such that Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1V nN ( sτ ) + λ H−1V HN ( sτ ) , V kN ( sτ ) . = Eqθ , qφ ( h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) ) , ( 3 ) with h = min ( τ + k , t+H ) .
The paper proposes LOVE, an adaptation of DOVE (Seyde’20) to latent variable predictive models (Seyde’20 only condsidered predictive models without latent variables). Seyde’20 proposes to use a generalization of Upper Confidence Bound to deep model-based RL, by training an ensemble of models and value functions, and training a policy to maximize mean + variance of this ensemble (similarly to Lowrey’19). The submission empirically demonstrates that tuning the learning rate and number of training steps per environment steps of Dreamer (Hafner’20) improves sample efficiency, using an ensemble of predictive models further improves data efficiency slightly (on cartpole and walker tasks), while on top of that the proposed exploration method slightly improves sample efficiency on the Hopper and sparse Cartpole tasks.
SP:e5629c2dd2fcd0113b302aabd5618a64a20fcdfa
Learning to Plan Optimistically: Uncertainty-Guided Deep Exploration via Latent Model Ensembles
1 INTRODUCTION . The ability to learn complex behaviors through interaction will enable the autonomous deployment of various robotic systems in the real world . Reinforcement learning ( RL ) provides a key framework for realizing these capabilities , but efficiency of the learning process remains a prevalent concern . Reallife applications yield complex planning problems due to high-dimensional environment states , which are further exacerbated by the agent ’ s continuous actions space . For RL to enable real-world autonomy , it therefore becomes crucial to determine efficient representations of the underlying planning problem , while formulating interaction strategies capable of exploring the resulting representation efficiently . In traditional controls , planning problems are commonly formulated based on the underlying statespace representation . This may inhibit efficient learning when the environment states are highdimensional or their dynamics are susceptible to non-smooth events such as singularities and discontinuities ( Schrittwieser et al. , 2019 ; Hwangbo et al. , 2019 ; Yang et al. , 2019 ) . It may then be desirable for the agent to abstract a latent representation that facilitates efficient learning ( Ha & Schmidhuber , 2018 ; Zhang et al. , 2019 ; Lee et al. , 2019 ) . The latent representation may then be leveraged either in a model-free or model-based setting . Model-free techniques estimate state-values directly from observed data to distill a policy mapping . Model-based techniques learn an explicit representation of the environment that is leveraged in generating fictitious interactions and enable policy learning in imagination ( Hafner et al. , 2019a ) . While the former reduces potential sources of bias , the latter offers a structured representation encoding deeper insights into underlying environment behavior . The agent should leverage the chosen representation to efficiently identify and explore informative interactions . We provide a motivational one-dimensional example of a potential action-value mapping in Figure 1 ( left ) . The true function and its samples are visualized in red with the true maximum denoted by the green dot . Relying only on the predicted mean can bias policy learning towards local optima ( orange dot ; Sutton & Barto ( 2018 ) ) , while added stochasticity can waste samples on un-informative interactions . Auxiliary information-gain objectives integrate predicted uncertainty , however , uncertain environment behavior does not equate to potential for improvement ( pink dot ) . It is desirable to focus exploration on interactions that harbor potential for improving overall performance . Combining mean performance estimates with the associated uncertainty into an upper confidence bound ( UCB ) objective provides a concise method of doing so ( blue dot ; Auer et al . ( 2002 ) ; Krause & Ong ( 2011 ) ) . The underlying uncertainty can be explicitly represented by maintaining an ensemble of hypothesis on environment behavior ( Osband et al. , 2016 ; Lakshminarayanan et al. , 2017 ) . Figure 1 ( right ) demonstrates this selective uncertainty reduction by showcasing forward predictions of a ensembled model on two motion patterns of a walker agent . The expected high-reward walking behavior has been sufficiently explored and model hypotheses strongly agree ( top ) , while little effort has been extended to reduce uncertainty over the expected low-reward falling behavior ( bottom ) . This paper demonstrates that exploring interactions through imagined positive futures can yield information-dense sampling and data-efficient learning . We present latent optimistic value exploration ( LOVE ) , an algorithm that leverages optimism in the face of uncertain long-term rewards in guiding exploration . Potential futures are imagined by an ensemble of latent variable models and their predicted infinite-horizon performance is obtained in combination with associated value function estimates . Training on a UCB objective over imagined futures yields a policy that behaves inherently optimistic and focuses on interactions with the potential to improve performance under the current world model . This provides a concise , differentiable framework for driving deep exploration while not relying on stochasticity . We present empirical results on challenging visual control tasks that highlight the necessity for deep exploration in scenarios with sparse reward signals , and demonstrate improved sample-efficiency on a selection of benchmarking environments from the DeepMind Control Suite ( Tassa et al. , 2018 ) . We compare to both Dreamer ( Hafner et al. , 2019a ) , the current state-of-the-art model-based agent , and DrQ ( Kostrikov et al. , 2020 ) , a concurrent model-free approach . 2 RELATED WORK . Problem representation Model-free approaches learn a policy by directly estimating performance from interaction data . While their asymptotic performance previously came at the cost of sample complexity ( Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) , recent advances in representation learning through contrastive methods and data augmentation have improved their efficiency ( Srinivas et al. , 2020 ; Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) . However , their implicit representation of the world can make generalization of learned behaviors under changing task specifications difficult . Model-based techniques leverage a structured representation of their environment that enables them to imagine potential interactions . The nature of the problem hereby dictates model complexity , ranging from linear ( Levine & Abbeel , 2014 ; Kumar et al. , 2016 ) , over Gaussian process models ( Deisenroth & Rasmussen , 2011 ; Kamthe & Deisenroth , 2018 ) to deep neural networks ( Chua et al. , 2018 ; Clavera et al. , 2018 ) . In high-dimensional environments , latent variable models can provide concise representations that improve efficiency of the learning process ( Watter et al. , 2015 ; Ha & Schmidhuber , 2018 ; Lee et al. , 2019 ; Hafner et al. , 2019a ) . Planning interactions Model-based approaches leverage their representation of the world in predicting the performance of action sequences . The agent may then either solve a model predictive control-style optimization ( Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Hafner et al. , 2019b ) or train a policy in simulation ( Kurutach et al. , 2018 ; Clavera et al. , 2018 ) . The resulting finite-horizon formulations can be extended by value function estimates to approximate an infinite-horizon planning problem ( Lowrey et al. , 2019 ; Hafner et al. , 2019a ; Seyde et al. , 2020 ) . When considering learned models , ensembling the model predictions may further be leveraged in debiasing the actor strategy during training ( Kurutach et al. , 2018 ; Chua et al. , 2018 ; Clavera et al. , 2018 ; Seyde et al. , 2020 ) . Both explicit and implicit model rollouts in combination with value estimates can also be utilized to accelerate model-free learning ( Oh et al. , 2017 ; Feinberg et al. , 2018 ; Buckman et al. , 2018 ) . Directed exploration Directed exploration can improve over random exploration by focusing on information-dense interactions ( Schmidhuber , 2010 ) . These methods are commonly driven by uncertainty estimates . Information gain techniques define an auxiliary objective that encourages exploration of unexpected environment behavior or model disagreement and have been applied in discrete ( Stadie et al. , 2015 ; Ostrovski et al. , 2017 ; Pathak et al. , 2017 ) and continuous actions spaces ( Still & Precup , 2012 ; Houthooft et al. , 2016 ; Henaff , 2019 ) . When driving interactions to improve knowledge of the environment dynamics , effort may be wasted on uncertain interactions that are tangential to the objective . Alternatively , exploration can be driven by uncertainty over expected performance as encoded by value functions ( Osband et al. , 2016 ; 2017 ; Chen et al. , 2017 ; O ’ Donoghue et al. , 2018 ; Lee et al. , 2020 ) , multi-step imagined returns ( Depeweg et al. , 2018 ; Henaff et al. , 2019 ) or their combination ( Lowrey et al. , 2019 ; Schrittwieser et al. , 2019 ; Seyde et al. , 2020 ) . Model-ensemble agents Related work on ensemble agents has demonstrated impressive results . We note key differences to our approach . ME-TRPO ( Kurutach et al. , 2018 ) leverages a dynamics ensemble to debias policy optimization on finite-horizon returns under a known reward function and random exploration . MAX ( Shyam et al. , 2019 ) and Amos et al . ( 2018 ) explore via finite-horizon uncertainty in a state and latent dynamics ensemble , respectively . RP1 ( Ball et al. , 2020 ) explores in reward space via finite-horizon returns , but assumes access to the nominal reward function and full proprioceptive feedback . Seyde et al . ( 2020 ) also leverage full proprioception and embed optimism into the value function , which prohibits adjustment of the exploration trade-off during policy learning and limits transferability . Exploring uncertain dynamics samples interactions orthogonal to task completion and finite-horizon objectives limit exploration locally , while full-observability and access to the reward function are strong assumptions . We learn latent dynamics , reward and value functions in partially observable settings to explore uncertainty over infinite-horizon returns . This enables backpropagation through imagined trajectories to recover analytic policy gradients , while offering a flexible framework to guide exploration based on expected potential for long-term improvement . 3 PRELIMINARIES . In the following , we first introduce the general problem definition and the associated nomenclature . We then provide an overview of the representation learning framework used to abstract environment behavior , which leverages the recurrent state space model ( RSSM ) proposed by Hafner et al . ( 2019a ) . 3.1 PROBLEM FORMULATION . We formulate the underlying optimization problem as a partially observable Markov decision process ( POMDP ) defined by the tuple { X , A , T , R , Ω , O , γ } , where X , A , O denote the state , action and observation space , respectively , T : X ×A → X signifies the transition mapping , R : X ×A → R the reward mapping , Ω : X → O the observation mapping , and γ ∈ [ 0 , 1 ) is the discount factor . We define xt and at to be the state and action at time t , respectively , and use the notation rt = R ( xt , at ) . Let πφ ( at|ot ) denote a policy parameterized by φ and define the discounted infinite horizon return Gt = ∑∞ τ=t γ τ−tR ( xτ , aτ ) , where xt+1 ∼ T ( xt+1|xt , at ) and at ∼ πφ ( at|ot ) . The goal is then to learn the optimal policy maximizing Gt under unknown nominal dynamics and reward mappings . 3.2 PLANNING FROM PIXELS . We build on the world model introduced in Hafner et al . ( 2019b ) and refined in Hafner et al . ( 2019a ) . High-dimensional image observations are first embedded into a low-dimensional latent space using a neural network encoder . An RSSM then serves as a probabilistic transition model and defines the model state s. Together , the encoder and RSSM define the representation model . The agent therefore abstracts observation ot of environment state xt into model state st , which is leveraged for planning . Consistency of the learned representations is enforced by minimizing the reconstruction error of a decoder network in the observation model and the ability to predict rewards of the reward model . For details , we refer the reader to Hafner et al . ( 2019a ) , and provide their definitions of the models as Representation model : pθ ( st|st−1 , at−1 , ot ) Transition model : qθ ( st|st−1 , at−1 ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) , ( 1 ) where p and q denote distributions in latent space , with θ as their joint parameterization . The action model πφ ( at|st ) is then trained to optimize the predicted return of imagined world model rollouts . The world model is only rolled-out over a finite horizon H , but complemented by predictions from the value model vψ ( st ) at the terminal state st+H to approximate the infinite horizon return . The policy and value function are trained jointly using policy iteration on the objective functions maxφEqθ , qφ ( ∑t+H τ=t Vλ ( sτ ) ) , minψ Eqθ , qφ ( ∑t+H τ=t 1 2‖vψ ( sτ ) − Vλ ( sτ ) ‖ 2 ) , ( 2 ) respectively . Here , Vλ ( sτ ) represents an exponentially recency-weighted average of the k-step value estimates V kN ( sτ ) along the trajectory to stabilize the learning ( Sutton & Barto , 2018 ) , such that Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1V nN ( sτ ) + λ H−1V HN ( sτ ) , V kN ( sτ ) . = Eqθ , qφ ( h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) ) , ( 3 ) with h = min ( τ + k , t+H ) .
This paper proposes LOVE (Latent Optimistic Value Exploration), a model-based exploration algorithm for POMDP or pixel-based control systems. The method builds upon Dreamer (Hafner et al. 2019) for learning latent models, and the variance of value estimates (one transition/reward/value model per particle) estimates the epistemic uncertainty of the world, which can be used as a UCB-style exploration reward. LOVE can achieve a comparable or better performance on a simple pointmass environment with a trap and standard DeepMind continuous control suites.
SP:e5629c2dd2fcd0113b302aabd5618a64a20fcdfa
Learning to Plan Optimistically: Uncertainty-Guided Deep Exploration via Latent Model Ensembles
1 INTRODUCTION . The ability to learn complex behaviors through interaction will enable the autonomous deployment of various robotic systems in the real world . Reinforcement learning ( RL ) provides a key framework for realizing these capabilities , but efficiency of the learning process remains a prevalent concern . Reallife applications yield complex planning problems due to high-dimensional environment states , which are further exacerbated by the agent ’ s continuous actions space . For RL to enable real-world autonomy , it therefore becomes crucial to determine efficient representations of the underlying planning problem , while formulating interaction strategies capable of exploring the resulting representation efficiently . In traditional controls , planning problems are commonly formulated based on the underlying statespace representation . This may inhibit efficient learning when the environment states are highdimensional or their dynamics are susceptible to non-smooth events such as singularities and discontinuities ( Schrittwieser et al. , 2019 ; Hwangbo et al. , 2019 ; Yang et al. , 2019 ) . It may then be desirable for the agent to abstract a latent representation that facilitates efficient learning ( Ha & Schmidhuber , 2018 ; Zhang et al. , 2019 ; Lee et al. , 2019 ) . The latent representation may then be leveraged either in a model-free or model-based setting . Model-free techniques estimate state-values directly from observed data to distill a policy mapping . Model-based techniques learn an explicit representation of the environment that is leveraged in generating fictitious interactions and enable policy learning in imagination ( Hafner et al. , 2019a ) . While the former reduces potential sources of bias , the latter offers a structured representation encoding deeper insights into underlying environment behavior . The agent should leverage the chosen representation to efficiently identify and explore informative interactions . We provide a motivational one-dimensional example of a potential action-value mapping in Figure 1 ( left ) . The true function and its samples are visualized in red with the true maximum denoted by the green dot . Relying only on the predicted mean can bias policy learning towards local optima ( orange dot ; Sutton & Barto ( 2018 ) ) , while added stochasticity can waste samples on un-informative interactions . Auxiliary information-gain objectives integrate predicted uncertainty , however , uncertain environment behavior does not equate to potential for improvement ( pink dot ) . It is desirable to focus exploration on interactions that harbor potential for improving overall performance . Combining mean performance estimates with the associated uncertainty into an upper confidence bound ( UCB ) objective provides a concise method of doing so ( blue dot ; Auer et al . ( 2002 ) ; Krause & Ong ( 2011 ) ) . The underlying uncertainty can be explicitly represented by maintaining an ensemble of hypothesis on environment behavior ( Osband et al. , 2016 ; Lakshminarayanan et al. , 2017 ) . Figure 1 ( right ) demonstrates this selective uncertainty reduction by showcasing forward predictions of a ensembled model on two motion patterns of a walker agent . The expected high-reward walking behavior has been sufficiently explored and model hypotheses strongly agree ( top ) , while little effort has been extended to reduce uncertainty over the expected low-reward falling behavior ( bottom ) . This paper demonstrates that exploring interactions through imagined positive futures can yield information-dense sampling and data-efficient learning . We present latent optimistic value exploration ( LOVE ) , an algorithm that leverages optimism in the face of uncertain long-term rewards in guiding exploration . Potential futures are imagined by an ensemble of latent variable models and their predicted infinite-horizon performance is obtained in combination with associated value function estimates . Training on a UCB objective over imagined futures yields a policy that behaves inherently optimistic and focuses on interactions with the potential to improve performance under the current world model . This provides a concise , differentiable framework for driving deep exploration while not relying on stochasticity . We present empirical results on challenging visual control tasks that highlight the necessity for deep exploration in scenarios with sparse reward signals , and demonstrate improved sample-efficiency on a selection of benchmarking environments from the DeepMind Control Suite ( Tassa et al. , 2018 ) . We compare to both Dreamer ( Hafner et al. , 2019a ) , the current state-of-the-art model-based agent , and DrQ ( Kostrikov et al. , 2020 ) , a concurrent model-free approach . 2 RELATED WORK . Problem representation Model-free approaches learn a policy by directly estimating performance from interaction data . While their asymptotic performance previously came at the cost of sample complexity ( Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Haarnoja et al. , 2018 ) , recent advances in representation learning through contrastive methods and data augmentation have improved their efficiency ( Srinivas et al. , 2020 ; Laskin et al. , 2020 ; Kostrikov et al. , 2020 ) . However , their implicit representation of the world can make generalization of learned behaviors under changing task specifications difficult . Model-based techniques leverage a structured representation of their environment that enables them to imagine potential interactions . The nature of the problem hereby dictates model complexity , ranging from linear ( Levine & Abbeel , 2014 ; Kumar et al. , 2016 ) , over Gaussian process models ( Deisenroth & Rasmussen , 2011 ; Kamthe & Deisenroth , 2018 ) to deep neural networks ( Chua et al. , 2018 ; Clavera et al. , 2018 ) . In high-dimensional environments , latent variable models can provide concise representations that improve efficiency of the learning process ( Watter et al. , 2015 ; Ha & Schmidhuber , 2018 ; Lee et al. , 2019 ; Hafner et al. , 2019a ) . Planning interactions Model-based approaches leverage their representation of the world in predicting the performance of action sequences . The agent may then either solve a model predictive control-style optimization ( Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Hafner et al. , 2019b ) or train a policy in simulation ( Kurutach et al. , 2018 ; Clavera et al. , 2018 ) . The resulting finite-horizon formulations can be extended by value function estimates to approximate an infinite-horizon planning problem ( Lowrey et al. , 2019 ; Hafner et al. , 2019a ; Seyde et al. , 2020 ) . When considering learned models , ensembling the model predictions may further be leveraged in debiasing the actor strategy during training ( Kurutach et al. , 2018 ; Chua et al. , 2018 ; Clavera et al. , 2018 ; Seyde et al. , 2020 ) . Both explicit and implicit model rollouts in combination with value estimates can also be utilized to accelerate model-free learning ( Oh et al. , 2017 ; Feinberg et al. , 2018 ; Buckman et al. , 2018 ) . Directed exploration Directed exploration can improve over random exploration by focusing on information-dense interactions ( Schmidhuber , 2010 ) . These methods are commonly driven by uncertainty estimates . Information gain techniques define an auxiliary objective that encourages exploration of unexpected environment behavior or model disagreement and have been applied in discrete ( Stadie et al. , 2015 ; Ostrovski et al. , 2017 ; Pathak et al. , 2017 ) and continuous actions spaces ( Still & Precup , 2012 ; Houthooft et al. , 2016 ; Henaff , 2019 ) . When driving interactions to improve knowledge of the environment dynamics , effort may be wasted on uncertain interactions that are tangential to the objective . Alternatively , exploration can be driven by uncertainty over expected performance as encoded by value functions ( Osband et al. , 2016 ; 2017 ; Chen et al. , 2017 ; O ’ Donoghue et al. , 2018 ; Lee et al. , 2020 ) , multi-step imagined returns ( Depeweg et al. , 2018 ; Henaff et al. , 2019 ) or their combination ( Lowrey et al. , 2019 ; Schrittwieser et al. , 2019 ; Seyde et al. , 2020 ) . Model-ensemble agents Related work on ensemble agents has demonstrated impressive results . We note key differences to our approach . ME-TRPO ( Kurutach et al. , 2018 ) leverages a dynamics ensemble to debias policy optimization on finite-horizon returns under a known reward function and random exploration . MAX ( Shyam et al. , 2019 ) and Amos et al . ( 2018 ) explore via finite-horizon uncertainty in a state and latent dynamics ensemble , respectively . RP1 ( Ball et al. , 2020 ) explores in reward space via finite-horizon returns , but assumes access to the nominal reward function and full proprioceptive feedback . Seyde et al . ( 2020 ) also leverage full proprioception and embed optimism into the value function , which prohibits adjustment of the exploration trade-off during policy learning and limits transferability . Exploring uncertain dynamics samples interactions orthogonal to task completion and finite-horizon objectives limit exploration locally , while full-observability and access to the reward function are strong assumptions . We learn latent dynamics , reward and value functions in partially observable settings to explore uncertainty over infinite-horizon returns . This enables backpropagation through imagined trajectories to recover analytic policy gradients , while offering a flexible framework to guide exploration based on expected potential for long-term improvement . 3 PRELIMINARIES . In the following , we first introduce the general problem definition and the associated nomenclature . We then provide an overview of the representation learning framework used to abstract environment behavior , which leverages the recurrent state space model ( RSSM ) proposed by Hafner et al . ( 2019a ) . 3.1 PROBLEM FORMULATION . We formulate the underlying optimization problem as a partially observable Markov decision process ( POMDP ) defined by the tuple { X , A , T , R , Ω , O , γ } , where X , A , O denote the state , action and observation space , respectively , T : X ×A → X signifies the transition mapping , R : X ×A → R the reward mapping , Ω : X → O the observation mapping , and γ ∈ [ 0 , 1 ) is the discount factor . We define xt and at to be the state and action at time t , respectively , and use the notation rt = R ( xt , at ) . Let πφ ( at|ot ) denote a policy parameterized by φ and define the discounted infinite horizon return Gt = ∑∞ τ=t γ τ−tR ( xτ , aτ ) , where xt+1 ∼ T ( xt+1|xt , at ) and at ∼ πφ ( at|ot ) . The goal is then to learn the optimal policy maximizing Gt under unknown nominal dynamics and reward mappings . 3.2 PLANNING FROM PIXELS . We build on the world model introduced in Hafner et al . ( 2019b ) and refined in Hafner et al . ( 2019a ) . High-dimensional image observations are first embedded into a low-dimensional latent space using a neural network encoder . An RSSM then serves as a probabilistic transition model and defines the model state s. Together , the encoder and RSSM define the representation model . The agent therefore abstracts observation ot of environment state xt into model state st , which is leveraged for planning . Consistency of the learned representations is enforced by minimizing the reconstruction error of a decoder network in the observation model and the ability to predict rewards of the reward model . For details , we refer the reader to Hafner et al . ( 2019a ) , and provide their definitions of the models as Representation model : pθ ( st|st−1 , at−1 , ot ) Transition model : qθ ( st|st−1 , at−1 ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) , ( 1 ) where p and q denote distributions in latent space , with θ as their joint parameterization . The action model πφ ( at|st ) is then trained to optimize the predicted return of imagined world model rollouts . The world model is only rolled-out over a finite horizon H , but complemented by predictions from the value model vψ ( st ) at the terminal state st+H to approximate the infinite horizon return . The policy and value function are trained jointly using policy iteration on the objective functions maxφEqθ , qφ ( ∑t+H τ=t Vλ ( sτ ) ) , minψ Eqθ , qφ ( ∑t+H τ=t 1 2‖vψ ( sτ ) − Vλ ( sτ ) ‖ 2 ) , ( 2 ) respectively . Here , Vλ ( sτ ) represents an exponentially recency-weighted average of the k-step value estimates V kN ( sτ ) along the trajectory to stabilize the learning ( Sutton & Barto , 2018 ) , such that Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1V nN ( sτ ) + λ H−1V HN ( sτ ) , V kN ( sτ ) . = Eqθ , qφ ( h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) ) , ( 3 ) with h = min ( τ + k , t+H ) .
The authors proposed latent optimistic value exploration (LOVE) as a mechanism to leverage optimistic exploration for continuous visual control. The main idea is to use a small (~5) ensemble of latent models with shared encoders (and therefore shared learned latent space) but different transition, reward and value models. The variance of predictions from this ensemble can be used as uncertainty estimates of each action sequence while the mean is the typical policy learning objective. Then LOVE puts more weighs on the states with high variance during exploration to enforce the agent to visit (optimistically) uncertain states. This is inherently optimistic because there is a positive bias (beta > 0 and var > 0) addition to the expected reward.
SP:e5629c2dd2fcd0113b302aabd5618a64a20fcdfa
Hidden Incentives for Auto-Induced Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy of predicting what users will click . This system can achieve better performance by either 1 ) making better predictions , or 2 ) changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad , and are sometimes even desirable . But they can cause problems if they occur unexpectedly . It is typical in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ( 2 ) will not happen . However , given the increasing real-world use of ML algorithms , we believe it is important to model and experimentally observe what happens when assumptions like this are violated . This is the motivation of our work . In many cases , including news recommendation , we would consider ( 2 ) a form of cheating—the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem ( e.g . ( 1 ) and/or ( 2 ) ) , but we only told it about the ends , so it didn ’ t know not to ’ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” : in this case , to maximize accuracy via ( 1 ) . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and “ side-effects ” , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : one means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation.1 The goal of our work is to provide insights and practical tools for understanding and managing incentives , specifically hidden incentives for auto-induced distributional shift : HI-ADS . To study which conditions cause HI-ADS to be revealed , we present unit tests for detecting HI-ADS in supervised learning ( SL ) and reinforcement learning ( RL ) . We also create an environment that models ADS in news recommendation , illustrating possible effects of revealing HI-ADS in this setting . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is ’ hidden ’ and we want it to remain hidden . A learner `` fails '' the unit test if it nonetheless pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) Jaderberg et al . ( 2017 ) ) can lead to high levels of failure . Similarly , recommender systems trained with PBT induce larger drifts in user base and user interests . These results suggest that failure of our unit tests indicates that an algorithm is prone to revealing HI-ADS in other settings . Finally , we propose and test a mitigation strategy we call context swapping . The strategy consists of rotating learners through different environments throughout learning , so that they can ’ t see the results or correlations of their actions in one environment over longer time horizons . This effectively mitigates HI-ADS in our unit test environments , but did not work well in content recommendation experiments . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves instantiating multiple learning scenarios which run in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Many recent works focus on multi-task meta-learning , where the OL seeks to find learning rules that generalize to unseen tasks by training the IL on a distribution of tasks ( Finn et al. , 2017 ) . Single-task meta-learning includes learning an optimizer for a single task ( Gong et al. , 2018 ) , and adaptive methods for selecting models ( Kalousis , 2000 ) or setting hyperparameters ( Snoek et al. , 2012 ) . For simplicity in this initial study we focus on single-task meta-learning . Population-based training ( PBT ; Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high- 1Note removing or hiding an incentive for a behavior is different from prohibiting that behavior , which may still occur incidentally . In particular , not having a ( revealed ) incentive for behaviors that change a human ’ s preferences , is not the same as having a ( revealed ) incentive for behaviors that preserve a human ’ s preferences . The first is often preferable ; we don ’ t want to prevent changes in human preferences that occur “ naturally ” , e.g . as a result of good arguments or evidence . performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In the example of content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In the example of content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix 8 . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present - e.g . for a crash prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . a1 a2 s1 s2 r1 r2 ( a ) RL : Incentives for ADS are present ; pursuing them is desirable a1 a2 s1 s2 r1 r2 ( b ) Myopic RL : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( c ) SL with ADS : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( d ) SL with i.i.d . data : Incentives for ADS are absent Figure 2 : The widely studied problems of reinforcement learning ( RL ) with state s , action a , reward r tuples , and i.i.d . supervised learning ( SL ) with inputs x , predictions ŷ and loss l ( a , d ) are free from incentive problems . We focus on cases where there are incentives present which the learner is not meant to pursue ( b , c ) . Lines show paths of influence . The learner may have incentives to influence any nodes descending from its action , A , or prediction , ŷ . Which incentives are undesirable ( orange ) or desirable ( cyan ) for the learner to pursue is context-dependent . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider an algorithm meant to alert drivers of imminent collisions . If it works well , such a system will help drivers avoid crashing , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL .
This paper introduces the concept of auto-induced distributional shift (ADS), and argues that some meta learning and reinforcement learning algorithms have the incentives to change the distribution so that the problem is easier to solve. The paper presents unit tests to detect hidden incentives for auto-induced distributional shift (HI-ADS) and also proposes context swapping to reduce the distributional shift. Experiments on Population-Based Training (PBT) show that PBT reveals HI-ADS in unit tests and context swapping mitigates the distributional shift for PBT.
SP:d1f5b4cfa8dd66dbaef07852b1832fad22189d54
Hidden Incentives for Auto-Induced Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy of predicting what users will click . This system can achieve better performance by either 1 ) making better predictions , or 2 ) changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad , and are sometimes even desirable . But they can cause problems if they occur unexpectedly . It is typical in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ( 2 ) will not happen . However , given the increasing real-world use of ML algorithms , we believe it is important to model and experimentally observe what happens when assumptions like this are violated . This is the motivation of our work . In many cases , including news recommendation , we would consider ( 2 ) a form of cheating—the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem ( e.g . ( 1 ) and/or ( 2 ) ) , but we only told it about the ends , so it didn ’ t know not to ’ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” : in this case , to maximize accuracy via ( 1 ) . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and “ side-effects ” , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : one means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation.1 The goal of our work is to provide insights and practical tools for understanding and managing incentives , specifically hidden incentives for auto-induced distributional shift : HI-ADS . To study which conditions cause HI-ADS to be revealed , we present unit tests for detecting HI-ADS in supervised learning ( SL ) and reinforcement learning ( RL ) . We also create an environment that models ADS in news recommendation , illustrating possible effects of revealing HI-ADS in this setting . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is ’ hidden ’ and we want it to remain hidden . A learner `` fails '' the unit test if it nonetheless pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) Jaderberg et al . ( 2017 ) ) can lead to high levels of failure . Similarly , recommender systems trained with PBT induce larger drifts in user base and user interests . These results suggest that failure of our unit tests indicates that an algorithm is prone to revealing HI-ADS in other settings . Finally , we propose and test a mitigation strategy we call context swapping . The strategy consists of rotating learners through different environments throughout learning , so that they can ’ t see the results or correlations of their actions in one environment over longer time horizons . This effectively mitigates HI-ADS in our unit test environments , but did not work well in content recommendation experiments . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves instantiating multiple learning scenarios which run in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Many recent works focus on multi-task meta-learning , where the OL seeks to find learning rules that generalize to unseen tasks by training the IL on a distribution of tasks ( Finn et al. , 2017 ) . Single-task meta-learning includes learning an optimizer for a single task ( Gong et al. , 2018 ) , and adaptive methods for selecting models ( Kalousis , 2000 ) or setting hyperparameters ( Snoek et al. , 2012 ) . For simplicity in this initial study we focus on single-task meta-learning . Population-based training ( PBT ; Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high- 1Note removing or hiding an incentive for a behavior is different from prohibiting that behavior , which may still occur incidentally . In particular , not having a ( revealed ) incentive for behaviors that change a human ’ s preferences , is not the same as having a ( revealed ) incentive for behaviors that preserve a human ’ s preferences . The first is often preferable ; we don ’ t want to prevent changes in human preferences that occur “ naturally ” , e.g . as a result of good arguments or evidence . performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In the example of content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In the example of content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix 8 . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present - e.g . for a crash prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . a1 a2 s1 s2 r1 r2 ( a ) RL : Incentives for ADS are present ; pursuing them is desirable a1 a2 s1 s2 r1 r2 ( b ) Myopic RL : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( c ) SL with ADS : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( d ) SL with i.i.d . data : Incentives for ADS are absent Figure 2 : The widely studied problems of reinforcement learning ( RL ) with state s , action a , reward r tuples , and i.i.d . supervised learning ( SL ) with inputs x , predictions ŷ and loss l ( a , d ) are free from incentive problems . We focus on cases where there are incentives present which the learner is not meant to pursue ( b , c ) . Lines show paths of influence . The learner may have incentives to influence any nodes descending from its action , A , or prediction , ŷ . Which incentives are undesirable ( orange ) or desirable ( cyan ) for the learner to pursue is context-dependent . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider an algorithm meant to alert drivers of imminent collisions . If it works well , such a system will help drivers avoid crashing , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL .
Abstract: The paper highlights an interesting problem of learning dynamics, where a learning system has the incentives to change it’s future input in order to increase its performance. This is not always problematic, but it can, at times, lead to perverse incentives for the system, such as under-performing on users with complex profiles in the present, in order to remove them from the future testing sets. The authors propose a set of unit tests to detect this issue and a way to solve the problem for the PBS metalearning frameworks. The experiments on toy/simulated datasets show the relevance of the approach.
SP:d1f5b4cfa8dd66dbaef07852b1832fad22189d54
Hidden Incentives for Auto-Induced Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy of predicting what users will click . This system can achieve better performance by either 1 ) making better predictions , or 2 ) changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad , and are sometimes even desirable . But they can cause problems if they occur unexpectedly . It is typical in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ( 2 ) will not happen . However , given the increasing real-world use of ML algorithms , we believe it is important to model and experimentally observe what happens when assumptions like this are violated . This is the motivation of our work . In many cases , including news recommendation , we would consider ( 2 ) a form of cheating—the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem ( e.g . ( 1 ) and/or ( 2 ) ) , but we only told it about the ends , so it didn ’ t know not to ’ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” : in this case , to maximize accuracy via ( 1 ) . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and “ side-effects ” , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : one means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation.1 The goal of our work is to provide insights and practical tools for understanding and managing incentives , specifically hidden incentives for auto-induced distributional shift : HI-ADS . To study which conditions cause HI-ADS to be revealed , we present unit tests for detecting HI-ADS in supervised learning ( SL ) and reinforcement learning ( RL ) . We also create an environment that models ADS in news recommendation , illustrating possible effects of revealing HI-ADS in this setting . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is ’ hidden ’ and we want it to remain hidden . A learner `` fails '' the unit test if it nonetheless pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) Jaderberg et al . ( 2017 ) ) can lead to high levels of failure . Similarly , recommender systems trained with PBT induce larger drifts in user base and user interests . These results suggest that failure of our unit tests indicates that an algorithm is prone to revealing HI-ADS in other settings . Finally , we propose and test a mitigation strategy we call context swapping . The strategy consists of rotating learners through different environments throughout learning , so that they can ’ t see the results or correlations of their actions in one environment over longer time horizons . This effectively mitigates HI-ADS in our unit test environments , but did not work well in content recommendation experiments . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves instantiating multiple learning scenarios which run in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Many recent works focus on multi-task meta-learning , where the OL seeks to find learning rules that generalize to unseen tasks by training the IL on a distribution of tasks ( Finn et al. , 2017 ) . Single-task meta-learning includes learning an optimizer for a single task ( Gong et al. , 2018 ) , and adaptive methods for selecting models ( Kalousis , 2000 ) or setting hyperparameters ( Snoek et al. , 2012 ) . For simplicity in this initial study we focus on single-task meta-learning . Population-based training ( PBT ; Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high- 1Note removing or hiding an incentive for a behavior is different from prohibiting that behavior , which may still occur incidentally . In particular , not having a ( revealed ) incentive for behaviors that change a human ’ s preferences , is not the same as having a ( revealed ) incentive for behaviors that preserve a human ’ s preferences . The first is often preferable ; we don ’ t want to prevent changes in human preferences that occur “ naturally ” , e.g . as a result of good arguments or evidence . performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In the example of content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In the example of content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix 8 . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present - e.g . for a crash prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . a1 a2 s1 s2 r1 r2 ( a ) RL : Incentives for ADS are present ; pursuing them is desirable a1 a2 s1 s2 r1 r2 ( b ) Myopic RL : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( c ) SL with ADS : Incentives for ADS are present ; pursuing them is undesirable ŷ1 ŷ2 x1 x2 ` 1 ` 2 ( d ) SL with i.i.d . data : Incentives for ADS are absent Figure 2 : The widely studied problems of reinforcement learning ( RL ) with state s , action a , reward r tuples , and i.i.d . supervised learning ( SL ) with inputs x , predictions ŷ and loss l ( a , d ) are free from incentive problems . We focus on cases where there are incentives present which the learner is not meant to pursue ( b , c ) . Lines show paths of influence . The learner may have incentives to influence any nodes descending from its action , A , or prediction , ŷ . Which incentives are undesirable ( orange ) or desirable ( cyan ) for the learner to pursue is context-dependent . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider an algorithm meant to alert drivers of imminent collisions . If it works well , such a system will help drivers avoid crashing , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL .
This paper discusses a phenomenon where machine-learned models may influence user behaviors in future iterations, creating self-selection effects such as filter bubbles or propagation of fake news. The paper calls these effects auto-induced distribution shift (ADS) and argues that a specific meta-learning algorithm PBT manipulates users instead of maximizing rewards. To illustrate the ideas, the paper introduces a few simulation environments where user behaviors may change when certain prediction events happen.
SP:d1f5b4cfa8dd66dbaef07852b1832fad22189d54
An Attention Free Transformer
We introduce Attention Free Transformer ( AFT ) , an efficient variant of Transformers ( Vaswani et al. , 2017 ) that eliminates the need for dot product attention . AFT offers great simplicity and efficiency compared with standard Transformers , where the multi-head attention operation is replaced with the composition of element-wise multiplications/divisions and global/local pooling . During training time , AFT has linear time and space complexity w.r.t . both the sequence length and feature dimension ; in the autoregressive decoding mode , AFT has constant memory and time complexity per step . We show that , surprisingly , we are able to train AFT effectively on challenging benchmarks , and also to match or surpass the standard Transformer counterparts and other efficient variants . In particular , AFT achieves the state-of-the-art result on CIFAR10 autoregressive modeling with much reduced complexity , and also outperforms several efficient Transformer variants on Enwik8 . 1 INTRODUCTION . Attention mechanisms , represented by Transformers ( Vaswani et al. , 2017 ) , have driven the advancement of various machine learning problems , including language modeling ( Devlin et al. , 2018 ; Radford et al . ) , image modeling ( Chen et al . ) , and set modeling ( Lee et al. , 2019 ) . Different from other well known model architectures such as Convolutional Neural Nets ( CNNs ) or Recurrent Neural Nets ( RNNs ) , Transformers enable direct interaction between every pair of elements within a sequence , which makes them especially powerful at capturing long term dependencies . However , Transformers require high computational costs . The root cause of this challenge is the need to perform attention operations that have quadratic time and space complexity w.r.t the context size . This makes it especially difficult for Transformers to scale to inputs with large context sizes . A number of recent works have been dedicated to addressing the scalability issue of Transformers ( Child et al. , 2019 ; Kitaev et al. , 2020 ; Rae et al. , 2020 ; Wang et al. , 2020b ; Katharopoulos et al. , 2020 ; Tay et al. , 2020a ; Choromanski et al. , 2020 ) . While the techniques adopted in the literature range from sparsity , locality sensitive hashing , low rank decomposition , kernel approximation and etc. , most of them are trying to approximate the full attention operation . In this paper , we take a bolder step towards the same goal , by proposing a computational module that does not use or approximate the standard dot product attention . We hence name our model the attention free transformer ( AFT ) . Similar to dot product attention , AFT is composed of the interaction of three quantities , namely the query , key and value . What ’ s different , however , is that AFT operates solely based on element-wise operations . To be more concrete , they key and value are first multiplied element-wise , the result of which is then pooled over the context dimension ( in the causal model , this corresponds to a cumulative sum ) . The query is then multiplied with the reduced key-value representation element-wise to produce the final output . See Figure 1a for an illustration . AFT maintains the full advantage of dot product attention , namely direct interaction between any two elements in a sequence ( up to proper masking ) . However , the computational cost is drastically reduced to a O ( Td ) complexity for time and space , where T , d are the context length and feature dimension , respectively . In the autoregressive decoding mode , AFT also provides constant decoding time and space complexity per step , compared to O ( T ) for standard transformers . To the best of our knowledge , AFT is the first model that achieves such efficiency in the context of Transformers . See Table 1 for the complexity analysis of AFT in comparison to other variants . We show that we can interpret AFT as an extreme case of multi head dot product attention ( MHA ) . In particular , we show that by 1 ) setting the number of heads equal to the feature dimension in MHA and 2 ) using relu in place of softmax as the non-linearity , MHA can be decomposed into the summation of two AFT modules ( see Equation 6 ) . However , this relationship is not true in a general sense , i.e. , by varying the non-linearity injected after the query and key in AFT , we can obtain models that do not have a MHA counterpart . This realization allows us to freely explore the design choices ( e.g. , nonlinearity ) of AFT to achieve the best performance . This philosophy is in direct contrast with previous and concurrent “ linearized attention ” works ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) , which are constrained by the design space of MHA . We perform experiments with AFT on several benchmarks , including unconditional image modeling , image super-resolution , language modeling , machine translation and point cloud generation . We show that AFT works very well as an alternative to the standard Transformer , providing competitive results as well as excellent efficiency . To summarize , our contributions are as follows : • We propose AFT , a new family of Transformer models that achievesO ( Td ) time and space complexity in training , as well asO ( d ) time and space complexity in autoregressive decoding . • We show strong performance of AFT as a drop in replacement of MHA on various benchmarks , including setting the state-of-the-art result on CIFAR10 in the standard setting and outperforming other efficient Transformer variants . 2 MULTI-HEAD ATTENTION . At the core of Transformers is the Multi-Head Attention ( MHA ) operation . Given three sequences , namely the query Q ∈ RT×d , key K ∈ RT×d and value V ∈ RT×d , and the number of heads h , MHA performs a scaled dot product attention for each head i , defined as : fi ( Q , K , V ) = σ ( Q′i ( K ′ i ) T √ dk ) V ′i , s.t . Q ′ i = QW Q i , K ′ i = KW K i , V ′ i = VW V i , ( 1 ) where WQi ∈ Rd×dk , WKi ∈ Rd×dk , WVi ∈ Rd×dvare linear transformations for head i , and σ is the non-linearity by default set as the softmaxr function ( subscript r indicates softmax is applied to each row of a matrix ) . dk , dv are dimensions for key and value , respectively . MHA concatenates the output of h attention heads along the channel dimension , resulting in feature dimension hdv . Unless otherwise mentioned , we assume dk = dv and h = ddk . This means the query , key and value are the same dimension within each head , and output dimension matches that of the input . 3 METHODOLOGY . 3.1 ATTENTION FREE TRANSFORMER . We now define Attention free transformer ( AFT ) , which provides an alternative to MHA . Given Q , K , V , AFT first linearly transforms them into Q′ = QWQ , K ′ = KWK , V ′ = VWV , then performs following operation : f ( Q , K , V ) = σq ( Q ′ ) T∑ t=1 ( σk ( K ′ ) V ′ ) t , ( 2 ) where is the element-wise product , with support for broadcasting when the operands ’ dimensions don ’ t exactly match 1 ; σq , σk are nonlinearities applied to the query and key , respectively . Explained in words , the key and value are first combined with an element-wise multiplication , the result of which is then pooled over the context dimension , yielding a fixed length context vector ∈ Rd . This context vector is then multiplied with each row of the query , which forms the final output of an AFT layer . One particularly useful variant of MHA is masked attention , oftentimes presented in the form of causal attention . Specifically , in auto-regressive models , queries are constrained to not be able to interact with keys and values beyond the curret position . In standard attention , this is usually implemented with an explicit binary masking matrix of shape T×T , with non-causal entries masked as 0 . We show that it is also straightforward to extend AFT to the causal mode while maintaining its efficiency . We denote an AFT layer ’ s output as Yt = f ( Q≤t , K≤t , V≤t ) , t = 1 , ... , T 2 . We formulate the casual AFT as : Yt = σq ( Q ′ t ) t∑ t′=1 ( σk ( K ′ ≤t ) V ′≤t ) t′ , t = 1 , ... , T , ( 3 ) where the subscript Xt indexes the tth row of matrix X . Discussions : The design philosophy of AFT is to promote extreme efficiency , while keeping the benefit of standard Transformers . Concretely , AFT enables direct interaction of any two elements within the sequence , which is arguably the biggest advantage of Transformers over other types of models such as RNNs and ConvNets . However , AFT gets rid of the need of performing the costly spatial dot product attention , by computing a reduced value representation with the weights only depending on the keys . The resulting operation has an extremely efficiency of O ( Td ) w.r.t . both time and space , which is the first model that achieves linear complexity along both context and feature dimensions . Moreover , the causal mode of AFT has an additional advantage of a constant decoding cost per step , similar to ( Katharopoulos et al. , 2020 ) . To see this , from Equation 3 , we have a simple recursion of Yt = σq ( Q′t ) ( σk ( K ′t ) V ′t +KVt−1 ) with KVt = ∑t t′=1 ( σk ( K ′ t′ ) V ′t′ ) , assuming σq , σk are both element-wise functions . One thus only need to keep KVt in memory , and update it with constant cost per step . Selecting nonlinearies : σq , σk provide additional nonlinearity which helps to increase model ’ s capacity . Empirically , we have found that one particularly strong setting is to let σk = softmax which is normalized along the context dimension . This choice brings an interesting benefit especially in the causal mode , which we can explicitly write as : Yt = σq ( Q ′ t ) ( gt ( t ) V ′t + t−1∑ t′=1 gt ( t ′ ) V ′t′ ) , gt ( t ′ ) = exp ( K ′t ) ∑t t′=1 exp ( K ′ t′ ) . ( 4 ) Here gt ( t ) acts as a role similar to that of an input gate in an LSTM , and gt ( t′ ) is operating like the forget gate , which depends on the input of time t , dynamically downweights the contribution of past time steps . When augmented with standard position embeddings as commonly used in Transformers , this allows the model to be able to learn the notion of recency at the same time of having access to the full context in the history . From this view , σq can also be interpreted as the output gate , for which we found that both sigmoid and relu work well , with the former being slightly better . Also note that the same space and time complexity still holds for σk = softmax , both in training and decoding . In our experiments , unless otherwise mentioned , we use the sigmoid+ softmax setting for σq and σk by default . Relation to MHA : Although AFT performs fundamentally different operations than standard attention , we show that the two family of models overlap in the extreme case . To see this , we explore 1We adopt Numpy styled broadcasting convention : https : //numpy.org/doc/stable/user/theory.broadcasting.html 2We assume here that Yt includes input information at the current position t , the version where the current position is excluded can be obtained by shifting the outputs to the right . the limit of number of heads in MHA , which amounts to letting dk = 1 for each head . In this case , the dot product operation within each head reduces to a scalar product . Next , we set σ to be relu instead of softmax in Equation 1 . In this case , we have : fi ( Q , K , V ) = [ Q ′ i ( K ′ i ) T ] +V ′ i = ( [ Q′i ] + [ ( K ′ i ) T ] + + [ −Q′i ] + [ − ( K ′i ) T ] + ) V ′i = [ Q′i ] + ( [ K ′i ] T +V ′ i ) + [ −Q′i ] + ( [ −KTi ] +V ′i ) , ( 5 ) where [ · ] + denotes the relu operator , and Q′i , K ′i , V ′i ∈ RT×1 by definition . The concatenated output of the attention heads can then be concisely written as : f ( Q , K , V ) = [ Q′ ] + T∑ t=1 ( [ K ′ ] + V ′ ) t + [ −Q′ ] + T∑ t=1 ( [ −K ′ ] + V ′ ) t , ( 6 ) which consists of two terms , each of which is an AFT operation , with σq = σk = [ · ] + and σq = σk = [ −· ] + , respectively . However , note that this correspondence is not general , i.e. , AFT does not need to approximate any MHA counterpart and can indeed have very different inductive biases than that of a standard Transformer . Relation to Linearized Attention : There are a few recent works proposing to linearize the dot product attention ( Linear Attention ) from the view of kernel approximation , first proposed in Katharopoulos et al . ( 2020 ) and also in concurrent work ( Choromanski et al. , 2020 ) . ( Katharopoulos et al. , 2020 ) proposes the linear attention operation in the form : Yt = φ ( Q′t ) ∑T t′=1 ( φ ( K ′t′ ) TV ′t′ ) φ ( Q ) ′t ∑t t′−1 φ ( K ′ t ) T , ( 7 ) where Q′t , K ′ t , V ′ t are all row vectors of R d. Equation 7 is similar to AFT , in the sense that the key and value are first combined and reduced in both cases . However AFT differs in two aspects : 1 ) the time complexity of Linear Attention is O ( Td2 ) , which is linear in the sequence length but has difficulty scaling to wide networks 2 ) Linear Attention is designed to approximate MHA , where the nonlinearity on query and key are shared . In AFT however , we show that it is beneficial to search for different nonlinearities for both the query and key .
The paper introduces a method to replace qkv-attention by a simpler, efficient building block. This is done by element-wise multiplication of a query representation with a compressed kv-memory. Per-channel attention pooling is used to compress the kv-memory. The model is derived from a softmax-free version of self-attention. The results show good performance on a couple of standard image and language modeling tasks while occasionally exhibiting favorable training speed. The results are largely on par with transformer baselines.
SP:66b1c09b1f72ea9699c8fb738b9996d06a84e1aa
An Attention Free Transformer
We introduce Attention Free Transformer ( AFT ) , an efficient variant of Transformers ( Vaswani et al. , 2017 ) that eliminates the need for dot product attention . AFT offers great simplicity and efficiency compared with standard Transformers , where the multi-head attention operation is replaced with the composition of element-wise multiplications/divisions and global/local pooling . During training time , AFT has linear time and space complexity w.r.t . both the sequence length and feature dimension ; in the autoregressive decoding mode , AFT has constant memory and time complexity per step . We show that , surprisingly , we are able to train AFT effectively on challenging benchmarks , and also to match or surpass the standard Transformer counterparts and other efficient variants . In particular , AFT achieves the state-of-the-art result on CIFAR10 autoregressive modeling with much reduced complexity , and also outperforms several efficient Transformer variants on Enwik8 . 1 INTRODUCTION . Attention mechanisms , represented by Transformers ( Vaswani et al. , 2017 ) , have driven the advancement of various machine learning problems , including language modeling ( Devlin et al. , 2018 ; Radford et al . ) , image modeling ( Chen et al . ) , and set modeling ( Lee et al. , 2019 ) . Different from other well known model architectures such as Convolutional Neural Nets ( CNNs ) or Recurrent Neural Nets ( RNNs ) , Transformers enable direct interaction between every pair of elements within a sequence , which makes them especially powerful at capturing long term dependencies . However , Transformers require high computational costs . The root cause of this challenge is the need to perform attention operations that have quadratic time and space complexity w.r.t the context size . This makes it especially difficult for Transformers to scale to inputs with large context sizes . A number of recent works have been dedicated to addressing the scalability issue of Transformers ( Child et al. , 2019 ; Kitaev et al. , 2020 ; Rae et al. , 2020 ; Wang et al. , 2020b ; Katharopoulos et al. , 2020 ; Tay et al. , 2020a ; Choromanski et al. , 2020 ) . While the techniques adopted in the literature range from sparsity , locality sensitive hashing , low rank decomposition , kernel approximation and etc. , most of them are trying to approximate the full attention operation . In this paper , we take a bolder step towards the same goal , by proposing a computational module that does not use or approximate the standard dot product attention . We hence name our model the attention free transformer ( AFT ) . Similar to dot product attention , AFT is composed of the interaction of three quantities , namely the query , key and value . What ’ s different , however , is that AFT operates solely based on element-wise operations . To be more concrete , they key and value are first multiplied element-wise , the result of which is then pooled over the context dimension ( in the causal model , this corresponds to a cumulative sum ) . The query is then multiplied with the reduced key-value representation element-wise to produce the final output . See Figure 1a for an illustration . AFT maintains the full advantage of dot product attention , namely direct interaction between any two elements in a sequence ( up to proper masking ) . However , the computational cost is drastically reduced to a O ( Td ) complexity for time and space , where T , d are the context length and feature dimension , respectively . In the autoregressive decoding mode , AFT also provides constant decoding time and space complexity per step , compared to O ( T ) for standard transformers . To the best of our knowledge , AFT is the first model that achieves such efficiency in the context of Transformers . See Table 1 for the complexity analysis of AFT in comparison to other variants . We show that we can interpret AFT as an extreme case of multi head dot product attention ( MHA ) . In particular , we show that by 1 ) setting the number of heads equal to the feature dimension in MHA and 2 ) using relu in place of softmax as the non-linearity , MHA can be decomposed into the summation of two AFT modules ( see Equation 6 ) . However , this relationship is not true in a general sense , i.e. , by varying the non-linearity injected after the query and key in AFT , we can obtain models that do not have a MHA counterpart . This realization allows us to freely explore the design choices ( e.g. , nonlinearity ) of AFT to achieve the best performance . This philosophy is in direct contrast with previous and concurrent “ linearized attention ” works ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) , which are constrained by the design space of MHA . We perform experiments with AFT on several benchmarks , including unconditional image modeling , image super-resolution , language modeling , machine translation and point cloud generation . We show that AFT works very well as an alternative to the standard Transformer , providing competitive results as well as excellent efficiency . To summarize , our contributions are as follows : • We propose AFT , a new family of Transformer models that achievesO ( Td ) time and space complexity in training , as well asO ( d ) time and space complexity in autoregressive decoding . • We show strong performance of AFT as a drop in replacement of MHA on various benchmarks , including setting the state-of-the-art result on CIFAR10 in the standard setting and outperforming other efficient Transformer variants . 2 MULTI-HEAD ATTENTION . At the core of Transformers is the Multi-Head Attention ( MHA ) operation . Given three sequences , namely the query Q ∈ RT×d , key K ∈ RT×d and value V ∈ RT×d , and the number of heads h , MHA performs a scaled dot product attention for each head i , defined as : fi ( Q , K , V ) = σ ( Q′i ( K ′ i ) T √ dk ) V ′i , s.t . Q ′ i = QW Q i , K ′ i = KW K i , V ′ i = VW V i , ( 1 ) where WQi ∈ Rd×dk , WKi ∈ Rd×dk , WVi ∈ Rd×dvare linear transformations for head i , and σ is the non-linearity by default set as the softmaxr function ( subscript r indicates softmax is applied to each row of a matrix ) . dk , dv are dimensions for key and value , respectively . MHA concatenates the output of h attention heads along the channel dimension , resulting in feature dimension hdv . Unless otherwise mentioned , we assume dk = dv and h = ddk . This means the query , key and value are the same dimension within each head , and output dimension matches that of the input . 3 METHODOLOGY . 3.1 ATTENTION FREE TRANSFORMER . We now define Attention free transformer ( AFT ) , which provides an alternative to MHA . Given Q , K , V , AFT first linearly transforms them into Q′ = QWQ , K ′ = KWK , V ′ = VWV , then performs following operation : f ( Q , K , V ) = σq ( Q ′ ) T∑ t=1 ( σk ( K ′ ) V ′ ) t , ( 2 ) where is the element-wise product , with support for broadcasting when the operands ’ dimensions don ’ t exactly match 1 ; σq , σk are nonlinearities applied to the query and key , respectively . Explained in words , the key and value are first combined with an element-wise multiplication , the result of which is then pooled over the context dimension , yielding a fixed length context vector ∈ Rd . This context vector is then multiplied with each row of the query , which forms the final output of an AFT layer . One particularly useful variant of MHA is masked attention , oftentimes presented in the form of causal attention . Specifically , in auto-regressive models , queries are constrained to not be able to interact with keys and values beyond the curret position . In standard attention , this is usually implemented with an explicit binary masking matrix of shape T×T , with non-causal entries masked as 0 . We show that it is also straightforward to extend AFT to the causal mode while maintaining its efficiency . We denote an AFT layer ’ s output as Yt = f ( Q≤t , K≤t , V≤t ) , t = 1 , ... , T 2 . We formulate the casual AFT as : Yt = σq ( Q ′ t ) t∑ t′=1 ( σk ( K ′ ≤t ) V ′≤t ) t′ , t = 1 , ... , T , ( 3 ) where the subscript Xt indexes the tth row of matrix X . Discussions : The design philosophy of AFT is to promote extreme efficiency , while keeping the benefit of standard Transformers . Concretely , AFT enables direct interaction of any two elements within the sequence , which is arguably the biggest advantage of Transformers over other types of models such as RNNs and ConvNets . However , AFT gets rid of the need of performing the costly spatial dot product attention , by computing a reduced value representation with the weights only depending on the keys . The resulting operation has an extremely efficiency of O ( Td ) w.r.t . both time and space , which is the first model that achieves linear complexity along both context and feature dimensions . Moreover , the causal mode of AFT has an additional advantage of a constant decoding cost per step , similar to ( Katharopoulos et al. , 2020 ) . To see this , from Equation 3 , we have a simple recursion of Yt = σq ( Q′t ) ( σk ( K ′t ) V ′t +KVt−1 ) with KVt = ∑t t′=1 ( σk ( K ′ t′ ) V ′t′ ) , assuming σq , σk are both element-wise functions . One thus only need to keep KVt in memory , and update it with constant cost per step . Selecting nonlinearies : σq , σk provide additional nonlinearity which helps to increase model ’ s capacity . Empirically , we have found that one particularly strong setting is to let σk = softmax which is normalized along the context dimension . This choice brings an interesting benefit especially in the causal mode , which we can explicitly write as : Yt = σq ( Q ′ t ) ( gt ( t ) V ′t + t−1∑ t′=1 gt ( t ′ ) V ′t′ ) , gt ( t ′ ) = exp ( K ′t ) ∑t t′=1 exp ( K ′ t′ ) . ( 4 ) Here gt ( t ) acts as a role similar to that of an input gate in an LSTM , and gt ( t′ ) is operating like the forget gate , which depends on the input of time t , dynamically downweights the contribution of past time steps . When augmented with standard position embeddings as commonly used in Transformers , this allows the model to be able to learn the notion of recency at the same time of having access to the full context in the history . From this view , σq can also be interpreted as the output gate , for which we found that both sigmoid and relu work well , with the former being slightly better . Also note that the same space and time complexity still holds for σk = softmax , both in training and decoding . In our experiments , unless otherwise mentioned , we use the sigmoid+ softmax setting for σq and σk by default . Relation to MHA : Although AFT performs fundamentally different operations than standard attention , we show that the two family of models overlap in the extreme case . To see this , we explore 1We adopt Numpy styled broadcasting convention : https : //numpy.org/doc/stable/user/theory.broadcasting.html 2We assume here that Yt includes input information at the current position t , the version where the current position is excluded can be obtained by shifting the outputs to the right . the limit of number of heads in MHA , which amounts to letting dk = 1 for each head . In this case , the dot product operation within each head reduces to a scalar product . Next , we set σ to be relu instead of softmax in Equation 1 . In this case , we have : fi ( Q , K , V ) = [ Q ′ i ( K ′ i ) T ] +V ′ i = ( [ Q′i ] + [ ( K ′ i ) T ] + + [ −Q′i ] + [ − ( K ′i ) T ] + ) V ′i = [ Q′i ] + ( [ K ′i ] T +V ′ i ) + [ −Q′i ] + ( [ −KTi ] +V ′i ) , ( 5 ) where [ · ] + denotes the relu operator , and Q′i , K ′i , V ′i ∈ RT×1 by definition . The concatenated output of the attention heads can then be concisely written as : f ( Q , K , V ) = [ Q′ ] + T∑ t=1 ( [ K ′ ] + V ′ ) t + [ −Q′ ] + T∑ t=1 ( [ −K ′ ] + V ′ ) t , ( 6 ) which consists of two terms , each of which is an AFT operation , with σq = σk = [ · ] + and σq = σk = [ −· ] + , respectively . However , note that this correspondence is not general , i.e. , AFT does not need to approximate any MHA counterpart and can indeed have very different inductive biases than that of a standard Transformer . Relation to Linearized Attention : There are a few recent works proposing to linearize the dot product attention ( Linear Attention ) from the view of kernel approximation , first proposed in Katharopoulos et al . ( 2020 ) and also in concurrent work ( Choromanski et al. , 2020 ) . ( Katharopoulos et al. , 2020 ) proposes the linear attention operation in the form : Yt = φ ( Q′t ) ∑T t′=1 ( φ ( K ′t′ ) TV ′t′ ) φ ( Q ) ′t ∑t t′−1 φ ( K ′ t ) T , ( 7 ) where Q′t , K ′ t , V ′ t are all row vectors of R d. Equation 7 is similar to AFT , in the sense that the key and value are first combined and reduced in both cases . However AFT differs in two aspects : 1 ) the time complexity of Linear Attention is O ( Td2 ) , which is linear in the sequence length but has difficulty scaling to wide networks 2 ) Linear Attention is designed to approximate MHA , where the nonlinearity on query and key are shared . In AFT however , we show that it is beneficial to search for different nonlinearities for both the query and key .
The paper suggest an alternative to the Multi-Head Attention (MHA) operation, which is one of the core elements in Transformers models. The proposed alternative is targeting the non-linear soft-max operator (in the MHA) and suggest to replace it with the "relu" operator. After doing so they could reformulate the new attention mechanism as a O(T) operator instead of the original O(T^2) operator (where T is the context size).
SP:66b1c09b1f72ea9699c8fb738b9996d06a84e1aa
An Attention Free Transformer
We introduce Attention Free Transformer ( AFT ) , an efficient variant of Transformers ( Vaswani et al. , 2017 ) that eliminates the need for dot product attention . AFT offers great simplicity and efficiency compared with standard Transformers , where the multi-head attention operation is replaced with the composition of element-wise multiplications/divisions and global/local pooling . During training time , AFT has linear time and space complexity w.r.t . both the sequence length and feature dimension ; in the autoregressive decoding mode , AFT has constant memory and time complexity per step . We show that , surprisingly , we are able to train AFT effectively on challenging benchmarks , and also to match or surpass the standard Transformer counterparts and other efficient variants . In particular , AFT achieves the state-of-the-art result on CIFAR10 autoregressive modeling with much reduced complexity , and also outperforms several efficient Transformer variants on Enwik8 . 1 INTRODUCTION . Attention mechanisms , represented by Transformers ( Vaswani et al. , 2017 ) , have driven the advancement of various machine learning problems , including language modeling ( Devlin et al. , 2018 ; Radford et al . ) , image modeling ( Chen et al . ) , and set modeling ( Lee et al. , 2019 ) . Different from other well known model architectures such as Convolutional Neural Nets ( CNNs ) or Recurrent Neural Nets ( RNNs ) , Transformers enable direct interaction between every pair of elements within a sequence , which makes them especially powerful at capturing long term dependencies . However , Transformers require high computational costs . The root cause of this challenge is the need to perform attention operations that have quadratic time and space complexity w.r.t the context size . This makes it especially difficult for Transformers to scale to inputs with large context sizes . A number of recent works have been dedicated to addressing the scalability issue of Transformers ( Child et al. , 2019 ; Kitaev et al. , 2020 ; Rae et al. , 2020 ; Wang et al. , 2020b ; Katharopoulos et al. , 2020 ; Tay et al. , 2020a ; Choromanski et al. , 2020 ) . While the techniques adopted in the literature range from sparsity , locality sensitive hashing , low rank decomposition , kernel approximation and etc. , most of them are trying to approximate the full attention operation . In this paper , we take a bolder step towards the same goal , by proposing a computational module that does not use or approximate the standard dot product attention . We hence name our model the attention free transformer ( AFT ) . Similar to dot product attention , AFT is composed of the interaction of three quantities , namely the query , key and value . What ’ s different , however , is that AFT operates solely based on element-wise operations . To be more concrete , they key and value are first multiplied element-wise , the result of which is then pooled over the context dimension ( in the causal model , this corresponds to a cumulative sum ) . The query is then multiplied with the reduced key-value representation element-wise to produce the final output . See Figure 1a for an illustration . AFT maintains the full advantage of dot product attention , namely direct interaction between any two elements in a sequence ( up to proper masking ) . However , the computational cost is drastically reduced to a O ( Td ) complexity for time and space , where T , d are the context length and feature dimension , respectively . In the autoregressive decoding mode , AFT also provides constant decoding time and space complexity per step , compared to O ( T ) for standard transformers . To the best of our knowledge , AFT is the first model that achieves such efficiency in the context of Transformers . See Table 1 for the complexity analysis of AFT in comparison to other variants . We show that we can interpret AFT as an extreme case of multi head dot product attention ( MHA ) . In particular , we show that by 1 ) setting the number of heads equal to the feature dimension in MHA and 2 ) using relu in place of softmax as the non-linearity , MHA can be decomposed into the summation of two AFT modules ( see Equation 6 ) . However , this relationship is not true in a general sense , i.e. , by varying the non-linearity injected after the query and key in AFT , we can obtain models that do not have a MHA counterpart . This realization allows us to freely explore the design choices ( e.g. , nonlinearity ) of AFT to achieve the best performance . This philosophy is in direct contrast with previous and concurrent “ linearized attention ” works ( Katharopoulos et al. , 2020 ; Choromanski et al. , 2020 ) , which are constrained by the design space of MHA . We perform experiments with AFT on several benchmarks , including unconditional image modeling , image super-resolution , language modeling , machine translation and point cloud generation . We show that AFT works very well as an alternative to the standard Transformer , providing competitive results as well as excellent efficiency . To summarize , our contributions are as follows : • We propose AFT , a new family of Transformer models that achievesO ( Td ) time and space complexity in training , as well asO ( d ) time and space complexity in autoregressive decoding . • We show strong performance of AFT as a drop in replacement of MHA on various benchmarks , including setting the state-of-the-art result on CIFAR10 in the standard setting and outperforming other efficient Transformer variants . 2 MULTI-HEAD ATTENTION . At the core of Transformers is the Multi-Head Attention ( MHA ) operation . Given three sequences , namely the query Q ∈ RT×d , key K ∈ RT×d and value V ∈ RT×d , and the number of heads h , MHA performs a scaled dot product attention for each head i , defined as : fi ( Q , K , V ) = σ ( Q′i ( K ′ i ) T √ dk ) V ′i , s.t . Q ′ i = QW Q i , K ′ i = KW K i , V ′ i = VW V i , ( 1 ) where WQi ∈ Rd×dk , WKi ∈ Rd×dk , WVi ∈ Rd×dvare linear transformations for head i , and σ is the non-linearity by default set as the softmaxr function ( subscript r indicates softmax is applied to each row of a matrix ) . dk , dv are dimensions for key and value , respectively . MHA concatenates the output of h attention heads along the channel dimension , resulting in feature dimension hdv . Unless otherwise mentioned , we assume dk = dv and h = ddk . This means the query , key and value are the same dimension within each head , and output dimension matches that of the input . 3 METHODOLOGY . 3.1 ATTENTION FREE TRANSFORMER . We now define Attention free transformer ( AFT ) , which provides an alternative to MHA . Given Q , K , V , AFT first linearly transforms them into Q′ = QWQ , K ′ = KWK , V ′ = VWV , then performs following operation : f ( Q , K , V ) = σq ( Q ′ ) T∑ t=1 ( σk ( K ′ ) V ′ ) t , ( 2 ) where is the element-wise product , with support for broadcasting when the operands ’ dimensions don ’ t exactly match 1 ; σq , σk are nonlinearities applied to the query and key , respectively . Explained in words , the key and value are first combined with an element-wise multiplication , the result of which is then pooled over the context dimension , yielding a fixed length context vector ∈ Rd . This context vector is then multiplied with each row of the query , which forms the final output of an AFT layer . One particularly useful variant of MHA is masked attention , oftentimes presented in the form of causal attention . Specifically , in auto-regressive models , queries are constrained to not be able to interact with keys and values beyond the curret position . In standard attention , this is usually implemented with an explicit binary masking matrix of shape T×T , with non-causal entries masked as 0 . We show that it is also straightforward to extend AFT to the causal mode while maintaining its efficiency . We denote an AFT layer ’ s output as Yt = f ( Q≤t , K≤t , V≤t ) , t = 1 , ... , T 2 . We formulate the casual AFT as : Yt = σq ( Q ′ t ) t∑ t′=1 ( σk ( K ′ ≤t ) V ′≤t ) t′ , t = 1 , ... , T , ( 3 ) where the subscript Xt indexes the tth row of matrix X . Discussions : The design philosophy of AFT is to promote extreme efficiency , while keeping the benefit of standard Transformers . Concretely , AFT enables direct interaction of any two elements within the sequence , which is arguably the biggest advantage of Transformers over other types of models such as RNNs and ConvNets . However , AFT gets rid of the need of performing the costly spatial dot product attention , by computing a reduced value representation with the weights only depending on the keys . The resulting operation has an extremely efficiency of O ( Td ) w.r.t . both time and space , which is the first model that achieves linear complexity along both context and feature dimensions . Moreover , the causal mode of AFT has an additional advantage of a constant decoding cost per step , similar to ( Katharopoulos et al. , 2020 ) . To see this , from Equation 3 , we have a simple recursion of Yt = σq ( Q′t ) ( σk ( K ′t ) V ′t +KVt−1 ) with KVt = ∑t t′=1 ( σk ( K ′ t′ ) V ′t′ ) , assuming σq , σk are both element-wise functions . One thus only need to keep KVt in memory , and update it with constant cost per step . Selecting nonlinearies : σq , σk provide additional nonlinearity which helps to increase model ’ s capacity . Empirically , we have found that one particularly strong setting is to let σk = softmax which is normalized along the context dimension . This choice brings an interesting benefit especially in the causal mode , which we can explicitly write as : Yt = σq ( Q ′ t ) ( gt ( t ) V ′t + t−1∑ t′=1 gt ( t ′ ) V ′t′ ) , gt ( t ′ ) = exp ( K ′t ) ∑t t′=1 exp ( K ′ t′ ) . ( 4 ) Here gt ( t ) acts as a role similar to that of an input gate in an LSTM , and gt ( t′ ) is operating like the forget gate , which depends on the input of time t , dynamically downweights the contribution of past time steps . When augmented with standard position embeddings as commonly used in Transformers , this allows the model to be able to learn the notion of recency at the same time of having access to the full context in the history . From this view , σq can also be interpreted as the output gate , for which we found that both sigmoid and relu work well , with the former being slightly better . Also note that the same space and time complexity still holds for σk = softmax , both in training and decoding . In our experiments , unless otherwise mentioned , we use the sigmoid+ softmax setting for σq and σk by default . Relation to MHA : Although AFT performs fundamentally different operations than standard attention , we show that the two family of models overlap in the extreme case . To see this , we explore 1We adopt Numpy styled broadcasting convention : https : //numpy.org/doc/stable/user/theory.broadcasting.html 2We assume here that Yt includes input information at the current position t , the version where the current position is excluded can be obtained by shifting the outputs to the right . the limit of number of heads in MHA , which amounts to letting dk = 1 for each head . In this case , the dot product operation within each head reduces to a scalar product . Next , we set σ to be relu instead of softmax in Equation 1 . In this case , we have : fi ( Q , K , V ) = [ Q ′ i ( K ′ i ) T ] +V ′ i = ( [ Q′i ] + [ ( K ′ i ) T ] + + [ −Q′i ] + [ − ( K ′i ) T ] + ) V ′i = [ Q′i ] + ( [ K ′i ] T +V ′ i ) + [ −Q′i ] + ( [ −KTi ] +V ′i ) , ( 5 ) where [ · ] + denotes the relu operator , and Q′i , K ′i , V ′i ∈ RT×1 by definition . The concatenated output of the attention heads can then be concisely written as : f ( Q , K , V ) = [ Q′ ] + T∑ t=1 ( [ K ′ ] + V ′ ) t + [ −Q′ ] + T∑ t=1 ( [ −K ′ ] + V ′ ) t , ( 6 ) which consists of two terms , each of which is an AFT operation , with σq = σk = [ · ] + and σq = σk = [ −· ] + , respectively . However , note that this correspondence is not general , i.e. , AFT does not need to approximate any MHA counterpart and can indeed have very different inductive biases than that of a standard Transformer . Relation to Linearized Attention : There are a few recent works proposing to linearize the dot product attention ( Linear Attention ) from the view of kernel approximation , first proposed in Katharopoulos et al . ( 2020 ) and also in concurrent work ( Choromanski et al. , 2020 ) . ( Katharopoulos et al. , 2020 ) proposes the linear attention operation in the form : Yt = φ ( Q′t ) ∑T t′=1 ( φ ( K ′t′ ) TV ′t′ ) φ ( Q ) ′t ∑t t′−1 φ ( K ′ t ) T , ( 7 ) where Q′t , K ′ t , V ′ t are all row vectors of R d. Equation 7 is similar to AFT , in the sense that the key and value are first combined and reduced in both cases . However AFT differs in two aspects : 1 ) the time complexity of Linear Attention is O ( Td2 ) , which is linear in the sequence length but has difficulty scaling to wide networks 2 ) Linear Attention is designed to approximate MHA , where the nonlinearity on query and key are shared . In AFT however , we show that it is beneficial to search for different nonlinearities for both the query and key .
This paper proposes an efficient transformer variant by replacing softmax in the self-attention layer with a RELU activation and arranging the computation using element-wise products and global/local pooling. This reduces complexity to linear complexity in the non-autoregressive case and log-linear complexity in the autoregressive case. The evaluation shows that it can reach the performance of a vanilla transformer in most of the examined tasks while having fewer memory requirements in general.
SP:66b1c09b1f72ea9699c8fb738b9996d06a84e1aa
Causal Inference Q-Network: Toward Resilient Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have shown enhanced performance , gained widespread applications ( Mnih et al. , 2015 ; 2016 ; Ecoffet et al. , 2019 ; Silver et al. , 2017 ; Mao et al. , 2017 ) , and improved robot learning ( Gu et al. , 2017 ) in navigation systems ( Tai et al. , 2017 ; Nagabandi et al. , 2018 ) . However , most successful demonstrations of these DRL methods are usually trained and deployed under well-controlled situations . In contrast , real-world use cases often encounter inevitable observational uncertainty ( Grigorescu et al. , 2020 ; Hafner et al. , 2018 ; Moreno et al. , 2018 ) from an external attacker ( Huang et al. , 2017 ) or noisy sensor ( Fortunato et al. , 2018 ; Lee et al. , 2018 ) . For examples , playing online video games may experience sudden black-outs or frame-skippings due to network instabilities , and driving on the road may encounter temporary blindness when facing the sun . Such an abrupt interference on the observation could cause serious issues for DRL algorithms . Unlike other machine learning tasks that involve only a single mission at a time ( e.g. , image classification ) , an RL agent has to deal with a dynamic ( Schmidhuber , 1992 ) and encoded state ( Schmidhuber , 1991 ; Kaelbling et al. , 1998 ) and to anticipate future rewards . Therefore , DRL-based systems are likely to propagate and even enlarge risks ( e.g. , delay and noisy pulsed-signals on sensor-fusion ( Yurtsever et al. , 2020 ; Johansen et al. , 2015 ) ) induced from the uncertain interference . In this paper , we investigate the resilience ability of an RL agent to withstand unforeseen , rare , adversarial and potentially catastrophic interferences , and to recover and adapt by improving itself in reaction to these events . We consider a resilient RL framework with observational interferences . At each time , the agent ’ s observation is subjected to a type of sudden interference at a predefined possibility . Whether or not an observation has interfered is referred to as the interference label . Specifically , to train a resilient agent , we provide the agent with the interference labels during training . For instance , the labels could be derived from some uncertain noise generators recording whether the agent observes an intervened state at the moment as a binary causation label . By applying the labels as an intervention into the environment , the RL agent is asked to learn a binary causation label and embed a latent state into its model . However , when the trained agent is deployed in the field ( i.e. , the testing phase ) , the agent only receives the interfered observations but is agnostic to interference labels and needs to act resiliently against the interference . For an RL agent to be resilient against interference , the agent needs to diagnose observations to make the correct inference about the reward information . To achieve this , the RL agent has to reason about what leads to desired rewards despite the irrelevant intermittent interference . To equip an RL agent with this reasoning capability , we exploit the causal inference framework . Intuitively , a causal inference model for observation interference uses an unobserved confounder ( Pearl , 2009 ; 2019 ; 1995b ; Saunders et al. , 2018 ; Bareinboim et al. , 2015 ) to capture the effect of the interference on the reward collected from the environment . When such a confounder is available , the RL agent can focus on the confounder for relevant reward information and make the best decision . As illustrated in Figure 1 , we propose a causal inference based DRL algorithm termed causal inference Q-network ( CIQ ) . During training , when the interference labels are available , the CIQ agent will implicitly learn a causal inference model by embedding the confounder into a latent state . At the same time , the CIQ agent will also train a Q-network on the latent state for decision making . Then at testing , the CIQ agent will make use of the learned model to estimate the confounding latent state and the interference label . The history of latent states is combined into a causal inference state , which captures the relevant information for the Q-network to collect rewards in the environment despite of the observational interference . In this paper , we evaluate the performance of our method in four environments : 1 ) Cartpole-v0 – the continuous control environment ( Brockman et al. , 2016 ) ; 2 ) the 3D graphical Banana Collector ( Juliani et al. , 2018 ) ) ; 3 ) an Atari environment LunarLander-v2 ( Brockman et al. , 2016 ) , and 4 ) pixel Cartpole – visual learning from the pixel inputs of Cartpole . For each of the environments , we consider four types of interference : ( a ) black-out , ( b ) Gaussian noise , ( c ) frozen screen , and ( d ) adversarial attack . In the testing phase mimicking the practical scenario that the agent may have interfered observations but is unaware of the true interference labels ( i.e. , happens or not ) , the results show that our CIQ method can perform better and more resilience against all the four types of interference . Furthermore , to benchmark the level of resilience of different RL models , we propose a new robustness measure , called CLEVER-Q , to evaluate the robustness of Q-network based RL algorithms . The idea is to compute a lower bound on the observation noise level such that the greedy action from the Q-network will remain the same against any noise below the lower bound . According to this robustness analysis , our CIQ algorithm indeed achieves higher CLEVER-Q scores compared with the baseline methods . The main contributions of this paper include 1 ) a framework to evaluate the resilience of DRL methods under abrupt observational interferences ; 2 ) the proposed CIQ architecture and algorithm towards training a resilient DRL agent , and 3 ) an extreme-value theory based robustness metric ( CLEVER-Q ) for quantifying the resilience of Q-network based RL algorithms . 2 RELATED WORKS . Causal Inference for Reinforcement Learning : Causal inference ( Greenland et al. , 1999 ; Pearl , 2009 ; Pearl et al. , 2016 ; Pearl , 2019 ; Robins et al. , 1995 ) has been used to empower the learning process under noisy observation and have better interpretability on deep learning models ( Shalit et al. , 2017 ; Louizos et al. , 2017 ) , also with efforts ( Jaber et al. , 2019 ; Forney et al. , 2017 ; Bareinboim et al. , 2015 ) on causal online learning and bandit methods . Defining causation and applying causal inference framework to DRL still remains relatively unexplored . Recent works ( Lu et al. , 2018 ; Tennenholtz et al. , 2019 ) study this problem by defining action as one kind of intervention and calculating the treatment effects on the action . In contrast , we introduce causation into DRL by applying extra noisy and uncertain inventions . Different from the aforementioned approaches , we leverage the causal effect of observational interferences on states , and design an end-to-end structure for learning a causal-observational representation evaluating treatment effects on rewards . Adversarial Perturbation : An intensifying challenge against deep neural network based systems is adversarial perturbation for making incorrect decisions . Many gradient-based noise-generating methods ( Goodfellow et al. , 2015 ; Huang et al. , 2017 ) have been conducted for misclassification and mislead an agent ’ s output action . As an example of using DRL model playing Atari games , an adversarial attacker ( Lin et al. , 2017 ; Yang et al. , 2020 ) could jam in a timely and barely detectable noise to maximize the prediction loss of a Q-network and cause massively degraded performance . Partially Observable Markov Decision Processes ( POMDPs ) : Our resilient RL framework can be viewed as a POMDP with interfered observations . Belief-state methods are available for simple POMDP problems ( e.g. , plan graph and the tiger problem ( Kaelbling et al. , 1998 ) ) , but no provably efficient algorithm is available for general POMDP settings ( Papadimitriou & Tsitsiklis , 1987 ; Gregor et al. , 2018 ) . Recently , Igl et al . ( 2018 ) have proposed a DRL approach for POMDPs by combining variational autoencoder and policy-based learning , but this kind of methods do not consider the interference labels available during training in our resilient RL framework . Safe Reinforcement Learning : Safe reinforcement learning ( SRL ) ( Garcia & Fernández , 2012 ) seeks to learn a policy that maximizes the expected return , while satisfying specific safety constraints . Previous approaches to SRL include reward-shaping ( Saunders et al. , 2018 ) , noisy training ( Fortunato et al. , 2018 ) , shielding-based SRL ( Alshiekh et al. , 2018 ) , and policy optimization with confident lower-bound constraints ( Thomas et al. , 2015 ) . However , finding these policies in the first place could need to reset the model at each time and be computationally challenging . Our proposed resilient RL framework can be viewed as an approach to achieve SRL ( Alshiekh et al. , 2018 ) , but we focus on gaining resilience against abrupt observation interferences . Another key difference between our framework and other SRL schemes is the novelty in proactively using available interference labels during training , which allows our agent to learn a causal inference model to make safer decisions . 3 RESILIENT REINFORCEMENT LEARNING . In this section , we formally introduce our resilient RL framework and provide an extreme-value theory based metric called CLEVER-Q for measuring the robustness of DQN-based methods . We consider a sequential decision-making problem where an agent interacts with an environment . At each time t , the agent gets an observation xt , e.g . a frame in a video environment . As in many RL domains ( e.g. , Atari games ) , we view st = ( xt−M+1 , . . . , xt ) to be the state of the environment where M is a fixed number for the history of observations . Given a stochastic policy π , the agent chooses an action at ∼ π ( st ) from a discrete action space based on the observed state and receives a reward rt from the environment . For a policy π , define the Q-function Qπ ( s , a ) = E [ ∑∞ t=0 γ trt|s0 = s , a0 = a , π ] where γ ∈ ( 0 , 1 ) is the discount factor . The agent ’ s goal is to find the optimal policy π∗ that achieves the optimal Q-function given by Q∗ ( s , a ) = maxπ Qπ ( s , a ) . 3.1 RESILIENCE BASE ON AN INTERVENTIONAL PERSPECTIVE . We consider a resilient RL framework where the observations are subject to interference ( as illustrated in Fig 1 ( a ) ) as an empirical process in Rubin ’ s Causal Model ( RCM ) ( Kennedy , 2016 ; Holland , 1988 ; Balke & Pearl , 1997 ; Robins et al. , 2003 ) for causal inference . Given a type of interference I , the agent ’ s observation becomes : x′t = F I ( xt , it ) = it × I ( xt ) + ( 1− it ) × xt ( 1 ) where it ∈ { 0 , 1 } is the label indicating whether the observation is interfered at time t or not ( under the potential outcome estimation ( Rubin , 1974 ) ) , and I ( xt ) is the interfered observation . The interfered state is then given by s′t = ( x ′ t−M+1 , . . . , x ′ t ) . We assume that interference labels it follow an i.i.d . Bernoulli process with a fixed interference probability pI as a noise level . For example , when pI equals to 10 % , each observational state has a 10 % chance to be intervened under a perturbation . The agent now needs to choose its actions at ∼ π ( s′t ) based on the interfered state . The resilient RL objective for the agent is to find a policy π to maximize rewards in this environment under observation interference . In this work , we consider four types of interference as described below . Gaussian Noise . Gaussian noise or white noise is a common interference to sensory data ( Osband et al. , 2019 ; Yurtsever et al. , 2020 ) . The interfered observation becomes I ( xt ) = xt + nt with a zero-mean Gaussian noise nt . The noise variance is set to be the variance of all recorded states . Adversarial Observation . Following the standard adversarial RL attack setting , we use the fast gradient sign method ( FGSM ) ( Szegedy et al. , 2014 ) to generate adversarial patterns against the DQN prediction loss ( Huang et al. , 2017 ) . The adversarial observation is given by I ( xt ) = xt + sign ( ∇xtQ ( xt , y ; θ ) ) where y is the optimal output action by weighting over all possible actions . Observation Black-Out . Off-the-shelf hardware can affect the entire sensor networks as a sensing background ( Yurtsever et al. , 2020 ) over-shoot with I ( xt ) = 0 ( Yan et al. , 2016 ) . This perturbation is realistic owing to overheat hardware and losing the observational information of sensors . Frozen Frame . Lagging and frozen frame ( s ) ( Kalashnikov et al. , 2018 ) often come from limited data communication bottleneck bandwidth . A frozen frame is given by I ( xt ) = xt−1 . If the perturbation is constantly present , the frame will remain the first frozen frame since the perturbation happened .
The paper presents a framework for deep reinforcement learning that is motivated by causal inference and with the central objective of being resilient to observational interferences. The key idea is to use interference labels in the training phase to learn a causal model including a hidden confounding state, and then use this model in the testing to make safer decisions and improve resilience. The authors also propose a new robustness measure, CLEVER-Q, which estimates a noise bound of an RL model below which the model's greedy decision would not be altered. The framework is tested extensively over multiple applications and under different types of observational interferences. The results show a clear advantage of the proposed framework over baseline RL methods in terms of resilience to interference.
SP:f359fc20c6359739c048c5852909a9655925e187
Causal Inference Q-Network: Toward Resilient Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have shown enhanced performance , gained widespread applications ( Mnih et al. , 2015 ; 2016 ; Ecoffet et al. , 2019 ; Silver et al. , 2017 ; Mao et al. , 2017 ) , and improved robot learning ( Gu et al. , 2017 ) in navigation systems ( Tai et al. , 2017 ; Nagabandi et al. , 2018 ) . However , most successful demonstrations of these DRL methods are usually trained and deployed under well-controlled situations . In contrast , real-world use cases often encounter inevitable observational uncertainty ( Grigorescu et al. , 2020 ; Hafner et al. , 2018 ; Moreno et al. , 2018 ) from an external attacker ( Huang et al. , 2017 ) or noisy sensor ( Fortunato et al. , 2018 ; Lee et al. , 2018 ) . For examples , playing online video games may experience sudden black-outs or frame-skippings due to network instabilities , and driving on the road may encounter temporary blindness when facing the sun . Such an abrupt interference on the observation could cause serious issues for DRL algorithms . Unlike other machine learning tasks that involve only a single mission at a time ( e.g. , image classification ) , an RL agent has to deal with a dynamic ( Schmidhuber , 1992 ) and encoded state ( Schmidhuber , 1991 ; Kaelbling et al. , 1998 ) and to anticipate future rewards . Therefore , DRL-based systems are likely to propagate and even enlarge risks ( e.g. , delay and noisy pulsed-signals on sensor-fusion ( Yurtsever et al. , 2020 ; Johansen et al. , 2015 ) ) induced from the uncertain interference . In this paper , we investigate the resilience ability of an RL agent to withstand unforeseen , rare , adversarial and potentially catastrophic interferences , and to recover and adapt by improving itself in reaction to these events . We consider a resilient RL framework with observational interferences . At each time , the agent ’ s observation is subjected to a type of sudden interference at a predefined possibility . Whether or not an observation has interfered is referred to as the interference label . Specifically , to train a resilient agent , we provide the agent with the interference labels during training . For instance , the labels could be derived from some uncertain noise generators recording whether the agent observes an intervened state at the moment as a binary causation label . By applying the labels as an intervention into the environment , the RL agent is asked to learn a binary causation label and embed a latent state into its model . However , when the trained agent is deployed in the field ( i.e. , the testing phase ) , the agent only receives the interfered observations but is agnostic to interference labels and needs to act resiliently against the interference . For an RL agent to be resilient against interference , the agent needs to diagnose observations to make the correct inference about the reward information . To achieve this , the RL agent has to reason about what leads to desired rewards despite the irrelevant intermittent interference . To equip an RL agent with this reasoning capability , we exploit the causal inference framework . Intuitively , a causal inference model for observation interference uses an unobserved confounder ( Pearl , 2009 ; 2019 ; 1995b ; Saunders et al. , 2018 ; Bareinboim et al. , 2015 ) to capture the effect of the interference on the reward collected from the environment . When such a confounder is available , the RL agent can focus on the confounder for relevant reward information and make the best decision . As illustrated in Figure 1 , we propose a causal inference based DRL algorithm termed causal inference Q-network ( CIQ ) . During training , when the interference labels are available , the CIQ agent will implicitly learn a causal inference model by embedding the confounder into a latent state . At the same time , the CIQ agent will also train a Q-network on the latent state for decision making . Then at testing , the CIQ agent will make use of the learned model to estimate the confounding latent state and the interference label . The history of latent states is combined into a causal inference state , which captures the relevant information for the Q-network to collect rewards in the environment despite of the observational interference . In this paper , we evaluate the performance of our method in four environments : 1 ) Cartpole-v0 – the continuous control environment ( Brockman et al. , 2016 ) ; 2 ) the 3D graphical Banana Collector ( Juliani et al. , 2018 ) ) ; 3 ) an Atari environment LunarLander-v2 ( Brockman et al. , 2016 ) , and 4 ) pixel Cartpole – visual learning from the pixel inputs of Cartpole . For each of the environments , we consider four types of interference : ( a ) black-out , ( b ) Gaussian noise , ( c ) frozen screen , and ( d ) adversarial attack . In the testing phase mimicking the practical scenario that the agent may have interfered observations but is unaware of the true interference labels ( i.e. , happens or not ) , the results show that our CIQ method can perform better and more resilience against all the four types of interference . Furthermore , to benchmark the level of resilience of different RL models , we propose a new robustness measure , called CLEVER-Q , to evaluate the robustness of Q-network based RL algorithms . The idea is to compute a lower bound on the observation noise level such that the greedy action from the Q-network will remain the same against any noise below the lower bound . According to this robustness analysis , our CIQ algorithm indeed achieves higher CLEVER-Q scores compared with the baseline methods . The main contributions of this paper include 1 ) a framework to evaluate the resilience of DRL methods under abrupt observational interferences ; 2 ) the proposed CIQ architecture and algorithm towards training a resilient DRL agent , and 3 ) an extreme-value theory based robustness metric ( CLEVER-Q ) for quantifying the resilience of Q-network based RL algorithms . 2 RELATED WORKS . Causal Inference for Reinforcement Learning : Causal inference ( Greenland et al. , 1999 ; Pearl , 2009 ; Pearl et al. , 2016 ; Pearl , 2019 ; Robins et al. , 1995 ) has been used to empower the learning process under noisy observation and have better interpretability on deep learning models ( Shalit et al. , 2017 ; Louizos et al. , 2017 ) , also with efforts ( Jaber et al. , 2019 ; Forney et al. , 2017 ; Bareinboim et al. , 2015 ) on causal online learning and bandit methods . Defining causation and applying causal inference framework to DRL still remains relatively unexplored . Recent works ( Lu et al. , 2018 ; Tennenholtz et al. , 2019 ) study this problem by defining action as one kind of intervention and calculating the treatment effects on the action . In contrast , we introduce causation into DRL by applying extra noisy and uncertain inventions . Different from the aforementioned approaches , we leverage the causal effect of observational interferences on states , and design an end-to-end structure for learning a causal-observational representation evaluating treatment effects on rewards . Adversarial Perturbation : An intensifying challenge against deep neural network based systems is adversarial perturbation for making incorrect decisions . Many gradient-based noise-generating methods ( Goodfellow et al. , 2015 ; Huang et al. , 2017 ) have been conducted for misclassification and mislead an agent ’ s output action . As an example of using DRL model playing Atari games , an adversarial attacker ( Lin et al. , 2017 ; Yang et al. , 2020 ) could jam in a timely and barely detectable noise to maximize the prediction loss of a Q-network and cause massively degraded performance . Partially Observable Markov Decision Processes ( POMDPs ) : Our resilient RL framework can be viewed as a POMDP with interfered observations . Belief-state methods are available for simple POMDP problems ( e.g. , plan graph and the tiger problem ( Kaelbling et al. , 1998 ) ) , but no provably efficient algorithm is available for general POMDP settings ( Papadimitriou & Tsitsiklis , 1987 ; Gregor et al. , 2018 ) . Recently , Igl et al . ( 2018 ) have proposed a DRL approach for POMDPs by combining variational autoencoder and policy-based learning , but this kind of methods do not consider the interference labels available during training in our resilient RL framework . Safe Reinforcement Learning : Safe reinforcement learning ( SRL ) ( Garcia & Fernández , 2012 ) seeks to learn a policy that maximizes the expected return , while satisfying specific safety constraints . Previous approaches to SRL include reward-shaping ( Saunders et al. , 2018 ) , noisy training ( Fortunato et al. , 2018 ) , shielding-based SRL ( Alshiekh et al. , 2018 ) , and policy optimization with confident lower-bound constraints ( Thomas et al. , 2015 ) . However , finding these policies in the first place could need to reset the model at each time and be computationally challenging . Our proposed resilient RL framework can be viewed as an approach to achieve SRL ( Alshiekh et al. , 2018 ) , but we focus on gaining resilience against abrupt observation interferences . Another key difference between our framework and other SRL schemes is the novelty in proactively using available interference labels during training , which allows our agent to learn a causal inference model to make safer decisions . 3 RESILIENT REINFORCEMENT LEARNING . In this section , we formally introduce our resilient RL framework and provide an extreme-value theory based metric called CLEVER-Q for measuring the robustness of DQN-based methods . We consider a sequential decision-making problem where an agent interacts with an environment . At each time t , the agent gets an observation xt , e.g . a frame in a video environment . As in many RL domains ( e.g. , Atari games ) , we view st = ( xt−M+1 , . . . , xt ) to be the state of the environment where M is a fixed number for the history of observations . Given a stochastic policy π , the agent chooses an action at ∼ π ( st ) from a discrete action space based on the observed state and receives a reward rt from the environment . For a policy π , define the Q-function Qπ ( s , a ) = E [ ∑∞ t=0 γ trt|s0 = s , a0 = a , π ] where γ ∈ ( 0 , 1 ) is the discount factor . The agent ’ s goal is to find the optimal policy π∗ that achieves the optimal Q-function given by Q∗ ( s , a ) = maxπ Qπ ( s , a ) . 3.1 RESILIENCE BASE ON AN INTERVENTIONAL PERSPECTIVE . We consider a resilient RL framework where the observations are subject to interference ( as illustrated in Fig 1 ( a ) ) as an empirical process in Rubin ’ s Causal Model ( RCM ) ( Kennedy , 2016 ; Holland , 1988 ; Balke & Pearl , 1997 ; Robins et al. , 2003 ) for causal inference . Given a type of interference I , the agent ’ s observation becomes : x′t = F I ( xt , it ) = it × I ( xt ) + ( 1− it ) × xt ( 1 ) where it ∈ { 0 , 1 } is the label indicating whether the observation is interfered at time t or not ( under the potential outcome estimation ( Rubin , 1974 ) ) , and I ( xt ) is the interfered observation . The interfered state is then given by s′t = ( x ′ t−M+1 , . . . , x ′ t ) . We assume that interference labels it follow an i.i.d . Bernoulli process with a fixed interference probability pI as a noise level . For example , when pI equals to 10 % , each observational state has a 10 % chance to be intervened under a perturbation . The agent now needs to choose its actions at ∼ π ( s′t ) based on the interfered state . The resilient RL objective for the agent is to find a policy π to maximize rewards in this environment under observation interference . In this work , we consider four types of interference as described below . Gaussian Noise . Gaussian noise or white noise is a common interference to sensory data ( Osband et al. , 2019 ; Yurtsever et al. , 2020 ) . The interfered observation becomes I ( xt ) = xt + nt with a zero-mean Gaussian noise nt . The noise variance is set to be the variance of all recorded states . Adversarial Observation . Following the standard adversarial RL attack setting , we use the fast gradient sign method ( FGSM ) ( Szegedy et al. , 2014 ) to generate adversarial patterns against the DQN prediction loss ( Huang et al. , 2017 ) . The adversarial observation is given by I ( xt ) = xt + sign ( ∇xtQ ( xt , y ; θ ) ) where y is the optimal output action by weighting over all possible actions . Observation Black-Out . Off-the-shelf hardware can affect the entire sensor networks as a sensing background ( Yurtsever et al. , 2020 ) over-shoot with I ( xt ) = 0 ( Yan et al. , 2016 ) . This perturbation is realistic owing to overheat hardware and losing the observational information of sensors . Frozen Frame . Lagging and frozen frame ( s ) ( Kalashnikov et al. , 2018 ) often come from limited data communication bottleneck bandwidth . A frozen frame is given by I ( xt ) = xt−1 . If the perturbation is constantly present , the frame will remain the first frozen frame since the perturbation happened .
This paper proposes a method, the Causal Inference Q-Network (CIQ), for training deep RL agents that are robust to abrupt interferences in observations, such as frame blackouts, Gaussian noise or adversarial perturbations. During training time, a binary interference label is provided to the agent at each time step indicating whether an interference has been applied to the observation; the interference label acts as a switch between two neural networks that process the observation to predict the Q-values. The CIQ agent learns to predict the interference label in a supervised fashion, and at test time it uses the predicted label to switch between networks, rather than the true label. The CIQ agent is shown to learn faster and more effectively when compared to a number of baselines on a selection of OpenAI Gym tasks that are modified to include various types of observational interferences.
SP:f359fc20c6359739c048c5852909a9655925e187
Causal Inference Q-Network: Toward Resilient Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have shown enhanced performance , gained widespread applications ( Mnih et al. , 2015 ; 2016 ; Ecoffet et al. , 2019 ; Silver et al. , 2017 ; Mao et al. , 2017 ) , and improved robot learning ( Gu et al. , 2017 ) in navigation systems ( Tai et al. , 2017 ; Nagabandi et al. , 2018 ) . However , most successful demonstrations of these DRL methods are usually trained and deployed under well-controlled situations . In contrast , real-world use cases often encounter inevitable observational uncertainty ( Grigorescu et al. , 2020 ; Hafner et al. , 2018 ; Moreno et al. , 2018 ) from an external attacker ( Huang et al. , 2017 ) or noisy sensor ( Fortunato et al. , 2018 ; Lee et al. , 2018 ) . For examples , playing online video games may experience sudden black-outs or frame-skippings due to network instabilities , and driving on the road may encounter temporary blindness when facing the sun . Such an abrupt interference on the observation could cause serious issues for DRL algorithms . Unlike other machine learning tasks that involve only a single mission at a time ( e.g. , image classification ) , an RL agent has to deal with a dynamic ( Schmidhuber , 1992 ) and encoded state ( Schmidhuber , 1991 ; Kaelbling et al. , 1998 ) and to anticipate future rewards . Therefore , DRL-based systems are likely to propagate and even enlarge risks ( e.g. , delay and noisy pulsed-signals on sensor-fusion ( Yurtsever et al. , 2020 ; Johansen et al. , 2015 ) ) induced from the uncertain interference . In this paper , we investigate the resilience ability of an RL agent to withstand unforeseen , rare , adversarial and potentially catastrophic interferences , and to recover and adapt by improving itself in reaction to these events . We consider a resilient RL framework with observational interferences . At each time , the agent ’ s observation is subjected to a type of sudden interference at a predefined possibility . Whether or not an observation has interfered is referred to as the interference label . Specifically , to train a resilient agent , we provide the agent with the interference labels during training . For instance , the labels could be derived from some uncertain noise generators recording whether the agent observes an intervened state at the moment as a binary causation label . By applying the labels as an intervention into the environment , the RL agent is asked to learn a binary causation label and embed a latent state into its model . However , when the trained agent is deployed in the field ( i.e. , the testing phase ) , the agent only receives the interfered observations but is agnostic to interference labels and needs to act resiliently against the interference . For an RL agent to be resilient against interference , the agent needs to diagnose observations to make the correct inference about the reward information . To achieve this , the RL agent has to reason about what leads to desired rewards despite the irrelevant intermittent interference . To equip an RL agent with this reasoning capability , we exploit the causal inference framework . Intuitively , a causal inference model for observation interference uses an unobserved confounder ( Pearl , 2009 ; 2019 ; 1995b ; Saunders et al. , 2018 ; Bareinboim et al. , 2015 ) to capture the effect of the interference on the reward collected from the environment . When such a confounder is available , the RL agent can focus on the confounder for relevant reward information and make the best decision . As illustrated in Figure 1 , we propose a causal inference based DRL algorithm termed causal inference Q-network ( CIQ ) . During training , when the interference labels are available , the CIQ agent will implicitly learn a causal inference model by embedding the confounder into a latent state . At the same time , the CIQ agent will also train a Q-network on the latent state for decision making . Then at testing , the CIQ agent will make use of the learned model to estimate the confounding latent state and the interference label . The history of latent states is combined into a causal inference state , which captures the relevant information for the Q-network to collect rewards in the environment despite of the observational interference . In this paper , we evaluate the performance of our method in four environments : 1 ) Cartpole-v0 – the continuous control environment ( Brockman et al. , 2016 ) ; 2 ) the 3D graphical Banana Collector ( Juliani et al. , 2018 ) ) ; 3 ) an Atari environment LunarLander-v2 ( Brockman et al. , 2016 ) , and 4 ) pixel Cartpole – visual learning from the pixel inputs of Cartpole . For each of the environments , we consider four types of interference : ( a ) black-out , ( b ) Gaussian noise , ( c ) frozen screen , and ( d ) adversarial attack . In the testing phase mimicking the practical scenario that the agent may have interfered observations but is unaware of the true interference labels ( i.e. , happens or not ) , the results show that our CIQ method can perform better and more resilience against all the four types of interference . Furthermore , to benchmark the level of resilience of different RL models , we propose a new robustness measure , called CLEVER-Q , to evaluate the robustness of Q-network based RL algorithms . The idea is to compute a lower bound on the observation noise level such that the greedy action from the Q-network will remain the same against any noise below the lower bound . According to this robustness analysis , our CIQ algorithm indeed achieves higher CLEVER-Q scores compared with the baseline methods . The main contributions of this paper include 1 ) a framework to evaluate the resilience of DRL methods under abrupt observational interferences ; 2 ) the proposed CIQ architecture and algorithm towards training a resilient DRL agent , and 3 ) an extreme-value theory based robustness metric ( CLEVER-Q ) for quantifying the resilience of Q-network based RL algorithms . 2 RELATED WORKS . Causal Inference for Reinforcement Learning : Causal inference ( Greenland et al. , 1999 ; Pearl , 2009 ; Pearl et al. , 2016 ; Pearl , 2019 ; Robins et al. , 1995 ) has been used to empower the learning process under noisy observation and have better interpretability on deep learning models ( Shalit et al. , 2017 ; Louizos et al. , 2017 ) , also with efforts ( Jaber et al. , 2019 ; Forney et al. , 2017 ; Bareinboim et al. , 2015 ) on causal online learning and bandit methods . Defining causation and applying causal inference framework to DRL still remains relatively unexplored . Recent works ( Lu et al. , 2018 ; Tennenholtz et al. , 2019 ) study this problem by defining action as one kind of intervention and calculating the treatment effects on the action . In contrast , we introduce causation into DRL by applying extra noisy and uncertain inventions . Different from the aforementioned approaches , we leverage the causal effect of observational interferences on states , and design an end-to-end structure for learning a causal-observational representation evaluating treatment effects on rewards . Adversarial Perturbation : An intensifying challenge against deep neural network based systems is adversarial perturbation for making incorrect decisions . Many gradient-based noise-generating methods ( Goodfellow et al. , 2015 ; Huang et al. , 2017 ) have been conducted for misclassification and mislead an agent ’ s output action . As an example of using DRL model playing Atari games , an adversarial attacker ( Lin et al. , 2017 ; Yang et al. , 2020 ) could jam in a timely and barely detectable noise to maximize the prediction loss of a Q-network and cause massively degraded performance . Partially Observable Markov Decision Processes ( POMDPs ) : Our resilient RL framework can be viewed as a POMDP with interfered observations . Belief-state methods are available for simple POMDP problems ( e.g. , plan graph and the tiger problem ( Kaelbling et al. , 1998 ) ) , but no provably efficient algorithm is available for general POMDP settings ( Papadimitriou & Tsitsiklis , 1987 ; Gregor et al. , 2018 ) . Recently , Igl et al . ( 2018 ) have proposed a DRL approach for POMDPs by combining variational autoencoder and policy-based learning , but this kind of methods do not consider the interference labels available during training in our resilient RL framework . Safe Reinforcement Learning : Safe reinforcement learning ( SRL ) ( Garcia & Fernández , 2012 ) seeks to learn a policy that maximizes the expected return , while satisfying specific safety constraints . Previous approaches to SRL include reward-shaping ( Saunders et al. , 2018 ) , noisy training ( Fortunato et al. , 2018 ) , shielding-based SRL ( Alshiekh et al. , 2018 ) , and policy optimization with confident lower-bound constraints ( Thomas et al. , 2015 ) . However , finding these policies in the first place could need to reset the model at each time and be computationally challenging . Our proposed resilient RL framework can be viewed as an approach to achieve SRL ( Alshiekh et al. , 2018 ) , but we focus on gaining resilience against abrupt observation interferences . Another key difference between our framework and other SRL schemes is the novelty in proactively using available interference labels during training , which allows our agent to learn a causal inference model to make safer decisions . 3 RESILIENT REINFORCEMENT LEARNING . In this section , we formally introduce our resilient RL framework and provide an extreme-value theory based metric called CLEVER-Q for measuring the robustness of DQN-based methods . We consider a sequential decision-making problem where an agent interacts with an environment . At each time t , the agent gets an observation xt , e.g . a frame in a video environment . As in many RL domains ( e.g. , Atari games ) , we view st = ( xt−M+1 , . . . , xt ) to be the state of the environment where M is a fixed number for the history of observations . Given a stochastic policy π , the agent chooses an action at ∼ π ( st ) from a discrete action space based on the observed state and receives a reward rt from the environment . For a policy π , define the Q-function Qπ ( s , a ) = E [ ∑∞ t=0 γ trt|s0 = s , a0 = a , π ] where γ ∈ ( 0 , 1 ) is the discount factor . The agent ’ s goal is to find the optimal policy π∗ that achieves the optimal Q-function given by Q∗ ( s , a ) = maxπ Qπ ( s , a ) . 3.1 RESILIENCE BASE ON AN INTERVENTIONAL PERSPECTIVE . We consider a resilient RL framework where the observations are subject to interference ( as illustrated in Fig 1 ( a ) ) as an empirical process in Rubin ’ s Causal Model ( RCM ) ( Kennedy , 2016 ; Holland , 1988 ; Balke & Pearl , 1997 ; Robins et al. , 2003 ) for causal inference . Given a type of interference I , the agent ’ s observation becomes : x′t = F I ( xt , it ) = it × I ( xt ) + ( 1− it ) × xt ( 1 ) where it ∈ { 0 , 1 } is the label indicating whether the observation is interfered at time t or not ( under the potential outcome estimation ( Rubin , 1974 ) ) , and I ( xt ) is the interfered observation . The interfered state is then given by s′t = ( x ′ t−M+1 , . . . , x ′ t ) . We assume that interference labels it follow an i.i.d . Bernoulli process with a fixed interference probability pI as a noise level . For example , when pI equals to 10 % , each observational state has a 10 % chance to be intervened under a perturbation . The agent now needs to choose its actions at ∼ π ( s′t ) based on the interfered state . The resilient RL objective for the agent is to find a policy π to maximize rewards in this environment under observation interference . In this work , we consider four types of interference as described below . Gaussian Noise . Gaussian noise or white noise is a common interference to sensory data ( Osband et al. , 2019 ; Yurtsever et al. , 2020 ) . The interfered observation becomes I ( xt ) = xt + nt with a zero-mean Gaussian noise nt . The noise variance is set to be the variance of all recorded states . Adversarial Observation . Following the standard adversarial RL attack setting , we use the fast gradient sign method ( FGSM ) ( Szegedy et al. , 2014 ) to generate adversarial patterns against the DQN prediction loss ( Huang et al. , 2017 ) . The adversarial observation is given by I ( xt ) = xt + sign ( ∇xtQ ( xt , y ; θ ) ) where y is the optimal output action by weighting over all possible actions . Observation Black-Out . Off-the-shelf hardware can affect the entire sensor networks as a sensing background ( Yurtsever et al. , 2020 ) over-shoot with I ( xt ) = 0 ( Yan et al. , 2016 ) . This perturbation is realistic owing to overheat hardware and losing the observational information of sensors . Frozen Frame . Lagging and frozen frame ( s ) ( Kalashnikov et al. , 2018 ) often come from limited data communication bottleneck bandwidth . A frozen frame is given by I ( xt ) = xt−1 . If the perturbation is constantly present , the frame will remain the first frozen frame since the perturbation happened .
Overview: The paper introduces a causal mechanism that both creates and explains away noise interventions into observational data fed into RL agents. The authors propose a form of resilient agent, that based on training data containing labeled interventions, learns both Q function and the causal impact of interventions on the Q function. The model architecture consists of a intervention predictor and a split parametrization of the Q function estimation as a function of intervention as shown in L^{CIQ} presented as eq.3. Finally, the authors show the performance of their proposed method on 4 visual based RL agents with two types of interventions (attacks): namely adversarial and blackout against classical baselines such as DQN and DQN with safe actions.
SP:f359fc20c6359739c048c5852909a9655925e187
A law of robustness for two-layers neural networks
√ n/k where n is the number of datapoints . In particular , this conjecture implies that overparametrization is necessary for robustness , since it means that one needs roughly one neuron per datapoint to ensure a O ( 1 ) -Lipschitz network , while mere data fitting of d-dimensional data requires only one neuron per d datapoints . We prove a weaker version of this conjecture when the Lipschitz constant is replaced by an upper bound on it based on the spectral norm of the weight matrix . We also prove the conjecture in the highdimensional regime n ≈ d ( which we also refer to as the undercomplete case , since only k ≤ d is relevant here ) . Finally we prove the conjecture for polynomial activation functions of degree p when n ≈ dp . We complement these findings with experimental evidence supporting the conjecture . 1 INTRODUCTION . We study two-layers neural networks with inputs in Rd , k neurons , and Lipschitz non-linearity ψ : R→ R. These are functions of the form : x 7→ k∑ ` =1 a ` ψ ( w ` · x+ b ` ) , ( 1 ) with a ` , b ` ∈ R and w ` ∈ Rd for any ` ∈ [ k ] . We denote by Fk ( ψ ) the set of functions of the form ( 1 ) . When k is large enough and ψ is non-polynomial , this set of functions can be used to fit any given data set ( Cybenko , 1989 ; Leshno et al. , 1993 ) . That is , given a data set ( xi , yi ) i∈ [ n ] ∈ ( Rd × R ) n , one can find f ∈ Fk ( ψ ) such that f ( xi ) = yi , ∀i ∈ [ n ] . ( 2 ) In a variety of scenarios one is furthermore interested in fitting the data smoothly . For example , in machine learning , the data fitting model f is used to make predictions at unseen points x 6∈ { x1 , . . . , xn } . It is reasonable to ask for these predictions to be stable , that is a small perturbation of x should result in a small perturbation of f ( x ) . A natural question is : how “ costly ” is this stability restriction compared to mere data fitting ? In practice it seems much harder to find robust models for large scale problems , as first evidenced in the seminal paper ( Szegedy et al. , 2013 ) . In theory the “ cost ” of finding robust models has been investigated from a computational complexity perspective in ( Bubeck et al. , 2019 ) , from a statistical perspective in ( Schmidt et al. , 2018 ) , and more generally from a model complexity perspective in ( Degwekar et al. , 2019 ; Raghunathan et al. , 2019 ; Allen-Zhu and Li , 2020 ) . We propose here a different angle of study within the broad model complexity perspective : does a model have to be larger for it to be robust ? Empirical evidence ( e.g. , ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) ) suggests that bigger models ( also known as “ overparametrization ” ) do indeed help for robustness . Our main contribution is a conjecture ( Conjecture 1 and Conjecture 2 ) on the precise tradeoffs between size of the model ( i.e. , the number of neurons k ) and robustness ( i.e. , the Lipschitz constant of the data fitting model f ∈ Fk ( ψ ) ) for generic data sets . We say that a data set ( xi , yi ) i∈ [ n ] is generic if it is i.i.d . with xi uniform ( or approximately so , see below ) on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } and yi uniform on { −1 , +1 } . We give the precise conjecture in Section 2 . We prove several weaker versions of Conjecture 1 and Conjecture 2 respectively in Section 4 and Section 3 . We also give empirical evidence for the conjecture in Section 5 . A corollary of our conjecture . A key fact about generic data , established in Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) , is that one can memorize arbitrary labels with k ≈ n/d , that is merely one neuron per d datapoints . Our conjecture implies that for such optimal-size neural networks it is impossible to be robust , in the sense that the Lipschitz constant must be of order √ d. The conjecture also states that to be robust ( i.e . attain Lipschitz constantO ( 1 ) ) one must necessarily have k ≈ n , that is roughly each datapoint must have its own neuron . Therefore , we obtain a trade off between size and robustness , namely to make the network robust it needs to be d times larger than for mere data fitting . We illustrate these two cases in Figure 1 . We train a neural network to fit generic data , and plot the maximum gradient over several randomly drawn points ( a proxy for the Lipschitz constant ) for various values of √ d , when either k = n ( blue dots ) or k = 10nd ( red dots ) . As predicted , for the large neural network ( k = n ) the Lipschitz constant remains roughly constant , while for the optimally-sized one ( k = 10nd ) the Lipschitz constant increases roughly linearly in √ d. Notation . For Ω ⊂ Rd we define LipΩ ( f ) = supx 6=x′∈Ω |f ( x ) −f ( x′ ) | ‖x−x′‖ ( if Ω = R d we omit the subscript and write Lip ( f ) ) , where ‖ · ‖ denotes the Euclidean norm . For matrices we use ‖ · ‖op , ‖ · ‖op , ∗ , ‖ · ‖F and 〈· , ·〉 for respectively the operator norm , the nuclear norm ( sum of singular values ) , the Frobenius norm , and the Frobenius inner product . We also use these notations for tensors of higher order , see Appendix A for more details on tensors . We denote c > 0 and C > 0 for universal numerical constants , respectively small enough and large enough , whose values can change in different occurences . Similarly , by cp > 0 and Cp > 0 we denote constants depending only on the parameter p. We also write ReLU ( t ) = max ( t , 0 ) for the rectified linear unit . Generic data . We give some flexibility in our definition of “ generic data ” in order to focus on the essence of the problem , rather than technical details . Namely , in addition to the spherical model mentioned above , where xi is i.i.d . uniform on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } , we also consider the very closely related model where xi is i.i.d . from a centered Gaussian with covariance 1 d Id ( in particular E [ ‖xi‖ 2 ] = 1 , and in fact ‖xi‖ is tightly concentrated around 1 ) . In both cases we consider yi to be i.i.d . random signs . We say that a property holds with high probability for generic data , if it holds with high probability either for the spherical model or for the Gaussian model . 2 A CONJECTURED LAW OF ROBUSTNESS . Our main contribution is the following conjecture , which asserts that , on generic data sets , increasing the size of a network is necessary to obtain robustness : Conjecture 1 For generic data sets , with high probability1 , any f ∈ Fk ( ψ ) fitting the data2 ( i.e. , satisfying ( 2 ) ) must also satisfy : LipSd−1 ( f ) ≥ c √ n k . Note that for generic data , with high probability ( for n = poly ( d ) ) , there exists a smooth interpolation . Namely there exists g : Rd → R with g ( xi ) = yi , ∀i ∈ [ n ] and Lip ( g ) = O ( 1 ) . This follows easily from the fact that with high probability ( for large d ) one has ‖xi − xj‖ ≥ 1 , ∀i 6= j. Conjecture 1 puts restrictions on how smoothly one can interpolate data with small neural networks . A striking consequence of the conjecture is that for a two-layers neural network f ∈ Fk ( ψ ) to be as robust as this function g ( i.e. , Lip ( f ) = O ( 1 ) ) and fit the data , one must have k = Ω ( n ) , i.e. , roughly one neuron per data point . On the other hand with that many neurons it is quite trivial to smoothly interpolate the data , as we explain in Section 3.3 . Thus the conjecture makes a strong statement that essentially the trivial smooth interpolation is the best thing one can do . In addition to making the prediction that one neuron per datapoint is necessary for optimal smoothness , the conjecture also gives a precise prediction on the possible tradeoff between size of the network and its robustness . We also conjecture that this whole range of tradeoffs is actually achievable : Conjecture 2 Let n , d , k be such that C · nd ≤ k ≤ C · n and n ≤ d C where C is an arbitrarily large constant in the latter occurence . There exists ψ such that , for generic data sets , with high probability , there exists f ∈ Fk ( ψ ) fitting the data ( i.e. , satisfying ( 2 ) ) and such that LipSd−1 ( f ) ≤ C √ n k . The condition k ≤ C · n in Conjecture 2 is necessary , for any interpolation of the data must have Lipschitz constant at least a constant . The other condition on k , namely k ≥ C · nd , is also necessary , for that many neurons is needed to merely guarantee the existence of a data-fitting neural network with k neurons ( see Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) ) . Finally the condition n ≤ dC is merely used to avoid explicitly stating a logarithmic term in our conjecture ( indeed , equivalently one can replace this condition by adding a multiplicative polylogarithmic term in d in the claimed inequality ) . Our results around Conjecture 2 ( Section 3 ) . We prove Conjecture 2 for both the optimal smoothness regime ( which is quite straightforward , see Section 3.3 ) and for the optimal size regime ( here more work is needed , and we use a certain tensor-based construction , see Section 3.4 ) . In the latter case we only prove approximate data fitting ( mostly to simplify the proofs ) , and more importantly we need to assume that n is of order dp for some even integer p. It would be interesting to generalize the proof to any n. While the conjecture remains open between these two extreme regimes , we do give a construction in Section 3.3 which has the correct qualitative behavior ( namely increasing k improves the Lipschitz constant ) , albeit the scaling we obtain is n/k instead of √ n/k , see Theorem 1 . Our results around Conjecture 1 ( Section 4 ) . We prove a weaker version of Conjecture 1 where the Lipschitz constant on the sphere is replaced by a proxy involving the spectral norm of the weight matrix , see Theorem 3 . We also prove the conjecture in the optimal size regime , specifically when n = dp for an integer p and one uses a polynomial activation function of degree p , see Theorem 6 . For p = 1 ( i.e. , n ≈ d ) we in fact prove the conjecture for abritrary non-linearities , see Theorem 4 . 1We do not quantify the “ with high probability ” in our conjecture . We believe the conjecture to be true except for an event of exponentially small probability with respect to the sampling of a generic data set , but even proving that the statement is true with strictly positive probability would be extremely interesting . 2We expect the same lower bound to hold even if one only asks f to approximately fit the data . In fact our provable variants of Conjecture 1 are based proofs that are robust to only assuming an approximately fitting f . Further open problems . Our proposed law of robustness is a first mathematical formalization of the broader phenomenon that “ overparametrization in neural networks is necessary for robustness ” . Ideally one would like a much more refined understanding of the phenomenon than the one given in Conjecture 1 . For example , one could imagine that in greater generality , the law would read LipΩ ( f ) ≥ F ( k , ( xi , yi ) i∈ [ n ] , Ω ) . That is , we would like to understand how the achievable level of smoothness depends on the particular data set at hand , but also on the set where we expect to be making predictions . Another direction to generalize the law would be to extend it to multilayers neural networks . In particular one could imagine the most general law would replace the parameter k ( number of neurons ) by the type of architecture being used and in turn predict the best architecture for a given data set and prediction set . Finally note that our proposed law apply to all neural networks , but it would also be interesting to understand how the law interacts with algorithmic considerations ( for example in Section 5 we use Adam Kingma and Ba ( 2015 ) to find a set of weights that qualitatively match Conjecture 2 ) .
This submission studies the relationship between the hidden-layer size of a two-layer neural network and its robustness, that is measured by its Lipschitz constant here. This paper first makes a conjecture that any two-layer neural network with k-neurons and Lipschitz activation functions that perfectly fit the data must have its Lipschitz constant larger than \sqrt(n/k) (with n being the number of data points and k the number of hidden neurons). An implication of this conjecture is that overparameterization can help improve the network robustness (namely, by making \sqrt(n/k) with sufficiently large k). Furthermore, a weaker version of this conjecture was proved by replacing the Lipschitz constant with an upper bound on the spectral norm of the weight matrix. The conjecture was further proved for ReLU activation function and polynomial activation function in different data regimes. These theoretical findings were finally evidenced with numerical results.
SP:4d996de760a12de3340883269c88cb7b31268ca7
A law of robustness for two-layers neural networks
√ n/k where n is the number of datapoints . In particular , this conjecture implies that overparametrization is necessary for robustness , since it means that one needs roughly one neuron per datapoint to ensure a O ( 1 ) -Lipschitz network , while mere data fitting of d-dimensional data requires only one neuron per d datapoints . We prove a weaker version of this conjecture when the Lipschitz constant is replaced by an upper bound on it based on the spectral norm of the weight matrix . We also prove the conjecture in the highdimensional regime n ≈ d ( which we also refer to as the undercomplete case , since only k ≤ d is relevant here ) . Finally we prove the conjecture for polynomial activation functions of degree p when n ≈ dp . We complement these findings with experimental evidence supporting the conjecture . 1 INTRODUCTION . We study two-layers neural networks with inputs in Rd , k neurons , and Lipschitz non-linearity ψ : R→ R. These are functions of the form : x 7→ k∑ ` =1 a ` ψ ( w ` · x+ b ` ) , ( 1 ) with a ` , b ` ∈ R and w ` ∈ Rd for any ` ∈ [ k ] . We denote by Fk ( ψ ) the set of functions of the form ( 1 ) . When k is large enough and ψ is non-polynomial , this set of functions can be used to fit any given data set ( Cybenko , 1989 ; Leshno et al. , 1993 ) . That is , given a data set ( xi , yi ) i∈ [ n ] ∈ ( Rd × R ) n , one can find f ∈ Fk ( ψ ) such that f ( xi ) = yi , ∀i ∈ [ n ] . ( 2 ) In a variety of scenarios one is furthermore interested in fitting the data smoothly . For example , in machine learning , the data fitting model f is used to make predictions at unseen points x 6∈ { x1 , . . . , xn } . It is reasonable to ask for these predictions to be stable , that is a small perturbation of x should result in a small perturbation of f ( x ) . A natural question is : how “ costly ” is this stability restriction compared to mere data fitting ? In practice it seems much harder to find robust models for large scale problems , as first evidenced in the seminal paper ( Szegedy et al. , 2013 ) . In theory the “ cost ” of finding robust models has been investigated from a computational complexity perspective in ( Bubeck et al. , 2019 ) , from a statistical perspective in ( Schmidt et al. , 2018 ) , and more generally from a model complexity perspective in ( Degwekar et al. , 2019 ; Raghunathan et al. , 2019 ; Allen-Zhu and Li , 2020 ) . We propose here a different angle of study within the broad model complexity perspective : does a model have to be larger for it to be robust ? Empirical evidence ( e.g. , ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) ) suggests that bigger models ( also known as “ overparametrization ” ) do indeed help for robustness . Our main contribution is a conjecture ( Conjecture 1 and Conjecture 2 ) on the precise tradeoffs between size of the model ( i.e. , the number of neurons k ) and robustness ( i.e. , the Lipschitz constant of the data fitting model f ∈ Fk ( ψ ) ) for generic data sets . We say that a data set ( xi , yi ) i∈ [ n ] is generic if it is i.i.d . with xi uniform ( or approximately so , see below ) on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } and yi uniform on { −1 , +1 } . We give the precise conjecture in Section 2 . We prove several weaker versions of Conjecture 1 and Conjecture 2 respectively in Section 4 and Section 3 . We also give empirical evidence for the conjecture in Section 5 . A corollary of our conjecture . A key fact about generic data , established in Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) , is that one can memorize arbitrary labels with k ≈ n/d , that is merely one neuron per d datapoints . Our conjecture implies that for such optimal-size neural networks it is impossible to be robust , in the sense that the Lipschitz constant must be of order √ d. The conjecture also states that to be robust ( i.e . attain Lipschitz constantO ( 1 ) ) one must necessarily have k ≈ n , that is roughly each datapoint must have its own neuron . Therefore , we obtain a trade off between size and robustness , namely to make the network robust it needs to be d times larger than for mere data fitting . We illustrate these two cases in Figure 1 . We train a neural network to fit generic data , and plot the maximum gradient over several randomly drawn points ( a proxy for the Lipschitz constant ) for various values of √ d , when either k = n ( blue dots ) or k = 10nd ( red dots ) . As predicted , for the large neural network ( k = n ) the Lipschitz constant remains roughly constant , while for the optimally-sized one ( k = 10nd ) the Lipschitz constant increases roughly linearly in √ d. Notation . For Ω ⊂ Rd we define LipΩ ( f ) = supx 6=x′∈Ω |f ( x ) −f ( x′ ) | ‖x−x′‖ ( if Ω = R d we omit the subscript and write Lip ( f ) ) , where ‖ · ‖ denotes the Euclidean norm . For matrices we use ‖ · ‖op , ‖ · ‖op , ∗ , ‖ · ‖F and 〈· , ·〉 for respectively the operator norm , the nuclear norm ( sum of singular values ) , the Frobenius norm , and the Frobenius inner product . We also use these notations for tensors of higher order , see Appendix A for more details on tensors . We denote c > 0 and C > 0 for universal numerical constants , respectively small enough and large enough , whose values can change in different occurences . Similarly , by cp > 0 and Cp > 0 we denote constants depending only on the parameter p. We also write ReLU ( t ) = max ( t , 0 ) for the rectified linear unit . Generic data . We give some flexibility in our definition of “ generic data ” in order to focus on the essence of the problem , rather than technical details . Namely , in addition to the spherical model mentioned above , where xi is i.i.d . uniform on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } , we also consider the very closely related model where xi is i.i.d . from a centered Gaussian with covariance 1 d Id ( in particular E [ ‖xi‖ 2 ] = 1 , and in fact ‖xi‖ is tightly concentrated around 1 ) . In both cases we consider yi to be i.i.d . random signs . We say that a property holds with high probability for generic data , if it holds with high probability either for the spherical model or for the Gaussian model . 2 A CONJECTURED LAW OF ROBUSTNESS . Our main contribution is the following conjecture , which asserts that , on generic data sets , increasing the size of a network is necessary to obtain robustness : Conjecture 1 For generic data sets , with high probability1 , any f ∈ Fk ( ψ ) fitting the data2 ( i.e. , satisfying ( 2 ) ) must also satisfy : LipSd−1 ( f ) ≥ c √ n k . Note that for generic data , with high probability ( for n = poly ( d ) ) , there exists a smooth interpolation . Namely there exists g : Rd → R with g ( xi ) = yi , ∀i ∈ [ n ] and Lip ( g ) = O ( 1 ) . This follows easily from the fact that with high probability ( for large d ) one has ‖xi − xj‖ ≥ 1 , ∀i 6= j. Conjecture 1 puts restrictions on how smoothly one can interpolate data with small neural networks . A striking consequence of the conjecture is that for a two-layers neural network f ∈ Fk ( ψ ) to be as robust as this function g ( i.e. , Lip ( f ) = O ( 1 ) ) and fit the data , one must have k = Ω ( n ) , i.e. , roughly one neuron per data point . On the other hand with that many neurons it is quite trivial to smoothly interpolate the data , as we explain in Section 3.3 . Thus the conjecture makes a strong statement that essentially the trivial smooth interpolation is the best thing one can do . In addition to making the prediction that one neuron per datapoint is necessary for optimal smoothness , the conjecture also gives a precise prediction on the possible tradeoff between size of the network and its robustness . We also conjecture that this whole range of tradeoffs is actually achievable : Conjecture 2 Let n , d , k be such that C · nd ≤ k ≤ C · n and n ≤ d C where C is an arbitrarily large constant in the latter occurence . There exists ψ such that , for generic data sets , with high probability , there exists f ∈ Fk ( ψ ) fitting the data ( i.e. , satisfying ( 2 ) ) and such that LipSd−1 ( f ) ≤ C √ n k . The condition k ≤ C · n in Conjecture 2 is necessary , for any interpolation of the data must have Lipschitz constant at least a constant . The other condition on k , namely k ≥ C · nd , is also necessary , for that many neurons is needed to merely guarantee the existence of a data-fitting neural network with k neurons ( see Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) ) . Finally the condition n ≤ dC is merely used to avoid explicitly stating a logarithmic term in our conjecture ( indeed , equivalently one can replace this condition by adding a multiplicative polylogarithmic term in d in the claimed inequality ) . Our results around Conjecture 2 ( Section 3 ) . We prove Conjecture 2 for both the optimal smoothness regime ( which is quite straightforward , see Section 3.3 ) and for the optimal size regime ( here more work is needed , and we use a certain tensor-based construction , see Section 3.4 ) . In the latter case we only prove approximate data fitting ( mostly to simplify the proofs ) , and more importantly we need to assume that n is of order dp for some even integer p. It would be interesting to generalize the proof to any n. While the conjecture remains open between these two extreme regimes , we do give a construction in Section 3.3 which has the correct qualitative behavior ( namely increasing k improves the Lipschitz constant ) , albeit the scaling we obtain is n/k instead of √ n/k , see Theorem 1 . Our results around Conjecture 1 ( Section 4 ) . We prove a weaker version of Conjecture 1 where the Lipschitz constant on the sphere is replaced by a proxy involving the spectral norm of the weight matrix , see Theorem 3 . We also prove the conjecture in the optimal size regime , specifically when n = dp for an integer p and one uses a polynomial activation function of degree p , see Theorem 6 . For p = 1 ( i.e. , n ≈ d ) we in fact prove the conjecture for abritrary non-linearities , see Theorem 4 . 1We do not quantify the “ with high probability ” in our conjecture . We believe the conjecture to be true except for an event of exponentially small probability with respect to the sampling of a generic data set , but even proving that the statement is true with strictly positive probability would be extremely interesting . 2We expect the same lower bound to hold even if one only asks f to approximately fit the data . In fact our provable variants of Conjecture 1 are based proofs that are robust to only assuming an approximately fitting f . Further open problems . Our proposed law of robustness is a first mathematical formalization of the broader phenomenon that “ overparametrization in neural networks is necessary for robustness ” . Ideally one would like a much more refined understanding of the phenomenon than the one given in Conjecture 1 . For example , one could imagine that in greater generality , the law would read LipΩ ( f ) ≥ F ( k , ( xi , yi ) i∈ [ n ] , Ω ) . That is , we would like to understand how the achievable level of smoothness depends on the particular data set at hand , but also on the set where we expect to be making predictions . Another direction to generalize the law would be to extend it to multilayers neural networks . In particular one could imagine the most general law would replace the parameter k ( number of neurons ) by the type of architecture being used and in turn predict the best architecture for a given data set and prediction set . Finally note that our proposed law apply to all neural networks , but it would also be interesting to understand how the law interacts with algorithmic considerations ( for example in Section 5 we use Adam Kingma and Ba ( 2015 ) to find a set of weights that qualitatively match Conjecture 2 ) .
In this article, the authors investigated the fundamental trade-off between the size of a neural network and its robustness (measured by its Lipschitz constant), in the setting of a single-hidden-layer network with $k$ neurons and (approximately) Gaussian data, by proposing two conjectures, Conjecture 1 and 2, on the (lower and upper bound of the) network Lipschitz constant in perfectly fitting a given data set of size $n$ and data dimension $d$. Some weaker versions of the two proposed conjectures were proven, in Section 4 and 3, respectively. Empirical evidence for the proposed conjectures was shown in Section 5.
SP:4d996de760a12de3340883269c88cb7b31268ca7
A law of robustness for two-layers neural networks
√ n/k where n is the number of datapoints . In particular , this conjecture implies that overparametrization is necessary for robustness , since it means that one needs roughly one neuron per datapoint to ensure a O ( 1 ) -Lipschitz network , while mere data fitting of d-dimensional data requires only one neuron per d datapoints . We prove a weaker version of this conjecture when the Lipschitz constant is replaced by an upper bound on it based on the spectral norm of the weight matrix . We also prove the conjecture in the highdimensional regime n ≈ d ( which we also refer to as the undercomplete case , since only k ≤ d is relevant here ) . Finally we prove the conjecture for polynomial activation functions of degree p when n ≈ dp . We complement these findings with experimental evidence supporting the conjecture . 1 INTRODUCTION . We study two-layers neural networks with inputs in Rd , k neurons , and Lipschitz non-linearity ψ : R→ R. These are functions of the form : x 7→ k∑ ` =1 a ` ψ ( w ` · x+ b ` ) , ( 1 ) with a ` , b ` ∈ R and w ` ∈ Rd for any ` ∈ [ k ] . We denote by Fk ( ψ ) the set of functions of the form ( 1 ) . When k is large enough and ψ is non-polynomial , this set of functions can be used to fit any given data set ( Cybenko , 1989 ; Leshno et al. , 1993 ) . That is , given a data set ( xi , yi ) i∈ [ n ] ∈ ( Rd × R ) n , one can find f ∈ Fk ( ψ ) such that f ( xi ) = yi , ∀i ∈ [ n ] . ( 2 ) In a variety of scenarios one is furthermore interested in fitting the data smoothly . For example , in machine learning , the data fitting model f is used to make predictions at unseen points x 6∈ { x1 , . . . , xn } . It is reasonable to ask for these predictions to be stable , that is a small perturbation of x should result in a small perturbation of f ( x ) . A natural question is : how “ costly ” is this stability restriction compared to mere data fitting ? In practice it seems much harder to find robust models for large scale problems , as first evidenced in the seminal paper ( Szegedy et al. , 2013 ) . In theory the “ cost ” of finding robust models has been investigated from a computational complexity perspective in ( Bubeck et al. , 2019 ) , from a statistical perspective in ( Schmidt et al. , 2018 ) , and more generally from a model complexity perspective in ( Degwekar et al. , 2019 ; Raghunathan et al. , 2019 ; Allen-Zhu and Li , 2020 ) . We propose here a different angle of study within the broad model complexity perspective : does a model have to be larger for it to be robust ? Empirical evidence ( e.g. , ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) ) suggests that bigger models ( also known as “ overparametrization ” ) do indeed help for robustness . Our main contribution is a conjecture ( Conjecture 1 and Conjecture 2 ) on the precise tradeoffs between size of the model ( i.e. , the number of neurons k ) and robustness ( i.e. , the Lipschitz constant of the data fitting model f ∈ Fk ( ψ ) ) for generic data sets . We say that a data set ( xi , yi ) i∈ [ n ] is generic if it is i.i.d . with xi uniform ( or approximately so , see below ) on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } and yi uniform on { −1 , +1 } . We give the precise conjecture in Section 2 . We prove several weaker versions of Conjecture 1 and Conjecture 2 respectively in Section 4 and Section 3 . We also give empirical evidence for the conjecture in Section 5 . A corollary of our conjecture . A key fact about generic data , established in Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) , is that one can memorize arbitrary labels with k ≈ n/d , that is merely one neuron per d datapoints . Our conjecture implies that for such optimal-size neural networks it is impossible to be robust , in the sense that the Lipschitz constant must be of order √ d. The conjecture also states that to be robust ( i.e . attain Lipschitz constantO ( 1 ) ) one must necessarily have k ≈ n , that is roughly each datapoint must have its own neuron . Therefore , we obtain a trade off between size and robustness , namely to make the network robust it needs to be d times larger than for mere data fitting . We illustrate these two cases in Figure 1 . We train a neural network to fit generic data , and plot the maximum gradient over several randomly drawn points ( a proxy for the Lipschitz constant ) for various values of √ d , when either k = n ( blue dots ) or k = 10nd ( red dots ) . As predicted , for the large neural network ( k = n ) the Lipschitz constant remains roughly constant , while for the optimally-sized one ( k = 10nd ) the Lipschitz constant increases roughly linearly in √ d. Notation . For Ω ⊂ Rd we define LipΩ ( f ) = supx 6=x′∈Ω |f ( x ) −f ( x′ ) | ‖x−x′‖ ( if Ω = R d we omit the subscript and write Lip ( f ) ) , where ‖ · ‖ denotes the Euclidean norm . For matrices we use ‖ · ‖op , ‖ · ‖op , ∗ , ‖ · ‖F and 〈· , ·〉 for respectively the operator norm , the nuclear norm ( sum of singular values ) , the Frobenius norm , and the Frobenius inner product . We also use these notations for tensors of higher order , see Appendix A for more details on tensors . We denote c > 0 and C > 0 for universal numerical constants , respectively small enough and large enough , whose values can change in different occurences . Similarly , by cp > 0 and Cp > 0 we denote constants depending only on the parameter p. We also write ReLU ( t ) = max ( t , 0 ) for the rectified linear unit . Generic data . We give some flexibility in our definition of “ generic data ” in order to focus on the essence of the problem , rather than technical details . Namely , in addition to the spherical model mentioned above , where xi is i.i.d . uniform on the sphere Sd−1 = { x ∈ Rd : ‖x‖ = 1 } , we also consider the very closely related model where xi is i.i.d . from a centered Gaussian with covariance 1 d Id ( in particular E [ ‖xi‖ 2 ] = 1 , and in fact ‖xi‖ is tightly concentrated around 1 ) . In both cases we consider yi to be i.i.d . random signs . We say that a property holds with high probability for generic data , if it holds with high probability either for the spherical model or for the Gaussian model . 2 A CONJECTURED LAW OF ROBUSTNESS . Our main contribution is the following conjecture , which asserts that , on generic data sets , increasing the size of a network is necessary to obtain robustness : Conjecture 1 For generic data sets , with high probability1 , any f ∈ Fk ( ψ ) fitting the data2 ( i.e. , satisfying ( 2 ) ) must also satisfy : LipSd−1 ( f ) ≥ c √ n k . Note that for generic data , with high probability ( for n = poly ( d ) ) , there exists a smooth interpolation . Namely there exists g : Rd → R with g ( xi ) = yi , ∀i ∈ [ n ] and Lip ( g ) = O ( 1 ) . This follows easily from the fact that with high probability ( for large d ) one has ‖xi − xj‖ ≥ 1 , ∀i 6= j. Conjecture 1 puts restrictions on how smoothly one can interpolate data with small neural networks . A striking consequence of the conjecture is that for a two-layers neural network f ∈ Fk ( ψ ) to be as robust as this function g ( i.e. , Lip ( f ) = O ( 1 ) ) and fit the data , one must have k = Ω ( n ) , i.e. , roughly one neuron per data point . On the other hand with that many neurons it is quite trivial to smoothly interpolate the data , as we explain in Section 3.3 . Thus the conjecture makes a strong statement that essentially the trivial smooth interpolation is the best thing one can do . In addition to making the prediction that one neuron per datapoint is necessary for optimal smoothness , the conjecture also gives a precise prediction on the possible tradeoff between size of the network and its robustness . We also conjecture that this whole range of tradeoffs is actually achievable : Conjecture 2 Let n , d , k be such that C · nd ≤ k ≤ C · n and n ≤ d C where C is an arbitrarily large constant in the latter occurence . There exists ψ such that , for generic data sets , with high probability , there exists f ∈ Fk ( ψ ) fitting the data ( i.e. , satisfying ( 2 ) ) and such that LipSd−1 ( f ) ≤ C √ n k . The condition k ≤ C · n in Conjecture 2 is necessary , for any interpolation of the data must have Lipschitz constant at least a constant . The other condition on k , namely k ≥ C · nd , is also necessary , for that many neurons is needed to merely guarantee the existence of a data-fitting neural network with k neurons ( see Baum ( 1988 ) ; Yun et al . ( 2019 ) ; Bubeck et al . ( 2020 ) ) . Finally the condition n ≤ dC is merely used to avoid explicitly stating a logarithmic term in our conjecture ( indeed , equivalently one can replace this condition by adding a multiplicative polylogarithmic term in d in the claimed inequality ) . Our results around Conjecture 2 ( Section 3 ) . We prove Conjecture 2 for both the optimal smoothness regime ( which is quite straightforward , see Section 3.3 ) and for the optimal size regime ( here more work is needed , and we use a certain tensor-based construction , see Section 3.4 ) . In the latter case we only prove approximate data fitting ( mostly to simplify the proofs ) , and more importantly we need to assume that n is of order dp for some even integer p. It would be interesting to generalize the proof to any n. While the conjecture remains open between these two extreme regimes , we do give a construction in Section 3.3 which has the correct qualitative behavior ( namely increasing k improves the Lipschitz constant ) , albeit the scaling we obtain is n/k instead of √ n/k , see Theorem 1 . Our results around Conjecture 1 ( Section 4 ) . We prove a weaker version of Conjecture 1 where the Lipschitz constant on the sphere is replaced by a proxy involving the spectral norm of the weight matrix , see Theorem 3 . We also prove the conjecture in the optimal size regime , specifically when n = dp for an integer p and one uses a polynomial activation function of degree p , see Theorem 6 . For p = 1 ( i.e. , n ≈ d ) we in fact prove the conjecture for abritrary non-linearities , see Theorem 4 . 1We do not quantify the “ with high probability ” in our conjecture . We believe the conjecture to be true except for an event of exponentially small probability with respect to the sampling of a generic data set , but even proving that the statement is true with strictly positive probability would be extremely interesting . 2We expect the same lower bound to hold even if one only asks f to approximately fit the data . In fact our provable variants of Conjecture 1 are based proofs that are robust to only assuming an approximately fitting f . Further open problems . Our proposed law of robustness is a first mathematical formalization of the broader phenomenon that “ overparametrization in neural networks is necessary for robustness ” . Ideally one would like a much more refined understanding of the phenomenon than the one given in Conjecture 1 . For example , one could imagine that in greater generality , the law would read LipΩ ( f ) ≥ F ( k , ( xi , yi ) i∈ [ n ] , Ω ) . That is , we would like to understand how the achievable level of smoothness depends on the particular data set at hand , but also on the set where we expect to be making predictions . Another direction to generalize the law would be to extend it to multilayers neural networks . In particular one could imagine the most general law would replace the parameter k ( number of neurons ) by the type of architecture being used and in turn predict the best architecture for a given data set and prediction set . Finally note that our proposed law apply to all neural networks , but it would also be interesting to understand how the law interacts with algorithmic considerations ( for example in Section 5 we use Adam Kingma and Ba ( 2015 ) to find a set of weights that qualitatively match Conjecture 2 ) .
This paper concerns the Lipschitz constant of two-layer neural networks that fit "generic data sets" exactly. A key contribution is the statement of two conjectures relating the number of hidden neurons in the network to the Lipschitz constant. Roughly, to have $O(1)$ Lipschitz constant, the authors conjecture the number of hidden neurons should be on the order of the input dimension. In a slogan, over-parameterization is needed for robustness. Proofs are provided for various special cases, relying on results about real symmetric tensors and uniformly random points on the unit sphere. Overall, this is a very interesting paper. My main question surrounds the notion of generic data set that the authors use. Itemized comments follow.
SP:4d996de760a12de3340883269c88cb7b31268ca7
Taking Notes on the Fly Helps Language Pre-Training
1 INTRODUCTION . Unsupervised language pre-training , e.g. , BERT ( Devlin et al. , 2018 ) , is shown to be a successful way to improve the performance of various NLP downstream tasks . However , as the pre-training task requires no human labeling effort , a massive scale of training corpus from the Web can be used to train models with billions of parameters ( Raffel et al. , 2019 ) , making the pre-training computationally expensive . As an illustration , training a BERT-base model on Wikipedia corpus requires more than five days on 16 NVIDIA Tesla V100 GPUs . Therefore , how to make language pre-training more efficient and less resource-intensive , has become an important research direction in the field ( Strubell et al. , 2019 ) . Our work aims at improving the efficiency of language pre-training methods . In particular , we study how to speed up pre-training through better data utilization . It is well-known that in a natural language data corpus , words follow a heavy-tail distribution ( Larson , 2010 ) . A large proportion of words appear only very few times and the embeddings of those ( rare ) words are usually poorly optimized and noisy ( Bahdanau et al. , 2017 ; Gong et al. , 2018 ; Khassanov et al. , 2019 ; Schick & Schütze , 2020 ) . ∗Equal Contribution . Work done during internships at Microsoft Research Asia . †Correspondence to : dihe @ microsoft.com Unlike previous works that sought to merely improve the embedding quality of rare words , we argue that the existence of rare words could also slow down the training process of other model parameters . Taking BERT as an example , if we imagine the model encounters the following masked sentence during pre-training : COVID-19 has cost thousands of lives . Note that “ COVID-19 ” is a rare word , while also the only key information for the model to rely on to fill in the blank with the correct answer “ lives ” . As the embedding of the rare word “ COVID-19 ” is poorly trained , the Transformer lacks concrete input signal to predict “ lives ” . Furthermore , with noisy inputs , the model needs to take longer time to converge and sometimes even can not generalize well ( Zhang et al. , 2016 ) . Empirically , we observe that around 20 % of the sentences in the corpus contain at least one rare word . Moreover , since most pre-training methods concatenate adjacent multiple sentences to form one input sample , empirically we find that more than 90 % of input samples contain at least one rare word . The large proportion of such sentences could cause severe data utilization problem for language pre-training due to the lack of concrete semantics for sentence understanding . Therefore , learning from the masked language modeling tasks using these noisy embeddings may make the pre-training inefficient . Moreover , completely removing those sentences with rare words is not an applicable choice either since it will significantly reduce the size of the training data and hurt the final model performance . Our method to solve this problem is inspired by how humans manage information . Note-taking is a useful skill which can help people recall information that would otherwise be lost , especially for new concepts during learning ( Makany et al. , 2009 ) . If people take notes when facing a rare word that they don ’ t know , then next time when the rare word appears , they can refer to the notes to better understand the sentence . For example , we may meet the following sentence somewhere beforehand : The COVID-19 pandemic is an ongoing global crisis . From the sentence , we can realize that “ COVID-19 ” is related to “ pandemic ” and “ global crisis ” and record the connection in the notes . When facing “ COVID-19 ” again in the masked-language-modeling task above , we can refer to the note of “ COVID-19 ” . It is easy to see that once “ pandemic ” and “ global crisis ” are connected to “ COVID-19 ” , we can understand the sentence and predict “ lives ” more easily , as illustrated in Figure 1 . Mapped back to language pre-training , we believe for rare words , explicitly leveraging cross-sentence information is helpful to enhance semantics of the rare words in the current sentence to predict the masked tokens . Through this more efficient data utilization , the Transformer can receive better input signals which leads to more efficient training of its model parameters . Motivated by the discussion above , we propose a new learning approach called “ Taking Notes on the Fly ” ( TNF ) to improve data utilization for language pre-training . Specifically , we maintain a note dictionary , where the keys are rare words and the values are historical contextual representations of them . In the forward pass , when a rare word w appears in a sentence , we query the value of w in the note dictionary and use it as a part of the input . In this way , the semantic information of w saved in the note can be encoded together with other words through the model . Besides updating the model parameters , we also update the note dictionary . In particular , we define the note of w in the current sentence as the mean pooling over the contextual representations of the words nearby w. Then we update w ’ s value in the note dictionary by a weighted linear combination of w ’ s previous value and w ’ s note in the current sentence . TNF introduces little computational overhead at pre-training since the note dictionary is updated on the fly during the forward pass . Furthermore , different from the memory-augmented neural networks ( Santoro et al. , 2016 ; Guu et al. , 2020 ) , the note dictionary is only used to improve the training efficiency of the model parameters , while not served as a part of the model . When the pre-training is finished , we discard the note dictionary and use the trained Transformer encoder during the fine-tuning of downstream tasks , same as all previous works . We conduct experiments using BERT and ELECTRA ( Clark et al. , 2019 ) as TNF ’ s backbone methods . Results show that TNF significantly expedites BERT and ELECTRA , and improves their performances on downstream tasks . BERT-TNF and ELECTRA-TNF ’ s training times are both 60 % less than their corresponding backbone models when reaching the same performance . When trained with the same number of iterations , BERT-TNF and ELECTRA-TNF outperform the backbone methods on both the average GLUE score and the majority of individual tasks . We also observe that even in the downstream tasks where rare words only take a neglectable proportion of the data ( i.e . 0.47 % ) , TNF also outperforms baseline methods with a large margin . It indicates that TNF improves the pre-training of the entire model . 2 RELATED WORK . Efficient BERT pre-training . The massive energy cost of language pre-training ( Strubell et al. , 2019 ) has become an obstacle to its further developments . There are several works aiming at reducing the energy cost of pre-training . Gong et al . ( 2019 ) observes that parameters in different layers have similar attention distribution , and propose a parameter distillation method from shallow layers to deep layers . Another notable work is ELECTRA ( Clark et al. , 2019 ) , which develops a new task using one discriminator and one generator . The generator corrupts the sentence , and the discriminator is trained to predict whether each word in the corrupted sentence is replaced or not . Orthogonal to them , we focus on improving pre-training efficiency by finding ways to utilize the data corpus better . Therefore , it can be applied to all of the methods above to further boost their performances . Representation of rare words . It is widely acknowledged that the quality of rare words ’ embeddings is significantly worse than that of popular words . Gao et al . ( 2019 ) provides a theoretical understanding of this problem , which illustrates that the problem lies in the sparse ( and inaccurate ) stochastic optimization of neural networks . Several works attempt to improve the representation of rare words using linguistic priors ( Luong et al. , 2013 ; El-Kishky et al. , 2019 ; Kim et al. , 2016 ; Santos & Zadrozny , 2014 ) . But the improved embedding quality is still far behind that of popular words ( Gong et al. , 2018 ) . Sennrich et al . ( 2015 ) develops a novel way to split each word into sub-word units . However , the embeddings of low-frequency sub-word units are still difficult to train ( Ott et al. , 2018 ) . Due to the poor quality of rare word representations , the pre-training model built on top of it suffers from noisy input semantic signals which lead to inefficient training . We try to bypass the problem of poor rare word representations by leveraging cross-sentence information to enhance input semantic signals of the current sentence for better model training . Memory-augmented BERT . Another line of work close to ours uses memory-augmented neural networks in language-related tasks . Févry et al . ( 2020 ) and Guu et al . ( 2020 ) define the memory buffer as an external knowledge base of entities for better open domain question answering tasks . Khandelwal et al . ( 2019 ) constructs the memory for every test context at inference , to hold extra token candidates for better language modeling . Similar to other memory-augmented neural networks , the memory buffer in these works is a model component that will be used during inference . Although sharing general methodological concepts with these works , the goal and details of our method are different from them . Especially , our note dictionary is only maintained in pre-training for efficient data utilization . At fine-tuning , we ditch the note dictionary , hence adding no extra time or space complexity to the backbone models . 3 TAKING NOTES ON THE FLY . 3.1 PRELIMINARY . In this section , we use the BERT model as an example to introduce the basics of the model architecture and training objective of language pre-training . BERT ( Bidirectional Encoder Representation from Transformers ) is developed on a multi-layer bidirectional Transformer encoder , which takes a sequence of word semantic information ( token embeddings ) and order information ( positional embeddings ) as input , and outputs the contextual representations of words . Each Transformer layer is formed by a self-attention sub-layer and a position-wise feed-forward sub-layer , with a residual connection ( He et al. , 2016 ) and layer normalization ( Ba et al. , 2016 ) applied after every sub-layer . The self-attention sub-layer is referred to as ” Scaled Dot-Product Attention ” in Vaswani et al . ( 2017 ) , which produces its output by calculating the scaled dot products of queries and keys as the coefficients of the values , i.e. , Attention ( Q , K , V ) = Softmax ( QKT√ d ) V. ( 1 ) Q ( Query ) , K ( Key ) , V ( Value ) are the hidden representations outputted from the previous layer and d is the dimension of the hidden representations . Transformer also extends the aforementioned self-attention layer to a multi-head version in order to jointly attend to information from different representation subspaces . The multi-head self-attention sub-layer works as follows , Multi-head ( Q , K , V ) =Concat ( head1 , · · · , headH ) WO ( 2 ) headk =Attention ( QW Q k , KW K k , V W V k ) , ( 3 ) where WQk ∈ Rd×dK , WKk ∈ Rd×dK , WVk ∈ Rd×dV are projection matrices . H is the number of heads . dK and dV are the dimensions of the key and value separately . Following the self-attention sub-layer , there is a position-wise feed-forward ( FFN ) sub-layer , which is a fully connected network applied to every position identically and separately . The FFN sub-layer is usually a two-layer feed-forward network with a ReLU activation function in between . Given vectors { h1 , . . . , hn } , a position-wise FFN sub-layer transforms each hi as FFN ( hi ) = σ ( hiW1+b1 ) W2+b2 , where W1 , W2 , b1 and b2 are parameters . BERT uses the Transformer model as its backbone neural network architecture and trains the model parameters with the masked language model task on large text corpora . In the masked language model task , given a sampled sentence from the corpora , 15 % of the positions in the sentence are randomly selected . The selected positions will be either replaced by special token [ MASK ] , replaced by randomly picked tokens or remain the same . The objective of BERT pre-training is to predict words at the masked positions correctly given the masked sentences . As this task requires no human labeling effort , large scale data corpus is usually used to train the model . Empirically , the trained model , served as a good initialization , significantly improves the performance of downstream tasks .
This paper proposes Taking Notes on the Fly, a technique to improve the training efficiency of language-modeling style pretraining. It works by identifying rare words in the pre-training and adding a “note-taking” component to the masked language model which augments these words with an extra “note” embedding at the input layer. The note embedding is constructed from an exponential moving average of mean-pooled contextualized representations of context windows in which that word was previously seen during training. The notes are dropped in fine-tuning. Experiments find that this pre-training method improves fine-tuning results on English NLP tasks in the GLUE benchmark when used in the original BERT pre-training setup. In particular, the model can achieve similar performance to the original BERT model with less than 40% of the training steps, and similarly for ELECTRA.
SP:e6d36114cad7f28f80e91de6c3536cd6a93d962a
Taking Notes on the Fly Helps Language Pre-Training
1 INTRODUCTION . Unsupervised language pre-training , e.g. , BERT ( Devlin et al. , 2018 ) , is shown to be a successful way to improve the performance of various NLP downstream tasks . However , as the pre-training task requires no human labeling effort , a massive scale of training corpus from the Web can be used to train models with billions of parameters ( Raffel et al. , 2019 ) , making the pre-training computationally expensive . As an illustration , training a BERT-base model on Wikipedia corpus requires more than five days on 16 NVIDIA Tesla V100 GPUs . Therefore , how to make language pre-training more efficient and less resource-intensive , has become an important research direction in the field ( Strubell et al. , 2019 ) . Our work aims at improving the efficiency of language pre-training methods . In particular , we study how to speed up pre-training through better data utilization . It is well-known that in a natural language data corpus , words follow a heavy-tail distribution ( Larson , 2010 ) . A large proportion of words appear only very few times and the embeddings of those ( rare ) words are usually poorly optimized and noisy ( Bahdanau et al. , 2017 ; Gong et al. , 2018 ; Khassanov et al. , 2019 ; Schick & Schütze , 2020 ) . ∗Equal Contribution . Work done during internships at Microsoft Research Asia . †Correspondence to : dihe @ microsoft.com Unlike previous works that sought to merely improve the embedding quality of rare words , we argue that the existence of rare words could also slow down the training process of other model parameters . Taking BERT as an example , if we imagine the model encounters the following masked sentence during pre-training : COVID-19 has cost thousands of lives . Note that “ COVID-19 ” is a rare word , while also the only key information for the model to rely on to fill in the blank with the correct answer “ lives ” . As the embedding of the rare word “ COVID-19 ” is poorly trained , the Transformer lacks concrete input signal to predict “ lives ” . Furthermore , with noisy inputs , the model needs to take longer time to converge and sometimes even can not generalize well ( Zhang et al. , 2016 ) . Empirically , we observe that around 20 % of the sentences in the corpus contain at least one rare word . Moreover , since most pre-training methods concatenate adjacent multiple sentences to form one input sample , empirically we find that more than 90 % of input samples contain at least one rare word . The large proportion of such sentences could cause severe data utilization problem for language pre-training due to the lack of concrete semantics for sentence understanding . Therefore , learning from the masked language modeling tasks using these noisy embeddings may make the pre-training inefficient . Moreover , completely removing those sentences with rare words is not an applicable choice either since it will significantly reduce the size of the training data and hurt the final model performance . Our method to solve this problem is inspired by how humans manage information . Note-taking is a useful skill which can help people recall information that would otherwise be lost , especially for new concepts during learning ( Makany et al. , 2009 ) . If people take notes when facing a rare word that they don ’ t know , then next time when the rare word appears , they can refer to the notes to better understand the sentence . For example , we may meet the following sentence somewhere beforehand : The COVID-19 pandemic is an ongoing global crisis . From the sentence , we can realize that “ COVID-19 ” is related to “ pandemic ” and “ global crisis ” and record the connection in the notes . When facing “ COVID-19 ” again in the masked-language-modeling task above , we can refer to the note of “ COVID-19 ” . It is easy to see that once “ pandemic ” and “ global crisis ” are connected to “ COVID-19 ” , we can understand the sentence and predict “ lives ” more easily , as illustrated in Figure 1 . Mapped back to language pre-training , we believe for rare words , explicitly leveraging cross-sentence information is helpful to enhance semantics of the rare words in the current sentence to predict the masked tokens . Through this more efficient data utilization , the Transformer can receive better input signals which leads to more efficient training of its model parameters . Motivated by the discussion above , we propose a new learning approach called “ Taking Notes on the Fly ” ( TNF ) to improve data utilization for language pre-training . Specifically , we maintain a note dictionary , where the keys are rare words and the values are historical contextual representations of them . In the forward pass , when a rare word w appears in a sentence , we query the value of w in the note dictionary and use it as a part of the input . In this way , the semantic information of w saved in the note can be encoded together with other words through the model . Besides updating the model parameters , we also update the note dictionary . In particular , we define the note of w in the current sentence as the mean pooling over the contextual representations of the words nearby w. Then we update w ’ s value in the note dictionary by a weighted linear combination of w ’ s previous value and w ’ s note in the current sentence . TNF introduces little computational overhead at pre-training since the note dictionary is updated on the fly during the forward pass . Furthermore , different from the memory-augmented neural networks ( Santoro et al. , 2016 ; Guu et al. , 2020 ) , the note dictionary is only used to improve the training efficiency of the model parameters , while not served as a part of the model . When the pre-training is finished , we discard the note dictionary and use the trained Transformer encoder during the fine-tuning of downstream tasks , same as all previous works . We conduct experiments using BERT and ELECTRA ( Clark et al. , 2019 ) as TNF ’ s backbone methods . Results show that TNF significantly expedites BERT and ELECTRA , and improves their performances on downstream tasks . BERT-TNF and ELECTRA-TNF ’ s training times are both 60 % less than their corresponding backbone models when reaching the same performance . When trained with the same number of iterations , BERT-TNF and ELECTRA-TNF outperform the backbone methods on both the average GLUE score and the majority of individual tasks . We also observe that even in the downstream tasks where rare words only take a neglectable proportion of the data ( i.e . 0.47 % ) , TNF also outperforms baseline methods with a large margin . It indicates that TNF improves the pre-training of the entire model . 2 RELATED WORK . Efficient BERT pre-training . The massive energy cost of language pre-training ( Strubell et al. , 2019 ) has become an obstacle to its further developments . There are several works aiming at reducing the energy cost of pre-training . Gong et al . ( 2019 ) observes that parameters in different layers have similar attention distribution , and propose a parameter distillation method from shallow layers to deep layers . Another notable work is ELECTRA ( Clark et al. , 2019 ) , which develops a new task using one discriminator and one generator . The generator corrupts the sentence , and the discriminator is trained to predict whether each word in the corrupted sentence is replaced or not . Orthogonal to them , we focus on improving pre-training efficiency by finding ways to utilize the data corpus better . Therefore , it can be applied to all of the methods above to further boost their performances . Representation of rare words . It is widely acknowledged that the quality of rare words ’ embeddings is significantly worse than that of popular words . Gao et al . ( 2019 ) provides a theoretical understanding of this problem , which illustrates that the problem lies in the sparse ( and inaccurate ) stochastic optimization of neural networks . Several works attempt to improve the representation of rare words using linguistic priors ( Luong et al. , 2013 ; El-Kishky et al. , 2019 ; Kim et al. , 2016 ; Santos & Zadrozny , 2014 ) . But the improved embedding quality is still far behind that of popular words ( Gong et al. , 2018 ) . Sennrich et al . ( 2015 ) develops a novel way to split each word into sub-word units . However , the embeddings of low-frequency sub-word units are still difficult to train ( Ott et al. , 2018 ) . Due to the poor quality of rare word representations , the pre-training model built on top of it suffers from noisy input semantic signals which lead to inefficient training . We try to bypass the problem of poor rare word representations by leveraging cross-sentence information to enhance input semantic signals of the current sentence for better model training . Memory-augmented BERT . Another line of work close to ours uses memory-augmented neural networks in language-related tasks . Févry et al . ( 2020 ) and Guu et al . ( 2020 ) define the memory buffer as an external knowledge base of entities for better open domain question answering tasks . Khandelwal et al . ( 2019 ) constructs the memory for every test context at inference , to hold extra token candidates for better language modeling . Similar to other memory-augmented neural networks , the memory buffer in these works is a model component that will be used during inference . Although sharing general methodological concepts with these works , the goal and details of our method are different from them . Especially , our note dictionary is only maintained in pre-training for efficient data utilization . At fine-tuning , we ditch the note dictionary , hence adding no extra time or space complexity to the backbone models . 3 TAKING NOTES ON THE FLY . 3.1 PRELIMINARY . In this section , we use the BERT model as an example to introduce the basics of the model architecture and training objective of language pre-training . BERT ( Bidirectional Encoder Representation from Transformers ) is developed on a multi-layer bidirectional Transformer encoder , which takes a sequence of word semantic information ( token embeddings ) and order information ( positional embeddings ) as input , and outputs the contextual representations of words . Each Transformer layer is formed by a self-attention sub-layer and a position-wise feed-forward sub-layer , with a residual connection ( He et al. , 2016 ) and layer normalization ( Ba et al. , 2016 ) applied after every sub-layer . The self-attention sub-layer is referred to as ” Scaled Dot-Product Attention ” in Vaswani et al . ( 2017 ) , which produces its output by calculating the scaled dot products of queries and keys as the coefficients of the values , i.e. , Attention ( Q , K , V ) = Softmax ( QKT√ d ) V. ( 1 ) Q ( Query ) , K ( Key ) , V ( Value ) are the hidden representations outputted from the previous layer and d is the dimension of the hidden representations . Transformer also extends the aforementioned self-attention layer to a multi-head version in order to jointly attend to information from different representation subspaces . The multi-head self-attention sub-layer works as follows , Multi-head ( Q , K , V ) =Concat ( head1 , · · · , headH ) WO ( 2 ) headk =Attention ( QW Q k , KW K k , V W V k ) , ( 3 ) where WQk ∈ Rd×dK , WKk ∈ Rd×dK , WVk ∈ Rd×dV are projection matrices . H is the number of heads . dK and dV are the dimensions of the key and value separately . Following the self-attention sub-layer , there is a position-wise feed-forward ( FFN ) sub-layer , which is a fully connected network applied to every position identically and separately . The FFN sub-layer is usually a two-layer feed-forward network with a ReLU activation function in between . Given vectors { h1 , . . . , hn } , a position-wise FFN sub-layer transforms each hi as FFN ( hi ) = σ ( hiW1+b1 ) W2+b2 , where W1 , W2 , b1 and b2 are parameters . BERT uses the Transformer model as its backbone neural network architecture and trains the model parameters with the masked language model task on large text corpora . In the masked language model task , given a sampled sentence from the corpora , 15 % of the positions in the sentence are randomly selected . The selected positions will be either replaced by special token [ MASK ] , replaced by randomly picked tokens or remain the same . The objective of BERT pre-training is to predict words at the masked positions correctly given the masked sentences . As this task requires no human labeling effort , large scale data corpus is usually used to train the model . Empirically , the trained model , served as a good initialization , significantly improves the performance of downstream tasks .
The paper proposes an external memory architecture. When encountering the rare words (with a frequency between 100-500), the method will store the average contextualized word embedding of nearby words into a dictionary. Next time it encounters the same rare word, it will retrieve the average embedding and input it into BERT encoder. The experiment results show that given the same number of training steps, adding the external memory improves the MLM loss and significantly improves the results on RTE (Recognizing Textual Entailment) dataset, which leads to a slightly better GLUE score. The experiment also shows that keeping the external memory during the fine-tuning stage slightly degrades the performance.
SP:e6d36114cad7f28f80e91de6c3536cd6a93d962a
Taking Notes on the Fly Helps Language Pre-Training
1 INTRODUCTION . Unsupervised language pre-training , e.g. , BERT ( Devlin et al. , 2018 ) , is shown to be a successful way to improve the performance of various NLP downstream tasks . However , as the pre-training task requires no human labeling effort , a massive scale of training corpus from the Web can be used to train models with billions of parameters ( Raffel et al. , 2019 ) , making the pre-training computationally expensive . As an illustration , training a BERT-base model on Wikipedia corpus requires more than five days on 16 NVIDIA Tesla V100 GPUs . Therefore , how to make language pre-training more efficient and less resource-intensive , has become an important research direction in the field ( Strubell et al. , 2019 ) . Our work aims at improving the efficiency of language pre-training methods . In particular , we study how to speed up pre-training through better data utilization . It is well-known that in a natural language data corpus , words follow a heavy-tail distribution ( Larson , 2010 ) . A large proportion of words appear only very few times and the embeddings of those ( rare ) words are usually poorly optimized and noisy ( Bahdanau et al. , 2017 ; Gong et al. , 2018 ; Khassanov et al. , 2019 ; Schick & Schütze , 2020 ) . ∗Equal Contribution . Work done during internships at Microsoft Research Asia . †Correspondence to : dihe @ microsoft.com Unlike previous works that sought to merely improve the embedding quality of rare words , we argue that the existence of rare words could also slow down the training process of other model parameters . Taking BERT as an example , if we imagine the model encounters the following masked sentence during pre-training : COVID-19 has cost thousands of lives . Note that “ COVID-19 ” is a rare word , while also the only key information for the model to rely on to fill in the blank with the correct answer “ lives ” . As the embedding of the rare word “ COVID-19 ” is poorly trained , the Transformer lacks concrete input signal to predict “ lives ” . Furthermore , with noisy inputs , the model needs to take longer time to converge and sometimes even can not generalize well ( Zhang et al. , 2016 ) . Empirically , we observe that around 20 % of the sentences in the corpus contain at least one rare word . Moreover , since most pre-training methods concatenate adjacent multiple sentences to form one input sample , empirically we find that more than 90 % of input samples contain at least one rare word . The large proportion of such sentences could cause severe data utilization problem for language pre-training due to the lack of concrete semantics for sentence understanding . Therefore , learning from the masked language modeling tasks using these noisy embeddings may make the pre-training inefficient . Moreover , completely removing those sentences with rare words is not an applicable choice either since it will significantly reduce the size of the training data and hurt the final model performance . Our method to solve this problem is inspired by how humans manage information . Note-taking is a useful skill which can help people recall information that would otherwise be lost , especially for new concepts during learning ( Makany et al. , 2009 ) . If people take notes when facing a rare word that they don ’ t know , then next time when the rare word appears , they can refer to the notes to better understand the sentence . For example , we may meet the following sentence somewhere beforehand : The COVID-19 pandemic is an ongoing global crisis . From the sentence , we can realize that “ COVID-19 ” is related to “ pandemic ” and “ global crisis ” and record the connection in the notes . When facing “ COVID-19 ” again in the masked-language-modeling task above , we can refer to the note of “ COVID-19 ” . It is easy to see that once “ pandemic ” and “ global crisis ” are connected to “ COVID-19 ” , we can understand the sentence and predict “ lives ” more easily , as illustrated in Figure 1 . Mapped back to language pre-training , we believe for rare words , explicitly leveraging cross-sentence information is helpful to enhance semantics of the rare words in the current sentence to predict the masked tokens . Through this more efficient data utilization , the Transformer can receive better input signals which leads to more efficient training of its model parameters . Motivated by the discussion above , we propose a new learning approach called “ Taking Notes on the Fly ” ( TNF ) to improve data utilization for language pre-training . Specifically , we maintain a note dictionary , where the keys are rare words and the values are historical contextual representations of them . In the forward pass , when a rare word w appears in a sentence , we query the value of w in the note dictionary and use it as a part of the input . In this way , the semantic information of w saved in the note can be encoded together with other words through the model . Besides updating the model parameters , we also update the note dictionary . In particular , we define the note of w in the current sentence as the mean pooling over the contextual representations of the words nearby w. Then we update w ’ s value in the note dictionary by a weighted linear combination of w ’ s previous value and w ’ s note in the current sentence . TNF introduces little computational overhead at pre-training since the note dictionary is updated on the fly during the forward pass . Furthermore , different from the memory-augmented neural networks ( Santoro et al. , 2016 ; Guu et al. , 2020 ) , the note dictionary is only used to improve the training efficiency of the model parameters , while not served as a part of the model . When the pre-training is finished , we discard the note dictionary and use the trained Transformer encoder during the fine-tuning of downstream tasks , same as all previous works . We conduct experiments using BERT and ELECTRA ( Clark et al. , 2019 ) as TNF ’ s backbone methods . Results show that TNF significantly expedites BERT and ELECTRA , and improves their performances on downstream tasks . BERT-TNF and ELECTRA-TNF ’ s training times are both 60 % less than their corresponding backbone models when reaching the same performance . When trained with the same number of iterations , BERT-TNF and ELECTRA-TNF outperform the backbone methods on both the average GLUE score and the majority of individual tasks . We also observe that even in the downstream tasks where rare words only take a neglectable proportion of the data ( i.e . 0.47 % ) , TNF also outperforms baseline methods with a large margin . It indicates that TNF improves the pre-training of the entire model . 2 RELATED WORK . Efficient BERT pre-training . The massive energy cost of language pre-training ( Strubell et al. , 2019 ) has become an obstacle to its further developments . There are several works aiming at reducing the energy cost of pre-training . Gong et al . ( 2019 ) observes that parameters in different layers have similar attention distribution , and propose a parameter distillation method from shallow layers to deep layers . Another notable work is ELECTRA ( Clark et al. , 2019 ) , which develops a new task using one discriminator and one generator . The generator corrupts the sentence , and the discriminator is trained to predict whether each word in the corrupted sentence is replaced or not . Orthogonal to them , we focus on improving pre-training efficiency by finding ways to utilize the data corpus better . Therefore , it can be applied to all of the methods above to further boost their performances . Representation of rare words . It is widely acknowledged that the quality of rare words ’ embeddings is significantly worse than that of popular words . Gao et al . ( 2019 ) provides a theoretical understanding of this problem , which illustrates that the problem lies in the sparse ( and inaccurate ) stochastic optimization of neural networks . Several works attempt to improve the representation of rare words using linguistic priors ( Luong et al. , 2013 ; El-Kishky et al. , 2019 ; Kim et al. , 2016 ; Santos & Zadrozny , 2014 ) . But the improved embedding quality is still far behind that of popular words ( Gong et al. , 2018 ) . Sennrich et al . ( 2015 ) develops a novel way to split each word into sub-word units . However , the embeddings of low-frequency sub-word units are still difficult to train ( Ott et al. , 2018 ) . Due to the poor quality of rare word representations , the pre-training model built on top of it suffers from noisy input semantic signals which lead to inefficient training . We try to bypass the problem of poor rare word representations by leveraging cross-sentence information to enhance input semantic signals of the current sentence for better model training . Memory-augmented BERT . Another line of work close to ours uses memory-augmented neural networks in language-related tasks . Févry et al . ( 2020 ) and Guu et al . ( 2020 ) define the memory buffer as an external knowledge base of entities for better open domain question answering tasks . Khandelwal et al . ( 2019 ) constructs the memory for every test context at inference , to hold extra token candidates for better language modeling . Similar to other memory-augmented neural networks , the memory buffer in these works is a model component that will be used during inference . Although sharing general methodological concepts with these works , the goal and details of our method are different from them . Especially , our note dictionary is only maintained in pre-training for efficient data utilization . At fine-tuning , we ditch the note dictionary , hence adding no extra time or space complexity to the backbone models . 3 TAKING NOTES ON THE FLY . 3.1 PRELIMINARY . In this section , we use the BERT model as an example to introduce the basics of the model architecture and training objective of language pre-training . BERT ( Bidirectional Encoder Representation from Transformers ) is developed on a multi-layer bidirectional Transformer encoder , which takes a sequence of word semantic information ( token embeddings ) and order information ( positional embeddings ) as input , and outputs the contextual representations of words . Each Transformer layer is formed by a self-attention sub-layer and a position-wise feed-forward sub-layer , with a residual connection ( He et al. , 2016 ) and layer normalization ( Ba et al. , 2016 ) applied after every sub-layer . The self-attention sub-layer is referred to as ” Scaled Dot-Product Attention ” in Vaswani et al . ( 2017 ) , which produces its output by calculating the scaled dot products of queries and keys as the coefficients of the values , i.e. , Attention ( Q , K , V ) = Softmax ( QKT√ d ) V. ( 1 ) Q ( Query ) , K ( Key ) , V ( Value ) are the hidden representations outputted from the previous layer and d is the dimension of the hidden representations . Transformer also extends the aforementioned self-attention layer to a multi-head version in order to jointly attend to information from different representation subspaces . The multi-head self-attention sub-layer works as follows , Multi-head ( Q , K , V ) =Concat ( head1 , · · · , headH ) WO ( 2 ) headk =Attention ( QW Q k , KW K k , V W V k ) , ( 3 ) where WQk ∈ Rd×dK , WKk ∈ Rd×dK , WVk ∈ Rd×dV are projection matrices . H is the number of heads . dK and dV are the dimensions of the key and value separately . Following the self-attention sub-layer , there is a position-wise feed-forward ( FFN ) sub-layer , which is a fully connected network applied to every position identically and separately . The FFN sub-layer is usually a two-layer feed-forward network with a ReLU activation function in between . Given vectors { h1 , . . . , hn } , a position-wise FFN sub-layer transforms each hi as FFN ( hi ) = σ ( hiW1+b1 ) W2+b2 , where W1 , W2 , b1 and b2 are parameters . BERT uses the Transformer model as its backbone neural network architecture and trains the model parameters with the masked language model task on large text corpora . In the masked language model task , given a sampled sentence from the corpora , 15 % of the positions in the sentence are randomly selected . The selected positions will be either replaced by special token [ MASK ] , replaced by randomly picked tokens or remain the same . The objective of BERT pre-training is to predict words at the masked positions correctly given the masked sentences . As this task requires no human labeling effort , large scale data corpus is usually used to train the model . Empirically , the trained model , served as a good initialization , significantly improves the performance of downstream tasks .
This work aims at accelerating pre-training by leveraging the contextual embeddings for the rare words. It is argued that the inadequate training of rare words slows down the pre-training. The authors then proposed to keep a moving average of the contextual embeddings for the rare words and use it to augment the input embeddings of the rare words. This technique is applied to BERT and ELECTRA and is shown to improve over the baseline.
SP:e6d36114cad7f28f80e91de6c3536cd6a93d962a
Finding Patient Zero: Learning Contagion Source with Graph Neural Networks
1 INTRODUCTION . The ability to quickly identify the origin of an outbreak , or “ finding patient zero ” , is critically important in the effort to contain an emerging epidemic . The identification of early transmission chains and the reconstruction of the possible paths of diffusion of the virus can be the difference between stopping an outbreak in its infancy and letting an epidemic unfold and affect a large share of a population . Hence , solving this problem would be instrumental in informing and guiding contact tracing efforts carried out by public health authorities , allowing for optimal resource allocation that can maximize the probability of an early containment of the outbreak . Disease spreading is modeled as a contagion process on a network Stroock & Varadhan ( 2007 ) ; Pastor-Satorras et al . ( 2015 ) of human-to-human interactions where infected individuals are going to transmit the virus by infecting ( with a certain probability ) their direct contacts . In general , contagion processes can capture a wide range of phenomena , from rumor propagation on social media to virus spreading over cyber-physical networks Centola & Macy ( 2007 ) ; Baronchelli ( 2018 ) ; Wang et al . ( 2013 ) ; Mishra & Keshri ( 2013 ) . Therefore , learning the source of a contagion process would also have broader impact on various domains , from detecting sources of fake news to defending malware attacks . Learning the index case , or patient zero ( P0 ) , is a difficult problem . In this paper , we model disease spreading as a contagion process ( chains of transmissions ) over a graph . The evolution of an outbreak is noisy and highly dependent on the graph structure and disease dynamics . In addition , in real-world epidemics , there is often a delay from the start of the outbreak to when epidemic surveillance and contact tracing starts . Hence , we might only observe the state of the graph at some intermediate times without access to the complete chains of transmission . Furthermore , due to its stochastic nature , the same source node might lead to different epidemic spreading trajectories . Finally , learning P0 from noisy observations of graph snapshots is computationally intractable and the complexity grows exponentially with the size of the graph Shah & Zaman ( 2011 ) . Most work in learning the dynamics of a contagion process Rodriguez et al . ( 2011 ) ; Mei & Eisner ( 2017 ) ; Li et al . ( 2018a ) have focused on inferring the forward dynamics of the diffusion . In epidemiology , for example , Pastor-Satorras & Vespignani ( 2001 ) have studied learning the temporal dynamics of diseases spreading on mobility networks . The problem of learning the reverse dynamics and identifying diffusion sources has been largely overlooked due to the aforementioned challenges . Two of the most notable exceptions in the area are “ rumor centrality ” Shah & Zaman ( 2011 ) for contagion processes on trees and Dynamic Message-passing ( DMP ) on graphs Lokhov et al . ( 2014 ) but both require as input the parameters of the spreading dynamics simulations . Our goal is to provide fresh perspectives on the problem of finding patient zero using graph neural networks ( GNNs ) Gilmer et al . ( 2017 ) . First , we conduct a rigorous analysis of learning P0 based on the graph structure and the disease dynamics , allowing us to find conditions for identifying P0 accurately . We test our theoretical results on a set of epidemic simulations on synthetic graphs commonly used in the literature Erdös et al . ( 1959 ) ; Albert & Barabási ( 2002 ) . We also evaluate our method on a realistic co-location network for the greater Boston area , finding performance similar to the synthetic data . While collecting labeled data to train GNN to find P0 may not be possible , training GNN using simulations on real contact-tracing data can provide a fast method for inferring P0 and help with planning and resource allocation . To the best of our knowledge , our work is the first to tackle the patient zero problem with deep learning and to test the approach on a realistic contact network . In summary , we make the following contributions : • We find upper bounds on the accuracy of finding patient zero in graphs with cycles , independent of the inference algorithm used . • We show that beyond a certain time scale the inference becomes difficult , highlighting the importance of swift and early contact-tracing . • We demonstrate the superiority of GNNs over state-of-the-art message passing algorithms in terms of speed and accuracy . Most importantly , our method is model agnostic and does not require the epidemic parameters to be known . • We validate our theoretical findings using extensive experiments for different epidemic dynamics and graph structures , including a real-world co-location graph of the COVID-19 outbreak . 2 RELATED WORK . Learning contagion dynamics Learning forward dynamics of contagion processes on a graph is a well studied problem area . For instance , Rodriguez et al . ( 2011 ) ; Du et al . ( 2013 ) proposed scalable algorithms to estimate the parameters of the underlying diffusion network , a problem known as network inference . Deep learning has led to novel neural network models that can learn forward dynamics of various processes including neural Hawkes processes Mei & Eisner ( 2017 ) and Markov decision processes-based reinforcement learning Li et al . ( 2018a ) . Learning forward contagion dynamics have also been intensively studied in epidemiology Pastor-Satorras & Vespignani ( 2001 ) ; Vynnycky & White ( 2010 ) , social science Matsubara et al . ( 2012 ) , and cyber-security Prakash et al . ( 2012 ) . In contrast , research in learning the reverse dynamics of contagion processes is rather scarce . Influence maximization Kempe et al . ( 2003 ) , for instance , finds a small set of individuals that can effectively spread information in a graph , but only maximizes the number of affected nodes in the infinite time limit . Our problem is more difficult as we care not just about the number of infected nodes , but which nodes were infected . Finding patient zero In order to find patient zero , we aim to learn the reverse dynamics of contagion processes . Shah & Zaman ( 2011 ) were among the first to formalize the problem on trees in the context of modeling rumor spreading in a network . Prakash et al . ( 2012 ) ; Vosoughi et al . ( 2017 ) studied similar problems for detecting viruses in computer networks . More recent advances proposed a dynamic message passing algorithm Lokhov et al . ( 2014 ) and belief propagation Altarelli et al . ( 2014 ) to estimate the epidemic outbreak source . Fairly recently , Fanti & Viswanath ( 2017 ) reduced the deanonymization of Bitcoin to the source identification problem in an epidemic and analyzes the dynamics properties . On the theoretical side , Shah & Zaman ( 2011 ) ; Wang et al . ( 2014 ) analyzed the quality of the maximum likelihood estimator and rumor centrality , but only for the simple SI model on trees . Antulov-Fantulin et al . ( 2015 ) found detectability limits for patient zero in the SIR model using exact analytical methods and Monte Carlo estimators . Khim & Loh ( 2016 ) ; Bubeck et al . ( 2017 ) proved that it is possible to construct a confidence set for the predicted diffusion source nodes with a size independent of the number of infected nodes over a regular tree . Our work provides fresh perspectives on the patient zero problem on general graphs based on the recent development of graph neural networks Graph neural networks Graph neural networks have received considerable attention ( see several references in Bronstein et al . ( 2017 ) ; Zhang et al . ( 2018 ) ; Wu et al . ( 2019 ) ; Goyal & Ferrara ( 2018 ) ) . While most research is focused on static graphs , a few have explored dynamic graphs Li et al . ( 2018b ) ; You et al . ( 2018 ) ; Kipf et al . ( 2018 ) ; Pareja et al . ( 2019 ) ; Trivedi et al . ( 2019 ) . For example , Kipf et al . ( 2018 ) propose a deep graph model to learn both the graph attribute and structure dynamics . They use a recurrent decoder to forecast the node attributes for multiple time steps ahead . Trivedi et al . ( 2019 ) take a continuous-time modeling approach where they take the node embedding as the input and model the occurrence of an edge as a point process . Xu et al . ( 2020 ) propose a temporal graph attention layer to learn the representations of temporal graphs . However , most research is designed for link prediction tasks and none of these existing studies have studied the problem of learning the source of the dynamics on a graph . 3 CONTAGION PROCESS AND PATIENT ZERO . Finding patient zero means tracing the contagion dynamics back to its initial state and identifying the first nodes that started spreading . Here , we describe the disease dynamics on a network using Susceptible-Infected-Recovered ( SIR ) and Susceptible-Exposed-Infected-Recovered ( SEIR ) Kermack & McKendrick ( 1927 ) compartmental models that assume that infected individuals develop immunity once they recover from the infections . 3.1 CONTAGION PROCESSES ON NETWORKS . In the SIR model , the population is split into three compartments : susceptible ( S ) who are susceptible to infection by the disease ; infected ( I ) who have caught the disease and are infectious ; removed ( R ) who are removed from consideration after experiencing the full infectious period . Continuous time model For a contagion process on a graph G with N nodes , each vertex represents an individual who is in contact only with its neighbors . We can represent the graph using the adjacency matrix A ∈ RN×N , where A [ i , j ] = 1 if two individuals are connected , 0 otherwise . Let Si , Ii , Ri be the average probabilities of node i being in each of the states , with Si + Ii +Ri = 1 . The SIR dynamics on a graph is given by Newman ( 2018 ) : dSi dt = −β ∑ j AijIjSi , dRi dt = γIi , dSi dt + dIi dt + dRi dt = 0 . ( 1 ) where β is the infection rate per contact and γ the recovery/death rate . The basic reproductive rate of a disease R0 ≡ βλ1/γ is defined as the number of secondary infections created by an index case in a fully susceptible population Keeling & Rohani ( 2011 ) . Here λ1 is the largest eigenvalue of A . The disease will spread and result in an epidemic if R0 > 1 . Discrete time model We can also use an equivalent discrete time SIR model . Let xti ∈ { S , I , R } be the state of node i at time t. For a susceptible node i , its probability to become infected or removed at time t+ 1 is P ( xt+1i = I|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = R|x t i = I ) = γ . ( 2 ) The SIR model doesn ’ t account for the incubation period , where an individual is infected but not infectious . This is remedied by introducing an “ exposed ” ( E ) state , leading to the SEIR model . For a susceptible node i , the probability to enter the exposed state , and becoming infectious at time t+ 1 is P ( xt+1i = E|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = I|x t i = E ) = α , ( 3 ) An infected node eventually enters the removed state with probability γ , which is the same as SIR ( 2 ) . ( 2 ) and ( 3 ) yield ( 1 ) for very small β as ∏ j ( 1− βAijIi ) ≈ βAijIi ( proof in supp . B ) . Finding patient zero Finding P0 can be formulated as a maximum likelihood estimation problem for SIR and SEIR models . Specifically , we observe a snapshot of the state of the nodes at time step t as xt : = ( xt1 , · · · , xtN ) , with each node ’ s state xti ∈ { S , E , I , R } . The problem of finding P0 is to search for a set of nodes Z = { i|x0i = I , i ∈ { 1 , · · ·N } } which led to the observed state xt . A common approach is to find Z such that the likelihood of observing xt is maximized : Z ? = argmaxZ , |Z|≤kP ( xt|Z ) ( 4 ) where P ( xt|Z ) is the probability of observing xt with Z being the P0 set . We assume the number of P0s is no larger than k. Estimating the original state of the dynamic system given the future states requires computing the conditional likelihood P ( xt|Z ) exactly , which is intractable due to the combinatorics of possible transmission routes .
This paper studies the problem of source detection in an epidemics when one observes the underlying graph and a snapshot of the population at a given time i.e. who is infected or not infected. For a SIR (or SEIR) model, the authors propose to use GNN for this task. The learning procedure is then the following: given a fixed graph G, the authors create a dataset of snapshots by running a SIR on G.
SP:27753b9dcce0cb9b4d764b5721f0b5a20496ff68
Finding Patient Zero: Learning Contagion Source with Graph Neural Networks
1 INTRODUCTION . The ability to quickly identify the origin of an outbreak , or “ finding patient zero ” , is critically important in the effort to contain an emerging epidemic . The identification of early transmission chains and the reconstruction of the possible paths of diffusion of the virus can be the difference between stopping an outbreak in its infancy and letting an epidemic unfold and affect a large share of a population . Hence , solving this problem would be instrumental in informing and guiding contact tracing efforts carried out by public health authorities , allowing for optimal resource allocation that can maximize the probability of an early containment of the outbreak . Disease spreading is modeled as a contagion process on a network Stroock & Varadhan ( 2007 ) ; Pastor-Satorras et al . ( 2015 ) of human-to-human interactions where infected individuals are going to transmit the virus by infecting ( with a certain probability ) their direct contacts . In general , contagion processes can capture a wide range of phenomena , from rumor propagation on social media to virus spreading over cyber-physical networks Centola & Macy ( 2007 ) ; Baronchelli ( 2018 ) ; Wang et al . ( 2013 ) ; Mishra & Keshri ( 2013 ) . Therefore , learning the source of a contagion process would also have broader impact on various domains , from detecting sources of fake news to defending malware attacks . Learning the index case , or patient zero ( P0 ) , is a difficult problem . In this paper , we model disease spreading as a contagion process ( chains of transmissions ) over a graph . The evolution of an outbreak is noisy and highly dependent on the graph structure and disease dynamics . In addition , in real-world epidemics , there is often a delay from the start of the outbreak to when epidemic surveillance and contact tracing starts . Hence , we might only observe the state of the graph at some intermediate times without access to the complete chains of transmission . Furthermore , due to its stochastic nature , the same source node might lead to different epidemic spreading trajectories . Finally , learning P0 from noisy observations of graph snapshots is computationally intractable and the complexity grows exponentially with the size of the graph Shah & Zaman ( 2011 ) . Most work in learning the dynamics of a contagion process Rodriguez et al . ( 2011 ) ; Mei & Eisner ( 2017 ) ; Li et al . ( 2018a ) have focused on inferring the forward dynamics of the diffusion . In epidemiology , for example , Pastor-Satorras & Vespignani ( 2001 ) have studied learning the temporal dynamics of diseases spreading on mobility networks . The problem of learning the reverse dynamics and identifying diffusion sources has been largely overlooked due to the aforementioned challenges . Two of the most notable exceptions in the area are “ rumor centrality ” Shah & Zaman ( 2011 ) for contagion processes on trees and Dynamic Message-passing ( DMP ) on graphs Lokhov et al . ( 2014 ) but both require as input the parameters of the spreading dynamics simulations . Our goal is to provide fresh perspectives on the problem of finding patient zero using graph neural networks ( GNNs ) Gilmer et al . ( 2017 ) . First , we conduct a rigorous analysis of learning P0 based on the graph structure and the disease dynamics , allowing us to find conditions for identifying P0 accurately . We test our theoretical results on a set of epidemic simulations on synthetic graphs commonly used in the literature Erdös et al . ( 1959 ) ; Albert & Barabási ( 2002 ) . We also evaluate our method on a realistic co-location network for the greater Boston area , finding performance similar to the synthetic data . While collecting labeled data to train GNN to find P0 may not be possible , training GNN using simulations on real contact-tracing data can provide a fast method for inferring P0 and help with planning and resource allocation . To the best of our knowledge , our work is the first to tackle the patient zero problem with deep learning and to test the approach on a realistic contact network . In summary , we make the following contributions : • We find upper bounds on the accuracy of finding patient zero in graphs with cycles , independent of the inference algorithm used . • We show that beyond a certain time scale the inference becomes difficult , highlighting the importance of swift and early contact-tracing . • We demonstrate the superiority of GNNs over state-of-the-art message passing algorithms in terms of speed and accuracy . Most importantly , our method is model agnostic and does not require the epidemic parameters to be known . • We validate our theoretical findings using extensive experiments for different epidemic dynamics and graph structures , including a real-world co-location graph of the COVID-19 outbreak . 2 RELATED WORK . Learning contagion dynamics Learning forward dynamics of contagion processes on a graph is a well studied problem area . For instance , Rodriguez et al . ( 2011 ) ; Du et al . ( 2013 ) proposed scalable algorithms to estimate the parameters of the underlying diffusion network , a problem known as network inference . Deep learning has led to novel neural network models that can learn forward dynamics of various processes including neural Hawkes processes Mei & Eisner ( 2017 ) and Markov decision processes-based reinforcement learning Li et al . ( 2018a ) . Learning forward contagion dynamics have also been intensively studied in epidemiology Pastor-Satorras & Vespignani ( 2001 ) ; Vynnycky & White ( 2010 ) , social science Matsubara et al . ( 2012 ) , and cyber-security Prakash et al . ( 2012 ) . In contrast , research in learning the reverse dynamics of contagion processes is rather scarce . Influence maximization Kempe et al . ( 2003 ) , for instance , finds a small set of individuals that can effectively spread information in a graph , but only maximizes the number of affected nodes in the infinite time limit . Our problem is more difficult as we care not just about the number of infected nodes , but which nodes were infected . Finding patient zero In order to find patient zero , we aim to learn the reverse dynamics of contagion processes . Shah & Zaman ( 2011 ) were among the first to formalize the problem on trees in the context of modeling rumor spreading in a network . Prakash et al . ( 2012 ) ; Vosoughi et al . ( 2017 ) studied similar problems for detecting viruses in computer networks . More recent advances proposed a dynamic message passing algorithm Lokhov et al . ( 2014 ) and belief propagation Altarelli et al . ( 2014 ) to estimate the epidemic outbreak source . Fairly recently , Fanti & Viswanath ( 2017 ) reduced the deanonymization of Bitcoin to the source identification problem in an epidemic and analyzes the dynamics properties . On the theoretical side , Shah & Zaman ( 2011 ) ; Wang et al . ( 2014 ) analyzed the quality of the maximum likelihood estimator and rumor centrality , but only for the simple SI model on trees . Antulov-Fantulin et al . ( 2015 ) found detectability limits for patient zero in the SIR model using exact analytical methods and Monte Carlo estimators . Khim & Loh ( 2016 ) ; Bubeck et al . ( 2017 ) proved that it is possible to construct a confidence set for the predicted diffusion source nodes with a size independent of the number of infected nodes over a regular tree . Our work provides fresh perspectives on the patient zero problem on general graphs based on the recent development of graph neural networks Graph neural networks Graph neural networks have received considerable attention ( see several references in Bronstein et al . ( 2017 ) ; Zhang et al . ( 2018 ) ; Wu et al . ( 2019 ) ; Goyal & Ferrara ( 2018 ) ) . While most research is focused on static graphs , a few have explored dynamic graphs Li et al . ( 2018b ) ; You et al . ( 2018 ) ; Kipf et al . ( 2018 ) ; Pareja et al . ( 2019 ) ; Trivedi et al . ( 2019 ) . For example , Kipf et al . ( 2018 ) propose a deep graph model to learn both the graph attribute and structure dynamics . They use a recurrent decoder to forecast the node attributes for multiple time steps ahead . Trivedi et al . ( 2019 ) take a continuous-time modeling approach where they take the node embedding as the input and model the occurrence of an edge as a point process . Xu et al . ( 2020 ) propose a temporal graph attention layer to learn the representations of temporal graphs . However , most research is designed for link prediction tasks and none of these existing studies have studied the problem of learning the source of the dynamics on a graph . 3 CONTAGION PROCESS AND PATIENT ZERO . Finding patient zero means tracing the contagion dynamics back to its initial state and identifying the first nodes that started spreading . Here , we describe the disease dynamics on a network using Susceptible-Infected-Recovered ( SIR ) and Susceptible-Exposed-Infected-Recovered ( SEIR ) Kermack & McKendrick ( 1927 ) compartmental models that assume that infected individuals develop immunity once they recover from the infections . 3.1 CONTAGION PROCESSES ON NETWORKS . In the SIR model , the population is split into three compartments : susceptible ( S ) who are susceptible to infection by the disease ; infected ( I ) who have caught the disease and are infectious ; removed ( R ) who are removed from consideration after experiencing the full infectious period . Continuous time model For a contagion process on a graph G with N nodes , each vertex represents an individual who is in contact only with its neighbors . We can represent the graph using the adjacency matrix A ∈ RN×N , where A [ i , j ] = 1 if two individuals are connected , 0 otherwise . Let Si , Ii , Ri be the average probabilities of node i being in each of the states , with Si + Ii +Ri = 1 . The SIR dynamics on a graph is given by Newman ( 2018 ) : dSi dt = −β ∑ j AijIjSi , dRi dt = γIi , dSi dt + dIi dt + dRi dt = 0 . ( 1 ) where β is the infection rate per contact and γ the recovery/death rate . The basic reproductive rate of a disease R0 ≡ βλ1/γ is defined as the number of secondary infections created by an index case in a fully susceptible population Keeling & Rohani ( 2011 ) . Here λ1 is the largest eigenvalue of A . The disease will spread and result in an epidemic if R0 > 1 . Discrete time model We can also use an equivalent discrete time SIR model . Let xti ∈ { S , I , R } be the state of node i at time t. For a susceptible node i , its probability to become infected or removed at time t+ 1 is P ( xt+1i = I|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = R|x t i = I ) = γ . ( 2 ) The SIR model doesn ’ t account for the incubation period , where an individual is infected but not infectious . This is remedied by introducing an “ exposed ” ( E ) state , leading to the SEIR model . For a susceptible node i , the probability to enter the exposed state , and becoming infectious at time t+ 1 is P ( xt+1i = E|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = I|x t i = E ) = α , ( 3 ) An infected node eventually enters the removed state with probability γ , which is the same as SIR ( 2 ) . ( 2 ) and ( 3 ) yield ( 1 ) for very small β as ∏ j ( 1− βAijIi ) ≈ βAijIi ( proof in supp . B ) . Finding patient zero Finding P0 can be formulated as a maximum likelihood estimation problem for SIR and SEIR models . Specifically , we observe a snapshot of the state of the nodes at time step t as xt : = ( xt1 , · · · , xtN ) , with each node ’ s state xti ∈ { S , E , I , R } . The problem of finding P0 is to search for a set of nodes Z = { i|x0i = I , i ∈ { 1 , · · ·N } } which led to the observed state xt . A common approach is to find Z such that the likelihood of observing xt is maximized : Z ? = argmaxZ , |Z|≤kP ( xt|Z ) ( 4 ) where P ( xt|Z ) is the probability of observing xt with Z being the P0 set . We assume the number of P0s is no larger than k. Estimating the original state of the dynamic system given the future states requires computing the conditional likelihood P ( xt|Z ) exactly , which is intractable due to the combinatorics of possible transmission routes .
Backtracking source of an epidemic (Patient Zero (P0)) is one of the important research topics of the current era that helps efficient resource allocation. Many of the existing works in this domain use graph-theoretic measures or message passing algorithms to tackle this problem. In contrast, this paper uses recently emerged Graph Neural Networks (GNNs) to learn and efficiently locate P0. It models disease spreading as a contagion process over a graph. While considering cyclic graphs, the paper shows upper bound on the accuracy of finding P0 and presents a bound of time horizon after which inference become difficult. Experimental results on different real-world and synthetic networks show interesting results.
SP:27753b9dcce0cb9b4d764b5721f0b5a20496ff68
Finding Patient Zero: Learning Contagion Source with Graph Neural Networks
1 INTRODUCTION . The ability to quickly identify the origin of an outbreak , or “ finding patient zero ” , is critically important in the effort to contain an emerging epidemic . The identification of early transmission chains and the reconstruction of the possible paths of diffusion of the virus can be the difference between stopping an outbreak in its infancy and letting an epidemic unfold and affect a large share of a population . Hence , solving this problem would be instrumental in informing and guiding contact tracing efforts carried out by public health authorities , allowing for optimal resource allocation that can maximize the probability of an early containment of the outbreak . Disease spreading is modeled as a contagion process on a network Stroock & Varadhan ( 2007 ) ; Pastor-Satorras et al . ( 2015 ) of human-to-human interactions where infected individuals are going to transmit the virus by infecting ( with a certain probability ) their direct contacts . In general , contagion processes can capture a wide range of phenomena , from rumor propagation on social media to virus spreading over cyber-physical networks Centola & Macy ( 2007 ) ; Baronchelli ( 2018 ) ; Wang et al . ( 2013 ) ; Mishra & Keshri ( 2013 ) . Therefore , learning the source of a contagion process would also have broader impact on various domains , from detecting sources of fake news to defending malware attacks . Learning the index case , or patient zero ( P0 ) , is a difficult problem . In this paper , we model disease spreading as a contagion process ( chains of transmissions ) over a graph . The evolution of an outbreak is noisy and highly dependent on the graph structure and disease dynamics . In addition , in real-world epidemics , there is often a delay from the start of the outbreak to when epidemic surveillance and contact tracing starts . Hence , we might only observe the state of the graph at some intermediate times without access to the complete chains of transmission . Furthermore , due to its stochastic nature , the same source node might lead to different epidemic spreading trajectories . Finally , learning P0 from noisy observations of graph snapshots is computationally intractable and the complexity grows exponentially with the size of the graph Shah & Zaman ( 2011 ) . Most work in learning the dynamics of a contagion process Rodriguez et al . ( 2011 ) ; Mei & Eisner ( 2017 ) ; Li et al . ( 2018a ) have focused on inferring the forward dynamics of the diffusion . In epidemiology , for example , Pastor-Satorras & Vespignani ( 2001 ) have studied learning the temporal dynamics of diseases spreading on mobility networks . The problem of learning the reverse dynamics and identifying diffusion sources has been largely overlooked due to the aforementioned challenges . Two of the most notable exceptions in the area are “ rumor centrality ” Shah & Zaman ( 2011 ) for contagion processes on trees and Dynamic Message-passing ( DMP ) on graphs Lokhov et al . ( 2014 ) but both require as input the parameters of the spreading dynamics simulations . Our goal is to provide fresh perspectives on the problem of finding patient zero using graph neural networks ( GNNs ) Gilmer et al . ( 2017 ) . First , we conduct a rigorous analysis of learning P0 based on the graph structure and the disease dynamics , allowing us to find conditions for identifying P0 accurately . We test our theoretical results on a set of epidemic simulations on synthetic graphs commonly used in the literature Erdös et al . ( 1959 ) ; Albert & Barabási ( 2002 ) . We also evaluate our method on a realistic co-location network for the greater Boston area , finding performance similar to the synthetic data . While collecting labeled data to train GNN to find P0 may not be possible , training GNN using simulations on real contact-tracing data can provide a fast method for inferring P0 and help with planning and resource allocation . To the best of our knowledge , our work is the first to tackle the patient zero problem with deep learning and to test the approach on a realistic contact network . In summary , we make the following contributions : • We find upper bounds on the accuracy of finding patient zero in graphs with cycles , independent of the inference algorithm used . • We show that beyond a certain time scale the inference becomes difficult , highlighting the importance of swift and early contact-tracing . • We demonstrate the superiority of GNNs over state-of-the-art message passing algorithms in terms of speed and accuracy . Most importantly , our method is model agnostic and does not require the epidemic parameters to be known . • We validate our theoretical findings using extensive experiments for different epidemic dynamics and graph structures , including a real-world co-location graph of the COVID-19 outbreak . 2 RELATED WORK . Learning contagion dynamics Learning forward dynamics of contagion processes on a graph is a well studied problem area . For instance , Rodriguez et al . ( 2011 ) ; Du et al . ( 2013 ) proposed scalable algorithms to estimate the parameters of the underlying diffusion network , a problem known as network inference . Deep learning has led to novel neural network models that can learn forward dynamics of various processes including neural Hawkes processes Mei & Eisner ( 2017 ) and Markov decision processes-based reinforcement learning Li et al . ( 2018a ) . Learning forward contagion dynamics have also been intensively studied in epidemiology Pastor-Satorras & Vespignani ( 2001 ) ; Vynnycky & White ( 2010 ) , social science Matsubara et al . ( 2012 ) , and cyber-security Prakash et al . ( 2012 ) . In contrast , research in learning the reverse dynamics of contagion processes is rather scarce . Influence maximization Kempe et al . ( 2003 ) , for instance , finds a small set of individuals that can effectively spread information in a graph , but only maximizes the number of affected nodes in the infinite time limit . Our problem is more difficult as we care not just about the number of infected nodes , but which nodes were infected . Finding patient zero In order to find patient zero , we aim to learn the reverse dynamics of contagion processes . Shah & Zaman ( 2011 ) were among the first to formalize the problem on trees in the context of modeling rumor spreading in a network . Prakash et al . ( 2012 ) ; Vosoughi et al . ( 2017 ) studied similar problems for detecting viruses in computer networks . More recent advances proposed a dynamic message passing algorithm Lokhov et al . ( 2014 ) and belief propagation Altarelli et al . ( 2014 ) to estimate the epidemic outbreak source . Fairly recently , Fanti & Viswanath ( 2017 ) reduced the deanonymization of Bitcoin to the source identification problem in an epidemic and analyzes the dynamics properties . On the theoretical side , Shah & Zaman ( 2011 ) ; Wang et al . ( 2014 ) analyzed the quality of the maximum likelihood estimator and rumor centrality , but only for the simple SI model on trees . Antulov-Fantulin et al . ( 2015 ) found detectability limits for patient zero in the SIR model using exact analytical methods and Monte Carlo estimators . Khim & Loh ( 2016 ) ; Bubeck et al . ( 2017 ) proved that it is possible to construct a confidence set for the predicted diffusion source nodes with a size independent of the number of infected nodes over a regular tree . Our work provides fresh perspectives on the patient zero problem on general graphs based on the recent development of graph neural networks Graph neural networks Graph neural networks have received considerable attention ( see several references in Bronstein et al . ( 2017 ) ; Zhang et al . ( 2018 ) ; Wu et al . ( 2019 ) ; Goyal & Ferrara ( 2018 ) ) . While most research is focused on static graphs , a few have explored dynamic graphs Li et al . ( 2018b ) ; You et al . ( 2018 ) ; Kipf et al . ( 2018 ) ; Pareja et al . ( 2019 ) ; Trivedi et al . ( 2019 ) . For example , Kipf et al . ( 2018 ) propose a deep graph model to learn both the graph attribute and structure dynamics . They use a recurrent decoder to forecast the node attributes for multiple time steps ahead . Trivedi et al . ( 2019 ) take a continuous-time modeling approach where they take the node embedding as the input and model the occurrence of an edge as a point process . Xu et al . ( 2020 ) propose a temporal graph attention layer to learn the representations of temporal graphs . However , most research is designed for link prediction tasks and none of these existing studies have studied the problem of learning the source of the dynamics on a graph . 3 CONTAGION PROCESS AND PATIENT ZERO . Finding patient zero means tracing the contagion dynamics back to its initial state and identifying the first nodes that started spreading . Here , we describe the disease dynamics on a network using Susceptible-Infected-Recovered ( SIR ) and Susceptible-Exposed-Infected-Recovered ( SEIR ) Kermack & McKendrick ( 1927 ) compartmental models that assume that infected individuals develop immunity once they recover from the infections . 3.1 CONTAGION PROCESSES ON NETWORKS . In the SIR model , the population is split into three compartments : susceptible ( S ) who are susceptible to infection by the disease ; infected ( I ) who have caught the disease and are infectious ; removed ( R ) who are removed from consideration after experiencing the full infectious period . Continuous time model For a contagion process on a graph G with N nodes , each vertex represents an individual who is in contact only with its neighbors . We can represent the graph using the adjacency matrix A ∈ RN×N , where A [ i , j ] = 1 if two individuals are connected , 0 otherwise . Let Si , Ii , Ri be the average probabilities of node i being in each of the states , with Si + Ii +Ri = 1 . The SIR dynamics on a graph is given by Newman ( 2018 ) : dSi dt = −β ∑ j AijIjSi , dRi dt = γIi , dSi dt + dIi dt + dRi dt = 0 . ( 1 ) where β is the infection rate per contact and γ the recovery/death rate . The basic reproductive rate of a disease R0 ≡ βλ1/γ is defined as the number of secondary infections created by an index case in a fully susceptible population Keeling & Rohani ( 2011 ) . Here λ1 is the largest eigenvalue of A . The disease will spread and result in an epidemic if R0 > 1 . Discrete time model We can also use an equivalent discrete time SIR model . Let xti ∈ { S , I , R } be the state of node i at time t. For a susceptible node i , its probability to become infected or removed at time t+ 1 is P ( xt+1i = I|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = R|x t i = I ) = γ . ( 2 ) The SIR model doesn ’ t account for the incubation period , where an individual is infected but not infectious . This is remedied by introducing an “ exposed ” ( E ) state , leading to the SEIR model . For a susceptible node i , the probability to enter the exposed state , and becoming infectious at time t+ 1 is P ( xt+1i = E|x t i = S ) = 1− ∏ j ( 1− βAijIi ( t ) ) , P ( xt+1i = I|x t i = E ) = α , ( 3 ) An infected node eventually enters the removed state with probability γ , which is the same as SIR ( 2 ) . ( 2 ) and ( 3 ) yield ( 1 ) for very small β as ∏ j ( 1− βAijIi ) ≈ βAijIi ( proof in supp . B ) . Finding patient zero Finding P0 can be formulated as a maximum likelihood estimation problem for SIR and SEIR models . Specifically , we observe a snapshot of the state of the nodes at time step t as xt : = ( xt1 , · · · , xtN ) , with each node ’ s state xti ∈ { S , E , I , R } . The problem of finding P0 is to search for a set of nodes Z = { i|x0i = I , i ∈ { 1 , · · ·N } } which led to the observed state xt . A common approach is to find Z such that the likelihood of observing xt is maximized : Z ? = argmaxZ , |Z|≤kP ( xt|Z ) ( 4 ) where P ( xt|Z ) is the probability of observing xt with Z being the P0 set . We assume the number of P0s is no larger than k. Estimating the original state of the dynamic system given the future states requires computing the conditional likelihood P ( xt|Z ) exactly , which is intractable due to the combinatorics of possible transmission routes .
An S(E)IR epidemics propagates on a graph, and the goal is to detect its source (P0) only from the observation of the state (S,E,I,R) of every node of the graph at some time $T > 0$. This version of the source detection problem has been studied first by Shah and Zeman (2011) for SI epidemics, as listed in Section 2. The current paper claims to (i) establish new fundamental limits on this problem, showing in particular that after some time the source detection becomes difficult, and (ii) to demonstrate the ability of graph convolutional networks to solve the problem and validate the results on real data.
SP:27753b9dcce0cb9b4d764b5721f0b5a20496ff68
Iterative Amortized Policy Optimization
1 Introduction . Reinforcement learning ( RL ) algorithms involve policy evaluation and policy optimization [ 73 ] . Given a policy , one can estimate the value for each state or state-action pair following that policy , and given a value estimate , one can improve the policy to maximize the value . This latter procedure , policy optimization , can be challenging in continuous control due to instability and poor asymptotic performance . In deep RL , where policies over continuous actions are often parameterized by deep networks , such issues are typically tackled using regularization from previous policies [ 67 , 68 ] or by maximizing policy entropy [ 57 , 23 ] . These techniques can be interpreted as variational inference [ 51 ] , using optimization to infer a policy that yields high expected return while satisfying prior policy constraints . This smooths the optimization landscape , improving stability and performance [ 3 ] . However , one subtlety arises : when used with entropy or KL regularization , policy networks perform amortized optimization [ 26 ] . That is , rather than optimizing the action distribution , e.g. , mean and variance , many deep RL algorithms , such as soft actor-critic ( SAC ) [ 31 , 32 ] , instead optimize a network to output these parameters , learning to optimize the policy . Typically , this is implemented as a direct mapping from states to action distribution parameters . While such direct amortization schemes have improved the efficiency of variational inference as “ encoder ” networks [ 44 , 64 , 56 ] , they also suffer from several drawbacks : 1 ) they tend to provide suboptimal estimates [ 20 , 43 , 55 ] , yielding a so-called “ amortization gap ” in performance [ 20 ] , 2 ) they are restricted to a single estimate [ 27 ] , thereby limiting exploration , and 3 ) they can not generalize to new objectives , unlike , e.g. , gradient-based [ 36 ] or gradient-free optimizers [ 66 ] . Inspired by techniques and improvements from variational inference , we investigate iterative amortized policy optimization . Iterative amortization [ 55 ] uses gradients or errors to iteratively update the parameters of a distribution . Unlike direct amortization , which receives gradients only after ∗Now at DeepMind , London , UK . Correspondence to josephmarino @ deepmind.com . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . outputting the distribution , iterative amortization uses these gradients online , thereby learning to iteratively optimize . In generative modeling settings , iterative amortization empirically outperforms direct amortization [ 55 , 54 ] and can find multiple modes of the optimization landscape [ 27 ] . The contributions of this paper are as follows : • We propose iterative amortized policy optimization , exploiting a new , fruitful connection between amortized variational inference and policy optimization . • Using the suite of MuJoCo environments [ 78 , 12 ] , we demonstrate performance improvements over direct amortized policies , as well as more complex flow-based policies . • We demonstrate novel benefits of this amortization technique : improved accuracy , providing multiple policy estimates , and generalizing to new objectives . 2 Background . 2.1 Preliminaries . We consider Markov decision processes ( MDPs ) , where st ∈ S and at ∈ A are the state and action at time t , resulting in reward rt = r ( st , at ) . Environment state transitions are given by st+1 ∼ penv ( st+1|st , at ) , and the agent is defined by a parametric distribution , pθ ( at|st ) , with parameters θ.2 The discounted sum of rewards is denoted as R ( τ ) = ∑t γtrt , where γ ∈ ( 0 , 1 ] is the discount factor , and τ = ( s1 , a1 , . . . ) is a trajectory . The distribution over trajectories is : p ( τ ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) pθ ( at|st ) , ( 1 ) where the initial state is drawn from the distribution ρ ( s1 ) . The standard RL objective consists of maximizing the expected discounted return , Ep ( τ ) [ R ( τ ) ] . For convenience of presentation , we use the undiscounted setting ( γ = 1 ) , though the formulation can be applied with any valid γ . 2.2 KL-Regularized Reinforcement Learning . Various works have formulated RL , planning , and control problems in terms of probabilistic inference [ 21 , 8 , 79 , 77 , 11 , 51 ] . These approaches consider the agent-environment interaction as a graphical model , then convert reward maximization into maximum marginal likelihood estimation , learning and inferring a policy that results in maximal reward . This conversion is accomplished by introducing one or more binary observed variables [ 19 ] , denoted as O for “ optimality ” [ 51 ] , with p ( O = 1|τ ) ∝ exp ( R ( τ ) /α ) , where α is a temperature hyper-parameter . We would like to infer latent variables , τ , and learn parameters , θ , that yield the maximum log-likelihood of optimality , i.e. , log p ( O = 1 ) . Evaluating this likelihood requires marginalizing the joint distribution , p ( O = 1 ) = ∫ p ( τ , O = 1 ) dτ . This involves averaging over all trajectories , which is intractable in high-dimensional spaces . Instead , we can use variational inference to lower bound this objective , introducing a structured approximate posterior distribution : π ( τ |O ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) π ( at|st , O ) . ( 2 ) This provides the following lower bound on the objective : log p ( O = 1 ) = log ∫ p ( O = 1|τ ) p ( τ ) dτ ( 3 ) ≥ ∫ π ( τ |O ) [ log p ( O = 1|τ ) p ( τ ) π ( τ |O ) ] dτ ( 4 ) = Eπ [ R ( τ ) /α ] −DKL ( π ( τ |O ) ‖p ( τ ) ) . ( 5 ) 2In this paper , we consider the entropy-regularized case , where pθ ( at|st ) = U ( −1 , 1 ) , i.e. , uniform . However , we present the derivation for the KL-regularized case for full generality . 21 Equivalently , we can multiply by α , defining the variational RL objective as : J ( π , θ ) ≡ Eπ [ R ( τ ) ] − αDKL ( π ( τ |O ) ‖p ( τ ) ) . ( 6 ) This objective consists of the expected return ( i.e. , the standard RL objective ) and a KL divergence between π ( τ |O ) and p ( τ ) . In terms of states and actions , this objective is : J ( π , θ ) = Est , rt∼penv at∼π [ T∑ t=1 rt − α log π ( at|st , O ) pθ ( at|st ) ] . ( 7 ) At a given timestep , t , one can optimize this objective by estimating the future terms in the sum using a “ soft ” action-value ( Qπ ) network [ 30 ] or model [ 62 ] . For instance , sampling st ∼ penv , slightly abusing notation , we can write the objective at time t as : J ( π , θ ) = Eπ [ Qπ ( st , at ) ] − αDKL ( π ( at|st , O ) ||pθ ( at|st ) ) . ( 8 ) Policy optimization in the KL-regularized setting corresponds to maximizing J w.r.t . π . We often consider parametric policies , in which π is defined by distribution parameters , λ , e.g. , Gaussian mean , µ , and variance , σ2 . In this case , policy optimization corresponds to maximizing : λ← arg max λ J ( π , θ ) . ( 9 ) Optionally , we can then also learn the policy prior parameters , θ [ 1 ] . 2.3 Entropy & KL Regularized Policy Networks Perform Direct Amortization . Policy-based approaches to RL typically do not directly optimize the action distribution parameters , e.g. , through gradient-based optimization . Instead , the action distribution parameters are output by a function approximator ( deep network ) , fφ , which is trained using deterministic [ 70 , 52 ] or stochastic gradients [ 83 , 35 ] . When combined with entropy or KL regularization , this policy network is a form of amortized optimization [ 26 ] , learning to estimate policies . Again , denoting the action distribution parameters , e.g. , mean and variance , as λ , for a given state , s , we can express this direct mapping as λ← fφ ( s ) , ( direct amortization ) ( 10 ) denoting the corresponding policy as πφ ( a|s , O ; λ ) . Thus , fφ attempts to learn to optimize Eq . 9 . This setup is shown in Figure 1 ( Right ) . Without entropy or KL regularization , i.e . πφ ( a|s ) = pθ ( a|s ) , we can instead interpret the network as directly integrating the LHS of Eq . 4 , which is less efficient and more challenging . Regularization smooths the optimization landscape , yielding more stable improvement and higher asymptotic performance [ 3 ] . Viewing policy networks as a form of direct amortized variational optimizer ( Eq . 10 ) allows us to see that they are similar to “ encoder ” networks in variational autoencoders ( VAEs ) [ 44 , 64 ] . However , there are several drawbacks to direct amortization . Algorithm 1 Direct Amortization Initialize φ for each environment step do λ← fφ ( st ) at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Algorithm 2 Iterative Amortization Initialize φ for each environment step do Initialize λ for each policy optimization iteration do λ← fφ ( st , λ , ∇λJ ) end for at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Amortization Gap . Direct amortization results in suboptimal approximate posterior estimates , with the resulting gap in the variational bound referred to as the amortization gap [ 20 ] . Thus , in the RL setting , an amortized policy , πφ , results in worse performance than the optimal policy within the parametric policy class , denoted as π̂ . The amortization gap is the gap in following inequality : J ( πφ , θ ) ≤ J ( π̂ , θ ) . Because J is a variational bound on the RL objective , i.e. , expected return , a looser bound , due to amortization , prevents one from more completely optimizing this objective . This is shown in Figure 1 ( Left ) ,3 where J is plotted over two dimensions of the policy mean at a particular state in the MuJoCo environment Hopper-v2 . The estimate of a direct amortized policy ( ) is suboptimal , far from the optimal estimate ( F ) . While the relative difference in the objective is relatively small , suboptimal estimates prevent sampling and exploring high-value regions of the action-space . That is , suboptimal estimates have only a minor impact on evaluation performance ( see Appendix B.6 ) but hinder effective data collection . Single Estimate . Direct amortization is limited to a single , static estimate . In other words , if there are multiple high-value regions of the action-space , a uni-modal ( e.g. , Gaussian ) direct amortized policy is restricted to only one region , thereby limiting exploration . Note that this is an additional restriction beyond simply considering uni-modal distributions , as a generic optimization procedure may arrive at multiple uni-modal estimates depending on initialization and stochastic sampling ( see Section 3.2 ) . While multi-modal distributions reduce the severity of this restriction [ 74 , 29 ] , the other limitations of direct amortization still persist . Inability to Generalize Across Objectives . Direct amortization is a feedforward procedure , receiving gradients from the objective only after estimation . This is contrast to other forms of optimization , which receive gradients ( feedback ) during estimation . Thus , unlike other optimizers , direct amortization is incapable of generalizing to new objectives , e.g. , if Qπ ( s , a ) or pθ ( a|s ) change , which is a desirable capability for adapting to new tasks or environments . To improve upon this scheme and overcome these drawbacks , in Section 3 , we turn to a technique developed in generative modeling , iterative amortization [ 55 ] , retaining the efficiency of amortization while employing a more flexible iterative estimation procedure .
The paper proposes to replace the actor/policy network with an iterative version to encode the action distribution parameters, which is inspired by prior work on iterative amortized optimization. This scheme generates the action distribution parameters for each state at the end of an inner loop which takes the objective gradient wrt to the parameters also as input (as opposed to a regular actor network which does one forward pass). This seems similar to prior work on learning to learn/meta learning but the presentation can be improved (more detailed comments below). Experimental evidence is given for benefits over SAC in mujoco environments.
SP:cf5222ed98e5d552771fb915beeee4d504b947fe
Iterative Amortized Policy Optimization
1 Introduction . Reinforcement learning ( RL ) algorithms involve policy evaluation and policy optimization [ 73 ] . Given a policy , one can estimate the value for each state or state-action pair following that policy , and given a value estimate , one can improve the policy to maximize the value . This latter procedure , policy optimization , can be challenging in continuous control due to instability and poor asymptotic performance . In deep RL , where policies over continuous actions are often parameterized by deep networks , such issues are typically tackled using regularization from previous policies [ 67 , 68 ] or by maximizing policy entropy [ 57 , 23 ] . These techniques can be interpreted as variational inference [ 51 ] , using optimization to infer a policy that yields high expected return while satisfying prior policy constraints . This smooths the optimization landscape , improving stability and performance [ 3 ] . However , one subtlety arises : when used with entropy or KL regularization , policy networks perform amortized optimization [ 26 ] . That is , rather than optimizing the action distribution , e.g. , mean and variance , many deep RL algorithms , such as soft actor-critic ( SAC ) [ 31 , 32 ] , instead optimize a network to output these parameters , learning to optimize the policy . Typically , this is implemented as a direct mapping from states to action distribution parameters . While such direct amortization schemes have improved the efficiency of variational inference as “ encoder ” networks [ 44 , 64 , 56 ] , they also suffer from several drawbacks : 1 ) they tend to provide suboptimal estimates [ 20 , 43 , 55 ] , yielding a so-called “ amortization gap ” in performance [ 20 ] , 2 ) they are restricted to a single estimate [ 27 ] , thereby limiting exploration , and 3 ) they can not generalize to new objectives , unlike , e.g. , gradient-based [ 36 ] or gradient-free optimizers [ 66 ] . Inspired by techniques and improvements from variational inference , we investigate iterative amortized policy optimization . Iterative amortization [ 55 ] uses gradients or errors to iteratively update the parameters of a distribution . Unlike direct amortization , which receives gradients only after ∗Now at DeepMind , London , UK . Correspondence to josephmarino @ deepmind.com . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . outputting the distribution , iterative amortization uses these gradients online , thereby learning to iteratively optimize . In generative modeling settings , iterative amortization empirically outperforms direct amortization [ 55 , 54 ] and can find multiple modes of the optimization landscape [ 27 ] . The contributions of this paper are as follows : • We propose iterative amortized policy optimization , exploiting a new , fruitful connection between amortized variational inference and policy optimization . • Using the suite of MuJoCo environments [ 78 , 12 ] , we demonstrate performance improvements over direct amortized policies , as well as more complex flow-based policies . • We demonstrate novel benefits of this amortization technique : improved accuracy , providing multiple policy estimates , and generalizing to new objectives . 2 Background . 2.1 Preliminaries . We consider Markov decision processes ( MDPs ) , where st ∈ S and at ∈ A are the state and action at time t , resulting in reward rt = r ( st , at ) . Environment state transitions are given by st+1 ∼ penv ( st+1|st , at ) , and the agent is defined by a parametric distribution , pθ ( at|st ) , with parameters θ.2 The discounted sum of rewards is denoted as R ( τ ) = ∑t γtrt , where γ ∈ ( 0 , 1 ] is the discount factor , and τ = ( s1 , a1 , . . . ) is a trajectory . The distribution over trajectories is : p ( τ ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) pθ ( at|st ) , ( 1 ) where the initial state is drawn from the distribution ρ ( s1 ) . The standard RL objective consists of maximizing the expected discounted return , Ep ( τ ) [ R ( τ ) ] . For convenience of presentation , we use the undiscounted setting ( γ = 1 ) , though the formulation can be applied with any valid γ . 2.2 KL-Regularized Reinforcement Learning . Various works have formulated RL , planning , and control problems in terms of probabilistic inference [ 21 , 8 , 79 , 77 , 11 , 51 ] . These approaches consider the agent-environment interaction as a graphical model , then convert reward maximization into maximum marginal likelihood estimation , learning and inferring a policy that results in maximal reward . This conversion is accomplished by introducing one or more binary observed variables [ 19 ] , denoted as O for “ optimality ” [ 51 ] , with p ( O = 1|τ ) ∝ exp ( R ( τ ) /α ) , where α is a temperature hyper-parameter . We would like to infer latent variables , τ , and learn parameters , θ , that yield the maximum log-likelihood of optimality , i.e. , log p ( O = 1 ) . Evaluating this likelihood requires marginalizing the joint distribution , p ( O = 1 ) = ∫ p ( τ , O = 1 ) dτ . This involves averaging over all trajectories , which is intractable in high-dimensional spaces . Instead , we can use variational inference to lower bound this objective , introducing a structured approximate posterior distribution : π ( τ |O ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) π ( at|st , O ) . ( 2 ) This provides the following lower bound on the objective : log p ( O = 1 ) = log ∫ p ( O = 1|τ ) p ( τ ) dτ ( 3 ) ≥ ∫ π ( τ |O ) [ log p ( O = 1|τ ) p ( τ ) π ( τ |O ) ] dτ ( 4 ) = Eπ [ R ( τ ) /α ] −DKL ( π ( τ |O ) ‖p ( τ ) ) . ( 5 ) 2In this paper , we consider the entropy-regularized case , where pθ ( at|st ) = U ( −1 , 1 ) , i.e. , uniform . However , we present the derivation for the KL-regularized case for full generality . 21 Equivalently , we can multiply by α , defining the variational RL objective as : J ( π , θ ) ≡ Eπ [ R ( τ ) ] − αDKL ( π ( τ |O ) ‖p ( τ ) ) . ( 6 ) This objective consists of the expected return ( i.e. , the standard RL objective ) and a KL divergence between π ( τ |O ) and p ( τ ) . In terms of states and actions , this objective is : J ( π , θ ) = Est , rt∼penv at∼π [ T∑ t=1 rt − α log π ( at|st , O ) pθ ( at|st ) ] . ( 7 ) At a given timestep , t , one can optimize this objective by estimating the future terms in the sum using a “ soft ” action-value ( Qπ ) network [ 30 ] or model [ 62 ] . For instance , sampling st ∼ penv , slightly abusing notation , we can write the objective at time t as : J ( π , θ ) = Eπ [ Qπ ( st , at ) ] − αDKL ( π ( at|st , O ) ||pθ ( at|st ) ) . ( 8 ) Policy optimization in the KL-regularized setting corresponds to maximizing J w.r.t . π . We often consider parametric policies , in which π is defined by distribution parameters , λ , e.g. , Gaussian mean , µ , and variance , σ2 . In this case , policy optimization corresponds to maximizing : λ← arg max λ J ( π , θ ) . ( 9 ) Optionally , we can then also learn the policy prior parameters , θ [ 1 ] . 2.3 Entropy & KL Regularized Policy Networks Perform Direct Amortization . Policy-based approaches to RL typically do not directly optimize the action distribution parameters , e.g. , through gradient-based optimization . Instead , the action distribution parameters are output by a function approximator ( deep network ) , fφ , which is trained using deterministic [ 70 , 52 ] or stochastic gradients [ 83 , 35 ] . When combined with entropy or KL regularization , this policy network is a form of amortized optimization [ 26 ] , learning to estimate policies . Again , denoting the action distribution parameters , e.g. , mean and variance , as λ , for a given state , s , we can express this direct mapping as λ← fφ ( s ) , ( direct amortization ) ( 10 ) denoting the corresponding policy as πφ ( a|s , O ; λ ) . Thus , fφ attempts to learn to optimize Eq . 9 . This setup is shown in Figure 1 ( Right ) . Without entropy or KL regularization , i.e . πφ ( a|s ) = pθ ( a|s ) , we can instead interpret the network as directly integrating the LHS of Eq . 4 , which is less efficient and more challenging . Regularization smooths the optimization landscape , yielding more stable improvement and higher asymptotic performance [ 3 ] . Viewing policy networks as a form of direct amortized variational optimizer ( Eq . 10 ) allows us to see that they are similar to “ encoder ” networks in variational autoencoders ( VAEs ) [ 44 , 64 ] . However , there are several drawbacks to direct amortization . Algorithm 1 Direct Amortization Initialize φ for each environment step do λ← fφ ( st ) at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Algorithm 2 Iterative Amortization Initialize φ for each environment step do Initialize λ for each policy optimization iteration do λ← fφ ( st , λ , ∇λJ ) end for at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Amortization Gap . Direct amortization results in suboptimal approximate posterior estimates , with the resulting gap in the variational bound referred to as the amortization gap [ 20 ] . Thus , in the RL setting , an amortized policy , πφ , results in worse performance than the optimal policy within the parametric policy class , denoted as π̂ . The amortization gap is the gap in following inequality : J ( πφ , θ ) ≤ J ( π̂ , θ ) . Because J is a variational bound on the RL objective , i.e. , expected return , a looser bound , due to amortization , prevents one from more completely optimizing this objective . This is shown in Figure 1 ( Left ) ,3 where J is plotted over two dimensions of the policy mean at a particular state in the MuJoCo environment Hopper-v2 . The estimate of a direct amortized policy ( ) is suboptimal , far from the optimal estimate ( F ) . While the relative difference in the objective is relatively small , suboptimal estimates prevent sampling and exploring high-value regions of the action-space . That is , suboptimal estimates have only a minor impact on evaluation performance ( see Appendix B.6 ) but hinder effective data collection . Single Estimate . Direct amortization is limited to a single , static estimate . In other words , if there are multiple high-value regions of the action-space , a uni-modal ( e.g. , Gaussian ) direct amortized policy is restricted to only one region , thereby limiting exploration . Note that this is an additional restriction beyond simply considering uni-modal distributions , as a generic optimization procedure may arrive at multiple uni-modal estimates depending on initialization and stochastic sampling ( see Section 3.2 ) . While multi-modal distributions reduce the severity of this restriction [ 74 , 29 ] , the other limitations of direct amortization still persist . Inability to Generalize Across Objectives . Direct amortization is a feedforward procedure , receiving gradients from the objective only after estimation . This is contrast to other forms of optimization , which receive gradients ( feedback ) during estimation . Thus , unlike other optimizers , direct amortization is incapable of generalizing to new objectives , e.g. , if Qπ ( s , a ) or pθ ( a|s ) change , which is a desirable capability for adapting to new tasks or environments . To improve upon this scheme and overcome these drawbacks , in Section 3 , we turn to a technique developed in generative modeling , iterative amortization [ 55 ] , retaining the efficiency of amortization while employing a more flexible iterative estimation procedure .
**Contributions**: The authors propose to use iterative amortization for policy optimization to help reduce suboptimality in policy optimization. They find that like in variational inference for generative modeling, iterative amortization is able cover multiple modes of distributions and lower the amortization gap, and show slightly improved performance on mujoco gym benchmarks. Additionally, they find that the iteratively amortized policy is able to better exploit the learned Q function and lead to more overestimation bias, and address this by tuning a parameter to make the Q-function backups more pessimistic to compensate.
SP:cf5222ed98e5d552771fb915beeee4d504b947fe
Iterative Amortized Policy Optimization
1 Introduction . Reinforcement learning ( RL ) algorithms involve policy evaluation and policy optimization [ 73 ] . Given a policy , one can estimate the value for each state or state-action pair following that policy , and given a value estimate , one can improve the policy to maximize the value . This latter procedure , policy optimization , can be challenging in continuous control due to instability and poor asymptotic performance . In deep RL , where policies over continuous actions are often parameterized by deep networks , such issues are typically tackled using regularization from previous policies [ 67 , 68 ] or by maximizing policy entropy [ 57 , 23 ] . These techniques can be interpreted as variational inference [ 51 ] , using optimization to infer a policy that yields high expected return while satisfying prior policy constraints . This smooths the optimization landscape , improving stability and performance [ 3 ] . However , one subtlety arises : when used with entropy or KL regularization , policy networks perform amortized optimization [ 26 ] . That is , rather than optimizing the action distribution , e.g. , mean and variance , many deep RL algorithms , such as soft actor-critic ( SAC ) [ 31 , 32 ] , instead optimize a network to output these parameters , learning to optimize the policy . Typically , this is implemented as a direct mapping from states to action distribution parameters . While such direct amortization schemes have improved the efficiency of variational inference as “ encoder ” networks [ 44 , 64 , 56 ] , they also suffer from several drawbacks : 1 ) they tend to provide suboptimal estimates [ 20 , 43 , 55 ] , yielding a so-called “ amortization gap ” in performance [ 20 ] , 2 ) they are restricted to a single estimate [ 27 ] , thereby limiting exploration , and 3 ) they can not generalize to new objectives , unlike , e.g. , gradient-based [ 36 ] or gradient-free optimizers [ 66 ] . Inspired by techniques and improvements from variational inference , we investigate iterative amortized policy optimization . Iterative amortization [ 55 ] uses gradients or errors to iteratively update the parameters of a distribution . Unlike direct amortization , which receives gradients only after ∗Now at DeepMind , London , UK . Correspondence to josephmarino @ deepmind.com . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . outputting the distribution , iterative amortization uses these gradients online , thereby learning to iteratively optimize . In generative modeling settings , iterative amortization empirically outperforms direct amortization [ 55 , 54 ] and can find multiple modes of the optimization landscape [ 27 ] . The contributions of this paper are as follows : • We propose iterative amortized policy optimization , exploiting a new , fruitful connection between amortized variational inference and policy optimization . • Using the suite of MuJoCo environments [ 78 , 12 ] , we demonstrate performance improvements over direct amortized policies , as well as more complex flow-based policies . • We demonstrate novel benefits of this amortization technique : improved accuracy , providing multiple policy estimates , and generalizing to new objectives . 2 Background . 2.1 Preliminaries . We consider Markov decision processes ( MDPs ) , where st ∈ S and at ∈ A are the state and action at time t , resulting in reward rt = r ( st , at ) . Environment state transitions are given by st+1 ∼ penv ( st+1|st , at ) , and the agent is defined by a parametric distribution , pθ ( at|st ) , with parameters θ.2 The discounted sum of rewards is denoted as R ( τ ) = ∑t γtrt , where γ ∈ ( 0 , 1 ] is the discount factor , and τ = ( s1 , a1 , . . . ) is a trajectory . The distribution over trajectories is : p ( τ ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) pθ ( at|st ) , ( 1 ) where the initial state is drawn from the distribution ρ ( s1 ) . The standard RL objective consists of maximizing the expected discounted return , Ep ( τ ) [ R ( τ ) ] . For convenience of presentation , we use the undiscounted setting ( γ = 1 ) , though the formulation can be applied with any valid γ . 2.2 KL-Regularized Reinforcement Learning . Various works have formulated RL , planning , and control problems in terms of probabilistic inference [ 21 , 8 , 79 , 77 , 11 , 51 ] . These approaches consider the agent-environment interaction as a graphical model , then convert reward maximization into maximum marginal likelihood estimation , learning and inferring a policy that results in maximal reward . This conversion is accomplished by introducing one or more binary observed variables [ 19 ] , denoted as O for “ optimality ” [ 51 ] , with p ( O = 1|τ ) ∝ exp ( R ( τ ) /α ) , where α is a temperature hyper-parameter . We would like to infer latent variables , τ , and learn parameters , θ , that yield the maximum log-likelihood of optimality , i.e. , log p ( O = 1 ) . Evaluating this likelihood requires marginalizing the joint distribution , p ( O = 1 ) = ∫ p ( τ , O = 1 ) dτ . This involves averaging over all trajectories , which is intractable in high-dimensional spaces . Instead , we can use variational inference to lower bound this objective , introducing a structured approximate posterior distribution : π ( τ |O ) = ρ ( s1 ) T−1∏ t=1 penv ( st+1|st , at ) π ( at|st , O ) . ( 2 ) This provides the following lower bound on the objective : log p ( O = 1 ) = log ∫ p ( O = 1|τ ) p ( τ ) dτ ( 3 ) ≥ ∫ π ( τ |O ) [ log p ( O = 1|τ ) p ( τ ) π ( τ |O ) ] dτ ( 4 ) = Eπ [ R ( τ ) /α ] −DKL ( π ( τ |O ) ‖p ( τ ) ) . ( 5 ) 2In this paper , we consider the entropy-regularized case , where pθ ( at|st ) = U ( −1 , 1 ) , i.e. , uniform . However , we present the derivation for the KL-regularized case for full generality . 21 Equivalently , we can multiply by α , defining the variational RL objective as : J ( π , θ ) ≡ Eπ [ R ( τ ) ] − αDKL ( π ( τ |O ) ‖p ( τ ) ) . ( 6 ) This objective consists of the expected return ( i.e. , the standard RL objective ) and a KL divergence between π ( τ |O ) and p ( τ ) . In terms of states and actions , this objective is : J ( π , θ ) = Est , rt∼penv at∼π [ T∑ t=1 rt − α log π ( at|st , O ) pθ ( at|st ) ] . ( 7 ) At a given timestep , t , one can optimize this objective by estimating the future terms in the sum using a “ soft ” action-value ( Qπ ) network [ 30 ] or model [ 62 ] . For instance , sampling st ∼ penv , slightly abusing notation , we can write the objective at time t as : J ( π , θ ) = Eπ [ Qπ ( st , at ) ] − αDKL ( π ( at|st , O ) ||pθ ( at|st ) ) . ( 8 ) Policy optimization in the KL-regularized setting corresponds to maximizing J w.r.t . π . We often consider parametric policies , in which π is defined by distribution parameters , λ , e.g. , Gaussian mean , µ , and variance , σ2 . In this case , policy optimization corresponds to maximizing : λ← arg max λ J ( π , θ ) . ( 9 ) Optionally , we can then also learn the policy prior parameters , θ [ 1 ] . 2.3 Entropy & KL Regularized Policy Networks Perform Direct Amortization . Policy-based approaches to RL typically do not directly optimize the action distribution parameters , e.g. , through gradient-based optimization . Instead , the action distribution parameters are output by a function approximator ( deep network ) , fφ , which is trained using deterministic [ 70 , 52 ] or stochastic gradients [ 83 , 35 ] . When combined with entropy or KL regularization , this policy network is a form of amortized optimization [ 26 ] , learning to estimate policies . Again , denoting the action distribution parameters , e.g. , mean and variance , as λ , for a given state , s , we can express this direct mapping as λ← fφ ( s ) , ( direct amortization ) ( 10 ) denoting the corresponding policy as πφ ( a|s , O ; λ ) . Thus , fφ attempts to learn to optimize Eq . 9 . This setup is shown in Figure 1 ( Right ) . Without entropy or KL regularization , i.e . πφ ( a|s ) = pθ ( a|s ) , we can instead interpret the network as directly integrating the LHS of Eq . 4 , which is less efficient and more challenging . Regularization smooths the optimization landscape , yielding more stable improvement and higher asymptotic performance [ 3 ] . Viewing policy networks as a form of direct amortized variational optimizer ( Eq . 10 ) allows us to see that they are similar to “ encoder ” networks in variational autoencoders ( VAEs ) [ 44 , 64 ] . However , there are several drawbacks to direct amortization . Algorithm 1 Direct Amortization Initialize φ for each environment step do λ← fφ ( st ) at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Algorithm 2 Iterative Amortization Initialize φ for each environment step do Initialize λ for each policy optimization iteration do λ← fφ ( st , λ , ∇λJ ) end for at ∼ πφ ( at|st , O ; λ ) st+1 ∼ penv ( st+1|st , at ) end for for each training step do φ← φ+ η∇φJ end for Amortization Gap . Direct amortization results in suboptimal approximate posterior estimates , with the resulting gap in the variational bound referred to as the amortization gap [ 20 ] . Thus , in the RL setting , an amortized policy , πφ , results in worse performance than the optimal policy within the parametric policy class , denoted as π̂ . The amortization gap is the gap in following inequality : J ( πφ , θ ) ≤ J ( π̂ , θ ) . Because J is a variational bound on the RL objective , i.e. , expected return , a looser bound , due to amortization , prevents one from more completely optimizing this objective . This is shown in Figure 1 ( Left ) ,3 where J is plotted over two dimensions of the policy mean at a particular state in the MuJoCo environment Hopper-v2 . The estimate of a direct amortized policy ( ) is suboptimal , far from the optimal estimate ( F ) . While the relative difference in the objective is relatively small , suboptimal estimates prevent sampling and exploring high-value regions of the action-space . That is , suboptimal estimates have only a minor impact on evaluation performance ( see Appendix B.6 ) but hinder effective data collection . Single Estimate . Direct amortization is limited to a single , static estimate . In other words , if there are multiple high-value regions of the action-space , a uni-modal ( e.g. , Gaussian ) direct amortized policy is restricted to only one region , thereby limiting exploration . Note that this is an additional restriction beyond simply considering uni-modal distributions , as a generic optimization procedure may arrive at multiple uni-modal estimates depending on initialization and stochastic sampling ( see Section 3.2 ) . While multi-modal distributions reduce the severity of this restriction [ 74 , 29 ] , the other limitations of direct amortization still persist . Inability to Generalize Across Objectives . Direct amortization is a feedforward procedure , receiving gradients from the objective only after estimation . This is contrast to other forms of optimization , which receive gradients ( feedback ) during estimation . Thus , unlike other optimizers , direct amortization is incapable of generalizing to new objectives , e.g. , if Qπ ( s , a ) or pθ ( a|s ) change , which is a desirable capability for adapting to new tasks or environments . To improve upon this scheme and overcome these drawbacks , in Section 3 , we turn to a technique developed in generative modeling , iterative amortization [ 55 ] , retaining the efficiency of amortization while employing a more flexible iterative estimation procedure .
This paper draws an interesting connection to variational inference, categorizing current policy optimization methods with KL regularization as direct amortized optimizers. The paper shows how direct amortized policy optimization can be suboptimal and proposes a new class of method called iterative amortized policy optimization. This ‘iterative’ amortized policy optimization performs iterative optimization before the regular optimization step, offering several advantages: better at reaching the optima, better at sampling multiple modes, and support more rapidly changing policy. The paper shows nice visualization to support these claims and also run benchmark experiments to show its improvement.
SP:cf5222ed98e5d552771fb915beeee4d504b947fe
Dream and Search to Control: Latent Space Planning for Continuous Control
1 INTRODUCTION . Deep reinforcement learning ( RL ) has been effective at solving sequential decision-making problems with varying levels of difficulty . The solutions generally fall into one of two categories : model-free and model-based methods . Model-free methods ( Haarnoja et al. , 2018 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Schulman et al. , 2017 ) directly learn a policy or action-values . However , they are usually considered to be sample-inefficient . Model-based methods ( Lee et al. , 2019 ; Gregor et al. , 2019 ; Zhang et al. , 2018 ; Ha & Schmidhuber , 2018 ) learn the environment ’ s dynamics . Common model-based approaches involve sampling trajectories from the learned dynamics to train using RL or applying a planning algorithm directly on the learned dynamics ( Ha & Schmidhuber , 2018 ; Hafner et al. , 2019a ; b ) . However , learning multi-step dynamics in the raw observation space is challenging . This is primarily because it involves the reconstruction of high-dimensional features ( e.g. , pixels ) in order to roll-out trajectories , which is an error-prone process . Instead , recent work has focused on learning latent space models ( Hafner et al. , 2019a ; b ) . This has been shown to improve robustness and sample efficiency by eliminating the need for high-dimensional reconstruction during inference . Learning on latent dynamics : Once the dynamics have been learned , a classic approach is to sample trajectories from it to learn a policy using RL . This approach is usually motivated by sample efficiency . Dreamer ( Hafner et al. , 2019a ) took this approach and demonstrated state-of-the-art performance on continuous control by performing gradient-based RL on learned latent dynamics . Another approach is to perform a look-ahead search - where the dynamics are used for a multi-step rollout to determine an optimal action . This could be accompanied by a value estimate and/or a policy that produces state-action mappings to narrow the search space or reduce the search ’ s depth . MuZero ( Schrittwieser et al. , 2019 ) took this approach and applied tree-based search on latent dynamics - however , it was restricted to discrete action spaces only . The role of look-ahead search using learned latent dynamics has not been explored sufficiently for continuous action spaces . Our contribution : In this paper , we extend the idea of performing look-ahead search using learned latent dynamics to continuous action spaces . Our high level approach is shown in Fig 1 . We build on top of Dreamer and modify how actions are sampled during online planning . Instead of sampling actions from the current policy , we search over a set of actions sampled from a mix of distributions . For our search mechanism , we implement MCTS but also investigate a simple rollout algorithm that trades off performance for compute complexity . We observed that look-ahead search results in optimal actions early on . This , in turn , leads to faster convergence of model estimates and of optimal policies . However , these benefits come at the cost of computational time since deeper and iterative look-ahead search takes more time . 2 RELATED WORK . Model-Based RL involves learning a dynamical model and utilizing it to sample trajectories to train a policy or performing look-ahead search for policy improvement . World Model ( Ha & Schmidhuber , 2018 ) learns a latent representation of observations and learns a dynamical model over this latent representation . It then utilizes the learned model to optimize a linear controller via evolution . The latent representations help to plan in a low dimensional abstract space . PlaNet ( Hafner et al. , 2019b ) does end-to-end training of the latent observation encoding and dynamics and does online planning using CEM . Dreamer , the current state-of-the-art , ( Hafner et al. , 2019a ) builds on top of PlaNet and uses analytic gradients to efficiently learn long-horizon behaviors for visual control purely by latent imagination . We built our work on top of Dreamer . Planning using look-ahead search : Given a dynamics model , one can search over its state-action space to determine an optimal action . If one has a perfect model but a sub-optimal action-value function , then in fact , a deeper look-ahead search will usually yield better policies . This look-ahead search could be done both during online decision making and during policy improvement . AlphaGo ( Silver et al. , 2017 ; Lowrey et al. , 2018 ) combined MCTS with a value estimator to plan and explore with known ground-truth dynamics . MuZero ( Schrittwieser et al. , 2019 ) learned a latent dynamic model and performed MCTS over it . They conditioned the latent representation on value and multistep reward prediction rather than observation reconstruction . These works are limited to discrete action space due to large action space in continuous action space tasks . A variation on MCTS is Progressive Widening ( Coulom , 2006 ; Chaslot et al. , 2008 ; Couëtoux et al. , 2011 ) where the the child-actions of a node are expanded based on its visitation count . This has been exploited in continuous action spaces by adding sampled actions from a proposal distribution to create a discrete set of child-actions . AOC ( Moerland et al. , 2018 ) utilized this approach to apply MCTS in continuous action spaces over true dynamics.However , they showed their results only for the Pendulum-v0 task in OpenAI Gym . A common thread across all these prior works is the availability of known ground-truth dynamics . Another approach that can be used to reduce the size of the look-ahead search space is to utilize hierarchical optimistic optimization ( HOO ) , which splits the action space and gradually increases the resolution of actions ( Mansley et al. , 2011 ; Bubeck et al. , 2009 ) . 3 DREAMER : LEARNING LATENT DYNAMICS AND POLICY . MBRL approaches usually involve collecting data from the environment , dynamics learning , and behavior learning by utilizing data collected from environment-agent interaction and/or trajectories generated via learned dynamics . We adopt Dreamer ’ s dynamics and behavior learning approach . And , unlike Dreamer , we perform decision-time planning via look-ahead search during exploration to determine an action , instead of just using learned behavior policy . In this section , we review Dreamer ’ s dynamics learning component in subsection ( 3.1 ) and the behavior learning component in subsection ( 3.2 ) . After that , we describe our investigation of look-ahead search for decision-time planning in section ( 4 ) . 3.1 DYNAMICS LEARNING . This comprises of a representation model that encodes the history of observations and actions to create a Markovian belief of the current state . This belief state and an action are consumed by a transition model that predicts the model ’ s future latent state . The transition model is conditioned on an observation model and a reward model . The observation model predicts the observation corresponding to the current latent state and the reward model predicts the corresponding reward . The observation model is used only to condition the transition model and does not play a role during inference . These models are summarized n Eq . ( 1 ) where ( st , at , ot , rt ) represent latent state , action , observation , and reward at discrete-time step t. Representation model : pθ ( st|st−1 , at−1 , ot ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) Transition model : qθ ( st|st−1 , at−1 ) . ( 1 ) The transition model is implemented as a recurrent state-space model ( RSSM ) ( Hafner et al. , 2019b ) . The representation , observation model and reward model are dense networks . Observation features are given to the representation model , which are reconstructed by the observation model . This is unlike Dreamer which trains the model over raw pixels . The combined parameter vector θ in Eq . 1 is updated by stochastic backpropagation ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . It optimizes θ using a joint reconstruction loss ( JREC ) comprising of an observation reconstruction loss ( JO ) , a reward reconstruction loss ( JR ) and a KL regularizer ( JD ) , as described in Eq . ( 2 ) . JREC . = Ep ( ∑ t ( J tO + J tR + J tD ) ) + const J tO . = ln q ( ot|st ) J tR . = ln q ( rt|st ) J tD . = −βKL ( p ( st|st−1 , at−1 , ot ) || ( st|st−1 , at−1 ) ) . ( 2 ) 3.2 BEHAVIOR LEARNING . Given a transition dynamics , the action and value models are learnt from the imagined trajectories { sτ , aτ , rτ } t+Hτ=t of finite-horizon ( H ) over latent state space . Dreamer utilizes these trajectories for learning behaviour via an actor-critic approach . The action model implements the policy and aims to predict actions that solve the imagination environment . The value model estimates the expected imagined rewards that the action model achieves from each state sτ , where τ is the discrete-time index during imagination . Action model : aτ ∼ qφ ( aτ |sτ ) Value model : vψ ( sτ ) ≈ Eq ( ·|sτ ) ∑t+H τ=t γ τ−trτ . ( 3 ) As in Eq . ( 3 ) , action and value models are implemented as dense neural network with parameters φ and ψ , respectively . As shown in Eq . 4 , the action model outputs a tanh-transformed Gaussian ( Haarnoja et al. , 2018 ) . This allows for re-parameterized sampling ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) that views sampled actions as deterministically dependent on the neural network output , allowing Dreamer to backpropagate analytic gradients through the sampling operation . aτ = tanh ( µφ ( sτ ) + σφ ( sτ ) ) , ∼ Normal ( 0 , I ) . ( 4 ) Dreamer uses Vλ ( Eq . 8 ) ( Sutton & Barto , 2018 ) , an exponentially weighted average of the estimates for different k-step returns for the imagination rollouts . The k varies from 1 . . . H . It helps to balance bias and variance of target for value estimates by acting as an intermediary between the 1-step and the Monte-Carlo return . The objective for the action model qφ ( aτ |sτ ) is to predict actions that result in state trajectories with high value estimates as shown in Eq . 5 . It uses analytic gradients through the learned dynamics to maximize the value estimates . The objective for the value model vψ ( sτ ) , in turn , is to regress the value estimates as shown in Eq . ( 6 ) . Also , Dreamer freezes the world model while learning behaviors . max φ Eqθ , qφ t+H∑ τ=t Vλ ( sτ ) , ( 5 ) min ψ Eqθ , qφ t+H∑ τ=t 1 2 ∥∥∥vψ ( sτ ) −Vλ ( sτ ) ) ∥∥∥2 . ( 6 ) VkN ( sτ ) . = Eqθ , qφ h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) with h = min ( τ + k , t+H ) , ( 7 ) Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1VnN ( sτ ) + λ H−1VHN ( sτ ) , ( 8 )
This paper extends Dreamer, a model-based RL algorithm trained through latent imagination, by additionally performing decision-time planning in the learned latent-space dynamics for action selection. Most of the components follow those of Dreamer: from the experiences collected by the agent, it learns a (latent-space) world model that comprises representation model, observation model, reward model, and transition model, which are trained by minimizing reconstruction loss with a KL regularizer. The value and action models are also trained as same as Dreamer. It computes value estimates for the imagined trajectories and performs gradient ascent using the reparameterized gradient. Still, unlike Dreamer, the proposed method does not work on raw pixels but uses low-dimensional features such as joint positions and velocities. Finally, additional online planning, either a simple rollout or an MCTS, is performed to select an action at each interaction with the environment. Experimental results demonstrate that the proposed shows a better sample efficiency in several domains.
SP:b29c4295d1c4d89280ef2a44d75b5f96e53e70b7
Dream and Search to Control: Latent Space Planning for Continuous Control
1 INTRODUCTION . Deep reinforcement learning ( RL ) has been effective at solving sequential decision-making problems with varying levels of difficulty . The solutions generally fall into one of two categories : model-free and model-based methods . Model-free methods ( Haarnoja et al. , 2018 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Schulman et al. , 2017 ) directly learn a policy or action-values . However , they are usually considered to be sample-inefficient . Model-based methods ( Lee et al. , 2019 ; Gregor et al. , 2019 ; Zhang et al. , 2018 ; Ha & Schmidhuber , 2018 ) learn the environment ’ s dynamics . Common model-based approaches involve sampling trajectories from the learned dynamics to train using RL or applying a planning algorithm directly on the learned dynamics ( Ha & Schmidhuber , 2018 ; Hafner et al. , 2019a ; b ) . However , learning multi-step dynamics in the raw observation space is challenging . This is primarily because it involves the reconstruction of high-dimensional features ( e.g. , pixels ) in order to roll-out trajectories , which is an error-prone process . Instead , recent work has focused on learning latent space models ( Hafner et al. , 2019a ; b ) . This has been shown to improve robustness and sample efficiency by eliminating the need for high-dimensional reconstruction during inference . Learning on latent dynamics : Once the dynamics have been learned , a classic approach is to sample trajectories from it to learn a policy using RL . This approach is usually motivated by sample efficiency . Dreamer ( Hafner et al. , 2019a ) took this approach and demonstrated state-of-the-art performance on continuous control by performing gradient-based RL on learned latent dynamics . Another approach is to perform a look-ahead search - where the dynamics are used for a multi-step rollout to determine an optimal action . This could be accompanied by a value estimate and/or a policy that produces state-action mappings to narrow the search space or reduce the search ’ s depth . MuZero ( Schrittwieser et al. , 2019 ) took this approach and applied tree-based search on latent dynamics - however , it was restricted to discrete action spaces only . The role of look-ahead search using learned latent dynamics has not been explored sufficiently for continuous action spaces . Our contribution : In this paper , we extend the idea of performing look-ahead search using learned latent dynamics to continuous action spaces . Our high level approach is shown in Fig 1 . We build on top of Dreamer and modify how actions are sampled during online planning . Instead of sampling actions from the current policy , we search over a set of actions sampled from a mix of distributions . For our search mechanism , we implement MCTS but also investigate a simple rollout algorithm that trades off performance for compute complexity . We observed that look-ahead search results in optimal actions early on . This , in turn , leads to faster convergence of model estimates and of optimal policies . However , these benefits come at the cost of computational time since deeper and iterative look-ahead search takes more time . 2 RELATED WORK . Model-Based RL involves learning a dynamical model and utilizing it to sample trajectories to train a policy or performing look-ahead search for policy improvement . World Model ( Ha & Schmidhuber , 2018 ) learns a latent representation of observations and learns a dynamical model over this latent representation . It then utilizes the learned model to optimize a linear controller via evolution . The latent representations help to plan in a low dimensional abstract space . PlaNet ( Hafner et al. , 2019b ) does end-to-end training of the latent observation encoding and dynamics and does online planning using CEM . Dreamer , the current state-of-the-art , ( Hafner et al. , 2019a ) builds on top of PlaNet and uses analytic gradients to efficiently learn long-horizon behaviors for visual control purely by latent imagination . We built our work on top of Dreamer . Planning using look-ahead search : Given a dynamics model , one can search over its state-action space to determine an optimal action . If one has a perfect model but a sub-optimal action-value function , then in fact , a deeper look-ahead search will usually yield better policies . This look-ahead search could be done both during online decision making and during policy improvement . AlphaGo ( Silver et al. , 2017 ; Lowrey et al. , 2018 ) combined MCTS with a value estimator to plan and explore with known ground-truth dynamics . MuZero ( Schrittwieser et al. , 2019 ) learned a latent dynamic model and performed MCTS over it . They conditioned the latent representation on value and multistep reward prediction rather than observation reconstruction . These works are limited to discrete action space due to large action space in continuous action space tasks . A variation on MCTS is Progressive Widening ( Coulom , 2006 ; Chaslot et al. , 2008 ; Couëtoux et al. , 2011 ) where the the child-actions of a node are expanded based on its visitation count . This has been exploited in continuous action spaces by adding sampled actions from a proposal distribution to create a discrete set of child-actions . AOC ( Moerland et al. , 2018 ) utilized this approach to apply MCTS in continuous action spaces over true dynamics.However , they showed their results only for the Pendulum-v0 task in OpenAI Gym . A common thread across all these prior works is the availability of known ground-truth dynamics . Another approach that can be used to reduce the size of the look-ahead search space is to utilize hierarchical optimistic optimization ( HOO ) , which splits the action space and gradually increases the resolution of actions ( Mansley et al. , 2011 ; Bubeck et al. , 2009 ) . 3 DREAMER : LEARNING LATENT DYNAMICS AND POLICY . MBRL approaches usually involve collecting data from the environment , dynamics learning , and behavior learning by utilizing data collected from environment-agent interaction and/or trajectories generated via learned dynamics . We adopt Dreamer ’ s dynamics and behavior learning approach . And , unlike Dreamer , we perform decision-time planning via look-ahead search during exploration to determine an action , instead of just using learned behavior policy . In this section , we review Dreamer ’ s dynamics learning component in subsection ( 3.1 ) and the behavior learning component in subsection ( 3.2 ) . After that , we describe our investigation of look-ahead search for decision-time planning in section ( 4 ) . 3.1 DYNAMICS LEARNING . This comprises of a representation model that encodes the history of observations and actions to create a Markovian belief of the current state . This belief state and an action are consumed by a transition model that predicts the model ’ s future latent state . The transition model is conditioned on an observation model and a reward model . The observation model predicts the observation corresponding to the current latent state and the reward model predicts the corresponding reward . The observation model is used only to condition the transition model and does not play a role during inference . These models are summarized n Eq . ( 1 ) where ( st , at , ot , rt ) represent latent state , action , observation , and reward at discrete-time step t. Representation model : pθ ( st|st−1 , at−1 , ot ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) Transition model : qθ ( st|st−1 , at−1 ) . ( 1 ) The transition model is implemented as a recurrent state-space model ( RSSM ) ( Hafner et al. , 2019b ) . The representation , observation model and reward model are dense networks . Observation features are given to the representation model , which are reconstructed by the observation model . This is unlike Dreamer which trains the model over raw pixels . The combined parameter vector θ in Eq . 1 is updated by stochastic backpropagation ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . It optimizes θ using a joint reconstruction loss ( JREC ) comprising of an observation reconstruction loss ( JO ) , a reward reconstruction loss ( JR ) and a KL regularizer ( JD ) , as described in Eq . ( 2 ) . JREC . = Ep ( ∑ t ( J tO + J tR + J tD ) ) + const J tO . = ln q ( ot|st ) J tR . = ln q ( rt|st ) J tD . = −βKL ( p ( st|st−1 , at−1 , ot ) || ( st|st−1 , at−1 ) ) . ( 2 ) 3.2 BEHAVIOR LEARNING . Given a transition dynamics , the action and value models are learnt from the imagined trajectories { sτ , aτ , rτ } t+Hτ=t of finite-horizon ( H ) over latent state space . Dreamer utilizes these trajectories for learning behaviour via an actor-critic approach . The action model implements the policy and aims to predict actions that solve the imagination environment . The value model estimates the expected imagined rewards that the action model achieves from each state sτ , where τ is the discrete-time index during imagination . Action model : aτ ∼ qφ ( aτ |sτ ) Value model : vψ ( sτ ) ≈ Eq ( ·|sτ ) ∑t+H τ=t γ τ−trτ . ( 3 ) As in Eq . ( 3 ) , action and value models are implemented as dense neural network with parameters φ and ψ , respectively . As shown in Eq . 4 , the action model outputs a tanh-transformed Gaussian ( Haarnoja et al. , 2018 ) . This allows for re-parameterized sampling ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) that views sampled actions as deterministically dependent on the neural network output , allowing Dreamer to backpropagate analytic gradients through the sampling operation . aτ = tanh ( µφ ( sτ ) + σφ ( sτ ) ) , ∼ Normal ( 0 , I ) . ( 4 ) Dreamer uses Vλ ( Eq . 8 ) ( Sutton & Barto , 2018 ) , an exponentially weighted average of the estimates for different k-step returns for the imagination rollouts . The k varies from 1 . . . H . It helps to balance bias and variance of target for value estimates by acting as an intermediary between the 1-step and the Monte-Carlo return . The objective for the action model qφ ( aτ |sτ ) is to predict actions that result in state trajectories with high value estimates as shown in Eq . 5 . It uses analytic gradients through the learned dynamics to maximize the value estimates . The objective for the value model vψ ( sτ ) , in turn , is to regress the value estimates as shown in Eq . ( 6 ) . Also , Dreamer freezes the world model while learning behaviors . max φ Eqθ , qφ t+H∑ τ=t Vλ ( sτ ) , ( 5 ) min ψ Eqθ , qφ t+H∑ τ=t 1 2 ∥∥∥vψ ( sτ ) −Vλ ( sτ ) ) ∥∥∥2 . ( 6 ) VkN ( sτ ) . = Eqθ , qφ h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) with h = min ( τ + k , t+H ) , ( 7 ) Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1VnN ( sτ ) + λ H−1VHN ( sτ ) , ( 8 )
The paper is developed on top of the Dreamer architecture, i.e. learning a latent space dynamics based on the image inputs to train policies. The difference is that, instead of using the already trained policy, this paper used MPC or MCTS to sample actions during the exploration phase to reduce the bias. The authors demonstrated that their approach led to overall improved sample efficiency and final policy performance across many MuJoCo benchmark tests.
SP:b29c4295d1c4d89280ef2a44d75b5f96e53e70b7
Dream and Search to Control: Latent Space Planning for Continuous Control
1 INTRODUCTION . Deep reinforcement learning ( RL ) has been effective at solving sequential decision-making problems with varying levels of difficulty . The solutions generally fall into one of two categories : model-free and model-based methods . Model-free methods ( Haarnoja et al. , 2018 ; Silver et al. , 2014 ; Lillicrap et al. , 2015 ; Fujimoto et al. , 2018 ; Schulman et al. , 2017 ) directly learn a policy or action-values . However , they are usually considered to be sample-inefficient . Model-based methods ( Lee et al. , 2019 ; Gregor et al. , 2019 ; Zhang et al. , 2018 ; Ha & Schmidhuber , 2018 ) learn the environment ’ s dynamics . Common model-based approaches involve sampling trajectories from the learned dynamics to train using RL or applying a planning algorithm directly on the learned dynamics ( Ha & Schmidhuber , 2018 ; Hafner et al. , 2019a ; b ) . However , learning multi-step dynamics in the raw observation space is challenging . This is primarily because it involves the reconstruction of high-dimensional features ( e.g. , pixels ) in order to roll-out trajectories , which is an error-prone process . Instead , recent work has focused on learning latent space models ( Hafner et al. , 2019a ; b ) . This has been shown to improve robustness and sample efficiency by eliminating the need for high-dimensional reconstruction during inference . Learning on latent dynamics : Once the dynamics have been learned , a classic approach is to sample trajectories from it to learn a policy using RL . This approach is usually motivated by sample efficiency . Dreamer ( Hafner et al. , 2019a ) took this approach and demonstrated state-of-the-art performance on continuous control by performing gradient-based RL on learned latent dynamics . Another approach is to perform a look-ahead search - where the dynamics are used for a multi-step rollout to determine an optimal action . This could be accompanied by a value estimate and/or a policy that produces state-action mappings to narrow the search space or reduce the search ’ s depth . MuZero ( Schrittwieser et al. , 2019 ) took this approach and applied tree-based search on latent dynamics - however , it was restricted to discrete action spaces only . The role of look-ahead search using learned latent dynamics has not been explored sufficiently for continuous action spaces . Our contribution : In this paper , we extend the idea of performing look-ahead search using learned latent dynamics to continuous action spaces . Our high level approach is shown in Fig 1 . We build on top of Dreamer and modify how actions are sampled during online planning . Instead of sampling actions from the current policy , we search over a set of actions sampled from a mix of distributions . For our search mechanism , we implement MCTS but also investigate a simple rollout algorithm that trades off performance for compute complexity . We observed that look-ahead search results in optimal actions early on . This , in turn , leads to faster convergence of model estimates and of optimal policies . However , these benefits come at the cost of computational time since deeper and iterative look-ahead search takes more time . 2 RELATED WORK . Model-Based RL involves learning a dynamical model and utilizing it to sample trajectories to train a policy or performing look-ahead search for policy improvement . World Model ( Ha & Schmidhuber , 2018 ) learns a latent representation of observations and learns a dynamical model over this latent representation . It then utilizes the learned model to optimize a linear controller via evolution . The latent representations help to plan in a low dimensional abstract space . PlaNet ( Hafner et al. , 2019b ) does end-to-end training of the latent observation encoding and dynamics and does online planning using CEM . Dreamer , the current state-of-the-art , ( Hafner et al. , 2019a ) builds on top of PlaNet and uses analytic gradients to efficiently learn long-horizon behaviors for visual control purely by latent imagination . We built our work on top of Dreamer . Planning using look-ahead search : Given a dynamics model , one can search over its state-action space to determine an optimal action . If one has a perfect model but a sub-optimal action-value function , then in fact , a deeper look-ahead search will usually yield better policies . This look-ahead search could be done both during online decision making and during policy improvement . AlphaGo ( Silver et al. , 2017 ; Lowrey et al. , 2018 ) combined MCTS with a value estimator to plan and explore with known ground-truth dynamics . MuZero ( Schrittwieser et al. , 2019 ) learned a latent dynamic model and performed MCTS over it . They conditioned the latent representation on value and multistep reward prediction rather than observation reconstruction . These works are limited to discrete action space due to large action space in continuous action space tasks . A variation on MCTS is Progressive Widening ( Coulom , 2006 ; Chaslot et al. , 2008 ; Couëtoux et al. , 2011 ) where the the child-actions of a node are expanded based on its visitation count . This has been exploited in continuous action spaces by adding sampled actions from a proposal distribution to create a discrete set of child-actions . AOC ( Moerland et al. , 2018 ) utilized this approach to apply MCTS in continuous action spaces over true dynamics.However , they showed their results only for the Pendulum-v0 task in OpenAI Gym . A common thread across all these prior works is the availability of known ground-truth dynamics . Another approach that can be used to reduce the size of the look-ahead search space is to utilize hierarchical optimistic optimization ( HOO ) , which splits the action space and gradually increases the resolution of actions ( Mansley et al. , 2011 ; Bubeck et al. , 2009 ) . 3 DREAMER : LEARNING LATENT DYNAMICS AND POLICY . MBRL approaches usually involve collecting data from the environment , dynamics learning , and behavior learning by utilizing data collected from environment-agent interaction and/or trajectories generated via learned dynamics . We adopt Dreamer ’ s dynamics and behavior learning approach . And , unlike Dreamer , we perform decision-time planning via look-ahead search during exploration to determine an action , instead of just using learned behavior policy . In this section , we review Dreamer ’ s dynamics learning component in subsection ( 3.1 ) and the behavior learning component in subsection ( 3.2 ) . After that , we describe our investigation of look-ahead search for decision-time planning in section ( 4 ) . 3.1 DYNAMICS LEARNING . This comprises of a representation model that encodes the history of observations and actions to create a Markovian belief of the current state . This belief state and an action are consumed by a transition model that predicts the model ’ s future latent state . The transition model is conditioned on an observation model and a reward model . The observation model predicts the observation corresponding to the current latent state and the reward model predicts the corresponding reward . The observation model is used only to condition the transition model and does not play a role during inference . These models are summarized n Eq . ( 1 ) where ( st , at , ot , rt ) represent latent state , action , observation , and reward at discrete-time step t. Representation model : pθ ( st|st−1 , at−1 , ot ) Observation model : qθ ( ot|st ) Reward model : qθ ( rt|st ) Transition model : qθ ( st|st−1 , at−1 ) . ( 1 ) The transition model is implemented as a recurrent state-space model ( RSSM ) ( Hafner et al. , 2019b ) . The representation , observation model and reward model are dense networks . Observation features are given to the representation model , which are reconstructed by the observation model . This is unlike Dreamer which trains the model over raw pixels . The combined parameter vector θ in Eq . 1 is updated by stochastic backpropagation ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) . It optimizes θ using a joint reconstruction loss ( JREC ) comprising of an observation reconstruction loss ( JO ) , a reward reconstruction loss ( JR ) and a KL regularizer ( JD ) , as described in Eq . ( 2 ) . JREC . = Ep ( ∑ t ( J tO + J tR + J tD ) ) + const J tO . = ln q ( ot|st ) J tR . = ln q ( rt|st ) J tD . = −βKL ( p ( st|st−1 , at−1 , ot ) || ( st|st−1 , at−1 ) ) . ( 2 ) 3.2 BEHAVIOR LEARNING . Given a transition dynamics , the action and value models are learnt from the imagined trajectories { sτ , aτ , rτ } t+Hτ=t of finite-horizon ( H ) over latent state space . Dreamer utilizes these trajectories for learning behaviour via an actor-critic approach . The action model implements the policy and aims to predict actions that solve the imagination environment . The value model estimates the expected imagined rewards that the action model achieves from each state sτ , where τ is the discrete-time index during imagination . Action model : aτ ∼ qφ ( aτ |sτ ) Value model : vψ ( sτ ) ≈ Eq ( ·|sτ ) ∑t+H τ=t γ τ−trτ . ( 3 ) As in Eq . ( 3 ) , action and value models are implemented as dense neural network with parameters φ and ψ , respectively . As shown in Eq . 4 , the action model outputs a tanh-transformed Gaussian ( Haarnoja et al. , 2018 ) . This allows for re-parameterized sampling ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) that views sampled actions as deterministically dependent on the neural network output , allowing Dreamer to backpropagate analytic gradients through the sampling operation . aτ = tanh ( µφ ( sτ ) + σφ ( sτ ) ) , ∼ Normal ( 0 , I ) . ( 4 ) Dreamer uses Vλ ( Eq . 8 ) ( Sutton & Barto , 2018 ) , an exponentially weighted average of the estimates for different k-step returns for the imagination rollouts . The k varies from 1 . . . H . It helps to balance bias and variance of target for value estimates by acting as an intermediary between the 1-step and the Monte-Carlo return . The objective for the action model qφ ( aτ |sτ ) is to predict actions that result in state trajectories with high value estimates as shown in Eq . 5 . It uses analytic gradients through the learned dynamics to maximize the value estimates . The objective for the value model vψ ( sτ ) , in turn , is to regress the value estimates as shown in Eq . ( 6 ) . Also , Dreamer freezes the world model while learning behaviors . max φ Eqθ , qφ t+H∑ τ=t Vλ ( sτ ) , ( 5 ) min ψ Eqθ , qφ t+H∑ τ=t 1 2 ∥∥∥vψ ( sτ ) −Vλ ( sτ ) ) ∥∥∥2 . ( 6 ) VkN ( sτ ) . = Eqθ , qφ h−1∑ n=τ γn−τrn + γ h−τvψ ( sh ) with h = min ( τ + k , t+H ) , ( 7 ) Vλ ( sτ ) . = ( 1− λ ) H−1∑ n=1 λn−1VnN ( sτ ) + λ H−1VHN ( sτ ) , ( 8 )
This paper proposes to integrate planning into Dreamer. The main idea is to apply a planning module on top of Dreamer to improve the quality of action selection. The planning via MCTS is on the learnt latent dynamics and the policy learnt by Dreamer. One of the challenges addressed in the paper is to perform planning on continuous action spaces. The proposed method is evaluated on 20 control tasks from the DeepMind Control suite, and compared against the original Dreamer algorithm, and a baseline planning method that does only rollout simulations.
SP:b29c4295d1c4d89280ef2a44d75b5f96e53e70b7
Safety Aware Reinforcement Learning (SARL)
1 INTRODUCTION . Reinforcement learning ( RL ) algorithms have seen great research advances in recent years , both in theory and in their applications to concrete engineering problems . The application of RL algorithms extends to computer games ( Mnih et al. , 2013 ; Silver et al. , 2017 ) , robotics ( Gu et al. , 2017 ) and recently real-world engineering problems , such as microgrid optimization ( Liu et al. , 2018 ) and hardware design ( Mirhoseini et al. , 2020 ) . As RL agents become increasingly prevalent in complex real-world applications , the notion of safety becomes increasingly important . Thus , safety related research in RL has also seen a significant surge in recent years ( Zhang et al. , 2020 ; Brown et al. , 2020 ; Mell et al. , 2019 ; Cheng et al . ; Rahaman et al . ) . 1.1 SIDE EFFECTS IN REINFORCEMENT LEARNING ENVIRONMENTS . Our work focuses specifically on the problem of side effects , identified as a key topic in the area of safety in AI by Amodei et al . ( 2016 ) . Here , an agent ’ s actions to perform a task in its environment may cause undesired , and sometimes irreversible , changes in the environment . A major issue with measuring and investigating side effects is that it is challenging to define an appropriate sideeffect metric , especially in a general fashion that can apply to many settings . The difficulty of quantifying side effects distinguishes this problem from safe exploration and traditional motion planning approaches that focus primarily on avoiding obstacles or a clearly defined failure state ( Amodei et al. , 2016 ; Zhu et al. , 2020 ) . As such , when learning a task in an unknown environment with complex dynamics , it is challenging to formulate an appropriate environment framework to jointly encapsulate the primary task and side effect problem . Previous work on formulating a more precise definition of side effects includes work by Turner et al . ( 2019 ) on conservative utility preservation and by Krakovna et al . ( 2018 ) on relative reachability . These works investigated more abstract notions of measuring side effects based on an analysis of changes , reversible and irreversible , in the state space itself . While those works have made great progress on advancing towards a greater understanding of side effects , they have generally been limited to simple grid world environments where the RL problem can often be solved in a tabular way and value function estimations are often not prohibitively demanding . Our work focuses on expanding the concept of side effects to more complex environments , generated by the SafeLife suite ( Wainwright and Eckersley , 2020 ) , which provides more complex environment dynamics and tasks that can not be solved in a tabular fashion . Turner et al . ( 2020 ) recently extended their approach to environments in the SafeLife suite , suggesting that attainable utility preservation can be used as an alternative to the SafeLife side metric described in Wainwright and Eckersley ( 2020 ) and Section 2 . The primary differentiating feature of SARL is that it is metric agnostic , for both the reward and side effect measure , making it orthogonal and complimentary to the work by Turner et al . ( 2020 ) . In this paper , we make the following contributions which , to the best of our knowledge , are novel additions to the growing field of research in RL safety : • SARL : a flexible , metric agnostic RL framework that can modulate the actions of a trained RL agent to trade off between task performance and a safety objective . We utilize the distance between the action probability distributions of two policies as a form of regularization during training . • A generalizeable notion of safety that allows us to train a safe agent independent of specific tasks in an environment and port it across multiple complex tasks in that environment . We provide a description of the SafeLife suite in Section 2 , a detailed description of our method in Section 3 , our experiments and results for various environments in Section 4 and Section 5 respectively , as well as a discussion in Section 6 . 2 THE SAFELIFE ENVIRONMENT . The SafeLife suite ( Wainwright and Eckersley , 2020 ) creates complex environments of systems of cellular automata based on a set of rules from Conway ’ s Game of Life ( Gardner , 1970 ) that govern the interactions between , and the state ( alive or dead ) of , different cells : • any dead cell with exactly three living neighbors becomes alive ; • any live cell with less than two or more than three neighbors dies ( as if by under- or overpopulation ) ; and • every other cell retains its prior state . In addition to the basic rules , SafeLife enables the creation of complex , procedurally generated environments through special cells , such as a spawner , that can create new cells and dynamically generated patterns . The agent can generally perform three tasks : navigation , prune and append which are illustrated in Figure 1 taken from Wainwright and Eckersley ( 2020 ) . The flexibility of SafeLife enables the creation of still environments , where the cell patterns do not change over time without agent interference , and dynamic environments , where the cell patterns do change over time without agent interference . The dynamic environments create an additional layer of difficulty , as the agent now needs to learn to distinguish between variations in the environment that are triggered by its own actions versus those that are caused by the dynamic rules independent of its actions . As described in Section 4 , our experiments focus on the prune and append tasks in still and dynamic environments : prune-still , prune-dynamic , append-still , append-dynamic . 2.1 SAFELIFE SIDE EFFECT METRIC . There are two separate side effect metrics that we use in this paper : a training-time side effect metric that can easily be calculated at every frame , and a separate end-of-episode side effect metric used to validate overall agent safety . These metrics are identical to the side effect metrics described in Wainwright and Eckersley ( 2020 ) . The side effect metric used in training is found by comparing any given state to the starting state of that episode . Every cell in the grid that is different from the corresponding cell in the starting state ( excluding differences due to agent movement or goal completion ) is marked as having a side effect of +1 . The total side effect of a state is the sum of side effects of individual cells . The difference in side effects between subsequent states is then to train safe agents as described in Section 3 . At the end of each episode , we perform a separate side effect calculation that is more robust to stochastic and chaotic dynamics observed in SafeLife . We prepare a counterfactual inaction baseline state at time tend , defined as the state that would have been achieved had the agent followed an inaction policy for tend time steps . We then evolve both the primary state and the inaction state for an additional n = 1000 time steps and store the average occupancy of green life cells at each point in the grid , producing two distributions . The total episodic side effect is then given the earth-mover distance between the two distributions using a modified Manhattan distance metric as described in Wainwright and Eckersley ( 2020 ) . The normalized episodic side effect metric , shown in the figures in Section 5 , is defined as the total episodic side effect divided by the number of green cells present at the start of the episode , showing the percentage of structures in each episode that are disrupted . 3 METHOD . 3.1 TRAINING FOR REGULARIZED SAFE RL AGENT . Our method relies on regularizing the loss function of the RL agent with the distance of the task agent , Aθ , from the virtual safe actor , Zψ , as shown in Figure 2 . More formally , the general objective of the task agent Aθ can be expressed as : FA ( θ ) = Lθ + β ∗ Ldist ( Pπθ , Pπψ ) ( 1 ) where β is a regularization hyperparameter , Pπθ represents the probability of taking a given action given by Aθ , and Pπψ represents the probability distribution of taking a given action according to Zψ . As shown in Equation 1 , the actor loss Lθ is regularized by the distance between the actions suggested by the task agent and the virtual safe agent . The gradient of the objective in Equation 1 expressed as the expectation of rewards of task agent actions α taken from a distribution of policies Pπθ is then given by : ∇θFA ( θ ) = ∇θEα∼Pπθ [ L ( θ ) ] + β ∗ ∇θEα∼Pπθ , ζ∼Pπψ [ Ldist ( α , ζ ) ] ( 2 ) where ∇θ is independent from the virtual safe agent actions ζ given that Zψ is only dependent on ψ . This formulation enables training Zψ independently from Aθ , thereby abstracting the notion of safety away from the task . The gradient formulation underscores the importance for a distance metric Ldist that is differentiable to ensure that gradients update the task agent parameters θ from both terms of the augmented loss functions . 3.2 DISTANCE METRICS FOR LOSS REGULARIZATION . The primary objective of the regularization term is to express a notion of distance between a purely reward based action and a purely safety motivated action , thereby penalizing Aθ for taking a purely reward motivated action . We model the regularization term as the distance between probability distributions Pπθ and Pπψ . Given this formulation , previous work ( Nowozin et al. , 2016 ; Arjovsky et al. , 2017 ; Huszár , 2015 ) has provided a number of choices for distance metrics in supervised learning problems with various advantages or shortfalls . One common method of measuring the difference in probability distributions is the KL Divergence , DKL ( p‖q ) = ∫ x p ( x ) log p ( x ) q ( x ) dx , where p and q are probability distributions described by probability density functions . The KL Divergence , however , has some significant disadvantages – the most significant one being that the KL Divergence is unbounded when probability density functions to express the underlying distribution can not be easily described by the model manifold ( Arjovsky et al. , 2017 ) . Furthermore , the KL divergence is not symmetric given that DKL ( p‖q ) 6= DKL ( q‖p ) , and also does not satisfy the triangle inequality . One alternative to the KL Divergence is the Jensen-Shannon distanceDJS ( p‖q ) = 1 2DKL ( p‖m ) + 1 2DKL ( q‖m ) withm = 1 2 ( p+q ) , which is symmetric , satisfies the triangle inequality and is bounded : 0 ≤ DJS ≤ log ( 2 ) . These advantages make DJS a good choice for the SARL algorithm , but as discussed extensively in Arjovsky et al . ( 2017 ) , DJS also has notable disadvantages , the most important being that DJS is not guaranteed to always be continuous and differentiable in low manifold settings . Another alternative to DJS is the Wasserstein Distance . As discussed in Arjovsky et al . ( 2017 ) , the Wasserstein Distance is generally better suited for calculating distances for low-dimensional manifolds compared to DJS and other variants of the KL divergence . In its analytical form the Wasserstein Distance W ( p , q ) = ( infJ∈J ( p , q ) ∫ ‖x − y‖pdJ ( x , y ) ) 1 p , however , is intractable to compute in most cases leading many researchers to establish approximations of the metric . A common way of approximating the Wasserstein Distance is to re-formulate the calculation as an optimal transport problem of moving probability mass from p to q , as shown in Cuturi ( 2013 ) and Pacchiano et al . ( 2019 ) . The dual formulation based on behavior embedding maps of policy characteristics described in Pacchiano et al . ( 2019 ) is particularly applicable for the SARL algorithm , leading us to adapt it as an additional alternative to the Jensen-Shannon Distance . In this formulation , policy characteristics are converted to distributions in a latent space of behavioral embeddings on which the Wasserstein Distance is then computed . For our experiments in Section 4 , we apply both DJS and the dual formulation of the Wasserstein Distance described in Pacchiano et al . ( 2019 ) to compute the distance between Pπθ and Pπψ .
This paper proposes a safety-aware reinforcement learning algorithm that learns to perform tasks with minimal side-effects. The key idea is that a safety policy is learned independent of the task reward. When learning the task, this safety policy is incorporated by minimizing the distance between the task agent and the safety agent. In this way, the paper claims that the safety agent can be generalized to different tasks. The method is tested on SafeLife Suite, and its performance can match task-specific safe learning baselines.
SP:dbb93ea184c9798f5a7ffeeef8fbadf3ebd3eac5
Safety Aware Reinforcement Learning (SARL)
1 INTRODUCTION . Reinforcement learning ( RL ) algorithms have seen great research advances in recent years , both in theory and in their applications to concrete engineering problems . The application of RL algorithms extends to computer games ( Mnih et al. , 2013 ; Silver et al. , 2017 ) , robotics ( Gu et al. , 2017 ) and recently real-world engineering problems , such as microgrid optimization ( Liu et al. , 2018 ) and hardware design ( Mirhoseini et al. , 2020 ) . As RL agents become increasingly prevalent in complex real-world applications , the notion of safety becomes increasingly important . Thus , safety related research in RL has also seen a significant surge in recent years ( Zhang et al. , 2020 ; Brown et al. , 2020 ; Mell et al. , 2019 ; Cheng et al . ; Rahaman et al . ) . 1.1 SIDE EFFECTS IN REINFORCEMENT LEARNING ENVIRONMENTS . Our work focuses specifically on the problem of side effects , identified as a key topic in the area of safety in AI by Amodei et al . ( 2016 ) . Here , an agent ’ s actions to perform a task in its environment may cause undesired , and sometimes irreversible , changes in the environment . A major issue with measuring and investigating side effects is that it is challenging to define an appropriate sideeffect metric , especially in a general fashion that can apply to many settings . The difficulty of quantifying side effects distinguishes this problem from safe exploration and traditional motion planning approaches that focus primarily on avoiding obstacles or a clearly defined failure state ( Amodei et al. , 2016 ; Zhu et al. , 2020 ) . As such , when learning a task in an unknown environment with complex dynamics , it is challenging to formulate an appropriate environment framework to jointly encapsulate the primary task and side effect problem . Previous work on formulating a more precise definition of side effects includes work by Turner et al . ( 2019 ) on conservative utility preservation and by Krakovna et al . ( 2018 ) on relative reachability . These works investigated more abstract notions of measuring side effects based on an analysis of changes , reversible and irreversible , in the state space itself . While those works have made great progress on advancing towards a greater understanding of side effects , they have generally been limited to simple grid world environments where the RL problem can often be solved in a tabular way and value function estimations are often not prohibitively demanding . Our work focuses on expanding the concept of side effects to more complex environments , generated by the SafeLife suite ( Wainwright and Eckersley , 2020 ) , which provides more complex environment dynamics and tasks that can not be solved in a tabular fashion . Turner et al . ( 2020 ) recently extended their approach to environments in the SafeLife suite , suggesting that attainable utility preservation can be used as an alternative to the SafeLife side metric described in Wainwright and Eckersley ( 2020 ) and Section 2 . The primary differentiating feature of SARL is that it is metric agnostic , for both the reward and side effect measure , making it orthogonal and complimentary to the work by Turner et al . ( 2020 ) . In this paper , we make the following contributions which , to the best of our knowledge , are novel additions to the growing field of research in RL safety : • SARL : a flexible , metric agnostic RL framework that can modulate the actions of a trained RL agent to trade off between task performance and a safety objective . We utilize the distance between the action probability distributions of two policies as a form of regularization during training . • A generalizeable notion of safety that allows us to train a safe agent independent of specific tasks in an environment and port it across multiple complex tasks in that environment . We provide a description of the SafeLife suite in Section 2 , a detailed description of our method in Section 3 , our experiments and results for various environments in Section 4 and Section 5 respectively , as well as a discussion in Section 6 . 2 THE SAFELIFE ENVIRONMENT . The SafeLife suite ( Wainwright and Eckersley , 2020 ) creates complex environments of systems of cellular automata based on a set of rules from Conway ’ s Game of Life ( Gardner , 1970 ) that govern the interactions between , and the state ( alive or dead ) of , different cells : • any dead cell with exactly three living neighbors becomes alive ; • any live cell with less than two or more than three neighbors dies ( as if by under- or overpopulation ) ; and • every other cell retains its prior state . In addition to the basic rules , SafeLife enables the creation of complex , procedurally generated environments through special cells , such as a spawner , that can create new cells and dynamically generated patterns . The agent can generally perform three tasks : navigation , prune and append which are illustrated in Figure 1 taken from Wainwright and Eckersley ( 2020 ) . The flexibility of SafeLife enables the creation of still environments , where the cell patterns do not change over time without agent interference , and dynamic environments , where the cell patterns do change over time without agent interference . The dynamic environments create an additional layer of difficulty , as the agent now needs to learn to distinguish between variations in the environment that are triggered by its own actions versus those that are caused by the dynamic rules independent of its actions . As described in Section 4 , our experiments focus on the prune and append tasks in still and dynamic environments : prune-still , prune-dynamic , append-still , append-dynamic . 2.1 SAFELIFE SIDE EFFECT METRIC . There are two separate side effect metrics that we use in this paper : a training-time side effect metric that can easily be calculated at every frame , and a separate end-of-episode side effect metric used to validate overall agent safety . These metrics are identical to the side effect metrics described in Wainwright and Eckersley ( 2020 ) . The side effect metric used in training is found by comparing any given state to the starting state of that episode . Every cell in the grid that is different from the corresponding cell in the starting state ( excluding differences due to agent movement or goal completion ) is marked as having a side effect of +1 . The total side effect of a state is the sum of side effects of individual cells . The difference in side effects between subsequent states is then to train safe agents as described in Section 3 . At the end of each episode , we perform a separate side effect calculation that is more robust to stochastic and chaotic dynamics observed in SafeLife . We prepare a counterfactual inaction baseline state at time tend , defined as the state that would have been achieved had the agent followed an inaction policy for tend time steps . We then evolve both the primary state and the inaction state for an additional n = 1000 time steps and store the average occupancy of green life cells at each point in the grid , producing two distributions . The total episodic side effect is then given the earth-mover distance between the two distributions using a modified Manhattan distance metric as described in Wainwright and Eckersley ( 2020 ) . The normalized episodic side effect metric , shown in the figures in Section 5 , is defined as the total episodic side effect divided by the number of green cells present at the start of the episode , showing the percentage of structures in each episode that are disrupted . 3 METHOD . 3.1 TRAINING FOR REGULARIZED SAFE RL AGENT . Our method relies on regularizing the loss function of the RL agent with the distance of the task agent , Aθ , from the virtual safe actor , Zψ , as shown in Figure 2 . More formally , the general objective of the task agent Aθ can be expressed as : FA ( θ ) = Lθ + β ∗ Ldist ( Pπθ , Pπψ ) ( 1 ) where β is a regularization hyperparameter , Pπθ represents the probability of taking a given action given by Aθ , and Pπψ represents the probability distribution of taking a given action according to Zψ . As shown in Equation 1 , the actor loss Lθ is regularized by the distance between the actions suggested by the task agent and the virtual safe agent . The gradient of the objective in Equation 1 expressed as the expectation of rewards of task agent actions α taken from a distribution of policies Pπθ is then given by : ∇θFA ( θ ) = ∇θEα∼Pπθ [ L ( θ ) ] + β ∗ ∇θEα∼Pπθ , ζ∼Pπψ [ Ldist ( α , ζ ) ] ( 2 ) where ∇θ is independent from the virtual safe agent actions ζ given that Zψ is only dependent on ψ . This formulation enables training Zψ independently from Aθ , thereby abstracting the notion of safety away from the task . The gradient formulation underscores the importance for a distance metric Ldist that is differentiable to ensure that gradients update the task agent parameters θ from both terms of the augmented loss functions . 3.2 DISTANCE METRICS FOR LOSS REGULARIZATION . The primary objective of the regularization term is to express a notion of distance between a purely reward based action and a purely safety motivated action , thereby penalizing Aθ for taking a purely reward motivated action . We model the regularization term as the distance between probability distributions Pπθ and Pπψ . Given this formulation , previous work ( Nowozin et al. , 2016 ; Arjovsky et al. , 2017 ; Huszár , 2015 ) has provided a number of choices for distance metrics in supervised learning problems with various advantages or shortfalls . One common method of measuring the difference in probability distributions is the KL Divergence , DKL ( p‖q ) = ∫ x p ( x ) log p ( x ) q ( x ) dx , where p and q are probability distributions described by probability density functions . The KL Divergence , however , has some significant disadvantages – the most significant one being that the KL Divergence is unbounded when probability density functions to express the underlying distribution can not be easily described by the model manifold ( Arjovsky et al. , 2017 ) . Furthermore , the KL divergence is not symmetric given that DKL ( p‖q ) 6= DKL ( q‖p ) , and also does not satisfy the triangle inequality . One alternative to the KL Divergence is the Jensen-Shannon distanceDJS ( p‖q ) = 1 2DKL ( p‖m ) + 1 2DKL ( q‖m ) withm = 1 2 ( p+q ) , which is symmetric , satisfies the triangle inequality and is bounded : 0 ≤ DJS ≤ log ( 2 ) . These advantages make DJS a good choice for the SARL algorithm , but as discussed extensively in Arjovsky et al . ( 2017 ) , DJS also has notable disadvantages , the most important being that DJS is not guaranteed to always be continuous and differentiable in low manifold settings . Another alternative to DJS is the Wasserstein Distance . As discussed in Arjovsky et al . ( 2017 ) , the Wasserstein Distance is generally better suited for calculating distances for low-dimensional manifolds compared to DJS and other variants of the KL divergence . In its analytical form the Wasserstein Distance W ( p , q ) = ( infJ∈J ( p , q ) ∫ ‖x − y‖pdJ ( x , y ) ) 1 p , however , is intractable to compute in most cases leading many researchers to establish approximations of the metric . A common way of approximating the Wasserstein Distance is to re-formulate the calculation as an optimal transport problem of moving probability mass from p to q , as shown in Cuturi ( 2013 ) and Pacchiano et al . ( 2019 ) . The dual formulation based on behavior embedding maps of policy characteristics described in Pacchiano et al . ( 2019 ) is particularly applicable for the SARL algorithm , leading us to adapt it as an additional alternative to the Jensen-Shannon Distance . In this formulation , policy characteristics are converted to distributions in a latent space of behavioral embeddings on which the Wasserstein Distance is then computed . For our experiments in Section 4 , we apply both DJS and the dual formulation of the Wasserstein Distance described in Pacchiano et al . ( 2019 ) to compute the distance between Pπθ and Pπψ .
The paper aims to reduce the unwanted side effects of the actions of a reward-maximizing reinforcement-learning (RL) agent. The authors study a framework in which the environment issues a metric that measures the total side effects of the agent's actions at the end of each episode. The work's proposed solution trains an agent who focuses on the total reward and another agent who minimizes the total side effects. The authors then empirically investigate the effectiveness of combining the two agents via a distance measure between the policies that unifies them into one.
SP:dbb93ea184c9798f5a7ffeeef8fbadf3ebd3eac5
Safety Aware Reinforcement Learning (SARL)
1 INTRODUCTION . Reinforcement learning ( RL ) algorithms have seen great research advances in recent years , both in theory and in their applications to concrete engineering problems . The application of RL algorithms extends to computer games ( Mnih et al. , 2013 ; Silver et al. , 2017 ) , robotics ( Gu et al. , 2017 ) and recently real-world engineering problems , such as microgrid optimization ( Liu et al. , 2018 ) and hardware design ( Mirhoseini et al. , 2020 ) . As RL agents become increasingly prevalent in complex real-world applications , the notion of safety becomes increasingly important . Thus , safety related research in RL has also seen a significant surge in recent years ( Zhang et al. , 2020 ; Brown et al. , 2020 ; Mell et al. , 2019 ; Cheng et al . ; Rahaman et al . ) . 1.1 SIDE EFFECTS IN REINFORCEMENT LEARNING ENVIRONMENTS . Our work focuses specifically on the problem of side effects , identified as a key topic in the area of safety in AI by Amodei et al . ( 2016 ) . Here , an agent ’ s actions to perform a task in its environment may cause undesired , and sometimes irreversible , changes in the environment . A major issue with measuring and investigating side effects is that it is challenging to define an appropriate sideeffect metric , especially in a general fashion that can apply to many settings . The difficulty of quantifying side effects distinguishes this problem from safe exploration and traditional motion planning approaches that focus primarily on avoiding obstacles or a clearly defined failure state ( Amodei et al. , 2016 ; Zhu et al. , 2020 ) . As such , when learning a task in an unknown environment with complex dynamics , it is challenging to formulate an appropriate environment framework to jointly encapsulate the primary task and side effect problem . Previous work on formulating a more precise definition of side effects includes work by Turner et al . ( 2019 ) on conservative utility preservation and by Krakovna et al . ( 2018 ) on relative reachability . These works investigated more abstract notions of measuring side effects based on an analysis of changes , reversible and irreversible , in the state space itself . While those works have made great progress on advancing towards a greater understanding of side effects , they have generally been limited to simple grid world environments where the RL problem can often be solved in a tabular way and value function estimations are often not prohibitively demanding . Our work focuses on expanding the concept of side effects to more complex environments , generated by the SafeLife suite ( Wainwright and Eckersley , 2020 ) , which provides more complex environment dynamics and tasks that can not be solved in a tabular fashion . Turner et al . ( 2020 ) recently extended their approach to environments in the SafeLife suite , suggesting that attainable utility preservation can be used as an alternative to the SafeLife side metric described in Wainwright and Eckersley ( 2020 ) and Section 2 . The primary differentiating feature of SARL is that it is metric agnostic , for both the reward and side effect measure , making it orthogonal and complimentary to the work by Turner et al . ( 2020 ) . In this paper , we make the following contributions which , to the best of our knowledge , are novel additions to the growing field of research in RL safety : • SARL : a flexible , metric agnostic RL framework that can modulate the actions of a trained RL agent to trade off between task performance and a safety objective . We utilize the distance between the action probability distributions of two policies as a form of regularization during training . • A generalizeable notion of safety that allows us to train a safe agent independent of specific tasks in an environment and port it across multiple complex tasks in that environment . We provide a description of the SafeLife suite in Section 2 , a detailed description of our method in Section 3 , our experiments and results for various environments in Section 4 and Section 5 respectively , as well as a discussion in Section 6 . 2 THE SAFELIFE ENVIRONMENT . The SafeLife suite ( Wainwright and Eckersley , 2020 ) creates complex environments of systems of cellular automata based on a set of rules from Conway ’ s Game of Life ( Gardner , 1970 ) that govern the interactions between , and the state ( alive or dead ) of , different cells : • any dead cell with exactly three living neighbors becomes alive ; • any live cell with less than two or more than three neighbors dies ( as if by under- or overpopulation ) ; and • every other cell retains its prior state . In addition to the basic rules , SafeLife enables the creation of complex , procedurally generated environments through special cells , such as a spawner , that can create new cells and dynamically generated patterns . The agent can generally perform three tasks : navigation , prune and append which are illustrated in Figure 1 taken from Wainwright and Eckersley ( 2020 ) . The flexibility of SafeLife enables the creation of still environments , where the cell patterns do not change over time without agent interference , and dynamic environments , where the cell patterns do change over time without agent interference . The dynamic environments create an additional layer of difficulty , as the agent now needs to learn to distinguish between variations in the environment that are triggered by its own actions versus those that are caused by the dynamic rules independent of its actions . As described in Section 4 , our experiments focus on the prune and append tasks in still and dynamic environments : prune-still , prune-dynamic , append-still , append-dynamic . 2.1 SAFELIFE SIDE EFFECT METRIC . There are two separate side effect metrics that we use in this paper : a training-time side effect metric that can easily be calculated at every frame , and a separate end-of-episode side effect metric used to validate overall agent safety . These metrics are identical to the side effect metrics described in Wainwright and Eckersley ( 2020 ) . The side effect metric used in training is found by comparing any given state to the starting state of that episode . Every cell in the grid that is different from the corresponding cell in the starting state ( excluding differences due to agent movement or goal completion ) is marked as having a side effect of +1 . The total side effect of a state is the sum of side effects of individual cells . The difference in side effects between subsequent states is then to train safe agents as described in Section 3 . At the end of each episode , we perform a separate side effect calculation that is more robust to stochastic and chaotic dynamics observed in SafeLife . We prepare a counterfactual inaction baseline state at time tend , defined as the state that would have been achieved had the agent followed an inaction policy for tend time steps . We then evolve both the primary state and the inaction state for an additional n = 1000 time steps and store the average occupancy of green life cells at each point in the grid , producing two distributions . The total episodic side effect is then given the earth-mover distance between the two distributions using a modified Manhattan distance metric as described in Wainwright and Eckersley ( 2020 ) . The normalized episodic side effect metric , shown in the figures in Section 5 , is defined as the total episodic side effect divided by the number of green cells present at the start of the episode , showing the percentage of structures in each episode that are disrupted . 3 METHOD . 3.1 TRAINING FOR REGULARIZED SAFE RL AGENT . Our method relies on regularizing the loss function of the RL agent with the distance of the task agent , Aθ , from the virtual safe actor , Zψ , as shown in Figure 2 . More formally , the general objective of the task agent Aθ can be expressed as : FA ( θ ) = Lθ + β ∗ Ldist ( Pπθ , Pπψ ) ( 1 ) where β is a regularization hyperparameter , Pπθ represents the probability of taking a given action given by Aθ , and Pπψ represents the probability distribution of taking a given action according to Zψ . As shown in Equation 1 , the actor loss Lθ is regularized by the distance between the actions suggested by the task agent and the virtual safe agent . The gradient of the objective in Equation 1 expressed as the expectation of rewards of task agent actions α taken from a distribution of policies Pπθ is then given by : ∇θFA ( θ ) = ∇θEα∼Pπθ [ L ( θ ) ] + β ∗ ∇θEα∼Pπθ , ζ∼Pπψ [ Ldist ( α , ζ ) ] ( 2 ) where ∇θ is independent from the virtual safe agent actions ζ given that Zψ is only dependent on ψ . This formulation enables training Zψ independently from Aθ , thereby abstracting the notion of safety away from the task . The gradient formulation underscores the importance for a distance metric Ldist that is differentiable to ensure that gradients update the task agent parameters θ from both terms of the augmented loss functions . 3.2 DISTANCE METRICS FOR LOSS REGULARIZATION . The primary objective of the regularization term is to express a notion of distance between a purely reward based action and a purely safety motivated action , thereby penalizing Aθ for taking a purely reward motivated action . We model the regularization term as the distance between probability distributions Pπθ and Pπψ . Given this formulation , previous work ( Nowozin et al. , 2016 ; Arjovsky et al. , 2017 ; Huszár , 2015 ) has provided a number of choices for distance metrics in supervised learning problems with various advantages or shortfalls . One common method of measuring the difference in probability distributions is the KL Divergence , DKL ( p‖q ) = ∫ x p ( x ) log p ( x ) q ( x ) dx , where p and q are probability distributions described by probability density functions . The KL Divergence , however , has some significant disadvantages – the most significant one being that the KL Divergence is unbounded when probability density functions to express the underlying distribution can not be easily described by the model manifold ( Arjovsky et al. , 2017 ) . Furthermore , the KL divergence is not symmetric given that DKL ( p‖q ) 6= DKL ( q‖p ) , and also does not satisfy the triangle inequality . One alternative to the KL Divergence is the Jensen-Shannon distanceDJS ( p‖q ) = 1 2DKL ( p‖m ) + 1 2DKL ( q‖m ) withm = 1 2 ( p+q ) , which is symmetric , satisfies the triangle inequality and is bounded : 0 ≤ DJS ≤ log ( 2 ) . These advantages make DJS a good choice for the SARL algorithm , but as discussed extensively in Arjovsky et al . ( 2017 ) , DJS also has notable disadvantages , the most important being that DJS is not guaranteed to always be continuous and differentiable in low manifold settings . Another alternative to DJS is the Wasserstein Distance . As discussed in Arjovsky et al . ( 2017 ) , the Wasserstein Distance is generally better suited for calculating distances for low-dimensional manifolds compared to DJS and other variants of the KL divergence . In its analytical form the Wasserstein Distance W ( p , q ) = ( infJ∈J ( p , q ) ∫ ‖x − y‖pdJ ( x , y ) ) 1 p , however , is intractable to compute in most cases leading many researchers to establish approximations of the metric . A common way of approximating the Wasserstein Distance is to re-formulate the calculation as an optimal transport problem of moving probability mass from p to q , as shown in Cuturi ( 2013 ) and Pacchiano et al . ( 2019 ) . The dual formulation based on behavior embedding maps of policy characteristics described in Pacchiano et al . ( 2019 ) is particularly applicable for the SARL algorithm , leading us to adapt it as an additional alternative to the Jensen-Shannon Distance . In this formulation , policy characteristics are converted to distributions in a latent space of behavioral embeddings on which the Wasserstein Distance is then computed . For our experiments in Section 4 , we apply both DJS and the dual formulation of the Wasserstein Distance described in Pacchiano et al . ( 2019 ) to compute the distance between Pπθ and Pπψ .
This paper aims to address the issue of mitigating side effects in policy learning. The authors propose an algorithm SARL, which uses a safe policy to define a regularization term for penalizing the agent's actions deviating from the safe agent in policy learning. In the experiments, four variations for SARL are shown and compared with a baseline method based on reward penalty. The proposed algorithm is competitive across the experiments presented in the paper.
SP:dbb93ea184c9798f5a7ffeeef8fbadf3ebd3eac5
ResNet After All: Neural ODEs and Their Numerical Solution
1 INTRODUCTION . The choice of neural network architecture is an important consideration in the deep learning community . Among a plethora of options , Residual Neural Networks ( ResNets ) ( He et al. , 2016 ) have emerged as an important subclass of models , as they mitigate the gradient issues ( Balduzzi et al. , 2017 ) arising with training deep neural networks by adding skip connections between the successive layers . Besides the architectural advancements inspired from the original scheme ( Zagoruyko & Komodakis , 2016 ; Xie et al. , 2017 ) , recently Neural Ordinary Differential Equation ( Neural ODE ) models ( Chen et al. , 2018 ; E , 2017 ; Lu et al. , 2018 ; Haber & Ruthotto , 2017 ) have been proposed as an analog of continuous-depth ResNets . While Neural ODEs do not necessarily improve upon the sheer predictive performance of ResNets , they offer the vast knowledge of ODE theory to be applied to deep learning research . For instance , the authors in Yan et al . ( 2020 ) discovered that for specific perturbations , Neural ODEs are more robust than convolutional neural networks . Moreover , inspired by the theoretical properties of the solution curves , they propose a regularizer which improved the robustness of Neural ODE models even further . However , if Neural ODEs are chosen for their theoretical advantages , it is essential that the effective model—the combination of ODE problem and its solution via a particular numerical method—is a close approximation of the true analytical , but practically inaccessible ODE solution . Code : https : //github.com/boschresearch/numerics_independent_neural_odes In this work , we study the empirical risk minimization ( ERM ) problem LD = 1 |D| ∑ ( x , y ) ∈D l ( f ( x ; w ) , y ) ( 1 ) where D = { ( xn , yn ) | xn ∈ RDx , yn ∈ RDy , n = 1 , . . . , N } is a set of training data , l : RDy × RDy → R is a ( non-negative ) loss function and f is a Neural ODE model with weights w , i.e. , f = fd ◦ ϕfvT ◦ fu ( 2 ) where fx , x ∈ { d , v , u } are neural networks and u and d denote the upstream and downstream layers respectively . ϕ is defined to be the ( analytical ) flow of the dynamical system dz dt = fv ( z ; wv ) , z ( t ) = ϕ fv t ( z ( 0 ) ) . ( 3 ) As the vector field fv of the dynamical system is itself defined by a neural network , evaluating ϕ fv T is intractable and we have to resort to a numerical scheme Ψt to compute ϕt . Ψ belongs either to a class of fixed step methods or is an adaptive step size solver as proposed in Chen et al . ( 2018 ) . For fixed step solvers with step size h one can directly compute the number of steps taken by the solver # steps = Th−1 . We set the final time T = 1 for all our experiments . The global numerical error etrain of the model is the difference between the true , ( unknown ) , analytical solution of the model and the numerical solution etrain = ||ϕT ( z ( 0 ) ) −ΨT ( z ( 0 ) ) || at time T . The global numerical error for a given problem can be controlled by adjusting either the step size or the local error tolerance . Since the numerical solvers play an essential role in the approximation of the solutions of an ODE , it is intuitive to ask : how does the choice of the numerical method affect the training of a Neural ODE model ? Specifically , does the discretization of the numerical solver impact the resulting flow of the ODE ? To test the effect of the numerical solver on a Neural ODE model , we first train a Neural ODE on a synthetic classification task consisting of three concentric spheres , where the outer and inner sphere correspond to the same class ( for more information see Section 2.4 ) . For this problem there are no true underlying dynamics and therefore , the model only has to find some dynamics which solve the problem . We train the Neural ODE model using a fixed step solver with a small step size and a solver with a large step size ( see Figure 1 ( a ) and ( b ) respectively ) . If the model is trained with a large step size , then the numerically computed trajectories for the individual Initial Value Problems ( IVPs ) cross in phase space ( see Figure 1 ( b ) ) . Specifically , we observe that trajectories of IVPs belonging to different classes cross . This crossing behavior contradicts the expected behavior of autonomous ODE solutions , as according to the Picard-Lindelöf theorem we expect unique solutions to the IVPs . We observe crossing trajectories because the discretization error of the solver is so large that the resulting numerical solutions no longer maintain the properties of ODE solutions . We observe that both , the model trained with the small step size and the model trained with the large step size , achieve very high accuracy . This leads us to the conclusion that the step size parameter is not like any other hyperparameter , as its chosen value often does not affect the performance of the model . Instead , the step size affects whether the trained model has a valid ODE interpretation . Crossing trajectories are not bad per se if the performance is all we are interested . If , however , we are interested in applying algorithms whose success is motivated from ODE theory to , for example , increase model robustness ( Yan et al. , 2020 ) , then the trajectories must not cross . We argue that if any discretization with similar or lesser discretization error yields the same prediction , the trained model corresponds to an ODE that is qualitatively well approximated by the applied discretization . Therefore , in our experiments we evaluate each Neural ODE model with smaller and larger step sizes than the training step size . We notice that the model trained with the small step size achieves the same level of performance when using a solver with smaller discretization error for testing ( Figure 1 ( c ) ) . For the model trained with the large step size , we observe a significant drop in performance if the model is evaluated using a solver with a smaller discretization error ( see Figure 1 ( d ) ) . The reason for the drop in model performance is that the decision boundary of the classifier has adapted to the global numerical error etrain in the computed solution . For this specific example , correct classification relies on crossing trajectories as a feature . Therefore , the solutions of solvers with a smaller discretization error are no longer assigned the right class by the classifier and the Neural ODE model is a ResNet model without ODE interpretation . If we are interested in extending ODE theory to Neural ODE models , we have to ensure that the trained Neural ODE model indeed maintains the properties of ODE solutions . In this work we show that the training process of a Neural ODE yields a discrete ResNet without valid ODE interpretation if the discretization is chosen too coarse . With our rigorous Neural ODE experiments on a synthetic dataset as well as CIFAR10 using both fixed step and adaptive step size methods , we show that if the precision of the solver used for training is high enough , the model does not depend on the solver used for testing as long as the test solver has a small enough discretization error . Therefore , such a model allows for a valid ODE interpretation . Based on this observation we propose an algorithm to find the coarsest discretization for which the model is independent of the solver . 2 INTERACTION OF NEURAL ODE AND ODE SOLVER CAN LEAD TO DISCRETE DYNAMICS . We want to study how the Neural ODE is affected by the specific solver configuration used for training . To this end , in our experiments we first train each model with a specific step size htrain ( or a specific tolerance toltrain in the case of adaptive step size methods ) . For the remainder of this section we will only consider fixed step solvers , but all points made equally hold for adaptive step methods , as shown by our experiments . Post-training , we evaluate the trained models using different step sizes htest and note how using smaller steps sizes htest < htrain affects the model performance . We expect that if the model yields good performance in the limiting behavior using smaller and smaller step sizes htest → 0 for testing , then model should correspond to a valid ODE . For a model trained with a small step size , we find that the numerical solutions do not change drastically if the testing step size htest is decreased ( see Figure 1 ( c ) ) . But if the step size htrain is beyond a critical value , the model accumulates a large global numerical error etrain . The decision layer may use these drastically altered solutions as a signal/feature in the downstream computations . In this case , the model is tied to a specific , discrete flow and the model remains no longer valid in the limit of using smaller and smaller step sizes htest → 0 . 2.1 THE TRAJECTORY CROSSING PROBLEM . In this sub-section , we examine the trajectory crossing effect which causes the ODE interpretation to break down . First , we look at the numerically computed trajectories in phase space of a Neural ODE model trained with a very large step size of htrain = 1/2 ( see Figure 1 ( b ) ) . A key observation is that the trajectories cross in phase space . This crossing happens because the step size htrain is much bigger than the length scale at which the vector field changes , thus missing “ the curvature ” of the true solution . Specifically , we observe that the model exploits this trajectory crossing behavior as a feature to separate observations from different classes . This is a clear indication that these trajectories do not approximate the true analytical solution of an ODE , as according to the Picard-Lindelöf theorem ( Hairer et al. , 1993 , § 1.8 ) , solutions of first order autonomous ODEs do not cross in phase space . Since the numerical solutions using smaller step sizes htest < htrain no longer maintain the crossing trajectory feature , the classifier can not separate the data with the learned vector field ( see Figure 2 ) . 2.2 LADY WINDERMERE ’ S FAN . In cases where trajectory crossings do not occur , other , more subtle effects can also lead to a drop in performance in the limit of using smaller and smaller test step sizes htest → 0 . The compound effect of local numerical error leads to a biased global error which is sometimes exploited as a feature in downstream blocks . This effect how the local error gets accumulated into global error was coined as Lady Windermere ’ s Fan in Hairer et al . ( 1993 , § 1.7 ) . To understand these effects we introduce an example based on the XOR problem D = { ( ( 0 , 0 ) 7→ 0 ) , ( ( 1 , 1 ) 7→ 0 ) , ( ( 0 , 1 ) 7→ 1 ) , ( ( 1 , 0 ) 7→ 1 ) } . This dataset can not be classified correctly in 2D with a linear decision boundary ( Goodfellow et al. , 2016 , § 1.2 ) . Therefore , we consider the ODE z′ ( t ) = ( α 1 −γ||z||δ β ) z . ( 4 ) The qualitative behavior of the analytical flow are increasing ellipsoids with ever increasing rotational speed . We chose this problem as an example based on the knowledge that the precision of a solver influences how the rotational speed of the ellipsoids is resolved . Therefore , this problem is useful in illustrating how the numerical accuracy of the solver can affect the final solution . Fig . 3 depicts the numerical solution of this flow with one set of fixed parameters and different step sizes h = 10−2.5 , 10−3.5 . For both step sizes we do not observe crossing trajectories , but the final solutions differ greatly . For h = 10−2.5 the numerical flow produces a transformation in which the data points can be separated linearly . But for the smaller step size of h = 10−3.5 , the numerical solution is no longer linearly separable . The problem here is that the numerical solution using the larger step size is not accurate enough to resolve the rotational velocity . For each step the local error gets accumulated into the global error . In Figure 3 ( a ) , the accumulation of error in the numerical solution results in a valid feature for a linear decision ( classification ) layer . The reason for this is that the global numerical errors etrain are biased . We define as the fingerprint of the method the structure in the global numerical error . The decision layer then adapts to this method specific fingerprint . How this fingerprint affects the performance of the model when using smaller step size htest is dependent on two aspects . First , does the data remain separable when using smaller step sizes htest < htrain ? If not , we will observe a significant drop in performance . Second , how sensitive is the decision layer to changes in the solutions and how much do the numerical solutions change when decreasing the test step size htest → 0 ? Essentially , the input sensitivity of the downstream layer should be less than the output sensitivity of htest < htrain . For the decision layer , there should exist a sensitivity threshold d such that fd ( z ( T ) + δ ) = fd ( z ( T ) ) ∀||δ|| < d. Thus , if two solvers compute the same solution up to δ , the classifier identifies these solutions as the same class and the result of the model is not affected by the interchanging these solvers .
The authors show that Neural ODEs exploit the ODE-solver used for training to realize a dynamical system that violates the ODE vector field property of non-overlapping trajectories. The authors conclude that NODEs are not real ODEs, hence the paper's title "ResNet after all.". To avoid such behavior, the authors propose to monitor the accuracy metrics using a finer ODE solver and decrease the solver's step size if a discrepancy between the two different stepsize accuracies is observed.
SP:5404aa9f7dfb70080947d9629768cb39a25b84ed
ResNet After All: Neural ODEs and Their Numerical Solution
1 INTRODUCTION . The choice of neural network architecture is an important consideration in the deep learning community . Among a plethora of options , Residual Neural Networks ( ResNets ) ( He et al. , 2016 ) have emerged as an important subclass of models , as they mitigate the gradient issues ( Balduzzi et al. , 2017 ) arising with training deep neural networks by adding skip connections between the successive layers . Besides the architectural advancements inspired from the original scheme ( Zagoruyko & Komodakis , 2016 ; Xie et al. , 2017 ) , recently Neural Ordinary Differential Equation ( Neural ODE ) models ( Chen et al. , 2018 ; E , 2017 ; Lu et al. , 2018 ; Haber & Ruthotto , 2017 ) have been proposed as an analog of continuous-depth ResNets . While Neural ODEs do not necessarily improve upon the sheer predictive performance of ResNets , they offer the vast knowledge of ODE theory to be applied to deep learning research . For instance , the authors in Yan et al . ( 2020 ) discovered that for specific perturbations , Neural ODEs are more robust than convolutional neural networks . Moreover , inspired by the theoretical properties of the solution curves , they propose a regularizer which improved the robustness of Neural ODE models even further . However , if Neural ODEs are chosen for their theoretical advantages , it is essential that the effective model—the combination of ODE problem and its solution via a particular numerical method—is a close approximation of the true analytical , but practically inaccessible ODE solution . Code : https : //github.com/boschresearch/numerics_independent_neural_odes In this work , we study the empirical risk minimization ( ERM ) problem LD = 1 |D| ∑ ( x , y ) ∈D l ( f ( x ; w ) , y ) ( 1 ) where D = { ( xn , yn ) | xn ∈ RDx , yn ∈ RDy , n = 1 , . . . , N } is a set of training data , l : RDy × RDy → R is a ( non-negative ) loss function and f is a Neural ODE model with weights w , i.e. , f = fd ◦ ϕfvT ◦ fu ( 2 ) where fx , x ∈ { d , v , u } are neural networks and u and d denote the upstream and downstream layers respectively . ϕ is defined to be the ( analytical ) flow of the dynamical system dz dt = fv ( z ; wv ) , z ( t ) = ϕ fv t ( z ( 0 ) ) . ( 3 ) As the vector field fv of the dynamical system is itself defined by a neural network , evaluating ϕ fv T is intractable and we have to resort to a numerical scheme Ψt to compute ϕt . Ψ belongs either to a class of fixed step methods or is an adaptive step size solver as proposed in Chen et al . ( 2018 ) . For fixed step solvers with step size h one can directly compute the number of steps taken by the solver # steps = Th−1 . We set the final time T = 1 for all our experiments . The global numerical error etrain of the model is the difference between the true , ( unknown ) , analytical solution of the model and the numerical solution etrain = ||ϕT ( z ( 0 ) ) −ΨT ( z ( 0 ) ) || at time T . The global numerical error for a given problem can be controlled by adjusting either the step size or the local error tolerance . Since the numerical solvers play an essential role in the approximation of the solutions of an ODE , it is intuitive to ask : how does the choice of the numerical method affect the training of a Neural ODE model ? Specifically , does the discretization of the numerical solver impact the resulting flow of the ODE ? To test the effect of the numerical solver on a Neural ODE model , we first train a Neural ODE on a synthetic classification task consisting of three concentric spheres , where the outer and inner sphere correspond to the same class ( for more information see Section 2.4 ) . For this problem there are no true underlying dynamics and therefore , the model only has to find some dynamics which solve the problem . We train the Neural ODE model using a fixed step solver with a small step size and a solver with a large step size ( see Figure 1 ( a ) and ( b ) respectively ) . If the model is trained with a large step size , then the numerically computed trajectories for the individual Initial Value Problems ( IVPs ) cross in phase space ( see Figure 1 ( b ) ) . Specifically , we observe that trajectories of IVPs belonging to different classes cross . This crossing behavior contradicts the expected behavior of autonomous ODE solutions , as according to the Picard-Lindelöf theorem we expect unique solutions to the IVPs . We observe crossing trajectories because the discretization error of the solver is so large that the resulting numerical solutions no longer maintain the properties of ODE solutions . We observe that both , the model trained with the small step size and the model trained with the large step size , achieve very high accuracy . This leads us to the conclusion that the step size parameter is not like any other hyperparameter , as its chosen value often does not affect the performance of the model . Instead , the step size affects whether the trained model has a valid ODE interpretation . Crossing trajectories are not bad per se if the performance is all we are interested . If , however , we are interested in applying algorithms whose success is motivated from ODE theory to , for example , increase model robustness ( Yan et al. , 2020 ) , then the trajectories must not cross . We argue that if any discretization with similar or lesser discretization error yields the same prediction , the trained model corresponds to an ODE that is qualitatively well approximated by the applied discretization . Therefore , in our experiments we evaluate each Neural ODE model with smaller and larger step sizes than the training step size . We notice that the model trained with the small step size achieves the same level of performance when using a solver with smaller discretization error for testing ( Figure 1 ( c ) ) . For the model trained with the large step size , we observe a significant drop in performance if the model is evaluated using a solver with a smaller discretization error ( see Figure 1 ( d ) ) . The reason for the drop in model performance is that the decision boundary of the classifier has adapted to the global numerical error etrain in the computed solution . For this specific example , correct classification relies on crossing trajectories as a feature . Therefore , the solutions of solvers with a smaller discretization error are no longer assigned the right class by the classifier and the Neural ODE model is a ResNet model without ODE interpretation . If we are interested in extending ODE theory to Neural ODE models , we have to ensure that the trained Neural ODE model indeed maintains the properties of ODE solutions . In this work we show that the training process of a Neural ODE yields a discrete ResNet without valid ODE interpretation if the discretization is chosen too coarse . With our rigorous Neural ODE experiments on a synthetic dataset as well as CIFAR10 using both fixed step and adaptive step size methods , we show that if the precision of the solver used for training is high enough , the model does not depend on the solver used for testing as long as the test solver has a small enough discretization error . Therefore , such a model allows for a valid ODE interpretation . Based on this observation we propose an algorithm to find the coarsest discretization for which the model is independent of the solver . 2 INTERACTION OF NEURAL ODE AND ODE SOLVER CAN LEAD TO DISCRETE DYNAMICS . We want to study how the Neural ODE is affected by the specific solver configuration used for training . To this end , in our experiments we first train each model with a specific step size htrain ( or a specific tolerance toltrain in the case of adaptive step size methods ) . For the remainder of this section we will only consider fixed step solvers , but all points made equally hold for adaptive step methods , as shown by our experiments . Post-training , we evaluate the trained models using different step sizes htest and note how using smaller steps sizes htest < htrain affects the model performance . We expect that if the model yields good performance in the limiting behavior using smaller and smaller step sizes htest → 0 for testing , then model should correspond to a valid ODE . For a model trained with a small step size , we find that the numerical solutions do not change drastically if the testing step size htest is decreased ( see Figure 1 ( c ) ) . But if the step size htrain is beyond a critical value , the model accumulates a large global numerical error etrain . The decision layer may use these drastically altered solutions as a signal/feature in the downstream computations . In this case , the model is tied to a specific , discrete flow and the model remains no longer valid in the limit of using smaller and smaller step sizes htest → 0 . 2.1 THE TRAJECTORY CROSSING PROBLEM . In this sub-section , we examine the trajectory crossing effect which causes the ODE interpretation to break down . First , we look at the numerically computed trajectories in phase space of a Neural ODE model trained with a very large step size of htrain = 1/2 ( see Figure 1 ( b ) ) . A key observation is that the trajectories cross in phase space . This crossing happens because the step size htrain is much bigger than the length scale at which the vector field changes , thus missing “ the curvature ” of the true solution . Specifically , we observe that the model exploits this trajectory crossing behavior as a feature to separate observations from different classes . This is a clear indication that these trajectories do not approximate the true analytical solution of an ODE , as according to the Picard-Lindelöf theorem ( Hairer et al. , 1993 , § 1.8 ) , solutions of first order autonomous ODEs do not cross in phase space . Since the numerical solutions using smaller step sizes htest < htrain no longer maintain the crossing trajectory feature , the classifier can not separate the data with the learned vector field ( see Figure 2 ) . 2.2 LADY WINDERMERE ’ S FAN . In cases where trajectory crossings do not occur , other , more subtle effects can also lead to a drop in performance in the limit of using smaller and smaller test step sizes htest → 0 . The compound effect of local numerical error leads to a biased global error which is sometimes exploited as a feature in downstream blocks . This effect how the local error gets accumulated into global error was coined as Lady Windermere ’ s Fan in Hairer et al . ( 1993 , § 1.7 ) . To understand these effects we introduce an example based on the XOR problem D = { ( ( 0 , 0 ) 7→ 0 ) , ( ( 1 , 1 ) 7→ 0 ) , ( ( 0 , 1 ) 7→ 1 ) , ( ( 1 , 0 ) 7→ 1 ) } . This dataset can not be classified correctly in 2D with a linear decision boundary ( Goodfellow et al. , 2016 , § 1.2 ) . Therefore , we consider the ODE z′ ( t ) = ( α 1 −γ||z||δ β ) z . ( 4 ) The qualitative behavior of the analytical flow are increasing ellipsoids with ever increasing rotational speed . We chose this problem as an example based on the knowledge that the precision of a solver influences how the rotational speed of the ellipsoids is resolved . Therefore , this problem is useful in illustrating how the numerical accuracy of the solver can affect the final solution . Fig . 3 depicts the numerical solution of this flow with one set of fixed parameters and different step sizes h = 10−2.5 , 10−3.5 . For both step sizes we do not observe crossing trajectories , but the final solutions differ greatly . For h = 10−2.5 the numerical flow produces a transformation in which the data points can be separated linearly . But for the smaller step size of h = 10−3.5 , the numerical solution is no longer linearly separable . The problem here is that the numerical solution using the larger step size is not accurate enough to resolve the rotational velocity . For each step the local error gets accumulated into the global error . In Figure 3 ( a ) , the accumulation of error in the numerical solution results in a valid feature for a linear decision ( classification ) layer . The reason for this is that the global numerical errors etrain are biased . We define as the fingerprint of the method the structure in the global numerical error . The decision layer then adapts to this method specific fingerprint . How this fingerprint affects the performance of the model when using smaller step size htest is dependent on two aspects . First , does the data remain separable when using smaller step sizes htest < htrain ? If not , we will observe a significant drop in performance . Second , how sensitive is the decision layer to changes in the solutions and how much do the numerical solutions change when decreasing the test step size htest → 0 ? Essentially , the input sensitivity of the downstream layer should be less than the output sensitivity of htest < htrain . For the decision layer , there should exist a sensitivity threshold d such that fd ( z ( T ) + δ ) = fd ( z ( T ) ) ∀||δ|| < d. Thus , if two solvers compute the same solution up to δ , the classifier identifies these solutions as the same class and the result of the model is not affected by the interchanging these solvers .
This paper empirically studies whether Neural ODEs have a valid ODE interpretation. The authors show that a Neural ODE model does not necessarily represent a continuous dynamical system if the discretization of the numerical method is too coarse. Indeed, this is a widely overlooked issue that has been largely ignored in the Neural ODE community. To address this issue, the authors propose a novel adaptive step size scheme.
SP:5404aa9f7dfb70080947d9629768cb39a25b84ed
ResNet After All: Neural ODEs and Their Numerical Solution
1 INTRODUCTION . The choice of neural network architecture is an important consideration in the deep learning community . Among a plethora of options , Residual Neural Networks ( ResNets ) ( He et al. , 2016 ) have emerged as an important subclass of models , as they mitigate the gradient issues ( Balduzzi et al. , 2017 ) arising with training deep neural networks by adding skip connections between the successive layers . Besides the architectural advancements inspired from the original scheme ( Zagoruyko & Komodakis , 2016 ; Xie et al. , 2017 ) , recently Neural Ordinary Differential Equation ( Neural ODE ) models ( Chen et al. , 2018 ; E , 2017 ; Lu et al. , 2018 ; Haber & Ruthotto , 2017 ) have been proposed as an analog of continuous-depth ResNets . While Neural ODEs do not necessarily improve upon the sheer predictive performance of ResNets , they offer the vast knowledge of ODE theory to be applied to deep learning research . For instance , the authors in Yan et al . ( 2020 ) discovered that for specific perturbations , Neural ODEs are more robust than convolutional neural networks . Moreover , inspired by the theoretical properties of the solution curves , they propose a regularizer which improved the robustness of Neural ODE models even further . However , if Neural ODEs are chosen for their theoretical advantages , it is essential that the effective model—the combination of ODE problem and its solution via a particular numerical method—is a close approximation of the true analytical , but practically inaccessible ODE solution . Code : https : //github.com/boschresearch/numerics_independent_neural_odes In this work , we study the empirical risk minimization ( ERM ) problem LD = 1 |D| ∑ ( x , y ) ∈D l ( f ( x ; w ) , y ) ( 1 ) where D = { ( xn , yn ) | xn ∈ RDx , yn ∈ RDy , n = 1 , . . . , N } is a set of training data , l : RDy × RDy → R is a ( non-negative ) loss function and f is a Neural ODE model with weights w , i.e. , f = fd ◦ ϕfvT ◦ fu ( 2 ) where fx , x ∈ { d , v , u } are neural networks and u and d denote the upstream and downstream layers respectively . ϕ is defined to be the ( analytical ) flow of the dynamical system dz dt = fv ( z ; wv ) , z ( t ) = ϕ fv t ( z ( 0 ) ) . ( 3 ) As the vector field fv of the dynamical system is itself defined by a neural network , evaluating ϕ fv T is intractable and we have to resort to a numerical scheme Ψt to compute ϕt . Ψ belongs either to a class of fixed step methods or is an adaptive step size solver as proposed in Chen et al . ( 2018 ) . For fixed step solvers with step size h one can directly compute the number of steps taken by the solver # steps = Th−1 . We set the final time T = 1 for all our experiments . The global numerical error etrain of the model is the difference between the true , ( unknown ) , analytical solution of the model and the numerical solution etrain = ||ϕT ( z ( 0 ) ) −ΨT ( z ( 0 ) ) || at time T . The global numerical error for a given problem can be controlled by adjusting either the step size or the local error tolerance . Since the numerical solvers play an essential role in the approximation of the solutions of an ODE , it is intuitive to ask : how does the choice of the numerical method affect the training of a Neural ODE model ? Specifically , does the discretization of the numerical solver impact the resulting flow of the ODE ? To test the effect of the numerical solver on a Neural ODE model , we first train a Neural ODE on a synthetic classification task consisting of three concentric spheres , where the outer and inner sphere correspond to the same class ( for more information see Section 2.4 ) . For this problem there are no true underlying dynamics and therefore , the model only has to find some dynamics which solve the problem . We train the Neural ODE model using a fixed step solver with a small step size and a solver with a large step size ( see Figure 1 ( a ) and ( b ) respectively ) . If the model is trained with a large step size , then the numerically computed trajectories for the individual Initial Value Problems ( IVPs ) cross in phase space ( see Figure 1 ( b ) ) . Specifically , we observe that trajectories of IVPs belonging to different classes cross . This crossing behavior contradicts the expected behavior of autonomous ODE solutions , as according to the Picard-Lindelöf theorem we expect unique solutions to the IVPs . We observe crossing trajectories because the discretization error of the solver is so large that the resulting numerical solutions no longer maintain the properties of ODE solutions . We observe that both , the model trained with the small step size and the model trained with the large step size , achieve very high accuracy . This leads us to the conclusion that the step size parameter is not like any other hyperparameter , as its chosen value often does not affect the performance of the model . Instead , the step size affects whether the trained model has a valid ODE interpretation . Crossing trajectories are not bad per se if the performance is all we are interested . If , however , we are interested in applying algorithms whose success is motivated from ODE theory to , for example , increase model robustness ( Yan et al. , 2020 ) , then the trajectories must not cross . We argue that if any discretization with similar or lesser discretization error yields the same prediction , the trained model corresponds to an ODE that is qualitatively well approximated by the applied discretization . Therefore , in our experiments we evaluate each Neural ODE model with smaller and larger step sizes than the training step size . We notice that the model trained with the small step size achieves the same level of performance when using a solver with smaller discretization error for testing ( Figure 1 ( c ) ) . For the model trained with the large step size , we observe a significant drop in performance if the model is evaluated using a solver with a smaller discretization error ( see Figure 1 ( d ) ) . The reason for the drop in model performance is that the decision boundary of the classifier has adapted to the global numerical error etrain in the computed solution . For this specific example , correct classification relies on crossing trajectories as a feature . Therefore , the solutions of solvers with a smaller discretization error are no longer assigned the right class by the classifier and the Neural ODE model is a ResNet model without ODE interpretation . If we are interested in extending ODE theory to Neural ODE models , we have to ensure that the trained Neural ODE model indeed maintains the properties of ODE solutions . In this work we show that the training process of a Neural ODE yields a discrete ResNet without valid ODE interpretation if the discretization is chosen too coarse . With our rigorous Neural ODE experiments on a synthetic dataset as well as CIFAR10 using both fixed step and adaptive step size methods , we show that if the precision of the solver used for training is high enough , the model does not depend on the solver used for testing as long as the test solver has a small enough discretization error . Therefore , such a model allows for a valid ODE interpretation . Based on this observation we propose an algorithm to find the coarsest discretization for which the model is independent of the solver . 2 INTERACTION OF NEURAL ODE AND ODE SOLVER CAN LEAD TO DISCRETE DYNAMICS . We want to study how the Neural ODE is affected by the specific solver configuration used for training . To this end , in our experiments we first train each model with a specific step size htrain ( or a specific tolerance toltrain in the case of adaptive step size methods ) . For the remainder of this section we will only consider fixed step solvers , but all points made equally hold for adaptive step methods , as shown by our experiments . Post-training , we evaluate the trained models using different step sizes htest and note how using smaller steps sizes htest < htrain affects the model performance . We expect that if the model yields good performance in the limiting behavior using smaller and smaller step sizes htest → 0 for testing , then model should correspond to a valid ODE . For a model trained with a small step size , we find that the numerical solutions do not change drastically if the testing step size htest is decreased ( see Figure 1 ( c ) ) . But if the step size htrain is beyond a critical value , the model accumulates a large global numerical error etrain . The decision layer may use these drastically altered solutions as a signal/feature in the downstream computations . In this case , the model is tied to a specific , discrete flow and the model remains no longer valid in the limit of using smaller and smaller step sizes htest → 0 . 2.1 THE TRAJECTORY CROSSING PROBLEM . In this sub-section , we examine the trajectory crossing effect which causes the ODE interpretation to break down . First , we look at the numerically computed trajectories in phase space of a Neural ODE model trained with a very large step size of htrain = 1/2 ( see Figure 1 ( b ) ) . A key observation is that the trajectories cross in phase space . This crossing happens because the step size htrain is much bigger than the length scale at which the vector field changes , thus missing “ the curvature ” of the true solution . Specifically , we observe that the model exploits this trajectory crossing behavior as a feature to separate observations from different classes . This is a clear indication that these trajectories do not approximate the true analytical solution of an ODE , as according to the Picard-Lindelöf theorem ( Hairer et al. , 1993 , § 1.8 ) , solutions of first order autonomous ODEs do not cross in phase space . Since the numerical solutions using smaller step sizes htest < htrain no longer maintain the crossing trajectory feature , the classifier can not separate the data with the learned vector field ( see Figure 2 ) . 2.2 LADY WINDERMERE ’ S FAN . In cases where trajectory crossings do not occur , other , more subtle effects can also lead to a drop in performance in the limit of using smaller and smaller test step sizes htest → 0 . The compound effect of local numerical error leads to a biased global error which is sometimes exploited as a feature in downstream blocks . This effect how the local error gets accumulated into global error was coined as Lady Windermere ’ s Fan in Hairer et al . ( 1993 , § 1.7 ) . To understand these effects we introduce an example based on the XOR problem D = { ( ( 0 , 0 ) 7→ 0 ) , ( ( 1 , 1 ) 7→ 0 ) , ( ( 0 , 1 ) 7→ 1 ) , ( ( 1 , 0 ) 7→ 1 ) } . This dataset can not be classified correctly in 2D with a linear decision boundary ( Goodfellow et al. , 2016 , § 1.2 ) . Therefore , we consider the ODE z′ ( t ) = ( α 1 −γ||z||δ β ) z . ( 4 ) The qualitative behavior of the analytical flow are increasing ellipsoids with ever increasing rotational speed . We chose this problem as an example based on the knowledge that the precision of a solver influences how the rotational speed of the ellipsoids is resolved . Therefore , this problem is useful in illustrating how the numerical accuracy of the solver can affect the final solution . Fig . 3 depicts the numerical solution of this flow with one set of fixed parameters and different step sizes h = 10−2.5 , 10−3.5 . For both step sizes we do not observe crossing trajectories , but the final solutions differ greatly . For h = 10−2.5 the numerical flow produces a transformation in which the data points can be separated linearly . But for the smaller step size of h = 10−3.5 , the numerical solution is no longer linearly separable . The problem here is that the numerical solution using the larger step size is not accurate enough to resolve the rotational velocity . For each step the local error gets accumulated into the global error . In Figure 3 ( a ) , the accumulation of error in the numerical solution results in a valid feature for a linear decision ( classification ) layer . The reason for this is that the global numerical errors etrain are biased . We define as the fingerprint of the method the structure in the global numerical error . The decision layer then adapts to this method specific fingerprint . How this fingerprint affects the performance of the model when using smaller step size htest is dependent on two aspects . First , does the data remain separable when using smaller step sizes htest < htrain ? If not , we will observe a significant drop in performance . Second , how sensitive is the decision layer to changes in the solutions and how much do the numerical solutions change when decreasing the test step size htest → 0 ? Essentially , the input sensitivity of the downstream layer should be less than the output sensitivity of htest < htrain . For the decision layer , there should exist a sensitivity threshold d such that fd ( z ( T ) + δ ) = fd ( z ( T ) ) ∀||δ|| < d. Thus , if two solvers compute the same solution up to δ , the classifier identifies these solutions as the same class and the result of the model is not affected by the interchanging these solvers .
The paper demonstrates how neural ODE models generating features for downstream tasks (or simply modelling trajectories) may rely on the discreteness of integration methods to generate features and thus fail in the exact ODE limit of integration step-size going to zero. The paper highlights particular failure modes, such as the discreteness of integration methods allowing for qualitative differences like overlapping trajectories (impossible for the exact solution of an autonomous ODE) compared to exact solutions, or quantitative differences like the accumulated error of a numerically integrated ODE resulting in useful features for downstream tasks. The paper empirically demonstrates the phenomenon that low training losses can be achieved for a range of integration methods and integration step-sizes, but that, of these models, the ones robust to changes in integration method and decreases in integration step-sizes at test time are those trained below a certain (empirically determined) integration step-size threshold. This is attributable to models trained with lower integration step-sizes maintaining features that are qualitatively the same as or quantitatively close to those features produced by the same model with smaller integration step-sizes. The paper proposes an algorithm for adapting integration step-size during training so that the resulting neural ODE model is robust to changes in integration method and integration step-size at test time. The algorithm is empirically demonstrated to achieve the same performance as grid search (for similar numbers of function evaluations).
SP:5404aa9f7dfb70080947d9629768cb39a25b84ed
Self-supervised Visual Reinforcement Learning with Object-centric Representations
1 INTRODUCTION . Reinforcement learning ( RL ) includes a promising class of algorithms that have shown capability to solve challenging tasks when those tasks are well specified by suitable reward functions . However , in the real world , people are rarely given a well-defined reward function . Indeed , humans are excellent at setting their own abstract goals and achieving them . Agents that exist persistently in the world should likewise prepare themselves to solve diverse tasks by first constructing plausible goal spaces , setting their own goals within these spaces , and then trying to achieve them . In this way , they can learn about the world around them . In principle , the goal space for an autonomous agent could be any arbitrary function of the state space . However , when the state space is high-dimensional and unstructured , such as only images , it is desirable to have goal spaces which allow efficient exploration and learning , where the factors of variation in the environment are well disentangled . Recently , unsupervised representation learning has been proposed to learn such goal spaces ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ) . All existing methods in this context use variational autoencoders ( VAEs ) to map observations into a low-dimensional latent space that can later be used for sampling goals and reward shaping . However , for complex compositional scenes consisting of multiple objects , the inductive bias of VAEs could be harmful . In contrast , representing perceptual observations in terms of entities has been shown to improve data efficiency and transfer performance on a wide range of tasks ( Burgess et al. , 2019 ) . Recent research has proposed a range of methods for unsupervised scene and video decomposition ( Greff et al. , 2017 ; Kosiorek et al. , 2018 ; Burgess et al. , 2019 ; Greff et al. , 2019 ; Jiang et al. , 2019 ; Weis et al. , 2020 ; Locatello et al. , 2020 ) . These methods learn object representations and scene decomposition jointly . The majority of them are in part motivated by the fact that the learned representations are useful for downstream tasks such as image classification , object detection , or semantic segmentation . In this work , we show that such learned representations are also beneficial for autonomous control and reinforcement learning . ∗equal contribution We propose to combine these object-centric unsupervised representation methods that represent the scene as a set of potentially structured vectors with goal-conditional visual RL . In our method ( illustrated in Figure 1 ) , dubbed SMORL ( for self-supervised multi-object RL ) , a representation of raw sensory inputs is learned by a compositional latent variable model based on the SCALOR architecture ( Jiang et al. , 2019 ) . We show that using object-centric representations simplifies the goal space learning . Autonomous agents can use those representations to learn how to achieve different goals with a reward function that utilizes the structure of the learned goal space . Our main contributions are as follows : • We show that structured object-centric representations learned with generative world models can significantly improve the performance of the self-supervised visual RL agent . • We develop SMORL , an algorithm that uses learned representations to autonomously discover and learn useful skills in compositional environments with several objects using only images as inputs . • We show that even with fully disentangled ground-truth representation there is a large benefit from using SMORL in environments with complex compositional tasks such as rearranging many objects . 2 RELATED WORK . Our work lies in the intersection of several actively evolving topics : visual reinforcement learning for control and robotics , and self-supervised learning . Vision-based RL for robotics is able to efficiently learn a variety of behaviors such as grasping , pushing and navigation ( Levine et al. , 2016 ; Pathak et al. , 2018 ; Levine et al. , 2018 ; Kalashnikov et al. , 2018 ) using only images and rewards as input signals . Self-supervised learning is a form of unsupervised learning where the data provides the supervision . It was successfully used to learn powerful representations for downstream tasks in natural language processing ( Devlin et al. , 2018 ; Radford et al. , 2019 ) and computer vision ( He et al. , 2019 ; Chen et al. , 2020 ) . In the context of RL , self-supervision refers to the agent constructing its own reward signal and using it to solve self-proposed goals ( Baranes & Oudeyer , 2013 ; Nair et al. , 2018 ; Péré et al. , 2018 ; Hausman et al. , 2018 ; Lynch et al. , 2019 ) . This is especially relevant for visual RL , where a reward signal is usually not naturally available . These methods can potentially acquire a diverse repertoire of general-purpose robotic skills that can be reused and combined during test time . Such self-supervised approaches are crucial for scaling learning from narrow single-task learning to more general agents that explore the environment on their own to prepare for solving many different tasks in the future . Next , we will cover the two most related lines of research in more detail . Self-supervised visual RL ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ; Ghosh et al. , 2019 ; WardeFarley et al. , 2019 ; Laversanne-Finot et al. , 2018 ) tackles multi-task RL problems from images without any external reward signal . However , all previous methods assume that the environment observation can be encoded into a single vector , e.g . using VAE representations . With multiple objects being present , this assumption may result in object encodings overlapping in the representation , which is known as the binding problem ( Greff et al. , 2016 ; 2020 ) . In addition , as the reward is also constructed based on this vector , the agent is incentivized to solve tasks that are incompatible , for instance simultaneously moving all objects to goal positions . In contrast , we suggest to learn object-centric representations and use them for reward shaping . This way , the agent can learn to solve tasks independently and then combine these skills during evaluation . Learning object-centric representations in RL ( Watters et al. , 2019 ; van Steenkiste et al. , 2019 ; Veerapaneni et al. , 2020 ; Kipf et al. , 2020 ) has been suggested to approach tasks with combinatorial and compositional elements such as the manipulation of multiple objects . However , the previous work has assumed a fixed , single task and a given reward signal , whereas we are using the learned object-representations to construct a reward signal that helps to learn useful skills that can be used to solve multiple tasks . In addition , these methods use scene-mixture models such as MONET ( Burgess et al. , 2019 ) and IODINE ( Greff et al. , 2019 ) , which do not explicitly contain features like position and scale . These features can be used by the agent for more efficient sampling from the goal space and thus the explicit modeling of these features helps to create additional biases useful for manipulation tasks . However , we expect that other object-centric representations could also be successfully applied as suitable representations for RL tasks . 3 BACKGROUND . Our method combines goal-conditional RL with unsupervised object-oriented representation learning for multi-object environments . Before we describe each technique in detail , we briefly state some RL preliminaries . We consider a Markov decision process defined by ( S , A , p , r ) , where S and A are the continuous state and action spaces , p : S × S ×A 7→ [ 0 , ∞ ) is an unknown probability density representing the probability of transitioning to state st+1 ∈ S from state st ∈ S given action at ∈ A , and r : S 7→ R is a function computing the reward for reaching state st+1 . The agent ’ s objective is to maximize the expected return R = ∑T t=1 Est∼ρπ , at∼π , st+1∼p [ r ( st+1 ) ] over the horizon T , where ρπ ( st ) is the state marginal distribution induced by the agent ’ s policy π ( at|st ) . 3.1 GOAL-CONDITIONAL REINFORCEMENT LEARNING . In the standard RL setting described before , the agent only learns to solve a single task , specified by the reward function . If we are interested in an agent that can solve multiple tasks ( each with a different reward function ) in an environment , we can train the agent on those tasks by telling the agent which distinct task to solve at each time step . But how can we describe a task to the agent ? A simple , yet not too restrictive way is to let each task correspond to an environment state the agent has to reach , denoted as the goal state g. The task is then given to the agent by conditioning its policy π ( at | st , g ) on the goal g , and the agent ’ s objective turns to maximize the expected goal-conditional return : Eg∼G [ T∑ t=1 Est∼ρπ , at∼π , st+1∼p [ rg ( st+1 ) ] ] ( 1 ) whereG is some distribution over the space of goals G ⊆ S the agent receives for training . The reward function can , for example , be the negative distance of the current state to the goal : rg ( s ) = −‖s−g‖ . Often , we are only interested in reaching a partial state configuration , e.g . moving an object to a target position , and want to avoid using the full environment state as the goal . In this case , we have to provide a mapping m : S 7→ G of states to the desired goal space ; the mapping is then used to compute the reward function , i.e . rg ( s ) = −‖m ( s ) − g‖ . As the reward is computed within the goal space , it is clear that the choice of goal space plays a crucial role in determining the difficulty of the learning task . If the goal space is low-dimensional and structured , e.g . in terms of ground truth positions of objects , rewards provide a meaningful signal towards reaching goals . However , if we only have access to high-dimensional , unstructured observations , e.g . camera images , and we naively choose this space as the goal space , optimization becomes hard as there is little correspondence between the reward and the distance of the underlying world states ( Nair et al. , 2018 ) . One option to deal with such difficult observation spaces is to learn a goal space in which the RL task becomes easier . For instance , we can try to find a low-dimensional latent space Z and use it both as the input space to our policy and the space in which we specify goals . If the environment is composed of independent parts that we intend to control separately , intuitively , learning to control is easiest if the latent space is also structured in terms of those independent components . Previous research ( Nair et al. , 2018 ; Pong et al. , 2020 ) relied on the disentangling properties of representation learning models such as the β-VAE ( Higgins et al. , 2017 ) for this purpose . However , these models become insufficient when faced with multi-object scenarios due to the increasing combinatorial complexity of the scene , as we show in Sec . 5.2 and in App . A.2 . Instead , we use a model explicitly geared towards inferring object-structured representations , which we introduce in the next section .
The paper combines an existing generative world model (SCALOR, Jiang et al. 2019) with goal-conditioned attention policy. The method is evaluated on object manipulation environments based on MuJoCo (Todorov et al., 2012), Multiworld (Nair et al. 2018) and a Sawyer arm. The paper is clearly written; the authors discuss challenges and motivate their design choices well throughout the paper.
SP:37b8cd02d6c638f0f2e6687c614ae86c0a7bc250
Self-supervised Visual Reinforcement Learning with Object-centric Representations
1 INTRODUCTION . Reinforcement learning ( RL ) includes a promising class of algorithms that have shown capability to solve challenging tasks when those tasks are well specified by suitable reward functions . However , in the real world , people are rarely given a well-defined reward function . Indeed , humans are excellent at setting their own abstract goals and achieving them . Agents that exist persistently in the world should likewise prepare themselves to solve diverse tasks by first constructing plausible goal spaces , setting their own goals within these spaces , and then trying to achieve them . In this way , they can learn about the world around them . In principle , the goal space for an autonomous agent could be any arbitrary function of the state space . However , when the state space is high-dimensional and unstructured , such as only images , it is desirable to have goal spaces which allow efficient exploration and learning , where the factors of variation in the environment are well disentangled . Recently , unsupervised representation learning has been proposed to learn such goal spaces ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ) . All existing methods in this context use variational autoencoders ( VAEs ) to map observations into a low-dimensional latent space that can later be used for sampling goals and reward shaping . However , for complex compositional scenes consisting of multiple objects , the inductive bias of VAEs could be harmful . In contrast , representing perceptual observations in terms of entities has been shown to improve data efficiency and transfer performance on a wide range of tasks ( Burgess et al. , 2019 ) . Recent research has proposed a range of methods for unsupervised scene and video decomposition ( Greff et al. , 2017 ; Kosiorek et al. , 2018 ; Burgess et al. , 2019 ; Greff et al. , 2019 ; Jiang et al. , 2019 ; Weis et al. , 2020 ; Locatello et al. , 2020 ) . These methods learn object representations and scene decomposition jointly . The majority of them are in part motivated by the fact that the learned representations are useful for downstream tasks such as image classification , object detection , or semantic segmentation . In this work , we show that such learned representations are also beneficial for autonomous control and reinforcement learning . ∗equal contribution We propose to combine these object-centric unsupervised representation methods that represent the scene as a set of potentially structured vectors with goal-conditional visual RL . In our method ( illustrated in Figure 1 ) , dubbed SMORL ( for self-supervised multi-object RL ) , a representation of raw sensory inputs is learned by a compositional latent variable model based on the SCALOR architecture ( Jiang et al. , 2019 ) . We show that using object-centric representations simplifies the goal space learning . Autonomous agents can use those representations to learn how to achieve different goals with a reward function that utilizes the structure of the learned goal space . Our main contributions are as follows : • We show that structured object-centric representations learned with generative world models can significantly improve the performance of the self-supervised visual RL agent . • We develop SMORL , an algorithm that uses learned representations to autonomously discover and learn useful skills in compositional environments with several objects using only images as inputs . • We show that even with fully disentangled ground-truth representation there is a large benefit from using SMORL in environments with complex compositional tasks such as rearranging many objects . 2 RELATED WORK . Our work lies in the intersection of several actively evolving topics : visual reinforcement learning for control and robotics , and self-supervised learning . Vision-based RL for robotics is able to efficiently learn a variety of behaviors such as grasping , pushing and navigation ( Levine et al. , 2016 ; Pathak et al. , 2018 ; Levine et al. , 2018 ; Kalashnikov et al. , 2018 ) using only images and rewards as input signals . Self-supervised learning is a form of unsupervised learning where the data provides the supervision . It was successfully used to learn powerful representations for downstream tasks in natural language processing ( Devlin et al. , 2018 ; Radford et al. , 2019 ) and computer vision ( He et al. , 2019 ; Chen et al. , 2020 ) . In the context of RL , self-supervision refers to the agent constructing its own reward signal and using it to solve self-proposed goals ( Baranes & Oudeyer , 2013 ; Nair et al. , 2018 ; Péré et al. , 2018 ; Hausman et al. , 2018 ; Lynch et al. , 2019 ) . This is especially relevant for visual RL , where a reward signal is usually not naturally available . These methods can potentially acquire a diverse repertoire of general-purpose robotic skills that can be reused and combined during test time . Such self-supervised approaches are crucial for scaling learning from narrow single-task learning to more general agents that explore the environment on their own to prepare for solving many different tasks in the future . Next , we will cover the two most related lines of research in more detail . Self-supervised visual RL ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ; Ghosh et al. , 2019 ; WardeFarley et al. , 2019 ; Laversanne-Finot et al. , 2018 ) tackles multi-task RL problems from images without any external reward signal . However , all previous methods assume that the environment observation can be encoded into a single vector , e.g . using VAE representations . With multiple objects being present , this assumption may result in object encodings overlapping in the representation , which is known as the binding problem ( Greff et al. , 2016 ; 2020 ) . In addition , as the reward is also constructed based on this vector , the agent is incentivized to solve tasks that are incompatible , for instance simultaneously moving all objects to goal positions . In contrast , we suggest to learn object-centric representations and use them for reward shaping . This way , the agent can learn to solve tasks independently and then combine these skills during evaluation . Learning object-centric representations in RL ( Watters et al. , 2019 ; van Steenkiste et al. , 2019 ; Veerapaneni et al. , 2020 ; Kipf et al. , 2020 ) has been suggested to approach tasks with combinatorial and compositional elements such as the manipulation of multiple objects . However , the previous work has assumed a fixed , single task and a given reward signal , whereas we are using the learned object-representations to construct a reward signal that helps to learn useful skills that can be used to solve multiple tasks . In addition , these methods use scene-mixture models such as MONET ( Burgess et al. , 2019 ) and IODINE ( Greff et al. , 2019 ) , which do not explicitly contain features like position and scale . These features can be used by the agent for more efficient sampling from the goal space and thus the explicit modeling of these features helps to create additional biases useful for manipulation tasks . However , we expect that other object-centric representations could also be successfully applied as suitable representations for RL tasks . 3 BACKGROUND . Our method combines goal-conditional RL with unsupervised object-oriented representation learning for multi-object environments . Before we describe each technique in detail , we briefly state some RL preliminaries . We consider a Markov decision process defined by ( S , A , p , r ) , where S and A are the continuous state and action spaces , p : S × S ×A 7→ [ 0 , ∞ ) is an unknown probability density representing the probability of transitioning to state st+1 ∈ S from state st ∈ S given action at ∈ A , and r : S 7→ R is a function computing the reward for reaching state st+1 . The agent ’ s objective is to maximize the expected return R = ∑T t=1 Est∼ρπ , at∼π , st+1∼p [ r ( st+1 ) ] over the horizon T , where ρπ ( st ) is the state marginal distribution induced by the agent ’ s policy π ( at|st ) . 3.1 GOAL-CONDITIONAL REINFORCEMENT LEARNING . In the standard RL setting described before , the agent only learns to solve a single task , specified by the reward function . If we are interested in an agent that can solve multiple tasks ( each with a different reward function ) in an environment , we can train the agent on those tasks by telling the agent which distinct task to solve at each time step . But how can we describe a task to the agent ? A simple , yet not too restrictive way is to let each task correspond to an environment state the agent has to reach , denoted as the goal state g. The task is then given to the agent by conditioning its policy π ( at | st , g ) on the goal g , and the agent ’ s objective turns to maximize the expected goal-conditional return : Eg∼G [ T∑ t=1 Est∼ρπ , at∼π , st+1∼p [ rg ( st+1 ) ] ] ( 1 ) whereG is some distribution over the space of goals G ⊆ S the agent receives for training . The reward function can , for example , be the negative distance of the current state to the goal : rg ( s ) = −‖s−g‖ . Often , we are only interested in reaching a partial state configuration , e.g . moving an object to a target position , and want to avoid using the full environment state as the goal . In this case , we have to provide a mapping m : S 7→ G of states to the desired goal space ; the mapping is then used to compute the reward function , i.e . rg ( s ) = −‖m ( s ) − g‖ . As the reward is computed within the goal space , it is clear that the choice of goal space plays a crucial role in determining the difficulty of the learning task . If the goal space is low-dimensional and structured , e.g . in terms of ground truth positions of objects , rewards provide a meaningful signal towards reaching goals . However , if we only have access to high-dimensional , unstructured observations , e.g . camera images , and we naively choose this space as the goal space , optimization becomes hard as there is little correspondence between the reward and the distance of the underlying world states ( Nair et al. , 2018 ) . One option to deal with such difficult observation spaces is to learn a goal space in which the RL task becomes easier . For instance , we can try to find a low-dimensional latent space Z and use it both as the input space to our policy and the space in which we specify goals . If the environment is composed of independent parts that we intend to control separately , intuitively , learning to control is easiest if the latent space is also structured in terms of those independent components . Previous research ( Nair et al. , 2018 ; Pong et al. , 2020 ) relied on the disentangling properties of representation learning models such as the β-VAE ( Higgins et al. , 2017 ) for this purpose . However , these models become insufficient when faced with multi-object scenarios due to the increasing combinatorial complexity of the scene , as we show in Sec . 5.2 and in App . A.2 . Instead , we use a model explicitly geared towards inferring object-structured representations , which we introduce in the next section .
This work proposes to use object-centric unsupervised representation learning for self-supervised goal-conditioned RL, as opposed to prior work that assumes no particular structure on the learned representations (eg. VAEs). The proposed method, self-supervised multi-object RL (SMORL), uses the SCALOR architecture from prior work, then modifies the policy representation with single-object attention and also the reward function in RL with imagined goals (RIG). The results show that the method can learn simulated pushing and rearranging tasks in a self-supervised way with up to 4 objects in the scene, and outperforms RIG and Skew-Fit on pushing tasks. The proposed method is sufficiently novel, explores an important direction for self-supervised learning, and the results are quite strong.
SP:37b8cd02d6c638f0f2e6687c614ae86c0a7bc250
Self-supervised Visual Reinforcement Learning with Object-centric Representations
1 INTRODUCTION . Reinforcement learning ( RL ) includes a promising class of algorithms that have shown capability to solve challenging tasks when those tasks are well specified by suitable reward functions . However , in the real world , people are rarely given a well-defined reward function . Indeed , humans are excellent at setting their own abstract goals and achieving them . Agents that exist persistently in the world should likewise prepare themselves to solve diverse tasks by first constructing plausible goal spaces , setting their own goals within these spaces , and then trying to achieve them . In this way , they can learn about the world around them . In principle , the goal space for an autonomous agent could be any arbitrary function of the state space . However , when the state space is high-dimensional and unstructured , such as only images , it is desirable to have goal spaces which allow efficient exploration and learning , where the factors of variation in the environment are well disentangled . Recently , unsupervised representation learning has been proposed to learn such goal spaces ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ) . All existing methods in this context use variational autoencoders ( VAEs ) to map observations into a low-dimensional latent space that can later be used for sampling goals and reward shaping . However , for complex compositional scenes consisting of multiple objects , the inductive bias of VAEs could be harmful . In contrast , representing perceptual observations in terms of entities has been shown to improve data efficiency and transfer performance on a wide range of tasks ( Burgess et al. , 2019 ) . Recent research has proposed a range of methods for unsupervised scene and video decomposition ( Greff et al. , 2017 ; Kosiorek et al. , 2018 ; Burgess et al. , 2019 ; Greff et al. , 2019 ; Jiang et al. , 2019 ; Weis et al. , 2020 ; Locatello et al. , 2020 ) . These methods learn object representations and scene decomposition jointly . The majority of them are in part motivated by the fact that the learned representations are useful for downstream tasks such as image classification , object detection , or semantic segmentation . In this work , we show that such learned representations are also beneficial for autonomous control and reinforcement learning . ∗equal contribution We propose to combine these object-centric unsupervised representation methods that represent the scene as a set of potentially structured vectors with goal-conditional visual RL . In our method ( illustrated in Figure 1 ) , dubbed SMORL ( for self-supervised multi-object RL ) , a representation of raw sensory inputs is learned by a compositional latent variable model based on the SCALOR architecture ( Jiang et al. , 2019 ) . We show that using object-centric representations simplifies the goal space learning . Autonomous agents can use those representations to learn how to achieve different goals with a reward function that utilizes the structure of the learned goal space . Our main contributions are as follows : • We show that structured object-centric representations learned with generative world models can significantly improve the performance of the self-supervised visual RL agent . • We develop SMORL , an algorithm that uses learned representations to autonomously discover and learn useful skills in compositional environments with several objects using only images as inputs . • We show that even with fully disentangled ground-truth representation there is a large benefit from using SMORL in environments with complex compositional tasks such as rearranging many objects . 2 RELATED WORK . Our work lies in the intersection of several actively evolving topics : visual reinforcement learning for control and robotics , and self-supervised learning . Vision-based RL for robotics is able to efficiently learn a variety of behaviors such as grasping , pushing and navigation ( Levine et al. , 2016 ; Pathak et al. , 2018 ; Levine et al. , 2018 ; Kalashnikov et al. , 2018 ) using only images and rewards as input signals . Self-supervised learning is a form of unsupervised learning where the data provides the supervision . It was successfully used to learn powerful representations for downstream tasks in natural language processing ( Devlin et al. , 2018 ; Radford et al. , 2019 ) and computer vision ( He et al. , 2019 ; Chen et al. , 2020 ) . In the context of RL , self-supervision refers to the agent constructing its own reward signal and using it to solve self-proposed goals ( Baranes & Oudeyer , 2013 ; Nair et al. , 2018 ; Péré et al. , 2018 ; Hausman et al. , 2018 ; Lynch et al. , 2019 ) . This is especially relevant for visual RL , where a reward signal is usually not naturally available . These methods can potentially acquire a diverse repertoire of general-purpose robotic skills that can be reused and combined during test time . Such self-supervised approaches are crucial for scaling learning from narrow single-task learning to more general agents that explore the environment on their own to prepare for solving many different tasks in the future . Next , we will cover the two most related lines of research in more detail . Self-supervised visual RL ( Nair et al. , 2018 ; 2019 ; Pong et al. , 2020 ; Ghosh et al. , 2019 ; WardeFarley et al. , 2019 ; Laversanne-Finot et al. , 2018 ) tackles multi-task RL problems from images without any external reward signal . However , all previous methods assume that the environment observation can be encoded into a single vector , e.g . using VAE representations . With multiple objects being present , this assumption may result in object encodings overlapping in the representation , which is known as the binding problem ( Greff et al. , 2016 ; 2020 ) . In addition , as the reward is also constructed based on this vector , the agent is incentivized to solve tasks that are incompatible , for instance simultaneously moving all objects to goal positions . In contrast , we suggest to learn object-centric representations and use them for reward shaping . This way , the agent can learn to solve tasks independently and then combine these skills during evaluation . Learning object-centric representations in RL ( Watters et al. , 2019 ; van Steenkiste et al. , 2019 ; Veerapaneni et al. , 2020 ; Kipf et al. , 2020 ) has been suggested to approach tasks with combinatorial and compositional elements such as the manipulation of multiple objects . However , the previous work has assumed a fixed , single task and a given reward signal , whereas we are using the learned object-representations to construct a reward signal that helps to learn useful skills that can be used to solve multiple tasks . In addition , these methods use scene-mixture models such as MONET ( Burgess et al. , 2019 ) and IODINE ( Greff et al. , 2019 ) , which do not explicitly contain features like position and scale . These features can be used by the agent for more efficient sampling from the goal space and thus the explicit modeling of these features helps to create additional biases useful for manipulation tasks . However , we expect that other object-centric representations could also be successfully applied as suitable representations for RL tasks . 3 BACKGROUND . Our method combines goal-conditional RL with unsupervised object-oriented representation learning for multi-object environments . Before we describe each technique in detail , we briefly state some RL preliminaries . We consider a Markov decision process defined by ( S , A , p , r ) , where S and A are the continuous state and action spaces , p : S × S ×A 7→ [ 0 , ∞ ) is an unknown probability density representing the probability of transitioning to state st+1 ∈ S from state st ∈ S given action at ∈ A , and r : S 7→ R is a function computing the reward for reaching state st+1 . The agent ’ s objective is to maximize the expected return R = ∑T t=1 Est∼ρπ , at∼π , st+1∼p [ r ( st+1 ) ] over the horizon T , where ρπ ( st ) is the state marginal distribution induced by the agent ’ s policy π ( at|st ) . 3.1 GOAL-CONDITIONAL REINFORCEMENT LEARNING . In the standard RL setting described before , the agent only learns to solve a single task , specified by the reward function . If we are interested in an agent that can solve multiple tasks ( each with a different reward function ) in an environment , we can train the agent on those tasks by telling the agent which distinct task to solve at each time step . But how can we describe a task to the agent ? A simple , yet not too restrictive way is to let each task correspond to an environment state the agent has to reach , denoted as the goal state g. The task is then given to the agent by conditioning its policy π ( at | st , g ) on the goal g , and the agent ’ s objective turns to maximize the expected goal-conditional return : Eg∼G [ T∑ t=1 Est∼ρπ , at∼π , st+1∼p [ rg ( st+1 ) ] ] ( 1 ) whereG is some distribution over the space of goals G ⊆ S the agent receives for training . The reward function can , for example , be the negative distance of the current state to the goal : rg ( s ) = −‖s−g‖ . Often , we are only interested in reaching a partial state configuration , e.g . moving an object to a target position , and want to avoid using the full environment state as the goal . In this case , we have to provide a mapping m : S 7→ G of states to the desired goal space ; the mapping is then used to compute the reward function , i.e . rg ( s ) = −‖m ( s ) − g‖ . As the reward is computed within the goal space , it is clear that the choice of goal space plays a crucial role in determining the difficulty of the learning task . If the goal space is low-dimensional and structured , e.g . in terms of ground truth positions of objects , rewards provide a meaningful signal towards reaching goals . However , if we only have access to high-dimensional , unstructured observations , e.g . camera images , and we naively choose this space as the goal space , optimization becomes hard as there is little correspondence between the reward and the distance of the underlying world states ( Nair et al. , 2018 ) . One option to deal with such difficult observation spaces is to learn a goal space in which the RL task becomes easier . For instance , we can try to find a low-dimensional latent space Z and use it both as the input space to our policy and the space in which we specify goals . If the environment is composed of independent parts that we intend to control separately , intuitively , learning to control is easiest if the latent space is also structured in terms of those independent components . Previous research ( Nair et al. , 2018 ; Pong et al. , 2020 ) relied on the disentangling properties of representation learning models such as the β-VAE ( Higgins et al. , 2017 ) for this purpose . However , these models become insufficient when faced with multi-object scenarios due to the increasing combinatorial complexity of the scene , as we show in Sec . 5.2 and in App . A.2 . Instead , we use a model explicitly geared towards inferring object-structured representations , which we introduce in the next section .
The paper proposes to use object-centric representations for RL, which can efficiently handle multiple objects in the scene. To learn a policy that can take a variable number of object observations, the paper proposes the goal-conditioned attention policy, which can focus on objects of interests to achieve each sub-goal, and thus reduce the combinatorial complexity of multiple objects. The goal-conditioned attention policy can be efficiently trained with hindsight experience replay on the object-centric goal representations. The experiments demonstrate the superior performance of the goal-conditioned attention policy on dealing with multiple objects.
SP:37b8cd02d6c638f0f2e6687c614ae86c0a7bc250
Simplifying Models with Unlabeled Output Data
1 INTRODUCTION . We study problems whose outputs have validity constraints . For example , in pseudocode-to-code translation , the output code must compile . Other examples include natural language translation and molecule generation , where outputs should be grammatically correct or chemically valid , respectively . State-of-the-art models typically learn the input-output mapping from expensively-obtained labeled data Kulal et al . ( 2019 ) ; Vaswani et al . ( 2017 ) ; Méndez-Lucio et al . ( 2020 ) ; Senior et al . ( 2020 ) , which may not contain enough examples to learn a complex validity structure on high-dimensional output spaces . However , there are often lots of “ unlabeled ” outputs—outputs without a corresponding input ( e.g. , GitHub has over 40 million public code repositories ) . How do we leverage these with a much smaller amount of labeled input-output pairs to improve accuracy and validity ? In this paper , we present predict-and-denoise , a framework in which we compose a base predictor , which maps an input to a possibly invalid output , with a denoiser , which maps the possibly invalid output to a valid output . We first train the denoiser on synthetic perturbations of unlabeled outputs . Second , we train the base predictor composed with the fixed denoiser on the labeled data ( Figure 1 left ) . By factorizing into two modules , base predictor and denoiser , the framework allows the base predictor to be simpler by offloading the complexity of modeling the output validity structure to the denoiser , which has the benefit of being trained on much more data . We aim to lay down a principled framework for using unlabeled outputs with theoretical justification for improving sample efficiency by reducing the complexity of the learned base predictor . Figure 1 ( middle , right ) shows a pictorial example of a staircase function where valid outputs are integers and requires a complex spline to represent . When composed with a denoiser ( which rounds to the nearest integer ) , a simple linear base predictor can represent the staircase function . We theoretically show that our framework reduces the complexity of a 2-layer ReLU network needed to represent a family of functions on a discrete valid output set in high-dimensions . This complexity gap can be arbitrarily large depending on the stability of the target function being learned . We expect such a lower complexity function to be learnable with fewer samples , improving generalization . Empirically , we show on image generation and two pseudocode-to-code datasets ( synthetic and SPOC Kulal et al . ( 2019 ) ) that predict-and-denoise improves test performance across continuous and discrete output data modalities . In image generation , our framework improves the clarity and styling of font images by learning a low-complexity base predictor to generate an abstract image while the denoiser sharpens the image . For pseudocode-to-code , we consider the more difficult full-program translation task rather than line-by-line translation ( with compiler side information ) studied by previous work Kulal et al . ( 2019 ) ; Yasunaga and Liang ( 2020 ) . We first study a synthetic pseudocode-to-code dataset where the denoiser simplifies the base predictor by helping with global type inference . On SPOC , a recent pseudocode-to-code dataset on programming competition problems , we improve the proportion of correct programs by 3-5 % points over a baseline Transformer . 2 SETUP . We consider prediction problems from an input spaceX ( e.g. , pseudocode ) to an output space Y ( e.g. , code ) where there is an unknown subset of valid outputs V⊆Y ( e.g. , code that compiles ) , where the true output is always valid ( in V ) . We have a labeled dataset ( x1 , y1 ) , ... , ( xn , yn ) where xi ∈X and yi∈V and access to many unlabeled outputs ( ỹ1 , ... , ỹm ) from V . We do not assume access to any black box function for testing validity ( whether y∈V or not ) , allowing for general problems ( e.g . language generation ) where output validity is imprecisely characterized . A predictor f : X →Y from a chosen hypothesis class H maps from inputs to the ambient output space . Our goal is to improve the predictor by leveraging information about the valid space V from the unlabeled examples { ỹi } mi=1 . We leverage a denoiser Π : Y→V , which projects a possibly invalid output inY and to the valid set V . We can use unlabeled outputs to learn an approximate denoiser . Base , composed , and direct predictors . Let ‖·‖ be a norm onH . Let Π◦fbase be a composed predictor that is supposed to represent the target function f ? ( that is , Π◦fbase =f ? onX ) . In the context of a composed predictor , we call fbase the base predictor . We compare against fdirect∈argminf∈H { ‖f‖ : f ( x ) =f ? ( x ) , x∈X } , a minimum norm direct predictor which represents f ? . 3 DENOISERS CAN REDUCE MODEL COMPLEXITY . In this section , we study direct and composed predictors from an approximation standpoint and use complexity measures on predictors as surrogates for sample complexity . We aim to represent a target function f ? : X →V . We assume access to a denoiser Π : Y→V which projects to the nearest valid output for an appropriate metric on the output space ( breaking ties arbitrarily ) . In Section 3.1 , we give a simple example for when composing with a denoiser ( Π ◦ fbase ) can drastically reduce the complexity of the learned predictor . Since fbase becomes easier to approximate , we may expect better generalization Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Wei and Ma ( 2020 ; 2019 ) . In Section 3.2 , we theoretically show for two-layer ReLU networks that the complexity required to directly represent f ? can be arbitrarily larger than representing with a composed predictor depending on the stability of f ? . 3.1 MOTIVATING EXAMPLE . Figure 1 shows a staircase function f ? that requires a complex direct predictor fdirect but the minimum norm base predictor f∗base has low complexity . For 0 < δ < 1 , let the input space X = ] Ni=1 [ i− ( 1−δ ) /2 , i+ ( 1−δ ) /2 ] be a union ofN disjoint intervals and the valid outputs V =Z be the integers , a subset of the ambient output space Y =R . The staircase function is f ? ( x ) = bxe defined onX , which rounds a linear function onto the integers . Following Savarese et al . ( 2019 ) , we define the norm of a univariate function f : R→R as ‖f‖= 1 2 max ( ∫ ∞ −∞ |f ′′ ( x ) |2dx , |f ′ ( −∞ ) +f ′ ( +∞ ) | ) . ( 1 ) This norm measures the ( lack of ) stability of f . Complex functions will have a higher norm . Consider representing f ? with linear splines , a family of piecewise linear functions . In linear splines , the norm in Equation ( 1 ) becomes roughly the sum of absolute changes in slope between piecewise segments . If we represent f ? directly with a linear spline fdirect , the norm of fdirect has to be large due to the large number of slope changes : ‖fdirect‖= ( N−1 ) /δ ( Figure 1 left ) . Suppose we have access to a denoiser Π ( y ) =bye , which projects onto V=Z . Then a linear function f∗base composed with Π can represent the staircase onX , reducing the norm to 1 ( Figure 1 right ) . By not requiring f∗base to represent the local complexity and discreteness in f ? , the base predictor f∗base better captures the underlying globally linear structure of f ? . 3.2 ANALYSIS FOR 2-LAYER RELU NETWORKS . We extend to more general hypothesis classes and high dimensional outputs . Our setting is motivated by the task of generating images of font characters from attributes , which we study empirically in Section 5.1 . In font image generation , there is a discrete set of valid font images in the continuous ambient output space . Formally , we take the valid set V= { y∗1 , ... , y∗N } to be a discrete set overN output values in Rk and f ? is a piecewise constant function defined onN disjoint intervalsX = ] Ni=1 [ xli , xui ] ( in ascending order ) , where there is a δ > 0 gap between each interval and the next . The target function f ? is defined such that if x∈ [ xli , xui ] , then f ? ( x ) =y∗i . We study 2-layer ReLU networks , often studied as a first step towards understanding the expressivity of neural networks Neyshabur et al . ( 2014 ) ; Savarese et al . ( 2019 ) ; Eldan and Shamir ( 2016 ) . Following Savarese et al . ( 2019 ) , we define fθ∈H as fθ ( x ) = h∑ l=1 w ( 2 ) l [ 〈w ( 1 ) l , x〉+b ( 1 ) l ] + +b ( 2 ) l on x∈Rd , where we will take d= 1 throughout . Here , [ x ] + = max ( x,0 ) is the element-wise ReLU nonlinearity . The parameters θ contain the hidden unit size h∈N and all weights and biases . We let W ( 1 ) ∈Rh×d denote the matrix with w ( 1 ) l ∈Rd as rows and let b ( 1 ) , b ( 2 ) , w ( 2 ) ∈Rh be vectors with b ( 1 ) l , b ( 2 ) l , w ( 2 ) l ∈R as elements respectively . We let Θ denote this parameter space . Measure of complexity . Following Savarese et al . ( 2019 ) , the complexity of a network is associated with the squared Euclidean norm of the weights C ( θ ) = 1 2 ( ‖w ( 2 ) ‖22+‖W ( 1 ) ‖2F ) . The norm of f ∈H is the minimum norm required to represent f : ‖f‖= inf θ̂∈Θ C ( θ̂ ) s.t . fθ̂=f . ( 2 ) Savarese et al . ( 2019 ) showed that this norm is equivalent to Equation 1 for univariate networks . Since these complexity measures typically appear in generalization bounds Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) , we expect to improve generalization error by reducing these complexity measures . Minimum complexity reduces with a denoiser . Given Π ( y ) ∈ argminy∗∈V ‖y∗− y‖2 which is projection onto V ( breaking ties arbitrarily ) , we want to compare the norms of fdirect that represents f ? directly and the minimum norm base predictor that represents f ? : f∗base =argmin f∈H { ‖f‖ : Π◦f ( x ) =f ? ( x ) , x∈X } . ( 3 ) Note that ‖f∗base‖≤‖fdirect‖ since fdirect is a feasible solution . Thus composing can not increase the norm . Adjacent intervals measure stability . Our result depends crucially on the number of non-adjacent pairs of intervals in f ? . Suppose the output dimension is k = 1 . We define a pair of interval indices ( i , i+1 ) as adjacent if there is no valid output value y ∈V such that either y∗i < y < y∗i+1 or y∗i+1 < y < y ∗ i hold . The number of non-adjacent interval pairs characterizes the instability of f ? . Let |J | be the number of non-adjacent pairs and |I| be the number of adjacent pairs , where |I|+|J |=N−1 . Our bound also depends onL=mini|y∗i −y∗i+1| andU=maxi|y∗i −y∗i+1| , the min and max separation between valid points . For higher output dimensions ( k > 1 ) , let y∗i , j be the j-th output coordinate of the i-th valid point and let |Jj | , |Ij | , Lj , Uj be the analogous quantities for each output coordinate j∈ [ k ] . Theorem 1 . Let the valid output space V⊂Rk be a set overN multivariate output values { y∗1 , ... , y∗N } in V . Let f ? : R→Rk be a piecewise constant function defined onX = ] Ni=1 [ xli , xui ] where f ? ( x ) =y∗i if x∈ [ xli , xui ] . Let ∆x be the length of the smallest interval inX . Then ‖fdirect‖ ‖f∗base‖ =Ω NmaxjLj∑k j=1Uj ( |Jj |+δ |Ij |∆x ) ( 4 ) See Appendix A for a proof . If |Jj | are sublinear in N and valid points are evenly spaced , then the gap is Ω ( 1/δ ) which can be arbitrarily large for a fixed output dimension as δ→ 0 and N→∞ . If any |Jj | is linear in N ( many non-adjacent intervals ) , then there is only a constant factor gap in the worst case . Overall , if f ? is stable with respect to its discrete output space , we can learn a simpler base predictor that still represents f ? when composed with the denoiser . Note that in practice , we need to regularize the base predictor to find this low complexity solution .
The paper introduces a “predict-and-denoise” model for structured prediction, specifically for tasks where the output has to adhere to some constraints e.g. natural language, code etc. This framework allows leveraging of unlabelled output data to train the denoiser, which consequently allows the base predictor to be of low complexity that can potentially generalize with relatively fewer labelled data. The authors theoretically back their arguments basing their theory on a 2 layer ReLU model. The paper demonstrates the performance of this model on two tasks - font image generation, and pseudocode-to-code translation and shows improvement in performance over previous works.
SP:c56a2ed56cb664f09aaecb355c0012a57f61d245
Simplifying Models with Unlabeled Output Data
1 INTRODUCTION . We study problems whose outputs have validity constraints . For example , in pseudocode-to-code translation , the output code must compile . Other examples include natural language translation and molecule generation , where outputs should be grammatically correct or chemically valid , respectively . State-of-the-art models typically learn the input-output mapping from expensively-obtained labeled data Kulal et al . ( 2019 ) ; Vaswani et al . ( 2017 ) ; Méndez-Lucio et al . ( 2020 ) ; Senior et al . ( 2020 ) , which may not contain enough examples to learn a complex validity structure on high-dimensional output spaces . However , there are often lots of “ unlabeled ” outputs—outputs without a corresponding input ( e.g. , GitHub has over 40 million public code repositories ) . How do we leverage these with a much smaller amount of labeled input-output pairs to improve accuracy and validity ? In this paper , we present predict-and-denoise , a framework in which we compose a base predictor , which maps an input to a possibly invalid output , with a denoiser , which maps the possibly invalid output to a valid output . We first train the denoiser on synthetic perturbations of unlabeled outputs . Second , we train the base predictor composed with the fixed denoiser on the labeled data ( Figure 1 left ) . By factorizing into two modules , base predictor and denoiser , the framework allows the base predictor to be simpler by offloading the complexity of modeling the output validity structure to the denoiser , which has the benefit of being trained on much more data . We aim to lay down a principled framework for using unlabeled outputs with theoretical justification for improving sample efficiency by reducing the complexity of the learned base predictor . Figure 1 ( middle , right ) shows a pictorial example of a staircase function where valid outputs are integers and requires a complex spline to represent . When composed with a denoiser ( which rounds to the nearest integer ) , a simple linear base predictor can represent the staircase function . We theoretically show that our framework reduces the complexity of a 2-layer ReLU network needed to represent a family of functions on a discrete valid output set in high-dimensions . This complexity gap can be arbitrarily large depending on the stability of the target function being learned . We expect such a lower complexity function to be learnable with fewer samples , improving generalization . Empirically , we show on image generation and two pseudocode-to-code datasets ( synthetic and SPOC Kulal et al . ( 2019 ) ) that predict-and-denoise improves test performance across continuous and discrete output data modalities . In image generation , our framework improves the clarity and styling of font images by learning a low-complexity base predictor to generate an abstract image while the denoiser sharpens the image . For pseudocode-to-code , we consider the more difficult full-program translation task rather than line-by-line translation ( with compiler side information ) studied by previous work Kulal et al . ( 2019 ) ; Yasunaga and Liang ( 2020 ) . We first study a synthetic pseudocode-to-code dataset where the denoiser simplifies the base predictor by helping with global type inference . On SPOC , a recent pseudocode-to-code dataset on programming competition problems , we improve the proportion of correct programs by 3-5 % points over a baseline Transformer . 2 SETUP . We consider prediction problems from an input spaceX ( e.g. , pseudocode ) to an output space Y ( e.g. , code ) where there is an unknown subset of valid outputs V⊆Y ( e.g. , code that compiles ) , where the true output is always valid ( in V ) . We have a labeled dataset ( x1 , y1 ) , ... , ( xn , yn ) where xi ∈X and yi∈V and access to many unlabeled outputs ( ỹ1 , ... , ỹm ) from V . We do not assume access to any black box function for testing validity ( whether y∈V or not ) , allowing for general problems ( e.g . language generation ) where output validity is imprecisely characterized . A predictor f : X →Y from a chosen hypothesis class H maps from inputs to the ambient output space . Our goal is to improve the predictor by leveraging information about the valid space V from the unlabeled examples { ỹi } mi=1 . We leverage a denoiser Π : Y→V , which projects a possibly invalid output inY and to the valid set V . We can use unlabeled outputs to learn an approximate denoiser . Base , composed , and direct predictors . Let ‖·‖ be a norm onH . Let Π◦fbase be a composed predictor that is supposed to represent the target function f ? ( that is , Π◦fbase =f ? onX ) . In the context of a composed predictor , we call fbase the base predictor . We compare against fdirect∈argminf∈H { ‖f‖ : f ( x ) =f ? ( x ) , x∈X } , a minimum norm direct predictor which represents f ? . 3 DENOISERS CAN REDUCE MODEL COMPLEXITY . In this section , we study direct and composed predictors from an approximation standpoint and use complexity measures on predictors as surrogates for sample complexity . We aim to represent a target function f ? : X →V . We assume access to a denoiser Π : Y→V which projects to the nearest valid output for an appropriate metric on the output space ( breaking ties arbitrarily ) . In Section 3.1 , we give a simple example for when composing with a denoiser ( Π ◦ fbase ) can drastically reduce the complexity of the learned predictor . Since fbase becomes easier to approximate , we may expect better generalization Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Wei and Ma ( 2020 ; 2019 ) . In Section 3.2 , we theoretically show for two-layer ReLU networks that the complexity required to directly represent f ? can be arbitrarily larger than representing with a composed predictor depending on the stability of f ? . 3.1 MOTIVATING EXAMPLE . Figure 1 shows a staircase function f ? that requires a complex direct predictor fdirect but the minimum norm base predictor f∗base has low complexity . For 0 < δ < 1 , let the input space X = ] Ni=1 [ i− ( 1−δ ) /2 , i+ ( 1−δ ) /2 ] be a union ofN disjoint intervals and the valid outputs V =Z be the integers , a subset of the ambient output space Y =R . The staircase function is f ? ( x ) = bxe defined onX , which rounds a linear function onto the integers . Following Savarese et al . ( 2019 ) , we define the norm of a univariate function f : R→R as ‖f‖= 1 2 max ( ∫ ∞ −∞ |f ′′ ( x ) |2dx , |f ′ ( −∞ ) +f ′ ( +∞ ) | ) . ( 1 ) This norm measures the ( lack of ) stability of f . Complex functions will have a higher norm . Consider representing f ? with linear splines , a family of piecewise linear functions . In linear splines , the norm in Equation ( 1 ) becomes roughly the sum of absolute changes in slope between piecewise segments . If we represent f ? directly with a linear spline fdirect , the norm of fdirect has to be large due to the large number of slope changes : ‖fdirect‖= ( N−1 ) /δ ( Figure 1 left ) . Suppose we have access to a denoiser Π ( y ) =bye , which projects onto V=Z . Then a linear function f∗base composed with Π can represent the staircase onX , reducing the norm to 1 ( Figure 1 right ) . By not requiring f∗base to represent the local complexity and discreteness in f ? , the base predictor f∗base better captures the underlying globally linear structure of f ? . 3.2 ANALYSIS FOR 2-LAYER RELU NETWORKS . We extend to more general hypothesis classes and high dimensional outputs . Our setting is motivated by the task of generating images of font characters from attributes , which we study empirically in Section 5.1 . In font image generation , there is a discrete set of valid font images in the continuous ambient output space . Formally , we take the valid set V= { y∗1 , ... , y∗N } to be a discrete set overN output values in Rk and f ? is a piecewise constant function defined onN disjoint intervalsX = ] Ni=1 [ xli , xui ] ( in ascending order ) , where there is a δ > 0 gap between each interval and the next . The target function f ? is defined such that if x∈ [ xli , xui ] , then f ? ( x ) =y∗i . We study 2-layer ReLU networks , often studied as a first step towards understanding the expressivity of neural networks Neyshabur et al . ( 2014 ) ; Savarese et al . ( 2019 ) ; Eldan and Shamir ( 2016 ) . Following Savarese et al . ( 2019 ) , we define fθ∈H as fθ ( x ) = h∑ l=1 w ( 2 ) l [ 〈w ( 1 ) l , x〉+b ( 1 ) l ] + +b ( 2 ) l on x∈Rd , where we will take d= 1 throughout . Here , [ x ] + = max ( x,0 ) is the element-wise ReLU nonlinearity . The parameters θ contain the hidden unit size h∈N and all weights and biases . We let W ( 1 ) ∈Rh×d denote the matrix with w ( 1 ) l ∈Rd as rows and let b ( 1 ) , b ( 2 ) , w ( 2 ) ∈Rh be vectors with b ( 1 ) l , b ( 2 ) l , w ( 2 ) l ∈R as elements respectively . We let Θ denote this parameter space . Measure of complexity . Following Savarese et al . ( 2019 ) , the complexity of a network is associated with the squared Euclidean norm of the weights C ( θ ) = 1 2 ( ‖w ( 2 ) ‖22+‖W ( 1 ) ‖2F ) . The norm of f ∈H is the minimum norm required to represent f : ‖f‖= inf θ̂∈Θ C ( θ̂ ) s.t . fθ̂=f . ( 2 ) Savarese et al . ( 2019 ) showed that this norm is equivalent to Equation 1 for univariate networks . Since these complexity measures typically appear in generalization bounds Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) , we expect to improve generalization error by reducing these complexity measures . Minimum complexity reduces with a denoiser . Given Π ( y ) ∈ argminy∗∈V ‖y∗− y‖2 which is projection onto V ( breaking ties arbitrarily ) , we want to compare the norms of fdirect that represents f ? directly and the minimum norm base predictor that represents f ? : f∗base =argmin f∈H { ‖f‖ : Π◦f ( x ) =f ? ( x ) , x∈X } . ( 3 ) Note that ‖f∗base‖≤‖fdirect‖ since fdirect is a feasible solution . Thus composing can not increase the norm . Adjacent intervals measure stability . Our result depends crucially on the number of non-adjacent pairs of intervals in f ? . Suppose the output dimension is k = 1 . We define a pair of interval indices ( i , i+1 ) as adjacent if there is no valid output value y ∈V such that either y∗i < y < y∗i+1 or y∗i+1 < y < y ∗ i hold . The number of non-adjacent interval pairs characterizes the instability of f ? . Let |J | be the number of non-adjacent pairs and |I| be the number of adjacent pairs , where |I|+|J |=N−1 . Our bound also depends onL=mini|y∗i −y∗i+1| andU=maxi|y∗i −y∗i+1| , the min and max separation between valid points . For higher output dimensions ( k > 1 ) , let y∗i , j be the j-th output coordinate of the i-th valid point and let |Jj | , |Ij | , Lj , Uj be the analogous quantities for each output coordinate j∈ [ k ] . Theorem 1 . Let the valid output space V⊂Rk be a set overN multivariate output values { y∗1 , ... , y∗N } in V . Let f ? : R→Rk be a piecewise constant function defined onX = ] Ni=1 [ xli , xui ] where f ? ( x ) =y∗i if x∈ [ xli , xui ] . Let ∆x be the length of the smallest interval inX . Then ‖fdirect‖ ‖f∗base‖ =Ω NmaxjLj∑k j=1Uj ( |Jj |+δ |Ij |∆x ) ( 4 ) See Appendix A for a proof . If |Jj | are sublinear in N and valid points are evenly spaced , then the gap is Ω ( 1/δ ) which can be arbitrarily large for a fixed output dimension as δ→ 0 and N→∞ . If any |Jj | is linear in N ( many non-adjacent intervals ) , then there is only a constant factor gap in the worst case . Overall , if f ? is stable with respect to its discrete output space , we can learn a simpler base predictor that still represents f ? when composed with the denoiser . Note that in practice , we need to regularize the base predictor to find this low complexity solution .
The authors propose a more data-efficient way to train generative models with constraints on the output; specifically they evaluate on image generation and pseudocode-to-code (SPoC) tasks. They train two separate models, a “predictor” and a “denoiser”, which they then compose: the output from the “predictor” is further processed by the “denoiser”. For the SPoC task they show an improvement of 3-5% over a simple transformer baseline.
SP:c56a2ed56cb664f09aaecb355c0012a57f61d245
Simplifying Models with Unlabeled Output Data
1 INTRODUCTION . We study problems whose outputs have validity constraints . For example , in pseudocode-to-code translation , the output code must compile . Other examples include natural language translation and molecule generation , where outputs should be grammatically correct or chemically valid , respectively . State-of-the-art models typically learn the input-output mapping from expensively-obtained labeled data Kulal et al . ( 2019 ) ; Vaswani et al . ( 2017 ) ; Méndez-Lucio et al . ( 2020 ) ; Senior et al . ( 2020 ) , which may not contain enough examples to learn a complex validity structure on high-dimensional output spaces . However , there are often lots of “ unlabeled ” outputs—outputs without a corresponding input ( e.g. , GitHub has over 40 million public code repositories ) . How do we leverage these with a much smaller amount of labeled input-output pairs to improve accuracy and validity ? In this paper , we present predict-and-denoise , a framework in which we compose a base predictor , which maps an input to a possibly invalid output , with a denoiser , which maps the possibly invalid output to a valid output . We first train the denoiser on synthetic perturbations of unlabeled outputs . Second , we train the base predictor composed with the fixed denoiser on the labeled data ( Figure 1 left ) . By factorizing into two modules , base predictor and denoiser , the framework allows the base predictor to be simpler by offloading the complexity of modeling the output validity structure to the denoiser , which has the benefit of being trained on much more data . We aim to lay down a principled framework for using unlabeled outputs with theoretical justification for improving sample efficiency by reducing the complexity of the learned base predictor . Figure 1 ( middle , right ) shows a pictorial example of a staircase function where valid outputs are integers and requires a complex spline to represent . When composed with a denoiser ( which rounds to the nearest integer ) , a simple linear base predictor can represent the staircase function . We theoretically show that our framework reduces the complexity of a 2-layer ReLU network needed to represent a family of functions on a discrete valid output set in high-dimensions . This complexity gap can be arbitrarily large depending on the stability of the target function being learned . We expect such a lower complexity function to be learnable with fewer samples , improving generalization . Empirically , we show on image generation and two pseudocode-to-code datasets ( synthetic and SPOC Kulal et al . ( 2019 ) ) that predict-and-denoise improves test performance across continuous and discrete output data modalities . In image generation , our framework improves the clarity and styling of font images by learning a low-complexity base predictor to generate an abstract image while the denoiser sharpens the image . For pseudocode-to-code , we consider the more difficult full-program translation task rather than line-by-line translation ( with compiler side information ) studied by previous work Kulal et al . ( 2019 ) ; Yasunaga and Liang ( 2020 ) . We first study a synthetic pseudocode-to-code dataset where the denoiser simplifies the base predictor by helping with global type inference . On SPOC , a recent pseudocode-to-code dataset on programming competition problems , we improve the proportion of correct programs by 3-5 % points over a baseline Transformer . 2 SETUP . We consider prediction problems from an input spaceX ( e.g. , pseudocode ) to an output space Y ( e.g. , code ) where there is an unknown subset of valid outputs V⊆Y ( e.g. , code that compiles ) , where the true output is always valid ( in V ) . We have a labeled dataset ( x1 , y1 ) , ... , ( xn , yn ) where xi ∈X and yi∈V and access to many unlabeled outputs ( ỹ1 , ... , ỹm ) from V . We do not assume access to any black box function for testing validity ( whether y∈V or not ) , allowing for general problems ( e.g . language generation ) where output validity is imprecisely characterized . A predictor f : X →Y from a chosen hypothesis class H maps from inputs to the ambient output space . Our goal is to improve the predictor by leveraging information about the valid space V from the unlabeled examples { ỹi } mi=1 . We leverage a denoiser Π : Y→V , which projects a possibly invalid output inY and to the valid set V . We can use unlabeled outputs to learn an approximate denoiser . Base , composed , and direct predictors . Let ‖·‖ be a norm onH . Let Π◦fbase be a composed predictor that is supposed to represent the target function f ? ( that is , Π◦fbase =f ? onX ) . In the context of a composed predictor , we call fbase the base predictor . We compare against fdirect∈argminf∈H { ‖f‖ : f ( x ) =f ? ( x ) , x∈X } , a minimum norm direct predictor which represents f ? . 3 DENOISERS CAN REDUCE MODEL COMPLEXITY . In this section , we study direct and composed predictors from an approximation standpoint and use complexity measures on predictors as surrogates for sample complexity . We aim to represent a target function f ? : X →V . We assume access to a denoiser Π : Y→V which projects to the nearest valid output for an appropriate metric on the output space ( breaking ties arbitrarily ) . In Section 3.1 , we give a simple example for when composing with a denoiser ( Π ◦ fbase ) can drastically reduce the complexity of the learned predictor . Since fbase becomes easier to approximate , we may expect better generalization Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Wei and Ma ( 2020 ; 2019 ) . In Section 3.2 , we theoretically show for two-layer ReLU networks that the complexity required to directly represent f ? can be arbitrarily larger than representing with a composed predictor depending on the stability of f ? . 3.1 MOTIVATING EXAMPLE . Figure 1 shows a staircase function f ? that requires a complex direct predictor fdirect but the minimum norm base predictor f∗base has low complexity . For 0 < δ < 1 , let the input space X = ] Ni=1 [ i− ( 1−δ ) /2 , i+ ( 1−δ ) /2 ] be a union ofN disjoint intervals and the valid outputs V =Z be the integers , a subset of the ambient output space Y =R . The staircase function is f ? ( x ) = bxe defined onX , which rounds a linear function onto the integers . Following Savarese et al . ( 2019 ) , we define the norm of a univariate function f : R→R as ‖f‖= 1 2 max ( ∫ ∞ −∞ |f ′′ ( x ) |2dx , |f ′ ( −∞ ) +f ′ ( +∞ ) | ) . ( 1 ) This norm measures the ( lack of ) stability of f . Complex functions will have a higher norm . Consider representing f ? with linear splines , a family of piecewise linear functions . In linear splines , the norm in Equation ( 1 ) becomes roughly the sum of absolute changes in slope between piecewise segments . If we represent f ? directly with a linear spline fdirect , the norm of fdirect has to be large due to the large number of slope changes : ‖fdirect‖= ( N−1 ) /δ ( Figure 1 left ) . Suppose we have access to a denoiser Π ( y ) =bye , which projects onto V=Z . Then a linear function f∗base composed with Π can represent the staircase onX , reducing the norm to 1 ( Figure 1 right ) . By not requiring f∗base to represent the local complexity and discreteness in f ? , the base predictor f∗base better captures the underlying globally linear structure of f ? . 3.2 ANALYSIS FOR 2-LAYER RELU NETWORKS . We extend to more general hypothesis classes and high dimensional outputs . Our setting is motivated by the task of generating images of font characters from attributes , which we study empirically in Section 5.1 . In font image generation , there is a discrete set of valid font images in the continuous ambient output space . Formally , we take the valid set V= { y∗1 , ... , y∗N } to be a discrete set overN output values in Rk and f ? is a piecewise constant function defined onN disjoint intervalsX = ] Ni=1 [ xli , xui ] ( in ascending order ) , where there is a δ > 0 gap between each interval and the next . The target function f ? is defined such that if x∈ [ xli , xui ] , then f ? ( x ) =y∗i . We study 2-layer ReLU networks , often studied as a first step towards understanding the expressivity of neural networks Neyshabur et al . ( 2014 ) ; Savarese et al . ( 2019 ) ; Eldan and Shamir ( 2016 ) . Following Savarese et al . ( 2019 ) , we define fθ∈H as fθ ( x ) = h∑ l=1 w ( 2 ) l [ 〈w ( 1 ) l , x〉+b ( 1 ) l ] + +b ( 2 ) l on x∈Rd , where we will take d= 1 throughout . Here , [ x ] + = max ( x,0 ) is the element-wise ReLU nonlinearity . The parameters θ contain the hidden unit size h∈N and all weights and biases . We let W ( 1 ) ∈Rh×d denote the matrix with w ( 1 ) l ∈Rd as rows and let b ( 1 ) , b ( 2 ) , w ( 2 ) ∈Rh be vectors with b ( 1 ) l , b ( 2 ) l , w ( 2 ) l ∈R as elements respectively . We let Θ denote this parameter space . Measure of complexity . Following Savarese et al . ( 2019 ) , the complexity of a network is associated with the squared Euclidean norm of the weights C ( θ ) = 1 2 ( ‖w ( 2 ) ‖22+‖W ( 1 ) ‖2F ) . The norm of f ∈H is the minimum norm required to represent f : ‖f‖= inf θ̂∈Θ C ( θ̂ ) s.t . fθ̂=f . ( 2 ) Savarese et al . ( 2019 ) showed that this norm is equivalent to Equation 1 for univariate networks . Since these complexity measures typically appear in generalization bounds Bartlett et al . ( 2017 ) ; Neyshabur et al . ( 2017 ) , we expect to improve generalization error by reducing these complexity measures . Minimum complexity reduces with a denoiser . Given Π ( y ) ∈ argminy∗∈V ‖y∗− y‖2 which is projection onto V ( breaking ties arbitrarily ) , we want to compare the norms of fdirect that represents f ? directly and the minimum norm base predictor that represents f ? : f∗base =argmin f∈H { ‖f‖ : Π◦f ( x ) =f ? ( x ) , x∈X } . ( 3 ) Note that ‖f∗base‖≤‖fdirect‖ since fdirect is a feasible solution . Thus composing can not increase the norm . Adjacent intervals measure stability . Our result depends crucially on the number of non-adjacent pairs of intervals in f ? . Suppose the output dimension is k = 1 . We define a pair of interval indices ( i , i+1 ) as adjacent if there is no valid output value y ∈V such that either y∗i < y < y∗i+1 or y∗i+1 < y < y ∗ i hold . The number of non-adjacent interval pairs characterizes the instability of f ? . Let |J | be the number of non-adjacent pairs and |I| be the number of adjacent pairs , where |I|+|J |=N−1 . Our bound also depends onL=mini|y∗i −y∗i+1| andU=maxi|y∗i −y∗i+1| , the min and max separation between valid points . For higher output dimensions ( k > 1 ) , let y∗i , j be the j-th output coordinate of the i-th valid point and let |Jj | , |Ij | , Lj , Uj be the analogous quantities for each output coordinate j∈ [ k ] . Theorem 1 . Let the valid output space V⊂Rk be a set overN multivariate output values { y∗1 , ... , y∗N } in V . Let f ? : R→Rk be a piecewise constant function defined onX = ] Ni=1 [ xli , xui ] where f ? ( x ) =y∗i if x∈ [ xli , xui ] . Let ∆x be the length of the smallest interval inX . Then ‖fdirect‖ ‖f∗base‖ =Ω NmaxjLj∑k j=1Uj ( |Jj |+δ |Ij |∆x ) ( 4 ) See Appendix A for a proof . If |Jj | are sublinear in N and valid points are evenly spaced , then the gap is Ω ( 1/δ ) which can be arbitrarily large for a fixed output dimension as δ→ 0 and N→∞ . If any |Jj | is linear in N ( many non-adjacent intervals ) , then there is only a constant factor gap in the worst case . Overall , if f ? is stable with respect to its discrete output space , we can learn a simpler base predictor that still represents f ? when composed with the denoiser . Note that in practice , we need to regularize the base predictor to find this low complexity solution .
This paper proposes a framework for problems where the output has some validity constraints, for e.g. the output must be a valid python program that must compile. These kind of problems arise naturally in settings such as pseudocode to program, and moreover there are many more unlabelled valid programs that are easily available (e.g. on Github) than there are labelled examples - i.e. paired pseudo-code, code examples. In this case, the authors propose the following framework of predict and de-noise: 1) train a de-noiser that learns to map synthetically noised versions of the un-labelled valid examples and 2) compose a predictor on the labelled examples with this de-noiser so that end predictions belong to the space of valid programs. The idea proposed in the paper is simple and intuitive, and the authors show that this approach leads to an improvement of 3-5% on the SPOC pseudo-code to code data-set. The authors also provide some theoretical justification why such a composition is the right thing to do.
SP:c56a2ed56cb664f09aaecb355c0012a57f61d245
Training GANs with Stronger Augmentations via Contrastive Discriminator
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have become one of the most prominent approaches for generative modeling with a wide range of applications ( Ho & Ermon , 2016 ; Zhu et al. , 2017 ; Karras et al. , 2019 ; Rott Shaham et al. , 2019 ) . In general , a GAN is defined by a minimax game between two neural networks : a generator network that maps a random vector into the data domain , and a discriminator network that classifies whether a given sample is real ( from the training dataset ) or fake ( from the generator ) . Provided that both generator and discriminator attain their optima at each minimax objective alternatively , it is theoretically guaranteed that the generator implicitly converges to model the data generating distribution ( Goodfellow et al. , 2014 ) . Due to the non-convex/stationary nature of the minimax game , however , training GANs in practice is often very unstable with an extreme sensitivity to many hyperparameters ( Salimans et al. , 2016 ; Lucic et al. , 2018 ; Kurach et al. , 2019 ) . Stabilizing the GAN dynamics has been extensively studied in the literature ( Arjovsky et al. , 2017 ; Gulrajani et al. , 2017 ; Miyato et al. , 2018 ; Wei et al. , 2018 ; Jolicoeur-Martineau , 2019 ; Chen et al. , 2019 ; Schonfeld et al. , 2020 ) , and the idea of incorporating data augmentation techniques has recently gained a particular attention on this line of research : more specifically , Zhang et al . ( 2020 ) have shown that consistency regularization between discriminator outputs of clean and augmented samples could greatly stabilize GAN training , and Zhao et al . ( 2020c ) further improved this idea . The question of which augmentations are good for GANs has been investigated very recently in several works ( Zhao et al. , 2020d ; Tran et al. , 2021 ; Karras et al. , 2020a ; Zhao et al. , 2020a ) , while they unanimously conclude only a limited range of augmentations ( e.g. , flipping and spatial translation ) were actually helpful for the current form of training GANs . Meanwhile , not only for GANs , data augmentation has also been played a key role in the literature of self-supervised representation learning ( Doersch et al. , 2015 ; Gidaris et al. , 2018 ; Wu et al. , 2018 ) , especially with the recent advances in contrastive learning ( Bachman et al. , 2019 ; Oord et al. , 2018 ; Chen et al. , 2020a ; b ; Grill et al. , 2020 ) : e.g. , Chen et al . ( 2020a ) have shown that the performance gap between supervised- and unsupervised learning can be significantly closed with large-scale contrastive learning over strong data augmentations . In this case , contrastive learning aims to extract the mutual information shared across augmentations , so good augmentations for contrastive learning should keep information relevant to downstream tasks ( e.g. , classification ) , while discarding nuisances for generalization . Finding such augmentations is still challenging , yet in some sense , it is more tangible than the case of GANs , as there are some known ways to formulate the goal rigourously , e.g. , InfoMax ( Linsker , 1988 ) or InfoMin principles ( Tian et al. , 2020 ) . Contribution . In this paper , we propose Contrastive Discriminator ( ContraD ) , a new way of training discriminators of GAN that incorporates the principle of contrastive learning . Specifically , instead of directly optimizing the discriminator network for the GAN loss , ContraD uses the network mainly to extract a contrastive representation from a given set of data augmentations and ( real or generated ) samples . The actual discriminator that minimizes the GAN loss is defined independently upon the contrastive representation , which turns out that a simple 2-layer network is sufficient to work as a complete GAN . By design , ContraD can be naturally trained with augmentations used in the literature of contrastive learning , e.g. , those proposed by SimCLR ( Chen et al. , 2020a ) , which are in fact much stronger than typical practices in the context of GAN training ( Zhang et al. , 2020 ; Zhao et al. , 2020c ; a ; Karras et al. , 2020a ) . Our key observation here is that , the task of contrastive learning ( to discriminate each of independent real samples ) and that of GAN discriminator ( to discriminate fake samples from the reals ) benefit each other when jointly trained with a shared representation . Self-supervised learning , including contrastive learning , have been recently applied in GAN as an auxiliary task upon the GAN loss ( Chen et al. , 2019 ; Tran et al. , 2019 ; Lee et al. , 2021 ; Zhao et al. , 2020d ) , mainly in attempt to alleviate catastopic forgetting in discriminators ( Chen et al. , 2019 ) . For conditional GANs , Kang & Park ( 2020 ) have proposed a contrastive form of loss to efficiently incorporate a given conditional information into discriminators . Our work can be differentiated to these prior works in a sense that , to the best of our knowledge , it is the first method that successfully leverage contrastive learning alone to incorporate a wide range of data augmentations in GAN training . Indeed , for example , Zhao et al . ( 2020d ) recently reported that simply regularizing auxiliary SimCLR loss ( Chen et al. , 2020a ) improves GAN training , but could not outperform existing methods based on simple data augmentations , e.g. , bCR ( Zhao et al. , 2020c ) . 2 BACKGROUND . Generative adversarial networks . We consider a problem of learning a generative model pg from a given dataset { xi } Ni=1 , where xi ∼ pdata and xi ∈ X . To this end , generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) considers two neural networks : ( a ) a generator network G : Z → X that maps a latent variable z ∼ p ( z ) into X , where p ( z ) is a specific prior distribution , and ( b ) a discriminator network D : X → [ 0 , 1 ] that discriminates samples from pdata and those from the implicit distribution pg derived fromG ( z ) . The primitive form of trainingG andD is the following : min G max D V ( G , D ) : = Ex∼pdata [ log ( D ( x ) ) ] + Ez∼p ( z ) [ log ( 1−D ( G ( z ) ) ) ] . ( 1 ) For a fixed G , the inner maximization objective ( 1 ) with respect to D leads to the following optimal discriminator D∗G , and consequently the outer minimization objective with respect to G becomes to minimize the Jensen-Shannon divergence between pdata and pg : D∗G : = maxD V ( G , D ) = pdata pdata+pg . Although this formulation ( 1 ) theoretically guarantees p∗g = pdata as the global optimum , the nonsaturating loss ( Goodfellow et al. , 2014 ) is more favored in practice for better optimization stability : max D L ( D ) : = V ( G , D ) , and min G L ( G ) : = −Ez [ log ( D ( G ( z ) ) ) ] . ( 2 ) Here , compared to ( 1 ) , G is now optimized to let D to classify G ( z ) as 1 , i.e. , the “ real ” . Contrastive representation learning . Consider two random variables v ( 1 ) and v ( 2 ) , which are often referred as views . Generally speaking , contrastive learning aims to extract a useful representation of v ( 1 ) and v ( 2 ) from learning a function that identifies whether a given sample is from p ( v ( 1 ) ) p ( v ( 2 ) |v ( 1 ) ) or p ( v ( 1 ) ) p ( v ( 2 ) ) , i.e. , whether two views are dependent or not . More specifically , the function estimates the mutual information I ( v ( 1 ) ; v ( 2 ) ) between the two views . To this end , Oord et al . ( 2018 ) proposed to minimize InfoNCE loss , which turns out to maximize a lower bound of I ( v ( 1 ) ; v ( 2 ) ) . Formally , for a given v ( 1 ) i ∼ p ( v ( 1 ) ) and v ( 2 ) i ∼ p ( v ( 2 ) |v ( 1 ) i ) while assuming v ( 2 ) j ∼ p ( v ( 2 ) ) for j = 1 , · · · , K , the InfoNCE loss is defined by : LNCE ( v ( 1 ) i ; v ( 2 ) , s ) : = − log exp ( s ( v ( 1 ) i , v ( 2 ) i ) ) ∑K j=1 exp ( s ( v ( 1 ) i , v ( 2 ) j ) ) , ( 3 ) where s ( · , · ) is the score function that models the log-density ratio of p ( v ( 2 ) |v ( 1 ) ) to p ( v ( 2 ) ) , possibly including some parametrized encoders for v ( 1 ) and v ( 2 ) . Many of recent unsupervised representation learning methods are based on this general framework of contrastive learning ( Wu et al. , 2018 ; Bachman et al. , 2019 ; Hénaff et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020a ) . In this paper , we focus on the one called SimCLR ( Chen et al. , 2020a ) , that adopts a wide range of independent data augmentations to define views : specifically , for a given set of data samples x = [ xi ] Ni=1 , SimCLR applys two independent augmentations , namely t1 and t2 , to the given data to obtain v ( 1 ) and v ( 2 ) , i.e. , ( v ( 1 ) , v ( 2 ) ) : = ( t1 ( x ) , t2 ( x ) ) . The actual loss of SimCLR is slightly different to InfoNCE , mainly due to practical considerations for sample efficiency : LSimCLR ( v ( 1 ) , v ( 2 ) ) : = 1 2N N∑ i=1 ( LNCE ( v ( 1 ) i ; [ v ( 2 ) ; v ( 1 ) −i ] , sSimCLR ) + LNCE ( v ( 2 ) i ; [ v ( 1 ) ; v ( 2 ) −i ] , sSimCLR ) ) , ( 4 ) where v−i : = v \ { vi } . For sSimCLR , SimCLR specifies to use ( a ) an encoder network f : X → Rde , ( b ) a small neural network called projection head h : Rde → Rdp , and ( c ) the normalized temperature-scaled cross entropy ( NT-Xent ) . Putting altogether , sSimCLR is defined by : sSimCLR ( v ( 1 ) , v ( 2 ) ; f , h ) : = h ( f ( v ( 1 ) ) ) · h ( f ( v ( 2 ) ) ) τ · ||h ( f ( v ( 1 ) ) ) ||2||h ( f ( v ( 2 ) ) ) ||2 , ( 5 ) where τ is a temperature hyperparameter . Once the training is done with respect to LSimCLR , the projection head h is discarded and f is served as the learned representation for downstream tasks .
The authors propose to improve GAN training by incorporating augmentations from contrastive learning. Specifically, a new contrastive discriminator, named ContraD, is proposed for GANs; with ContraD, the encoder part of the discriminator is trained with (two) contrastive learning losses, while the left discriminator head and the GAN generator are trained as usual. The authors argue that this specific fusion of GAN and contrastive learning significantly stabilizes GAN training and, moreover, the fused two research fields could benefit each other.
SP:a7f1259c98d2b58e608bf64299e2790351f78099
Training GANs with Stronger Augmentations via Contrastive Discriminator
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have become one of the most prominent approaches for generative modeling with a wide range of applications ( Ho & Ermon , 2016 ; Zhu et al. , 2017 ; Karras et al. , 2019 ; Rott Shaham et al. , 2019 ) . In general , a GAN is defined by a minimax game between two neural networks : a generator network that maps a random vector into the data domain , and a discriminator network that classifies whether a given sample is real ( from the training dataset ) or fake ( from the generator ) . Provided that both generator and discriminator attain their optima at each minimax objective alternatively , it is theoretically guaranteed that the generator implicitly converges to model the data generating distribution ( Goodfellow et al. , 2014 ) . Due to the non-convex/stationary nature of the minimax game , however , training GANs in practice is often very unstable with an extreme sensitivity to many hyperparameters ( Salimans et al. , 2016 ; Lucic et al. , 2018 ; Kurach et al. , 2019 ) . Stabilizing the GAN dynamics has been extensively studied in the literature ( Arjovsky et al. , 2017 ; Gulrajani et al. , 2017 ; Miyato et al. , 2018 ; Wei et al. , 2018 ; Jolicoeur-Martineau , 2019 ; Chen et al. , 2019 ; Schonfeld et al. , 2020 ) , and the idea of incorporating data augmentation techniques has recently gained a particular attention on this line of research : more specifically , Zhang et al . ( 2020 ) have shown that consistency regularization between discriminator outputs of clean and augmented samples could greatly stabilize GAN training , and Zhao et al . ( 2020c ) further improved this idea . The question of which augmentations are good for GANs has been investigated very recently in several works ( Zhao et al. , 2020d ; Tran et al. , 2021 ; Karras et al. , 2020a ; Zhao et al. , 2020a ) , while they unanimously conclude only a limited range of augmentations ( e.g. , flipping and spatial translation ) were actually helpful for the current form of training GANs . Meanwhile , not only for GANs , data augmentation has also been played a key role in the literature of self-supervised representation learning ( Doersch et al. , 2015 ; Gidaris et al. , 2018 ; Wu et al. , 2018 ) , especially with the recent advances in contrastive learning ( Bachman et al. , 2019 ; Oord et al. , 2018 ; Chen et al. , 2020a ; b ; Grill et al. , 2020 ) : e.g. , Chen et al . ( 2020a ) have shown that the performance gap between supervised- and unsupervised learning can be significantly closed with large-scale contrastive learning over strong data augmentations . In this case , contrastive learning aims to extract the mutual information shared across augmentations , so good augmentations for contrastive learning should keep information relevant to downstream tasks ( e.g. , classification ) , while discarding nuisances for generalization . Finding such augmentations is still challenging , yet in some sense , it is more tangible than the case of GANs , as there are some known ways to formulate the goal rigourously , e.g. , InfoMax ( Linsker , 1988 ) or InfoMin principles ( Tian et al. , 2020 ) . Contribution . In this paper , we propose Contrastive Discriminator ( ContraD ) , a new way of training discriminators of GAN that incorporates the principle of contrastive learning . Specifically , instead of directly optimizing the discriminator network for the GAN loss , ContraD uses the network mainly to extract a contrastive representation from a given set of data augmentations and ( real or generated ) samples . The actual discriminator that minimizes the GAN loss is defined independently upon the contrastive representation , which turns out that a simple 2-layer network is sufficient to work as a complete GAN . By design , ContraD can be naturally trained with augmentations used in the literature of contrastive learning , e.g. , those proposed by SimCLR ( Chen et al. , 2020a ) , which are in fact much stronger than typical practices in the context of GAN training ( Zhang et al. , 2020 ; Zhao et al. , 2020c ; a ; Karras et al. , 2020a ) . Our key observation here is that , the task of contrastive learning ( to discriminate each of independent real samples ) and that of GAN discriminator ( to discriminate fake samples from the reals ) benefit each other when jointly trained with a shared representation . Self-supervised learning , including contrastive learning , have been recently applied in GAN as an auxiliary task upon the GAN loss ( Chen et al. , 2019 ; Tran et al. , 2019 ; Lee et al. , 2021 ; Zhao et al. , 2020d ) , mainly in attempt to alleviate catastopic forgetting in discriminators ( Chen et al. , 2019 ) . For conditional GANs , Kang & Park ( 2020 ) have proposed a contrastive form of loss to efficiently incorporate a given conditional information into discriminators . Our work can be differentiated to these prior works in a sense that , to the best of our knowledge , it is the first method that successfully leverage contrastive learning alone to incorporate a wide range of data augmentations in GAN training . Indeed , for example , Zhao et al . ( 2020d ) recently reported that simply regularizing auxiliary SimCLR loss ( Chen et al. , 2020a ) improves GAN training , but could not outperform existing methods based on simple data augmentations , e.g. , bCR ( Zhao et al. , 2020c ) . 2 BACKGROUND . Generative adversarial networks . We consider a problem of learning a generative model pg from a given dataset { xi } Ni=1 , where xi ∼ pdata and xi ∈ X . To this end , generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) considers two neural networks : ( a ) a generator network G : Z → X that maps a latent variable z ∼ p ( z ) into X , where p ( z ) is a specific prior distribution , and ( b ) a discriminator network D : X → [ 0 , 1 ] that discriminates samples from pdata and those from the implicit distribution pg derived fromG ( z ) . The primitive form of trainingG andD is the following : min G max D V ( G , D ) : = Ex∼pdata [ log ( D ( x ) ) ] + Ez∼p ( z ) [ log ( 1−D ( G ( z ) ) ) ] . ( 1 ) For a fixed G , the inner maximization objective ( 1 ) with respect to D leads to the following optimal discriminator D∗G , and consequently the outer minimization objective with respect to G becomes to minimize the Jensen-Shannon divergence between pdata and pg : D∗G : = maxD V ( G , D ) = pdata pdata+pg . Although this formulation ( 1 ) theoretically guarantees p∗g = pdata as the global optimum , the nonsaturating loss ( Goodfellow et al. , 2014 ) is more favored in practice for better optimization stability : max D L ( D ) : = V ( G , D ) , and min G L ( G ) : = −Ez [ log ( D ( G ( z ) ) ) ] . ( 2 ) Here , compared to ( 1 ) , G is now optimized to let D to classify G ( z ) as 1 , i.e. , the “ real ” . Contrastive representation learning . Consider two random variables v ( 1 ) and v ( 2 ) , which are often referred as views . Generally speaking , contrastive learning aims to extract a useful representation of v ( 1 ) and v ( 2 ) from learning a function that identifies whether a given sample is from p ( v ( 1 ) ) p ( v ( 2 ) |v ( 1 ) ) or p ( v ( 1 ) ) p ( v ( 2 ) ) , i.e. , whether two views are dependent or not . More specifically , the function estimates the mutual information I ( v ( 1 ) ; v ( 2 ) ) between the two views . To this end , Oord et al . ( 2018 ) proposed to minimize InfoNCE loss , which turns out to maximize a lower bound of I ( v ( 1 ) ; v ( 2 ) ) . Formally , for a given v ( 1 ) i ∼ p ( v ( 1 ) ) and v ( 2 ) i ∼ p ( v ( 2 ) |v ( 1 ) i ) while assuming v ( 2 ) j ∼ p ( v ( 2 ) ) for j = 1 , · · · , K , the InfoNCE loss is defined by : LNCE ( v ( 1 ) i ; v ( 2 ) , s ) : = − log exp ( s ( v ( 1 ) i , v ( 2 ) i ) ) ∑K j=1 exp ( s ( v ( 1 ) i , v ( 2 ) j ) ) , ( 3 ) where s ( · , · ) is the score function that models the log-density ratio of p ( v ( 2 ) |v ( 1 ) ) to p ( v ( 2 ) ) , possibly including some parametrized encoders for v ( 1 ) and v ( 2 ) . Many of recent unsupervised representation learning methods are based on this general framework of contrastive learning ( Wu et al. , 2018 ; Bachman et al. , 2019 ; Hénaff et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020a ) . In this paper , we focus on the one called SimCLR ( Chen et al. , 2020a ) , that adopts a wide range of independent data augmentations to define views : specifically , for a given set of data samples x = [ xi ] Ni=1 , SimCLR applys two independent augmentations , namely t1 and t2 , to the given data to obtain v ( 1 ) and v ( 2 ) , i.e. , ( v ( 1 ) , v ( 2 ) ) : = ( t1 ( x ) , t2 ( x ) ) . The actual loss of SimCLR is slightly different to InfoNCE , mainly due to practical considerations for sample efficiency : LSimCLR ( v ( 1 ) , v ( 2 ) ) : = 1 2N N∑ i=1 ( LNCE ( v ( 1 ) i ; [ v ( 2 ) ; v ( 1 ) −i ] , sSimCLR ) + LNCE ( v ( 2 ) i ; [ v ( 1 ) ; v ( 2 ) −i ] , sSimCLR ) ) , ( 4 ) where v−i : = v \ { vi } . For sSimCLR , SimCLR specifies to use ( a ) an encoder network f : X → Rde , ( b ) a small neural network called projection head h : Rde → Rdp , and ( c ) the normalized temperature-scaled cross entropy ( NT-Xent ) . Putting altogether , sSimCLR is defined by : sSimCLR ( v ( 1 ) , v ( 2 ) ; f , h ) : = h ( f ( v ( 1 ) ) ) · h ( f ( v ( 2 ) ) ) τ · ||h ( f ( v ( 1 ) ) ) ||2||h ( f ( v ( 2 ) ) ) ||2 , ( 5 ) where τ is a temperature hyperparameter . Once the training is done with respect to LSimCLR , the projection head h is discarded and f is served as the learned representation for downstream tasks .
In this paper, the authors suggest using the contrastive loss to improve the training of the discriminator and further stabilize the GAN training process. More specifically, the proposed method incorporates the self-supervised simCLR contrastive loss on a pair of transformed real images and supervised contrastive loss on the fake ones. The proposed method is evaluated on the image synthesis task on CIFAR10/100 and CelebA-HQ-128 images and over several different GAN models.
SP:a7f1259c98d2b58e608bf64299e2790351f78099
Training GANs with Stronger Augmentations via Contrastive Discriminator
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have become one of the most prominent approaches for generative modeling with a wide range of applications ( Ho & Ermon , 2016 ; Zhu et al. , 2017 ; Karras et al. , 2019 ; Rott Shaham et al. , 2019 ) . In general , a GAN is defined by a minimax game between two neural networks : a generator network that maps a random vector into the data domain , and a discriminator network that classifies whether a given sample is real ( from the training dataset ) or fake ( from the generator ) . Provided that both generator and discriminator attain their optima at each minimax objective alternatively , it is theoretically guaranteed that the generator implicitly converges to model the data generating distribution ( Goodfellow et al. , 2014 ) . Due to the non-convex/stationary nature of the minimax game , however , training GANs in practice is often very unstable with an extreme sensitivity to many hyperparameters ( Salimans et al. , 2016 ; Lucic et al. , 2018 ; Kurach et al. , 2019 ) . Stabilizing the GAN dynamics has been extensively studied in the literature ( Arjovsky et al. , 2017 ; Gulrajani et al. , 2017 ; Miyato et al. , 2018 ; Wei et al. , 2018 ; Jolicoeur-Martineau , 2019 ; Chen et al. , 2019 ; Schonfeld et al. , 2020 ) , and the idea of incorporating data augmentation techniques has recently gained a particular attention on this line of research : more specifically , Zhang et al . ( 2020 ) have shown that consistency regularization between discriminator outputs of clean and augmented samples could greatly stabilize GAN training , and Zhao et al . ( 2020c ) further improved this idea . The question of which augmentations are good for GANs has been investigated very recently in several works ( Zhao et al. , 2020d ; Tran et al. , 2021 ; Karras et al. , 2020a ; Zhao et al. , 2020a ) , while they unanimously conclude only a limited range of augmentations ( e.g. , flipping and spatial translation ) were actually helpful for the current form of training GANs . Meanwhile , not only for GANs , data augmentation has also been played a key role in the literature of self-supervised representation learning ( Doersch et al. , 2015 ; Gidaris et al. , 2018 ; Wu et al. , 2018 ) , especially with the recent advances in contrastive learning ( Bachman et al. , 2019 ; Oord et al. , 2018 ; Chen et al. , 2020a ; b ; Grill et al. , 2020 ) : e.g. , Chen et al . ( 2020a ) have shown that the performance gap between supervised- and unsupervised learning can be significantly closed with large-scale contrastive learning over strong data augmentations . In this case , contrastive learning aims to extract the mutual information shared across augmentations , so good augmentations for contrastive learning should keep information relevant to downstream tasks ( e.g. , classification ) , while discarding nuisances for generalization . Finding such augmentations is still challenging , yet in some sense , it is more tangible than the case of GANs , as there are some known ways to formulate the goal rigourously , e.g. , InfoMax ( Linsker , 1988 ) or InfoMin principles ( Tian et al. , 2020 ) . Contribution . In this paper , we propose Contrastive Discriminator ( ContraD ) , a new way of training discriminators of GAN that incorporates the principle of contrastive learning . Specifically , instead of directly optimizing the discriminator network for the GAN loss , ContraD uses the network mainly to extract a contrastive representation from a given set of data augmentations and ( real or generated ) samples . The actual discriminator that minimizes the GAN loss is defined independently upon the contrastive representation , which turns out that a simple 2-layer network is sufficient to work as a complete GAN . By design , ContraD can be naturally trained with augmentations used in the literature of contrastive learning , e.g. , those proposed by SimCLR ( Chen et al. , 2020a ) , which are in fact much stronger than typical practices in the context of GAN training ( Zhang et al. , 2020 ; Zhao et al. , 2020c ; a ; Karras et al. , 2020a ) . Our key observation here is that , the task of contrastive learning ( to discriminate each of independent real samples ) and that of GAN discriminator ( to discriminate fake samples from the reals ) benefit each other when jointly trained with a shared representation . Self-supervised learning , including contrastive learning , have been recently applied in GAN as an auxiliary task upon the GAN loss ( Chen et al. , 2019 ; Tran et al. , 2019 ; Lee et al. , 2021 ; Zhao et al. , 2020d ) , mainly in attempt to alleviate catastopic forgetting in discriminators ( Chen et al. , 2019 ) . For conditional GANs , Kang & Park ( 2020 ) have proposed a contrastive form of loss to efficiently incorporate a given conditional information into discriminators . Our work can be differentiated to these prior works in a sense that , to the best of our knowledge , it is the first method that successfully leverage contrastive learning alone to incorporate a wide range of data augmentations in GAN training . Indeed , for example , Zhao et al . ( 2020d ) recently reported that simply regularizing auxiliary SimCLR loss ( Chen et al. , 2020a ) improves GAN training , but could not outperform existing methods based on simple data augmentations , e.g. , bCR ( Zhao et al. , 2020c ) . 2 BACKGROUND . Generative adversarial networks . We consider a problem of learning a generative model pg from a given dataset { xi } Ni=1 , where xi ∼ pdata and xi ∈ X . To this end , generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) considers two neural networks : ( a ) a generator network G : Z → X that maps a latent variable z ∼ p ( z ) into X , where p ( z ) is a specific prior distribution , and ( b ) a discriminator network D : X → [ 0 , 1 ] that discriminates samples from pdata and those from the implicit distribution pg derived fromG ( z ) . The primitive form of trainingG andD is the following : min G max D V ( G , D ) : = Ex∼pdata [ log ( D ( x ) ) ] + Ez∼p ( z ) [ log ( 1−D ( G ( z ) ) ) ] . ( 1 ) For a fixed G , the inner maximization objective ( 1 ) with respect to D leads to the following optimal discriminator D∗G , and consequently the outer minimization objective with respect to G becomes to minimize the Jensen-Shannon divergence between pdata and pg : D∗G : = maxD V ( G , D ) = pdata pdata+pg . Although this formulation ( 1 ) theoretically guarantees p∗g = pdata as the global optimum , the nonsaturating loss ( Goodfellow et al. , 2014 ) is more favored in practice for better optimization stability : max D L ( D ) : = V ( G , D ) , and min G L ( G ) : = −Ez [ log ( D ( G ( z ) ) ) ] . ( 2 ) Here , compared to ( 1 ) , G is now optimized to let D to classify G ( z ) as 1 , i.e. , the “ real ” . Contrastive representation learning . Consider two random variables v ( 1 ) and v ( 2 ) , which are often referred as views . Generally speaking , contrastive learning aims to extract a useful representation of v ( 1 ) and v ( 2 ) from learning a function that identifies whether a given sample is from p ( v ( 1 ) ) p ( v ( 2 ) |v ( 1 ) ) or p ( v ( 1 ) ) p ( v ( 2 ) ) , i.e. , whether two views are dependent or not . More specifically , the function estimates the mutual information I ( v ( 1 ) ; v ( 2 ) ) between the two views . To this end , Oord et al . ( 2018 ) proposed to minimize InfoNCE loss , which turns out to maximize a lower bound of I ( v ( 1 ) ; v ( 2 ) ) . Formally , for a given v ( 1 ) i ∼ p ( v ( 1 ) ) and v ( 2 ) i ∼ p ( v ( 2 ) |v ( 1 ) i ) while assuming v ( 2 ) j ∼ p ( v ( 2 ) ) for j = 1 , · · · , K , the InfoNCE loss is defined by : LNCE ( v ( 1 ) i ; v ( 2 ) , s ) : = − log exp ( s ( v ( 1 ) i , v ( 2 ) i ) ) ∑K j=1 exp ( s ( v ( 1 ) i , v ( 2 ) j ) ) , ( 3 ) where s ( · , · ) is the score function that models the log-density ratio of p ( v ( 2 ) |v ( 1 ) ) to p ( v ( 2 ) ) , possibly including some parametrized encoders for v ( 1 ) and v ( 2 ) . Many of recent unsupervised representation learning methods are based on this general framework of contrastive learning ( Wu et al. , 2018 ; Bachman et al. , 2019 ; Hénaff et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020a ) . In this paper , we focus on the one called SimCLR ( Chen et al. , 2020a ) , that adopts a wide range of independent data augmentations to define views : specifically , for a given set of data samples x = [ xi ] Ni=1 , SimCLR applys two independent augmentations , namely t1 and t2 , to the given data to obtain v ( 1 ) and v ( 2 ) , i.e. , ( v ( 1 ) , v ( 2 ) ) : = ( t1 ( x ) , t2 ( x ) ) . The actual loss of SimCLR is slightly different to InfoNCE , mainly due to practical considerations for sample efficiency : LSimCLR ( v ( 1 ) , v ( 2 ) ) : = 1 2N N∑ i=1 ( LNCE ( v ( 1 ) i ; [ v ( 2 ) ; v ( 1 ) −i ] , sSimCLR ) + LNCE ( v ( 2 ) i ; [ v ( 1 ) ; v ( 2 ) −i ] , sSimCLR ) ) , ( 4 ) where v−i : = v \ { vi } . For sSimCLR , SimCLR specifies to use ( a ) an encoder network f : X → Rde , ( b ) a small neural network called projection head h : Rde → Rdp , and ( c ) the normalized temperature-scaled cross entropy ( NT-Xent ) . Putting altogether , sSimCLR is defined by : sSimCLR ( v ( 1 ) , v ( 2 ) ; f , h ) : = h ( f ( v ( 1 ) ) ) · h ( f ( v ( 2 ) ) ) τ · ||h ( f ( v ( 1 ) ) ) ||2||h ( f ( v ( 2 ) ) ) ||2 , ( 5 ) where τ is a temperature hyperparameter . Once the training is done with respect to LSimCLR , the projection head h is discarded and f is served as the learned representation for downstream tasks .
This paper improves upon state-of-the-art GANs by incorporating recent advances of contrastive representation learning into the training of discriminator. In particular, the discriminator loss function consists of three terms: (1) the original SimCLR loss on the multi-view real data pairs; (2) the supervised contrastive loss (Khosla et al, 2020) that assigns high scores among the fake sample pairs and giving lower score among the real data pairs; (3) the usual discriminator loss in GAN training. While each of these terms alone is not entirely new, the author proposes several tricks to make the training of GANs together with the contrastive loss works. Empirically, the proposed method outperforms other GAN methods trained with auxiliary data augmentation techniques, and demonstrates good representations under the linear classifier probing setup.
SP:a7f1259c98d2b58e608bf64299e2790351f78099
A PAC-Bayesian Approach to Generalization Bounds for Graph Neural Networks
1 INTRODUCTION . Graph neural networks ( GNNs ) ( Gori et al. , 2005 ; Scarselli et al. , 2008 ; Bronstein et al. , 2017 ; Battaglia et al. , 2018 ) have become very popular recently due to their ability to learn powerful representations from graph-structured data , and have achieved state-of-the-art results in a variety of application domains such as social networks ( Hamilton et al. , 2017 ; Xu et al. , 2018 ) , quantum chemistry ( Gilmer et al. , 2017 ; Chen et al. , 2019a ) , computer vision ( Qi et al. , 2017 ; Monti et al. , 2017 ) , reinforcement learning ( Sanchez-Gonzalez et al. , 2018 ; Wang et al. , 2018 ) , robotics ( Casas et al. , 2019 ; Liang et al. , 2020 ) , and physics ( Henrion et al. , 2017 ) . Given a graph along with node/edge features , GNNs learn node/edge representations by propagating information on the graph via local computations shared across the nodes/edges . Based on the specific form of local computation employed , GNNs can be divided into two categories : graph convolution based GNNs ( Bruna et al. , 2013 ; Duvenaud et al. , 2015 ; Kipf & Welling , 2016 ) and message passing based GNNs ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) . The former generalizes the convolution operator from regular graphs ( e.g. , grids ) to ones with arbitrary topology , whereas the latter mimics message passing algorithms and parameterizes the shared functions via neural networks . Due to the tremendous empirical success of GNNs , there is increasing interest in understanding their theoretical properties . For example , some recent works study their expressiveness ( Maron et al. , 2018 ; Xu et al. , 2018 ; Chen et al. , 2019b ) , that is , what class of functions can be represented by GNNs . However , only few works investigate why GNNs generalize so well to unseen graphs . They are either restricted to a specific model variant ( Verma & Zhang , 2019 ; Du et al. , 2019 ; Garg et al. , 2020 ) or have loose dependencies on graph statistics ( Scarselli et al. , 2018 ) . On the other hand , GNNs have close ties to standard feedforward neural networks , e.g. , multi-layer perceptrons ( MLPs ) and convolutional neural networks ( CNNs ) . In particular , if each i.i.d . sample is viewed as a node , then the whole dataset becomes a graph without edges . Therefore , GNNs can be seen as generalizations of MLPs/CNNs since they model not only the regularities within a sample but also the dependencies among samples as defined in the graph . It is therefore natural to ask if we can generalize the recent advancements on generalization bounds for MLPs/CNNs ( Harvey et al. , 2017 ; Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Dziugaite & Roy , 2017 ; Arora et al. , 2018 ; 2019 ) to GNNs , and how would graph structures affect the generalization bounds ? In this paper , we answer the above questions by proving generalization bounds for the two primary classes of GNNs , i.e. , graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) and messagepassing GNNs ( MPGNNs ) ( Dai et al. , 2016 ; Jin et al. , 2018 ) . Our generalization bound for GCNs shows an intimate relationship with the bounds for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ) . In particular , they share the same term , i.e. , the product of the spectral norms of the learned weights at each layer multiplied by a factor that is additive across layers . The bound for GCNs has an additional multiplicative factor d ( l 1 ) /2 where d 1 is the maximum node degree and l is the network depth . Since MLPs/CNNs are special GNNs operating on graphs without edges ( i.e. , d 1 = 0 ) , the bound for GCNs coincides with the ones for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ) on such degenerated graphs . Therefore , our result is a natural generalization of the existing results for MLPs/CNNs . Our generalization bound for message passing GNNs reveals that the governing terms of the bound are similar to the ones of GCNs , i.e. , the geometric series of the learned weights and the multiplicative factor dl 1 . The geometric series appears due to the weight sharing across message passing steps , thus corresponding to the product term across layers in GCNs . The term dl 1 encodes the key graph statistics . Our bound improves the dependency on the maximum node degree and the maximum hidden dimension compared to the recent Rademacher complexity based bound ( Garg et al. , 2020 ) . Moreover , we compute the bound values on four real-world graph datasets ( e.g. , social networks and protein structures ) and verify that our bounds are tighter . In terms of the proof techniques , our analysis follows the PAC-Bayes framework in the seminal work of ( Neyshabur et al. , 2017 ) for MLPs/CNNs with ReLU activations . However , we make two distinctive contributions which are customized for GNNs . First , a naive adaptation of the perturbation analysis in ( Neyshabur et al. , 2017 ) does not work for GNNs since ReLU is not 1-Lipschitz under the spectral norm , i.e. , kReLU ( X ) k2 kXk2 does not hold for some real matrix X . Instead , we construct the recursion on certain node representations of GNNs like the one with maximum ` 2 norm , so that we can perform perturbation analysis with vector 2-norm . Second , in contrast to ( Neyshabur et al. , 2017 ) which only handles the homogeneous networks , i.e. , f ( ax ) = af ( x ) when a 0 , we properly construct a quantity of the learned weights which 1 ) provides a way to satisfy the constraints of the previous perturbation analysis and 2 ) induces a finite covering on the range of the quantity so that the PAC-Bayes bound holds for all possible weights . This generalizes the analysis to non-homogeneous GNNs like typical MPGNNs . The rest of the paper is organized as follows . In Section 2 , we introduce background material necessary for our analysis . We then present our generalization bounds and the comparison to existing results in Section 3 . We also provide an empirical study to support our theoretical arguments in Section 4 . At last , we discuss the extensions , limitations and some open problems . 2 BACKGROUND . In this section , we first explain our analysis setup including notation and assumptions . We then describe the two representative GNN models in detail . Finally , we review the PAC-Bayes analysis . 2.1 ANALYSIS SETUP . In the following analysis , we consider the K-class graph classification problem which is common in the GNN literature , where given a graph sample z , we would like to classify it into one of the predefined K classes . We will discuss extensions to other problems like graph regression in Section 5 . Each graph sample z is a triplet of an adjacency matrix A , node features X 2 Rn⇥h0 and output label y 2 R1⇥K , i.e . z = ( A , X , y ) , where n is the number of nodes and h0 is the input feature dimension . We start our discussion by defining our notations . Let N+k be the first k positive integers , i.e. , N+k = { 1 , 2 , . . . , k } , | · |p the vector p-norm and k · kp the operator norm induced by the vector p-norm . Further , k · kF denotes the Frobenius norm of a matrix , e the base of the natural logarithm function log , A [ i , j ] the ( i , j ) -th element of matrix A and A [ i , : ] the i-th row . We use parenthesis to avoid the ambiguity , e.g. , ( AB ) [ i , j ] means the ( i , j ) -th element of the product matrix AB . We then introduce some terminologies from statistical learning theory and define the sample space as Z , z = ( A , X , y ) 2 Z where X 2 X ( node feature space ) and A 2 G ( graph space ) , data distribution D , z iid⇠ D , hypothesis ( or model ) fw where fw 2 H ( hypothesis class ) , and training set S with size m , S = { z1 , . . . , zm } . We make the following assumptions which also appear in the literature : A1 Data , i.e. , triplets ( A , X , y ) , are i.i.d . samples drawn from some unknown distribution D. A2 The maximum hidden dimension across all layers is h. A3 Node feature of any graph is contained in a ` 2-ball with radius B . Specifically , we have 8i 2 N+n , the i-th node feature X [ i , : ] 2 XB , h0 = { x 2 Rh0 | Ph0 j=1 x 2 j B2 } . A4 We only consider simple graphs ( i.e. , undirected , no loops1 , and no multi-edges ) with maximum node degree as d 1 . Note that it is straightforward to estimate B and d empirically on real-world graph data . 2.2 GRAPH NEURAL NETWORKS ( GNNS ) . In this part , we describe the details of the GNN models and the loss function we used for the graph classification problem . The essential idea of GNNs is to propagate information over the graph so that the learned representations capture the dependencies among nodes/edges . We now review two classes of GNNs , GCNs and MPGNNs , which have different mechanisms for propagating information . We choose them since they are the most popular variants and represent two common types of neural networks , i.e. , feedforward ( GCNs ) and recurrent ( MPGNNs ) neural networks . We discuss the extension of our analysis to other GNN variants in Section 5 . For ease of notation , we define the model to be fw 2 H : X ⇥ G ! RK where w is the vectorization of all model parameters . GCNs : Graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) for the K-class graph classification problem can be defined as follows , Hk = k ⇣ L̃Hk 1Wk ⌘ ( k-th Graph Convolution Layer ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 1 ) where k 2 N+l 1 , Hk 2 Rn⇥hk are the node representations/states , 1n 2 R1⇥n is a all-one vector , l is the number of layers.2 and Wj is the weight matrix of the j-th layer . The initial node state is the observed node feature H0 = X . For both GCNs and MPGNNs , we consider l > 1 since otherwise the model degenerates to a linear transformation which does not leverage the graph and is trivial to analyze . Due to assumption A2 , Wj is of size at most h ⇥ h , i.e. , hk h , 8k 2 N+l 1 . The graph Laplacian L̃ is defined as , à = I + A , L̃ = D 12 ÃD 12 where D is the degree matrix of à . Note that the maximum eigenvalue of L̃ is 1 in this case . We absorb the bias into the weight by appending constant 1 to the node feature . Typically , GCNs use ReLU as the non-linearity , i.e. , i ( x ) = max ( 0 , x ) , 8i = 1 , · · · , l 1 . We use the common mean-readout to obtain the graph representation where Hl 1 2 Rn⇥hl 1 , Wl 2 Rhl 1⇥K , and Hl 2 R1⇥K . MPGNNs : There are multiple variants of message passing GNNs , e.g. , ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) , which share the same algorithmic framework but instantiate a few components differently , e.g. , the node state update function . We choose the same class of models as in ( Garg et al. , 2020 ) which are popular in the literature ( Dai et al. , 2016 ; Jin et al. , 2018 ) in order to fairly compare bounds . This MPGNN model can be written in matrix forms as follows , Mk = g ( C > outHk 1 ) ( k-th step Message Computation ) M̄k = CinMk ( k-th step Message Aggregation ) Hk = XW1 + ⇢ M̄k W2 ( k-th step Node State Update ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 2 ) 1Here loop means an edge that connects a vertex to itself , a.k.a. , self-loop . 2We count the readout function as a layer to be consistent with the existing analysis of MLPs/CNNs . where k 2 N+l 1 , Hk 2 Rn⇥hk are node representations/states and Hl 2 R1⇥K is the output representation . Here we initialize H0 = 0 . W.l.o.g. , we assume 8k 2 N+l 1 , Hk 2 Rn⇥h and Mk 2 Rn⇥h since h is the maximum hidden dimension . Cin 2 Rn⇥c and Cout 2 Rn⇥c ( c is the number of edges ) are the incidence matrices corresponding to incoming and outgoing nodes3 respectively . Specifically , rows and columns of Cin and Cout correspond to nodes and edges respectively . Cin [ i , j ] = 1 indicates that the incoming node of the j-th edge is the i-th node . Similarly , Cout [ i , j ] = 1 indicates that the outgoing node of the j-th edge is the i-th node . g , , ⇢ are nonlinear mappings , e.g. , ReLU and Tanh . Technically speaking , g : Rh ! Rh , : Rh ! Rh , and ⇢ : Rh ! Rh operate on vector-states of individual node/edge . However , since we share these functions across nodes/edges , we can naturally generalize them to matrix-states , e.g. , ̃ : Rn⇥h ! Rn⇥h where ̃ ( X ) [ i , : ] = ( X [ i , : ] ) . By doing so , the same function could be applied to matrices with varying size of the first dimension . For simplicity , we use g , , ⇢ to denote such generalization to matrices . We denote the Lipschitz constants of g , , ⇢ under the vector 2-norm as Cg , C , C⇢ respectively . We also assume g ( 0 ) = 0 , ( 0 ) = 0 , and ⇢ ( 0 ) = 0 and define the percolation complexity as C = CgC C⇢kW2k2 following ( Garg et al. , 2020 ) . Multiclass Margin Loss : We use the multi-class -margin loss following ( Bartlett et al. , 2017 ; Neyshabur et al. , 2017 ) . The generalization error is defined as , LD , ( fw ) = P z⇠D ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ , ( 3 ) where > 0 and fw ( X , A ) is the l-th layer representations , i.e. , Hl = fw ( X , A ) . Accordingly , we can define the empirical error as , LS , ( fw ) = 1 m X zi2S 1 ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ . ( 4 )
This paper provides results of generalization bounds for two types of GNNs: GCN and MPGNN. The presented analysis follows the framework of Neyshabur 2017 to construct posterior by adding random perturbations so that the PAC-Bayesian technique can be applied. The main contributions are the perturbation analysis for GCN and MPGNN, which results in a bound depending on the graph statistics. The paper compares the derived bounds with existing results, and examines the bounds numerically through experiments.
SP:edbfbf6b8fa385217b88beaad54cfa64fd814c58
A PAC-Bayesian Approach to Generalization Bounds for Graph Neural Networks
1 INTRODUCTION . Graph neural networks ( GNNs ) ( Gori et al. , 2005 ; Scarselli et al. , 2008 ; Bronstein et al. , 2017 ; Battaglia et al. , 2018 ) have become very popular recently due to their ability to learn powerful representations from graph-structured data , and have achieved state-of-the-art results in a variety of application domains such as social networks ( Hamilton et al. , 2017 ; Xu et al. , 2018 ) , quantum chemistry ( Gilmer et al. , 2017 ; Chen et al. , 2019a ) , computer vision ( Qi et al. , 2017 ; Monti et al. , 2017 ) , reinforcement learning ( Sanchez-Gonzalez et al. , 2018 ; Wang et al. , 2018 ) , robotics ( Casas et al. , 2019 ; Liang et al. , 2020 ) , and physics ( Henrion et al. , 2017 ) . Given a graph along with node/edge features , GNNs learn node/edge representations by propagating information on the graph via local computations shared across the nodes/edges . Based on the specific form of local computation employed , GNNs can be divided into two categories : graph convolution based GNNs ( Bruna et al. , 2013 ; Duvenaud et al. , 2015 ; Kipf & Welling , 2016 ) and message passing based GNNs ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) . The former generalizes the convolution operator from regular graphs ( e.g. , grids ) to ones with arbitrary topology , whereas the latter mimics message passing algorithms and parameterizes the shared functions via neural networks . Due to the tremendous empirical success of GNNs , there is increasing interest in understanding their theoretical properties . For example , some recent works study their expressiveness ( Maron et al. , 2018 ; Xu et al. , 2018 ; Chen et al. , 2019b ) , that is , what class of functions can be represented by GNNs . However , only few works investigate why GNNs generalize so well to unseen graphs . They are either restricted to a specific model variant ( Verma & Zhang , 2019 ; Du et al. , 2019 ; Garg et al. , 2020 ) or have loose dependencies on graph statistics ( Scarselli et al. , 2018 ) . On the other hand , GNNs have close ties to standard feedforward neural networks , e.g. , multi-layer perceptrons ( MLPs ) and convolutional neural networks ( CNNs ) . In particular , if each i.i.d . sample is viewed as a node , then the whole dataset becomes a graph without edges . Therefore , GNNs can be seen as generalizations of MLPs/CNNs since they model not only the regularities within a sample but also the dependencies among samples as defined in the graph . It is therefore natural to ask if we can generalize the recent advancements on generalization bounds for MLPs/CNNs ( Harvey et al. , 2017 ; Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Dziugaite & Roy , 2017 ; Arora et al. , 2018 ; 2019 ) to GNNs , and how would graph structures affect the generalization bounds ? In this paper , we answer the above questions by proving generalization bounds for the two primary classes of GNNs , i.e. , graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) and messagepassing GNNs ( MPGNNs ) ( Dai et al. , 2016 ; Jin et al. , 2018 ) . Our generalization bound for GCNs shows an intimate relationship with the bounds for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ) . In particular , they share the same term , i.e. , the product of the spectral norms of the learned weights at each layer multiplied by a factor that is additive across layers . The bound for GCNs has an additional multiplicative factor d ( l 1 ) /2 where d 1 is the maximum node degree and l is the network depth . Since MLPs/CNNs are special GNNs operating on graphs without edges ( i.e. , d 1 = 0 ) , the bound for GCNs coincides with the ones for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ) on such degenerated graphs . Therefore , our result is a natural generalization of the existing results for MLPs/CNNs . Our generalization bound for message passing GNNs reveals that the governing terms of the bound are similar to the ones of GCNs , i.e. , the geometric series of the learned weights and the multiplicative factor dl 1 . The geometric series appears due to the weight sharing across message passing steps , thus corresponding to the product term across layers in GCNs . The term dl 1 encodes the key graph statistics . Our bound improves the dependency on the maximum node degree and the maximum hidden dimension compared to the recent Rademacher complexity based bound ( Garg et al. , 2020 ) . Moreover , we compute the bound values on four real-world graph datasets ( e.g. , social networks and protein structures ) and verify that our bounds are tighter . In terms of the proof techniques , our analysis follows the PAC-Bayes framework in the seminal work of ( Neyshabur et al. , 2017 ) for MLPs/CNNs with ReLU activations . However , we make two distinctive contributions which are customized for GNNs . First , a naive adaptation of the perturbation analysis in ( Neyshabur et al. , 2017 ) does not work for GNNs since ReLU is not 1-Lipschitz under the spectral norm , i.e. , kReLU ( X ) k2 kXk2 does not hold for some real matrix X . Instead , we construct the recursion on certain node representations of GNNs like the one with maximum ` 2 norm , so that we can perform perturbation analysis with vector 2-norm . Second , in contrast to ( Neyshabur et al. , 2017 ) which only handles the homogeneous networks , i.e. , f ( ax ) = af ( x ) when a 0 , we properly construct a quantity of the learned weights which 1 ) provides a way to satisfy the constraints of the previous perturbation analysis and 2 ) induces a finite covering on the range of the quantity so that the PAC-Bayes bound holds for all possible weights . This generalizes the analysis to non-homogeneous GNNs like typical MPGNNs . The rest of the paper is organized as follows . In Section 2 , we introduce background material necessary for our analysis . We then present our generalization bounds and the comparison to existing results in Section 3 . We also provide an empirical study to support our theoretical arguments in Section 4 . At last , we discuss the extensions , limitations and some open problems . 2 BACKGROUND . In this section , we first explain our analysis setup including notation and assumptions . We then describe the two representative GNN models in detail . Finally , we review the PAC-Bayes analysis . 2.1 ANALYSIS SETUP . In the following analysis , we consider the K-class graph classification problem which is common in the GNN literature , where given a graph sample z , we would like to classify it into one of the predefined K classes . We will discuss extensions to other problems like graph regression in Section 5 . Each graph sample z is a triplet of an adjacency matrix A , node features X 2 Rn⇥h0 and output label y 2 R1⇥K , i.e . z = ( A , X , y ) , where n is the number of nodes and h0 is the input feature dimension . We start our discussion by defining our notations . Let N+k be the first k positive integers , i.e. , N+k = { 1 , 2 , . . . , k } , | · |p the vector p-norm and k · kp the operator norm induced by the vector p-norm . Further , k · kF denotes the Frobenius norm of a matrix , e the base of the natural logarithm function log , A [ i , j ] the ( i , j ) -th element of matrix A and A [ i , : ] the i-th row . We use parenthesis to avoid the ambiguity , e.g. , ( AB ) [ i , j ] means the ( i , j ) -th element of the product matrix AB . We then introduce some terminologies from statistical learning theory and define the sample space as Z , z = ( A , X , y ) 2 Z where X 2 X ( node feature space ) and A 2 G ( graph space ) , data distribution D , z iid⇠ D , hypothesis ( or model ) fw where fw 2 H ( hypothesis class ) , and training set S with size m , S = { z1 , . . . , zm } . We make the following assumptions which also appear in the literature : A1 Data , i.e. , triplets ( A , X , y ) , are i.i.d . samples drawn from some unknown distribution D. A2 The maximum hidden dimension across all layers is h. A3 Node feature of any graph is contained in a ` 2-ball with radius B . Specifically , we have 8i 2 N+n , the i-th node feature X [ i , : ] 2 XB , h0 = { x 2 Rh0 | Ph0 j=1 x 2 j B2 } . A4 We only consider simple graphs ( i.e. , undirected , no loops1 , and no multi-edges ) with maximum node degree as d 1 . Note that it is straightforward to estimate B and d empirically on real-world graph data . 2.2 GRAPH NEURAL NETWORKS ( GNNS ) . In this part , we describe the details of the GNN models and the loss function we used for the graph classification problem . The essential idea of GNNs is to propagate information over the graph so that the learned representations capture the dependencies among nodes/edges . We now review two classes of GNNs , GCNs and MPGNNs , which have different mechanisms for propagating information . We choose them since they are the most popular variants and represent two common types of neural networks , i.e. , feedforward ( GCNs ) and recurrent ( MPGNNs ) neural networks . We discuss the extension of our analysis to other GNN variants in Section 5 . For ease of notation , we define the model to be fw 2 H : X ⇥ G ! RK where w is the vectorization of all model parameters . GCNs : Graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) for the K-class graph classification problem can be defined as follows , Hk = k ⇣ L̃Hk 1Wk ⌘ ( k-th Graph Convolution Layer ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 1 ) where k 2 N+l 1 , Hk 2 Rn⇥hk are the node representations/states , 1n 2 R1⇥n is a all-one vector , l is the number of layers.2 and Wj is the weight matrix of the j-th layer . The initial node state is the observed node feature H0 = X . For both GCNs and MPGNNs , we consider l > 1 since otherwise the model degenerates to a linear transformation which does not leverage the graph and is trivial to analyze . Due to assumption A2 , Wj is of size at most h ⇥ h , i.e. , hk h , 8k 2 N+l 1 . The graph Laplacian L̃ is defined as , à = I + A , L̃ = D 12 ÃD 12 where D is the degree matrix of à . Note that the maximum eigenvalue of L̃ is 1 in this case . We absorb the bias into the weight by appending constant 1 to the node feature . Typically , GCNs use ReLU as the non-linearity , i.e. , i ( x ) = max ( 0 , x ) , 8i = 1 , · · · , l 1 . We use the common mean-readout to obtain the graph representation where Hl 1 2 Rn⇥hl 1 , Wl 2 Rhl 1⇥K , and Hl 2 R1⇥K . MPGNNs : There are multiple variants of message passing GNNs , e.g. , ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) , which share the same algorithmic framework but instantiate a few components differently , e.g. , the node state update function . We choose the same class of models as in ( Garg et al. , 2020 ) which are popular in the literature ( Dai et al. , 2016 ; Jin et al. , 2018 ) in order to fairly compare bounds . This MPGNN model can be written in matrix forms as follows , Mk = g ( C > outHk 1 ) ( k-th step Message Computation ) M̄k = CinMk ( k-th step Message Aggregation ) Hk = XW1 + ⇢ M̄k W2 ( k-th step Node State Update ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 2 ) 1Here loop means an edge that connects a vertex to itself , a.k.a. , self-loop . 2We count the readout function as a layer to be consistent with the existing analysis of MLPs/CNNs . where k 2 N+l 1 , Hk 2 Rn⇥hk are node representations/states and Hl 2 R1⇥K is the output representation . Here we initialize H0 = 0 . W.l.o.g. , we assume 8k 2 N+l 1 , Hk 2 Rn⇥h and Mk 2 Rn⇥h since h is the maximum hidden dimension . Cin 2 Rn⇥c and Cout 2 Rn⇥c ( c is the number of edges ) are the incidence matrices corresponding to incoming and outgoing nodes3 respectively . Specifically , rows and columns of Cin and Cout correspond to nodes and edges respectively . Cin [ i , j ] = 1 indicates that the incoming node of the j-th edge is the i-th node . Similarly , Cout [ i , j ] = 1 indicates that the outgoing node of the j-th edge is the i-th node . g , , ⇢ are nonlinear mappings , e.g. , ReLU and Tanh . Technically speaking , g : Rh ! Rh , : Rh ! Rh , and ⇢ : Rh ! Rh operate on vector-states of individual node/edge . However , since we share these functions across nodes/edges , we can naturally generalize them to matrix-states , e.g. , ̃ : Rn⇥h ! Rn⇥h where ̃ ( X ) [ i , : ] = ( X [ i , : ] ) . By doing so , the same function could be applied to matrices with varying size of the first dimension . For simplicity , we use g , , ⇢ to denote such generalization to matrices . We denote the Lipschitz constants of g , , ⇢ under the vector 2-norm as Cg , C , C⇢ respectively . We also assume g ( 0 ) = 0 , ( 0 ) = 0 , and ⇢ ( 0 ) = 0 and define the percolation complexity as C = CgC C⇢kW2k2 following ( Garg et al. , 2020 ) . Multiclass Margin Loss : We use the multi-class -margin loss following ( Bartlett et al. , 2017 ; Neyshabur et al. , 2017 ) . The generalization error is defined as , LD , ( fw ) = P z⇠D ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ , ( 3 ) where > 0 and fw ( X , A ) is the l-th layer representations , i.e. , Hl = fw ( X , A ) . Accordingly , we can define the empirical error as , LS , ( fw ) = 1 m X zi2S 1 ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ . ( 4 )
In this paper, the authors propose generalization bounds for GNNs, both convolutional and standard message passing variants. The result is a generalization of those for CNN/MLP architectures with relu activation functions. The analysis method closely follows those established in the former settings as well. The specific setting they consider is where each sample in the dataset is a graph. The proof relies on ensuring small perturbations in the GNN weights don't cause large deviations in output distributions. The resulting PAC-Bayes bound is shown to be tighter than corresponding Rademacher Complexity bounds.
SP:edbfbf6b8fa385217b88beaad54cfa64fd814c58
A PAC-Bayesian Approach to Generalization Bounds for Graph Neural Networks
1 INTRODUCTION . Graph neural networks ( GNNs ) ( Gori et al. , 2005 ; Scarselli et al. , 2008 ; Bronstein et al. , 2017 ; Battaglia et al. , 2018 ) have become very popular recently due to their ability to learn powerful representations from graph-structured data , and have achieved state-of-the-art results in a variety of application domains such as social networks ( Hamilton et al. , 2017 ; Xu et al. , 2018 ) , quantum chemistry ( Gilmer et al. , 2017 ; Chen et al. , 2019a ) , computer vision ( Qi et al. , 2017 ; Monti et al. , 2017 ) , reinforcement learning ( Sanchez-Gonzalez et al. , 2018 ; Wang et al. , 2018 ) , robotics ( Casas et al. , 2019 ; Liang et al. , 2020 ) , and physics ( Henrion et al. , 2017 ) . Given a graph along with node/edge features , GNNs learn node/edge representations by propagating information on the graph via local computations shared across the nodes/edges . Based on the specific form of local computation employed , GNNs can be divided into two categories : graph convolution based GNNs ( Bruna et al. , 2013 ; Duvenaud et al. , 2015 ; Kipf & Welling , 2016 ) and message passing based GNNs ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) . The former generalizes the convolution operator from regular graphs ( e.g. , grids ) to ones with arbitrary topology , whereas the latter mimics message passing algorithms and parameterizes the shared functions via neural networks . Due to the tremendous empirical success of GNNs , there is increasing interest in understanding their theoretical properties . For example , some recent works study their expressiveness ( Maron et al. , 2018 ; Xu et al. , 2018 ; Chen et al. , 2019b ) , that is , what class of functions can be represented by GNNs . However , only few works investigate why GNNs generalize so well to unseen graphs . They are either restricted to a specific model variant ( Verma & Zhang , 2019 ; Du et al. , 2019 ; Garg et al. , 2020 ) or have loose dependencies on graph statistics ( Scarselli et al. , 2018 ) . On the other hand , GNNs have close ties to standard feedforward neural networks , e.g. , multi-layer perceptrons ( MLPs ) and convolutional neural networks ( CNNs ) . In particular , if each i.i.d . sample is viewed as a node , then the whole dataset becomes a graph without edges . Therefore , GNNs can be seen as generalizations of MLPs/CNNs since they model not only the regularities within a sample but also the dependencies among samples as defined in the graph . It is therefore natural to ask if we can generalize the recent advancements on generalization bounds for MLPs/CNNs ( Harvey et al. , 2017 ; Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ; Dziugaite & Roy , 2017 ; Arora et al. , 2018 ; 2019 ) to GNNs , and how would graph structures affect the generalization bounds ? In this paper , we answer the above questions by proving generalization bounds for the two primary classes of GNNs , i.e. , graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) and messagepassing GNNs ( MPGNNs ) ( Dai et al. , 2016 ; Jin et al. , 2018 ) . Our generalization bound for GCNs shows an intimate relationship with the bounds for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ; Bartlett et al. , 2017 ) . In particular , they share the same term , i.e. , the product of the spectral norms of the learned weights at each layer multiplied by a factor that is additive across layers . The bound for GCNs has an additional multiplicative factor d ( l 1 ) /2 where d 1 is the maximum node degree and l is the network depth . Since MLPs/CNNs are special GNNs operating on graphs without edges ( i.e. , d 1 = 0 ) , the bound for GCNs coincides with the ones for MLPs/CNNs with ReLU activations ( Neyshabur et al. , 2017 ) on such degenerated graphs . Therefore , our result is a natural generalization of the existing results for MLPs/CNNs . Our generalization bound for message passing GNNs reveals that the governing terms of the bound are similar to the ones of GCNs , i.e. , the geometric series of the learned weights and the multiplicative factor dl 1 . The geometric series appears due to the weight sharing across message passing steps , thus corresponding to the product term across layers in GCNs . The term dl 1 encodes the key graph statistics . Our bound improves the dependency on the maximum node degree and the maximum hidden dimension compared to the recent Rademacher complexity based bound ( Garg et al. , 2020 ) . Moreover , we compute the bound values on four real-world graph datasets ( e.g. , social networks and protein structures ) and verify that our bounds are tighter . In terms of the proof techniques , our analysis follows the PAC-Bayes framework in the seminal work of ( Neyshabur et al. , 2017 ) for MLPs/CNNs with ReLU activations . However , we make two distinctive contributions which are customized for GNNs . First , a naive adaptation of the perturbation analysis in ( Neyshabur et al. , 2017 ) does not work for GNNs since ReLU is not 1-Lipschitz under the spectral norm , i.e. , kReLU ( X ) k2 kXk2 does not hold for some real matrix X . Instead , we construct the recursion on certain node representations of GNNs like the one with maximum ` 2 norm , so that we can perform perturbation analysis with vector 2-norm . Second , in contrast to ( Neyshabur et al. , 2017 ) which only handles the homogeneous networks , i.e. , f ( ax ) = af ( x ) when a 0 , we properly construct a quantity of the learned weights which 1 ) provides a way to satisfy the constraints of the previous perturbation analysis and 2 ) induces a finite covering on the range of the quantity so that the PAC-Bayes bound holds for all possible weights . This generalizes the analysis to non-homogeneous GNNs like typical MPGNNs . The rest of the paper is organized as follows . In Section 2 , we introduce background material necessary for our analysis . We then present our generalization bounds and the comparison to existing results in Section 3 . We also provide an empirical study to support our theoretical arguments in Section 4 . At last , we discuss the extensions , limitations and some open problems . 2 BACKGROUND . In this section , we first explain our analysis setup including notation and assumptions . We then describe the two representative GNN models in detail . Finally , we review the PAC-Bayes analysis . 2.1 ANALYSIS SETUP . In the following analysis , we consider the K-class graph classification problem which is common in the GNN literature , where given a graph sample z , we would like to classify it into one of the predefined K classes . We will discuss extensions to other problems like graph regression in Section 5 . Each graph sample z is a triplet of an adjacency matrix A , node features X 2 Rn⇥h0 and output label y 2 R1⇥K , i.e . z = ( A , X , y ) , where n is the number of nodes and h0 is the input feature dimension . We start our discussion by defining our notations . Let N+k be the first k positive integers , i.e. , N+k = { 1 , 2 , . . . , k } , | · |p the vector p-norm and k · kp the operator norm induced by the vector p-norm . Further , k · kF denotes the Frobenius norm of a matrix , e the base of the natural logarithm function log , A [ i , j ] the ( i , j ) -th element of matrix A and A [ i , : ] the i-th row . We use parenthesis to avoid the ambiguity , e.g. , ( AB ) [ i , j ] means the ( i , j ) -th element of the product matrix AB . We then introduce some terminologies from statistical learning theory and define the sample space as Z , z = ( A , X , y ) 2 Z where X 2 X ( node feature space ) and A 2 G ( graph space ) , data distribution D , z iid⇠ D , hypothesis ( or model ) fw where fw 2 H ( hypothesis class ) , and training set S with size m , S = { z1 , . . . , zm } . We make the following assumptions which also appear in the literature : A1 Data , i.e. , triplets ( A , X , y ) , are i.i.d . samples drawn from some unknown distribution D. A2 The maximum hidden dimension across all layers is h. A3 Node feature of any graph is contained in a ` 2-ball with radius B . Specifically , we have 8i 2 N+n , the i-th node feature X [ i , : ] 2 XB , h0 = { x 2 Rh0 | Ph0 j=1 x 2 j B2 } . A4 We only consider simple graphs ( i.e. , undirected , no loops1 , and no multi-edges ) with maximum node degree as d 1 . Note that it is straightforward to estimate B and d empirically on real-world graph data . 2.2 GRAPH NEURAL NETWORKS ( GNNS ) . In this part , we describe the details of the GNN models and the loss function we used for the graph classification problem . The essential idea of GNNs is to propagate information over the graph so that the learned representations capture the dependencies among nodes/edges . We now review two classes of GNNs , GCNs and MPGNNs , which have different mechanisms for propagating information . We choose them since they are the most popular variants and represent two common types of neural networks , i.e. , feedforward ( GCNs ) and recurrent ( MPGNNs ) neural networks . We discuss the extension of our analysis to other GNN variants in Section 5 . For ease of notation , we define the model to be fw 2 H : X ⇥ G ! RK where w is the vectorization of all model parameters . GCNs : Graph convolutional networks ( GCNs ) ( Kipf & Welling , 2016 ) for the K-class graph classification problem can be defined as follows , Hk = k ⇣ L̃Hk 1Wk ⌘ ( k-th Graph Convolution Layer ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 1 ) where k 2 N+l 1 , Hk 2 Rn⇥hk are the node representations/states , 1n 2 R1⇥n is a all-one vector , l is the number of layers.2 and Wj is the weight matrix of the j-th layer . The initial node state is the observed node feature H0 = X . For both GCNs and MPGNNs , we consider l > 1 since otherwise the model degenerates to a linear transformation which does not leverage the graph and is trivial to analyze . Due to assumption A2 , Wj is of size at most h ⇥ h , i.e. , hk h , 8k 2 N+l 1 . The graph Laplacian L̃ is defined as , à = I + A , L̃ = D 12 ÃD 12 where D is the degree matrix of à . Note that the maximum eigenvalue of L̃ is 1 in this case . We absorb the bias into the weight by appending constant 1 to the node feature . Typically , GCNs use ReLU as the non-linearity , i.e. , i ( x ) = max ( 0 , x ) , 8i = 1 , · · · , l 1 . We use the common mean-readout to obtain the graph representation where Hl 1 2 Rn⇥hl 1 , Wl 2 Rhl 1⇥K , and Hl 2 R1⇥K . MPGNNs : There are multiple variants of message passing GNNs , e.g. , ( Li et al. , 2015 ; Dai et al. , 2016 ; Gilmer et al. , 2017 ) , which share the same algorithmic framework but instantiate a few components differently , e.g. , the node state update function . We choose the same class of models as in ( Garg et al. , 2020 ) which are popular in the literature ( Dai et al. , 2016 ; Jin et al. , 2018 ) in order to fairly compare bounds . This MPGNN model can be written in matrix forms as follows , Mk = g ( C > outHk 1 ) ( k-th step Message Computation ) M̄k = CinMk ( k-th step Message Aggregation ) Hk = XW1 + ⇢ M̄k W2 ( k-th step Node State Update ) Hl = 1 n 1nHl 1Wl ( Readout Layer ) , ( 2 ) 1Here loop means an edge that connects a vertex to itself , a.k.a. , self-loop . 2We count the readout function as a layer to be consistent with the existing analysis of MLPs/CNNs . where k 2 N+l 1 , Hk 2 Rn⇥hk are node representations/states and Hl 2 R1⇥K is the output representation . Here we initialize H0 = 0 . W.l.o.g. , we assume 8k 2 N+l 1 , Hk 2 Rn⇥h and Mk 2 Rn⇥h since h is the maximum hidden dimension . Cin 2 Rn⇥c and Cout 2 Rn⇥c ( c is the number of edges ) are the incidence matrices corresponding to incoming and outgoing nodes3 respectively . Specifically , rows and columns of Cin and Cout correspond to nodes and edges respectively . Cin [ i , j ] = 1 indicates that the incoming node of the j-th edge is the i-th node . Similarly , Cout [ i , j ] = 1 indicates that the outgoing node of the j-th edge is the i-th node . g , , ⇢ are nonlinear mappings , e.g. , ReLU and Tanh . Technically speaking , g : Rh ! Rh , : Rh ! Rh , and ⇢ : Rh ! Rh operate on vector-states of individual node/edge . However , since we share these functions across nodes/edges , we can naturally generalize them to matrix-states , e.g. , ̃ : Rn⇥h ! Rn⇥h where ̃ ( X ) [ i , : ] = ( X [ i , : ] ) . By doing so , the same function could be applied to matrices with varying size of the first dimension . For simplicity , we use g , , ⇢ to denote such generalization to matrices . We denote the Lipschitz constants of g , , ⇢ under the vector 2-norm as Cg , C , C⇢ respectively . We also assume g ( 0 ) = 0 , ( 0 ) = 0 , and ⇢ ( 0 ) = 0 and define the percolation complexity as C = CgC C⇢kW2k2 following ( Garg et al. , 2020 ) . Multiclass Margin Loss : We use the multi-class -margin loss following ( Bartlett et al. , 2017 ; Neyshabur et al. , 2017 ) . The generalization error is defined as , LD , ( fw ) = P z⇠D ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ , ( 3 ) where > 0 and fw ( X , A ) is the l-th layer representations , i.e. , Hl = fw ( X , A ) . Accordingly , we can define the empirical error as , LS , ( fw ) = 1 m X zi2S 1 ✓ fw ( X , A ) [ y ] +max j 6=y fw ( X , A ) [ j ] ◆ . ( 4 )
The paper presents PAC-Bayesian generalization bounds for two classes of graph neural networks: graph convolutional neural networks and message passing graph neural networks. The paper essentially adapts Neyshabur et al. (2017) PAC-Bayesian margin bounds for neural networks to graph neural networks and expectedly the bounds contain terms that depend on the degree of the underlying graph. The main technical contribution of the paper is a perturbation bound for GNNs from which the main results follow.
SP:edbfbf6b8fa385217b88beaad54cfa64fd814c58
The shape and simplicity biases of adversarially robust ImageNet-trained CNNs
Adversarial training has been the topic of dozens of studies and a leading method for defending against adversarial attacks . Yet , it remains largely unknown ( a ) how adversarially-robust ImageNet classifiers ( R classifiers ) generalize to out-ofdistribution examples ; and ( b ) how their generalization capability relates to their hidden representations . In this paper , we perform a thorough , systematic study to answer these two questions across AlexNet , GoogLeNet , and ResNet-50 architectures . We found that while standard ImageNet classifiers have a strong texture bias , their R counterparts rely heavily on shapes . Remarkably , adversarial training induces three simplicity biases into hidden neurons in the process of “ robustifying ” the network . That is , each convolutional neuron in R networks often changes to detecting ( 1 ) pixel-wise smoother patterns i.e . a mechanism that blocks highfrequency noise from passing through the network ; ( 2 ) more lower-level features i.e . textures and colors ( instead of objects ) ; and ( 3 ) fewer types of inputs . Our findings reveal the interesting mechanisms that made networks more adversarially robust and also explain some recent findings e.g . why R networks benefit from much larger capacity ( Xie & Yuille , 2020 ) and can act as a strong image prior in image synthesis ( Santurkar et al. , 2019 ) . 1 INTRODUCTION . Given excellent test-set performance , deep neural networks often fail to generalize to out-ofdistribution ( OOD ) examples ( Nguyen et al. , 2015 ) including “ adversarial examples ” , i.e . modified inputs that are imperceptibly different from the real data but change predicted labels entirely ( Szegedy et al. , 2014 ) . Importantly , adversarial examples can transfer between models and cause unseen , all machine learning ( ML ) models to misbehave ( Papernot et al. , 2017 ) , threatening the security and reliability of ML applications ( Akhtar & Mian , 2018 ) . Adversarial training—teaching a classifier to correctly label adversarial examples ( instead of real data ) —has been a leading method in defending against adversarial attacks and the most effective defense in ICLR 2018 ( Athalye et al. , 2018 ) . Besides improved performance on adversarial examples , test-set accuracy can also be improved , for some architectures , when real images are properly incorporated into adversarial training ( Xie et al. , 2020 ) . It is therefore important to study how the standard adversarial training ( by Madry et al . 2018 ) changes the hidden representations and generalization capabilities of neural networks . On smaller datasets , Zhang & Zhu ( 2019 ) found that adversarially-robust networks ( hereafter , R networks ) rely heavily on shapes ( instead of textures ) to classify images . Intuitively , training on pixel-wise noisy images would encourage R networks to focus less on local statistics ( e.g . textures ) and instead harness global features ( e.g . shapes ) more . However , an important , open question is : Q1 : On ImageNet , do R networks still prefer shapes over textures ? It remains unknown whether such shape preference carries over to the large-scale ImageNet ( Russakovsky et al. , 2015 ) , which often induces a large texture bias into networks ( Geirhos et al. , 2019 ) e.g . to separate ∼150 four-legged species in ImageNet . Also , this shape-bias hypothesis suggested by Zhang & Zhu ( 2019 ) seems to contradict the recent findings that R networks on ImageNet act as a strong texture prior i.e . they can be successfully used for many image translation tasks without any extra image prior ( Santurkar et al. , 2019 ) . The above discussion leads to a follow-up question : Q2 : If an R network has a stronger preference for shapes than standard ImageNet networks ( hereafter , S networks ) , will it perform better on OOD distorted images ? Networks trained to be more shape-biased can generalize better to many unseen ImageNet-C ( Hendrycks & Dietterich , 2019 ) image corruptions than S networks , which have a strong texture bias ( Brendel & Bethge , 2019 ) . In contrast , there was also evidence that classifiers trained on one type of images often do not generalize well to others ( Geirhos et al. , 2018 ; Nguyen et al. , 2015 ; Kang et al. , 2019 ) . Importantly , R networks often underperform S networks on original test sets ( Tsipras et al. , 2019 ) perhaps due to an inherent trade-off ( Madry et al. , 2018 ) , a mismatch between real vs. adversarial distributions ( Xie et al. , 2020 ) , or a limitation in architectures—AdvProp helps improving performance of EfficientNets but not ResNets ( Xie et al. , 2020 ) . Most previous work aimed at understanding the behaviors of R classifiers as a function but little is known about the internal characteristics of R networks and , furthermore , their connections to the shape bias and generalization performance . Here , we ask : Q3 : How did adversarial training change the hidden neural representations to make classifiers more shape-biased and adversarially robust ? In this paper , we harness the common benchmarks in ML interpretability and neuroscience—cueconflict ( Geirhos et al. , 2019 ) , NetDissect ( Bau et al. , 2017 ) , and ImageNet-C—to answer the three questions above via a systematic study across three different convolutional architectures—AlexNet ( Krizhevsky et al. , 2012 ) , GoogLeNet ( Szegedy et al. , 2015 ) , and ResNet-50 ( He et al. , 2016 ) — trained to perform image classification on the large-scale ImageNet dataset ( Russakovsky et al. , 2015 ) . Our main findings include:1 1 . R classifiers trained on ImageNet prefer shapes over textures∼67 % of the time ( Sec . 3.1 ) — a stark contrast to the S classifiers , which use shapes at only ∼25 % . 2 . Consistent with the strong shape bias , R classifiers interestingly outperform S counterparts on texture-less , distorted images ( stylized and silhouetted images ) ( Sec . 3.2.2 ) . 3 . Adversarial training makes R networks more robust by ( 1 ) blocking pixel-wise input noise via smooth filters ( Sec . 3.3.1 ) ; ( 2 ) narrowing the input range that highly activates neurons to simpler patterns , effectively reducing the space of adversarial inputs ( Sec . 3.3.2 ) . 4 . Units that detect texture patterns ( according to NetDissect ) are not only useful to texturebased recognition as expected but can be also highly useful to shape-based recognition ( Sec . 3.4 ) . By aligning NetDissect and cue-conflict frameworks , we found that hidden neurons in R networks are surprisingly neither strongly shape-biased nor texture-biased , but instead generalists that detect low-level features ( Sec . 3.4 ) . 2 NETWORKS AND DATASETS . Networks To understand the effects of adversarial training across a wide range of architectures , we compare each pair of S and R models while keeping their network architectures constant . That is , we conduct all experiments on two groups of classifiers : ( a ) standard AlexNet , GoogLeNet , & ResNet-50 ( hereafter , ResNet ) models pre-trained on the 1000-class 2012 ImageNet dataset ; and ( b ) three adversarially-robust counterparts i.e . AlexNet-R , GoogLeNet-R , & ResNet-R which were trained via adversarial training ( see below ) ( Madry et al. , 2018 ) . Training A standard classifier with parameters θ was trained to minimize the cross-entropy loss L over pairs of ( training example x , ground-truth label y ) drawn from the ImageNet training set D : arg min θ E ( x , y ) ∼D [ L ( θ , x , y ) ] ( 1 ) On the other hand , we trained each R classifier via Madry et al . ( 2018 ) adversarial training framework where each real example x is changed by a perturbation ∆ : arg min θ E ( x , y ) ∼D [ max ∆∈P L ( θ , x+ ∆ , y ) ] ( 2 ) 1All code and data will be available on github upon publication . where P is the perturbation range ( Madry et al. , 2018 ) , here , within an L2 norm . Hyperparameters The S models were downloaded from PyTorch model zoo ( PyTorch , 2019 ) . We trained all R models using the robustness library ( Engstrom et al. , 2019 ) , using the same hyperparameters in Engstrom et al . ( 2020 ) ; Santurkar et al . ( 2019 ) ; Bansal et al . ( 2020 ) . That is , adverarial examples were generated using Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) with an L2 norm constraint of 3 , a step size of 0.5 , and 7 PGD-attack steps . R models were trained using an SGD optimizer for 90 epochs with a momentum of 0.9 , an initial learning rate of 0.1 ( which is reduced 10 times every 30 epochs ) , a weight decay of 10−4 , and a batch size of 256 on 4 Tesla-V100 GPU ’ s . Compared to the standard counterparts , R models have substantially higher adversarial accuracy but lower ImageNet validation-set accuracy ( Table 1 ) . To compute adversarial accuracy , we perturbed validation-set images with the same PGD attack settings as used in training . Correctly-labeled image subsets : ImageNet-CL Following Bansal et al . ( 2020 ) , to compare the behaviors of two networks of identical architectures on the same inputs , we tested them on the largest ImageNet validation subset ( hereafter , ImageNet-CL ) where both models have 100 % accuracy . The sizes of the three subsets for three architectures—AlexNet , GoogLeNet , and ResNet—are respectively : 17,693 , 24,581 , and 27,343 . On modified ImageNet images ( e.g . ImageNet-C ) , we only tested each pair of networks on the modified images whose original versions exist in ImageNet-CL . That is , we wish to gain deeper insights into how networks behave on correctly-classified images , and then how their behaviors change when some input feature ( e.g . textures or shapes ) is modified . 3 EXPERIMENT AND RESULTS . 3.1 DO IMAGENET ADVERSARIALLY ROBUST NETWORKS PREFER SHAPES OR TEXTURES ? . It is important to know which type of feature a classifier uses when making decisions . While standard ImageNet networks often carry a strong texture bias ( Geirhos et al. , 2019 ) , it is unknown whether their adversarially-robust counterparts would be heavily texture- or shape-biased . Here , we test this hypothesis by comparing S and R models on the well-known cue-conflict dataset ( Geirhos et al. , 2019 ) . That is , we feed “ stylized ” images provided by Geirhos et al . ( 2019 ) that contain contradicting texture and shape cues ( e.g . elephant skin on a cat silhouette ) and count the times a model uses textures or shapes ( i.e . outputting elephant or cat ) when it makes a correct prediction . Experiment Our procedure follows Geirhos et al . ( 2019 ) . First , we excluded 80 images that do not have conflicting cues ( e.g . cat textures on cat shapes ) from their 1,280-image dataset . Each texture or shape cue belongs to one of 16 MS COCO ( Caesar et al. , 2018 ) coarse labels ( e.g . cat or elephant ) . Second , we ran the networks on these images and converted their 1000-class probability vector outputs into 16-class probability vectors by taking the average over the probabilities of the fine-grained classes that are under the same COCO label . Third , we took only the images that each network correctly labels ( i.e . into the texture or shape class ) , which ranges from 669 to 877 images ( out of 1,200 ) for 6 networks and computed the texture and shape accuracies over 16 classes . Results On average , over three architectures , R classifiers rely on shapes ≥ 67.08 % of the time i.e . ∼2.7× higher than 24.56 % of the S models ( Table 2 ) . In other words , by replacing the real examples with adversarial examples , adversarial training causes the heavy texture bias of ImageNet classifiers ( Geirhos et al. , 2019 ; Brendel & Bethge , 2019 ) to drop substantially ( ∼2.7× ) .
This paper takes a step further to understand the relationships between the adversarial trained CNNs (R-CNNs) and shape-based representation, and delve deeper into the R-CNNs via studying the hidden units. First, it justifies that the R-CNNs prefer shape cues based on random-shuffled, Stylized-ImageNet, and silhouette experiments. Then, it tests R-CNNs on ImageNet-C to show the less connection between the shape-biased and the robustness against common corruptions. Finally, it studies the hidden unit via qualitative tools including NetDissect.
SP:d7243cbcc28ef5efc3891d4220342e818c87d188
The shape and simplicity biases of adversarially robust ImageNet-trained CNNs
Adversarial training has been the topic of dozens of studies and a leading method for defending against adversarial attacks . Yet , it remains largely unknown ( a ) how adversarially-robust ImageNet classifiers ( R classifiers ) generalize to out-ofdistribution examples ; and ( b ) how their generalization capability relates to their hidden representations . In this paper , we perform a thorough , systematic study to answer these two questions across AlexNet , GoogLeNet , and ResNet-50 architectures . We found that while standard ImageNet classifiers have a strong texture bias , their R counterparts rely heavily on shapes . Remarkably , adversarial training induces three simplicity biases into hidden neurons in the process of “ robustifying ” the network . That is , each convolutional neuron in R networks often changes to detecting ( 1 ) pixel-wise smoother patterns i.e . a mechanism that blocks highfrequency noise from passing through the network ; ( 2 ) more lower-level features i.e . textures and colors ( instead of objects ) ; and ( 3 ) fewer types of inputs . Our findings reveal the interesting mechanisms that made networks more adversarially robust and also explain some recent findings e.g . why R networks benefit from much larger capacity ( Xie & Yuille , 2020 ) and can act as a strong image prior in image synthesis ( Santurkar et al. , 2019 ) . 1 INTRODUCTION . Given excellent test-set performance , deep neural networks often fail to generalize to out-ofdistribution ( OOD ) examples ( Nguyen et al. , 2015 ) including “ adversarial examples ” , i.e . modified inputs that are imperceptibly different from the real data but change predicted labels entirely ( Szegedy et al. , 2014 ) . Importantly , adversarial examples can transfer between models and cause unseen , all machine learning ( ML ) models to misbehave ( Papernot et al. , 2017 ) , threatening the security and reliability of ML applications ( Akhtar & Mian , 2018 ) . Adversarial training—teaching a classifier to correctly label adversarial examples ( instead of real data ) —has been a leading method in defending against adversarial attacks and the most effective defense in ICLR 2018 ( Athalye et al. , 2018 ) . Besides improved performance on adversarial examples , test-set accuracy can also be improved , for some architectures , when real images are properly incorporated into adversarial training ( Xie et al. , 2020 ) . It is therefore important to study how the standard adversarial training ( by Madry et al . 2018 ) changes the hidden representations and generalization capabilities of neural networks . On smaller datasets , Zhang & Zhu ( 2019 ) found that adversarially-robust networks ( hereafter , R networks ) rely heavily on shapes ( instead of textures ) to classify images . Intuitively , training on pixel-wise noisy images would encourage R networks to focus less on local statistics ( e.g . textures ) and instead harness global features ( e.g . shapes ) more . However , an important , open question is : Q1 : On ImageNet , do R networks still prefer shapes over textures ? It remains unknown whether such shape preference carries over to the large-scale ImageNet ( Russakovsky et al. , 2015 ) , which often induces a large texture bias into networks ( Geirhos et al. , 2019 ) e.g . to separate ∼150 four-legged species in ImageNet . Also , this shape-bias hypothesis suggested by Zhang & Zhu ( 2019 ) seems to contradict the recent findings that R networks on ImageNet act as a strong texture prior i.e . they can be successfully used for many image translation tasks without any extra image prior ( Santurkar et al. , 2019 ) . The above discussion leads to a follow-up question : Q2 : If an R network has a stronger preference for shapes than standard ImageNet networks ( hereafter , S networks ) , will it perform better on OOD distorted images ? Networks trained to be more shape-biased can generalize better to many unseen ImageNet-C ( Hendrycks & Dietterich , 2019 ) image corruptions than S networks , which have a strong texture bias ( Brendel & Bethge , 2019 ) . In contrast , there was also evidence that classifiers trained on one type of images often do not generalize well to others ( Geirhos et al. , 2018 ; Nguyen et al. , 2015 ; Kang et al. , 2019 ) . Importantly , R networks often underperform S networks on original test sets ( Tsipras et al. , 2019 ) perhaps due to an inherent trade-off ( Madry et al. , 2018 ) , a mismatch between real vs. adversarial distributions ( Xie et al. , 2020 ) , or a limitation in architectures—AdvProp helps improving performance of EfficientNets but not ResNets ( Xie et al. , 2020 ) . Most previous work aimed at understanding the behaviors of R classifiers as a function but little is known about the internal characteristics of R networks and , furthermore , their connections to the shape bias and generalization performance . Here , we ask : Q3 : How did adversarial training change the hidden neural representations to make classifiers more shape-biased and adversarially robust ? In this paper , we harness the common benchmarks in ML interpretability and neuroscience—cueconflict ( Geirhos et al. , 2019 ) , NetDissect ( Bau et al. , 2017 ) , and ImageNet-C—to answer the three questions above via a systematic study across three different convolutional architectures—AlexNet ( Krizhevsky et al. , 2012 ) , GoogLeNet ( Szegedy et al. , 2015 ) , and ResNet-50 ( He et al. , 2016 ) — trained to perform image classification on the large-scale ImageNet dataset ( Russakovsky et al. , 2015 ) . Our main findings include:1 1 . R classifiers trained on ImageNet prefer shapes over textures∼67 % of the time ( Sec . 3.1 ) — a stark contrast to the S classifiers , which use shapes at only ∼25 % . 2 . Consistent with the strong shape bias , R classifiers interestingly outperform S counterparts on texture-less , distorted images ( stylized and silhouetted images ) ( Sec . 3.2.2 ) . 3 . Adversarial training makes R networks more robust by ( 1 ) blocking pixel-wise input noise via smooth filters ( Sec . 3.3.1 ) ; ( 2 ) narrowing the input range that highly activates neurons to simpler patterns , effectively reducing the space of adversarial inputs ( Sec . 3.3.2 ) . 4 . Units that detect texture patterns ( according to NetDissect ) are not only useful to texturebased recognition as expected but can be also highly useful to shape-based recognition ( Sec . 3.4 ) . By aligning NetDissect and cue-conflict frameworks , we found that hidden neurons in R networks are surprisingly neither strongly shape-biased nor texture-biased , but instead generalists that detect low-level features ( Sec . 3.4 ) . 2 NETWORKS AND DATASETS . Networks To understand the effects of adversarial training across a wide range of architectures , we compare each pair of S and R models while keeping their network architectures constant . That is , we conduct all experiments on two groups of classifiers : ( a ) standard AlexNet , GoogLeNet , & ResNet-50 ( hereafter , ResNet ) models pre-trained on the 1000-class 2012 ImageNet dataset ; and ( b ) three adversarially-robust counterparts i.e . AlexNet-R , GoogLeNet-R , & ResNet-R which were trained via adversarial training ( see below ) ( Madry et al. , 2018 ) . Training A standard classifier with parameters θ was trained to minimize the cross-entropy loss L over pairs of ( training example x , ground-truth label y ) drawn from the ImageNet training set D : arg min θ E ( x , y ) ∼D [ L ( θ , x , y ) ] ( 1 ) On the other hand , we trained each R classifier via Madry et al . ( 2018 ) adversarial training framework where each real example x is changed by a perturbation ∆ : arg min θ E ( x , y ) ∼D [ max ∆∈P L ( θ , x+ ∆ , y ) ] ( 2 ) 1All code and data will be available on github upon publication . where P is the perturbation range ( Madry et al. , 2018 ) , here , within an L2 norm . Hyperparameters The S models were downloaded from PyTorch model zoo ( PyTorch , 2019 ) . We trained all R models using the robustness library ( Engstrom et al. , 2019 ) , using the same hyperparameters in Engstrom et al . ( 2020 ) ; Santurkar et al . ( 2019 ) ; Bansal et al . ( 2020 ) . That is , adverarial examples were generated using Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) with an L2 norm constraint of 3 , a step size of 0.5 , and 7 PGD-attack steps . R models were trained using an SGD optimizer for 90 epochs with a momentum of 0.9 , an initial learning rate of 0.1 ( which is reduced 10 times every 30 epochs ) , a weight decay of 10−4 , and a batch size of 256 on 4 Tesla-V100 GPU ’ s . Compared to the standard counterparts , R models have substantially higher adversarial accuracy but lower ImageNet validation-set accuracy ( Table 1 ) . To compute adversarial accuracy , we perturbed validation-set images with the same PGD attack settings as used in training . Correctly-labeled image subsets : ImageNet-CL Following Bansal et al . ( 2020 ) , to compare the behaviors of two networks of identical architectures on the same inputs , we tested them on the largest ImageNet validation subset ( hereafter , ImageNet-CL ) where both models have 100 % accuracy . The sizes of the three subsets for three architectures—AlexNet , GoogLeNet , and ResNet—are respectively : 17,693 , 24,581 , and 27,343 . On modified ImageNet images ( e.g . ImageNet-C ) , we only tested each pair of networks on the modified images whose original versions exist in ImageNet-CL . That is , we wish to gain deeper insights into how networks behave on correctly-classified images , and then how their behaviors change when some input feature ( e.g . textures or shapes ) is modified . 3 EXPERIMENT AND RESULTS . 3.1 DO IMAGENET ADVERSARIALLY ROBUST NETWORKS PREFER SHAPES OR TEXTURES ? . It is important to know which type of feature a classifier uses when making decisions . While standard ImageNet networks often carry a strong texture bias ( Geirhos et al. , 2019 ) , it is unknown whether their adversarially-robust counterparts would be heavily texture- or shape-biased . Here , we test this hypothesis by comparing S and R models on the well-known cue-conflict dataset ( Geirhos et al. , 2019 ) . That is , we feed “ stylized ” images provided by Geirhos et al . ( 2019 ) that contain contradicting texture and shape cues ( e.g . elephant skin on a cat silhouette ) and count the times a model uses textures or shapes ( i.e . outputting elephant or cat ) when it makes a correct prediction . Experiment Our procedure follows Geirhos et al . ( 2019 ) . First , we excluded 80 images that do not have conflicting cues ( e.g . cat textures on cat shapes ) from their 1,280-image dataset . Each texture or shape cue belongs to one of 16 MS COCO ( Caesar et al. , 2018 ) coarse labels ( e.g . cat or elephant ) . Second , we ran the networks on these images and converted their 1000-class probability vector outputs into 16-class probability vectors by taking the average over the probabilities of the fine-grained classes that are under the same COCO label . Third , we took only the images that each network correctly labels ( i.e . into the texture or shape class ) , which ranges from 669 to 877 images ( out of 1,200 ) for 6 networks and computed the texture and shape accuracies over 16 classes . Results On average , over three architectures , R classifiers rely on shapes ≥ 67.08 % of the time i.e . ∼2.7× higher than 24.56 % of the S models ( Table 2 ) . In other words , by replacing the real examples with adversarial examples , adversarial training causes the heavy texture bias of ImageNet classifiers ( Geirhos et al. , 2019 ; Brendel & Bethge , 2019 ) to drop substantially ( ∼2.7× ) .
In this paper, the authors show that adversarially robust versions of three popular CNN architectures trained for image classification on ImageNet rely on shape rather than on textures to perform recognition. They also show that adversarially robust networks do not outperform non-robust networks on corrupted data. Finally, they perform some analysis to determine whether intermediate features are more related to shape or texture, finding that these representations to intertwine both types of information.
SP:d7243cbcc28ef5efc3891d4220342e818c87d188
The shape and simplicity biases of adversarially robust ImageNet-trained CNNs
Adversarial training has been the topic of dozens of studies and a leading method for defending against adversarial attacks . Yet , it remains largely unknown ( a ) how adversarially-robust ImageNet classifiers ( R classifiers ) generalize to out-ofdistribution examples ; and ( b ) how their generalization capability relates to their hidden representations . In this paper , we perform a thorough , systematic study to answer these two questions across AlexNet , GoogLeNet , and ResNet-50 architectures . We found that while standard ImageNet classifiers have a strong texture bias , their R counterparts rely heavily on shapes . Remarkably , adversarial training induces three simplicity biases into hidden neurons in the process of “ robustifying ” the network . That is , each convolutional neuron in R networks often changes to detecting ( 1 ) pixel-wise smoother patterns i.e . a mechanism that blocks highfrequency noise from passing through the network ; ( 2 ) more lower-level features i.e . textures and colors ( instead of objects ) ; and ( 3 ) fewer types of inputs . Our findings reveal the interesting mechanisms that made networks more adversarially robust and also explain some recent findings e.g . why R networks benefit from much larger capacity ( Xie & Yuille , 2020 ) and can act as a strong image prior in image synthesis ( Santurkar et al. , 2019 ) . 1 INTRODUCTION . Given excellent test-set performance , deep neural networks often fail to generalize to out-ofdistribution ( OOD ) examples ( Nguyen et al. , 2015 ) including “ adversarial examples ” , i.e . modified inputs that are imperceptibly different from the real data but change predicted labels entirely ( Szegedy et al. , 2014 ) . Importantly , adversarial examples can transfer between models and cause unseen , all machine learning ( ML ) models to misbehave ( Papernot et al. , 2017 ) , threatening the security and reliability of ML applications ( Akhtar & Mian , 2018 ) . Adversarial training—teaching a classifier to correctly label adversarial examples ( instead of real data ) —has been a leading method in defending against adversarial attacks and the most effective defense in ICLR 2018 ( Athalye et al. , 2018 ) . Besides improved performance on adversarial examples , test-set accuracy can also be improved , for some architectures , when real images are properly incorporated into adversarial training ( Xie et al. , 2020 ) . It is therefore important to study how the standard adversarial training ( by Madry et al . 2018 ) changes the hidden representations and generalization capabilities of neural networks . On smaller datasets , Zhang & Zhu ( 2019 ) found that adversarially-robust networks ( hereafter , R networks ) rely heavily on shapes ( instead of textures ) to classify images . Intuitively , training on pixel-wise noisy images would encourage R networks to focus less on local statistics ( e.g . textures ) and instead harness global features ( e.g . shapes ) more . However , an important , open question is : Q1 : On ImageNet , do R networks still prefer shapes over textures ? It remains unknown whether such shape preference carries over to the large-scale ImageNet ( Russakovsky et al. , 2015 ) , which often induces a large texture bias into networks ( Geirhos et al. , 2019 ) e.g . to separate ∼150 four-legged species in ImageNet . Also , this shape-bias hypothesis suggested by Zhang & Zhu ( 2019 ) seems to contradict the recent findings that R networks on ImageNet act as a strong texture prior i.e . they can be successfully used for many image translation tasks without any extra image prior ( Santurkar et al. , 2019 ) . The above discussion leads to a follow-up question : Q2 : If an R network has a stronger preference for shapes than standard ImageNet networks ( hereafter , S networks ) , will it perform better on OOD distorted images ? Networks trained to be more shape-biased can generalize better to many unseen ImageNet-C ( Hendrycks & Dietterich , 2019 ) image corruptions than S networks , which have a strong texture bias ( Brendel & Bethge , 2019 ) . In contrast , there was also evidence that classifiers trained on one type of images often do not generalize well to others ( Geirhos et al. , 2018 ; Nguyen et al. , 2015 ; Kang et al. , 2019 ) . Importantly , R networks often underperform S networks on original test sets ( Tsipras et al. , 2019 ) perhaps due to an inherent trade-off ( Madry et al. , 2018 ) , a mismatch between real vs. adversarial distributions ( Xie et al. , 2020 ) , or a limitation in architectures—AdvProp helps improving performance of EfficientNets but not ResNets ( Xie et al. , 2020 ) . Most previous work aimed at understanding the behaviors of R classifiers as a function but little is known about the internal characteristics of R networks and , furthermore , their connections to the shape bias and generalization performance . Here , we ask : Q3 : How did adversarial training change the hidden neural representations to make classifiers more shape-biased and adversarially robust ? In this paper , we harness the common benchmarks in ML interpretability and neuroscience—cueconflict ( Geirhos et al. , 2019 ) , NetDissect ( Bau et al. , 2017 ) , and ImageNet-C—to answer the three questions above via a systematic study across three different convolutional architectures—AlexNet ( Krizhevsky et al. , 2012 ) , GoogLeNet ( Szegedy et al. , 2015 ) , and ResNet-50 ( He et al. , 2016 ) — trained to perform image classification on the large-scale ImageNet dataset ( Russakovsky et al. , 2015 ) . Our main findings include:1 1 . R classifiers trained on ImageNet prefer shapes over textures∼67 % of the time ( Sec . 3.1 ) — a stark contrast to the S classifiers , which use shapes at only ∼25 % . 2 . Consistent with the strong shape bias , R classifiers interestingly outperform S counterparts on texture-less , distorted images ( stylized and silhouetted images ) ( Sec . 3.2.2 ) . 3 . Adversarial training makes R networks more robust by ( 1 ) blocking pixel-wise input noise via smooth filters ( Sec . 3.3.1 ) ; ( 2 ) narrowing the input range that highly activates neurons to simpler patterns , effectively reducing the space of adversarial inputs ( Sec . 3.3.2 ) . 4 . Units that detect texture patterns ( according to NetDissect ) are not only useful to texturebased recognition as expected but can be also highly useful to shape-based recognition ( Sec . 3.4 ) . By aligning NetDissect and cue-conflict frameworks , we found that hidden neurons in R networks are surprisingly neither strongly shape-biased nor texture-biased , but instead generalists that detect low-level features ( Sec . 3.4 ) . 2 NETWORKS AND DATASETS . Networks To understand the effects of adversarial training across a wide range of architectures , we compare each pair of S and R models while keeping their network architectures constant . That is , we conduct all experiments on two groups of classifiers : ( a ) standard AlexNet , GoogLeNet , & ResNet-50 ( hereafter , ResNet ) models pre-trained on the 1000-class 2012 ImageNet dataset ; and ( b ) three adversarially-robust counterparts i.e . AlexNet-R , GoogLeNet-R , & ResNet-R which were trained via adversarial training ( see below ) ( Madry et al. , 2018 ) . Training A standard classifier with parameters θ was trained to minimize the cross-entropy loss L over pairs of ( training example x , ground-truth label y ) drawn from the ImageNet training set D : arg min θ E ( x , y ) ∼D [ L ( θ , x , y ) ] ( 1 ) On the other hand , we trained each R classifier via Madry et al . ( 2018 ) adversarial training framework where each real example x is changed by a perturbation ∆ : arg min θ E ( x , y ) ∼D [ max ∆∈P L ( θ , x+ ∆ , y ) ] ( 2 ) 1All code and data will be available on github upon publication . where P is the perturbation range ( Madry et al. , 2018 ) , here , within an L2 norm . Hyperparameters The S models were downloaded from PyTorch model zoo ( PyTorch , 2019 ) . We trained all R models using the robustness library ( Engstrom et al. , 2019 ) , using the same hyperparameters in Engstrom et al . ( 2020 ) ; Santurkar et al . ( 2019 ) ; Bansal et al . ( 2020 ) . That is , adverarial examples were generated using Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) with an L2 norm constraint of 3 , a step size of 0.5 , and 7 PGD-attack steps . R models were trained using an SGD optimizer for 90 epochs with a momentum of 0.9 , an initial learning rate of 0.1 ( which is reduced 10 times every 30 epochs ) , a weight decay of 10−4 , and a batch size of 256 on 4 Tesla-V100 GPU ’ s . Compared to the standard counterparts , R models have substantially higher adversarial accuracy but lower ImageNet validation-set accuracy ( Table 1 ) . To compute adversarial accuracy , we perturbed validation-set images with the same PGD attack settings as used in training . Correctly-labeled image subsets : ImageNet-CL Following Bansal et al . ( 2020 ) , to compare the behaviors of two networks of identical architectures on the same inputs , we tested them on the largest ImageNet validation subset ( hereafter , ImageNet-CL ) where both models have 100 % accuracy . The sizes of the three subsets for three architectures—AlexNet , GoogLeNet , and ResNet—are respectively : 17,693 , 24,581 , and 27,343 . On modified ImageNet images ( e.g . ImageNet-C ) , we only tested each pair of networks on the modified images whose original versions exist in ImageNet-CL . That is , we wish to gain deeper insights into how networks behave on correctly-classified images , and then how their behaviors change when some input feature ( e.g . textures or shapes ) is modified . 3 EXPERIMENT AND RESULTS . 3.1 DO IMAGENET ADVERSARIALLY ROBUST NETWORKS PREFER SHAPES OR TEXTURES ? . It is important to know which type of feature a classifier uses when making decisions . While standard ImageNet networks often carry a strong texture bias ( Geirhos et al. , 2019 ) , it is unknown whether their adversarially-robust counterparts would be heavily texture- or shape-biased . Here , we test this hypothesis by comparing S and R models on the well-known cue-conflict dataset ( Geirhos et al. , 2019 ) . That is , we feed “ stylized ” images provided by Geirhos et al . ( 2019 ) that contain contradicting texture and shape cues ( e.g . elephant skin on a cat silhouette ) and count the times a model uses textures or shapes ( i.e . outputting elephant or cat ) when it makes a correct prediction . Experiment Our procedure follows Geirhos et al . ( 2019 ) . First , we excluded 80 images that do not have conflicting cues ( e.g . cat textures on cat shapes ) from their 1,280-image dataset . Each texture or shape cue belongs to one of 16 MS COCO ( Caesar et al. , 2018 ) coarse labels ( e.g . cat or elephant ) . Second , we ran the networks on these images and converted their 1000-class probability vector outputs into 16-class probability vectors by taking the average over the probabilities of the fine-grained classes that are under the same COCO label . Third , we took only the images that each network correctly labels ( i.e . into the texture or shape class ) , which ranges from 669 to 877 images ( out of 1,200 ) for 6 networks and computed the texture and shape accuracies over 16 classes . Results On average , over three architectures , R classifiers rely on shapes ≥ 67.08 % of the time i.e . ∼2.7× higher than 24.56 % of the S models ( Table 2 ) . In other words , by replacing the real examples with adversarial examples , adversarial training causes the heavy texture bias of ImageNet classifiers ( Geirhos et al. , 2019 ; Brendel & Bethge , 2019 ) to drop substantially ( ∼2.7× ) .
The submission concerns an experimental study of the behavior of networks trained with and without adversarial robustness criteria (using Madry et al., 2017). Given a set of such trained networks, a detailed look at the behavior and properties of adversarially robust networks and their non-robust counterparts is taken. This includes evaluation on the cue-conflict dataset (Geirhos et al.), and on scrambled, or texture-less (silhouette) variants of ImageNet images. Furthermore, visualizations of filter banks are analyzed and compared, as well as an analysis on the neuron level is carried out, using the NetDissect framework by Bau et al.
SP:d7243cbcc28ef5efc3891d4220342e818c87d188
No Spurious Local Minima: on the Optimization Landscapes of Wide and Deep Neural Networks
Empirical studies suggest that wide neural networks are comparably easy to optimize , but mathematical support for this observation is scarce . In this paper , we analyze the optimization landscapes of deep learning with wide networks . We prove especially that constraint and unconstraint empirical-risk minimization over such networks has no spurious local minima . Hence , our theories substantiate the common belief that increasing network widths not only improves the expressiveness of deep-learning pipelines but also facilitates their optimizations . 1 INTRODUCTION . Deep learning depends on optimization problems that seem impossible to solve , and yet , deeplearning pipelines outperform their competitors in many applications . A common suspicion is that the optimizations are often easier than they appear to be . In particular , while most objective functions are nonconvex and , therefore , might have spurious local minima , recent findings suggest that optimizations are not hampered by spurious local minima as long as the neural networks are sufficiently wide . For example , Dauphin et al . ( 2014 ) suggest that saddle points , rather than local minima , are the main challenges for optimizations over wide networks ; Goodfellow et al . ( 2014 ) give empirical evidence for stochastic-gradient descent to converge to a global minimum of the objective function of wide networks ; Livni et al . ( 2014 ) show that the optimizations over some classes of wide networks can be reduced to a convex problem ; Soudry & Carmon ( 2016 ) suggest that differentiable local minima of objective functions over wide networks are typically global minima ; Nguyen & Hein ( 2018 ) indicate that critical points in wide networks are often global minima ; and Allen-Zhu et al . ( 2019 ) and Du et al . ( 2019 ) suggest that stochastic-gradient descent typically converges to a global minimum for large networks . These findings raise the question of whether common optimization landscapes over wide ( but finite ) neural networks have no spurious local minima altogether . Progress in this direction has recently been made in Venturi et al . ( 2019 ) and then Lacotte & Pilanci ( 2020 ) . Broadly speaking , we call a local minimum spurious if there is no nonincreasing path to a global minimum ( see Section 2.2 for a formal definition ) . While the absence of spurious local minima does not preclude saddle points or suboptimal local minima in general , it means that one can move from every local minimum to a global minimum without increasing the objective function at any point—see Figure 1 for an illustration . Venturi et al . ( 2019 ) prove that there are no spurious local minima if the networks are sufficiently wide . Their theory has two main features that had not been established before : First , it holds for the entire landscapes—rather than for subsets of them . This feature is crucial : even randomized algorithms typically converge to sets of Lebesgue measure zero with probability one , that is , statements about “ almost all ” local minima are not necessarily meaningful . Second , their theory allows for arbitrary convex loss functions . This feature is important , for example , in view of the trends toward robust alternatives of the least-squares loss ( Belagiannis et al. , 2015 ; Jiang et al. , 2018 ; Wang et al. , 2016 ) . On the other hand , their theory has three major limitations : it is restricted to polynomial activation , which is convenient mathematically but much less popular than ReLU activation , it disregards regularizers and constraints , which have become standard in deep learning and in machine learning at large ( Hastie et al. , 2015 ) , and it restricts to shallow networks , that is , networks with only one hidden layer , which contrasts the deep architectures that are used in practice ( LeCun et al. , 2015 ) . Lacotte & Pilanci ( 2020 ) made progress on two of these limitations : first , their theory caters to ReLU activation rather than polynomial activation ; second , their theory allows for weight decay , which is a standard way to regularize estimators . However , their work is still restricted to one-hidden-layer networks . The interesting question is , therefore , whether such results can also be established for deep networks . And more generally , it would be highly desirable to have a theory for the absence of spurious local minima in a broad deep-learning framework . In this paper , we establish such a theory . We prove that the optimization landscapes of empirical-risk minimizers over wide feedforward networks have no spurious local minima . Our theory combines the features of the two mentioned works , as it applies to the entire optimization landscapes , allows for a wide spectrum of loss functions and activation functions , and constraint and unconstraint estimation . Moreover , it generalizes these works , as it allows for multiple outputs and arbitrary depths . Additionally , our proof techniques are considerably different from the ones used before and , therefore , might be of independent interest . Guide to the paper Sections 2 and 5 are the basic parts of the paper : they contain our main result and a short discussion of its implications . Readers who are interested in the underpinning principles should also study Section 3 , and readers who want additional insights on the proof techniques are referred to Section 4 . The actual proofs are stated in the Appendix . 2 DEEP-LEARNING FRAMEWORK AND MAIN RESULT . In this section , we specify the deep-learning framework and state our main result . The framework includes a wide range of feedforward neural networks ; in particular , it allows for arbitrarily many outputs and layers , a range of activation and loss functions , and constraint as well as unconstraint estimation . Our main result guarantees that if the networks are sufficiently wide , the objective function of the empirical-risk minimizer does not have any spurious local minima . 2.1 FEEDFORWARD NEURAL NETWORKS . We consider input data from a domain Dx ⊂ Rd and output data from a domain Dy ⊂ Rm . Typical examples are regression data with Dy = Rm and classification data with Dy = { ±1 } m. We model the data with layered , feedforward neural networks , that is , we study sets of functions G ··= { gΘ : Dx → Rm : Θ ∈M } ⊂ G ··= { gΘ : Dx → Rm : Θ ∈M } with gΘ [ x ] ··= Θlfl [ Θl−1 · · · f1 [ Θ0x ] ] for x ∈ Dx ( 1 ) and M⊂M ··= { Θ = ( Θl , . . . , Θ0 ) : Θj ∈ Rp j+1×pj } . The quantities p0 = d and pl+1 = m are the input and output dimensions , respectively , l the depth of the networks , and w ··= min { p1 , . . . , pl } the minimal width of the networks . The functions fj : Rpj → Rpj are called the activation functions . We assume that the activation functions are elementwise functions in the sense that fj [ b ] = ( fj [ b1 ] , . . . , fj [ bpj ] ) > for all b ∈ Rp j , where fj : R→ R is an arbitrary function . This allows for an unlimited variety in the type of activation , including ReLU fj : b 7→ max { 0 , b } , leaky ReLU fj : b 7→ max { 0 , b } + min { 0 , cb } for a fixed c ∈ ( 0 , 1 ) , polynomial fj : b 7→ cbk for fixed c ∈ ( 0 , ∞ ) and k ∈ [ 1 , ∞ ) , and sigmoid activation fj : b 7→ 1/ ( 1 + e−b ) as popular examples , and it allows for different activation functions in each layer . We study the most common approaches to parameter estimation in this setting : constraint and unconstraint empirical-risk minimization . The loss function l : Rm × Rm → R is assumed convex in its first argument ; this includes all standard loss functions , such as the least-squares loss l : ( a , b ) 7→ ||a − b||22 , the absolut-deviation loss l : ( a , b ) 7→ ||a − b||1 ( both typically used for regression ) , the logistic loss l : ( a , b ) 7→ − ( 1 + b ) log [ 1 + a ] − ( 1 − b ) log [ 1 − a ] , the hinge loss l : ( a , b ) 7→ max { 0 , 1− ab } ( both typically used for binary classification Dy = { ±1 } ) , and so forth . The optimization domain is the set M ··= { Θ ∈M : r [ Θ ] ≤ 1 } for a constraint r : M → R. Given data ( x1 , y1 ) , . . . , ( xn , yn ) ∈ Dx × Dy , the empirical-risk minimizers are then the networks gΘ̂erm with Θ̂erm ∈ arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] } . ( 2 ) It has been shown that constraints can facilitate the optimization as well as improve generalization— see Krizhevsky et al . ( 2012 ) and Livni et al . ( 2014 ) , among others . For ease of presentation , we limit ourselves to the following class of constraints : r [ Θ ] ··= max { ar max j∈ { 1 , ... , l } |||Θj |||1 , br|||Θ0|||q } for all Θ ∈M ( 3 ) for fixed tuning parameters ar , br ∈ [ 0 , ∞ ) , a parameter q ∈ ( 0 , ∞ ] , and ||| · |||q the usual row-wise ` q “ -norm , ” that is , |||Θj |||q ··= maxk ( ∑ i| ( Θj ) ki|q ) 1/q for q ∈ ( 0 , ∞ ) and |||Θj |||∞ ··= maxki| ( Θj ) ki| . This class of constraints includes the following four important cases : • Unconstraint estimation : ar = br = 0 . In other words , M =M . Unconstraint estimation had been the predominant approach in the earlier days of deep learning and is still used today ( Anthony & Bartlett , 1999 ) . • Connection sparsity : q = 1 . This constraint yields connection-sparse networks , which have received considerable attention recently ( Barron & Klusowski , 2018 ; 2019 ; Kim et al. , 2016 ; Taheri et al. , 2020 ) . • Strong sparsity : q < 1 . Nonconvex constraints have been popular in statistics for many years ( Fan & Li , 2001 ; Zhang , 2010 ) , but our paper is probably the first one that includes such constraints in a theoretical analysis in deep learning . • Input constraints : ar = 0 . Some researchers have argued for applying certain constraints , such as node-sparsity , only to the input level ( Feng & Simon , 2017 ) . In general , while our proof techniques also apply to many other types of constraints , there are two main reasons for using the mentioned sparsity-inducing constraints to illustrate our results : First , sparsity has become very popular in deep learning , because it can lower the burden on memory and optimization as well as increase interpretability ( Hebiri & Lederer , 2020 ) . And second , the above examples allow us to demonstrate that the discussed features of wide networks do not depend on smooth and convex constraints such as weight decay . Our theory can also be adjusted to the regularized versions of the empirical-risk minimizers , that is , for the networks indexed by any parameter in the set arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] + r [ Θ ] } . The proofs are virtually the same as for the constraint versions ; we omit the details for the sake of brevity . One line of research develops statistical theories for constraint and unconstraint empirical-risk minimizers—see Bartlett & Mendelson ( 2002 ) and Lederer ( 2020 ) , among others . As detailed above , empirical-risk minimizers are the networks whose parameters are global minima of the objective function Θ 7→ l [ gΘ ] ··= n∑ i=1 l [ gΘ [ xi ] , yi ] ( 4 ) over M for fixed data ( x1 , y1 ) , . . . , ( xn , yn ) . While the function gΘ 7→ l [ gΘ ] is convex by assumption , the objective function Θ 7→ l [ gΘ ] is usually nonconvex . It is thus unclear , per se , whether deep-learning pipelines can be expected to yield global minima of the objective function and , therefore , whether the statistical theories are valid in practice . Our goal is , broadly speaking , to establish conditions under which global minimization of ( 4 ) can indeed be expected .
This paper studies the optimization landscape of the training loss of deep neural networks. For a general setup, the paper shows that if the network width is greater than $2m(n+1)^l$, then any parameter value has a path to a global minimum on which the training loss does not increase. Here, $m$ is the output dimension, $n$ is the number of training examples, and $l$ is the number of hidden layers.
SP:44d8612c0df236bd137f053aa3d9ea450731f46a
No Spurious Local Minima: on the Optimization Landscapes of Wide and Deep Neural Networks
Empirical studies suggest that wide neural networks are comparably easy to optimize , but mathematical support for this observation is scarce . In this paper , we analyze the optimization landscapes of deep learning with wide networks . We prove especially that constraint and unconstraint empirical-risk minimization over such networks has no spurious local minima . Hence , our theories substantiate the common belief that increasing network widths not only improves the expressiveness of deep-learning pipelines but also facilitates their optimizations . 1 INTRODUCTION . Deep learning depends on optimization problems that seem impossible to solve , and yet , deeplearning pipelines outperform their competitors in many applications . A common suspicion is that the optimizations are often easier than they appear to be . In particular , while most objective functions are nonconvex and , therefore , might have spurious local minima , recent findings suggest that optimizations are not hampered by spurious local minima as long as the neural networks are sufficiently wide . For example , Dauphin et al . ( 2014 ) suggest that saddle points , rather than local minima , are the main challenges for optimizations over wide networks ; Goodfellow et al . ( 2014 ) give empirical evidence for stochastic-gradient descent to converge to a global minimum of the objective function of wide networks ; Livni et al . ( 2014 ) show that the optimizations over some classes of wide networks can be reduced to a convex problem ; Soudry & Carmon ( 2016 ) suggest that differentiable local minima of objective functions over wide networks are typically global minima ; Nguyen & Hein ( 2018 ) indicate that critical points in wide networks are often global minima ; and Allen-Zhu et al . ( 2019 ) and Du et al . ( 2019 ) suggest that stochastic-gradient descent typically converges to a global minimum for large networks . These findings raise the question of whether common optimization landscapes over wide ( but finite ) neural networks have no spurious local minima altogether . Progress in this direction has recently been made in Venturi et al . ( 2019 ) and then Lacotte & Pilanci ( 2020 ) . Broadly speaking , we call a local minimum spurious if there is no nonincreasing path to a global minimum ( see Section 2.2 for a formal definition ) . While the absence of spurious local minima does not preclude saddle points or suboptimal local minima in general , it means that one can move from every local minimum to a global minimum without increasing the objective function at any point—see Figure 1 for an illustration . Venturi et al . ( 2019 ) prove that there are no spurious local minima if the networks are sufficiently wide . Their theory has two main features that had not been established before : First , it holds for the entire landscapes—rather than for subsets of them . This feature is crucial : even randomized algorithms typically converge to sets of Lebesgue measure zero with probability one , that is , statements about “ almost all ” local minima are not necessarily meaningful . Second , their theory allows for arbitrary convex loss functions . This feature is important , for example , in view of the trends toward robust alternatives of the least-squares loss ( Belagiannis et al. , 2015 ; Jiang et al. , 2018 ; Wang et al. , 2016 ) . On the other hand , their theory has three major limitations : it is restricted to polynomial activation , which is convenient mathematically but much less popular than ReLU activation , it disregards regularizers and constraints , which have become standard in deep learning and in machine learning at large ( Hastie et al. , 2015 ) , and it restricts to shallow networks , that is , networks with only one hidden layer , which contrasts the deep architectures that are used in practice ( LeCun et al. , 2015 ) . Lacotte & Pilanci ( 2020 ) made progress on two of these limitations : first , their theory caters to ReLU activation rather than polynomial activation ; second , their theory allows for weight decay , which is a standard way to regularize estimators . However , their work is still restricted to one-hidden-layer networks . The interesting question is , therefore , whether such results can also be established for deep networks . And more generally , it would be highly desirable to have a theory for the absence of spurious local minima in a broad deep-learning framework . In this paper , we establish such a theory . We prove that the optimization landscapes of empirical-risk minimizers over wide feedforward networks have no spurious local minima . Our theory combines the features of the two mentioned works , as it applies to the entire optimization landscapes , allows for a wide spectrum of loss functions and activation functions , and constraint and unconstraint estimation . Moreover , it generalizes these works , as it allows for multiple outputs and arbitrary depths . Additionally , our proof techniques are considerably different from the ones used before and , therefore , might be of independent interest . Guide to the paper Sections 2 and 5 are the basic parts of the paper : they contain our main result and a short discussion of its implications . Readers who are interested in the underpinning principles should also study Section 3 , and readers who want additional insights on the proof techniques are referred to Section 4 . The actual proofs are stated in the Appendix . 2 DEEP-LEARNING FRAMEWORK AND MAIN RESULT . In this section , we specify the deep-learning framework and state our main result . The framework includes a wide range of feedforward neural networks ; in particular , it allows for arbitrarily many outputs and layers , a range of activation and loss functions , and constraint as well as unconstraint estimation . Our main result guarantees that if the networks are sufficiently wide , the objective function of the empirical-risk minimizer does not have any spurious local minima . 2.1 FEEDFORWARD NEURAL NETWORKS . We consider input data from a domain Dx ⊂ Rd and output data from a domain Dy ⊂ Rm . Typical examples are regression data with Dy = Rm and classification data with Dy = { ±1 } m. We model the data with layered , feedforward neural networks , that is , we study sets of functions G ··= { gΘ : Dx → Rm : Θ ∈M } ⊂ G ··= { gΘ : Dx → Rm : Θ ∈M } with gΘ [ x ] ··= Θlfl [ Θl−1 · · · f1 [ Θ0x ] ] for x ∈ Dx ( 1 ) and M⊂M ··= { Θ = ( Θl , . . . , Θ0 ) : Θj ∈ Rp j+1×pj } . The quantities p0 = d and pl+1 = m are the input and output dimensions , respectively , l the depth of the networks , and w ··= min { p1 , . . . , pl } the minimal width of the networks . The functions fj : Rpj → Rpj are called the activation functions . We assume that the activation functions are elementwise functions in the sense that fj [ b ] = ( fj [ b1 ] , . . . , fj [ bpj ] ) > for all b ∈ Rp j , where fj : R→ R is an arbitrary function . This allows for an unlimited variety in the type of activation , including ReLU fj : b 7→ max { 0 , b } , leaky ReLU fj : b 7→ max { 0 , b } + min { 0 , cb } for a fixed c ∈ ( 0 , 1 ) , polynomial fj : b 7→ cbk for fixed c ∈ ( 0 , ∞ ) and k ∈ [ 1 , ∞ ) , and sigmoid activation fj : b 7→ 1/ ( 1 + e−b ) as popular examples , and it allows for different activation functions in each layer . We study the most common approaches to parameter estimation in this setting : constraint and unconstraint empirical-risk minimization . The loss function l : Rm × Rm → R is assumed convex in its first argument ; this includes all standard loss functions , such as the least-squares loss l : ( a , b ) 7→ ||a − b||22 , the absolut-deviation loss l : ( a , b ) 7→ ||a − b||1 ( both typically used for regression ) , the logistic loss l : ( a , b ) 7→ − ( 1 + b ) log [ 1 + a ] − ( 1 − b ) log [ 1 − a ] , the hinge loss l : ( a , b ) 7→ max { 0 , 1− ab } ( both typically used for binary classification Dy = { ±1 } ) , and so forth . The optimization domain is the set M ··= { Θ ∈M : r [ Θ ] ≤ 1 } for a constraint r : M → R. Given data ( x1 , y1 ) , . . . , ( xn , yn ) ∈ Dx × Dy , the empirical-risk minimizers are then the networks gΘ̂erm with Θ̂erm ∈ arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] } . ( 2 ) It has been shown that constraints can facilitate the optimization as well as improve generalization— see Krizhevsky et al . ( 2012 ) and Livni et al . ( 2014 ) , among others . For ease of presentation , we limit ourselves to the following class of constraints : r [ Θ ] ··= max { ar max j∈ { 1 , ... , l } |||Θj |||1 , br|||Θ0|||q } for all Θ ∈M ( 3 ) for fixed tuning parameters ar , br ∈ [ 0 , ∞ ) , a parameter q ∈ ( 0 , ∞ ] , and ||| · |||q the usual row-wise ` q “ -norm , ” that is , |||Θj |||q ··= maxk ( ∑ i| ( Θj ) ki|q ) 1/q for q ∈ ( 0 , ∞ ) and |||Θj |||∞ ··= maxki| ( Θj ) ki| . This class of constraints includes the following four important cases : • Unconstraint estimation : ar = br = 0 . In other words , M =M . Unconstraint estimation had been the predominant approach in the earlier days of deep learning and is still used today ( Anthony & Bartlett , 1999 ) . • Connection sparsity : q = 1 . This constraint yields connection-sparse networks , which have received considerable attention recently ( Barron & Klusowski , 2018 ; 2019 ; Kim et al. , 2016 ; Taheri et al. , 2020 ) . • Strong sparsity : q < 1 . Nonconvex constraints have been popular in statistics for many years ( Fan & Li , 2001 ; Zhang , 2010 ) , but our paper is probably the first one that includes such constraints in a theoretical analysis in deep learning . • Input constraints : ar = 0 . Some researchers have argued for applying certain constraints , such as node-sparsity , only to the input level ( Feng & Simon , 2017 ) . In general , while our proof techniques also apply to many other types of constraints , there are two main reasons for using the mentioned sparsity-inducing constraints to illustrate our results : First , sparsity has become very popular in deep learning , because it can lower the burden on memory and optimization as well as increase interpretability ( Hebiri & Lederer , 2020 ) . And second , the above examples allow us to demonstrate that the discussed features of wide networks do not depend on smooth and convex constraints such as weight decay . Our theory can also be adjusted to the regularized versions of the empirical-risk minimizers , that is , for the networks indexed by any parameter in the set arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] + r [ Θ ] } . The proofs are virtually the same as for the constraint versions ; we omit the details for the sake of brevity . One line of research develops statistical theories for constraint and unconstraint empirical-risk minimizers—see Bartlett & Mendelson ( 2002 ) and Lederer ( 2020 ) , among others . As detailed above , empirical-risk minimizers are the networks whose parameters are global minima of the objective function Θ 7→ l [ gΘ ] ··= n∑ i=1 l [ gΘ [ xi ] , yi ] ( 4 ) over M for fixed data ( x1 , y1 ) , . . . , ( xn , yn ) . While the function gΘ 7→ l [ gΘ ] is convex by assumption , the objective function Θ 7→ l [ gΘ ] is usually nonconvex . It is thus unclear , per se , whether deep-learning pipelines can be expected to yield global minima of the objective function and , therefore , whether the statistical theories are valid in practice . Our goal is , broadly speaking , to establish conditions under which global minimization of ( 4 ) can indeed be expected .
This work showed that for a wide deep neural network, the optimization landscapes of empirical-risk minimizers over wide feedforward networks have no spurious local minima. The theory combines the features of the two mentioned works, as it applies to the entire optimization landscapes, allows for a wide spectrum of loss functions and activation functions, and constraint and unconstraint estimation. The proof defines two important concepts: path relation and block parameters and utilizes these two concepts and propositions and lemmas developed upon them to prove the main result.
SP:44d8612c0df236bd137f053aa3d9ea450731f46a
No Spurious Local Minima: on the Optimization Landscapes of Wide and Deep Neural Networks
Empirical studies suggest that wide neural networks are comparably easy to optimize , but mathematical support for this observation is scarce . In this paper , we analyze the optimization landscapes of deep learning with wide networks . We prove especially that constraint and unconstraint empirical-risk minimization over such networks has no spurious local minima . Hence , our theories substantiate the common belief that increasing network widths not only improves the expressiveness of deep-learning pipelines but also facilitates their optimizations . 1 INTRODUCTION . Deep learning depends on optimization problems that seem impossible to solve , and yet , deeplearning pipelines outperform their competitors in many applications . A common suspicion is that the optimizations are often easier than they appear to be . In particular , while most objective functions are nonconvex and , therefore , might have spurious local minima , recent findings suggest that optimizations are not hampered by spurious local minima as long as the neural networks are sufficiently wide . For example , Dauphin et al . ( 2014 ) suggest that saddle points , rather than local minima , are the main challenges for optimizations over wide networks ; Goodfellow et al . ( 2014 ) give empirical evidence for stochastic-gradient descent to converge to a global minimum of the objective function of wide networks ; Livni et al . ( 2014 ) show that the optimizations over some classes of wide networks can be reduced to a convex problem ; Soudry & Carmon ( 2016 ) suggest that differentiable local minima of objective functions over wide networks are typically global minima ; Nguyen & Hein ( 2018 ) indicate that critical points in wide networks are often global minima ; and Allen-Zhu et al . ( 2019 ) and Du et al . ( 2019 ) suggest that stochastic-gradient descent typically converges to a global minimum for large networks . These findings raise the question of whether common optimization landscapes over wide ( but finite ) neural networks have no spurious local minima altogether . Progress in this direction has recently been made in Venturi et al . ( 2019 ) and then Lacotte & Pilanci ( 2020 ) . Broadly speaking , we call a local minimum spurious if there is no nonincreasing path to a global minimum ( see Section 2.2 for a formal definition ) . While the absence of spurious local minima does not preclude saddle points or suboptimal local minima in general , it means that one can move from every local minimum to a global minimum without increasing the objective function at any point—see Figure 1 for an illustration . Venturi et al . ( 2019 ) prove that there are no spurious local minima if the networks are sufficiently wide . Their theory has two main features that had not been established before : First , it holds for the entire landscapes—rather than for subsets of them . This feature is crucial : even randomized algorithms typically converge to sets of Lebesgue measure zero with probability one , that is , statements about “ almost all ” local minima are not necessarily meaningful . Second , their theory allows for arbitrary convex loss functions . This feature is important , for example , in view of the trends toward robust alternatives of the least-squares loss ( Belagiannis et al. , 2015 ; Jiang et al. , 2018 ; Wang et al. , 2016 ) . On the other hand , their theory has three major limitations : it is restricted to polynomial activation , which is convenient mathematically but much less popular than ReLU activation , it disregards regularizers and constraints , which have become standard in deep learning and in machine learning at large ( Hastie et al. , 2015 ) , and it restricts to shallow networks , that is , networks with only one hidden layer , which contrasts the deep architectures that are used in practice ( LeCun et al. , 2015 ) . Lacotte & Pilanci ( 2020 ) made progress on two of these limitations : first , their theory caters to ReLU activation rather than polynomial activation ; second , their theory allows for weight decay , which is a standard way to regularize estimators . However , their work is still restricted to one-hidden-layer networks . The interesting question is , therefore , whether such results can also be established for deep networks . And more generally , it would be highly desirable to have a theory for the absence of spurious local minima in a broad deep-learning framework . In this paper , we establish such a theory . We prove that the optimization landscapes of empirical-risk minimizers over wide feedforward networks have no spurious local minima . Our theory combines the features of the two mentioned works , as it applies to the entire optimization landscapes , allows for a wide spectrum of loss functions and activation functions , and constraint and unconstraint estimation . Moreover , it generalizes these works , as it allows for multiple outputs and arbitrary depths . Additionally , our proof techniques are considerably different from the ones used before and , therefore , might be of independent interest . Guide to the paper Sections 2 and 5 are the basic parts of the paper : they contain our main result and a short discussion of its implications . Readers who are interested in the underpinning principles should also study Section 3 , and readers who want additional insights on the proof techniques are referred to Section 4 . The actual proofs are stated in the Appendix . 2 DEEP-LEARNING FRAMEWORK AND MAIN RESULT . In this section , we specify the deep-learning framework and state our main result . The framework includes a wide range of feedforward neural networks ; in particular , it allows for arbitrarily many outputs and layers , a range of activation and loss functions , and constraint as well as unconstraint estimation . Our main result guarantees that if the networks are sufficiently wide , the objective function of the empirical-risk minimizer does not have any spurious local minima . 2.1 FEEDFORWARD NEURAL NETWORKS . We consider input data from a domain Dx ⊂ Rd and output data from a domain Dy ⊂ Rm . Typical examples are regression data with Dy = Rm and classification data with Dy = { ±1 } m. We model the data with layered , feedforward neural networks , that is , we study sets of functions G ··= { gΘ : Dx → Rm : Θ ∈M } ⊂ G ··= { gΘ : Dx → Rm : Θ ∈M } with gΘ [ x ] ··= Θlfl [ Θl−1 · · · f1 [ Θ0x ] ] for x ∈ Dx ( 1 ) and M⊂M ··= { Θ = ( Θl , . . . , Θ0 ) : Θj ∈ Rp j+1×pj } . The quantities p0 = d and pl+1 = m are the input and output dimensions , respectively , l the depth of the networks , and w ··= min { p1 , . . . , pl } the minimal width of the networks . The functions fj : Rpj → Rpj are called the activation functions . We assume that the activation functions are elementwise functions in the sense that fj [ b ] = ( fj [ b1 ] , . . . , fj [ bpj ] ) > for all b ∈ Rp j , where fj : R→ R is an arbitrary function . This allows for an unlimited variety in the type of activation , including ReLU fj : b 7→ max { 0 , b } , leaky ReLU fj : b 7→ max { 0 , b } + min { 0 , cb } for a fixed c ∈ ( 0 , 1 ) , polynomial fj : b 7→ cbk for fixed c ∈ ( 0 , ∞ ) and k ∈ [ 1 , ∞ ) , and sigmoid activation fj : b 7→ 1/ ( 1 + e−b ) as popular examples , and it allows for different activation functions in each layer . We study the most common approaches to parameter estimation in this setting : constraint and unconstraint empirical-risk minimization . The loss function l : Rm × Rm → R is assumed convex in its first argument ; this includes all standard loss functions , such as the least-squares loss l : ( a , b ) 7→ ||a − b||22 , the absolut-deviation loss l : ( a , b ) 7→ ||a − b||1 ( both typically used for regression ) , the logistic loss l : ( a , b ) 7→ − ( 1 + b ) log [ 1 + a ] − ( 1 − b ) log [ 1 − a ] , the hinge loss l : ( a , b ) 7→ max { 0 , 1− ab } ( both typically used for binary classification Dy = { ±1 } ) , and so forth . The optimization domain is the set M ··= { Θ ∈M : r [ Θ ] ≤ 1 } for a constraint r : M → R. Given data ( x1 , y1 ) , . . . , ( xn , yn ) ∈ Dx × Dy , the empirical-risk minimizers are then the networks gΘ̂erm with Θ̂erm ∈ arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] } . ( 2 ) It has been shown that constraints can facilitate the optimization as well as improve generalization— see Krizhevsky et al . ( 2012 ) and Livni et al . ( 2014 ) , among others . For ease of presentation , we limit ourselves to the following class of constraints : r [ Θ ] ··= max { ar max j∈ { 1 , ... , l } |||Θj |||1 , br|||Θ0|||q } for all Θ ∈M ( 3 ) for fixed tuning parameters ar , br ∈ [ 0 , ∞ ) , a parameter q ∈ ( 0 , ∞ ] , and ||| · |||q the usual row-wise ` q “ -norm , ” that is , |||Θj |||q ··= maxk ( ∑ i| ( Θj ) ki|q ) 1/q for q ∈ ( 0 , ∞ ) and |||Θj |||∞ ··= maxki| ( Θj ) ki| . This class of constraints includes the following four important cases : • Unconstraint estimation : ar = br = 0 . In other words , M =M . Unconstraint estimation had been the predominant approach in the earlier days of deep learning and is still used today ( Anthony & Bartlett , 1999 ) . • Connection sparsity : q = 1 . This constraint yields connection-sparse networks , which have received considerable attention recently ( Barron & Klusowski , 2018 ; 2019 ; Kim et al. , 2016 ; Taheri et al. , 2020 ) . • Strong sparsity : q < 1 . Nonconvex constraints have been popular in statistics for many years ( Fan & Li , 2001 ; Zhang , 2010 ) , but our paper is probably the first one that includes such constraints in a theoretical analysis in deep learning . • Input constraints : ar = 0 . Some researchers have argued for applying certain constraints , such as node-sparsity , only to the input level ( Feng & Simon , 2017 ) . In general , while our proof techniques also apply to many other types of constraints , there are two main reasons for using the mentioned sparsity-inducing constraints to illustrate our results : First , sparsity has become very popular in deep learning , because it can lower the burden on memory and optimization as well as increase interpretability ( Hebiri & Lederer , 2020 ) . And second , the above examples allow us to demonstrate that the discussed features of wide networks do not depend on smooth and convex constraints such as weight decay . Our theory can also be adjusted to the regularized versions of the empirical-risk minimizers , that is , for the networks indexed by any parameter in the set arg min Θ∈M { n∑ i=1 l [ gΘ [ xi ] , yi ] + r [ Θ ] } . The proofs are virtually the same as for the constraint versions ; we omit the details for the sake of brevity . One line of research develops statistical theories for constraint and unconstraint empirical-risk minimizers—see Bartlett & Mendelson ( 2002 ) and Lederer ( 2020 ) , among others . As detailed above , empirical-risk minimizers are the networks whose parameters are global minima of the objective function Θ 7→ l [ gΘ ] ··= n∑ i=1 l [ gΘ [ xi ] , yi ] ( 4 ) over M for fixed data ( x1 , y1 ) , . . . , ( xn , yn ) . While the function gΘ 7→ l [ gΘ ] is convex by assumption , the objective function Θ 7→ l [ gΘ ] is usually nonconvex . It is thus unclear , per se , whether deep-learning pipelines can be expected to yield global minima of the objective function and , therefore , whether the statistical theories are valid in practice . Our goal is , broadly speaking , to establish conditions under which global minimization of ( 4 ) can indeed be expected .
[Summary] This paper considers the optimization landscape of deep learning with very wide networks. The main contribution of this paper is the result that shows the empirical risk of very wide networks has no *spurious local minima*. The results hold for both constrained (like the norm or sparsity constraints on the network parameters) or unconstrained risks, but require the network width larger than $O(mn^\ell)$, where $m$ is the output dimension, $n$ is the number of training samples, and $\ell$ is the number of layers.
SP:44d8612c0df236bd137f053aa3d9ea450731f46a
Gradient Origin Networks
1 INTRODUCTION . Observable data in nature has some parameters which are known , such as local coordinates , but also some unknown parameters such as how the data is related to other examples . Generative models , which learn a distribution over observables , are central to our understanding of patterns in nature and allow for efficient query of new unseen examples . Recently , deep generative models have received interest due to their ability to capture a broad set of features when modelling data distributions . As such , they offer direct applications such as synthesising high fidelity images ( Karras et al. , 2020 ) , super-resolution ( Dai et al. , 2019 ) , speech synthesis ( Li et al. , 2019 ) , and drug discovery ( Segler et al. , 2018 ) , as well as benefits for downstream tasks like semi-supervised learning ( Chen et al. , 2020 ) . A number of methods have been proposed such as Variational Autoencoders ( VAEs , Figure 1a ) , which learn to encode the data to a latent space that follows a normal distribution permitting sampling ( Kingma & Welling , 2014 ) . Generative Adversarial Networks ( GANs ) have two competing networks , one which generates data and another which discriminates from implausible results ( Goodfellow et al. , 2014 ) . Variational approaches that approximate the posterior using gradient descent ( Lipton & Tripathi , 2017 ) and short run MCMC ( Nijkamp et al. , 2020 ) respectively have been proposed , but to obtain a latent vector for a sample , they require iterative gradient updates . Autoregressive Models ( Van Den Oord et al. , 2016 ) decompose the data distribution as the product of conditional distributions and Normalizing Flows ( Rezende & Mohamed , 2015 ) chain together invertible functions ; both methods allow exact likelihood inference . Energy-Based Models ( EBMs ) map data points to ∗Authors contributed equally . energy values proportional to likelihood thereby permitting sampling through the use of Monte Carlo Markov Chains ( Du & Mordatch , 2019 ) . In general to support encoding , these approaches require separate encoding networks , are limited to invertible functions , or require multiple sampling steps . Implicit representation learning ( Park et al. , 2019 ; Tancik et al. , 2020 ) , where a network is trained on data parameterised continuously rather than in discrete grid form , has seen a surge of interest due to the small number of parameters , speed of convergence , and ability to model fine details . In particular , sinusoidal representation networks ( SIRENs ) ( Sitzmann et al. , 2020b ) achieve impressive results , modelling many signals with high precision , thanks to their use of periodic activations paired with carefully initialised MLPs . So far , however , these models have been limited to modelling single data samples , or use an additional hypernetwork or meta learning ( Sitzmann et al. , 2020a ) to estimate the weights of a simple implicit model , adding significant complexity . This paper proposes Gradient Origin Networks ( GONs ) , a new type of generative model ( Figure 1b ) that do not require encoders or hypernetworks . This is achieved by initialising latent points at the origin , then using the gradient of the log-likelihood of the data with respect to these points as the latent space . At inference , latent vectors can be obtained in a single step without requiring iteration . GONs are shown to have similar characteristics to convolutional autoencoders and variational autoencoders using approximately half the parameters , and can be applied to implicit representation networks ( such as SIRENs ) allowing a space of implicit functions to be learned with a simpler overall architecture . 2 PRELIMINARIES . We first introduce some background context that will be used to derive our proposed approach . 2.1 EMPIRICAL BAYES . The concept of empirical Bayes ( Robbins , 1956 ; Saremi & Hyvarinen , 2019 ) , for a random variable z ∼ pz and particular observation z0 ∼ pz0 , provides an estimator of z expressed purely in terms of p ( z0 ) that minimises the expected squared error . This estimator can be written as a conditional mean : ẑ ( z0 ) = ∫ zp ( z|z0 ) dz = ∫ z p ( z , z0 ) p ( z0 ) dz . ( 1 ) Of particular relevance is the case where z0 is a noisy observation of z with covariance Σ . In this case p ( z0 ) can be represented by marginalising out z : p ( z0 ) = ∫ 1 ( 2π ) d/2|det ( Σ ) |1/2 exp ( − ( z0 − z ) TΣ−1 ( z0 − z ) /2 ) p ( z ) dz . ( 2 ) Differentiating this with respect to z0 and multiplying both sides by Σ gives : Σ∇z0p ( z0 ) = ∫ ( z− z0 ) p ( z , z0 ) dz = ∫ zp ( z , z0 ) dz− z0p ( z0 ) . ( 3 ) After dividing through by p ( z0 ) and combining with Equation 1 we obtain a closed form estimator of z ( Miyasawa , 1961 ) written in terms of the score function∇ log p ( z0 ) ( Hyvärinen , 2005 ) : ẑ ( z0 ) = z0 + Σ∇z0 log p ( z0 ) . ( 4 ) This optimal procedure is achieved in what can be interpreted as a single gradient descent step , with no knowledge of the prior p ( z ) . By rearranging Equation 4 , a definition of ∇ log p ( z0 ) can be derived ; this can be used to train models that approximate the score function ( Song & Ermon , 2019 ) . 2.2 VARIATIONAL AUTOENCODERS . Variational Autoencoders ( VAEs ; Kingma & Welling 2014 ) are a probabilistic take on standard autoencoders that permit sampling . A latent-based generative model pθ ( x|z ) is defined with a normally distributed prior over the latent variables , pθ ( z ) = N ( z ; 0 , Id ) . pθ ( x|z ) is typically parameterised as a Bernoulli , Gaussian , multinomial distribution , or mixture of logits . In this case , the true posterior pθ ( z|x ) is intractable , so a secondary encoding network qφ ( z|x ) is used to approximate the true posterior ; the pair of networks thus resembles a traditional autoencoder . This allows VAEs to approximate pθ ( x ) by maximising the evidence lower bound ( ELBO ) , defined as : log pθ ( x ) ≥ LVAE = −DKL ( N ( qφ ( z|x ) ) ||N ( 0 , Id ) ) + Eqφ ( z|x ) [ log pθ ( x|z ) ] . ( 5 ) To optimise this lower bound with respect to θ and φ , gradients must be backpropagated through the stochastic process of generating samples from z′ ∼ qφ ( z|x ) . This is permitted by reparameterising z using the differentiable function z′ = µ ( z ) + σ ( z ) , where ∼ N ( 0 , Id ) and µ ( z ) and σ ( z ) 2 are the mean and variance respectively of a multivariate Gaussian distribution with diagonal covariance . 3 METHOD . Consider some dataset x ∼ pd of continuous or discrete signals x ∈ Rm , it is typical to assume that the data can be represented by low dimensional latent variables z ∈ Rk , which can be used by a generative neural network to reconstruct the data . These variables are often estimated through the use of a secondary encoding network that is trained concurrently with the generative network . An encoding network adds additional complexity ( and parameters ) to the model , it can be difficult to balance capacities of the two networks , and for complex hierarchical generative models designing a suitable architecture can be difficult . This has led some to instead approximate latent variables by performing gradient descent on the generative network ( Bojanowski et al. , 2018 ; Nijkamp et al. , 2020 ) . While this addresses the aforementioned problems , it significantly increases the run time of the inference process , introduces additional hyperparameters to tune , and convergence is not guaranteed . 3.1 GRADIENT ORIGIN NETWORKS . We propose a generative model that consists only of a decoding network , using empirical Bayes to approximate the posterior in a single step . That is , for some data point x and latent variable z ∼ pz , we wish to find an approximation of p ( z|x ) . Given some noisy observation z0 = z +N ( 0 , Id ) of z then empirical Bayes can be applied to approximate z . Specifically , since we wish to approximate z conditioned on x , we instead calculate ẑx , the least squares estimate of p ( z|x ) ( proof in Appendix A ) : ẑx ( z0 ) = z0 +∇z0 log p ( z0|x ) . ( 6 ) Using Bayes ’ rule , log p ( z0|x ) can be written as log p ( z0|x ) = log p ( x|z0 ) + log p ( z0 ) − log p ( x ) . Since log p ( x ) is a normalising constant that does not affect the gradient , we can rewrite Equation 6 in terms only of the decoding network and p ( z0 ) : ẑx ( z0 ) = z0 +∇z0 ( log p ( x|z0 ) + log p ( z0 ) ) . ( 7 ) It still remains , however , how to construct a noisy estimate of z0 with no knowledge of z . If we assume z follows a known distribution , then it is possible to develop reasonable estimates . For instance , if we assume p ( z ) = N ( z ; 0 , Id ) then we could sample from p ( z0 ) = N ( z0 ; 0 , 2Id ) however this could be far from the true distribution of p ( z0|z ) = N ( z0 ; z , Id ) . Instead we propose initialising z0 at the origin since this is the distribution ’ s mean . Initialising at a constant position decreases the input variation and thus simplifies the optimisation procedure . Naturally , how p ( x|z ) is modelled affects ẑx . While mean-field models result in ẑx that are linear functions of x , conditional autoregressive models , for instance , result in non-linear ẑx ; multiple gradient steps also induce non-linearity , however , we show that a single step works well on high dimensional data suggesting that linear encoders , which normally do not scale to high dimensional data are effective in this case . 3.2 AUTOENCODING WITH GONS . Before exploring GONs as generative models , we discuss the case where the prior p ( z ) is unknown ; such a model is referred to as an autoencoder . As such , the distribution p ( z0|z ) is also unknown thus it is again unclear how we can construct a noisy estimate of z . By training a model end-to-end where z0 is chosen as the origin , however , a prior is implicitly learned over z such that it is reachable from z0 . Although p ( z ) is unknown , we do not wish to impose a prior on z0 ; the term which enforces this is in Equation 7 is log p ( z0 ) , so we can safely ignore this term and simply maximise the likelihood of the data given z0 . Our estimator of z can therefore be defined simply as ẑx ( z0 ) = z0 +∇z0 log p ( x|z0 ) , which can otherwise be interpreted as a single gradient descent step on the conditional log-likelihood of the data . From this estimate , the data can be reconstructed by passing ẑx through the decoder to parameterise p ( x|ẑx ) . This procedure can be viewed more explicitly when using a neural network F : Rk → Rm to output the mean of p ( x|ẑx ) parameterised by a normal distribution ; in this case the loss function is defined in terms of mean squared error loss LMSE : Gx = LMSE ( x , F ( −∇z0LMSE ( x , F ( z0 ) ) ) ) . ( 8 ) The gradient computation thereby plays a similar role to an encoder , while F can be viewed as a decoder , with the outer loss term determining the overall reconstruction quality . Using a single network to perform both roles has the advantage of simplifying the overall architecture , avoiding the need to balance networks , and avoiding bottlenecks ; this is demonstrated in Figure 1b which provides a visualisation of the GON process .
The paper proposes GONs which seek to build a generative model with an “implicit” encoder that comes essentially for free with the use of a few re-parameterization tricks. The main idea being that existing generative models with an encoder are “redundant” in that the decoder itself has the ability to compute the gradient with respect to a latent vector, z, which itself can be thought of as the “encoding”. Since the choice of what initial latent vector to choose arises here, the paper advocates for simply choosing a z_0 which is a zero vector. In addition to the “explicit” formulation, there is also an implicit GON which is proposed that can generalize implicit generative models (like SIREN) to entire distributions as opposed to a single data point, as they are currently used.
SP:7a198931c36fb0b660c283036cbe475bb16750c9
Gradient Origin Networks
1 INTRODUCTION . Observable data in nature has some parameters which are known , such as local coordinates , but also some unknown parameters such as how the data is related to other examples . Generative models , which learn a distribution over observables , are central to our understanding of patterns in nature and allow for efficient query of new unseen examples . Recently , deep generative models have received interest due to their ability to capture a broad set of features when modelling data distributions . As such , they offer direct applications such as synthesising high fidelity images ( Karras et al. , 2020 ) , super-resolution ( Dai et al. , 2019 ) , speech synthesis ( Li et al. , 2019 ) , and drug discovery ( Segler et al. , 2018 ) , as well as benefits for downstream tasks like semi-supervised learning ( Chen et al. , 2020 ) . A number of methods have been proposed such as Variational Autoencoders ( VAEs , Figure 1a ) , which learn to encode the data to a latent space that follows a normal distribution permitting sampling ( Kingma & Welling , 2014 ) . Generative Adversarial Networks ( GANs ) have two competing networks , one which generates data and another which discriminates from implausible results ( Goodfellow et al. , 2014 ) . Variational approaches that approximate the posterior using gradient descent ( Lipton & Tripathi , 2017 ) and short run MCMC ( Nijkamp et al. , 2020 ) respectively have been proposed , but to obtain a latent vector for a sample , they require iterative gradient updates . Autoregressive Models ( Van Den Oord et al. , 2016 ) decompose the data distribution as the product of conditional distributions and Normalizing Flows ( Rezende & Mohamed , 2015 ) chain together invertible functions ; both methods allow exact likelihood inference . Energy-Based Models ( EBMs ) map data points to ∗Authors contributed equally . energy values proportional to likelihood thereby permitting sampling through the use of Monte Carlo Markov Chains ( Du & Mordatch , 2019 ) . In general to support encoding , these approaches require separate encoding networks , are limited to invertible functions , or require multiple sampling steps . Implicit representation learning ( Park et al. , 2019 ; Tancik et al. , 2020 ) , where a network is trained on data parameterised continuously rather than in discrete grid form , has seen a surge of interest due to the small number of parameters , speed of convergence , and ability to model fine details . In particular , sinusoidal representation networks ( SIRENs ) ( Sitzmann et al. , 2020b ) achieve impressive results , modelling many signals with high precision , thanks to their use of periodic activations paired with carefully initialised MLPs . So far , however , these models have been limited to modelling single data samples , or use an additional hypernetwork or meta learning ( Sitzmann et al. , 2020a ) to estimate the weights of a simple implicit model , adding significant complexity . This paper proposes Gradient Origin Networks ( GONs ) , a new type of generative model ( Figure 1b ) that do not require encoders or hypernetworks . This is achieved by initialising latent points at the origin , then using the gradient of the log-likelihood of the data with respect to these points as the latent space . At inference , latent vectors can be obtained in a single step without requiring iteration . GONs are shown to have similar characteristics to convolutional autoencoders and variational autoencoders using approximately half the parameters , and can be applied to implicit representation networks ( such as SIRENs ) allowing a space of implicit functions to be learned with a simpler overall architecture . 2 PRELIMINARIES . We first introduce some background context that will be used to derive our proposed approach . 2.1 EMPIRICAL BAYES . The concept of empirical Bayes ( Robbins , 1956 ; Saremi & Hyvarinen , 2019 ) , for a random variable z ∼ pz and particular observation z0 ∼ pz0 , provides an estimator of z expressed purely in terms of p ( z0 ) that minimises the expected squared error . This estimator can be written as a conditional mean : ẑ ( z0 ) = ∫ zp ( z|z0 ) dz = ∫ z p ( z , z0 ) p ( z0 ) dz . ( 1 ) Of particular relevance is the case where z0 is a noisy observation of z with covariance Σ . In this case p ( z0 ) can be represented by marginalising out z : p ( z0 ) = ∫ 1 ( 2π ) d/2|det ( Σ ) |1/2 exp ( − ( z0 − z ) TΣ−1 ( z0 − z ) /2 ) p ( z ) dz . ( 2 ) Differentiating this with respect to z0 and multiplying both sides by Σ gives : Σ∇z0p ( z0 ) = ∫ ( z− z0 ) p ( z , z0 ) dz = ∫ zp ( z , z0 ) dz− z0p ( z0 ) . ( 3 ) After dividing through by p ( z0 ) and combining with Equation 1 we obtain a closed form estimator of z ( Miyasawa , 1961 ) written in terms of the score function∇ log p ( z0 ) ( Hyvärinen , 2005 ) : ẑ ( z0 ) = z0 + Σ∇z0 log p ( z0 ) . ( 4 ) This optimal procedure is achieved in what can be interpreted as a single gradient descent step , with no knowledge of the prior p ( z ) . By rearranging Equation 4 , a definition of ∇ log p ( z0 ) can be derived ; this can be used to train models that approximate the score function ( Song & Ermon , 2019 ) . 2.2 VARIATIONAL AUTOENCODERS . Variational Autoencoders ( VAEs ; Kingma & Welling 2014 ) are a probabilistic take on standard autoencoders that permit sampling . A latent-based generative model pθ ( x|z ) is defined with a normally distributed prior over the latent variables , pθ ( z ) = N ( z ; 0 , Id ) . pθ ( x|z ) is typically parameterised as a Bernoulli , Gaussian , multinomial distribution , or mixture of logits . In this case , the true posterior pθ ( z|x ) is intractable , so a secondary encoding network qφ ( z|x ) is used to approximate the true posterior ; the pair of networks thus resembles a traditional autoencoder . This allows VAEs to approximate pθ ( x ) by maximising the evidence lower bound ( ELBO ) , defined as : log pθ ( x ) ≥ LVAE = −DKL ( N ( qφ ( z|x ) ) ||N ( 0 , Id ) ) + Eqφ ( z|x ) [ log pθ ( x|z ) ] . ( 5 ) To optimise this lower bound with respect to θ and φ , gradients must be backpropagated through the stochastic process of generating samples from z′ ∼ qφ ( z|x ) . This is permitted by reparameterising z using the differentiable function z′ = µ ( z ) + σ ( z ) , where ∼ N ( 0 , Id ) and µ ( z ) and σ ( z ) 2 are the mean and variance respectively of a multivariate Gaussian distribution with diagonal covariance . 3 METHOD . Consider some dataset x ∼ pd of continuous or discrete signals x ∈ Rm , it is typical to assume that the data can be represented by low dimensional latent variables z ∈ Rk , which can be used by a generative neural network to reconstruct the data . These variables are often estimated through the use of a secondary encoding network that is trained concurrently with the generative network . An encoding network adds additional complexity ( and parameters ) to the model , it can be difficult to balance capacities of the two networks , and for complex hierarchical generative models designing a suitable architecture can be difficult . This has led some to instead approximate latent variables by performing gradient descent on the generative network ( Bojanowski et al. , 2018 ; Nijkamp et al. , 2020 ) . While this addresses the aforementioned problems , it significantly increases the run time of the inference process , introduces additional hyperparameters to tune , and convergence is not guaranteed . 3.1 GRADIENT ORIGIN NETWORKS . We propose a generative model that consists only of a decoding network , using empirical Bayes to approximate the posterior in a single step . That is , for some data point x and latent variable z ∼ pz , we wish to find an approximation of p ( z|x ) . Given some noisy observation z0 = z +N ( 0 , Id ) of z then empirical Bayes can be applied to approximate z . Specifically , since we wish to approximate z conditioned on x , we instead calculate ẑx , the least squares estimate of p ( z|x ) ( proof in Appendix A ) : ẑx ( z0 ) = z0 +∇z0 log p ( z0|x ) . ( 6 ) Using Bayes ’ rule , log p ( z0|x ) can be written as log p ( z0|x ) = log p ( x|z0 ) + log p ( z0 ) − log p ( x ) . Since log p ( x ) is a normalising constant that does not affect the gradient , we can rewrite Equation 6 in terms only of the decoding network and p ( z0 ) : ẑx ( z0 ) = z0 +∇z0 ( log p ( x|z0 ) + log p ( z0 ) ) . ( 7 ) It still remains , however , how to construct a noisy estimate of z0 with no knowledge of z . If we assume z follows a known distribution , then it is possible to develop reasonable estimates . For instance , if we assume p ( z ) = N ( z ; 0 , Id ) then we could sample from p ( z0 ) = N ( z0 ; 0 , 2Id ) however this could be far from the true distribution of p ( z0|z ) = N ( z0 ; z , Id ) . Instead we propose initialising z0 at the origin since this is the distribution ’ s mean . Initialising at a constant position decreases the input variation and thus simplifies the optimisation procedure . Naturally , how p ( x|z ) is modelled affects ẑx . While mean-field models result in ẑx that are linear functions of x , conditional autoregressive models , for instance , result in non-linear ẑx ; multiple gradient steps also induce non-linearity , however , we show that a single step works well on high dimensional data suggesting that linear encoders , which normally do not scale to high dimensional data are effective in this case . 3.2 AUTOENCODING WITH GONS . Before exploring GONs as generative models , we discuss the case where the prior p ( z ) is unknown ; such a model is referred to as an autoencoder . As such , the distribution p ( z0|z ) is also unknown thus it is again unclear how we can construct a noisy estimate of z . By training a model end-to-end where z0 is chosen as the origin , however , a prior is implicitly learned over z such that it is reachable from z0 . Although p ( z ) is unknown , we do not wish to impose a prior on z0 ; the term which enforces this is in Equation 7 is log p ( z0 ) , so we can safely ignore this term and simply maximise the likelihood of the data given z0 . Our estimator of z can therefore be defined simply as ẑx ( z0 ) = z0 +∇z0 log p ( x|z0 ) , which can otherwise be interpreted as a single gradient descent step on the conditional log-likelihood of the data . From this estimate , the data can be reconstructed by passing ẑx through the decoder to parameterise p ( x|ẑx ) . This procedure can be viewed more explicitly when using a neural network F : Rk → Rm to output the mean of p ( x|ẑx ) parameterised by a normal distribution ; in this case the loss function is defined in terms of mean squared error loss LMSE : Gx = LMSE ( x , F ( −∇z0LMSE ( x , F ( z0 ) ) ) ) . ( 8 ) The gradient computation thereby plays a similar role to an encoder , while F can be viewed as a decoder , with the outer loss term determining the overall reconstruction quality . Using a single network to perform both roles has the advantage of simplifying the overall architecture , avoiding the need to balance networks , and avoiding bottlenecks ; this is demonstrated in Figure 1b which provides a visualisation of the GON process .
This paper proposes a new type of generative models with a new inference method of latent variables. Specifically, the gradient of latent variables with respect to zero vector is taken as the inferred latent variables. Based on this, the authors generalize the propose model to implicit and variational versions and demonstrate the models on image datasets.
SP:7a198931c36fb0b660c283036cbe475bb16750c9
Gradient Origin Networks
1 INTRODUCTION . Observable data in nature has some parameters which are known , such as local coordinates , but also some unknown parameters such as how the data is related to other examples . Generative models , which learn a distribution over observables , are central to our understanding of patterns in nature and allow for efficient query of new unseen examples . Recently , deep generative models have received interest due to their ability to capture a broad set of features when modelling data distributions . As such , they offer direct applications such as synthesising high fidelity images ( Karras et al. , 2020 ) , super-resolution ( Dai et al. , 2019 ) , speech synthesis ( Li et al. , 2019 ) , and drug discovery ( Segler et al. , 2018 ) , as well as benefits for downstream tasks like semi-supervised learning ( Chen et al. , 2020 ) . A number of methods have been proposed such as Variational Autoencoders ( VAEs , Figure 1a ) , which learn to encode the data to a latent space that follows a normal distribution permitting sampling ( Kingma & Welling , 2014 ) . Generative Adversarial Networks ( GANs ) have two competing networks , one which generates data and another which discriminates from implausible results ( Goodfellow et al. , 2014 ) . Variational approaches that approximate the posterior using gradient descent ( Lipton & Tripathi , 2017 ) and short run MCMC ( Nijkamp et al. , 2020 ) respectively have been proposed , but to obtain a latent vector for a sample , they require iterative gradient updates . Autoregressive Models ( Van Den Oord et al. , 2016 ) decompose the data distribution as the product of conditional distributions and Normalizing Flows ( Rezende & Mohamed , 2015 ) chain together invertible functions ; both methods allow exact likelihood inference . Energy-Based Models ( EBMs ) map data points to ∗Authors contributed equally . energy values proportional to likelihood thereby permitting sampling through the use of Monte Carlo Markov Chains ( Du & Mordatch , 2019 ) . In general to support encoding , these approaches require separate encoding networks , are limited to invertible functions , or require multiple sampling steps . Implicit representation learning ( Park et al. , 2019 ; Tancik et al. , 2020 ) , where a network is trained on data parameterised continuously rather than in discrete grid form , has seen a surge of interest due to the small number of parameters , speed of convergence , and ability to model fine details . In particular , sinusoidal representation networks ( SIRENs ) ( Sitzmann et al. , 2020b ) achieve impressive results , modelling many signals with high precision , thanks to their use of periodic activations paired with carefully initialised MLPs . So far , however , these models have been limited to modelling single data samples , or use an additional hypernetwork or meta learning ( Sitzmann et al. , 2020a ) to estimate the weights of a simple implicit model , adding significant complexity . This paper proposes Gradient Origin Networks ( GONs ) , a new type of generative model ( Figure 1b ) that do not require encoders or hypernetworks . This is achieved by initialising latent points at the origin , then using the gradient of the log-likelihood of the data with respect to these points as the latent space . At inference , latent vectors can be obtained in a single step without requiring iteration . GONs are shown to have similar characteristics to convolutional autoencoders and variational autoencoders using approximately half the parameters , and can be applied to implicit representation networks ( such as SIRENs ) allowing a space of implicit functions to be learned with a simpler overall architecture . 2 PRELIMINARIES . We first introduce some background context that will be used to derive our proposed approach . 2.1 EMPIRICAL BAYES . The concept of empirical Bayes ( Robbins , 1956 ; Saremi & Hyvarinen , 2019 ) , for a random variable z ∼ pz and particular observation z0 ∼ pz0 , provides an estimator of z expressed purely in terms of p ( z0 ) that minimises the expected squared error . This estimator can be written as a conditional mean : ẑ ( z0 ) = ∫ zp ( z|z0 ) dz = ∫ z p ( z , z0 ) p ( z0 ) dz . ( 1 ) Of particular relevance is the case where z0 is a noisy observation of z with covariance Σ . In this case p ( z0 ) can be represented by marginalising out z : p ( z0 ) = ∫ 1 ( 2π ) d/2|det ( Σ ) |1/2 exp ( − ( z0 − z ) TΣ−1 ( z0 − z ) /2 ) p ( z ) dz . ( 2 ) Differentiating this with respect to z0 and multiplying both sides by Σ gives : Σ∇z0p ( z0 ) = ∫ ( z− z0 ) p ( z , z0 ) dz = ∫ zp ( z , z0 ) dz− z0p ( z0 ) . ( 3 ) After dividing through by p ( z0 ) and combining with Equation 1 we obtain a closed form estimator of z ( Miyasawa , 1961 ) written in terms of the score function∇ log p ( z0 ) ( Hyvärinen , 2005 ) : ẑ ( z0 ) = z0 + Σ∇z0 log p ( z0 ) . ( 4 ) This optimal procedure is achieved in what can be interpreted as a single gradient descent step , with no knowledge of the prior p ( z ) . By rearranging Equation 4 , a definition of ∇ log p ( z0 ) can be derived ; this can be used to train models that approximate the score function ( Song & Ermon , 2019 ) . 2.2 VARIATIONAL AUTOENCODERS . Variational Autoencoders ( VAEs ; Kingma & Welling 2014 ) are a probabilistic take on standard autoencoders that permit sampling . A latent-based generative model pθ ( x|z ) is defined with a normally distributed prior over the latent variables , pθ ( z ) = N ( z ; 0 , Id ) . pθ ( x|z ) is typically parameterised as a Bernoulli , Gaussian , multinomial distribution , or mixture of logits . In this case , the true posterior pθ ( z|x ) is intractable , so a secondary encoding network qφ ( z|x ) is used to approximate the true posterior ; the pair of networks thus resembles a traditional autoencoder . This allows VAEs to approximate pθ ( x ) by maximising the evidence lower bound ( ELBO ) , defined as : log pθ ( x ) ≥ LVAE = −DKL ( N ( qφ ( z|x ) ) ||N ( 0 , Id ) ) + Eqφ ( z|x ) [ log pθ ( x|z ) ] . ( 5 ) To optimise this lower bound with respect to θ and φ , gradients must be backpropagated through the stochastic process of generating samples from z′ ∼ qφ ( z|x ) . This is permitted by reparameterising z using the differentiable function z′ = µ ( z ) + σ ( z ) , where ∼ N ( 0 , Id ) and µ ( z ) and σ ( z ) 2 are the mean and variance respectively of a multivariate Gaussian distribution with diagonal covariance . 3 METHOD . Consider some dataset x ∼ pd of continuous or discrete signals x ∈ Rm , it is typical to assume that the data can be represented by low dimensional latent variables z ∈ Rk , which can be used by a generative neural network to reconstruct the data . These variables are often estimated through the use of a secondary encoding network that is trained concurrently with the generative network . An encoding network adds additional complexity ( and parameters ) to the model , it can be difficult to balance capacities of the two networks , and for complex hierarchical generative models designing a suitable architecture can be difficult . This has led some to instead approximate latent variables by performing gradient descent on the generative network ( Bojanowski et al. , 2018 ; Nijkamp et al. , 2020 ) . While this addresses the aforementioned problems , it significantly increases the run time of the inference process , introduces additional hyperparameters to tune , and convergence is not guaranteed . 3.1 GRADIENT ORIGIN NETWORKS . We propose a generative model that consists only of a decoding network , using empirical Bayes to approximate the posterior in a single step . That is , for some data point x and latent variable z ∼ pz , we wish to find an approximation of p ( z|x ) . Given some noisy observation z0 = z +N ( 0 , Id ) of z then empirical Bayes can be applied to approximate z . Specifically , since we wish to approximate z conditioned on x , we instead calculate ẑx , the least squares estimate of p ( z|x ) ( proof in Appendix A ) : ẑx ( z0 ) = z0 +∇z0 log p ( z0|x ) . ( 6 ) Using Bayes ’ rule , log p ( z0|x ) can be written as log p ( z0|x ) = log p ( x|z0 ) + log p ( z0 ) − log p ( x ) . Since log p ( x ) is a normalising constant that does not affect the gradient , we can rewrite Equation 6 in terms only of the decoding network and p ( z0 ) : ẑx ( z0 ) = z0 +∇z0 ( log p ( x|z0 ) + log p ( z0 ) ) . ( 7 ) It still remains , however , how to construct a noisy estimate of z0 with no knowledge of z . If we assume z follows a known distribution , then it is possible to develop reasonable estimates . For instance , if we assume p ( z ) = N ( z ; 0 , Id ) then we could sample from p ( z0 ) = N ( z0 ; 0 , 2Id ) however this could be far from the true distribution of p ( z0|z ) = N ( z0 ; z , Id ) . Instead we propose initialising z0 at the origin since this is the distribution ’ s mean . Initialising at a constant position decreases the input variation and thus simplifies the optimisation procedure . Naturally , how p ( x|z ) is modelled affects ẑx . While mean-field models result in ẑx that are linear functions of x , conditional autoregressive models , for instance , result in non-linear ẑx ; multiple gradient steps also induce non-linearity , however , we show that a single step works well on high dimensional data suggesting that linear encoders , which normally do not scale to high dimensional data are effective in this case . 3.2 AUTOENCODING WITH GONS . Before exploring GONs as generative models , we discuss the case where the prior p ( z ) is unknown ; such a model is referred to as an autoencoder . As such , the distribution p ( z0|z ) is also unknown thus it is again unclear how we can construct a noisy estimate of z . By training a model end-to-end where z0 is chosen as the origin , however , a prior is implicitly learned over z such that it is reachable from z0 . Although p ( z ) is unknown , we do not wish to impose a prior on z0 ; the term which enforces this is in Equation 7 is log p ( z0 ) , so we can safely ignore this term and simply maximise the likelihood of the data given z0 . Our estimator of z can therefore be defined simply as ẑx ( z0 ) = z0 +∇z0 log p ( x|z0 ) , which can otherwise be interpreted as a single gradient descent step on the conditional log-likelihood of the data . From this estimate , the data can be reconstructed by passing ẑx through the decoder to parameterise p ( x|ẑx ) . This procedure can be viewed more explicitly when using a neural network F : Rk → Rm to output the mean of p ( x|ẑx ) parameterised by a normal distribution ; in this case the loss function is defined in terms of mean squared error loss LMSE : Gx = LMSE ( x , F ( −∇z0LMSE ( x , F ( z0 ) ) ) ) . ( 8 ) The gradient computation thereby plays a similar role to an encoder , while F can be viewed as a decoder , with the outer loss term determining the overall reconstruction quality . Using a single network to perform both roles has the advantage of simplifying the overall architecture , avoiding the need to balance networks , and avoiding bottlenecks ; this is demonstrated in Figure 1b which provides a visualisation of the GON process .
This paper introduces a "new" inference method for autoencoder-type models, where the encoder is taken as a gradient of the decoder with respect to a zero-initialized latent variable. The method is evaluated for both a deterministic autoencoder and a VAE on toy image data (cifar10 being the most complex of them) and applied to convolutional decoder and to SIREN-type implicit representation networks. This is, for all intents and purposes, a single step iterative inference setup. In its VAE variant it is extremely similar to old-school iterative inference, albeit with a single gradient step.
SP:7a198931c36fb0b660c283036cbe475bb16750c9
On the Neural Tangent Kernel of Equilibrium Models
1 INTRODUCTION Recent works empirically observe that as the depth of a weight-tied input-injected network increases , its output tends to converge to a fixed point . Motivated by this phenomenon , DEQ models were proposed to effectively represent an “ infinite depth ” network by root-finding . A natural question to ask is , what will DEQs become if their widths also go to infinity ? It is well-known that at certain random initialization , neural networks of various structures converge to Gaussian processes as their widths go to infinity ( Neal , 1996 ; Lee et al. , 2017 ; Yang , 2019 ; Matthews et al. , 2018 ; Novak et al. , 2018 ; Garriga-Alonso et al. , 2018 ) . Recent deep learning theory advances have also shown that in the infinite width limit , with proper initialization ( the NTK initialization ) , training the network fθ with gradient descent is equivalent to solving kernel regression with respect to the neural tangent kernel ( Arora et al. , 2019 ; Jacot et al. , 2018 ; Yang , 2019 ; Huang et al. , 2020 ) . However , as the depth goes to infinity , Jacot et al . ( 2019 ) showed that the NTKs of fully-connected neural networks ( FCNN ) converge either to a constant ( freeze ) , or to the Kronecker Delta ( chaos ) . In this work , we show that with input injection , the DEQ-NTKs converge to meaningful fixed points that depend on the input in a non-trivial way , thus avoiding both freeze and chaos . Furthermore , analogous to DEQ models , we can compute these kernels by solving an analogous fixed point equation , rather than simply iteratively applying the updates associated with the traditional NTK . Moreover , such derivations carry over to other structures like convolution DEQs ( CDEQ ) as well . We evaluate the approach and demonstrate that it typically matches or improves upon the performance of existing regularized NTK methods . 2 BACKGROUND AND PRELIMINARIES Bai et al . ( 2019 ) proposed the DEQ model , which is equivalent to running an infinite depth network with tied weight and input injection . These methods trace back to some of the original work in recurrent backpropagation ( Almeida , 1990 ; Pineda , 1988 ) , but with specific emphasis on : 1 ) computing the fixed point directly via root-finding rather than forward iteration ; and 2 ) incorporating the elements from modern deep networks in the single “ layer ” , such as self-attention transformers ( Bai et al. , 2019 ) , multi-scale convolutions ( Bai et al. , 2020 ) , etc . The DEQ algorithm finds the infinite depth fixed point using quasi-Newton root finding methods , and then backpropagates using implicit differentiation without storing the derivatives in the intermediate layers , thus achieving a constant memory complexity . Furthermore , although a traditional DEQ model does not always guarantee to find a stable fixed point , with careful parameterization and update method , monotone operator DEQs can ensure the existence of a unique stable fixed point ( Winston & Kolter , 2020 ) . On the side of connecting neural networks to kernel methods , Neal ( 1996 ) first discovered that a single-layered network with randomly initialized parameters becomes a Gaussian process ( GP ) in the large width limit . Such connection between neural networks and GP was later extended to multiple layers ( Lee et al. , 2017 ; Matthews et al. , 2018 ) and various other architectures ( Yang , 2019 ; Novak et al. , 2018 ; Garriga-Alonso et al. , 2018 ) . The networks studied in this line of works are randomly initialized , and one can imagine these networks as having fixed parameters throughout the training process , except for the last classification layer . Following the naming convention of Arora et al . ( 2019 ) , we call these networks weakly-trained , and networks where every layer is updated are called fully-trained . Weakly-trained nets induce the kernel Θ ( x , y ) = Eθ∼N [ f ( θ , x ) · f ( θ , y ) ] , where x , y ∈ Rd are two samples , θ represents the parameters of the network , N is the initialization distribution ( often Gaussian ) over θ , and f ( θ , · ) ∈ R is the output of the network . One related topic in studying the relation between Gaussian process kernel and depth is the meanfield theory . Poole et al . ( 2016 ) ; Schoenholz et al . ( 2016 ) showed that the correlations between all inputs on an infinitely wide weakly-trained net become either perfectly correlated ( order ) or decorrelated ( chaos ) as depth increases . This aligns with the observation in Jacot et al . ( 2019 ) . They suggested we should initialize the neural network on the “ edge-of-chaos ” to make sure that signals can propagate deep enough in the forward direction , and the gradient does not vanish or explode during backpropagation ( Raghu et al. , 2017 ; Schoenholz et al. , 2016 ) . These mean-field behaviors were later proven for various other structures like RNNs , CNNs , and NTKs as well ( Chen et al. , 2018a ; Xiao et al. , 2018 ; Gilboa et al. , 2019 ; Hayou et al. , 2019 ) . We emphasize that despite the similar appearance , our setting avoids the order vs. chaos scheme completely by adding input injection . Such structure guarantees the converged nets depend nontrivially on the inputs , as we will see later in the experiments . It can be unsatisfying that the previous results only involve weakly-trained nets . Interestingly , similar limiting behavior was proven by Jacot et al . ( 2018 ) to hold for fully-trained networks as well . They showed the kernel induced by a fully-trained infinite width network is the following : Θ ( x , y ) = Eθ∼N [ 〈 ∂f ( θ , x ) ∂θ , ∂f ( θ , y ) ∂θ 〉 ] . ( 1 ) They also gave a recursive formulation for the NTK of FCNN . Arora et al . ( 2019 ) ; Yang ( 2020 ) later provided formulation for convolution NTK and other structures . One may ask what happens if both the width and the depth go to infinity . It turns out that the vanilla FCNN does not have a meaningful convergence : either it gives constant kernels or Kronecker Delta kernels ( Jacot et al. , 2019 ) . On the bright side , this assertion is not always the case for other network structures . For example , the NTK induced by ResNet provides a meaningful fixed point in the large depth limit ( Huang et al. , 2020 ) . This may seem to give one explanation why ResNet outperforms FCNN , but unfortunately they also show that the ResNet NTK with infinite depth is no different from the ResNet NTK with just depth one . This conclusion makes the significance of infinite depth questionable . 2.1 NOTATIONS Throughout the paper , we write θ as the parameters for some network fθ or equivalently , f ( θ , · ) . We write capital letter W to represent matrices or tensors , which should be clear from the context , and use [ W ] i to represent the element of W indexed by i . We write lower case letter x to represent vectors or scalars . For a ∈ Z+ , let [ a ] = { 1 , . . . , a } . Denote σ ( x ) = √ 2max ( 0 , x ) as the normalized ReLU and σ̇ its derivative ( which only need to be well-defined almost everywhere ) . The symbol σ2a with subscript is always used to denote the variance of some distribution . We write N ( µ , Σ ) as the Gaussian distribution with mean µ ∈ Rd and covariance matrix Σ ∈ Rd×d . We let Sd−1 be the unit sphere embedded in Rd . 3 DEQ-NTK OF FULLY-CONNECTED NEURAL NETWORKS In this section , we show how to derive the NTK of the fully-connected DEQ ( DEQ-NTK ) . From now on , we simplify fully-connected DEQs as DEQs . Recall that DEQs are equivalent to infinitely deep fully-connected neural nets with input injection ( FCNN-IJ ) , and one can either exactly solve the fixed point using root-finding ( up to machine epsilon and root-finding algorithm accuracy ) or approximate the DEQs by just doing finite depth forward iterations . In section 3.1 , we show the NTK of the approximated DEQ using finite depth iteration , and in section 3.2 we demonstrate how to get the exact convergence point of DEQ-NTK . The details of this section can be found in appendix A . 3.1 FINITE DEPTH ITERATION OF DEQ-NTK Let d be the input dimension , x , y ∈ Rd be a pair of inputs , Nh be the width of the hth layers where h ∈ [ L+ 1 ] . Let N0 = d and NL+1 = 1 . Define the FCNN-IJ with L hidden layers as follows : f ( h ) θ ( x ) = √ σ2W Nh W ( h ) g ( h−1 ) ( x ) + √ σ2U Nh U ( h ) x+ √ σ2b Nh b ( h ) , h ∈ [ L+ 1 ] g ( L ) ( x ) = σ ( f ( L ) θ ( x ) ) where W ( h ) ∈ RNh×Nh−1 , U ( h ) ∈ RNh×d are the internal weights , and b ( h ) ∈ RNh are the bias terms . These parameters are chosen using the NTK initialization . Let us pick σW , σU , σb ∈ R arbitrarily in this section . NTK initialization . We randomly initialize every entry of every W , U , b from N ( 0 , 1 ) . Without loss of generality ( WLOG ) we assume the width of the hidden layer Nh = N is the same across different layers . We remark the readers to distinguish FCNN-IJ from a recurrent neural network ( RNN ) : our model injects the original input to each layer , whereas a RNN has a sequence of input ( x1 , . . . , xT ) , and inject xt to the tth-layer . Here is a crucial distinction between finite width DEQs and infinite width DEQs : Remark 1 . In the finite width regime , one typically has to assume the DEQs have tied weights , that is , W ( 1 ) = . . . = W ( L+1 ) . Otherwise it is unlikely the network will converge at all . In fact , one needs to be very careful with the parametrization of the weights to guarantee the fixed point is unique and stable . This is not the case in the infinite width regime . As we shall see soon , even with distinct weights in each layer , the convergence of DEQ-NTKs only depend on σ2W , σ 2 U , σ 2 b , and the nonlinearity σ . Assuming untied weights makes the analysis easier , but the same argument can be made rigorously for tied weights as well , see Yang ( 2019 ; 2020 ) . Our main theorem is the following : Theorem 1 . Recursively define the following quantities for h ∈ [ L ] : Σ ( 0 ) ( x , y ) = x⊤y ( 2 ) Λ ( h ) ( x , y ) = ( Σ ( h−1 ) ( x , x ) Σ ( h−1 ) ( x , y ) Σ ( h−1 ) ( y , x ) Σ ( h−1 ) ( y , y ) ) ∈ R2×2 ( 3 ) Σ ( h ) ( x , y ) = σ2WE ( u , v ) ∼N ( 0 , Λ ( h ) ) [ σ ( u ) σ ( v ) ] + σ2Ux⊤y + σ2b ( 4 ) Σ̇ ( h ) ( x , y ) = σ2WE ( u , v ) ∼N ( 0 , Λ ( h ) ) [ σ̇ ( u ) σ̇ ( v ) ] ( 5 ) Then the L-depth iteration to the DEQ-NTK can be expressed as : Θ ( L ) ( x , y ) = L+1∑ h=1 ( Σ ( h−1 ) ( x , y ) ) · L+1∏ h′=h Σ̇ ( h ′ ) ( x , y ) , ( 6 ) where by convention we set Σ̇L+1 ( x , y ) = 1 for the L-depth iteration . Proof Sketch . The first step is to show that at each layer h ∈ [ L ] , the representation f ( h ) θ ( x ) is associated with a Gaussian process with kernel eq . ( 3 ) as N → ∞ . Then use the characterization in eq . ( 1 ) , calculate the NTK by : Θ ( L ) ( x , y ) = Eθ [ 〈 ∂f ( θ , x ) ∂θ , ∂f ( θ , y ) ∂θ 〉 ] =Eθ [ 〈 ∂f ( θ , x ) ∂W , ∂f ( θ , y ) ∂W 〉 ] ︸ ︷︷ ︸ 1 +Eθ [ 〈 ∂f ( θ , x ) ∂U , ∂f ( θ , y ) ∂U 〉 ] ︸ ︷︷ ︸ 2 +Eθ [ 〈 ∂f ( θ , x ) ∂b , ∂f ( θ , y ) ∂b 〉 ] ︸ ︷︷ ︸ 3 . Calculating each term using the chain rule , we get eq . ( 6 ) . 3.2 FIXED POINT OF DEQ-NTK Based on eq . ( 6 ) , we are now ready to answer what the fixed point of Θ ( L ) is . By convention , we assume the two samples x , y ∈ Sd−1 , and we require the parameters σ2W , σ2U , σ2b obey the DEQNTK initialization . DEQ-NTK initialization . Let every entry of every W , U , b follows the NTK initialization described in section 3.1 , as well as the additional requirement σ2W + σ 2 U + σ 2 b = 1 . Let the nonlinear activation function σ be the normalized ReLU : σ ( x ) = √ 2max ( 0 , x ) . Definition 3.1 ( Normalized activation ) . We call an activation function σ : R → R normalized if Ex∼N ( 0,1 ) [ σ ( x ) 2 ] = 1 . Using normalized activations along with DEQ-NTK initialization , we can derive the main convergence theorem : Theorem 2 . Use same notations and settings in theorem 1 . With input data x , y ∈ Sd−1 , parameters σ2W , σ 2 U , σ 2 b follow the DEQ-NTK initialization , the fixed point of DEQ-NTK is Θ∗ ( x , y ) ≜ lim L→∞ Θ ( L ) ( x , y ) = Σ∗ ( x , y ) 1− Σ̇∗ ( x , y ) , ( 7 ) where Σ∗ ( x , y ) ≜ ρ∗ is the root of : Rσ ( ρ ) − ρ , where Rσ ( ρ ) ≜ σ2W ( √ 1− ρ2 + ( π − cos−1 ρ ) ρ π ) + σ2Ux ⊤y + σ2b , ( 8 ) and Σ̇∗ ( x , y ) ≜ lim h→∞ Σ̇ ( h ) ( x , y ) = σ2W ( π − cos−1 ( ρ∗ ) π ) . ( 9 ) Proof . Due to the fact that x ∈ Sd−1 , σ being a normalized activation , and DEQ-NTK initialization , one can easily calculate by induction that for all h ∈ [ L ] : Σ ( h ) ( x , x ) = σ2W E u∼N ( 0,1 ) [ σ ( u ) 2 ] + σ2V x ⊤x+ σ2b = 1 This indicates that in eq . ( 3 ) , the covariance matrix has a special structure Λ ( h ) ( x , y ) = ( 1 ρ ρ 1 ) , where ρ = Σ ( h−1 ) ( x , y ) depends on h , x , y . For simplicity we omit the h , x , y in Λ ( h ) ( x , y ) . As shown in Daniely et al . ( 2016 ) : E ( u , v ) ∼N ( 0 , Λ ) [ σ ( u ) σ ( v ) ] = √ 1− ρ2 + ( π − cos−1 ( ρ ) ) ρ π ( 10 ) E ( u , v ) ∼N ( 0 , Λ ) [ σ̇ ( u ) σ̇ ( v ) ] = π − cos−1 ( ρ ) π ( 11 ) Adding input injection and bias , we derive eq . ( 8 ) from eq . ( 10 ) , and similarly , eq . ( 9 ) from eq . ( 11 ) . Notice that iterating eqs . ( 2 ) to ( 4 ) to solve for Σ ( h ) ( x , y ) is equivalent to iterating ( Rσ ◦ · · ·◦Rσ ) ( ρ ) with initial input ρ = x⊤y . Take the derivative ∣∣∣∣ dRσ ( ρ ) dρ ∣∣∣∣ = ∣∣∣∣∣∣ σ2W ( 1− cos −1 ( ρ ) π ) ∣∣∣∣∣∣ < 1 , if σ2W < 1 and −1 ≤ ρ < 1 . For x ∕= y we have −1 ≤ ρ < c < 1 for some c ( this is because we only have finite number of inputs x , y ) and by DEQ-NTK initialization we have σ2W < 1 , so the above inequality hold . Hence Rσ ( ρ ) is a contraction on [ 0 , c ] , and we conclude that the fixed point ρ∗ is attractive . By lemma 1 , if σ2W < 1 , then the limit of eq . ( 6 ) exists , so we can rewrite the summation form in eq . ( 6 ) in a recursive form : Θ ( 0 ) ( x , y ) = Σ ( 0 ) ( x , y ) Θ ( L+1 ) ( x , y ) = Σ̇ ( L+1 ) ( x , y ) ·Θ ( L ) ( x , y ) + Σ ( L+1 ) ( x , y ) , and directly solve the fixed point iteration : lim L→∞ Θ ( L+1 ) ( x , y ) = lim L→∞ ( Σ̇ ( L+1 ) ( x , y ) ·Θ ( L ) ( x , y ) + Σ ( L+1 ) ( x , y ) ) =⇒ lim L→∞ Θ ( L+1 ) ( x , y ) = Σ̇∗ ( x , y ) · lim L→∞ Θ ( L ) ( x , y ) + Σ∗ ( x , y ) =⇒ lim L→∞ Θ ( L ) ( x , y ) = Σ̇∗ ( x , y ) · lim L→∞ Θ ( L ) ( x , y ) + Σ∗ ( x , y ) . ( 12 ) Solving for limL→∞ Θ ( L ) ( x , y ) we get Θ∗ ( x , y ) = Σ∗ ( x , y ) 1−Σ̇∗ ( x , y ) . Remark 2 . Note our Σ∗ ( x , y ) always depends on the inputs x and y , so the information between two inputs is always preserved , even if the depth goes to infinity . On the contrary as pointed out by Jacot et al . ( 2019 ) , without input injection , Σ ( h ) ( x , y ) always converges to 1 as h → ∞ , even if x ∕= y . 4 DEQ WITH CONVOLUTION LAYERS In this section we show how to derive the NTKs for convolution DEQs ( CDEQ ) . Although in this paper only the CDEQ with vanilla convolution structure is considered in experiments , we remark that our derivation is general enough for other CDEQ structure as well , for instance , CDEQ with global pooling layer . The details of this section can be found in appendix B . Unlike the FCNN-IJ , whose intermediate NTK representation is a real number . For convolution neural networks ( CNN ) , the intermediate NTK representation is a four-way tensor . In the following , we will present the notations , CNN with input injection ( CNN-IJ ) formulation , the CDEQ-NTK initialization , and our main theorem . Notation . We adopt the notations from Arora et al . ( 2019 ) . Let x , y ∈ RP×Q be a pair of inputs , let q ∈ Z+ be the filter size ( WLOG assume it is odd as well ) . By convention , we always pad the representation ( both the input layer and hidden layer ) with 0 ’ s . Denote the convolution operation as following : [ w ∗ x ] ij = q−1 2∑ a=− q−12 q−1 2∑ b=− q−12 [ w ] a+ q+12 , b+ q+1 2 [ x ] a+i , b+j for i ∈ [ P ] , j ∈ [ Q ] . Denote Dij , i′j′ = { ( i+ a , j + b , i′ + a′ , j′ + b′ ) ∈ [ P ] × [ Q ] × [ P ] × [ Q ] : − ( q − 1 ) /2 ≤ a , b , a′ , b′ ≤ ( q − 1 ) /2 } . Intuitively , Dij , i′j′ is a q × q × q × q set of indices centered at ( ij , i′j′ ) . For any tensor T ∈ RP×Q×P×Q , let [ T ] Dij , i′j′ be the natural sub-tensor and let Tr ( T ) = ∑ i , j Tij , ij . Formulation of CNN-IJ . Define the CNN-IJ as follows : • Let the input x ( 0 ) = x ∈ RP×Q×C0 , where C0 is the number of input channels , and Ch is the number of channels in layer h. Assume WLOG that Ch = C for all h ∈ [ L ] • For h = 1 , . . . , L , let the inner representation x̃ ( h ) ( β ) = Ch−1∑ α=1 √ σ2W Ch W ( h ) ( α ) , ( β ) ∗ x ( h−1 ) ( α ) + C0∑ α=1 √ σ2U Ch U ( h ) ( α ) , ( β ) ∗ x ( 0 ) ( α ) ( 13 ) [ x ( h ) ( β ) ] ij = 1 [ S ] ij [ σ ( x̃ ( h ) ( β ) ) ] ij , for i ∈ [ P ] , j ∈ [ Q ] ( 14 ) where W ( h ) ( α ) , ( β ) ∈ R q×q represent the convolution operator from the αth channel in layer h − 1 to the βth channel in layer h. Similarly , U ( h ) ( α ) , ( β ) ∈ R q×q injects the input in each convolution window . S ∈ RP×Q is a normalization matrix . Let W , U , S , σ2U , σ2W be chosen by the CDEQ-NTK initialization described later . Notice here we assume WLOG that the number of channels in the hidden layers is the same . • The final output is defined to be fθ ( x ) = ∑CL α=1 〈 W ( L+1 ) ( α ) , x ( L ) ( α ) 〉 , where W ( L+1 ) ( α ) ∈ RP×Q is sampled from standard Gaussian distribution . CDEQ-NTK initialization . Let 1q ∈ Rq×q , X ∈ RP×Q be two all-one matrices . Let X̃ ∈ R ( P+2 ) × ( Q+2 ) be the output of zero-padding X . We index the rows of X̃ by { 0 , 1 , . . . , P + 1 } and columns by { 0 , 1 , . . . , Q + 1 } . For position i ∈ [ P ] , j ∈ [ Q ] , let ( [ S ] ij ) 2 = [ 1q ∗ X̃ ] ij in eq . ( 14 ) . Let every entry of every W , U be sampled from N ( 0 , 1 ) and σ2W + σ2U = 1 . Using the above defined notations , we now state the CDEQ-NTK . Theorem 3 . Let x , y ∈ RP×Q×C0 be s.t ‖xij‖2 = ‖yij‖2 = 1 for i ∈ [ P ] , j ∈ [ Q ] . Define the following expressions recursively ( some x , y are omitted in the notations ) , for ( i , j , i′ , j′ ) ∈ [ P ] × [ Q ] × [ P ] × [ Q ] , h ∈ [ L ] K ( 0 ) ij , i′j′ ( x , y ) = ∑ α∈ [ C0 ] x ( α ) ⊗ y ( α ) ij , i′j′ ( 15 ) [ Σ ( 0 ) ( x , y ) ] ij , i′j′ = 1 [ S ] ij [ S ] i′j′ C0∑ α=1 Tr ( [ K ( 0 ) ( α ) ( x , y ) ] Dij , i′j′ ) ( 16 ) Λ ( h ) ij , i′j′ ( x , y ) = [ Σ ( h−1 ) ( x , x ) ] ij , ij [ Σ ( h−1 ) ( x , y ) ] ij , i′j′ [ Σ ( h−1 ) ( y , x ) ] i′j′ , ij [ Σ ( h−1 ) ( y , y ) ] i′j′ , i′j′ ∈ R2×2 ( 17 ) [ K ( h ) ( x , y ) ] ij , i′j′ = σ2W [ S ] ij · [ S ] i′j′ E ( u , v ) ∼N ( 0 , Λ ( h ) ij , i′j′ ) [ σ ( u ) σ ( v ) ] + σ2U [ S ] ij · [ S ] i′j′ [ K ( 0 ) ] ij , i′j′ ( 18 ) [ K̇ ( h ) ( x , y ) ] ij , i′j′ = σ2W [ S ] ij · [ S ] i′j′ E ( u , v ) ∼N ( 0 , Λ ( h ) ij , i′j′ ) [ σ̇ ( u ) σ̇ ( v ) ] ( 19 ) [ Σ ( h ) ( x , y ) ] ij , i′j′ = Tr ( [ K ( h ) ( x , y ) ] Dij , i′j′ ) ( 20 ) Define the linear operator L : RP×Q×P×Q → RP×Q×P×Q via [ L ( M ) ] ij , i′j′ = Tr ( [ M ] Dij , i′j′ ) . Then the CDEQ-NTK can be found solving the following linear system : Θ∗ ( x , y ) = K̇∗ ( x , y ) ⊙ L ( Θ∗ ( x , y ) ) +K∗ ( x , y ) , ( 21 ) where K∗ ( x , y ) = limL→∞ K ( L ) ( x , y ) , K̇∗ ( x , y ) = limL→∞ K̇ ( L ) ( x , y ) . The limit exists if σ2W < 1 . 5 EXPERIMENTS In this section , we evaluate the performance of DEQ-NTK and CDEQ-NTK on both MNIST and CIFAR-10 datasets . We also compare the performance of finite depth NTK and finite depth iteration of DEQ-NTK . Implementation . For DEQ-NTK , aligned with the theory , we normalize the dataset such that each data point has unit length . The fixed point Σ∗ ( x , y ) is solved by using the modified Powell hybrid method ( Powell , 1970 ) . Notice these root finding problems are one-dimensional , hence can be quickily solved . For CDEQ-NTK , the input data x has dimension P × Q × C0 , and we normalize x s.t ‖xij‖2 = 1 for any i ∈ [ P ] , j ∈ [ Q ] . We set q = 3 and stride 1 . The fixed point Σ∗ ( x , y ) ∈ RP×Q×P×Q is approximated by running 20 iterations of eq . ( 17 ) , eq . ( 18 ) , and eq . ( 20 ) . The actual CDEQ-NTK Θ ( x , y ) is then calculated by solving the sparse linear system eq . ( 21 ) . After obtaining the NTK matrix , we apply kernel regressions ( without regularization unless stated otherwise ) . For any label y ∈ { 1 , . . . , n } , denote its one-hot encoding by ey . Let 1 ∈ Rn be an all-1 vector , we train on the new encoding −0.1 · 1 + ey . That is , we change the “ 1 ” to 0.9 , and the “ 0 ” to −0.1 , as suggested by Novak et al . ( 2018 ) . Result . On MNIST data , we test the performance of DEQ-NTK with σ2W = 0.25 , σ2U = 0.25 , σ2b = 0.5 and achieve 98.6 % test accuracy . The results are listed in table 1 . On CIFAR-10 , we trained DEQ-NTK with three different sets of random initializations . These initializations are not fine-tuned , yet we can still see they are comparable , or even superior , to the finite-depth NTK with carefully chosen regularization . For CDEQ-NTK , we compute the kernel matrix on 2000 training data and tested on 10000 samples . See the results in table 2 .
This paper studies the double infinite-width + infinite-depth limit of fully connected and convolutional neural nets from an NTK angle, when input injections enter the picture. The techniques mix NTK techniques with Deep Equilibrium (DEQ) model techniques to directly compute the infinite-depth limit of the infinite-width limit of such neural nets. They show that there is no freeze/chaos transition for such networks (unlike the case without input injections). The writing is reasonably clear, although the size of the formulas is not very pleasant.
SP:3bd9aeb125e33dd92db4510d3c2c26e782576ab8