paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
LMSA: Low-relation Mutil-head Self-Attention Mechanism in Visual Transformer | 1 INTRODUCTION . The self-attention mechanism proposed by Vaswani et al . ( 2017 ) is originated from the natural language processing ( NLP ) Transformer network . Due to its superior performance , the self-attention mechanism has been widely used in the NLP field . The standard self-attention formula is defined as : Attention ( Q , K , V ) = softmax ( QKT√ dim ) V ( 1 ) The standard self-attention mechanism converts the input features linearly to obtain the variables Query ( Q ) , Key ( K ) , and Value ( V ) with the same dimension ( dim ) , then normalizes the result from the vector dot product of the Q and K , and then obtains the potential relationship between every two features , finally uses this potential relationship to re-combine the features to get the output features . Compared to recurrent neural network ( RNN ) ( Lipton et al. , 2015 ) series , self-attention is characterized by directly calculating dependencies regardless of the distance between features and can be calculated in parallel . ( Tang et al. , 2018 ) demonstrate that the self-Attention mechanism is better at Word Sense Disambiguation ( WSD ) tasks ( Raganato et al. , 2017 ) . The authors believe that the powerful semantic feature extraction ability is the key reason why self-Attention has better performance than RNN . Most recent studies have focused on improving the efficiency of the self-attention mechanism as it brings the computational complexity of O ( N2 ) to reach a considerable performance gain . Therefore , a batch of variants that pay more attention to computational efficiency are proposed on the basis of original transformer backbone , such as LongFormer ( Beltagy et al. , 2020 ) , Reformer ( Kitaev et al. , 2020 ) , Faster-Transformer , Turbo-Transformers ( Fang et al. , 2020 ) etc .. Through changing the feature sequence , partial self-attention , hardware acceleration , and other methods , the Transformer model can be better used in the NLP field . In the meanwhile , the excellent performance of the self-attention mechanism in the field of NLP has attracted great attention in computer vision . The Vision Transformer ( ViT ) backbone model proposed by ( Dosovitskiy et al. , 2020 ) divides the image information into patches for parallel input into the model , discards the decoder in the original transformer model , and retains its encoder as the feature extractor connected to the MLP layer to get output features . The results show that ViT is potentially competitive to the CNN network series ( He et al. , 2016 ) , which increasingly makes the Self-Attention mechanism popular for visual tasks . In addition to processing input and output features , ViT obeys the conventional Transformer Block , which makes ViT have high computational complexity , and coupled with the diversity of image feature information , it makes ViT training difficult . In essence , Transformer is data-hungry ( Khan et al. , 2021 ) , which makes it a consensus to establish more efficient and extensive attention fusion image features . ( Liu et al. , 2021 ) proposes Swin Transformer , which further divides the features into several windows based on patch division . Swin introduces Non-Local neural network ( Wang et al. , 2018 ) to model the relationship of each patch in windows and realizes the cross-window relationship modeling through the shift window operation . Recently , Cswin ( Dong et al. , 2021 ) abandons the shift windows method , set windows as stripe , and models the horizontal and vertical relationships of features at the same time . Even there are many similar applications of Transformer to the field of vision , but the works aim at optimizing the visual self-attention mechanism is relatively rare . This paper proposes a novel self-attention mechanism Low-relation Mutil-head Self-Attention ( LMSA ) to reduce the number of feature mapping Query and Key dimensions while maintaining the V alue dimension . This exploration breaks the information consistency of the traditional self-attention mechanism and greatly saves the computational complexity of a single self-Attention block . The diagram of LMSA is shown in Figure 1 , which also illustrates the difference between the proposed LMSA and the newly proposed multi-head self-attention mechanism . Specifically , we modified the self-attention mechanism based on recently proposed models such as Swin and Cswin , and we conducted a controlled experiment on the two attention mechanisms . In the Swin model , by appropriately compressing the number of dimensions , the image classification performance of the model has been further improved . In the Cswin model , we maximize the dimensionality compression of Query and Key , while its performance on different datasets remains competitive to the traditional self-attention mechanism . More importantly , through experiments , we demonstrate that the self-attention mechanism doesn ’ t have to align the dimensions of Query , Key , and V alue to be same . The excessively high dimensions of Query and Key not only cause model data redundancy but even have a negative impact on the final model performance . 2 RELATED WORK . 2.1 MUTIL-HEAD SELF-ATTENTION MACHINISM . For a long time , CNN and RNN as the first choice for sequence task models have the disadvantage that they can not be calculated in parallel . The input of each subsequence depends on the output of the previous subsequence , and as the sequence length increases , it will be accompanied by long-term memory failure . The Transformer was proposed by ( Vaswani et al. , 2017 ) . Transformer abandons the recurrent network structure and uses scaled dot-Product attention ( see Equation 1 ) as its computing core to obtain the correlation of features at any two positions , and perform feature fusion based on this . In order to enable the model to pay more attention to the information of different representation subspaces at different positions , the author embeds the multi-head mechanism into self-attention . The formula of the multi-head self-attention mechanism is as follows : MutilHead ( Q , K , V ) = Concat ( head1 , ... , headh ) W 0 Where headi = Attention ( QW Q i , KW K i , V W V i ) ( 2 ) Where WQi ∈ Rdmodel×dk , WKi ∈ Rdmodel×dk , WVi ∈ Rdmodel×dv , WO ∈ Rhdv×dmodel . Each head uses a different weight transformation , all heads are calculated in parallel , and the calculation results are concatenated to obtain the final output . Adjust the output scale by controlling the dimension of V alue . Generally , the dimension of V alue is set to be the same as the input feature . After a complete multi-head attention calculation , the input and output sizes can be guaranteed to be consistent . It is convenient to embed various networks for multi-head attention . 2.2 EFFICIENT ATTENTION . The multi-head self-attention mechanism has achieved great success in the field of NLP , but it has also brought excessive complexity , especially in long text sequence tasks . Memory Compressed Transformer ( Liu et al. , 2018 ) tries to divide a long text sequence into several modules of similar size , and perform self-attention within the modules , and reduce the size of the self-attention matrix through stride convolution , so as to achieve the goal of improving efficiency . ( Child et al. , 2019 ) proposed the Sparse Transformer , which simplifies the dense attention to sparse attention through explicit selection , and improves the concentration of the model . Longformer ( Beltagy et al. , 2020 ) which based on Sparse Transformer combines sliding window and dilated sliding window to achieve local and global Balance of attention . Axial Transformer ( Ho et al. , 2019 ) applies multiple attention along a single axis of the input tensor . Since the length of any single axis is usually much smaller than the total number of elements , this model can significantly save computation and memory . Unlike the previously mentioned Efficient Transformer , Refomer ( Kitaev et al. , 2020 ) has a more in-depth discussion of the self-attention mechanism itself . By designing a reversible Transformer Block , Reformer greatly saves the space used to store intermediate results and proposed that locality sensitive hashing only calculates similar feature relationships , which effectively reduces the computational complexity . Synthesizer ( Tay et al . ) changes the self-attention mechanism more boldly . It directly abandoned the generation and calculation of Query and Key , and instead used random initialization or linear projection of input features to directly replace the calculation results of QKT . The author concludes through experiments that this method has advantages and disadvantages with the traditional self-attention mechanism , and has no affiliation with it , which makes people interested in the effective principle of the self-attention mechanism . 2.3 VISUAL TRANSFORMER . With the continuous development of Transformer in the NLP field , people have also begun to try to introduce the self-attention mechanism into visual tasks . After ViT ( Dosovitskiy et al. , 2020 ) was proposed , more efficient visual Transformers have also been proposed . Among them , the most concerned are Swin Tranformer ( Liu et al. , 2021 ) and Cswin Transformer ( Dong et al. , 2021 ) . Swin Transformer realizes a more flexible local fusion of information through multi-level division of image features and then realizes information interaction between windows through shift operations . Cswin sets the windows in Swin as a bidirectional stripe with cross-feature capability , which is a successful application of Axial Attention in the computer vision field . Both Swin and CSwin adopted the strategy proposed by PiT ( Heo et al. , 2021 ) , dividing the entire model into several Layers , and down-sampling between the two layers . As the features move forward in the model , their scale decreases while their dimensions increase until the final High-Level feature is obtained to continue downstream tasks . The network structure of the Swin and Cswin model is shown in Figure 2 . 2.4 CONVOLUTIONAL VISION TRANSFORMER . Visual Tranformer ’ s extensive research makes the Self-Attention mechanism often used to compare with convolution , Convolutional Vision Transformer ( Wu et al. , 2021 ) groundbreakingly combines convolution and self-attention mechanism . CvT discards position embeding and uses convolutional projection instead of linear projection to generate the Q , K , and V required for self-attention calculations , as shown in Figure 3 . These changes enable CvT to well inherit the advantages of CNN while maintaining the dynamic self-encoding characteristics of Transformer : translation , scaling , and distortion invariance . 3 METHODOLOGY . Unlike text sequence features , visual features often contain more nonobjective information . The development of Transfomer in the computer vision field shows that the self-attention mechanism can effectively extract image features , and there is still much room for improvement . However , the standard self-attention mechanism has a computational complexity of O ( N2 ) . As the image size increases , the self-attention mechanism consumes a lot more computing time and storage space , which limits the efficiency of the self-attention mechanism in visual tasks . To reduce the complexity of the self-attention mechanism and improve the computational efficiency , in this paper , we propose Low-Relation Mutil-Head Self-Attention , which aims to reduce the low-quality data that has a small effect on the calculation result in the self-attention . 3.1 LOW-RELATION MUTIL-HEAD SELF-ATTENTION . In order to solve the problem of the high complexity of the self-attention mechanism , a large number of Efficient Attentions have been proposed ( Tay et al. , 2020 ) . The most common way to increase calculation speed is to control the number of Keys and V alues . Associate the Query generated by the feature map with the Key whose number is much smaller than Query , and act on the scaled V alue to achieve the purpose of improving efficiency by losing a certain accuracy . In the visual task , the most concerned optimization method is to adjust the receptive field of the self-attention mechanism to achieve a balance of accuracy and efficiency . The above self-attention optimization methods mostly focus on adjusting the number of features used for calculation . From the perspective of feature dimensions , we try to compress the number of Query and Key dimensions as much as possible while keeping the V alue dimension unchanged and explore the impact of this compression on the accuracy of self-attention . In the proposed LMSA , the consistency of Query , Key , and V alue dimensions is destroyed . We control the overall complexity by adjusting the dimensions of Query and Key . The core formula of LMSA is expressed as follows : LMSA ( Q , K , V ) = MutilHead ( CP ( Q ) , CP ( K ) , V ) ( 3 ) where CP ( X ) indicates the compress operation of X . In LMSA , we still use the multi-head mechanism to divide the feature into several heads , and each head is calculated in parallel . In the case of extreme compression , after Query and Key are divided into several heads , each head can only retain one dimension , that is , dimQi =1 . In specific tasks , we need to adjust the dimensions of Query and Key to meet the actual needs . | This paper presents a mechanism to reduce the computation costs of a standard self-attention module, named LMSA. The basic idea of LMSA is to reduce the dimension of key&query of self-attention(SA) while keeping the dimension of value unchanged. Therefore, the computational complexity of SA will be reduced from O(N^2D) to O(N^2D_q,k). They study the proposed mechanism on image classification and semantic segmentation. | SP:bfd698531bd15daa78d1084ad669c886027e687c |
A Collaborative Attention Adaptive Network for Financial Market Forecasting | 1 INTRODUCTION . In recent years , the use of social media information to predict the financial market has attracted the attention of more and more researchers , and some satisfactory experimental results have been achieved . This is due to the fact that social media information contains investor-related attitudes and subjective sentiments to the financial market , resulting in many investment banks and hedge funds trying to dig out valuable information from media information to help better predict financial markets , which play a key role in predicting the market . At the same time , the efficient market hypothesis ( EMH ) introduced by Fama ( 1970 ) points out that the current price of the asset reflects all the prior information that is immediately available . Therefore , using social media information and the actual price of the current financial market seems to be able to complete the market forecasting more accurately . To the best of our knowledge , the different types of data fusion methods commonly used in the field of financial market forecasting are mainly concatenation or weighted sums . They are simple , direct , and almost no parameter exchange methods to achieve data fusion ( Xu & Cohen , 2018 ; Perez-Rua et al. , 2019 ; Xu et al. , 2019 ) . In the field of computer vision ( CV ) , multimodal fusion methods are mainly used for the fusion of data based on text and images . By realizing the interaction of different information , extracting rich feature information , and obtaining satisfactory experimental results ( Baltrusaitis et al. , 2019 ) . It can be seen that the multimodal fusion method in the CV field seems to be more conducive to feature exchange and feature supplementation than the current method in the financial field ( Lu et al. , 2018 ; Kim et al. , 2017 ) . Therefore , we can infer that choosing an adaptive financial data fusion algorithm to achieve the integration of social media information and actual market prices is effective for improving the forecasting effect of the financial market . However , the current financial market forecasting field basically does not consider too many modal fusion methods , which may be one of the reasons that limit the current forecasting effect . In addition , the role of text and historical prices in the fusion method is different from multimodal fusion tasks , such as face recognition , medical aided diagnosis , and visual analysis . The fundamental reason is that the application scenarios are inconsistent , the source data for other tasks is objective , and the financial data is affected by the sentiment of market investors . Taking into account the difference between tweets and prices , we should pay attention to the effects of both when choosing a fusion method , and use the quantitative analysis of experimental results . To effectively solve the above problems , we propose a collaborative attention ( co-attention ) Transformer approach adaptive to financial market forecasting called CAFF , partially inspired by the recent proposed multimodal fusion in bidirectional encoder representation from Transformers ( BERT ) , which was originally developed to utilize Transformer to realize the feature interaction between text and image data ( Lu et al. , 2019 ) . To verify the rationality of the CAFF method , we included the existing traditional multimodal fusion methods in the experiments for comparison . In summary , the contributions of our work are as follows : • To the best of our knowledge , this work is among the first to introduce a co-attention Transformer fusion approach adaptive to financial market forecasting , which is inspired by the multimodal fusion method and takes into account the characteristics of financial data . • We propose a novel financial market forecasting framework based on the idea of deep fusion to model multisource data analysis . The components of the framework work together to extract tweets and price features in parallel , fuse the features and realize accurate prediction . • Experimental results on stock market forecasting tasks demonstrate that our proposed method achieves a substantial gain over state-of-the-art methods . Moreover , the results also reveal that under the CAFF fusion framework , the quantitative analysis results show that social media information has played a relatively more critical role . 2 RELATED WORK . Some researchers have adopted the method of fusing real market prices and textual information reflecting investor sentiment from social media . In this section , we review the work related to financial market forecasting that fuse prices and text . A variety of analysis approaches based on text and prices to market forecasting have been proposed in the research literature . For example , Xu & Cohen ( 2018 ) proposed a new depth generation model for the stock market forecasting task , which combines text and price signals as the source information . Similarly , Li et al . ( 2020 ) also used the concatenation method to integrate the sentiment information contained in the news data and stock prices to predict the Hong Kong stock market . In addition , Xu et al . ( 2020 ) proposed a stock movement prediction network based on tweet and stock prices by means of incorporative attention mechanism that combines local and context attention mechanisms through incorporative attention to clean up context embedding using local semantics . The approach also makes use of concatenation . It can be seen that the common fusion methods in the field of financial market prediction are still surface feature fusion without parameter interaction . At present , the mainstream fusion technology in the field of CV has attracted our attention , such as bilinear pooling , attention-based fusion , in which bilinear pooling creates a joint representation space by calculating the outer product to facilitate the multiplicative interaction between all elements in the two vectors , which is obviously not suitable for describing text and representing the value of price changes . Lu et al . ( 2019 ) proposed the visual language BERT ( ViLBERT ) model , which extends the Transformer to the fusion operation of processing images and texts . These extracted features can interact through a parallel attention layer , which provides a creative way for feature optimization , but we have to consider the differences between financial data and CV , speech task and other fields . Therefore , developing a method suitable for financial data with the help of the existing fusion methods is a problem worthy of discussion . In summary , using an improved deep learning framework based on a fusion algorithm to analyze financial data to achieve financial market forecasting appears to be effective , which can be confirmed via quantitative analysis . On the basis of the above advanced theoretical analysis , our research motivations are as follows . First , we believe that a framework that processes text and prices in parallel and fully fuses them would perform better than a single data source , where the fusion algorithm plays a key role . However , referring to the existing fusion methods in the CV field , the most natural and effective way to process prices may be to consider the original form as 1-D data rather than as a 2-D matrix image Gupta et al . ( 2020 ) . Moreover , the role of text used to describe the movement of financial market is inconsistent with prices , which are different from the text and image in the crossmodal task of CV fields . The above problems require an applicable prediction framework based on the fusion method to realize the feature extraction and fusion of tweets and prices with temporality , as well as a matching activation function . Hence , we propose a new framework called CAFF , which uses the Transformer model adapted to financial data and a variety of attention mechanisms to collaboratively predict the movement on the target trading day . 3 MODEL OVERVIEW . We propose CAFF , which conforms to the characteristics of financial data , and the complete framework is shown in Figure 1 . The upper of the model deeply extracts text features to learn the text representation of tweets , and the lowers extracts market price features in parallel . The operation with Transformer as the main structure in the middle is used to fuse tweets and price information , and the right side is used to process the merged features and realize the prediction of market trends on the target trading day . 3.1 THE PROPOSED MODEL : CAFF . Considering that there is a certain lag in the target trading day d , we are allowed to simulate and predict other trading days close to d in principle . We can not only predict the trend of the target trading day itself , but also the trend of other trading days during the lag period . For example , if we choose 08/06/2021 as the target trading day , then 03/07/2021 and 07/06/2021 represent the endpoints of the lag period ( the lag period is usually 5 days ) ; thus , we capture the relationships between the predictions mainly within this sample range . However , considering the actual conditions of the financial market , we neglected nontrading days in the calculation process to achieve the effect of effectively organizing and utilizing input data . In general , we can predict a series of movements z = [ z1 , z2 , . . . , zT ] , where the target trading day is zT and the rest are auxiliaries . 3.1.1 INPUT REPRESENTATION . Next , we introduce the processing of text and stock prices to obtain the input representation . Text data is regarded as a feature extraction task in NLP domain . Considering the inherent correlation and volatility , we adopt a relatively direct method to deal with stock prices to maintain the original structure . Tweet-level Model : Generally , tweets posted on social platforms for a given stock often contain multiple inconsistent items on a given trading day . To learn more profitable and valuable information from a large number of investor tweets , we adopt the Bi-LSTM and self-attention to obtain the representation as the input of the fusion component . For each sentence ti , we adopt the pretrained word embedding ( GloVe ) to project each word tag onto the d− dimensional space and the pretrained word embedding as the input of Bi-LSTM . ft = σ ( Wf · [ ht−1 , xt ] + bf ) ( 1 ) it = σ ( Wi · [ ht−1 , xt ] + bi ) ( 2 ) C̃t = tanh ( WC · [ ht−1 , xt ] + bC ) ( 3 ) Ct = ft ∗ Ct−1 + it ∗ C̃t ( 4 ) Ot = σ ( WO · [ ht−1 , xt ] + bO ) ( 5 ) ht = Ot ∗ tanh ( Ct ) ( 6 ) h = [ −→ ht , ←− ht ] ( 7 ) In accordance with the nature of time series data , we use an RNN with Bi-LSTM units and a selfattention mechanism to recursively extract features . The design characteristics of LSTM allow it to model text data ( e.g. , tweet data , news data ) to extract text features and capture the context relationship . Bi-LSTM adds a process of forward and backward concatenation of hidden vectors on the basis of the realization of LSTM . Formulas ( 1–7 ) describe the details of Bi-LSTM . The essence of the attention function can be described as a query ( q ) to a series of key-value ( k-v ) mappings . In current research , the k and v are often the same , that is , key = value . Formulas ( 8– 10 ) describe the details of the attention operations . The only difference between the self-attention mechanism and the abovementioned conventional attention mechanism is that q = k. Self-attention mechanisms have become a hot topic in recent research and have been explored in different tasks . The main reason we choose the self-attention mechanism after Bi-LSTM is that the self-attention is calculated for each word and all words , so regardless of the distance between them , long-distance dependency relationships can be captured to achieve the contextual interaction of tweets to obtain key text features . αi = softmax ( F ( keyi , q ) ) ( 8 ) att ( ( K , V ) , q ) = σNi=1αiXi ( 9 ) attention ( ( K , V ) , Q ) = att ( ( K , V ) , q1 ) ⊕ · · ·⊕ att ( ( K , V ) , qM ) ( 10 ) Price-level Model : Stock prices more intuitively reflect the real market conditions , while tweets contain objective investor attitudes , which allows the two to complement each other . However , the movement of stock has random volatility and is determined by continuous changes in prices rather than the absolute values of the opening and closing prices . Thus , the original stock price vector of trading day d is not fed directly into the neural network ; we employ a normalization strategy to obtain an adjusted closing price . The price adjustment formula is shown below : pd = [ p c d , p h d , p l d ] ( 11 ) pa = pd pcd−1 − 1 ( 12 ) where pcd , p h d and p l d denote the closing price , highest price and lowest price vectors , respectively . | This paper proposed a novel approach to jointly model text and stock price information and fuse them for stock market forecasting. It encodes text and stock price information in parallel and then fuses them using a co-attention transformer. Empirical results over a real-world dataset and trading simulations demonstrate that the proposed approach can outperform the existing baselines. | SP:814c416499bba8dfbf99ef716c350bb9256c2dbd |
A Collaborative Attention Adaptive Network for Financial Market Forecasting | 1 INTRODUCTION . In recent years , the use of social media information to predict the financial market has attracted the attention of more and more researchers , and some satisfactory experimental results have been achieved . This is due to the fact that social media information contains investor-related attitudes and subjective sentiments to the financial market , resulting in many investment banks and hedge funds trying to dig out valuable information from media information to help better predict financial markets , which play a key role in predicting the market . At the same time , the efficient market hypothesis ( EMH ) introduced by Fama ( 1970 ) points out that the current price of the asset reflects all the prior information that is immediately available . Therefore , using social media information and the actual price of the current financial market seems to be able to complete the market forecasting more accurately . To the best of our knowledge , the different types of data fusion methods commonly used in the field of financial market forecasting are mainly concatenation or weighted sums . They are simple , direct , and almost no parameter exchange methods to achieve data fusion ( Xu & Cohen , 2018 ; Perez-Rua et al. , 2019 ; Xu et al. , 2019 ) . In the field of computer vision ( CV ) , multimodal fusion methods are mainly used for the fusion of data based on text and images . By realizing the interaction of different information , extracting rich feature information , and obtaining satisfactory experimental results ( Baltrusaitis et al. , 2019 ) . It can be seen that the multimodal fusion method in the CV field seems to be more conducive to feature exchange and feature supplementation than the current method in the financial field ( Lu et al. , 2018 ; Kim et al. , 2017 ) . Therefore , we can infer that choosing an adaptive financial data fusion algorithm to achieve the integration of social media information and actual market prices is effective for improving the forecasting effect of the financial market . However , the current financial market forecasting field basically does not consider too many modal fusion methods , which may be one of the reasons that limit the current forecasting effect . In addition , the role of text and historical prices in the fusion method is different from multimodal fusion tasks , such as face recognition , medical aided diagnosis , and visual analysis . The fundamental reason is that the application scenarios are inconsistent , the source data for other tasks is objective , and the financial data is affected by the sentiment of market investors . Taking into account the difference between tweets and prices , we should pay attention to the effects of both when choosing a fusion method , and use the quantitative analysis of experimental results . To effectively solve the above problems , we propose a collaborative attention ( co-attention ) Transformer approach adaptive to financial market forecasting called CAFF , partially inspired by the recent proposed multimodal fusion in bidirectional encoder representation from Transformers ( BERT ) , which was originally developed to utilize Transformer to realize the feature interaction between text and image data ( Lu et al. , 2019 ) . To verify the rationality of the CAFF method , we included the existing traditional multimodal fusion methods in the experiments for comparison . In summary , the contributions of our work are as follows : • To the best of our knowledge , this work is among the first to introduce a co-attention Transformer fusion approach adaptive to financial market forecasting , which is inspired by the multimodal fusion method and takes into account the characteristics of financial data . • We propose a novel financial market forecasting framework based on the idea of deep fusion to model multisource data analysis . The components of the framework work together to extract tweets and price features in parallel , fuse the features and realize accurate prediction . • Experimental results on stock market forecasting tasks demonstrate that our proposed method achieves a substantial gain over state-of-the-art methods . Moreover , the results also reveal that under the CAFF fusion framework , the quantitative analysis results show that social media information has played a relatively more critical role . 2 RELATED WORK . Some researchers have adopted the method of fusing real market prices and textual information reflecting investor sentiment from social media . In this section , we review the work related to financial market forecasting that fuse prices and text . A variety of analysis approaches based on text and prices to market forecasting have been proposed in the research literature . For example , Xu & Cohen ( 2018 ) proposed a new depth generation model for the stock market forecasting task , which combines text and price signals as the source information . Similarly , Li et al . ( 2020 ) also used the concatenation method to integrate the sentiment information contained in the news data and stock prices to predict the Hong Kong stock market . In addition , Xu et al . ( 2020 ) proposed a stock movement prediction network based on tweet and stock prices by means of incorporative attention mechanism that combines local and context attention mechanisms through incorporative attention to clean up context embedding using local semantics . The approach also makes use of concatenation . It can be seen that the common fusion methods in the field of financial market prediction are still surface feature fusion without parameter interaction . At present , the mainstream fusion technology in the field of CV has attracted our attention , such as bilinear pooling , attention-based fusion , in which bilinear pooling creates a joint representation space by calculating the outer product to facilitate the multiplicative interaction between all elements in the two vectors , which is obviously not suitable for describing text and representing the value of price changes . Lu et al . ( 2019 ) proposed the visual language BERT ( ViLBERT ) model , which extends the Transformer to the fusion operation of processing images and texts . These extracted features can interact through a parallel attention layer , which provides a creative way for feature optimization , but we have to consider the differences between financial data and CV , speech task and other fields . Therefore , developing a method suitable for financial data with the help of the existing fusion methods is a problem worthy of discussion . In summary , using an improved deep learning framework based on a fusion algorithm to analyze financial data to achieve financial market forecasting appears to be effective , which can be confirmed via quantitative analysis . On the basis of the above advanced theoretical analysis , our research motivations are as follows . First , we believe that a framework that processes text and prices in parallel and fully fuses them would perform better than a single data source , where the fusion algorithm plays a key role . However , referring to the existing fusion methods in the CV field , the most natural and effective way to process prices may be to consider the original form as 1-D data rather than as a 2-D matrix image Gupta et al . ( 2020 ) . Moreover , the role of text used to describe the movement of financial market is inconsistent with prices , which are different from the text and image in the crossmodal task of CV fields . The above problems require an applicable prediction framework based on the fusion method to realize the feature extraction and fusion of tweets and prices with temporality , as well as a matching activation function . Hence , we propose a new framework called CAFF , which uses the Transformer model adapted to financial data and a variety of attention mechanisms to collaboratively predict the movement on the target trading day . 3 MODEL OVERVIEW . We propose CAFF , which conforms to the characteristics of financial data , and the complete framework is shown in Figure 1 . The upper of the model deeply extracts text features to learn the text representation of tweets , and the lowers extracts market price features in parallel . The operation with Transformer as the main structure in the middle is used to fuse tweets and price information , and the right side is used to process the merged features and realize the prediction of market trends on the target trading day . 3.1 THE PROPOSED MODEL : CAFF . Considering that there is a certain lag in the target trading day d , we are allowed to simulate and predict other trading days close to d in principle . We can not only predict the trend of the target trading day itself , but also the trend of other trading days during the lag period . For example , if we choose 08/06/2021 as the target trading day , then 03/07/2021 and 07/06/2021 represent the endpoints of the lag period ( the lag period is usually 5 days ) ; thus , we capture the relationships between the predictions mainly within this sample range . However , considering the actual conditions of the financial market , we neglected nontrading days in the calculation process to achieve the effect of effectively organizing and utilizing input data . In general , we can predict a series of movements z = [ z1 , z2 , . . . , zT ] , where the target trading day is zT and the rest are auxiliaries . 3.1.1 INPUT REPRESENTATION . Next , we introduce the processing of text and stock prices to obtain the input representation . Text data is regarded as a feature extraction task in NLP domain . Considering the inherent correlation and volatility , we adopt a relatively direct method to deal with stock prices to maintain the original structure . Tweet-level Model : Generally , tweets posted on social platforms for a given stock often contain multiple inconsistent items on a given trading day . To learn more profitable and valuable information from a large number of investor tweets , we adopt the Bi-LSTM and self-attention to obtain the representation as the input of the fusion component . For each sentence ti , we adopt the pretrained word embedding ( GloVe ) to project each word tag onto the d− dimensional space and the pretrained word embedding as the input of Bi-LSTM . ft = σ ( Wf · [ ht−1 , xt ] + bf ) ( 1 ) it = σ ( Wi · [ ht−1 , xt ] + bi ) ( 2 ) C̃t = tanh ( WC · [ ht−1 , xt ] + bC ) ( 3 ) Ct = ft ∗ Ct−1 + it ∗ C̃t ( 4 ) Ot = σ ( WO · [ ht−1 , xt ] + bO ) ( 5 ) ht = Ot ∗ tanh ( Ct ) ( 6 ) h = [ −→ ht , ←− ht ] ( 7 ) In accordance with the nature of time series data , we use an RNN with Bi-LSTM units and a selfattention mechanism to recursively extract features . The design characteristics of LSTM allow it to model text data ( e.g. , tweet data , news data ) to extract text features and capture the context relationship . Bi-LSTM adds a process of forward and backward concatenation of hidden vectors on the basis of the realization of LSTM . Formulas ( 1–7 ) describe the details of Bi-LSTM . The essence of the attention function can be described as a query ( q ) to a series of key-value ( k-v ) mappings . In current research , the k and v are often the same , that is , key = value . Formulas ( 8– 10 ) describe the details of the attention operations . The only difference between the self-attention mechanism and the abovementioned conventional attention mechanism is that q = k. Self-attention mechanisms have become a hot topic in recent research and have been explored in different tasks . The main reason we choose the self-attention mechanism after Bi-LSTM is that the self-attention is calculated for each word and all words , so regardless of the distance between them , long-distance dependency relationships can be captured to achieve the contextual interaction of tweets to obtain key text features . αi = softmax ( F ( keyi , q ) ) ( 8 ) att ( ( K , V ) , q ) = σNi=1αiXi ( 9 ) attention ( ( K , V ) , Q ) = att ( ( K , V ) , q1 ) ⊕ · · ·⊕ att ( ( K , V ) , qM ) ( 10 ) Price-level Model : Stock prices more intuitively reflect the real market conditions , while tweets contain objective investor attitudes , which allows the two to complement each other . However , the movement of stock has random volatility and is determined by continuous changes in prices rather than the absolute values of the opening and closing prices . Thus , the original stock price vector of trading day d is not fed directly into the neural network ; we employ a normalization strategy to obtain an adjusted closing price . The price adjustment formula is shown below : pd = [ p c d , p h d , p l d ] ( 11 ) pa = pd pcd−1 − 1 ( 12 ) where pcd , p h d and p l d denote the closing price , highest price and lowest price vectors , respectively . | This paper proposes a method to fuse tweets and stock prices for stock trend prediction flexibly. The authors claim that the proposed method outperforms other existing fusing methods. Furthermore, according to the results of the market trading simulation, this method achieves higher profits than other methods. | SP:814c416499bba8dfbf99ef716c350bb9256c2dbd |
Rewardless Open-Ended Learning (ROEL) | 1 INTRODUCTION . Development of machine learning over the past several decades has principally relied upon researchers solving a series of challenges proposed by experts within the community ( e.g . MNIST Lecun et al . ( 1998 ) , ATARI Bellemare et al . ( 2013 ) and robotics Yu et al . ( 2021 ) ) . Learning algorithms typically solve these challenges through a huge number of observations , and whilst they have exceeded human-level performance on a variety of these tasks ( Silver et al. , 2017 ) , ( Berner et al. , 2019 ) , they often require significantly more examples before coming close to matching human performance ( Toromanoff et al. , 2019 ) . Humans in contrast leverage many diverse experiences to solve complex tasks ( Wang et al. , 2018 ) often without a well defined objective or reward . Should we attempt to teach reinforcement learning ( RL ) agents in a similar fashion ? We use this question to motivate the design a procedure that aims to learn a diverse set of increasingly complex novel behaviors without supervision ( labels ) or incentives ( external rewards ) . Open-ended algorithms aim to automatically generate challenges to be solved ( Forestier et al. , 2020 ) , ( Schmidhuber , 2012 ) , ( Standish , 2002 ) , ( Secretan et al. , 2011 ) that can serve as stepping stones to increasingly complex problems . These algorithms are useful in designing a general unsupervised learning procedure because they do not rely upon manually selected challenges ; instead they search for challenges that form stepping stones to solve larger ones , collecting a diverse set of experiences along the way . Designing algorithms to achieve these open-endedness can be challenging . Often requiring a careful balance between diversity , optimization ( Mouret & Clune , 2015 ) , ( Pugh et al. , 2016 ) , and a domain complex enough for sufficient experiences/challenges to be generated in order to learn a suitable curricula . The Paired Open-Ended Trailblazer ( POET ) algorithm ( Wang et al. , 2019 ) , ( Wang et al. , 2020 ) is a recent example of an attempt to solve these challenges in the context of supervised RL . POET uses the Minimal Criterion Coevolution ( MCC ) algorithm ( Brant & Stanley , 2017 ) to co-evolve increasingly complex environments and agents and then directly optimizes an RL objective either with evolution strategies ( ES ) ( Salimans et al. , 2017 ) or proximal policy optimization ( PPO ) ( Schulman et al. , 2017 ) . Within POET both the MCC for suitable learning outcomes and agent optimization rely upon the extrinsic reward within the environment . This approach works well for the reward-dense bipedal walker control problem ( Brockman et al. , 2016 ) but can often become challenging , even in conceivably simple RL problems , to generate desired outcomes ( Vecerik et al. , 2018 ) . This problem becomes more challenging when the reward is sparse , especially with a long-horizon , where the agent effectively has no reward until termination . Reward-shaping can be used ( Ng et al. , 1999 ) to help improve the density of reward and aide exploration . However , reward-shaping does not encourage open-ended learning , because it rewards the agent for following a hand-designed objective driven path , which limits open-endedness and often leads to poor performance ( Lehman & Stanley , 2011b ) . An alternate approach is found in the field of unsupervised RL where we don ’ t use an extrinsic reward function at all . Instead the objective is to learn a group of behaviors and hope to observe the agent solving task through one of our explorations , an approach that shares some characteristics with the problem of novelty search ( NS ) in open-ended learning ( Lehman & Stanley , 2011a ) . The acquisition of a diverse set of useful skills without extrinsic reward is in itself no-easy task . We consider a skill as a latent-variable conditioned policy that alters the state of the environment consistently ( Gregor et al. , 2016 ) , ( Eysenbach et al. , 2018 ) . The utility of a skill is typically based on its diversity to another , for example whilst one skill might be standing still , walking , dancing and running are all vastly different and a good algorithm will aim to learn the entire set of skills . Skills are then often selected for a task specific problem either by imitation learning or by directly selecting an encoding on the latent-variable conditioned policy . The learned behaviors can also be used as a pre-conditioned policy for regular RL with rewards similar to pre-training on ImageNet ( Deng et al. , 2009 ) In this paper we propose Rewardless Open-Ended Learning ( ROEL ) an unsupervised deep RL algorithm based upon the POET framework . The key-idea of this work is to use constant environment mutation to generate a diverse set of skills capable of solving increasingly complex and novel problems . We hypothesize this combination of open-ended learning with unsupervised RL will generate sets of behaviors that are more diverse and general than unsupervised RL agents simply trained on a static environment . Behaviors can then be selected for a specific task by directly selecting from a latent encoding , or by comparing the state-space transition to a demonstration . Then , if a skill can only be demoed on a single environment , our environment generalist approach ensures this type of behavior will generalize across many environments . Our paper makes the following contributions : • We present a new algorithm , ROEL , that combines unsupervised RL with open-ended learning to generate diverse and general behaviors ( Section 3 ) . An approach that has not been attempted before with agent-environment co-evolution ( Section 2 ) . • We train an unsupervised learning algorithm on the bipedal-walker environment . An environment with a difficult task objective and a non-stationary environment transition . • We prove empirically , that our approach is capable of learning more general and diverse groups of policies than single environments , especially when deployed to environments with dynamics that differ from the training set ( Section 5 ) . 2 RELATED WORK . Central to recent open-ended learning solutions is quality diversity ( QD ) , based on NS , ( Lehman & Stanley , 2011a ) , ( Lehman & Stanley , 2011b ) QD algorithms aim to return a diverse set of highquality solutions by carefully balancing diversity and optimization ( Pugh et al. , 2016 ) , ( Mouret & Clune , 2015 ) . In traditionally hard RL exploration problems Ecoffet et al . ( 2021 ) produced significant performance improvements by maintaining an archive of stepping stones from state to state . QD itself however does not necessarily provide open-ended learning , most approaches for openended learning rely upon constantly generating new challenges for the agent to overcome . This can be through co-evolution ( de Jong & Pollack , 2004 ) , with an adversarial agent ( Florensa et al. , 2018a ) or simply the agent itself ( Team et al. , 2021 ) . In a similar vein research into self-generated curricula aims to automatically generate a sequence of objectives that efficiently allow the agent to learn complex behaviors . These approaches include : reverse goal-oriented curriculum generation ( Florensa et al. , 2018b ) , teacher-student curriculum learning ( Matiisen et al. , 2017 ) , and procedural content generation ( Justesen et al. , 2018 ) , ( Hafner , 2021 ) . Another approach , world-agent based co-evolution , aims to constantly evolve the environment with the agent to generate pressure for agents to gather new skills . To facilitate open-ended learning we make use of a similar framework to POET ( Wang et al. , 2019 ) ( Wang et al. , 2020 ) where environment-agent pairs are evolved based on their QD using insights from the minimal criterion coevolution algorithm ( MCC ) ( Brant & Stanley , 2017 ) . The MCC performance ranking of agents in POET is based upon the agents total average episodic return from the extrinsic reward . Our approach extends this problem to the unsupervised domain , allowing for the discovery of diverse and useful sets of behaviors . PAIRED ( Dennis et al. , 2021 ) co-evolves 2 agents , a protagonist and antagonist where the protagonist aims to solve tasks generated by the antagonist . Regret is then defined as the average score of the protagonist and the best score of the antagonist over multiple trials . A separate adversary agent is then also trained , with the objective to minimax regret between the 2 agents by automatic environment generation . In contrast POET effectively maintains a population of minimax agents . We found the POET framework to be a suitable procedure to design a rewardless open ended learning algorithm . The results in PAIRED are inconclusive as to whether POETs population QD approach outperforms PAIREDs adversarial approach , we leave this investigation to future work . Our methodology aims to extend open-ended learning to the unsupervised RL setting , in an effort to generate increasingly sophisticated predictable and diverse behaviors . Significant previous work in fixed environment unsupervised RL has focused on intrinsic motivation ( Oudeyer , 2007 ) , ( Oudeyer et al. , 2007 ) , ( Chentanez et al. , 2005 ) , with examples including : empowerment ( Klyubin et al. , 2005 ) , ( Mohamed & Rezende , 2015a ) , state count based exploration ( Bellemare et al. , 2016 ) , curiosity driven exploration ( Pathak et al. , 2017 ) , surprise maximization ( Achiam & Sastry , 2017 ) and minimization ( Berseth et al. , 2021 ) . Compared to intrinsic motivation skill discovery aims to explore a group of skills that can then be exploited by imitation learning ( Schaal , 1997 ) , inverse reinforcement learning ( Russell , 1998 ) , or fine-tuning . Skill discovery has generally made use of relations between RL and information theory ( Ziebart et al. , 2008 ) , ( Florensa et al. , 2017 ) , ( Daniel et al. , 2012 ) , ( Eysenbach et al. , 2018 ) , ( Wang et al. , 2018 ) , ( Sharma et al. , 2020 ) . DIAYN ( Eysenbach et al. , 2018 ) explicitly aimed to exploit HRL by designing a reward function to maximize stateentropy , so that skills are differentiated by visiting different state-space regions . DADS ( Sharma et al. , 2020 ) subsequently aimed to discover skills that are both diverse and predictable . Our work then develops the methodology in DADS to train agents over a range of increasingly complex environments , creating unending environmental pressure for agents to evolve ever more complex and diverse skills . Gupta et al . ( 2020 ) provides another interesting approach to the problem of generalized unsupervised reinforcement learning by combining meta-learning ( Finn et al. , 2017 ) with DIAYN ( Eysenbach et al. , 2018 ) to automatically generate meta-training tasks . This is a useful approach for the fixed environment setting , but does not address the challenge of open-ended learning , only meta-training on a static state-transition distribution . 3 REWARDLESS OPEN-ENDED LEARNING ( ROEL ) . Building on previous work in unsupervised RL and mutual-information based exploration ( Eysenbach et al. , 2018 ) , ( Sharma et al. , 2020 ) , ROEL uses the POET framework ( Wang et al. , 2019 ) to endlessly generate agents capable of exhibiting increasingly complex , diverse and predictable behaviors . The policies learnt by ROEL can then be exploited to maximize a task specific objective using some form of supervision . Importantly our algorithms use of non-stationary environmental representations allows for the discovery of new emergent behaviors based on previous simpler behaviors . | In this work, the authors a method that lies in the intersection of two subfields of RL, namely open-endedness and unsupervised skill discovery. Specifically, they introduce a method called Rewardless Open-Ended Learning (ROEL) which extends a recent method called POET to perform skill discovery in a reward-free setting rather than traditional supervised RL. To this end, they use mutual-information-based skill discovery techniques which have recently become a popular approach for unsupervised RL. The authors empirically demonstrate that ROELD is able to learn identifiable skills in bipedal walker environment. | SP:33f86309e63b0605e3d2b83e839971523e236f5f |
Rewardless Open-Ended Learning (ROEL) | 1 INTRODUCTION . Development of machine learning over the past several decades has principally relied upon researchers solving a series of challenges proposed by experts within the community ( e.g . MNIST Lecun et al . ( 1998 ) , ATARI Bellemare et al . ( 2013 ) and robotics Yu et al . ( 2021 ) ) . Learning algorithms typically solve these challenges through a huge number of observations , and whilst they have exceeded human-level performance on a variety of these tasks ( Silver et al. , 2017 ) , ( Berner et al. , 2019 ) , they often require significantly more examples before coming close to matching human performance ( Toromanoff et al. , 2019 ) . Humans in contrast leverage many diverse experiences to solve complex tasks ( Wang et al. , 2018 ) often without a well defined objective or reward . Should we attempt to teach reinforcement learning ( RL ) agents in a similar fashion ? We use this question to motivate the design a procedure that aims to learn a diverse set of increasingly complex novel behaviors without supervision ( labels ) or incentives ( external rewards ) . Open-ended algorithms aim to automatically generate challenges to be solved ( Forestier et al. , 2020 ) , ( Schmidhuber , 2012 ) , ( Standish , 2002 ) , ( Secretan et al. , 2011 ) that can serve as stepping stones to increasingly complex problems . These algorithms are useful in designing a general unsupervised learning procedure because they do not rely upon manually selected challenges ; instead they search for challenges that form stepping stones to solve larger ones , collecting a diverse set of experiences along the way . Designing algorithms to achieve these open-endedness can be challenging . Often requiring a careful balance between diversity , optimization ( Mouret & Clune , 2015 ) , ( Pugh et al. , 2016 ) , and a domain complex enough for sufficient experiences/challenges to be generated in order to learn a suitable curricula . The Paired Open-Ended Trailblazer ( POET ) algorithm ( Wang et al. , 2019 ) , ( Wang et al. , 2020 ) is a recent example of an attempt to solve these challenges in the context of supervised RL . POET uses the Minimal Criterion Coevolution ( MCC ) algorithm ( Brant & Stanley , 2017 ) to co-evolve increasingly complex environments and agents and then directly optimizes an RL objective either with evolution strategies ( ES ) ( Salimans et al. , 2017 ) or proximal policy optimization ( PPO ) ( Schulman et al. , 2017 ) . Within POET both the MCC for suitable learning outcomes and agent optimization rely upon the extrinsic reward within the environment . This approach works well for the reward-dense bipedal walker control problem ( Brockman et al. , 2016 ) but can often become challenging , even in conceivably simple RL problems , to generate desired outcomes ( Vecerik et al. , 2018 ) . This problem becomes more challenging when the reward is sparse , especially with a long-horizon , where the agent effectively has no reward until termination . Reward-shaping can be used ( Ng et al. , 1999 ) to help improve the density of reward and aide exploration . However , reward-shaping does not encourage open-ended learning , because it rewards the agent for following a hand-designed objective driven path , which limits open-endedness and often leads to poor performance ( Lehman & Stanley , 2011b ) . An alternate approach is found in the field of unsupervised RL where we don ’ t use an extrinsic reward function at all . Instead the objective is to learn a group of behaviors and hope to observe the agent solving task through one of our explorations , an approach that shares some characteristics with the problem of novelty search ( NS ) in open-ended learning ( Lehman & Stanley , 2011a ) . The acquisition of a diverse set of useful skills without extrinsic reward is in itself no-easy task . We consider a skill as a latent-variable conditioned policy that alters the state of the environment consistently ( Gregor et al. , 2016 ) , ( Eysenbach et al. , 2018 ) . The utility of a skill is typically based on its diversity to another , for example whilst one skill might be standing still , walking , dancing and running are all vastly different and a good algorithm will aim to learn the entire set of skills . Skills are then often selected for a task specific problem either by imitation learning or by directly selecting an encoding on the latent-variable conditioned policy . The learned behaviors can also be used as a pre-conditioned policy for regular RL with rewards similar to pre-training on ImageNet ( Deng et al. , 2009 ) In this paper we propose Rewardless Open-Ended Learning ( ROEL ) an unsupervised deep RL algorithm based upon the POET framework . The key-idea of this work is to use constant environment mutation to generate a diverse set of skills capable of solving increasingly complex and novel problems . We hypothesize this combination of open-ended learning with unsupervised RL will generate sets of behaviors that are more diverse and general than unsupervised RL agents simply trained on a static environment . Behaviors can then be selected for a specific task by directly selecting from a latent encoding , or by comparing the state-space transition to a demonstration . Then , if a skill can only be demoed on a single environment , our environment generalist approach ensures this type of behavior will generalize across many environments . Our paper makes the following contributions : • We present a new algorithm , ROEL , that combines unsupervised RL with open-ended learning to generate diverse and general behaviors ( Section 3 ) . An approach that has not been attempted before with agent-environment co-evolution ( Section 2 ) . • We train an unsupervised learning algorithm on the bipedal-walker environment . An environment with a difficult task objective and a non-stationary environment transition . • We prove empirically , that our approach is capable of learning more general and diverse groups of policies than single environments , especially when deployed to environments with dynamics that differ from the training set ( Section 5 ) . 2 RELATED WORK . Central to recent open-ended learning solutions is quality diversity ( QD ) , based on NS , ( Lehman & Stanley , 2011a ) , ( Lehman & Stanley , 2011b ) QD algorithms aim to return a diverse set of highquality solutions by carefully balancing diversity and optimization ( Pugh et al. , 2016 ) , ( Mouret & Clune , 2015 ) . In traditionally hard RL exploration problems Ecoffet et al . ( 2021 ) produced significant performance improvements by maintaining an archive of stepping stones from state to state . QD itself however does not necessarily provide open-ended learning , most approaches for openended learning rely upon constantly generating new challenges for the agent to overcome . This can be through co-evolution ( de Jong & Pollack , 2004 ) , with an adversarial agent ( Florensa et al. , 2018a ) or simply the agent itself ( Team et al. , 2021 ) . In a similar vein research into self-generated curricula aims to automatically generate a sequence of objectives that efficiently allow the agent to learn complex behaviors . These approaches include : reverse goal-oriented curriculum generation ( Florensa et al. , 2018b ) , teacher-student curriculum learning ( Matiisen et al. , 2017 ) , and procedural content generation ( Justesen et al. , 2018 ) , ( Hafner , 2021 ) . Another approach , world-agent based co-evolution , aims to constantly evolve the environment with the agent to generate pressure for agents to gather new skills . To facilitate open-ended learning we make use of a similar framework to POET ( Wang et al. , 2019 ) ( Wang et al. , 2020 ) where environment-agent pairs are evolved based on their QD using insights from the minimal criterion coevolution algorithm ( MCC ) ( Brant & Stanley , 2017 ) . The MCC performance ranking of agents in POET is based upon the agents total average episodic return from the extrinsic reward . Our approach extends this problem to the unsupervised domain , allowing for the discovery of diverse and useful sets of behaviors . PAIRED ( Dennis et al. , 2021 ) co-evolves 2 agents , a protagonist and antagonist where the protagonist aims to solve tasks generated by the antagonist . Regret is then defined as the average score of the protagonist and the best score of the antagonist over multiple trials . A separate adversary agent is then also trained , with the objective to minimax regret between the 2 agents by automatic environment generation . In contrast POET effectively maintains a population of minimax agents . We found the POET framework to be a suitable procedure to design a rewardless open ended learning algorithm . The results in PAIRED are inconclusive as to whether POETs population QD approach outperforms PAIREDs adversarial approach , we leave this investigation to future work . Our methodology aims to extend open-ended learning to the unsupervised RL setting , in an effort to generate increasingly sophisticated predictable and diverse behaviors . Significant previous work in fixed environment unsupervised RL has focused on intrinsic motivation ( Oudeyer , 2007 ) , ( Oudeyer et al. , 2007 ) , ( Chentanez et al. , 2005 ) , with examples including : empowerment ( Klyubin et al. , 2005 ) , ( Mohamed & Rezende , 2015a ) , state count based exploration ( Bellemare et al. , 2016 ) , curiosity driven exploration ( Pathak et al. , 2017 ) , surprise maximization ( Achiam & Sastry , 2017 ) and minimization ( Berseth et al. , 2021 ) . Compared to intrinsic motivation skill discovery aims to explore a group of skills that can then be exploited by imitation learning ( Schaal , 1997 ) , inverse reinforcement learning ( Russell , 1998 ) , or fine-tuning . Skill discovery has generally made use of relations between RL and information theory ( Ziebart et al. , 2008 ) , ( Florensa et al. , 2017 ) , ( Daniel et al. , 2012 ) , ( Eysenbach et al. , 2018 ) , ( Wang et al. , 2018 ) , ( Sharma et al. , 2020 ) . DIAYN ( Eysenbach et al. , 2018 ) explicitly aimed to exploit HRL by designing a reward function to maximize stateentropy , so that skills are differentiated by visiting different state-space regions . DADS ( Sharma et al. , 2020 ) subsequently aimed to discover skills that are both diverse and predictable . Our work then develops the methodology in DADS to train agents over a range of increasingly complex environments , creating unending environmental pressure for agents to evolve ever more complex and diverse skills . Gupta et al . ( 2020 ) provides another interesting approach to the problem of generalized unsupervised reinforcement learning by combining meta-learning ( Finn et al. , 2017 ) with DIAYN ( Eysenbach et al. , 2018 ) to automatically generate meta-training tasks . This is a useful approach for the fixed environment setting , but does not address the challenge of open-ended learning , only meta-training on a static state-transition distribution . 3 REWARDLESS OPEN-ENDED LEARNING ( ROEL ) . Building on previous work in unsupervised RL and mutual-information based exploration ( Eysenbach et al. , 2018 ) , ( Sharma et al. , 2020 ) , ROEL uses the POET framework ( Wang et al. , 2019 ) to endlessly generate agents capable of exhibiting increasingly complex , diverse and predictable behaviors . The policies learnt by ROEL can then be exploited to maximize a task specific objective using some form of supervision . Importantly our algorithms use of non-stationary environmental representations allows for the discovery of new emergent behaviors based on previous simpler behaviors . | Rewardless Open-Ended Learning (ROEL) is fundamentally a combination between two Paired Open-Ended Trailblazer (POET) and Dynamics-Aware Unsupervised Discovery of Skills (DADS). POET presents a framework for "open-ended learning" which automatically generating progressively more difficult environments to elicit agents with novel behaviors. DADS introduces a method of "unsupervised RL" which learns a variety of skills without rewards solely based on mutual information between state transitions and skill-determining latent variable. The result is an RL framework which generates environments to elicit controllable behaviors without a reward function from the environment. The following empirical evaluations are performed: - Qualitative assessment of skills learned by ROEL - Qualitative comparison or ROEL and DADS - Measurement of rewards of different skills learned by ROEL and DADS - Measurement of state predictability of skills in different environments by ROEL and DADS The primary contributions of the paper are: - Combining open-ended RL and unsupervised RL - ROEL yields a more robust set of policies in a bipedal-walker environment than the DADS baseline. | SP:33f86309e63b0605e3d2b83e839971523e236f5f |
Provably Robust Adversarial Examples | 1 INTRODUCTION . Deep neural networks ( DNNs ) are vulnerable to adversarial attacks : small input perturbations that cause misclassification ( Szegedy et al. , 2013 ) . This has caused an increased interest in investigating powerful attacks ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ; Andriushchenko et al. , 2019 ; Zheng et al. , 2019 ; Wang et al. , 2019 ; Croce & Hein , 2019 ; Tramèr et al. , 2020 ) . An important limitation of existing attack methods is that they only produce a single concrete adversarial example and their effect can often be mitigated with existing defenses ( Madry et al. , 2018 ; Hu et al. , 2019 ; Sen et al. , 2020 ; Xiao et al. , 2020 ; Pang et al. , 2020 ; Lécuyer et al. , 2019 ; Cohen et al. , 2019 ; Salman et al. , 2019 ; Fischer et al. , 2020 ; Li et al. , 2020 ) . The effectiveness of these attacks can be improved by robustifying them : to consolidate the individual examples to produce a large symbolic region guaranteed to only contain adversarial examples . This Work : Provably Robust Adversarial Examples We present the concept of a provably robust adversarial example – a tuple consisting of an adversarial input point and an input region around it capturing a very large set ( e.g. , > 10100 ) of points guaranteed to be adversarial . We then introduce a novel algorithm for generating such regions and apply it to the setting of pixel intensity changes and geometric transformations . Our work relates to prior approaches on generating robust adversarial examples ( Athalye et al. , 2018 ; Qin et al. , 2019 ) but differs in a crucial point : our regions are guaranteed to be adversarial while prior approaches are empirical and offer no such guarantees . Main Contributions Our key contributions are : • The concept of a provably robust adversarial example – a connected input region capturing a very large set of points , generated by a set of perturbations , guaranteed to be adversarial . • A novel scalable method for synthesizing provably robust adversarial examples , based on iterative refinement and certification techniques . • A thorough evaluation of our method demonstrating it can generate provable regions containing ≈ 10573 concrete adversarial points for pixel intensity changes , in ≈ 2 minutes , and ≈ 10599 concrete points for geometric transformations , in ≈ 20 minutes , on a challenging CIFAR10 network . We also demonstrate that our robust adversarial examples are significantly more effective against state-of-the-art defenses based on randomized smoothing than the individual attacks used to construct the regions . 2 BACKGROUND . We now discuss the background necessary for the remainder of the paper . We consider a neural network f : Rn0 → Rnl with l layers , n0 input neurons and nl output classes . The network classifies an input x to class y ( x ) with the largest corresponding output value , i.e. , y ( x ) = argmaxi [ f ( x ) ] i . Note for brevity we will omit the argument to y when it is clear from the context . 2.1 NEURAL NETWORK CERTIFICATION . In this work , we rely on state-of-the-art neural network certification methods based on convex relaxations to prove that the adversarial examples produced by our algorithm are robust . These certification methods take a convex input region I ⊂ Rn0 and prove that every point in I is classified as target label yt by f . They propagate the set I through the layers of the network , producing a convex region that covers all possible values of output neurons ( Gehr et al. , 2018 ) . Robustness follows by proving that , for all combinations of output neuron values in this region , the output neuron corresponding to class yt has a larger value than the one corresponding to any other class y 6= yt . Commonly , one proves this property by computing a function Ly : Rn0 → R for each label y 6= yt , such that , for all x ∈ I , we have Ly ( x ) ≤ [ f ( x ) ] yt − [ f ( x ) ] y . For each Ly , one computes minx∈I Ly ( x ) to obtain a global lower bound that is true for all x ∈ I . If we obtain positive bounds for all y 6= yt , robustness is proven . To simplify notation , we will say that the certification objective L ( x ) is the function Ly ( x ) with the smallest minimum value on I . We will call its corresponding minimum value the certification error . We requireLy ( x ) to be a linear function of x . This requirement is consistent with many popular certification algorithms based on convex relaxation , such as CROWN ( Zhang et al. , 2018 ) , DeepZ ( Singh et al. , 2018a ) , and DeepPoly ( Singh et al. , 2019 ) . Without loss of generality , for the rest of this paper , we will treat DeepPoly as our preferred certification method . 2.2 GEOMETRIC CERTIFICATION . DeepPoly operates over specifications based on linear constraints over input pixels for verification . These constraints are straightforward to provide for simple pixel intensity transformations such as adversarial patches ( Chiang et al. , 2020 ) and L∞ ( Carlini & Wagner , 2017 ) perturbations that provide a closed-form formula for the input region . However , the geometric transformations do not yield such linear regions . To prove the robustness of our generated examples to geometric transformations , we rely on DeepG ( Balunović et al. , 2019 ) which , given a range of geometric transformation parameters , creates an overapproximation of the set of input images generated by geometric perturbations . DeepG then levarages DeepPoly to certify the input image region . When generating our geometric robust examples , we work directly in the geometric parameter space and , thus , our input region I and the inputs to our certification objective L ( x ) are also in geometric space . Despite this change , as our approach is agnostic to the choice of the verifier , in the remainder of the paper we will assume the certification is done using DeepPoly and not DeepG , unless otherwise stated . 2.3 RANDOMIZED SMOOTHING . Randomized smoothing ( Lécuyer et al. , 2019 ; Cohen et al. , 2019 ) is a provable defense mechanism against adversarial attacks . For a chosen standard deviation σ and neural network f as defined above , randomized smoothing computes a smoothed classifier g based on f , such that g ( x ) = argmax c P ( y ( x+ ) = c ) with random Gaussian noise ∼ N ( 0 , σ2I ) . This construction of g allows Cohen et al . ( 2019 ) to introduce the procedure CERTIFY that provides probabilistic guarantees on the robustness of g around a point x : Proposition 1 . ( From Cohen et al . ( 2019 ) ) With probability at least 1− α over the randomness in CERTIFY , if CERTIFY returns a class y and a radius R ( i.e does not abstain ) , then g predicts y within radius R around x : g ( x+ δ ) = y , for all ‖δ‖2 < R. We define adversarial attacks on smoothed classifiers as follows : Definition 1 ( Adversarial attack on smoothed classifiers ) . For a fixed σ , α and an adversarial distance R′ ∈ R > 0 , we call x̃ ∈ Rn0 an adversarial attack on the smoothed classifier g at the point x ∈ Rn0 , if ‖x̃− x‖2 < R′ and g ( x ) 6= g ( x̃ ) . Similarly to generating adversarial attacks on the network f , we need to balance the adversarial distance R′ on g. If too big — the problem becomes trivial ; if too small — no attacks exist . We outline the exact procedure we use to heuristically select R′ in Appendix A.6 . Using the above definition , we define the strength of an attack x̃ as follows : Definition 2 ( Strength of adversarial attack on smoothed classifiers ) . We measure the strength of an attack x̃ in terms of Radv– the radius around x̃ , whose L2 ball is certified to be the same adversarial class as x̃ on the smoothed network g using CERTIFY for a chosen σ and α . Intuitively , this definition states that for points x̃ for which Radv is bigger , the smoothed classifier is less confident about predicting the correct class , since more adversarial examples are sampled in this region and therefore , the attack on g is stronger . We use this measure in Section 5 to compare the effectiveness of our adversarial examples to examples obtained by PGD on g . 3 OVERVIEW . Existing methods for generating robust adversarial examples focus on achieving empirical robustness ( Qin et al. , 2019 ; Athalye et al. , 2018 ) . In contrast , we consider provably robust adversarial examples , defined below : Definition 3 ( Provably Robust Adversarial Example ) . We define provably robust adversarial example to be any large connected neural network input region , defined by a set of perturbations of an image , that can be formally proven to only contain adversarial examples . In this section , we outline how we generate such regions . The technical details are given in Section 4 . To generate a provably robust adversarial example , ideally , we would like to directly maximize the input region ’ s size , under the constraint that it only contains adversarial examples . This leads to multiple challenges : Small changes of the parametrization of the input region ( e.g. , as a hyperbox ) can lead to large changes of the certification objective , necessitating a small learning rate for optimization algorithms based on gradient descent . At the same time , the optimizer would have to solve a full forward verification problem in each optimization step , which is slow and impractical . Additionally , according to Balunovic & Vechev ( 2020 ) , bad initialization of the robust region might further cause convergence to local minima , resulting in small robust regions . We now provide an overview of how we generate robust adversarial regions while alleviating these problems . Our method for generating robust examples in the shape of a hyperbox is shown in Figure 1 and assumes an algorithm A that generates adversarial examples and a neural network verifier V. We require V to provide the certification objective L ( x ) as a linear function of the network ’ s input neurons ( whose values can be drawn from the input hyperbox ) , as described in Section 2 . We split our algorithm into two steps , described in Section 3.1 and Section 3.2 , to address the challenges outlined above . An optional final step , illustrated in Figure 2 and outlined in Appendix D , demonstrates the extension of our algorithm to generate polyhedral examples . 3.1 COMPUTING AN OVERAPPROXIMATING REGION . In the first step , we compute an overapproximation hyperbox O by fitting a hyperbox around samples obtained fromA . O is represented as a dashed blue rectangle in Figure 1 . Intuitively , we use O to restrict the search space for adversarial regions to a part of the input space thatA can attack . | This paper presents a novel algorithm for identifying "provably robust adversarial examples": large regions in the input space that provably contain only adversarial examples. Each region corresponds to a single adversarial example $\tilde{x}$ found in the center of the region, along with all the points that can be generated by applying a sequence of transformations to $\tilde{x}$. The transformations considered in the paper are semantically meaningful changes to the original image. Critically, we can be guaranteed that $\tilde{x}$ will be misclassified even if _it_ is perturbed. The paper demonstrates that the algorithm can generate regions of non-trivial size on networks of non-trivial size. For example, for a CIFAR10 classifier with 6 layers and ~62k neurons, it finds axis-aligned regions containing a median of $10^{573}$ adversarial examples. In addition, the paper shows that provably robust adversarial examples can be used to create adversarial examples to $L_2$-smoothed classifiers that are more robust to $L_2$ noise as compared to adversarial examples generated directly via PGD attacks. | SP:264e8676eea93e3f351c395c7165d754db4bd07e |
Provably Robust Adversarial Examples | 1 INTRODUCTION . Deep neural networks ( DNNs ) are vulnerable to adversarial attacks : small input perturbations that cause misclassification ( Szegedy et al. , 2013 ) . This has caused an increased interest in investigating powerful attacks ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ; Madry et al. , 2018 ; Andriushchenko et al. , 2019 ; Zheng et al. , 2019 ; Wang et al. , 2019 ; Croce & Hein , 2019 ; Tramèr et al. , 2020 ) . An important limitation of existing attack methods is that they only produce a single concrete adversarial example and their effect can often be mitigated with existing defenses ( Madry et al. , 2018 ; Hu et al. , 2019 ; Sen et al. , 2020 ; Xiao et al. , 2020 ; Pang et al. , 2020 ; Lécuyer et al. , 2019 ; Cohen et al. , 2019 ; Salman et al. , 2019 ; Fischer et al. , 2020 ; Li et al. , 2020 ) . The effectiveness of these attacks can be improved by robustifying them : to consolidate the individual examples to produce a large symbolic region guaranteed to only contain adversarial examples . This Work : Provably Robust Adversarial Examples We present the concept of a provably robust adversarial example – a tuple consisting of an adversarial input point and an input region around it capturing a very large set ( e.g. , > 10100 ) of points guaranteed to be adversarial . We then introduce a novel algorithm for generating such regions and apply it to the setting of pixel intensity changes and geometric transformations . Our work relates to prior approaches on generating robust adversarial examples ( Athalye et al. , 2018 ; Qin et al. , 2019 ) but differs in a crucial point : our regions are guaranteed to be adversarial while prior approaches are empirical and offer no such guarantees . Main Contributions Our key contributions are : • The concept of a provably robust adversarial example – a connected input region capturing a very large set of points , generated by a set of perturbations , guaranteed to be adversarial . • A novel scalable method for synthesizing provably robust adversarial examples , based on iterative refinement and certification techniques . • A thorough evaluation of our method demonstrating it can generate provable regions containing ≈ 10573 concrete adversarial points for pixel intensity changes , in ≈ 2 minutes , and ≈ 10599 concrete points for geometric transformations , in ≈ 20 minutes , on a challenging CIFAR10 network . We also demonstrate that our robust adversarial examples are significantly more effective against state-of-the-art defenses based on randomized smoothing than the individual attacks used to construct the regions . 2 BACKGROUND . We now discuss the background necessary for the remainder of the paper . We consider a neural network f : Rn0 → Rnl with l layers , n0 input neurons and nl output classes . The network classifies an input x to class y ( x ) with the largest corresponding output value , i.e. , y ( x ) = argmaxi [ f ( x ) ] i . Note for brevity we will omit the argument to y when it is clear from the context . 2.1 NEURAL NETWORK CERTIFICATION . In this work , we rely on state-of-the-art neural network certification methods based on convex relaxations to prove that the adversarial examples produced by our algorithm are robust . These certification methods take a convex input region I ⊂ Rn0 and prove that every point in I is classified as target label yt by f . They propagate the set I through the layers of the network , producing a convex region that covers all possible values of output neurons ( Gehr et al. , 2018 ) . Robustness follows by proving that , for all combinations of output neuron values in this region , the output neuron corresponding to class yt has a larger value than the one corresponding to any other class y 6= yt . Commonly , one proves this property by computing a function Ly : Rn0 → R for each label y 6= yt , such that , for all x ∈ I , we have Ly ( x ) ≤ [ f ( x ) ] yt − [ f ( x ) ] y . For each Ly , one computes minx∈I Ly ( x ) to obtain a global lower bound that is true for all x ∈ I . If we obtain positive bounds for all y 6= yt , robustness is proven . To simplify notation , we will say that the certification objective L ( x ) is the function Ly ( x ) with the smallest minimum value on I . We will call its corresponding minimum value the certification error . We requireLy ( x ) to be a linear function of x . This requirement is consistent with many popular certification algorithms based on convex relaxation , such as CROWN ( Zhang et al. , 2018 ) , DeepZ ( Singh et al. , 2018a ) , and DeepPoly ( Singh et al. , 2019 ) . Without loss of generality , for the rest of this paper , we will treat DeepPoly as our preferred certification method . 2.2 GEOMETRIC CERTIFICATION . DeepPoly operates over specifications based on linear constraints over input pixels for verification . These constraints are straightforward to provide for simple pixel intensity transformations such as adversarial patches ( Chiang et al. , 2020 ) and L∞ ( Carlini & Wagner , 2017 ) perturbations that provide a closed-form formula for the input region . However , the geometric transformations do not yield such linear regions . To prove the robustness of our generated examples to geometric transformations , we rely on DeepG ( Balunović et al. , 2019 ) which , given a range of geometric transformation parameters , creates an overapproximation of the set of input images generated by geometric perturbations . DeepG then levarages DeepPoly to certify the input image region . When generating our geometric robust examples , we work directly in the geometric parameter space and , thus , our input region I and the inputs to our certification objective L ( x ) are also in geometric space . Despite this change , as our approach is agnostic to the choice of the verifier , in the remainder of the paper we will assume the certification is done using DeepPoly and not DeepG , unless otherwise stated . 2.3 RANDOMIZED SMOOTHING . Randomized smoothing ( Lécuyer et al. , 2019 ; Cohen et al. , 2019 ) is a provable defense mechanism against adversarial attacks . For a chosen standard deviation σ and neural network f as defined above , randomized smoothing computes a smoothed classifier g based on f , such that g ( x ) = argmax c P ( y ( x+ ) = c ) with random Gaussian noise ∼ N ( 0 , σ2I ) . This construction of g allows Cohen et al . ( 2019 ) to introduce the procedure CERTIFY that provides probabilistic guarantees on the robustness of g around a point x : Proposition 1 . ( From Cohen et al . ( 2019 ) ) With probability at least 1− α over the randomness in CERTIFY , if CERTIFY returns a class y and a radius R ( i.e does not abstain ) , then g predicts y within radius R around x : g ( x+ δ ) = y , for all ‖δ‖2 < R. We define adversarial attacks on smoothed classifiers as follows : Definition 1 ( Adversarial attack on smoothed classifiers ) . For a fixed σ , α and an adversarial distance R′ ∈ R > 0 , we call x̃ ∈ Rn0 an adversarial attack on the smoothed classifier g at the point x ∈ Rn0 , if ‖x̃− x‖2 < R′ and g ( x ) 6= g ( x̃ ) . Similarly to generating adversarial attacks on the network f , we need to balance the adversarial distance R′ on g. If too big — the problem becomes trivial ; if too small — no attacks exist . We outline the exact procedure we use to heuristically select R′ in Appendix A.6 . Using the above definition , we define the strength of an attack x̃ as follows : Definition 2 ( Strength of adversarial attack on smoothed classifiers ) . We measure the strength of an attack x̃ in terms of Radv– the radius around x̃ , whose L2 ball is certified to be the same adversarial class as x̃ on the smoothed network g using CERTIFY for a chosen σ and α . Intuitively , this definition states that for points x̃ for which Radv is bigger , the smoothed classifier is less confident about predicting the correct class , since more adversarial examples are sampled in this region and therefore , the attack on g is stronger . We use this measure in Section 5 to compare the effectiveness of our adversarial examples to examples obtained by PGD on g . 3 OVERVIEW . Existing methods for generating robust adversarial examples focus on achieving empirical robustness ( Qin et al. , 2019 ; Athalye et al. , 2018 ) . In contrast , we consider provably robust adversarial examples , defined below : Definition 3 ( Provably Robust Adversarial Example ) . We define provably robust adversarial example to be any large connected neural network input region , defined by a set of perturbations of an image , that can be formally proven to only contain adversarial examples . In this section , we outline how we generate such regions . The technical details are given in Section 4 . To generate a provably robust adversarial example , ideally , we would like to directly maximize the input region ’ s size , under the constraint that it only contains adversarial examples . This leads to multiple challenges : Small changes of the parametrization of the input region ( e.g. , as a hyperbox ) can lead to large changes of the certification objective , necessitating a small learning rate for optimization algorithms based on gradient descent . At the same time , the optimizer would have to solve a full forward verification problem in each optimization step , which is slow and impractical . Additionally , according to Balunovic & Vechev ( 2020 ) , bad initialization of the robust region might further cause convergence to local minima , resulting in small robust regions . We now provide an overview of how we generate robust adversarial regions while alleviating these problems . Our method for generating robust examples in the shape of a hyperbox is shown in Figure 1 and assumes an algorithm A that generates adversarial examples and a neural network verifier V. We require V to provide the certification objective L ( x ) as a linear function of the network ’ s input neurons ( whose values can be drawn from the input hyperbox ) , as described in Section 2 . We split our algorithm into two steps , described in Section 3.1 and Section 3.2 , to address the challenges outlined above . An optional final step , illustrated in Figure 2 and outlined in Appendix D , demonstrates the extension of our algorithm to generate polyhedral examples . 3.1 COMPUTING AN OVERAPPROXIMATING REGION . In the first step , we compute an overapproximation hyperbox O by fitting a hyperbox around samples obtained fromA . O is represented as a dashed blue rectangle in Figure 1 . Intuitively , we use O to restrict the search space for adversarial regions to a part of the input space thatA can attack . | The manuscript introduces a definition of provablely-robust adversarial examples, a set of examples that are verified to be classified as different labels compared with the input of interest. The main idea of the technique is to shrink a box-like region from an over approximation to a verifiable smaller sub-region such that a robustness verifier will return robust for all points in that particular sub-region. In the evaluation part, the author demonstrates the effectiveness of the approach with several experiments, i.e. robustness against intensity transformation and randomized smoothing defense. | SP:264e8676eea93e3f351c395c7165d754db4bd07e |
Gotta Go Fast When Generating Data with Score-Based Models | Score-based ( denoising diffusion ) generative models have recently gained a lot of success in generating realistic and diverse data . These approaches define a forward diffusion process for transforming data to noise and generate data by reversing it ( thereby going from noise to data ) . Unfortunately , current score-based models generate data very slowly due to the sheer number of score network evaluations required by numerical SDE solvers . In this work , we aim to accelerate this process by devising a more efficient SDE solver . Existing approaches rely on the Euler-Maruyama ( EM ) solver , which uses a fixed step size . We found that naively replacing it with other SDE solvers fares poorly - they either result in low-quality samples or become slower than EM . To get around this issue , we carefully devise an SDE solver with adaptive step sizes tailored to score-based generative models piece by piece . Our solver requires only two score function evaluations per step , rarely rejects samples , and leads to high-quality samples . Our approach generates data 2 to 10 times faster than EM while achieving better or equal sample quality . For high-resolution images , our method leads to significantly higher quality samples than all other methods tested . Our SDE solver has the benefit of requiring no step size tuning . 1 INTRODUCTION . Score-based generative models ( Song and Ermon , 2019 ; 2020 ; Ho et al. , 2020 ; Jolicoeur-Martineau et al. , 2020 ; Song et al. , 2020a ; Piché-Taillefer , 2021 ) have been very successful at generating data from various modalities , such as images ( Ho et al. , 2020 ; Song et al. , 2020a ) , audio ( Chen et al. , 2020 ; Kong et al. , 2020 ; Mittal et al. , 2021 ; Kameoka et al. , 2020 ) , and graphs ( Niu et al. , 2020 ) . They have further been used effectively for super-resolution ( Saharia et al. , 2021 ; Kadkhodaie and Simoncelli , 2020 ) , inpainting ( Kadkhodaie and Simoncelli , 2020 ) , source separation ( Jayaram and Thickstun , 2020 ) , and image-to-image translation ( Sasaki et al. , 2021 ) . In most of these applications , scorebased models achieved superior performances in terms of quality and diversity than the historically dominant Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) . Score-based models can be understood in two main classes : those based on a Variance Exploding ( VE ) diffusion process ( Song and Ermon , 2019 ) and those based on a Variance Preserving ( VP ) one ( Ho et al. , 2020 ) . Both diffusion processes progressively transform real data into Gaussian noise ; N ( 0 , σ2maxI ) for VE where σ2max is very large , and N ( 0 , I ) for VP . The diffusion process ( VE , VP , etc . ) is then reversed in order to generate real data from Gaussian noise . Reversing the process requires the score function , which is estimated with a neural network ( known as a score network ) . Although very powerful , score-based models generate data through an undesirably long iterative process ; meanwhile , other state-of-the-art methods such as GANs generate data from a single forward pass of a neural network . Increasing the speed of the generative process is thus an active area of research . Chen et al . ( 2020 ) and San-Roman et al . ( 2021 ) proposed faster step size schedules for VP diffusions that still yield relatively good quality/diversity metrics . Although fast , these schedules are arbitrary , require careful tuning , and the optimal schedules will vary from one model to another . Block et al . ( 2020 ) proposed generating data progressively from low to high-resolution images and show that the scheme improves speed . Similarly , Nichol and Dhariwal ( 2021 ) proposed generating low-resolution images and then upscale them since generating low-resolution images is quicker . They further suggested to accelerate VP-based models by learning dimension-specific noise rather than assuming equal noise everywhere . Note that these methods do not affect the data generation algorithm and would thus be complementary to our methods . Song et al . ( 2020a ) and Song et al . ( 2020b ) proposed removing the noise from the data generation algorithm and solve an Ordinary Differential Equation ( ODE ) rather than a Stochastic Differential Equation ( SDE ) ; they report being able to converge much faster when there is no noise . Although it improves the generation speed , Song et al . ( 2020a ) report obtaining lower-quality images when using the ODE formulation for the VE process ( Song et al. , 2020a ) . We will later show that our SDE solver generally leads to better results than ODE solvers at similar speeds . Thus , existing methods for acceleration often require considerable step size/schedule tuning ( this is also true for the baseline approach ) and do not always work for both VE and VP processes . To improve speed and remove the need for step size/schedule tuning , we propose to solve the reverse diffusion process using SDE solvers with adaptive step sizes . It turns out that off-the-shelf SDE solvers are ill-suited for generative modeling and exhibit either ( 1 ) divergence , ( 2 ) slower data generation than the baseline , or ( 3 ) significantly worse quality than the baseline ( see Appendix A ) . This can be attributed to distinct features of the SDEs that arise in score-based generative models that set them apart from the SDEs traditionally considered in the numerical SDE solver literature , namely : ( 1 ) the codomain of the unknown function is extremely high-dimensional , especially in the case of image generation ; ( 2 ) evaluating the score function is computationally expensive , requiring a forward pass of a large mini-batch through a large neural network ; ( 3 ) the required precision of the solution is smaller than usual because we are satisfied as long as the error is not perceptible ( e.g. , one RGB increment on an image ) . We devise our own SDE solver with these features in mind , resulting in an algorithm that can get around the problems encountered by off-the-shelf solvers . To address high dimensionality , we use the ` 2 norm rather than the ` ∞ norm to measure the error across different dimensions to prevent a single pixel from slowing down the solver . To address the cost of score function evaluations while still obtaining high precision , we ( 1 ) take the minimum number of score function evaluations needed for adaptive step sizes ( two evaluations ) , and ( 2 ) use extrapolation to get high precision at no extra cost . To take advantage of the reduced requirement for precision , we set the absolute tolerance for the error according to the range of RGB values . Our main contribution is a new SDE solver tailored to score-based generative models with the following benefits : • Our solver is much faster than the baseline methods , i.e . reverse-diffusion method with Langevin dynamics and Euler-Maruyama ( EM ) ; • It yields higher quality/diversity samples than EM when using the same computing budget ; • It does not require any step size or schedule tuning ; • It can be used to quickly solve any type of diffusion process ( e.g. , VE , VP ) 2 BACKGROUND . 2.1 SCORE-BASED MODELING WITH SDES . Let x ( 0 ) ∈ Rd be a sample from the data distribution pdata . The sample is gradually corrupted over time through a Forward Diffusion Process ( FDP ) , a common type of Stochastic Differential Equation ( SDE ) : dx = f ( x , t ) dt+ g ( t ) dw , ( 1 ) where f ( x , t ) : Rd × R→ Rd is the drift , g ( t ) : R→ R is the diffusion coefficient and w ( t ) is the Wiener process indexed by t ∈ [ 0 , 1 ] . Data points and their probability distribution evolve along the trajectories { x ( t ) } 1t=0 and { pt ( x ) } 1t=0 respectively , with p0 ≡ pdata . The functions f and g are chosen such that x ( 1 ) be approximately Gaussian and independent from x ( 0 ) . Inference is achieved by reversing this diffusion , drawing x ( 1 ) from its Gaussian distribution and solving the Reverse Diffusion Process ( RDP ) equal to : dx = [ f ( x , t ) − g ( t ) 2∇x log pt ( x ) ] dt+ g ( t ) dw̄ , ( 2 ) where∇x log pt ( x ) is referred to as the score of the distribution at time t ( Hyvärinen , 2005 ) and w̄ ( t ) is the Wiener process in which time flows backward ( Anderson , 1982 ) . One can observe from Equation 2 that the RDP requires knowledge of the score ( or pt ) , which we do not have access to . Fortunately , it can be estimated by a neural network ( referred to as the score network ) by optimizing the following objective : L ( θ ) = Ex ( t ) ∼p ( x ( t ) |x ( 0 ) ) , x ( 0 ) ∼pdata [ λ ( t ) 2 ∥∥sθ ( x ( t ) , t ) −∇x ( t ) log pt ( x ( t ) |x ( 0 ) ) ∥∥22 ] , ( 3 ) where λ ( t ) : R→ R is a weighting function generally chosen to be inversely proportional to : E [ ∥∥∇x ( t ) log pt ( x ( t ) |x ( 0 ) ) ∥∥22 ] . One can demonstrate that the minimizer of that objective θ∗ will be such that sθ∗ ( x , t ) = ∇x log pt ( x ) ( Vincent , 2011 ) , allowing us to approximate the reverse diffusion process . As can be seen , evaluating the objective requires the ability to generate samples from the FDP at arbitrary times t. Thankfully , as long as the drift is affine ( i.e. , f ( x , t ) = Ax + B ) , the transition kernel p ( x ( t ) |x ( 0 ) ) will always be normally distributed ( Särkkä and Solin , 2019 ) , which means that we can solve the forward diffusion in a single step . Furthermore , the score of the Gaussian transition kernel is trivial to compute , making the loss an inexpensive training objective . There are two primary choices for the FDP in the literature , which we discuss below . 2.2 VARIANCE EXPLODING ( VE ) PROCESS . The Variance Exploding ( VE ) process consists in the following FDP : dx = √ d [ σ2 ( t ) ] dt dw . Its associated transition kernel is : x ( t ) |x ( 0 ) ∼ N ( x ( 0 ) , [ σ2 ( t ) − σ2 ( 0 ) ] I ) ≈ N ( x ( 0 ) , σ2 ( t ) I ) . In practice , we let σ ( t ) = σmin ( σmax σmin ) t , where σmin = 0.01 and σmax ≈ maxi ∑N j=1 ||x ( i ) − x ( j ) || is the maximum Euclidean distance between two samples from the dataset { x ( i ) } Ni=1 ( Song and Ermon , 2020 ) . Using the maximum Euclidean distance ensures that x ( 1 ) does not depend on x ( 0 ) ; thus , x ( 1 ) is approximately distributed as N ( 0 , σ2 ( 1 ) I ) . | The paper presents a new SDE solver for the reverse process in score-based models. The algorithm is fast and offers high quality, and avoids some hyperparameter tuning. There is theoretical analysis on the stability and bias of the algorithm. The paper also has experiments comparing the proposed algorithm to several baseline methods. | SP:906e0447c7ae0b27e107132f3795a83d4b7e48e6 |
Gotta Go Fast When Generating Data with Score-Based Models | Score-based ( denoising diffusion ) generative models have recently gained a lot of success in generating realistic and diverse data . These approaches define a forward diffusion process for transforming data to noise and generate data by reversing it ( thereby going from noise to data ) . Unfortunately , current score-based models generate data very slowly due to the sheer number of score network evaluations required by numerical SDE solvers . In this work , we aim to accelerate this process by devising a more efficient SDE solver . Existing approaches rely on the Euler-Maruyama ( EM ) solver , which uses a fixed step size . We found that naively replacing it with other SDE solvers fares poorly - they either result in low-quality samples or become slower than EM . To get around this issue , we carefully devise an SDE solver with adaptive step sizes tailored to score-based generative models piece by piece . Our solver requires only two score function evaluations per step , rarely rejects samples , and leads to high-quality samples . Our approach generates data 2 to 10 times faster than EM while achieving better or equal sample quality . For high-resolution images , our method leads to significantly higher quality samples than all other methods tested . Our SDE solver has the benefit of requiring no step size tuning . 1 INTRODUCTION . Score-based generative models ( Song and Ermon , 2019 ; 2020 ; Ho et al. , 2020 ; Jolicoeur-Martineau et al. , 2020 ; Song et al. , 2020a ; Piché-Taillefer , 2021 ) have been very successful at generating data from various modalities , such as images ( Ho et al. , 2020 ; Song et al. , 2020a ) , audio ( Chen et al. , 2020 ; Kong et al. , 2020 ; Mittal et al. , 2021 ; Kameoka et al. , 2020 ) , and graphs ( Niu et al. , 2020 ) . They have further been used effectively for super-resolution ( Saharia et al. , 2021 ; Kadkhodaie and Simoncelli , 2020 ) , inpainting ( Kadkhodaie and Simoncelli , 2020 ) , source separation ( Jayaram and Thickstun , 2020 ) , and image-to-image translation ( Sasaki et al. , 2021 ) . In most of these applications , scorebased models achieved superior performances in terms of quality and diversity than the historically dominant Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) . Score-based models can be understood in two main classes : those based on a Variance Exploding ( VE ) diffusion process ( Song and Ermon , 2019 ) and those based on a Variance Preserving ( VP ) one ( Ho et al. , 2020 ) . Both diffusion processes progressively transform real data into Gaussian noise ; N ( 0 , σ2maxI ) for VE where σ2max is very large , and N ( 0 , I ) for VP . The diffusion process ( VE , VP , etc . ) is then reversed in order to generate real data from Gaussian noise . Reversing the process requires the score function , which is estimated with a neural network ( known as a score network ) . Although very powerful , score-based models generate data through an undesirably long iterative process ; meanwhile , other state-of-the-art methods such as GANs generate data from a single forward pass of a neural network . Increasing the speed of the generative process is thus an active area of research . Chen et al . ( 2020 ) and San-Roman et al . ( 2021 ) proposed faster step size schedules for VP diffusions that still yield relatively good quality/diversity metrics . Although fast , these schedules are arbitrary , require careful tuning , and the optimal schedules will vary from one model to another . Block et al . ( 2020 ) proposed generating data progressively from low to high-resolution images and show that the scheme improves speed . Similarly , Nichol and Dhariwal ( 2021 ) proposed generating low-resolution images and then upscale them since generating low-resolution images is quicker . They further suggested to accelerate VP-based models by learning dimension-specific noise rather than assuming equal noise everywhere . Note that these methods do not affect the data generation algorithm and would thus be complementary to our methods . Song et al . ( 2020a ) and Song et al . ( 2020b ) proposed removing the noise from the data generation algorithm and solve an Ordinary Differential Equation ( ODE ) rather than a Stochastic Differential Equation ( SDE ) ; they report being able to converge much faster when there is no noise . Although it improves the generation speed , Song et al . ( 2020a ) report obtaining lower-quality images when using the ODE formulation for the VE process ( Song et al. , 2020a ) . We will later show that our SDE solver generally leads to better results than ODE solvers at similar speeds . Thus , existing methods for acceleration often require considerable step size/schedule tuning ( this is also true for the baseline approach ) and do not always work for both VE and VP processes . To improve speed and remove the need for step size/schedule tuning , we propose to solve the reverse diffusion process using SDE solvers with adaptive step sizes . It turns out that off-the-shelf SDE solvers are ill-suited for generative modeling and exhibit either ( 1 ) divergence , ( 2 ) slower data generation than the baseline , or ( 3 ) significantly worse quality than the baseline ( see Appendix A ) . This can be attributed to distinct features of the SDEs that arise in score-based generative models that set them apart from the SDEs traditionally considered in the numerical SDE solver literature , namely : ( 1 ) the codomain of the unknown function is extremely high-dimensional , especially in the case of image generation ; ( 2 ) evaluating the score function is computationally expensive , requiring a forward pass of a large mini-batch through a large neural network ; ( 3 ) the required precision of the solution is smaller than usual because we are satisfied as long as the error is not perceptible ( e.g. , one RGB increment on an image ) . We devise our own SDE solver with these features in mind , resulting in an algorithm that can get around the problems encountered by off-the-shelf solvers . To address high dimensionality , we use the ` 2 norm rather than the ` ∞ norm to measure the error across different dimensions to prevent a single pixel from slowing down the solver . To address the cost of score function evaluations while still obtaining high precision , we ( 1 ) take the minimum number of score function evaluations needed for adaptive step sizes ( two evaluations ) , and ( 2 ) use extrapolation to get high precision at no extra cost . To take advantage of the reduced requirement for precision , we set the absolute tolerance for the error according to the range of RGB values . Our main contribution is a new SDE solver tailored to score-based generative models with the following benefits : • Our solver is much faster than the baseline methods , i.e . reverse-diffusion method with Langevin dynamics and Euler-Maruyama ( EM ) ; • It yields higher quality/diversity samples than EM when using the same computing budget ; • It does not require any step size or schedule tuning ; • It can be used to quickly solve any type of diffusion process ( e.g. , VE , VP ) 2 BACKGROUND . 2.1 SCORE-BASED MODELING WITH SDES . Let x ( 0 ) ∈ Rd be a sample from the data distribution pdata . The sample is gradually corrupted over time through a Forward Diffusion Process ( FDP ) , a common type of Stochastic Differential Equation ( SDE ) : dx = f ( x , t ) dt+ g ( t ) dw , ( 1 ) where f ( x , t ) : Rd × R→ Rd is the drift , g ( t ) : R→ R is the diffusion coefficient and w ( t ) is the Wiener process indexed by t ∈ [ 0 , 1 ] . Data points and their probability distribution evolve along the trajectories { x ( t ) } 1t=0 and { pt ( x ) } 1t=0 respectively , with p0 ≡ pdata . The functions f and g are chosen such that x ( 1 ) be approximately Gaussian and independent from x ( 0 ) . Inference is achieved by reversing this diffusion , drawing x ( 1 ) from its Gaussian distribution and solving the Reverse Diffusion Process ( RDP ) equal to : dx = [ f ( x , t ) − g ( t ) 2∇x log pt ( x ) ] dt+ g ( t ) dw̄ , ( 2 ) where∇x log pt ( x ) is referred to as the score of the distribution at time t ( Hyvärinen , 2005 ) and w̄ ( t ) is the Wiener process in which time flows backward ( Anderson , 1982 ) . One can observe from Equation 2 that the RDP requires knowledge of the score ( or pt ) , which we do not have access to . Fortunately , it can be estimated by a neural network ( referred to as the score network ) by optimizing the following objective : L ( θ ) = Ex ( t ) ∼p ( x ( t ) |x ( 0 ) ) , x ( 0 ) ∼pdata [ λ ( t ) 2 ∥∥sθ ( x ( t ) , t ) −∇x ( t ) log pt ( x ( t ) |x ( 0 ) ) ∥∥22 ] , ( 3 ) where λ ( t ) : R→ R is a weighting function generally chosen to be inversely proportional to : E [ ∥∥∇x ( t ) log pt ( x ( t ) |x ( 0 ) ) ∥∥22 ] . One can demonstrate that the minimizer of that objective θ∗ will be such that sθ∗ ( x , t ) = ∇x log pt ( x ) ( Vincent , 2011 ) , allowing us to approximate the reverse diffusion process . As can be seen , evaluating the objective requires the ability to generate samples from the FDP at arbitrary times t. Thankfully , as long as the drift is affine ( i.e. , f ( x , t ) = Ax + B ) , the transition kernel p ( x ( t ) |x ( 0 ) ) will always be normally distributed ( Särkkä and Solin , 2019 ) , which means that we can solve the forward diffusion in a single step . Furthermore , the score of the Gaussian transition kernel is trivial to compute , making the loss an inexpensive training objective . There are two primary choices for the FDP in the literature , which we discuss below . 2.2 VARIANCE EXPLODING ( VE ) PROCESS . The Variance Exploding ( VE ) process consists in the following FDP : dx = √ d [ σ2 ( t ) ] dt dw . Its associated transition kernel is : x ( t ) |x ( 0 ) ∼ N ( x ( 0 ) , [ σ2 ( t ) − σ2 ( 0 ) ] I ) ≈ N ( x ( 0 ) , σ2 ( t ) I ) . In practice , we let σ ( t ) = σmin ( σmax σmin ) t , where σmin = 0.01 and σmax ≈ maxi ∑N j=1 ||x ( i ) − x ( j ) || is the maximum Euclidean distance between two samples from the dataset { x ( i ) } Ni=1 ( Song and Ermon , 2020 ) . Using the maximum Euclidean distance ensures that x ( 1 ) does not depend on x ( 0 ) ; thus , x ( 1 ) is approximately distributed as N ( 0 , σ2 ( 1 ) I ) . | Score-based/diffusion-based generative models can achieve high sample quality. However, their sampling speed is slow due to the large number of evaluations required by numerical SDE solvers. This works aims to accelerate the sampling process by using a more efficient SDE solver. The proposed approach generates data 2 to 10 times faster than the baselines while achieving reasonably well sample qualities. | SP:906e0447c7ae0b27e107132f3795a83d4b7e48e6 |
Multivariate Time Series Forecasting with Latent Graph Inference | This paper introduces a new architecture for multivariate time series forecasting that simultaneously infers and leverages relations among time series . We cast our method as a modular extension to univariate architectures where relations among individual time series are dynamically inferred in the latent space obtained after encoding the whole input signal . Our approach is flexible enough to scale gracefully according to the needs of the forecasting task under consideration . In its most straight-forward and general version , we infer a potentially fully connected graph to model the interactions between time series , which allows us to obtain competitive forecast accuracy compared with the state-of-the-art in graph neural networks for forecasting . In addition , whereas previous latent graph inference methods scale O ( N2 ) w.r.t . the number of nodes N ( representing the time series ) , we show how to configure our approach to cater for the scale of modern time series panels . By assuming the inferred graph to be bipartite where one partition consists of the original N nodes and we introduce K nodes ( taking inspiration from low-rank-decompositions ) we reduce the time complexity of our procedure to O ( NK ) . This allows us to leverage the dependency structure with a small trade-off in forecasting accuracy . We demonstrate the effectiveness of our method for a variety of datasets where it performs better or very competitively to previous methods under both the fully connected and bipartite assumptions . 1 INTRODUCTION . Time Series Forecasting ( TSF ) has been widely studied due to its practical significance in a wide variety of applications such as climate modelling ( Mudelsee , 2019 ) , supply chain management in retail ( Larson , 2001 ; Böse et al. , 2017 ) , market analysis in finance ( Andersen et al. , 2005 ) , traffic control ( Li et al. , 2017 ) and medicine ( Kaushik et al. , 2020 ) . Petropoulos et al . ( 2020 ) provide a non-systematic overview of further applications . In TSF , given a sequence of data points indexed over time , we aim to estimate its future values based on previously observed data . Data is often multivariate , meaning that multiple variables vary over time , each variable may not only depend on its own historical values , but also on other variables ’ past . Efficiently modelling the dependencies between these variables is still an open problem . Multivariate Time Series ( MTS ) methods aim to leverage the dependencies between variables in order to improve the forecasting accuracy . Some classical MTS forecasting algorithms such as Vector Autoregression ( VAR ) ( Lütkepohl , 2005 ) or Gaussian Processes ( Roberts et al. , 2013 ) only consider linear dependencies among variables . A natural way to model non-linear dependencies in deep learning is via Graph Neural Networks ( GNNs ) ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) . In fact , GNNs have been successfully applied for the Multivariate Time Series forecasting ( Li et al. , 2017 ; Yu et al. , 2017 ; Chen et al. , 2020a ) , leveraging the relations among different series . But these methods require a pre-defined adjacency matrix which may only be available in some specific datasets , for example , traffic datasets , where it can be constructed from the spatial structure of a city . More recently , a family of methods that do not require a pre-defined adjacency matrix have been proposed ( Wu et al. , 2019 ; Franceschi et al. , 2019 ; Wu et al. , 2020 ; Shang et al. , 2021 ) . In this case , a latent graph representation is inferred while forecasting , allowing to operate on a larger variety of datasets . Our work belongs to this category . However , inferring all pairwise relations may come at a higher computational cost , as the number of relations scales quadratically O ( N2 ) w.r.t . the number of nodes . This limits the scalability to large datasets . Additionally , the above mentioned latent graph inference methods perform message passing update at every time step iteration which can also be expensive . To overcome these limitations , we propose a new latent graph inference algorithm for Multivariate Time Series forecasting that is more efficient than previous algorithms while achieving better or competitive performance . We cast the latent graph inference as a modular and easy-to-implement extension to current univariate models . The graph is dynamically inferred per inputted data stream allowing a more flexible representation than a static graph for the whole dataset . Additionally , we optionally reduce the complexity from O ( N2 ) ( Fully Connected Assumption ) to O ( NK ) ( Bipartite Assumption ) where K ⌧ N for a small trade off in performance . 2 BACKGROUND . 2.1 TIME SERIES FORECASTING . In time series forecasting we want to estimate a future time series xt+1 : T given its past xt0 : t where t0 t T indexes over time , and ( optionally ) some context information c. For the multivariate case we assume the time series is composed of N variates at a time such that xt0 : T = { x1 , t0 : T , . . . , xN , t0 : T } 2 RN⇥T t0+1 . In this section we distinguish two main categories of time series forecasting methods , Global Univariate and Multivariate . Global Univariate methods : In this case we only use the past of each univariate to predict its future . However , the model weights ✓u are shared across all univariate time series . More formally : x̂i , t+1 : T = fu ( xi , t0 : t , ci ; ✓u ) ( 1 ) where x̂ denotes the estimated values , i 2 { 1 , . . . , N } indexes over multivariates and fu ( · ) is the estimator function with learnable parameters ✓u shared across time series . Conditioning on the past of each univariate may limit the performance of the forecasting algorithm compared to multivariate ones . Despite that , it simplifies the design of f✓ and already provides reasonable results . A popular example of univariate models would be ( Salinas et al. , 2020 ) . Multivariate methods : Multivariate methods condition on all past data ( all N variates ) and directly predict the multivariate target . More formally : x̂t+1 : T = fm ( xt0 : t , c ) . ( 2 ) Different variables may be correlated and/or depend on the same con-founders . For example , in retail forecasting , PPE masks and antibacterial soaps jointly increased in demand during the early days of the COVID-19 pandemic . In traffic forecasting , an increase of the outcome traffic flow in a given neighborhood may result in an increase of the income traffic flow on another one . Modelling these dependencies may improve the forecasting accuracy , but it may come at a cost of higher complexity and hence more expensive algorithms , specially when trying to model all pairwise interactions between variates . 2.2 GRAPH NEURAL NETWORKS . Graph Neural Networks ( GNNs ) ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) operate directly on graph structured data . They have gained a lot of attention in the last years due to their success in a large variety of domains which benefit from modelling interactions between different nodes/entities . In the context of multivariate time series , GNNs can be used to model the interactions between time series . In this work we consider the type of GNN introduced by ( Gilmer et al. , 2017 ) . Given a graph G = ( V , E ) with nodes vi 2 V and edges eij 2 E , we define a graph convolutional layer as : mij = e ( h l i , h l j ) mi = X j2N ( i ) ↵ijmij h l+1 i = h ( h l i , mi ) ( 3 ) Where e and h are the edge and node functions , usually approximated as Multi Layer Perceptrons ( MLPs ) , hli 2 Rnf is the nf-dimensional embedding of a node vi at layer l and mij is the edge embedding that propagates information from node vj to vi . A GNN is constructed by stacking multiple of these Graph Convolutional Layers hl+1 = GCL [ hl , E ] . Additionally , in Equation 3 we include ↵ij 2 ( 0 , 1 ) which is a scalar value that performs the edge inference or attention over the neighbors similarly to Veličković et al . ( 2017 ) . As done in ( Satorras et al. , 2021 ) , we choose this value to be computed as the output of a function ↵ij = ↵ ( mij ) where ↵ is composed of just a linear layer followed by a sigmoid activation function . 3 RELATED WORK . Time series forecasting has been extensively studied in the past due to its practical significance with a number of recent overview articles available ( et al. , 2020 ; Benidis et al. , 2020 ; Lim and Zohren , 2021 ) . Traditionally , most classical methods are univariate in nature ( see e.g. , Hyndman and Athanasopoulos ( 2017 ) for an overview ) . While some of these have multi-variate extensions ( e.g. , ARMA and VARMA models ) , they are limited by the amount of related time series information they can incorporate . Dynamic factor models ( Geweke , 1977 ; Wang et al. , 2019a ) are fore-runners of a family of models that has recently received more attention , the so-called global models ( Januschowski et al. , 2019 ; Montero-Manso and Hyndman , 2022 ) . These global models estimate their parameters over an entire panel of time series , so thereby taking advantage of cross time series learning , but still produce a univariate forecast . Many such global models have been proposed building on the main neural network architectures like RNNs ( Salinas et al. , 2020 ; Liberty et al. , 2020 ; Bandara et al. , 2019 ) , CNNs ( Wen et al. , 2017 ; Chen et al. , 2020b ) , Transformers ( Li et al. , 2019 ; Lim et al. , 2021 ; Eisenach et al. , 2020 ) and also combining classical probabilistic models with deep learning ( Rangapuram et al. , 2018 ; Kurle et al. , 2020 ; de Bézenac et al. , 2020 ) . However , these global models do not explicitly model the relationship between the time series in the panel . Most recently , global multi-variate forecasting models have received attention , in particular models that attempt to capture the relationship of the time series via a multi-variate likelihood ( Rasul et al. , 2020 ; 2021 ; de Bézenac et al. , 2020 ; Salinas et al. , 2019 ) . Here , we attempt to capture the multivariate nature of many modern forecasting problems primarily by using a multi-variate time series as input . For this , a natural way to model and exploit the relationship between time series is via Graph Neural Networks ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) which have been successfully applied to a wide variety of deep learning domains where exploiting relations between entities/nodes can benefit the prediction task . Even in those cases where edges are not explicitly provided in the dataset , attention or a latent graph can be inferred from the node embeddings such that GNNs can still leverage the structure of the data . Some examples of latent graph inference or attention are ( Wang et al. , 2019b ) in point clouds , ( Franceschi et al. , 2019 ) in semi-supervised graph classification , ( Ying et al. , 2018 ) in hierarchical graph representation learning , ( Kipf et al. , 2018 ) in modelling dynamical systems , ( Kazi et al. , 2020 ) in zero-shot learning and 3D point cloud segmentation , ( Garcia and Bruna , 2017 ; Kossen et al. , 2021 ) in image classification , ( Cranmer et al. , 2020 ) in inferring symbolic representations and ( Fuchs et al. , 2020 ; Satorras et al. , 2021 ) in molecular property prediction . In Multivariate Time Series ( MTS ) forecasting we can leverage dependencies between time series by exchanging information among them . Lai et al . ( 2018 ) ; Shih et al . ( 2019 ) are some of the first deep learning approaches designed to exploit those pair-wise dependencies . More recent methods , ( Li et al. , 2017 ; Yu et al. , 2017 ; Seo et al. , 2018 ; Zhao et al. , 2019 ) are built in the intersection of Graph Neural Networks and time series forecasting but they require a pre-defined adjacency matrix . Lately , new methods that infer a latent graph from the node embeddings have been introduced in MTS forecasting ( Wu et al. , 2020 ; Shang et al. , 2021 ; Cao et al. , 2021 ) , and in MTS anomaly detection ( Zhang et al. , 2020 ; Deng and Hooi , 2021 ) . These methods can be applied to any dataset even when there is not an explicitly defined adjacency matrix . But this comes with a limitation , inferring the edges can be expensive since those scale quadratically O ( N2 ) w.r.t the number of nodes/variables N or O ( N3 ) in ( Cao et al. , 2021 ) . Our approach is related to ( Wu et al. , 2020 ; Shang et al. , 2021 ) , but in contrast a ) Our latent graph is dynamically inferred for each inputted data stream instead of a static graph for the whole dataset which allows a more flexible graph representation . b ) It is modular since it can be added as an extension to standard univariate methods after encoding the input signal xt0 : t , this also makes the graph operation cheaper since the message exchange is only done at time step t. c ) Optionally reduces the number of edges from O ( N2 ) to O ( NK ) where K ⌧ N with the bipartite assumption . | The paper proposes using graph neural net (GNN) operations to combine per-series embeddings, to enable multivariate forecasting. Specifically, N individual series are separately encoded for a given time window to get representations per series. These representations are then updated with a GNN - either assuming a fully connected graph (with edge weights computed as part of the model), or using a bipartite graph (using a smaller set of K << N auxilliary nodes). I.e., after multiple layers of the GNN, the representations are updated with information from the other series' representations. Finally, the final representations are passed through per-series decoders. The latent bipartite graph formulation enables more efficient operation of the GNN component as instead of computing O(N^2) messages only O(NK) need to be computed in a given pass. The authors compare the proposed approach with other Graph based forecasting approaches (including ablated versions of the proposed approach) on 6 datasets - 2 where there is a given graph structure (so past work requiring the graph structure to be known can be used) and 4 where there is not. They demonstrate competitive performance of the proposed approach (including the bipartite graph approach) and significant speed up of forward passes using the bipartite formulation especially for larger N. They also examine the inferred adjacency matrices for different methods on some synthetic data. Additionally, they show hyper parameter sensitivity results for varying K (number of latent nodes in the bipartite graph) for one dataset. | SP:fb6ceb7cc788fb39fbe67529b2c4401f51fd74cb |
Multivariate Time Series Forecasting with Latent Graph Inference | This paper introduces a new architecture for multivariate time series forecasting that simultaneously infers and leverages relations among time series . We cast our method as a modular extension to univariate architectures where relations among individual time series are dynamically inferred in the latent space obtained after encoding the whole input signal . Our approach is flexible enough to scale gracefully according to the needs of the forecasting task under consideration . In its most straight-forward and general version , we infer a potentially fully connected graph to model the interactions between time series , which allows us to obtain competitive forecast accuracy compared with the state-of-the-art in graph neural networks for forecasting . In addition , whereas previous latent graph inference methods scale O ( N2 ) w.r.t . the number of nodes N ( representing the time series ) , we show how to configure our approach to cater for the scale of modern time series panels . By assuming the inferred graph to be bipartite where one partition consists of the original N nodes and we introduce K nodes ( taking inspiration from low-rank-decompositions ) we reduce the time complexity of our procedure to O ( NK ) . This allows us to leverage the dependency structure with a small trade-off in forecasting accuracy . We demonstrate the effectiveness of our method for a variety of datasets where it performs better or very competitively to previous methods under both the fully connected and bipartite assumptions . 1 INTRODUCTION . Time Series Forecasting ( TSF ) has been widely studied due to its practical significance in a wide variety of applications such as climate modelling ( Mudelsee , 2019 ) , supply chain management in retail ( Larson , 2001 ; Böse et al. , 2017 ) , market analysis in finance ( Andersen et al. , 2005 ) , traffic control ( Li et al. , 2017 ) and medicine ( Kaushik et al. , 2020 ) . Petropoulos et al . ( 2020 ) provide a non-systematic overview of further applications . In TSF , given a sequence of data points indexed over time , we aim to estimate its future values based on previously observed data . Data is often multivariate , meaning that multiple variables vary over time , each variable may not only depend on its own historical values , but also on other variables ’ past . Efficiently modelling the dependencies between these variables is still an open problem . Multivariate Time Series ( MTS ) methods aim to leverage the dependencies between variables in order to improve the forecasting accuracy . Some classical MTS forecasting algorithms such as Vector Autoregression ( VAR ) ( Lütkepohl , 2005 ) or Gaussian Processes ( Roberts et al. , 2013 ) only consider linear dependencies among variables . A natural way to model non-linear dependencies in deep learning is via Graph Neural Networks ( GNNs ) ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) . In fact , GNNs have been successfully applied for the Multivariate Time Series forecasting ( Li et al. , 2017 ; Yu et al. , 2017 ; Chen et al. , 2020a ) , leveraging the relations among different series . But these methods require a pre-defined adjacency matrix which may only be available in some specific datasets , for example , traffic datasets , where it can be constructed from the spatial structure of a city . More recently , a family of methods that do not require a pre-defined adjacency matrix have been proposed ( Wu et al. , 2019 ; Franceschi et al. , 2019 ; Wu et al. , 2020 ; Shang et al. , 2021 ) . In this case , a latent graph representation is inferred while forecasting , allowing to operate on a larger variety of datasets . Our work belongs to this category . However , inferring all pairwise relations may come at a higher computational cost , as the number of relations scales quadratically O ( N2 ) w.r.t . the number of nodes . This limits the scalability to large datasets . Additionally , the above mentioned latent graph inference methods perform message passing update at every time step iteration which can also be expensive . To overcome these limitations , we propose a new latent graph inference algorithm for Multivariate Time Series forecasting that is more efficient than previous algorithms while achieving better or competitive performance . We cast the latent graph inference as a modular and easy-to-implement extension to current univariate models . The graph is dynamically inferred per inputted data stream allowing a more flexible representation than a static graph for the whole dataset . Additionally , we optionally reduce the complexity from O ( N2 ) ( Fully Connected Assumption ) to O ( NK ) ( Bipartite Assumption ) where K ⌧ N for a small trade off in performance . 2 BACKGROUND . 2.1 TIME SERIES FORECASTING . In time series forecasting we want to estimate a future time series xt+1 : T given its past xt0 : t where t0 t T indexes over time , and ( optionally ) some context information c. For the multivariate case we assume the time series is composed of N variates at a time such that xt0 : T = { x1 , t0 : T , . . . , xN , t0 : T } 2 RN⇥T t0+1 . In this section we distinguish two main categories of time series forecasting methods , Global Univariate and Multivariate . Global Univariate methods : In this case we only use the past of each univariate to predict its future . However , the model weights ✓u are shared across all univariate time series . More formally : x̂i , t+1 : T = fu ( xi , t0 : t , ci ; ✓u ) ( 1 ) where x̂ denotes the estimated values , i 2 { 1 , . . . , N } indexes over multivariates and fu ( · ) is the estimator function with learnable parameters ✓u shared across time series . Conditioning on the past of each univariate may limit the performance of the forecasting algorithm compared to multivariate ones . Despite that , it simplifies the design of f✓ and already provides reasonable results . A popular example of univariate models would be ( Salinas et al. , 2020 ) . Multivariate methods : Multivariate methods condition on all past data ( all N variates ) and directly predict the multivariate target . More formally : x̂t+1 : T = fm ( xt0 : t , c ) . ( 2 ) Different variables may be correlated and/or depend on the same con-founders . For example , in retail forecasting , PPE masks and antibacterial soaps jointly increased in demand during the early days of the COVID-19 pandemic . In traffic forecasting , an increase of the outcome traffic flow in a given neighborhood may result in an increase of the income traffic flow on another one . Modelling these dependencies may improve the forecasting accuracy , but it may come at a cost of higher complexity and hence more expensive algorithms , specially when trying to model all pairwise interactions between variates . 2.2 GRAPH NEURAL NETWORKS . Graph Neural Networks ( GNNs ) ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) operate directly on graph structured data . They have gained a lot of attention in the last years due to their success in a large variety of domains which benefit from modelling interactions between different nodes/entities . In the context of multivariate time series , GNNs can be used to model the interactions between time series . In this work we consider the type of GNN introduced by ( Gilmer et al. , 2017 ) . Given a graph G = ( V , E ) with nodes vi 2 V and edges eij 2 E , we define a graph convolutional layer as : mij = e ( h l i , h l j ) mi = X j2N ( i ) ↵ijmij h l+1 i = h ( h l i , mi ) ( 3 ) Where e and h are the edge and node functions , usually approximated as Multi Layer Perceptrons ( MLPs ) , hli 2 Rnf is the nf-dimensional embedding of a node vi at layer l and mij is the edge embedding that propagates information from node vj to vi . A GNN is constructed by stacking multiple of these Graph Convolutional Layers hl+1 = GCL [ hl , E ] . Additionally , in Equation 3 we include ↵ij 2 ( 0 , 1 ) which is a scalar value that performs the edge inference or attention over the neighbors similarly to Veličković et al . ( 2017 ) . As done in ( Satorras et al. , 2021 ) , we choose this value to be computed as the output of a function ↵ij = ↵ ( mij ) where ↵ is composed of just a linear layer followed by a sigmoid activation function . 3 RELATED WORK . Time series forecasting has been extensively studied in the past due to its practical significance with a number of recent overview articles available ( et al. , 2020 ; Benidis et al. , 2020 ; Lim and Zohren , 2021 ) . Traditionally , most classical methods are univariate in nature ( see e.g. , Hyndman and Athanasopoulos ( 2017 ) for an overview ) . While some of these have multi-variate extensions ( e.g. , ARMA and VARMA models ) , they are limited by the amount of related time series information they can incorporate . Dynamic factor models ( Geweke , 1977 ; Wang et al. , 2019a ) are fore-runners of a family of models that has recently received more attention , the so-called global models ( Januschowski et al. , 2019 ; Montero-Manso and Hyndman , 2022 ) . These global models estimate their parameters over an entire panel of time series , so thereby taking advantage of cross time series learning , but still produce a univariate forecast . Many such global models have been proposed building on the main neural network architectures like RNNs ( Salinas et al. , 2020 ; Liberty et al. , 2020 ; Bandara et al. , 2019 ) , CNNs ( Wen et al. , 2017 ; Chen et al. , 2020b ) , Transformers ( Li et al. , 2019 ; Lim et al. , 2021 ; Eisenach et al. , 2020 ) and also combining classical probabilistic models with deep learning ( Rangapuram et al. , 2018 ; Kurle et al. , 2020 ; de Bézenac et al. , 2020 ) . However , these global models do not explicitly model the relationship between the time series in the panel . Most recently , global multi-variate forecasting models have received attention , in particular models that attempt to capture the relationship of the time series via a multi-variate likelihood ( Rasul et al. , 2020 ; 2021 ; de Bézenac et al. , 2020 ; Salinas et al. , 2019 ) . Here , we attempt to capture the multivariate nature of many modern forecasting problems primarily by using a multi-variate time series as input . For this , a natural way to model and exploit the relationship between time series is via Graph Neural Networks ( Bruna et al. , 2013 ; Defferrard et al. , 2016 ; Kipf and Welling , 2016 ) which have been successfully applied to a wide variety of deep learning domains where exploiting relations between entities/nodes can benefit the prediction task . Even in those cases where edges are not explicitly provided in the dataset , attention or a latent graph can be inferred from the node embeddings such that GNNs can still leverage the structure of the data . Some examples of latent graph inference or attention are ( Wang et al. , 2019b ) in point clouds , ( Franceschi et al. , 2019 ) in semi-supervised graph classification , ( Ying et al. , 2018 ) in hierarchical graph representation learning , ( Kipf et al. , 2018 ) in modelling dynamical systems , ( Kazi et al. , 2020 ) in zero-shot learning and 3D point cloud segmentation , ( Garcia and Bruna , 2017 ; Kossen et al. , 2021 ) in image classification , ( Cranmer et al. , 2020 ) in inferring symbolic representations and ( Fuchs et al. , 2020 ; Satorras et al. , 2021 ) in molecular property prediction . In Multivariate Time Series ( MTS ) forecasting we can leverage dependencies between time series by exchanging information among them . Lai et al . ( 2018 ) ; Shih et al . ( 2019 ) are some of the first deep learning approaches designed to exploit those pair-wise dependencies . More recent methods , ( Li et al. , 2017 ; Yu et al. , 2017 ; Seo et al. , 2018 ; Zhao et al. , 2019 ) are built in the intersection of Graph Neural Networks and time series forecasting but they require a pre-defined adjacency matrix . Lately , new methods that infer a latent graph from the node embeddings have been introduced in MTS forecasting ( Wu et al. , 2020 ; Shang et al. , 2021 ; Cao et al. , 2021 ) , and in MTS anomaly detection ( Zhang et al. , 2020 ; Deng and Hooi , 2021 ) . These methods can be applied to any dataset even when there is not an explicitly defined adjacency matrix . But this comes with a limitation , inferring the edges can be expensive since those scale quadratically O ( N2 ) w.r.t the number of nodes/variables N or O ( N3 ) in ( Cao et al. , 2021 ) . Our approach is related to ( Wu et al. , 2020 ; Shang et al. , 2021 ) , but in contrast a ) Our latent graph is dynamically inferred for each inputted data stream instead of a static graph for the whole dataset which allows a more flexible graph representation . b ) It is modular since it can be added as an extension to standard univariate methods after encoding the input signal xt0 : t , this also makes the graph operation cheaper since the message exchange is only done at time step t. c ) Optionally reduces the number of edges from O ( N2 ) to O ( NK ) where K ⌧ N with the bipartite assumption . | This paper presents a method to combine information of multivariate time series by extending univariate architectures. The technique uses a graph representation to represent interactions by assuming a bipartite structure, which allows the technique to scale the representation to reduce the complexity from $O(N^2)$ to $O(N K)$ using K additional nodes. The architecture represents each time series as one of N nodes and associate K embeddings (nodes) and thus there are connections between the N nodes and the K nodes but not within each group of nodes. The architecture encodes the confounders, co-linearities, and other information among the time series to improve forecasting. The experiments show the performance (and time efficiency) of the technique against several baselines on METR-LA and PEMS-BAY datasets. The experiments also show the performance on single-step forecasting on four publicly available datasets. Finally, synthetic datasets were used to evaluate the adjacency matrices in control scenarios. | SP:fb6ceb7cc788fb39fbe67529b2c4401f51fd74cb |
FCause: Flow-based Causal Discovery | 1 INTRODUCTION . Understanding causal relationships between variables is crucial in many applications , including biology ( Koller & Friedman , 2009 ; Sachs et al. , 2005 ) , economics ( Varian , 2016 ; Cunningham , 2020 ) , and healthcare ( Tu et al. , 2019 ) . In addition , such information can also be used to advance other machine learning domains , such as fairness ( Kusner et al. , 2017 ; Chiappa , 2019 ) , privacy ( Tople et al. , 2020 ; Chandrasekaran et al. , 2021 ) and robustness ( Arjovsky et al. , 2019 ; Zhang et al. , 2020 ; Zheng et al. , 2021 ) . In practice , however , we often do not have a priori knowledge of causal relationships . We can gain this knowledge experimentally , e.g. , through randomized control trials ( Hariton & Locascio , 2018 ) , but experiments are sometimes cost-prohibitive or unethical . In such cases , causal discovery , the task of learning the causal relationships from existing data is essential . While causal discovery methods have been studied for decades , classical approaches tend to have scaling issues and rely on domain-specific assumptions . Recent advances in causal discovery use continuous optimization methods to overcome the scalability issues in classical approaches ( Zheng et al. , 2018 ; 2020 ) . They frame the combinatorial optimization problem of learning a directed acyclic graph ( DAG ) as a smooth optimization problem under constraints , allowing the use of efficient algorithms for continuous optimization . In addition to scalability advantages , this represents a first step in bridging the gap between deep learning and causal discovery . However , continuous optimization-based causal discovery remains experimental . These methods can not handle datasets with missing values and suffer from simple distributional assumptions , making performance sensitive to changes in the dataset ’ s scale ( Reisach et al. , 2021 ; Kaiser & Sipos , 2021 ) . These limitations directly impact these methods ’ reliability and applicability . In contrast , when the causal graph—the structure but not functional forms of causal relationships—is already known , causal-aware ( Bayesian ) deep learning methods have many application advantages . One recent framework , Carefl ( Khemakhem et al. , 2021 ) , fits an autoregressive flow model using the variables ’ causal ordering for the autoregressive transformations . This yields a model that can be used to answer complex causal queries , such as counterfactuals . Its performance for end-toend causal discovery , however , is limited by its reliance on classical causal discovery methods for inferring causal structures , the cost of fitting several flow-based models , and an inability to handle datasets with missing values . In this work , we show how continuous optimization methods can be combined with flow-based models to address these deficiencies . We propose FCause , an efficient flow-based causal discovery method able to capture complex nonlinear relations between variables , robust to data scaling , and able to handle datasets with missing values ( missing at random ) . FCause uses powerful flow-based models to capture complex relationships between variables ( Khemakhem et al. , 2021 ) , performs efficient causal discovery using ideas from continuous optimization-based causal discovery methods ( Zheng et al. , 2018 ) , and handles partially-observed datasets using amortized approximate inference to estimate distributions over missing values ( Kingma & Welling , 2013 ) . In section 6 , we perform extensive empirical evaluations of FCause , and observe that it achieves state-of-the-art results on multiple causal discovery benchmarks , and that its performance is robust with respect to changes in the scaling of the data ( e.g. , standardized data or not ) . In addition , FCauseremains competitive when used on datasets with 30 % of missing values , even comparing against baselines used on the corresponding fully-observed dataset . Finally , we present a unified formulation of several continuous optimization-based causal discovery algorithms based on flow-based models ( Khemakhem et al. , 2021 ) . This unified perspective facilitates the development of general new techniques to improve these methods , and allows a simple comparison between methods , shedding light on the benefits and drawbacks of each one . 2 RELATED WORK . Approaches for causal discovery from observational data can be classified into three broad groups : constraint-based , score-based and functional causal models ( Glymour et al. , 2019 ) . Constraint-based methods employ conditional independence tests to discover the underlying causal structure ( Spirtes & Glymour , 1991 ; Spirtes et al. , 2000 ) . Score-based methods find a causal structure by optimizing a score function ( Chickering & Meek , 2015 ; Chickering , 2020 ) . Functional causal models represent each variable as a function of its direct causes and some noise term ( Shimizu et al. , 2006 ; Hoyer et al. , 2008 ) . Classical causal discovery methods in these groups often struggle to scale to high dimensions , as the combinatorial space of possible causal orderings among variables grows superexponentially ( Peters et al. , 2017 ) . Thus , scalable causal discovery algorithms tend to reduce the search space through reliance on domain-specific assumptions . Recently , Zheng et al . ( 2018 ) introduced Notears , a new family of score-based method based on continuous optimization . Notears uses a novel algebraic characterization of directed acyclic graphs ( DAG ) , which allows an equality-constrained optimization problem to jointly learn the model parameters and adjacency relationships between variables . Notears inspired the development of other methods , Notears-MLP and Notears-Sob ( Zheng et al. , 2020 ) , Grandag ( Lachapelle et al. , 2019 ) , and DAG-GNN ( Yu et al. , 2019 ) , which extend the original formulation to model nonlinear relationships between variables . The methods ’ main benefits are its scalability and simplicity , a consequence of the fact that standard numerical solvers can be used to solve the resulting optimization problem . However , they have often been observed to be sensitive to different data scalings ( Kaiser & Sipos , 2021 ) , and can not handle missing values . Additionally , normalizing flows ( Rezende & Mohamed , 2015 ) have been used to build causal aware models ( Cai et al. , 2018 ; Khemakhem et al. , 2021 ) . These are based on the fact that the variables ’ causal ordering can be used for the transformations used by autoregressive flows ( Kingma et al. , 2016 ; Huang et al. , 2018 ) .1 These methods are able to model complex nonlinear relationships between variables . However , they rely on prior traditional methods or local search algorithms for causal discovery . Specifically , Self ( Cai et al. , 2018 ) uses a hill climbing procedure , and Carefl ( Khemakhem et al. , 2021 ) proposes to use a constraint-based method ( e.g . PC ) to find the graphs skeleton with as many oriented edges as possible and to fit several flow models to determine the orientation of the remaining edges . Apart from aforementioned methods , causal aware deep learning models have , in general , shown better properties regarding generalization and robustness ( Arjovsky et al. , 2019 ; Zhang et al. , 2020 ; Kyono et al. , 2020 ; Tople et al. , 2020 ) . 3 PRELIMINARIES . In this section , we describe the representations of causal relationships ( SEM and DAGs ) and explain how causal discovery can be formulated as an optimization task . We bring these components together when we introduce FCause in section 4 . 1While the formal connection to a restricted type of autoregressive flows was proposed by ( Khemakhem et al. , 2021 ) , some previous methods ( Mooij et al. , 2011 ; Cai et al. , 2018 ) use closely related ideas . Causal graphical models ( Peters et al. , 2017 ) are widely used to represent causal relationships between variables . Each variable is assigned a node in a graph ( typically a DAG ) , and causal relationships are represented as directed edges between nodes . These models are encoded using the graph ’ s adjacency matrix A ∈ { 0 , 1 } d×d , where d is the number of variables , or by explicitly stating the set of parents for each variables . If each of the edges is additionally assigned a weight , a weighted adjacency matrix is used W ∈ Rd×d instead . Here , zero entries indicate the absence of an edge , and non-zero entries indicate the presence of an edge with the corresponding weight . Structural Equation Models ( SEM ) are commonly used to describe a causal system . They characterize the value of a variable as a function of its causal parents and some external noise . Let x = [ x1 , . . . , xd ] represent d causally related variables , A ∈ { 0 , 1 } d×d the binary adjacency matrix between variables , and z = [ z1 , . . . , zd ] pairwise independent random noise . SEMs model each variable as xi = fi ( xpa ( i ) , zi ) , where fi a scalar function and xpa ( i ) = { xj : Aj , i = 1 } represents the set of parents of xi according to A . Additive Noise Models ( ANM ) represent a specific type of SEM for which the noise is additive : xi = fi ( xpa ( i ) ) + zi , i = 1 , . . . , d. ( 1 ) Equivalently , given a fixed adjacency matrix A , these d equations can be expressed jointly as x = fA ( x ) + z , ( 2 ) where fA ( x ) outputs a d-dimensional vector whose i-th component is given by fi ( xpa ( i ) ) . This is one of the most common functional forms in causal discovery . A crucial question regarding ANMs involves the identifiability of the underlying causal graph under observational data . Can the true adjacency matrix be recovered in the limit of infinite data ? Hoyer et al . ( 2008 ) showed that it is possible except when the underlying system is a combination of linear functions with Gaussian noise . In this work , we assume that the underlying functions are nonlinear without any specific assumption on their functional form . In this setting , the causal graph can be identified . A new algebraic characterization of DAGs was recently proposed by Zheng et al . ( 2018 ) . They showed that , given a weighted adjacency matrix W ∈ Rd×d , the quantity h ( W ) = tr ( eW W ) − d ( 3 ) is non-negative , and zero if and only if W represents a DAG . Since its introduction , this algebraic characterization of DAGs has been widely used to frame causal discovery problems with ANMs as continuous optimization tasks ( Zheng et al. , 2018 ; 2020 ; Lachapelle et al. , 2019 ) . All these methods propose to train a model ’ s parameters θ by maximizing a score subject to the constraint h ( W ( θ ) ) = 0 , whereW ( θ ) represents the weighted adjacency matrix as a function of the parameters θ . Due to the non-convexity of the set { θ : h ( W ( θ ) ) = 0 } , these methods use h ( W ( θ ) ) as a penalty term added to the loss , whose weight is increased as optimization proceeds . | This paper proposes a general flow-based approach to learn DAGs from data which provides a unified view of existing continuous optimization methods for structure learning. As a side benefit, the authors demonstrate that the proposed method could naturally be modified to handle missing data. The authors provide empirical studies to show that their proposed method outperforms the other baselines. | SP:0fd58ad8e49120d88bdf5fe2b7c0b6cf8d11b789 |
FCause: Flow-based Causal Discovery | 1 INTRODUCTION . Understanding causal relationships between variables is crucial in many applications , including biology ( Koller & Friedman , 2009 ; Sachs et al. , 2005 ) , economics ( Varian , 2016 ; Cunningham , 2020 ) , and healthcare ( Tu et al. , 2019 ) . In addition , such information can also be used to advance other machine learning domains , such as fairness ( Kusner et al. , 2017 ; Chiappa , 2019 ) , privacy ( Tople et al. , 2020 ; Chandrasekaran et al. , 2021 ) and robustness ( Arjovsky et al. , 2019 ; Zhang et al. , 2020 ; Zheng et al. , 2021 ) . In practice , however , we often do not have a priori knowledge of causal relationships . We can gain this knowledge experimentally , e.g. , through randomized control trials ( Hariton & Locascio , 2018 ) , but experiments are sometimes cost-prohibitive or unethical . In such cases , causal discovery , the task of learning the causal relationships from existing data is essential . While causal discovery methods have been studied for decades , classical approaches tend to have scaling issues and rely on domain-specific assumptions . Recent advances in causal discovery use continuous optimization methods to overcome the scalability issues in classical approaches ( Zheng et al. , 2018 ; 2020 ) . They frame the combinatorial optimization problem of learning a directed acyclic graph ( DAG ) as a smooth optimization problem under constraints , allowing the use of efficient algorithms for continuous optimization . In addition to scalability advantages , this represents a first step in bridging the gap between deep learning and causal discovery . However , continuous optimization-based causal discovery remains experimental . These methods can not handle datasets with missing values and suffer from simple distributional assumptions , making performance sensitive to changes in the dataset ’ s scale ( Reisach et al. , 2021 ; Kaiser & Sipos , 2021 ) . These limitations directly impact these methods ’ reliability and applicability . In contrast , when the causal graph—the structure but not functional forms of causal relationships—is already known , causal-aware ( Bayesian ) deep learning methods have many application advantages . One recent framework , Carefl ( Khemakhem et al. , 2021 ) , fits an autoregressive flow model using the variables ’ causal ordering for the autoregressive transformations . This yields a model that can be used to answer complex causal queries , such as counterfactuals . Its performance for end-toend causal discovery , however , is limited by its reliance on classical causal discovery methods for inferring causal structures , the cost of fitting several flow-based models , and an inability to handle datasets with missing values . In this work , we show how continuous optimization methods can be combined with flow-based models to address these deficiencies . We propose FCause , an efficient flow-based causal discovery method able to capture complex nonlinear relations between variables , robust to data scaling , and able to handle datasets with missing values ( missing at random ) . FCause uses powerful flow-based models to capture complex relationships between variables ( Khemakhem et al. , 2021 ) , performs efficient causal discovery using ideas from continuous optimization-based causal discovery methods ( Zheng et al. , 2018 ) , and handles partially-observed datasets using amortized approximate inference to estimate distributions over missing values ( Kingma & Welling , 2013 ) . In section 6 , we perform extensive empirical evaluations of FCause , and observe that it achieves state-of-the-art results on multiple causal discovery benchmarks , and that its performance is robust with respect to changes in the scaling of the data ( e.g. , standardized data or not ) . In addition , FCauseremains competitive when used on datasets with 30 % of missing values , even comparing against baselines used on the corresponding fully-observed dataset . Finally , we present a unified formulation of several continuous optimization-based causal discovery algorithms based on flow-based models ( Khemakhem et al. , 2021 ) . This unified perspective facilitates the development of general new techniques to improve these methods , and allows a simple comparison between methods , shedding light on the benefits and drawbacks of each one . 2 RELATED WORK . Approaches for causal discovery from observational data can be classified into three broad groups : constraint-based , score-based and functional causal models ( Glymour et al. , 2019 ) . Constraint-based methods employ conditional independence tests to discover the underlying causal structure ( Spirtes & Glymour , 1991 ; Spirtes et al. , 2000 ) . Score-based methods find a causal structure by optimizing a score function ( Chickering & Meek , 2015 ; Chickering , 2020 ) . Functional causal models represent each variable as a function of its direct causes and some noise term ( Shimizu et al. , 2006 ; Hoyer et al. , 2008 ) . Classical causal discovery methods in these groups often struggle to scale to high dimensions , as the combinatorial space of possible causal orderings among variables grows superexponentially ( Peters et al. , 2017 ) . Thus , scalable causal discovery algorithms tend to reduce the search space through reliance on domain-specific assumptions . Recently , Zheng et al . ( 2018 ) introduced Notears , a new family of score-based method based on continuous optimization . Notears uses a novel algebraic characterization of directed acyclic graphs ( DAG ) , which allows an equality-constrained optimization problem to jointly learn the model parameters and adjacency relationships between variables . Notears inspired the development of other methods , Notears-MLP and Notears-Sob ( Zheng et al. , 2020 ) , Grandag ( Lachapelle et al. , 2019 ) , and DAG-GNN ( Yu et al. , 2019 ) , which extend the original formulation to model nonlinear relationships between variables . The methods ’ main benefits are its scalability and simplicity , a consequence of the fact that standard numerical solvers can be used to solve the resulting optimization problem . However , they have often been observed to be sensitive to different data scalings ( Kaiser & Sipos , 2021 ) , and can not handle missing values . Additionally , normalizing flows ( Rezende & Mohamed , 2015 ) have been used to build causal aware models ( Cai et al. , 2018 ; Khemakhem et al. , 2021 ) . These are based on the fact that the variables ’ causal ordering can be used for the transformations used by autoregressive flows ( Kingma et al. , 2016 ; Huang et al. , 2018 ) .1 These methods are able to model complex nonlinear relationships between variables . However , they rely on prior traditional methods or local search algorithms for causal discovery . Specifically , Self ( Cai et al. , 2018 ) uses a hill climbing procedure , and Carefl ( Khemakhem et al. , 2021 ) proposes to use a constraint-based method ( e.g . PC ) to find the graphs skeleton with as many oriented edges as possible and to fit several flow models to determine the orientation of the remaining edges . Apart from aforementioned methods , causal aware deep learning models have , in general , shown better properties regarding generalization and robustness ( Arjovsky et al. , 2019 ; Zhang et al. , 2020 ; Kyono et al. , 2020 ; Tople et al. , 2020 ) . 3 PRELIMINARIES . In this section , we describe the representations of causal relationships ( SEM and DAGs ) and explain how causal discovery can be formulated as an optimization task . We bring these components together when we introduce FCause in section 4 . 1While the formal connection to a restricted type of autoregressive flows was proposed by ( Khemakhem et al. , 2021 ) , some previous methods ( Mooij et al. , 2011 ; Cai et al. , 2018 ) use closely related ideas . Causal graphical models ( Peters et al. , 2017 ) are widely used to represent causal relationships between variables . Each variable is assigned a node in a graph ( typically a DAG ) , and causal relationships are represented as directed edges between nodes . These models are encoded using the graph ’ s adjacency matrix A ∈ { 0 , 1 } d×d , where d is the number of variables , or by explicitly stating the set of parents for each variables . If each of the edges is additionally assigned a weight , a weighted adjacency matrix is used W ∈ Rd×d instead . Here , zero entries indicate the absence of an edge , and non-zero entries indicate the presence of an edge with the corresponding weight . Structural Equation Models ( SEM ) are commonly used to describe a causal system . They characterize the value of a variable as a function of its causal parents and some external noise . Let x = [ x1 , . . . , xd ] represent d causally related variables , A ∈ { 0 , 1 } d×d the binary adjacency matrix between variables , and z = [ z1 , . . . , zd ] pairwise independent random noise . SEMs model each variable as xi = fi ( xpa ( i ) , zi ) , where fi a scalar function and xpa ( i ) = { xj : Aj , i = 1 } represents the set of parents of xi according to A . Additive Noise Models ( ANM ) represent a specific type of SEM for which the noise is additive : xi = fi ( xpa ( i ) ) + zi , i = 1 , . . . , d. ( 1 ) Equivalently , given a fixed adjacency matrix A , these d equations can be expressed jointly as x = fA ( x ) + z , ( 2 ) where fA ( x ) outputs a d-dimensional vector whose i-th component is given by fi ( xpa ( i ) ) . This is one of the most common functional forms in causal discovery . A crucial question regarding ANMs involves the identifiability of the underlying causal graph under observational data . Can the true adjacency matrix be recovered in the limit of infinite data ? Hoyer et al . ( 2008 ) showed that it is possible except when the underlying system is a combination of linear functions with Gaussian noise . In this work , we assume that the underlying functions are nonlinear without any specific assumption on their functional form . In this setting , the causal graph can be identified . A new algebraic characterization of DAGs was recently proposed by Zheng et al . ( 2018 ) . They showed that , given a weighted adjacency matrix W ∈ Rd×d , the quantity h ( W ) = tr ( eW W ) − d ( 3 ) is non-negative , and zero if and only if W represents a DAG . Since its introduction , this algebraic characterization of DAGs has been widely used to frame causal discovery problems with ANMs as continuous optimization tasks ( Zheng et al. , 2018 ; 2020 ; Lachapelle et al. , 2019 ) . All these methods propose to train a model ’ s parameters θ by maximizing a score subject to the constraint h ( W ( θ ) ) = 0 , whereW ( θ ) represents the weighted adjacency matrix as a function of the parameters θ . Due to the non-convexity of the set { θ : h ( W ( θ ) ) = 0 } , these methods use h ( W ( θ ) ) as a penalty term added to the loss , whose weight is increased as optimization proceeds . | This paper proposes to combine the continuous optimization-based causal discovery approach from notears with flow-based function learning. An extension is given to data missing (completely) at random. Also, a unifying framework is presented facilitating the comparison and exchange of ideas between different continuous optimization-based causal discovery methods, viewing all in terms of flows. | SP:0fd58ad8e49120d88bdf5fe2b7c0b6cf8d11b789 |
Newer is not always better: Rethinking transferability metrics, their peculiarities, stability and performance | 1 INTRODUCTION . Transfer learning ( TL ) is a set of techniques of using abundant somewhat related source data p ( X ( s ) , Y ( s ) ) to ensure that a model can generalize well to the target domain , defined as either little amount of labelled data p ( X ( t ) , Y ( t ) ) ( supervised ) , and/or a lot of unlabelled data p ( X ( t ) ) ( unsupervised TL ) . TL is most commonly achieved either via fine-tuning or co-training . Fine-tuning ( FT ) is a process of adapting a model trained on source data by using target data to do several optimization steps ( for example , SGD ) that update the model parameters . Co-training on source and target data usually involves reweighting the instances in some way or enforcing domain irrelevance on feature representation layer , such that the model trained on such combined data works well on target data . Fine-tuning is becoming increasing popular because large models like ImageNet ( Krizhevsky et al. , 2012 ) , Bert ( Devlin et al. , 2018 ) etc . are released by companies and are easily modifiable . Training such large models from scratch is often prohibitively expensive for the end user . In this paper , we are primarily interested in effectively measuring transferability before training of the final model begins . Given a source data/model , a transferability measure ( TM ) quantifies how much knowledge of source domain/model is transferable to the target model . Transferability measures ( TMs ) are important for various reasons : they allow understanding of relationships between different learning tasks , selection of highly transferable tasks for joint training on source and target domains , selection of optimal pre-trained source models for the relevant target task , prevention of trial procedures attempting to transfer from each source domain and optimal policy learning in reinforcement learning scenarios ( e.g . optimal selection of next task to learn by a robot ) . If a measure is capable of efficiently and accurately measuring transferability across arbitrary tasks , the problem of task transfer learning is greatly simplified by using the measure to search over candidate transfer sources and targets . Contributions We study both supervised and unsupervised TMs in the context of FT. For supervised TMs , our contributions are three-fold : 1 . We show that H-score , commonly used as a baseline for newer supervised TMs , suffers from instability due to poor estimation of covariance matrices . We propose shrinkage-based estimation of H-score with regularized covariance estimation techniques from statistical literature . We show 80 % absolute increase over the original H-score and show superior performance in 9/15 cases against all newer TMs across various FT scenarios . 2 . We present a fast implementation of our estimator that is 3− 55 times faster than state-of-the-art LogME measure . Unlike LogME , our optimized implementation for our estimator is tractable even for really high-dimensional feature embeddings ∼ 105 . 3 . We identify problems with 3 other supervised TMs ( NCE , LEEP and NLEEP ) in target task selection when either the number of target classes or the class imbalance varies across candidate target tasks . We propose measuring correlation against relative target accuracy ( instead of vanilla accuracy ) in such scenarios . For unsupervised TMs , we outline computational challenges and propose dimensionality reduction methods for better estimation and effective comparison of such measures when the feature dimensions are large and/or different across various source models . We show that with our proposed modifications , even unsupervised TMs can be effective in identifying the best source ImageNet model . Our large set of 65,000 FT experiments with multiple ImageNet models and different regimes generated from CIFAR-100 and CIFAR-10 image datasets shows usefulness of our proposals . This paper is organized as follows . Section 2 describes general FT regimes and transfer learning tasks . Section 3 discusses supervised TM and addresses shortcomings of the pioneer TM ( H-Score ) that arise due to limited target data ( subsection 3.1 ) . In subsection 3.2 we demonstrate problems with recent NCE , LEEP and NLEEP metrics and propose a way to address them . Section 4 highlights shortcomings of different commonly used unsupervised measures for source selection and proposes alternatives that offer improvements . Finally , Section 5 presents a meta study of all metrics . 2 TRANSFERABILITY SETUP . We consider the following FT scenarios based on existing literature . ( i ) Source Model Selection ( SMS ) : For a particular target data/task , this regime aims to select the “ optimal ” source model ( or data ) to transfer-learn from , from a collection of candidate models/data . ( ii ) Target Task Selection ( TTS ) : For a particular ( source ) model , this regime aims to find the most related target data/task . In addition , we primarily consider two different FT strategies : ( i ) Linear FT/head only FT : All layers except for the penultimate layer are frozen . Only the weights of the head classifier are re-trained while fine-tuning . ( ii ) Nonlinear FT : Any arbitrary layer can be designated as a feature extractor , up to which all the layers are frozen ; the subsequent layers include nonlinear transformations and are re-trained along with the head on target data . 3 SUPERVISED TRANSFERABILITY MEASURES . Related Work Recent literature in transfer learning has proposed computationally efficient TMs . We categorize measures that require target labels as supervised TMs . Inspired by principles in information theory , Negative Conditional Entropy ( NCE ) Tran et al . ( 2019 ) uses pre-trained source model and evaluates conditional entropy between target pseudo labels ( source models ’ assigned labels ) and real target labels . Log Expected Empirical Predictor ( LEEP ) ( Nguyen et al. , 2020 ) modifies NCE by using soft predictions from the source model . Both NCE and LEEP do not directly use feature information , hence they are not applicable for layer selection . Cui et al . ( 2018 ) propose representing each output class by the mean of all images from that class and computing Earth Mover ’ s distance between the centroids of the source classes and target classes . Bao et al . ( 2019 ) ; Li et al . ( 2021 ) ; Huang et al . ( 2021 ) ; You et al . ( 2021 ) ; Deshpande et al . ( 2021 ) proposed metrics that capture information from both the ( learnt ) feature representations and the real target labels . These metrics are more appealing as these can be broadly applicable for models that are pre-trained in either supervised or unsupervised fashion . Li et al . ( 2021 ) proposed NLEEP that fits a Gaussian mixture model on the target feature embeddings and computes the LEEP score between the probabalistic assignment of target features to different clusters and the target labels . Huang et al . ( 2021 ) proposed TransRate — a computationally-friendly surrogate of mutual information ( using coding rate ) between the target feature embeddings and the target labels . Bao et al . ( 2019 ) introduced H-score that takes into account inter-class feature variance and feature redundancy . You et al . ( 2021 ) proposed LogME that considers an optimization problem rooted in Bayesian statistics to maximize the marginal likelihood under a linear classifier head . Deshpande et al . ( 2021 ) introduced LFC to measure in-class similarity of target feature embeddings across samples . Finally , Tan et al . ( 2021 ) used Optimal Transport to evaluate domain distance , and combined it , via a linear combination , with NCE . To learn such a measure , a portion of target tasks were set aside , the models were transferred onto these tasks and the results were used to learn the coefficients for the combined Optimal Transport based Conditional Entropy ( OTCE ) metric . While the resulting metric appears to be superior over other non-composite metrics like H-score and LEEP , it is expensive to compute since it requires finding the appropriate coefficients for the combination . Additionally , our results indicate that both components of the measure seem to be individually sub-optimal in measuring transferability against corresponding supervised and unsupervised measures . 3.1 IMPROVED ESTIMATION OF H-SCORE FOR LIMITED TARGET DATA . H-score ( Bao et al. , 2019 ) is one of the pioneer measures that is often used as a baseline for newer supervised TMs , which often demonstrate the improved performance . It characterizes discriminatory strength of feature embedding for classification : H ( f ) = tr ( Σ ( f ) −1 Σ ( z ) ) ( 1 ) where , d is the embedding dimension , fi = h ( x ( t ) i ) ∈ Rd is the target feature embeddings when the feature extractor ( h : Rp → Rd ) from the source model is applied to the target sample x ( t ) i ∈ Rp , F ∈ Rnt×d denotes the corresponding target feature matrix , Y = Y ( t ) ∈ Y = { 1 , · · · , C } are the target data labels , Σ ( f ) ∈ Rd×d denotes the sample feature covariance matrix of f , z = E [ f |Y ] ∈ Rd and Z ∈ Rnt×d denotes the corresponding target conditioned feature matrix , Σ ( z ) ∈ Rd×d denotes the sample covariance matrix of z . Intuitively , H ( f ) captures the notion that higher interclass variance and small feature redundancy results in better transferability . We hypothesize that the sub-optimal performance of H-Score ( compared to that of more recent metrics ) for measuring transferability in many of the evaluation cases , e.g. , in ( Nguyen et al. , 2020 ) , is due to lack of robust estimation of H-Score — see Fig . 1 for a synthetic example showing the non-reliability of empirical H-score over various sample sizes when compared with its population version . Given that many of the deep learning models in the context of TL have high-dimensional feature embedding space — typically larger than the number of target samples — the estimation of the two covariance matrices in H-score becomes challenging : the sample covariance matrix of the feature embedding has a large condition number1 in small data regimes . In many cases , it can not even be inverted . Bao et al . ( 2019 ) used a pseudo-inverse of the covariance matrix Σ ( f ) . However , this method of estimating a precision matrix can be sub-optimal as inversion can amplify estimation error ( Ledoit & Wolf , 2004 ) . We propose to use well-conditioned shrinkage estimators motivated by the rich literature in statistics on the estimation of high-dimensional covariance ( and precision ) matrices ( Pourahmadi , 2013 ) . We show that the use of such shrinkage estimators can offer significant gain in the performance of H-score in predicting transferability . In many cases , as our experiments show , the gain is so significant that H-score becomes a leading TM , surpassing the performance of state-of-the-art measures . 1Condition number of a positive semidefinite matrix A , is the ratio of its largest and smallest eigenvalues . Proposed Transferability Measure We propose the following shrinkage based H-score : Hα ( f ) = tr ( Σ ( f ) −1 α · ( 1− α ) Σ ( z ) ) , ( 2 ) Estimating Σ ( f ) α While there are several possibilities to obtain a regularized covariance matrix ( Pourahmadi , 2013 ) , we present an approach that considers a linear operation on the eigenvalues of the sample version of the feature embedding covariance matrix . Similar ideas of using well-conditioned plug-in covariance matrices are used in the context of discriminant analysis ( Hastie et al. , 2001 ) . In particular , we improve the conditioning of the covariance matrix by considering its weighted convex combination with a scalar multiple of the identity matrix : Σ ( f ) α = ( 1− α ) Σ ( f ) + ασId ( 3 ) where α ∈ [ 0 , 1 ] is the shrinkage parameter and σ is the average variance computed as tr ( Σ ( f ) ) /d . The linear op- eration on the eigenvalues ensures the covariance estimator is positive definite . Note that the inverse of Σ ( f ) α can be computed for every α , by using the eigen-decomposition of Σ ( f ) . The shrinkage parameter controls the bias and variance trade-off ; the optimal α needs to be selected . This distribution-free estimator is well-suited for our application as the explicit convex linear combination is easy to compute and makes the covariance estimates well-conditioned and more accurate ( Ledoit & Wolf , 2004 ; Chen et al. , 2010 ; Schäfer & Strimmer , 2005 ) . Understanding ( 1−α ) Σ ( z ) The scaling factor ( 1− α ) can be understood in terms of regularized covariance matrix estimation under a ridge penalty : 1/ ( 1 + λ ) ·Σ ( z ) = argminΣ̂ ||Σ̂−Σ ( z ) ||22 + λ||Σ̂||22 ( 4 ) where λ ≥ 0 is the ridge penalty . Choosing λ = α/ ( 1−α ) , it becomes clear that ( 1−α ) Σ ( z ) is the regularized covariance matrix . Choice of α Ledoit & Wolf ( 2004 ) proposed a covariance matrix estimator that minimizes mean squared error loss between the shrinkage based covariance estimator and the true covariance matrix . The optimization with respect to α considers the following objective : minα , v E [ ||Σ∗ −Σ||2 ] s.t . Σ∗ = ( 1− α ) Σ ( f ) + αvI , E [ Σ ( f ) ] = Σ . ( 5 ) where ‖A‖2 = tr ( AAT ) /d . This optimization problem permits a closed-form solution for the optimal shrinkage parameter , which is given by : α∗ = E [ ||Σ ( f ) −Σ||2 ] / E [ ||Σ ( f ) − ( tr ( Σ ) /d ) · Id||2 ] ( 6 ) ' min { ( 1/n2t ) ∑ i∈ [ nt ] ||fifTi −Σ ( f ) ||2 / ||Σ ( f ) − ( tr ( Σ ( f ) ) /d ) · Id||2 , 1 } . ( 7 ) where ( 7 ) defines a valid estimator ( not dependent on true covariance matrix ) for practical use . For proof , we refer the readers to Section 2.1 and 3.3 in Ledoit & Wolf ( 2004 ) . We provide some additional discussion on why same α is used for the two regularized covariance matrices in shrinkagebased H-Score in Supplement Section S2.1 . We provide validation of shrinkage-based estimation of H-Score on synthetic classification data . We generated 1 million 1000-dimensional features with 10 classes using Sklearn multi-class dataset generation function ( Pedregosa et al. , 2011 ) . Number of informative features is set to 500 with rest filled with random noise . We visualize the original and the population version of the H-score and the shrinkage-based H-Score for different sample sizes in Fig . 1 . We observe that the original H-Score becomes highly unreliable as the number of samples decreases . In contrast , the shrunken estimation of H-Score is highly stable and has a small error when compared with the population H-Score . Efficient Computation for small target data For small target data ( C ≤ nt < d ) , the naive implementation of Hα ( f ) can be very slow . We propose an optimized implementation for our shrinkagebased H-Score that exploits diagonal plus low-rank structure of Σ ( f ) α for efficient matrix inversion and the low-rank structure of Σ ( z ) for faster matrix-matrix multiplications . We assume F ( and correspondingly Z ) are centered . The optimized computation of Hα ( f ) is given by : Hα ( f ) = ( 1− α ) / ( ntασ ) · ( ‖R‖2F − ( 1− α ) · vec ( G ) T vec ( W−1G ) ) , ( 8 ) whereR = [ √ n1f̄Y=1 , · · · , √ nC f̄Y=C ] ∈ Rd×C , G = FR ∈ Rnt×C , W = ntασIn +FF T ∈ Rnt×nt . The derivation is provided in the Supplement Section S2.3 . We make a timing comparison of our optimized implementation of Hα ( f ) against the computational times of the state-of-the-art LogME measure and demonstrate 3− 55 times faster computation ( see Table 6 in Section 5.3 ) . 3.2 A CLOSER LOOK AT NCE , LEEP AND NLEEP MEASURES Next , we pursue a deeper investigation of some of the newer metrics that are reported to be superior to H-Score and bring to light what appears to be some overlooked issues with these metrics in Target Task Selection ( TTS ) scenario . TTS has received less attention than Source Model Selection ( SMS ) . To our knowledge , we are the first to bring to light some problematic aspects with NCE , LEEP and NLEEP , which can potentially lead to the misuse of these metrics in measuring transferability . These measures are sensitive to the number of target classes ( C ) and tend to be smaller when C is larger ( see Fig . 2 [ Left ] ) . Therefore , use of these measures for target tasks with dif- ferent C will most likely result in selecting the task with a smaller C. However , in practice , it is not always the case that transferring to a task with a smaller C is easier ; for example , reframing a multiclass classification into a set of binary tasks can create more difficult to learn boundaries ( Friedman et al. , 2000 ) . Furthermore , the measures are also problematic if two candidate target tasks have different degree of imbalance in their classes even if C is the same . The measures would predict higher transferability for imbalanced data regimes over balanced settings ( see Fig . 2 [ Right ] ) . However , imbalanced datasets are typically harder to learn . If these measures are correlated against vanilla accuracy , which tends to be higher as the imbalance increases e.g . for binary classification , the measures would falsely suggest they are good indicators of performance . Earlier work did not consider both these aspects and erroneously showed good correlation of these metrics against vanilla accuracy to show dominance of these metrics in TTS with different C ( Nguyen et al. , 2020 ; Tan et al. , 2021 ) and imbalance ( Tan et al. , 2021 ) . Here , we propose a method to ameliorate the shortcomings of to prevent misuse of these measures , so that they lead to more reliable conclusions . We propose to standardize the metrics by the entropy of the target label priors , leading to the definitions in ( 9 ) . This standardization considers both the class imbalance as well as number of classes through the entropy of the target label priors . n-NCE def = 1 + NCE/H ( Y ) , n-LEEP def = 1 + LEEP/H ( Y ) , n-NLEEP def= 1 +NLEEP/H ( Y ) . ( 9 ) Our proposed normalizations in ( 9 ) ensures the normalized NCE is bounded between [ 0 , 1 ] . For proof , see Supplement Section S2.4 . n-NCE is in fact equivalent to normalized mutual information and has been extensively used to measure correlation between two different labelings/clustering of samples ( Vinh et al. , 2010 ) . Given the similar behavior of LEEP and NCE to different C and class imbalance as shown in Fig . 2 , we suggest the same normalization as given in ( 9 ) . However , this normalization does not ensure boundedness of n-LEEP score ( and by extension n-NLEEP ) in the range [ 0 , 1 ] as in the case of n-NCE . For scenarios where candidate target tasks have different C , we propose an alternative evaluation criteria ( relative accuracy ) instead of vanilla accuracy — see Section 5 for more details . We provide empirical validation of the proposed normalization to these measures in Table 2 in Section 5.1 . We also show that our proposed shrinkage-based H-Score is the leading metric even in these scenarios . | This paper focuses on transferability measures both in a supervised and unsupervised context. In particular, the authors propose a shrinkage-based estimation of H-score in order to correct its instability and discuss the limitations of the other approaches on two different scenarios: source model selection or target task selection. Experiments are done on these tasks on CIFAR. | SP:480a43692dce83fedcd2464b293c1481d84e8952 |
Newer is not always better: Rethinking transferability metrics, their peculiarities, stability and performance | 1 INTRODUCTION . Transfer learning ( TL ) is a set of techniques of using abundant somewhat related source data p ( X ( s ) , Y ( s ) ) to ensure that a model can generalize well to the target domain , defined as either little amount of labelled data p ( X ( t ) , Y ( t ) ) ( supervised ) , and/or a lot of unlabelled data p ( X ( t ) ) ( unsupervised TL ) . TL is most commonly achieved either via fine-tuning or co-training . Fine-tuning ( FT ) is a process of adapting a model trained on source data by using target data to do several optimization steps ( for example , SGD ) that update the model parameters . Co-training on source and target data usually involves reweighting the instances in some way or enforcing domain irrelevance on feature representation layer , such that the model trained on such combined data works well on target data . Fine-tuning is becoming increasing popular because large models like ImageNet ( Krizhevsky et al. , 2012 ) , Bert ( Devlin et al. , 2018 ) etc . are released by companies and are easily modifiable . Training such large models from scratch is often prohibitively expensive for the end user . In this paper , we are primarily interested in effectively measuring transferability before training of the final model begins . Given a source data/model , a transferability measure ( TM ) quantifies how much knowledge of source domain/model is transferable to the target model . Transferability measures ( TMs ) are important for various reasons : they allow understanding of relationships between different learning tasks , selection of highly transferable tasks for joint training on source and target domains , selection of optimal pre-trained source models for the relevant target task , prevention of trial procedures attempting to transfer from each source domain and optimal policy learning in reinforcement learning scenarios ( e.g . optimal selection of next task to learn by a robot ) . If a measure is capable of efficiently and accurately measuring transferability across arbitrary tasks , the problem of task transfer learning is greatly simplified by using the measure to search over candidate transfer sources and targets . Contributions We study both supervised and unsupervised TMs in the context of FT. For supervised TMs , our contributions are three-fold : 1 . We show that H-score , commonly used as a baseline for newer supervised TMs , suffers from instability due to poor estimation of covariance matrices . We propose shrinkage-based estimation of H-score with regularized covariance estimation techniques from statistical literature . We show 80 % absolute increase over the original H-score and show superior performance in 9/15 cases against all newer TMs across various FT scenarios . 2 . We present a fast implementation of our estimator that is 3− 55 times faster than state-of-the-art LogME measure . Unlike LogME , our optimized implementation for our estimator is tractable even for really high-dimensional feature embeddings ∼ 105 . 3 . We identify problems with 3 other supervised TMs ( NCE , LEEP and NLEEP ) in target task selection when either the number of target classes or the class imbalance varies across candidate target tasks . We propose measuring correlation against relative target accuracy ( instead of vanilla accuracy ) in such scenarios . For unsupervised TMs , we outline computational challenges and propose dimensionality reduction methods for better estimation and effective comparison of such measures when the feature dimensions are large and/or different across various source models . We show that with our proposed modifications , even unsupervised TMs can be effective in identifying the best source ImageNet model . Our large set of 65,000 FT experiments with multiple ImageNet models and different regimes generated from CIFAR-100 and CIFAR-10 image datasets shows usefulness of our proposals . This paper is organized as follows . Section 2 describes general FT regimes and transfer learning tasks . Section 3 discusses supervised TM and addresses shortcomings of the pioneer TM ( H-Score ) that arise due to limited target data ( subsection 3.1 ) . In subsection 3.2 we demonstrate problems with recent NCE , LEEP and NLEEP metrics and propose a way to address them . Section 4 highlights shortcomings of different commonly used unsupervised measures for source selection and proposes alternatives that offer improvements . Finally , Section 5 presents a meta study of all metrics . 2 TRANSFERABILITY SETUP . We consider the following FT scenarios based on existing literature . ( i ) Source Model Selection ( SMS ) : For a particular target data/task , this regime aims to select the “ optimal ” source model ( or data ) to transfer-learn from , from a collection of candidate models/data . ( ii ) Target Task Selection ( TTS ) : For a particular ( source ) model , this regime aims to find the most related target data/task . In addition , we primarily consider two different FT strategies : ( i ) Linear FT/head only FT : All layers except for the penultimate layer are frozen . Only the weights of the head classifier are re-trained while fine-tuning . ( ii ) Nonlinear FT : Any arbitrary layer can be designated as a feature extractor , up to which all the layers are frozen ; the subsequent layers include nonlinear transformations and are re-trained along with the head on target data . 3 SUPERVISED TRANSFERABILITY MEASURES . Related Work Recent literature in transfer learning has proposed computationally efficient TMs . We categorize measures that require target labels as supervised TMs . Inspired by principles in information theory , Negative Conditional Entropy ( NCE ) Tran et al . ( 2019 ) uses pre-trained source model and evaluates conditional entropy between target pseudo labels ( source models ’ assigned labels ) and real target labels . Log Expected Empirical Predictor ( LEEP ) ( Nguyen et al. , 2020 ) modifies NCE by using soft predictions from the source model . Both NCE and LEEP do not directly use feature information , hence they are not applicable for layer selection . Cui et al . ( 2018 ) propose representing each output class by the mean of all images from that class and computing Earth Mover ’ s distance between the centroids of the source classes and target classes . Bao et al . ( 2019 ) ; Li et al . ( 2021 ) ; Huang et al . ( 2021 ) ; You et al . ( 2021 ) ; Deshpande et al . ( 2021 ) proposed metrics that capture information from both the ( learnt ) feature representations and the real target labels . These metrics are more appealing as these can be broadly applicable for models that are pre-trained in either supervised or unsupervised fashion . Li et al . ( 2021 ) proposed NLEEP that fits a Gaussian mixture model on the target feature embeddings and computes the LEEP score between the probabalistic assignment of target features to different clusters and the target labels . Huang et al . ( 2021 ) proposed TransRate — a computationally-friendly surrogate of mutual information ( using coding rate ) between the target feature embeddings and the target labels . Bao et al . ( 2019 ) introduced H-score that takes into account inter-class feature variance and feature redundancy . You et al . ( 2021 ) proposed LogME that considers an optimization problem rooted in Bayesian statistics to maximize the marginal likelihood under a linear classifier head . Deshpande et al . ( 2021 ) introduced LFC to measure in-class similarity of target feature embeddings across samples . Finally , Tan et al . ( 2021 ) used Optimal Transport to evaluate domain distance , and combined it , via a linear combination , with NCE . To learn such a measure , a portion of target tasks were set aside , the models were transferred onto these tasks and the results were used to learn the coefficients for the combined Optimal Transport based Conditional Entropy ( OTCE ) metric . While the resulting metric appears to be superior over other non-composite metrics like H-score and LEEP , it is expensive to compute since it requires finding the appropriate coefficients for the combination . Additionally , our results indicate that both components of the measure seem to be individually sub-optimal in measuring transferability against corresponding supervised and unsupervised measures . 3.1 IMPROVED ESTIMATION OF H-SCORE FOR LIMITED TARGET DATA . H-score ( Bao et al. , 2019 ) is one of the pioneer measures that is often used as a baseline for newer supervised TMs , which often demonstrate the improved performance . It characterizes discriminatory strength of feature embedding for classification : H ( f ) = tr ( Σ ( f ) −1 Σ ( z ) ) ( 1 ) where , d is the embedding dimension , fi = h ( x ( t ) i ) ∈ Rd is the target feature embeddings when the feature extractor ( h : Rp → Rd ) from the source model is applied to the target sample x ( t ) i ∈ Rp , F ∈ Rnt×d denotes the corresponding target feature matrix , Y = Y ( t ) ∈ Y = { 1 , · · · , C } are the target data labels , Σ ( f ) ∈ Rd×d denotes the sample feature covariance matrix of f , z = E [ f |Y ] ∈ Rd and Z ∈ Rnt×d denotes the corresponding target conditioned feature matrix , Σ ( z ) ∈ Rd×d denotes the sample covariance matrix of z . Intuitively , H ( f ) captures the notion that higher interclass variance and small feature redundancy results in better transferability . We hypothesize that the sub-optimal performance of H-Score ( compared to that of more recent metrics ) for measuring transferability in many of the evaluation cases , e.g. , in ( Nguyen et al. , 2020 ) , is due to lack of robust estimation of H-Score — see Fig . 1 for a synthetic example showing the non-reliability of empirical H-score over various sample sizes when compared with its population version . Given that many of the deep learning models in the context of TL have high-dimensional feature embedding space — typically larger than the number of target samples — the estimation of the two covariance matrices in H-score becomes challenging : the sample covariance matrix of the feature embedding has a large condition number1 in small data regimes . In many cases , it can not even be inverted . Bao et al . ( 2019 ) used a pseudo-inverse of the covariance matrix Σ ( f ) . However , this method of estimating a precision matrix can be sub-optimal as inversion can amplify estimation error ( Ledoit & Wolf , 2004 ) . We propose to use well-conditioned shrinkage estimators motivated by the rich literature in statistics on the estimation of high-dimensional covariance ( and precision ) matrices ( Pourahmadi , 2013 ) . We show that the use of such shrinkage estimators can offer significant gain in the performance of H-score in predicting transferability . In many cases , as our experiments show , the gain is so significant that H-score becomes a leading TM , surpassing the performance of state-of-the-art measures . 1Condition number of a positive semidefinite matrix A , is the ratio of its largest and smallest eigenvalues . Proposed Transferability Measure We propose the following shrinkage based H-score : Hα ( f ) = tr ( Σ ( f ) −1 α · ( 1− α ) Σ ( z ) ) , ( 2 ) Estimating Σ ( f ) α While there are several possibilities to obtain a regularized covariance matrix ( Pourahmadi , 2013 ) , we present an approach that considers a linear operation on the eigenvalues of the sample version of the feature embedding covariance matrix . Similar ideas of using well-conditioned plug-in covariance matrices are used in the context of discriminant analysis ( Hastie et al. , 2001 ) . In particular , we improve the conditioning of the covariance matrix by considering its weighted convex combination with a scalar multiple of the identity matrix : Σ ( f ) α = ( 1− α ) Σ ( f ) + ασId ( 3 ) where α ∈ [ 0 , 1 ] is the shrinkage parameter and σ is the average variance computed as tr ( Σ ( f ) ) /d . The linear op- eration on the eigenvalues ensures the covariance estimator is positive definite . Note that the inverse of Σ ( f ) α can be computed for every α , by using the eigen-decomposition of Σ ( f ) . The shrinkage parameter controls the bias and variance trade-off ; the optimal α needs to be selected . This distribution-free estimator is well-suited for our application as the explicit convex linear combination is easy to compute and makes the covariance estimates well-conditioned and more accurate ( Ledoit & Wolf , 2004 ; Chen et al. , 2010 ; Schäfer & Strimmer , 2005 ) . Understanding ( 1−α ) Σ ( z ) The scaling factor ( 1− α ) can be understood in terms of regularized covariance matrix estimation under a ridge penalty : 1/ ( 1 + λ ) ·Σ ( z ) = argminΣ̂ ||Σ̂−Σ ( z ) ||22 + λ||Σ̂||22 ( 4 ) where λ ≥ 0 is the ridge penalty . Choosing λ = α/ ( 1−α ) , it becomes clear that ( 1−α ) Σ ( z ) is the regularized covariance matrix . Choice of α Ledoit & Wolf ( 2004 ) proposed a covariance matrix estimator that minimizes mean squared error loss between the shrinkage based covariance estimator and the true covariance matrix . The optimization with respect to α considers the following objective : minα , v E [ ||Σ∗ −Σ||2 ] s.t . Σ∗ = ( 1− α ) Σ ( f ) + αvI , E [ Σ ( f ) ] = Σ . ( 5 ) where ‖A‖2 = tr ( AAT ) /d . This optimization problem permits a closed-form solution for the optimal shrinkage parameter , which is given by : α∗ = E [ ||Σ ( f ) −Σ||2 ] / E [ ||Σ ( f ) − ( tr ( Σ ) /d ) · Id||2 ] ( 6 ) ' min { ( 1/n2t ) ∑ i∈ [ nt ] ||fifTi −Σ ( f ) ||2 / ||Σ ( f ) − ( tr ( Σ ( f ) ) /d ) · Id||2 , 1 } . ( 7 ) where ( 7 ) defines a valid estimator ( not dependent on true covariance matrix ) for practical use . For proof , we refer the readers to Section 2.1 and 3.3 in Ledoit & Wolf ( 2004 ) . We provide some additional discussion on why same α is used for the two regularized covariance matrices in shrinkagebased H-Score in Supplement Section S2.1 . We provide validation of shrinkage-based estimation of H-Score on synthetic classification data . We generated 1 million 1000-dimensional features with 10 classes using Sklearn multi-class dataset generation function ( Pedregosa et al. , 2011 ) . Number of informative features is set to 500 with rest filled with random noise . We visualize the original and the population version of the H-score and the shrinkage-based H-Score for different sample sizes in Fig . 1 . We observe that the original H-Score becomes highly unreliable as the number of samples decreases . In contrast , the shrunken estimation of H-Score is highly stable and has a small error when compared with the population H-Score . Efficient Computation for small target data For small target data ( C ≤ nt < d ) , the naive implementation of Hα ( f ) can be very slow . We propose an optimized implementation for our shrinkagebased H-Score that exploits diagonal plus low-rank structure of Σ ( f ) α for efficient matrix inversion and the low-rank structure of Σ ( z ) for faster matrix-matrix multiplications . We assume F ( and correspondingly Z ) are centered . The optimized computation of Hα ( f ) is given by : Hα ( f ) = ( 1− α ) / ( ntασ ) · ( ‖R‖2F − ( 1− α ) · vec ( G ) T vec ( W−1G ) ) , ( 8 ) whereR = [ √ n1f̄Y=1 , · · · , √ nC f̄Y=C ] ∈ Rd×C , G = FR ∈ Rnt×C , W = ntασIn +FF T ∈ Rnt×nt . The derivation is provided in the Supplement Section S2.3 . We make a timing comparison of our optimized implementation of Hα ( f ) against the computational times of the state-of-the-art LogME measure and demonstrate 3− 55 times faster computation ( see Table 6 in Section 5.3 ) . 3.2 A CLOSER LOOK AT NCE , LEEP AND NLEEP MEASURES Next , we pursue a deeper investigation of some of the newer metrics that are reported to be superior to H-Score and bring to light what appears to be some overlooked issues with these metrics in Target Task Selection ( TTS ) scenario . TTS has received less attention than Source Model Selection ( SMS ) . To our knowledge , we are the first to bring to light some problematic aspects with NCE , LEEP and NLEEP , which can potentially lead to the misuse of these metrics in measuring transferability . These measures are sensitive to the number of target classes ( C ) and tend to be smaller when C is larger ( see Fig . 2 [ Left ] ) . Therefore , use of these measures for target tasks with dif- ferent C will most likely result in selecting the task with a smaller C. However , in practice , it is not always the case that transferring to a task with a smaller C is easier ; for example , reframing a multiclass classification into a set of binary tasks can create more difficult to learn boundaries ( Friedman et al. , 2000 ) . Furthermore , the measures are also problematic if two candidate target tasks have different degree of imbalance in their classes even if C is the same . The measures would predict higher transferability for imbalanced data regimes over balanced settings ( see Fig . 2 [ Right ] ) . However , imbalanced datasets are typically harder to learn . If these measures are correlated against vanilla accuracy , which tends to be higher as the imbalance increases e.g . for binary classification , the measures would falsely suggest they are good indicators of performance . Earlier work did not consider both these aspects and erroneously showed good correlation of these metrics against vanilla accuracy to show dominance of these metrics in TTS with different C ( Nguyen et al. , 2020 ; Tan et al. , 2021 ) and imbalance ( Tan et al. , 2021 ) . Here , we propose a method to ameliorate the shortcomings of to prevent misuse of these measures , so that they lead to more reliable conclusions . We propose to standardize the metrics by the entropy of the target label priors , leading to the definitions in ( 9 ) . This standardization considers both the class imbalance as well as number of classes through the entropy of the target label priors . n-NCE def = 1 + NCE/H ( Y ) , n-LEEP def = 1 + LEEP/H ( Y ) , n-NLEEP def= 1 +NLEEP/H ( Y ) . ( 9 ) Our proposed normalizations in ( 9 ) ensures the normalized NCE is bounded between [ 0 , 1 ] . For proof , see Supplement Section S2.4 . n-NCE is in fact equivalent to normalized mutual information and has been extensively used to measure correlation between two different labelings/clustering of samples ( Vinh et al. , 2010 ) . Given the similar behavior of LEEP and NCE to different C and class imbalance as shown in Fig . 2 , we suggest the same normalization as given in ( 9 ) . However , this normalization does not ensure boundedness of n-LEEP score ( and by extension n-NLEEP ) in the range [ 0 , 1 ] as in the case of n-NCE . For scenarios where candidate target tasks have different C , we propose an alternative evaluation criteria ( relative accuracy ) instead of vanilla accuracy — see Section 5 for more details . We provide empirical validation of the proposed normalization to these measures in Table 2 in Section 5.1 . We also show that our proposed shrinkage-based H-Score is the leading metric even in these scenarios . | This paper is interested in task transferability measures (both in the supervised and the unsupervised case). Task transferability measures are useful in quantifying how much knowledge of the source domain or model is transferable to the target model (or target domain in the unsupervised setup). Ultimately, one aims at having effective transferability measures to select the best setup for the task of transfer learning. The 4 main contributions of this paper are: - Highlighting instabilities in the computation of the H-score which leads to poor estimate, and proposing to correct these instabilities with regularized covariance estimations, demonstrating an 80% improvement over the original H-score - Fast implementation that is 3-55 times faster than another state of the art baseline - Identify problems with other existing transferability measures (NCE, LEEP and N LEEP) and propose to measure correlation against relative target accuracy (instead of vanilla accuracy). - In the unsupervised setup, propose to use dimension reduction to improve the effectiveness of existing and proposed transferability measures. | SP:480a43692dce83fedcd2464b293c1481d84e8952 |
Global Convergence and Stability of Stochastic Gradient Descent | In machine learning , stochastic gradient descent ( SGD ) is widely deployed to train models using highly non-convex objectives with equally complex noise models . Unfortunately , SGD theory often makes restrictive assumptions that fail to capture the non-convexity of real problems , and almost entirely ignore the complex noise models that exist in practice . In this work , we make substantial progress on this shortcoming . First , we establish that SGD ’ s iterates will either globally converge to a stationary point or diverge under nearly arbitrary nonconvexity and noise models . Under a slightly more restrictive assumption on the joint behavior of the non-convexity and noise model that generalizes current assumptions in the literature , we show that the objective function can not diverge , even if the iterates diverge . As a consequence of our results , SGD can be applied to a greater range of stochastic optimization problems with confidence about its global convergence behavior and stability . 1 INTRODUCTION . Stochastic Gradient Descent ( SGD ) is a dominant algorithm for solving stochastic optimization problems that arise in machine learning , and has expanded its reach to more complex problems from estimating Gaussian Processes ( Chen et al. , 2020 ) , covariance estimation in stochastic filters ( Kim et al. , 2021 ) , and systems identification ( Hardt et al. , 2016 ; Zhang & Patel , 2020 ) . Accordingly , understanding SGD ’ s behavior has been crucial to its reliable application in machine learning and beyond . As a result , SGD ’ s theory has greatly advanced from a variety of perspectives : global convergence analysis ( Lei et al. , 2019 ; Gower et al. , 2020 ; Khaled & Richtárik , 2020 ; Mertikopoulos et al. , 2020 ; Patel , 2020 ) , local convergence analysis ( Mertikopoulos et al. , 2020 ) , greedy and global complexity analysis ( Gower et al. , 2020 ; Khaled & Richtárik , 2020 ) , asymptotic weak convergence ( Wang et al. , 2021 ) , and saddle point analysis ( Fang et al. , 2019 ; Mertikopoulos et al. , 2020 ; Jin et al. , 2021 ) . While all of these perspectives add new dimensions to our understanding of SGD , the global convergence analysis of SGD is the foundation as it dictates whether local analyses , complexity analyses or saddle point analyses are even warranted . Unfortunately , current global convergence analyses of SGD make restrictive assumptions that fail to capture actual stochastic optimization problems arising in machine learning . In particular , global convergence analyses of SGD assume : 1. a global Hölder constant for the gradient of the objective function ( e.g. , Reddi et al. , 2016a ; Ma & Klabjan , 2017 ; Zhou et al. , 2018 ; Bassily et al. , 2018 ; Lei et al. , 2019 ; Li & Orabona , 2019 ; Gower et al. , 2020 ; Khaled & Richtárik , 2020 ; Mertikopoulos et al. , 2020 ; Patel , 2020 ; Jin et al. , 2021 ) ; 2. unrealistic noise models ( e.g. , uniformly bounded variance ) for the stochastic gradients ( e.g. , Reddi et al. , 2016b ; Ma & Klabjan , 2017 ; Hu et al. , 2019 ; Bi & Gunn , 2019 ; Zou et al. , 2019 ; Mertikopoulos et al. , 2020 ) . While such assumptions often make the analysis simpler , the resulting global convergence results would not even apply to simple neural network models for binary classification ( see Appendix A ) . To address this gap , we analyze the global convergence of SGD on nonconvex stochastic optimization problems that capture many actual machine learning applications . In particular , we assume local Hölder continuity of the gradient function ( see Assumption 2 ) , which substantially relaxes the global Hölder assumption of all previous works . Second , we assume that the noise model of the stochastic gradients is bounded by an arbitrary upper semi-continuous function of the parameter ( see Assumption 4 ) , and can even have infinite variance ( c.f. , Wang et al. , 2021 ) , which generalizes the assumptions of all previous work . With these two general assumptions , we prove that the iterates of SGD will either converge to a stationary point or diverge to infinity with probability one ( see Theorem 2 ) . Owing to our result , SGD can be applied to actual empirical risk minimization problems with guarantees about its asymptotic behavior . In the process of proving Theorem 2 , we also prove another almost remarkable claim about the behavior of SGD ’ s iterates : that of all the possible asymptotic behaviors of the iterates ( e.g. , convergence to a fixed point , convergence to a manifold , limit cycles , oscillation between points , divergence ) , even with rather arbitrary noise models , the only two possibilities are either the iterates converge to a fixed point or they diverge ( see Theorem 1 ) . Note , we can not expect this outcome apriori even in such a simple context as applying SGD with fixed step sizes to solve a consistent linear system : the iterates may terminate in a cycle and , thus , fail to converge to a fixed point ( Motzkin & Schoenberg , 1954 , Theorem 2 ) . Thus , from a practical perspective , applying SGD to nonconvex problems with exotic noise models , which may initially cause concern , will either result in convergence to a stationary point or divergence of the iterates . While Theorem 2 is patently useful , SGD ’ s iterates diverging may cause some concern , especially when optimizing regularized empirical risk functions that are guaranteed to be coercive ( i.e. , the objective diverges to infinity as the argument tends to infinity ) . To address this issue , we generalize the notion of expected smoothness ( see Khaled & Richtárik , 2020 ) to an assumption about the joint behavior of the gradient function , the noise model , and the local Hölder constant ( see Assumption 5 ) to prove that , regardless SGD ’ s iterates ’ behavior , the objective function will remain finite and the gradient function will converge to zero with probability one ( see Theorem 3 ) . Thus , from a practical perspective , if we can apply Theorem 3 to a coercive objective function , we are guaranteed that the iterates can not diverge , and , consequently , must converge to a stationary point . Furthering the practical value of our results , as alluded to previously , our results enable the use of downstream analyses . Specifically , our results allow for SGD ’ s iterates to converge to stationary point or diverge ; as a result , when SGD ’ s iterates converge to a stationary point , saddle point escape analyses ( e.g. , Fang et al. , 2019 ; Mertikopoulos et al. , 2020 ; Jin et al. , 2021 ) can be applied to ensure that the stationary point is a local minimizer . Moreover , when SGD is converging to a stationary point , local convergence rate analyses can also be supplied , which can inform adaptive step size rules and stopping criteria ( Patel , 2020 ) . Finally , from a theoretical perspective , we innovate two new analysis strategies to deal with the generality of the local Hölder continuity assumption on the gradient , and our general noise model assumption . We term these two strategies the pseudo-global strategy and the local strategy . We develop the pseudo-global strategy to prove global convergence ( i.e. , Theorem 2 ) , while we develop the local strategy to prove stability ( i.e. , Theorem 3 ) . We believe that both of our strategies are of independent interest to theoreticians . Contribution Summary . To summarize , we study the behavior of SGD under much more realistic assumptions than what is currently in the literature ; namely , we consider local Hölder continuity and general noise models . In this context , we are able to show ( 1 ) that the iterates must either converge to a fixed point or that they might diverge ( Theorem 1 ) ; and ( 2 ) , when the iterates converge to a fixed point , it must be a stationary point of the objective function ( Theorem 2 ) . Moreover , under a slightly more restrictive assumption—which still generalizes current assumptions in the literature— , we show that , regardless of iterate behavior , the objective function will converge to a finite random variable ( i.e. , SGD is stable ) and the gradient function will converge to zero ( Theorem 3 ) . Finally , we develop two new analysis strategies , the pseudo-global strategy and the local strategy , that are of independent interest to theoreticians in machine learning and stochastic optimization . Organization . The remainder of the paper is organized as follows . In Section 2 , we specify the stochastic optimization problem that we will study , including a formal statement of all assumptions . In Section 3 , we specify Stochastic Gradient Descent ( SGD ) and the properties of the needed properties of the learning rate . In Section 4 , we prove and discuss our main results and highlight key steps , while leaving the rest to the appendix . In Section 5 , we conclude this work . 2 STOCHASTIC OPTIMIZATION . We consider solving the optimization problem min θ∈Rp { F ( θ ) : = E [ f ( θ , X ) ] } , ( 1 ) where F maps Rp into R ; f maps Rp and the co-domain of the random variable X into R ; and E is the expectation operator . As we require gradients , we take F and f to differentiable in θ , and denote its derivatives with respect to θ by Ḟ ( θ ) and ḟ ( θ , X ) . With this notation , we make the following general assumptions about the deterministic portion of the objective function . Assumption 1 . There exists Fl.b . ∈ R such that ∀θ ∈ Rp , Fl.b . ≤ F ( θ ) . Assumption 2 . There exists α ∈ ( 0 , 1 ] such that Ḟ ( θ ) is locally α-Hölder continuous . Assumptions 1 and 2 would even be considered mild in the context of non-convex deterministic optimization , in which it is also common to assume that the objective function well-behaved level sets ( e.g. , Nocedal & Wright , 2006 , Theorems 3.2 , 3.8 , 4.5 , 4.6 ) . Importantly , Assumption 2 relaxes the common restrictive assumption of globally Hölder continuous gradient functions that is common in other analyses . Our final step is to make some assumptions about the stochastic portion of the objective function . The first assumption requires the stochastic gradients to be unbiased , which can readily be relaxed ( Bottou et al. , 2018 ) . The second assumption allows for a generic noise model for an α-Hölder continuous gradient function , and even allows for the second moment to not exist when α < 1 ( c.f . Wang et al. , 2021 ) . Assumption 3 . For all θ ∈ Rp , Ḟ ( θ ) = E [ ḟ ( θ , X ) ] . Assumption 4 . Let α ∈ ( 0 , 1 ] be as in Assumption 2 . There exists an upper semi-continuous function G ( θ ) such that E [ ‖ḟ ( θ , X ) ‖1+α2 ] ≤ G ( θ ) . We will show that Assumptions 1 to 4 are sufficient for a global convergence result . Remark 1 . It is entirely possible that E [ ‖ḟ ( θ , X ) ‖1+α2 ] is ( at least ) upper semi-continuous , and to set G ( θ ) equal to this function . In the case that E [ ‖ḟ ( θ , X ) ‖1+α2 ] is not upper semi-continuous , it is possible to specify G ( θ ) as the upper envelope of E [ ‖ḟ ( θ , X ) ‖1+α2 ] ( i.e. , the its limit supremum function ) . However , it is unlikely that E [ ‖ḟ ( θ , X ) ‖1+α2 ] nor its upper envelope are easy to specify explicitly , and it is more likely to be able to find an upper bound . In order to show that the objective function can not diverge ( i.e. , to prove stability ) , we will need an additional assumption . This assumption will relate the gradient function , noise model and variation on the local Hölder constant . To begin , we define the variation on the local Hölder constant . Let α ∈ ( 0 , 1 ] be as in Assumption 2 and > 0 be arbitrary , and define L ( θ ) = supϕ { ‖Ḟ ( ϕ ) −Ḟ ( θ ) ‖ 2 ‖ϕ−θ‖α2 : ‖ϕ− θ‖2 ≤ ( G ( θ ) ∨ ) 1 1+α } if this quantity is nonzero otherwise , ( 2 ) where ∨ indicates the maximum between two quantities . Note , the choice of is irrelevant , and they can be distinct for the two cases in the definition of L , but we fix them to be the same for simplicity . Importantly , the quantity , L , is defined at every parameter θ under Assumption 2 . With this quantity , we can state a nonintuitive , technical assumption that is needed to prove stability . Assumption 5 . There exists C1 , C2 , C3 ≥ 0 such that , ∀θ ∈ Rp , L ( θ ) G ( θ ) + α ∥∥∥Ḟ ( θ ) ∥∥∥1+α 2 L ( θ ) 1/α ≤ C1 + C2 ( F ( θ ) − Fl.b . ) + C3 ∥∥∥Ḟ ( θ ) ∥∥∥2 2 . ( 3 ) Assumption 5 generalizes Assumption 4.3 ( c ) of Bottou et al . ( 2018 ) , which is satisfied for a large swath of statistical models . Moreover , Assumption 5 generalizes the notion of expected smoothness ( see Khaled & Richtárik , 2020 , for a history of the assumption ) , which expanded the optimization problems covered by the theory of Bottou et al . ( 2018 ) . Note , Assumption 5 is about the asymptotic properties of the stochastic optimization problem as the left hand side of the inequality in Assumption 5 can be bounded inside of any compact set . Thus , Assumption 5 covers a variety of asymptotic behaviors , such as exp ( ‖θ‖22 ) , exp ( ‖θ‖2 ) , ‖θ‖r2 for r ∈ R , log ( ‖θ‖2+1 ) , and log ( log ( ‖θ‖2+1 ) +1 ) . Therefore , Assumption 5 holds for functions with a variety of different asymptotic behaviors . We will show that Assumptions 1 to 5 are sufficient for a stability result . Now that we have specified the nature of the stochastic optimization problem , we turn our attention to the algorithm used to solve the problem , namely , stochastic gradient descent ( SGD ) . | In this paper, the authors consider the global convergence and stability of stochastic gradient descent in a fairly general non-convex setting. They are able to remove the often-assumed unrealistic uniform bounded assumption on the noise, and also relax the global Holder assumption in the literature. Their discussions in Appendix A provide an example for which the uniform bounded assumption on the noise commonly assumed in the literature fails. Their global convergence says that under some relatively weak assumptions, SGD either diverges or the objective converges to a finite random variable and the gradient converges to zero. This excludes the bad outcomes, e.g. limit cycle or oscillation. Their stability result says that under a stronger assumption, SGD's objective converges to a finite random variable and the gradient converges to zero with probability one. | SP:a84af29bb856abf8eebf6eb8ba8ffd18066f1550 |
Global Convergence and Stability of Stochastic Gradient Descent | In machine learning , stochastic gradient descent ( SGD ) is widely deployed to train models using highly non-convex objectives with equally complex noise models . Unfortunately , SGD theory often makes restrictive assumptions that fail to capture the non-convexity of real problems , and almost entirely ignore the complex noise models that exist in practice . In this work , we make substantial progress on this shortcoming . First , we establish that SGD ’ s iterates will either globally converge to a stationary point or diverge under nearly arbitrary nonconvexity and noise models . Under a slightly more restrictive assumption on the joint behavior of the non-convexity and noise model that generalizes current assumptions in the literature , we show that the objective function can not diverge , even if the iterates diverge . As a consequence of our results , SGD can be applied to a greater range of stochastic optimization problems with confidence about its global convergence behavior and stability . 1 INTRODUCTION . Stochastic Gradient Descent ( SGD ) is a dominant algorithm for solving stochastic optimization problems that arise in machine learning , and has expanded its reach to more complex problems from estimating Gaussian Processes ( Chen et al. , 2020 ) , covariance estimation in stochastic filters ( Kim et al. , 2021 ) , and systems identification ( Hardt et al. , 2016 ; Zhang & Patel , 2020 ) . Accordingly , understanding SGD ’ s behavior has been crucial to its reliable application in machine learning and beyond . As a result , SGD ’ s theory has greatly advanced from a variety of perspectives : global convergence analysis ( Lei et al. , 2019 ; Gower et al. , 2020 ; Khaled & Richtárik , 2020 ; Mertikopoulos et al. , 2020 ; Patel , 2020 ) , local convergence analysis ( Mertikopoulos et al. , 2020 ) , greedy and global complexity analysis ( Gower et al. , 2020 ; Khaled & Richtárik , 2020 ) , asymptotic weak convergence ( Wang et al. , 2021 ) , and saddle point analysis ( Fang et al. , 2019 ; Mertikopoulos et al. , 2020 ; Jin et al. , 2021 ) . While all of these perspectives add new dimensions to our understanding of SGD , the global convergence analysis of SGD is the foundation as it dictates whether local analyses , complexity analyses or saddle point analyses are even warranted . Unfortunately , current global convergence analyses of SGD make restrictive assumptions that fail to capture actual stochastic optimization problems arising in machine learning . In particular , global convergence analyses of SGD assume : 1. a global Hölder constant for the gradient of the objective function ( e.g. , Reddi et al. , 2016a ; Ma & Klabjan , 2017 ; Zhou et al. , 2018 ; Bassily et al. , 2018 ; Lei et al. , 2019 ; Li & Orabona , 2019 ; Gower et al. , 2020 ; Khaled & Richtárik , 2020 ; Mertikopoulos et al. , 2020 ; Patel , 2020 ; Jin et al. , 2021 ) ; 2. unrealistic noise models ( e.g. , uniformly bounded variance ) for the stochastic gradients ( e.g. , Reddi et al. , 2016b ; Ma & Klabjan , 2017 ; Hu et al. , 2019 ; Bi & Gunn , 2019 ; Zou et al. , 2019 ; Mertikopoulos et al. , 2020 ) . While such assumptions often make the analysis simpler , the resulting global convergence results would not even apply to simple neural network models for binary classification ( see Appendix A ) . To address this gap , we analyze the global convergence of SGD on nonconvex stochastic optimization problems that capture many actual machine learning applications . In particular , we assume local Hölder continuity of the gradient function ( see Assumption 2 ) , which substantially relaxes the global Hölder assumption of all previous works . Second , we assume that the noise model of the stochastic gradients is bounded by an arbitrary upper semi-continuous function of the parameter ( see Assumption 4 ) , and can even have infinite variance ( c.f. , Wang et al. , 2021 ) , which generalizes the assumptions of all previous work . With these two general assumptions , we prove that the iterates of SGD will either converge to a stationary point or diverge to infinity with probability one ( see Theorem 2 ) . Owing to our result , SGD can be applied to actual empirical risk minimization problems with guarantees about its asymptotic behavior . In the process of proving Theorem 2 , we also prove another almost remarkable claim about the behavior of SGD ’ s iterates : that of all the possible asymptotic behaviors of the iterates ( e.g. , convergence to a fixed point , convergence to a manifold , limit cycles , oscillation between points , divergence ) , even with rather arbitrary noise models , the only two possibilities are either the iterates converge to a fixed point or they diverge ( see Theorem 1 ) . Note , we can not expect this outcome apriori even in such a simple context as applying SGD with fixed step sizes to solve a consistent linear system : the iterates may terminate in a cycle and , thus , fail to converge to a fixed point ( Motzkin & Schoenberg , 1954 , Theorem 2 ) . Thus , from a practical perspective , applying SGD to nonconvex problems with exotic noise models , which may initially cause concern , will either result in convergence to a stationary point or divergence of the iterates . While Theorem 2 is patently useful , SGD ’ s iterates diverging may cause some concern , especially when optimizing regularized empirical risk functions that are guaranteed to be coercive ( i.e. , the objective diverges to infinity as the argument tends to infinity ) . To address this issue , we generalize the notion of expected smoothness ( see Khaled & Richtárik , 2020 ) to an assumption about the joint behavior of the gradient function , the noise model , and the local Hölder constant ( see Assumption 5 ) to prove that , regardless SGD ’ s iterates ’ behavior , the objective function will remain finite and the gradient function will converge to zero with probability one ( see Theorem 3 ) . Thus , from a practical perspective , if we can apply Theorem 3 to a coercive objective function , we are guaranteed that the iterates can not diverge , and , consequently , must converge to a stationary point . Furthering the practical value of our results , as alluded to previously , our results enable the use of downstream analyses . Specifically , our results allow for SGD ’ s iterates to converge to stationary point or diverge ; as a result , when SGD ’ s iterates converge to a stationary point , saddle point escape analyses ( e.g. , Fang et al. , 2019 ; Mertikopoulos et al. , 2020 ; Jin et al. , 2021 ) can be applied to ensure that the stationary point is a local minimizer . Moreover , when SGD is converging to a stationary point , local convergence rate analyses can also be supplied , which can inform adaptive step size rules and stopping criteria ( Patel , 2020 ) . Finally , from a theoretical perspective , we innovate two new analysis strategies to deal with the generality of the local Hölder continuity assumption on the gradient , and our general noise model assumption . We term these two strategies the pseudo-global strategy and the local strategy . We develop the pseudo-global strategy to prove global convergence ( i.e. , Theorem 2 ) , while we develop the local strategy to prove stability ( i.e. , Theorem 3 ) . We believe that both of our strategies are of independent interest to theoreticians . Contribution Summary . To summarize , we study the behavior of SGD under much more realistic assumptions than what is currently in the literature ; namely , we consider local Hölder continuity and general noise models . In this context , we are able to show ( 1 ) that the iterates must either converge to a fixed point or that they might diverge ( Theorem 1 ) ; and ( 2 ) , when the iterates converge to a fixed point , it must be a stationary point of the objective function ( Theorem 2 ) . Moreover , under a slightly more restrictive assumption—which still generalizes current assumptions in the literature— , we show that , regardless of iterate behavior , the objective function will converge to a finite random variable ( i.e. , SGD is stable ) and the gradient function will converge to zero ( Theorem 3 ) . Finally , we develop two new analysis strategies , the pseudo-global strategy and the local strategy , that are of independent interest to theoreticians in machine learning and stochastic optimization . Organization . The remainder of the paper is organized as follows . In Section 2 , we specify the stochastic optimization problem that we will study , including a formal statement of all assumptions . In Section 3 , we specify Stochastic Gradient Descent ( SGD ) and the properties of the needed properties of the learning rate . In Section 4 , we prove and discuss our main results and highlight key steps , while leaving the rest to the appendix . In Section 5 , we conclude this work . 2 STOCHASTIC OPTIMIZATION . We consider solving the optimization problem min θ∈Rp { F ( θ ) : = E [ f ( θ , X ) ] } , ( 1 ) where F maps Rp into R ; f maps Rp and the co-domain of the random variable X into R ; and E is the expectation operator . As we require gradients , we take F and f to differentiable in θ , and denote its derivatives with respect to θ by Ḟ ( θ ) and ḟ ( θ , X ) . With this notation , we make the following general assumptions about the deterministic portion of the objective function . Assumption 1 . There exists Fl.b . ∈ R such that ∀θ ∈ Rp , Fl.b . ≤ F ( θ ) . Assumption 2 . There exists α ∈ ( 0 , 1 ] such that Ḟ ( θ ) is locally α-Hölder continuous . Assumptions 1 and 2 would even be considered mild in the context of non-convex deterministic optimization , in which it is also common to assume that the objective function well-behaved level sets ( e.g. , Nocedal & Wright , 2006 , Theorems 3.2 , 3.8 , 4.5 , 4.6 ) . Importantly , Assumption 2 relaxes the common restrictive assumption of globally Hölder continuous gradient functions that is common in other analyses . Our final step is to make some assumptions about the stochastic portion of the objective function . The first assumption requires the stochastic gradients to be unbiased , which can readily be relaxed ( Bottou et al. , 2018 ) . The second assumption allows for a generic noise model for an α-Hölder continuous gradient function , and even allows for the second moment to not exist when α < 1 ( c.f . Wang et al. , 2021 ) . Assumption 3 . For all θ ∈ Rp , Ḟ ( θ ) = E [ ḟ ( θ , X ) ] . Assumption 4 . Let α ∈ ( 0 , 1 ] be as in Assumption 2 . There exists an upper semi-continuous function G ( θ ) such that E [ ‖ḟ ( θ , X ) ‖1+α2 ] ≤ G ( θ ) . We will show that Assumptions 1 to 4 are sufficient for a global convergence result . Remark 1 . It is entirely possible that E [ ‖ḟ ( θ , X ) ‖1+α2 ] is ( at least ) upper semi-continuous , and to set G ( θ ) equal to this function . In the case that E [ ‖ḟ ( θ , X ) ‖1+α2 ] is not upper semi-continuous , it is possible to specify G ( θ ) as the upper envelope of E [ ‖ḟ ( θ , X ) ‖1+α2 ] ( i.e. , the its limit supremum function ) . However , it is unlikely that E [ ‖ḟ ( θ , X ) ‖1+α2 ] nor its upper envelope are easy to specify explicitly , and it is more likely to be able to find an upper bound . In order to show that the objective function can not diverge ( i.e. , to prove stability ) , we will need an additional assumption . This assumption will relate the gradient function , noise model and variation on the local Hölder constant . To begin , we define the variation on the local Hölder constant . Let α ∈ ( 0 , 1 ] be as in Assumption 2 and > 0 be arbitrary , and define L ( θ ) = supϕ { ‖Ḟ ( ϕ ) −Ḟ ( θ ) ‖ 2 ‖ϕ−θ‖α2 : ‖ϕ− θ‖2 ≤ ( G ( θ ) ∨ ) 1 1+α } if this quantity is nonzero otherwise , ( 2 ) where ∨ indicates the maximum between two quantities . Note , the choice of is irrelevant , and they can be distinct for the two cases in the definition of L , but we fix them to be the same for simplicity . Importantly , the quantity , L , is defined at every parameter θ under Assumption 2 . With this quantity , we can state a nonintuitive , technical assumption that is needed to prove stability . Assumption 5 . There exists C1 , C2 , C3 ≥ 0 such that , ∀θ ∈ Rp , L ( θ ) G ( θ ) + α ∥∥∥Ḟ ( θ ) ∥∥∥1+α 2 L ( θ ) 1/α ≤ C1 + C2 ( F ( θ ) − Fl.b . ) + C3 ∥∥∥Ḟ ( θ ) ∥∥∥2 2 . ( 3 ) Assumption 5 generalizes Assumption 4.3 ( c ) of Bottou et al . ( 2018 ) , which is satisfied for a large swath of statistical models . Moreover , Assumption 5 generalizes the notion of expected smoothness ( see Khaled & Richtárik , 2020 , for a history of the assumption ) , which expanded the optimization problems covered by the theory of Bottou et al . ( 2018 ) . Note , Assumption 5 is about the asymptotic properties of the stochastic optimization problem as the left hand side of the inequality in Assumption 5 can be bounded inside of any compact set . Thus , Assumption 5 covers a variety of asymptotic behaviors , such as exp ( ‖θ‖22 ) , exp ( ‖θ‖2 ) , ‖θ‖r2 for r ∈ R , log ( ‖θ‖2+1 ) , and log ( log ( ‖θ‖2+1 ) +1 ) . Therefore , Assumption 5 holds for functions with a variety of different asymptotic behaviors . We will show that Assumptions 1 to 5 are sufficient for a stability result . Now that we have specified the nature of the stochastic optimization problem , we turn our attention to the algorithm used to solve the problem , namely , stochastic gradient descent ( SGD ) . | In this paper, the authors study the behavior of SGD under very general assumptions. The existing global convergence of SGD requires two restrictive assumptions: a global Holder continuity for gradients and unrealistic noise models for stochastic gradients. This paper relaxes the global Holder continuity assumption to a local Holder continuity assumption, and consider general noise model assumptions. The main results include global convergence and stability. By global convergence, the authors show that either the iterates converge to a stationary point or they diverge. By stability, the authors show that the objective function remains finite along any iterate sequence. In the deduction, the authors introduce novel techniques to decouple some dependencies encountered in considering general assumptions. | SP:a84af29bb856abf8eebf6eb8ba8ffd18066f1550 |
Recursive Construction of Stable Assemblies of Recurrent Neural Networks | 1 INTRODUCTION . Neuro-inspired machine learning has profoundly altered many fields such as computer vision , natural language processing , and computational neuroscience ( Bengio et al. , 2017 ; Hassabis et al. , 2017 ) . While models trained with e.g . deep learning are remarkably powerful , they are for the most part ‘ black boxes ’ . This opaqueness can be dangerous in safety-critical applications , such as autonomous driving or human-centered robotics , and it limits conceptual progress . In the case of recurrent models , one difficulty is that providing a certificate of stability is currently impossible or computationally impractical . Given that stability is a fundamental property of dynamical systems – and is intimately linked to concepts of control , generalization , data-efficiency , and robustness – being able to guarantee the stability of a recurrent model is an important step towards making sure deep models behave as we expect them to . In this spirit , there has been a recent flux of work focusing on applications of contraction analysis ( Lohmiller & Slotine , 1998 ) to recurrent models . Loosely speaking , a dynamical system is said to be contracting if any two of its trajectories converge to each other exponentially , regardless of initial conditions . A primary advantage of contraction analysis is that it is directly applicable to non-autonomous systems , which the vast majority of recurrent models are , allowing in turn modular contraction-preserving combination properties to be derived ( Slotine & Lohmiller , 2001 ; Slotine , 2003 ) . We include a mathematical primer on contraction analysis in Section A1 . Within this line of research , our paper has two main aims : 1 ) To provide simple contraction conditions for continuous-time recurrent neural networks and 2 ) To show how these continuous-time contraction conditions imply a combination property . Using both aims , we proceed to implement stable combination networks that exhibit state-of-the-art ( SOTA ) performance on multiple sequential image classification tasks with a small number of trainable parameters . 1.1 PREVIOUS WORK ON RNN STABILITY . To briefly review the current literature on application of contraction analysis to recurrent models , we first note that the ‘ Echo-State Condition ’ introduced in Jaeger ( 2001 ) is equivalent to discrete-time contraction in the identity metric . A later generalization of this condition included a diagonal metric ( Buehner & Young , 2006 ) . In the context of neuroscience , contraction analysis has been applied to analyzing the dynamics of winner-take-all networks ( Rutishauser et al. , 2011 ; 2015 ) as well as networks with synaptic plasticity ( Kozachkov et al. , 2020 ) . In the machine learning context , Miller and Hardt recently rederived an ‘ echo-state property ’ for discrete recurrent models , and went on to prove that these contracting recurrent models could be well-approximated by feedforward networks in certain cases ( Miller & Hardt , 2018 ) . More recently still , in a series of papers Revay , Wang , and Manchester applied contraction analysis to discrete-time recurrent networks ( Revay & Manchester , 2020 ; Revay et al. , 2021 ; 2020a ) , expanding the class of models considered in Miller & Hardt ( 2018 ) . In addition to contraction ( which amounts to a strong form of non-autonomous exponential stability ) there has been a considerable amount of work attempting to enforce weaker forms of stability in RNNs , such as autonomous stability ( Erichson et al. , 2021 ; Chang et al. , 2019 ) . Unfortunately , as we discuss in Section 2.3 , autonomous stability does not in general imply non-autonomous stability , so it is not clear what stability properties these RNNs possess when driven with external input . There is also a line of work which uses orthogonal weight matrices to avoid the vanishing/exploding gradient problem during training . Orthogonality is typically ensured during training via a parameterization ( Arjovsky et al. , 2016 ; Lezcano-Casado & Martınez-Rubio , 2019 ) – for example , by exploiting the fact that the matrix exponential of a skew-symmetric matrix is orthogonal , as is done in Lezcano-Casado & Martınez-Rubio ( 2019 ) . These works focus on parameterizations of individual RNNs which ensure stability is preserved during training . By contrast , our work focuses on ‘ combined ’ RNNs ( i.e network of networks ) and provides a parameterization on the connections between stable subnetworks such that training preserves the overall network stability ( Figure 1 ) . 1.2 COMBINATION NETWORKS . The combination and reuse of primitive “ modules ” has enabled a great deal of progress in computer science , and is also a key theme in biological evolution , particularly apparent in cortical structure of the human brain . In fact , it is thought that the majority of traits that have developed over the last 400+ million years are the result of evolutionary forces acting on regulatory elements that combine core components , rather than mutations to the core components themselves . This mechanism of action makes meaningful variation in population phenotypes much more feasible to achieve , and is appropriately titled “ facilitated variation ” ( Gerhart & Kirschner , 2007 ) . In addition to the biological evidence for facilitated variation , computational models have demonstrated that this approach produces populations that are better able to generalize to new environments ( Parter et al. , 2008 ) , an ability that will be critical to further develop in deep learning systems . While the benefits of building modular systems are clear ( Simon , 1962 ) , as in DeepMind ’ s AlphaGo for example ( Silver et al. , 2016 ) , there is no general guarantee that a combination of stable systems will itself be stable . Thus the tractability of these evolutionary processes hinges on some mechanism for ensuring stability of combinations . Because contraction analysis tools allow complicated contracting systems to be built up recursively from simpler elements , this form of stability is well suited for biological systems ( Slotine & Lohmiller , 2001 ; Slotine & Liu , 2012 ) . Note also that contracting combinations can be made between systems with very different dynamics , as long as those dynamics are contracting . Here , we describe two common forms of contracting system combinations – hierarchical and feedback – that automatically guarantee overall system stability ( Figure 1 ) . Ultimately , cognitive models are moving increasingly toward study of multi-area dynamics , but many questions remain on how to best train and evaluate such networks ( Yang et al. , 2018 ; Yang & Molano-Mazon , 2021 ) . Understanding how different brain regions interact harmoniously to produce a unified percept/action will require new ideas and analysis tools . 2 MATHEMATICAL RESULTS . 2.1 CONTRACTION CONDITIONS FOR INDIVIDUAL , CONTINUOUS-TIME RNNS . We consider the following continuous-time RNN , evolving according to the following equations : τ ẋ = −x + Wφ ( x ) + u ( t ) ( 1 ) where x ∈ Rn , φ is a static nonlinearity such that 0 ≤ φ′ ≤ g , u ( t ) is some input ( potentially timevarying ) and τ > 0 . We do not constrain the sign of φ . Example nonlinearities φ ( x ) that satisfy the constraints are tanh ( ax ) , log ( 1 + ex ) , and max ( 0 , x ) , with g = a , 1 , 1 respectively . Note that this class of RNNs is equivalent to another commonly used class of RNNs where the terms Wx + u appears inside φ ( · ) . See Section A2 or ( Miller & Fumarola , 2012 ) for details . Our mathematical results therefore apply equally well to both types of RNNs . We seek a stability certificate for this system in terms of the recurrent weight matrix W. We are specifically interested in restricting W such that the RNN is globally contracting . We do this with the goal of recursively combining these contracting RNNs with other contracting RNNs to make large , complicated , stable ‘ networks of networks ’ . Here we derive five restrictions on W which ensure contraction for the continuous-time RNN defined by equation 1 . To the best of our knowledge these contraction conditions are novel . All proofs can be found in the supplemental Section A4 . Theorem 1 ( Absolute Value Restricted Weights ) . Let |W| denote the matrix formed by taking the element-wise absolute value of W. If there exists a positive , diagonal P such that : P ( g|W| − I ) + ( g|W| − I ) TP ≺ 0 then equation 1 is contracting in metric P. Moreover , if Wii ≤ 0 , then |W |ii may be set to zero to reduce conservatism . Note that when g = 1 , Theorem 1 can be checked by checking for linear stability of |W| − I. Theorem 2 ( Symmetric Weights ) . If W = WT and gW ≺ I , then ( 1 ) is contracting . Theorem 3 ( Product of Diagonal and Orthogonal Weights ) . If there exists positive diagonal matrices P1 and P2 , as well as Q = QT 0 such that W = −P1QP2 then ( 1 ) is contracting in metric M = ( P1QP1 ) −1 . Theorem 4 ( Triangular Weights ) . If gW− I is triangular and Hurwitz , then ( 1 ) is contracting in a diagonal metric . Theorem 5 ( Singular Value Restricted Weights ) . If there exists a positive diagonal matrix P such that : g2WTPW −P ≺ 0 then ( 1 ) is contracting in metric P . 2.2 THE MODEL : NETWORK OF NETWORKS . The RNN in equation 1 is a subnetwork of our model . Our goal is to combine these subnetworks into a ‘ network of networks ’ in a manner that preserves the stability of the underlying modules . In particular , we seek to parameterize and learn the inter-module connections . To do this , we prove and make extensive use of the following theorem : Theorem 6 ( Network of Networks ) . Consider a collection of p subnetwork RNNs governed by equation 1 . Assume that these RNNs each have hidden-to-hidden weight matrices { W1 , . . . , Wp } and are independently contracting in metrics { M1 , . . . , Mp } . Define the block matrices W̃ ≡ BlockDiag ( W1 , . . . , Wp ) and M̃ ≡ BlockDiag ( M1 , . . . , Mp ) , as well as the overall state vector x̃T ≡ ( xT1 · · ·xT2 ) . Then the following ‘ network of networks ’ is globally contracting in metric M̃ : τ ˙̃x = −x̃ + W̃φ ( x̃ ) + u ( t ) + Lx̃ L ≡ B− M̃−1BTM̃ ( 2 ) Where B is an arbitrary square matrix . Note that we are agnostic to the particular contraction condition here – the subnetwork RNNs can satisfy any of the theorems in the preceding section . 2.3 ON STABILITY THEOREMS FOR RNNS . Several recent papers in machine learning , e.g ( Haber & Ruthotto , 2017 ; Chang et al. , 2019 ) , claim that a sufficient condition for stability of the nonlinear system : ẋ = f ( x , t ) is that the associated Jacobian matrix J ( x , t ) = ∂f∂x has eigenvalues whose real parts are strictly negative , i.e : max i Re ( λi ( J ( x , t ) ) ≤ −α with α > 0 . This claim is generally false . For a counter-example , see Section 4.4.2 in ( Slotine & Li , 1991 ) . However , in the specific case of the RNN ( 1 ) , it appears that the eigenvalues of the symmetric part of W do provide information on global stability in a number of applications . For example , in ( Matsuoka , 1992 ) it was shown that if Ws = 12 ( W + W T ) has all its eigenvalues less than unity , and u is constant , then ( 1 ) has a unique fixed point that is globally asymptotically stable . It is easy to see that this condition also implies that the real parts of the eigenvalues of the Jacobian are uniformly negative . Moreover , in ( Chang et al. , 2019 ) it was shown that setting the symmetric part of Ws = 12 ( W + W T ) almost equal to zero ( yet slightly negative ) led to rotational , yet stable dynamics in practice . This leads us to the following theorem , which shows that if the slopes of the activation functions change sufficiently slowly as a function of time , then the condition in ( Matsuoka , 1992 ) in fact implies global contraction of ( 1 ) . Theorem 7 . Let D be a positive , diagonal matrix with Dii = dφidxi , and let P be an arbitrary , positive diagonal matrix . If : ( gW − I ) P + P ( gWT − I ) −cP and Ḋ− cg−1D −βD for c , β > 0 , then ( 1 ) is contracting in metric D with rate β . It has been conjectured that diagonal stability of gW − I is a sufficient condition for global contraction of the RNN 1 ( Revay et al. , 2020b ) , however this has been difficult to prove . To better characterize this conjecture , we present Theorem 8 , which shows by way of counterexample that diagonal stability of gW − I does NOT imply global contraction in a constant metric for ( 1 ) . Theorem 8 . Satisfaction of the condition gWsym − I ≺ 0 is NOT sufficient to show global contraction of the general nonlinear RNN ( 1 ) in any constant metric . High levels of antisymmetry in W can make it impossible to find such a metric , which we demonstrate via a 2× 2 counterexample of the following form , with c ≥ 2 : W = [ 0 −c c 0 ] | In the paper, the authors study stable architectures for RNNs. On the theoretical side, the authors present a series of conditions such that a weight matrix of an RNN is contractive. On the modeling side, the authors propose RNN architectures that have contractive weight matrices. The proposed methods are evaluated on benchmark datasets including sequential MNIST, permuted MNIST, and sequential CIFAR-10. | SP:3e145b336f187ed10a193fc6102d245fdd99e004 |
Recursive Construction of Stable Assemblies of Recurrent Neural Networks | 1 INTRODUCTION . Neuro-inspired machine learning has profoundly altered many fields such as computer vision , natural language processing , and computational neuroscience ( Bengio et al. , 2017 ; Hassabis et al. , 2017 ) . While models trained with e.g . deep learning are remarkably powerful , they are for the most part ‘ black boxes ’ . This opaqueness can be dangerous in safety-critical applications , such as autonomous driving or human-centered robotics , and it limits conceptual progress . In the case of recurrent models , one difficulty is that providing a certificate of stability is currently impossible or computationally impractical . Given that stability is a fundamental property of dynamical systems – and is intimately linked to concepts of control , generalization , data-efficiency , and robustness – being able to guarantee the stability of a recurrent model is an important step towards making sure deep models behave as we expect them to . In this spirit , there has been a recent flux of work focusing on applications of contraction analysis ( Lohmiller & Slotine , 1998 ) to recurrent models . Loosely speaking , a dynamical system is said to be contracting if any two of its trajectories converge to each other exponentially , regardless of initial conditions . A primary advantage of contraction analysis is that it is directly applicable to non-autonomous systems , which the vast majority of recurrent models are , allowing in turn modular contraction-preserving combination properties to be derived ( Slotine & Lohmiller , 2001 ; Slotine , 2003 ) . We include a mathematical primer on contraction analysis in Section A1 . Within this line of research , our paper has two main aims : 1 ) To provide simple contraction conditions for continuous-time recurrent neural networks and 2 ) To show how these continuous-time contraction conditions imply a combination property . Using both aims , we proceed to implement stable combination networks that exhibit state-of-the-art ( SOTA ) performance on multiple sequential image classification tasks with a small number of trainable parameters . 1.1 PREVIOUS WORK ON RNN STABILITY . To briefly review the current literature on application of contraction analysis to recurrent models , we first note that the ‘ Echo-State Condition ’ introduced in Jaeger ( 2001 ) is equivalent to discrete-time contraction in the identity metric . A later generalization of this condition included a diagonal metric ( Buehner & Young , 2006 ) . In the context of neuroscience , contraction analysis has been applied to analyzing the dynamics of winner-take-all networks ( Rutishauser et al. , 2011 ; 2015 ) as well as networks with synaptic plasticity ( Kozachkov et al. , 2020 ) . In the machine learning context , Miller and Hardt recently rederived an ‘ echo-state property ’ for discrete recurrent models , and went on to prove that these contracting recurrent models could be well-approximated by feedforward networks in certain cases ( Miller & Hardt , 2018 ) . More recently still , in a series of papers Revay , Wang , and Manchester applied contraction analysis to discrete-time recurrent networks ( Revay & Manchester , 2020 ; Revay et al. , 2021 ; 2020a ) , expanding the class of models considered in Miller & Hardt ( 2018 ) . In addition to contraction ( which amounts to a strong form of non-autonomous exponential stability ) there has been a considerable amount of work attempting to enforce weaker forms of stability in RNNs , such as autonomous stability ( Erichson et al. , 2021 ; Chang et al. , 2019 ) . Unfortunately , as we discuss in Section 2.3 , autonomous stability does not in general imply non-autonomous stability , so it is not clear what stability properties these RNNs possess when driven with external input . There is also a line of work which uses orthogonal weight matrices to avoid the vanishing/exploding gradient problem during training . Orthogonality is typically ensured during training via a parameterization ( Arjovsky et al. , 2016 ; Lezcano-Casado & Martınez-Rubio , 2019 ) – for example , by exploiting the fact that the matrix exponential of a skew-symmetric matrix is orthogonal , as is done in Lezcano-Casado & Martınez-Rubio ( 2019 ) . These works focus on parameterizations of individual RNNs which ensure stability is preserved during training . By contrast , our work focuses on ‘ combined ’ RNNs ( i.e network of networks ) and provides a parameterization on the connections between stable subnetworks such that training preserves the overall network stability ( Figure 1 ) . 1.2 COMBINATION NETWORKS . The combination and reuse of primitive “ modules ” has enabled a great deal of progress in computer science , and is also a key theme in biological evolution , particularly apparent in cortical structure of the human brain . In fact , it is thought that the majority of traits that have developed over the last 400+ million years are the result of evolutionary forces acting on regulatory elements that combine core components , rather than mutations to the core components themselves . This mechanism of action makes meaningful variation in population phenotypes much more feasible to achieve , and is appropriately titled “ facilitated variation ” ( Gerhart & Kirschner , 2007 ) . In addition to the biological evidence for facilitated variation , computational models have demonstrated that this approach produces populations that are better able to generalize to new environments ( Parter et al. , 2008 ) , an ability that will be critical to further develop in deep learning systems . While the benefits of building modular systems are clear ( Simon , 1962 ) , as in DeepMind ’ s AlphaGo for example ( Silver et al. , 2016 ) , there is no general guarantee that a combination of stable systems will itself be stable . Thus the tractability of these evolutionary processes hinges on some mechanism for ensuring stability of combinations . Because contraction analysis tools allow complicated contracting systems to be built up recursively from simpler elements , this form of stability is well suited for biological systems ( Slotine & Lohmiller , 2001 ; Slotine & Liu , 2012 ) . Note also that contracting combinations can be made between systems with very different dynamics , as long as those dynamics are contracting . Here , we describe two common forms of contracting system combinations – hierarchical and feedback – that automatically guarantee overall system stability ( Figure 1 ) . Ultimately , cognitive models are moving increasingly toward study of multi-area dynamics , but many questions remain on how to best train and evaluate such networks ( Yang et al. , 2018 ; Yang & Molano-Mazon , 2021 ) . Understanding how different brain regions interact harmoniously to produce a unified percept/action will require new ideas and analysis tools . 2 MATHEMATICAL RESULTS . 2.1 CONTRACTION CONDITIONS FOR INDIVIDUAL , CONTINUOUS-TIME RNNS . We consider the following continuous-time RNN , evolving according to the following equations : τ ẋ = −x + Wφ ( x ) + u ( t ) ( 1 ) where x ∈ Rn , φ is a static nonlinearity such that 0 ≤ φ′ ≤ g , u ( t ) is some input ( potentially timevarying ) and τ > 0 . We do not constrain the sign of φ . Example nonlinearities φ ( x ) that satisfy the constraints are tanh ( ax ) , log ( 1 + ex ) , and max ( 0 , x ) , with g = a , 1 , 1 respectively . Note that this class of RNNs is equivalent to another commonly used class of RNNs where the terms Wx + u appears inside φ ( · ) . See Section A2 or ( Miller & Fumarola , 2012 ) for details . Our mathematical results therefore apply equally well to both types of RNNs . We seek a stability certificate for this system in terms of the recurrent weight matrix W. We are specifically interested in restricting W such that the RNN is globally contracting . We do this with the goal of recursively combining these contracting RNNs with other contracting RNNs to make large , complicated , stable ‘ networks of networks ’ . Here we derive five restrictions on W which ensure contraction for the continuous-time RNN defined by equation 1 . To the best of our knowledge these contraction conditions are novel . All proofs can be found in the supplemental Section A4 . Theorem 1 ( Absolute Value Restricted Weights ) . Let |W| denote the matrix formed by taking the element-wise absolute value of W. If there exists a positive , diagonal P such that : P ( g|W| − I ) + ( g|W| − I ) TP ≺ 0 then equation 1 is contracting in metric P. Moreover , if Wii ≤ 0 , then |W |ii may be set to zero to reduce conservatism . Note that when g = 1 , Theorem 1 can be checked by checking for linear stability of |W| − I. Theorem 2 ( Symmetric Weights ) . If W = WT and gW ≺ I , then ( 1 ) is contracting . Theorem 3 ( Product of Diagonal and Orthogonal Weights ) . If there exists positive diagonal matrices P1 and P2 , as well as Q = QT 0 such that W = −P1QP2 then ( 1 ) is contracting in metric M = ( P1QP1 ) −1 . Theorem 4 ( Triangular Weights ) . If gW− I is triangular and Hurwitz , then ( 1 ) is contracting in a diagonal metric . Theorem 5 ( Singular Value Restricted Weights ) . If there exists a positive diagonal matrix P such that : g2WTPW −P ≺ 0 then ( 1 ) is contracting in metric P . 2.2 THE MODEL : NETWORK OF NETWORKS . The RNN in equation 1 is a subnetwork of our model . Our goal is to combine these subnetworks into a ‘ network of networks ’ in a manner that preserves the stability of the underlying modules . In particular , we seek to parameterize and learn the inter-module connections . To do this , we prove and make extensive use of the following theorem : Theorem 6 ( Network of Networks ) . Consider a collection of p subnetwork RNNs governed by equation 1 . Assume that these RNNs each have hidden-to-hidden weight matrices { W1 , . . . , Wp } and are independently contracting in metrics { M1 , . . . , Mp } . Define the block matrices W̃ ≡ BlockDiag ( W1 , . . . , Wp ) and M̃ ≡ BlockDiag ( M1 , . . . , Mp ) , as well as the overall state vector x̃T ≡ ( xT1 · · ·xT2 ) . Then the following ‘ network of networks ’ is globally contracting in metric M̃ : τ ˙̃x = −x̃ + W̃φ ( x̃ ) + u ( t ) + Lx̃ L ≡ B− M̃−1BTM̃ ( 2 ) Where B is an arbitrary square matrix . Note that we are agnostic to the particular contraction condition here – the subnetwork RNNs can satisfy any of the theorems in the preceding section . 2.3 ON STABILITY THEOREMS FOR RNNS . Several recent papers in machine learning , e.g ( Haber & Ruthotto , 2017 ; Chang et al. , 2019 ) , claim that a sufficient condition for stability of the nonlinear system : ẋ = f ( x , t ) is that the associated Jacobian matrix J ( x , t ) = ∂f∂x has eigenvalues whose real parts are strictly negative , i.e : max i Re ( λi ( J ( x , t ) ) ≤ −α with α > 0 . This claim is generally false . For a counter-example , see Section 4.4.2 in ( Slotine & Li , 1991 ) . However , in the specific case of the RNN ( 1 ) , it appears that the eigenvalues of the symmetric part of W do provide information on global stability in a number of applications . For example , in ( Matsuoka , 1992 ) it was shown that if Ws = 12 ( W + W T ) has all its eigenvalues less than unity , and u is constant , then ( 1 ) has a unique fixed point that is globally asymptotically stable . It is easy to see that this condition also implies that the real parts of the eigenvalues of the Jacobian are uniformly negative . Moreover , in ( Chang et al. , 2019 ) it was shown that setting the symmetric part of Ws = 12 ( W + W T ) almost equal to zero ( yet slightly negative ) led to rotational , yet stable dynamics in practice . This leads us to the following theorem , which shows that if the slopes of the activation functions change sufficiently slowly as a function of time , then the condition in ( Matsuoka , 1992 ) in fact implies global contraction of ( 1 ) . Theorem 7 . Let D be a positive , diagonal matrix with Dii = dφidxi , and let P be an arbitrary , positive diagonal matrix . If : ( gW − I ) P + P ( gWT − I ) −cP and Ḋ− cg−1D −βD for c , β > 0 , then ( 1 ) is contracting in metric D with rate β . It has been conjectured that diagonal stability of gW − I is a sufficient condition for global contraction of the RNN 1 ( Revay et al. , 2020b ) , however this has been difficult to prove . To better characterize this conjecture , we present Theorem 8 , which shows by way of counterexample that diagonal stability of gW − I does NOT imply global contraction in a constant metric for ( 1 ) . Theorem 8 . Satisfaction of the condition gWsym − I ≺ 0 is NOT sufficient to show global contraction of the general nonlinear RNN ( 1 ) in any constant metric . High levels of antisymmetry in W can make it impossible to find such a metric , which we demonstrate via a 2× 2 counterexample of the following form , with c ≥ 2 : W = [ 0 −c c 0 ] | This paper is primarily a theoretical contribution to the construction of assemblies of recurrent neural networks. We know that combinations of learned modular components can be powerful and far more tractable than learning bespoke models from scratch, particularly in applied domains (e.g. AlphaGo). Yet so far, we have no theoretical guarantees that these combinations will actually remain stable. This paper develops the theory behind provably-stable combinations of RNNs using weight constraints and feedback mechanisms. Then, using fixed RNNs generated according to these constraints (leaving the connections between them as antisymmetric learnable parameters), the authors show that their sparse combination network is able to achieve SOTA performance on sequential image classification benchmarks with far fewer learned parameters and the previous stability guarantee. | SP:3e145b336f187ed10a193fc6102d245fdd99e004 |
Solving Inverse Problems in Medical Imaging with Score-Based Generative Models | 1 INTRODUCTION . Computed Tomography ( CT ) and Magnetic Resonance Imaging ( MRI ) are commonly used imaging tools for medical diagnosis . Reconstructing CT and MRI images from raw measurements ( sinograms for CT and k-spaces for MRI ) are well-known inverse problems . Specifically , measurements in CT are given by X-ray projections of an object from various directions , and measurements in MRI are obtained by inspecting the Fourier spectrum of an object with magnetic fields . However , since obtaining the full sinogram for CT causes excessive ionizing radiation for patients , and measuring the full k-space of MRI is very time-consuming , it has become important to reduce the number of measurements in CT and MRI . In many cases , only partial measurements , such as sparse-view sinograms and downsampled k-spaces , are available . Due to this loss of information , the inverse problems in CT and MRI are often ill-posed , making image reconstruction especially challenging . With the rise of machine learning , many methods ( Zhu et al. , 2018 ; Mardani et al. , 2017 ; Shen et al. , 2019 ; Würfl et al. , 2018 ; Ghani & Karl , 2018 ; Wei et al. , 2020 ) have been proposed for medical image reconstruction using a small number of measurements . Most of these methods are supervised learning techniques . They learn to directly map partial measurements to medical images , by training on a large dataset comprising pairs of CT/MRI images and measurements . These measurements need to be synthesized from medical images with a fixed physical model of the measurement process . However , when the measurement process changes , such as using a different number of CT projections or different downsampling ratio of MRI k-spaces , we have to re-collect the paired dataset with the new measurement process and re-train the model . This prevents models from generalizing effectively to new measurement processes , leading to counter-intuitive instabilities such as more measurements causing worse performance ( Antun et al. , 2020 ) . In this work , we sidestep this difficulty completely by proposing unsupervised methods that do not require a paired dataset for training , and therefore are not restricted to a fixed measurement process . Our main idea is to learn the prior distribution of medical images with a generative model in order to infer the lost information due to partial measurements . Specifically , we propose to train a score-based generative model ( Song & Ermon , 2019 ; 2020 ; Song et al. , 2021 ) on medical images as the data prior , due to its strong performance in image generation ( Ho et al. , 2020 ; Dhariwal & Nichol , 2021 ) . Given a trained score-based generative model , we provide a family of sampling algorithms to create image samples that are consistent with the observed measurements and the estimated data prior , leveraging the physical measurement process . Once our model is trained , it can be used to solve any inverse problem within the same image domain , as long as the mapping from images to measurements is linear , which holds for a large number of medical imaging applications . We evaluate the performance of our method on several tasks in CT and MRI . Empirically , we observe comparable or better performance compared to supervised learning counterparts , even when evaluated with the same measurement process in their training . In addition , we are able to uniformly surpass all baselines when changing the number of measurements , e.g. , using a different number of projections in sparse-view CT or changing the k-space downsampling ratio in undersampled MRI . Moreover , we show that by plugging in a different measurement process , we can use a single model to perform both sparse-view CT reconstruction and metal artifact removal for CT imaging with metallic implants . To the best of our knowledge , this is the first time that generative models are reported successful on clinical CT data . Collectively , these empirical results indicate that our method is a competitive alternative to supervised techniques in medical image reconstruction and artifact removal , and has the potential to be a universal tool for solving many inverse problems within the same image domain . 2 BACKGROUND . 2.1 LINEAR INVERSE PROBLEMS . An inverse problem seeks to recover an unknown signal from a set of observed measurements . Specifically , suppose x P Rn is an unknown signal , and y P Rm “ Ax ` is a noisy observation given by m linear measurements , where the measurement acquisition process is represented by a linear operatorA P Rmˆn , and P Rn represents a noise vector . Solving a linear inverse problem amounts to recovering the signal x from its measurement y . Without further assumptions , the problem is ill-defined when m ă n , so we additionally assume that x is sampled from a prior distribution ppxq . In this probabilistic formulation , the measurement and signal are connected through a measurement distribution ppy | xq “ q py ´Axq , where q denotes the noise distribution of . Given ppy | xq and ppxq , we can solve the inverse problem by sampling from the posterior distribution ppx | yq . Examples of linear inverse problems in medical imaging include image reconstruction for CT and MRI . In both cases , the signal x is a medical image . The measurement y in CT is a sinogram formed by X-ray projections of the image from various angular directions ( Buzug , 2011 ) , while the measurement y in MRI consists of spatial frequencies in the Fourier space of the image ( a.k.a . the k-space in the MRI community ) ( Vlaardingerbroek & Boer , 2013 ) . 2.2 SCORE-BASED GENERATIVE MODELS . When solving inverse problems in medical imaging , we are given an observation y , the measurement distribution ppy | xq and aim to sample from the posterior distribution ppx | yq . The prior distribution ppxq is typically unknown , but we can train generative models on a dataset txp1q , xp2q , ¨ ¨ ¨ , xpNqu „ ppxq to estimate this prior distribution . Given an estimate of ppxq and the measurement distribution ppy | xq , the posterior distribution ppx | yq can be determined through Bayes ’ rule . We propose to estimate the prior distribution of medical images using the recently introduced scorebased generative models ( Song & Ermon , 2019 ; Ho et al. , 2020 ; Song et al. , 2021 ) , whose iterative sampling procedure makes it especially easy for controllable generation conditioned on an observation y . Specifically , we adopt the formulation of score-based generative models in Song et al . ( 2021 ) , where we leverage a Markovian diffusion process to progressively perturb data to noise , and then smoothly convert noise to samples of the data distribution by estimating and simulating its time reversal . We provide an illustration of this generative modeling framework in Fig . 1 . Perturbation process Suppose the dataset is sampled from an unknown data distribution ppxq . We perturb datapoints with a stochastic process over a time horizon r0 , 1s , governed by a linear stochastic differential equation ( SDE ) of the following form dxt “ fptqxt dt ` gptqdwt , t P r0 , 1s , ( 1 ) where f : r0 , 1s Ñ R , g : r0 , 1s Ñ R , twt P RnutPr0,1s denotes a standard Wiener process ( a.k.a. , Brownian motion ) , and txt P RnutPr0,1s symbolizes the trajectory of random variables in the stochastic process . We further denote the marginal probability distribution of xt as ptpxq , and the transition distribution from x0 to xt as p0tpxt | x0q . By definition , we clearly have p0pxq ” ppxq . Moreover , the functions fptq and gptq are specifically chosen such that for any initial distribution p0pxq , the distribution at the end of the perturbation process , p1pxq , is close to a pre-defined noise distribution πpxq . In addition , the transition density p0tpxt | x0q is always a conditional linear Gaussian distribution , taking the form p0tpxt | x0q “ N pxt | αptqx0 , β2ptqIq where α : r0 , 1s Ñ R and β : r0 , 1s Ñ R can be derived analytically from fptq and gptq ( Särkkä & Solin , 2019 ) . Examples of such SDEs include Variance Exploding ( VE ) , Variance Preserving ( VP ) , and subVP SDEs proposed in Song et al . ( 2021 ) . We found VE SDEs performed the best in our experiments . Reverse process By reversing the perturbation process in Eq . ( 1 ) , we can start from a noise sample x1 „ p1pxq and gradually remove the noise therein to obtain a data sample x0 „ p0pxq ” ppxq . Crucially , the time reversal of Eq . ( 1 ) is given by the following reverse-time SDE ( Song et al. , 2021 ) dxt “ “ fptqxt ´ gptq2∇xt log ptpxtq ‰ dt ` gptqdw̄t , t P r0 , 1s , ( 2 ) where tw̄tutPr0,1s denotes a standard Wiener process in the reverse-time direction , and dt represents an infinitesimal negative time step , since the above SDE must be solved backwards from t “ 1 to t “ 0 . The quantity ∇xt log ptpxtq is known as the score function of ptpxtq . By the definition of time reversal , the trajectory of the reverse stochastic process given by Eq . ( 2 ) is txtutPr0,1s , same as the one from the forward SDE in Eq . ( 1 ) . Sampling Given an initial sample from p1pxq , as well as scores at each intermediate time step , ∇x log ptpxq , we can simulate the reverse-time SDE in Eq . ( 2 ) to obtain samples from the data distribution p0pxq ” ppxq . In practice , the initial sample is approximately drawn from πpxq since πpxq « p1pxq , and the scores are estimated by training a neural network sθpx , tq ( named the score model ) on a dataset txp1q , xp2q , ¨ ¨ ¨ , xpNqu „ ppxq with denoising score matching ( Vincent , 2011 ; Song et al. , 2021 ) , i.e. , solving the following objective θ˚ “ arg min θ 1 N N ÿ i “ 1 Et „ Ur0,1sExpiqt „ p0tpxpiqt |xpiqq ” ∥∥∥sθpxpiqt , tq ´∇xpiqt log p0tpxpiqt | xpiqq∥∥∥22 ı , where Ur0 , 1s denotes a uniform distribution over r0 , 1s . The theory of denoising score matching ensures that sθ˚px , tq « ∇x log ptpxq . After training this score model , we plug it into Eq . ( 2 ) and solve the resulting reverse-time SDE dxt “ “ fptqxt ´ gptq2sθ˚pxt , tq ‰ dt ` gptqdw̄t , t P r0 , 1s , ( 3 ) for sample generation . One sampling method is to use the Euler-Maruyama discretization for solving Eq . ( 3 ) , as given in Algorithm 1 . Other sampling methods include annealed Langevin dynamics ( ALD , Song & Ermon , 2019 ) , probability flow ODE solvers ( Song et al. , 2021 ) , and Predictor-Corrector samplers ( Song et al. , 2021 ) . Algorithm 1 Unconditional sampling Require : N. 1 : x̂1 „ πpxq , ∆tÐ 1N 2 : for i “ N ´ 1 to 0 do 3 : tÐ i ` 1 N 4 : x̂t´∆t Ð x̂t ´ fptqx̂t∆t 5 : x̂t´∆t Ð x̂t´∆t ` gptq2sθ˚px̂t , tq∆t 6 : z „ N p0 , Iq 7 : x̂t´∆t Ð x̂t´∆t ` gptq ? ∆t z 8 : return x̂0 Algorithm 2 Inverse problem solving Require : N , y , λ 1 : x̂1 „ πpxq , ∆tÐ 1N 2 : for i “ N ´ 1 to 0 do 3 : tÐ i ` 1 N 4 : ŷt „ p0tpyt | yq 5 : x̂t Ð T´1rλΛP´1pΛqŷt ` p1´ λq ` ΛT ¨ x̂t ` pI ´ΛqT x̂ts 6 : x̂t´∆t Ð x̂t ´ fptqx̂t∆t 7 : x̂t´∆t Ð x̂t´∆t ` gptq2sθ˚px̂t , tq∆t 8 : z „ N p0 , Iq 9 : x̂t´∆t Ð x̂t´∆t ` gptq ? ∆t z 10 : return x̂0 | The manuscript applies denoising score matching to linear inverse problems to solve compressed sensing problems in medical imaging, such as angular-undersampled CT and accelerated MRI reconstruction. Throughout the paper, the observed measurements $y$ are considered noise-free, which is reflected by a Dirac measurement distribution. To train a score function, a variance exploding SDE is considered as in previous works, e.g. Song et al. (2021). During inference, the authors incorporate a weighted projection onto measurement samples unlike previous approaches, which consider the gradient of the data distribution. This projection can be implemented in various sampling approaches such as annealed Langevin dynamics or predictor-corrector schemes. The numerical results indicate that unsupervised score matching methods are well suited for inverse problems in imaging and yield superior generalization performance. | SP:2b838e0fc3a29d7d098f2163a92aa74b1aef2d2f |
Solving Inverse Problems in Medical Imaging with Score-Based Generative Models | 1 INTRODUCTION . Computed Tomography ( CT ) and Magnetic Resonance Imaging ( MRI ) are commonly used imaging tools for medical diagnosis . Reconstructing CT and MRI images from raw measurements ( sinograms for CT and k-spaces for MRI ) are well-known inverse problems . Specifically , measurements in CT are given by X-ray projections of an object from various directions , and measurements in MRI are obtained by inspecting the Fourier spectrum of an object with magnetic fields . However , since obtaining the full sinogram for CT causes excessive ionizing radiation for patients , and measuring the full k-space of MRI is very time-consuming , it has become important to reduce the number of measurements in CT and MRI . In many cases , only partial measurements , such as sparse-view sinograms and downsampled k-spaces , are available . Due to this loss of information , the inverse problems in CT and MRI are often ill-posed , making image reconstruction especially challenging . With the rise of machine learning , many methods ( Zhu et al. , 2018 ; Mardani et al. , 2017 ; Shen et al. , 2019 ; Würfl et al. , 2018 ; Ghani & Karl , 2018 ; Wei et al. , 2020 ) have been proposed for medical image reconstruction using a small number of measurements . Most of these methods are supervised learning techniques . They learn to directly map partial measurements to medical images , by training on a large dataset comprising pairs of CT/MRI images and measurements . These measurements need to be synthesized from medical images with a fixed physical model of the measurement process . However , when the measurement process changes , such as using a different number of CT projections or different downsampling ratio of MRI k-spaces , we have to re-collect the paired dataset with the new measurement process and re-train the model . This prevents models from generalizing effectively to new measurement processes , leading to counter-intuitive instabilities such as more measurements causing worse performance ( Antun et al. , 2020 ) . In this work , we sidestep this difficulty completely by proposing unsupervised methods that do not require a paired dataset for training , and therefore are not restricted to a fixed measurement process . Our main idea is to learn the prior distribution of medical images with a generative model in order to infer the lost information due to partial measurements . Specifically , we propose to train a score-based generative model ( Song & Ermon , 2019 ; 2020 ; Song et al. , 2021 ) on medical images as the data prior , due to its strong performance in image generation ( Ho et al. , 2020 ; Dhariwal & Nichol , 2021 ) . Given a trained score-based generative model , we provide a family of sampling algorithms to create image samples that are consistent with the observed measurements and the estimated data prior , leveraging the physical measurement process . Once our model is trained , it can be used to solve any inverse problem within the same image domain , as long as the mapping from images to measurements is linear , which holds for a large number of medical imaging applications . We evaluate the performance of our method on several tasks in CT and MRI . Empirically , we observe comparable or better performance compared to supervised learning counterparts , even when evaluated with the same measurement process in their training . In addition , we are able to uniformly surpass all baselines when changing the number of measurements , e.g. , using a different number of projections in sparse-view CT or changing the k-space downsampling ratio in undersampled MRI . Moreover , we show that by plugging in a different measurement process , we can use a single model to perform both sparse-view CT reconstruction and metal artifact removal for CT imaging with metallic implants . To the best of our knowledge , this is the first time that generative models are reported successful on clinical CT data . Collectively , these empirical results indicate that our method is a competitive alternative to supervised techniques in medical image reconstruction and artifact removal , and has the potential to be a universal tool for solving many inverse problems within the same image domain . 2 BACKGROUND . 2.1 LINEAR INVERSE PROBLEMS . An inverse problem seeks to recover an unknown signal from a set of observed measurements . Specifically , suppose x P Rn is an unknown signal , and y P Rm “ Ax ` is a noisy observation given by m linear measurements , where the measurement acquisition process is represented by a linear operatorA P Rmˆn , and P Rn represents a noise vector . Solving a linear inverse problem amounts to recovering the signal x from its measurement y . Without further assumptions , the problem is ill-defined when m ă n , so we additionally assume that x is sampled from a prior distribution ppxq . In this probabilistic formulation , the measurement and signal are connected through a measurement distribution ppy | xq “ q py ´Axq , where q denotes the noise distribution of . Given ppy | xq and ppxq , we can solve the inverse problem by sampling from the posterior distribution ppx | yq . Examples of linear inverse problems in medical imaging include image reconstruction for CT and MRI . In both cases , the signal x is a medical image . The measurement y in CT is a sinogram formed by X-ray projections of the image from various angular directions ( Buzug , 2011 ) , while the measurement y in MRI consists of spatial frequencies in the Fourier space of the image ( a.k.a . the k-space in the MRI community ) ( Vlaardingerbroek & Boer , 2013 ) . 2.2 SCORE-BASED GENERATIVE MODELS . When solving inverse problems in medical imaging , we are given an observation y , the measurement distribution ppy | xq and aim to sample from the posterior distribution ppx | yq . The prior distribution ppxq is typically unknown , but we can train generative models on a dataset txp1q , xp2q , ¨ ¨ ¨ , xpNqu „ ppxq to estimate this prior distribution . Given an estimate of ppxq and the measurement distribution ppy | xq , the posterior distribution ppx | yq can be determined through Bayes ’ rule . We propose to estimate the prior distribution of medical images using the recently introduced scorebased generative models ( Song & Ermon , 2019 ; Ho et al. , 2020 ; Song et al. , 2021 ) , whose iterative sampling procedure makes it especially easy for controllable generation conditioned on an observation y . Specifically , we adopt the formulation of score-based generative models in Song et al . ( 2021 ) , where we leverage a Markovian diffusion process to progressively perturb data to noise , and then smoothly convert noise to samples of the data distribution by estimating and simulating its time reversal . We provide an illustration of this generative modeling framework in Fig . 1 . Perturbation process Suppose the dataset is sampled from an unknown data distribution ppxq . We perturb datapoints with a stochastic process over a time horizon r0 , 1s , governed by a linear stochastic differential equation ( SDE ) of the following form dxt “ fptqxt dt ` gptqdwt , t P r0 , 1s , ( 1 ) where f : r0 , 1s Ñ R , g : r0 , 1s Ñ R , twt P RnutPr0,1s denotes a standard Wiener process ( a.k.a. , Brownian motion ) , and txt P RnutPr0,1s symbolizes the trajectory of random variables in the stochastic process . We further denote the marginal probability distribution of xt as ptpxq , and the transition distribution from x0 to xt as p0tpxt | x0q . By definition , we clearly have p0pxq ” ppxq . Moreover , the functions fptq and gptq are specifically chosen such that for any initial distribution p0pxq , the distribution at the end of the perturbation process , p1pxq , is close to a pre-defined noise distribution πpxq . In addition , the transition density p0tpxt | x0q is always a conditional linear Gaussian distribution , taking the form p0tpxt | x0q “ N pxt | αptqx0 , β2ptqIq where α : r0 , 1s Ñ R and β : r0 , 1s Ñ R can be derived analytically from fptq and gptq ( Särkkä & Solin , 2019 ) . Examples of such SDEs include Variance Exploding ( VE ) , Variance Preserving ( VP ) , and subVP SDEs proposed in Song et al . ( 2021 ) . We found VE SDEs performed the best in our experiments . Reverse process By reversing the perturbation process in Eq . ( 1 ) , we can start from a noise sample x1 „ p1pxq and gradually remove the noise therein to obtain a data sample x0 „ p0pxq ” ppxq . Crucially , the time reversal of Eq . ( 1 ) is given by the following reverse-time SDE ( Song et al. , 2021 ) dxt “ “ fptqxt ´ gptq2∇xt log ptpxtq ‰ dt ` gptqdw̄t , t P r0 , 1s , ( 2 ) where tw̄tutPr0,1s denotes a standard Wiener process in the reverse-time direction , and dt represents an infinitesimal negative time step , since the above SDE must be solved backwards from t “ 1 to t “ 0 . The quantity ∇xt log ptpxtq is known as the score function of ptpxtq . By the definition of time reversal , the trajectory of the reverse stochastic process given by Eq . ( 2 ) is txtutPr0,1s , same as the one from the forward SDE in Eq . ( 1 ) . Sampling Given an initial sample from p1pxq , as well as scores at each intermediate time step , ∇x log ptpxq , we can simulate the reverse-time SDE in Eq . ( 2 ) to obtain samples from the data distribution p0pxq ” ppxq . In practice , the initial sample is approximately drawn from πpxq since πpxq « p1pxq , and the scores are estimated by training a neural network sθpx , tq ( named the score model ) on a dataset txp1q , xp2q , ¨ ¨ ¨ , xpNqu „ ppxq with denoising score matching ( Vincent , 2011 ; Song et al. , 2021 ) , i.e. , solving the following objective θ˚ “ arg min θ 1 N N ÿ i “ 1 Et „ Ur0,1sExpiqt „ p0tpxpiqt |xpiqq ” ∥∥∥sθpxpiqt , tq ´∇xpiqt log p0tpxpiqt | xpiqq∥∥∥22 ı , where Ur0 , 1s denotes a uniform distribution over r0 , 1s . The theory of denoising score matching ensures that sθ˚px , tq « ∇x log ptpxq . After training this score model , we plug it into Eq . ( 2 ) and solve the resulting reverse-time SDE dxt “ “ fptqxt ´ gptq2sθ˚pxt , tq ‰ dt ` gptqdw̄t , t P r0 , 1s , ( 3 ) for sample generation . One sampling method is to use the Euler-Maruyama discretization for solving Eq . ( 3 ) , as given in Algorithm 1 . Other sampling methods include annealed Langevin dynamics ( ALD , Song & Ermon , 2019 ) , probability flow ODE solvers ( Song et al. , 2021 ) , and Predictor-Corrector samplers ( Song et al. , 2021 ) . Algorithm 1 Unconditional sampling Require : N. 1 : x̂1 „ πpxq , ∆tÐ 1N 2 : for i “ N ´ 1 to 0 do 3 : tÐ i ` 1 N 4 : x̂t´∆t Ð x̂t ´ fptqx̂t∆t 5 : x̂t´∆t Ð x̂t´∆t ` gptq2sθ˚px̂t , tq∆t 6 : z „ N p0 , Iq 7 : x̂t´∆t Ð x̂t´∆t ` gptq ? ∆t z 8 : return x̂0 Algorithm 2 Inverse problem solving Require : N , y , λ 1 : x̂1 „ πpxq , ∆tÐ 1N 2 : for i “ N ´ 1 to 0 do 3 : tÐ i ` 1 N 4 : ŷt „ p0tpyt | yq 5 : x̂t Ð T´1rλΛP´1pΛqŷt ` p1´ λq ` ΛT ¨ x̂t ` pI ´ΛqT x̂ts 6 : x̂t´∆t Ð x̂t ´ fptqx̂t∆t 7 : x̂t´∆t Ð x̂t´∆t ` gptq2sθ˚px̂t , tq∆t 8 : z „ N p0 , Iq 9 : x̂t´∆t Ð x̂t´∆t ` gptq ? ∆t z 10 : return x̂0 | This paper provides an unsupervised approach to solve the inverse problem for reconstructing medical CT and MRI scans using score-based generative models. The proposed method was evaluated on the LIDC and BraTS datasets. Compared to existing supervised and unsupervised approaches, the proposed method demonstrates comparable or better performances in terms of PSNR and SSIM. | SP:2b838e0fc3a29d7d098f2163a92aa74b1aef2d2f |
An Efficient and Reliable Tolerance-Based Algorithm for Principal Component Analysis | 1 INTRODUCTION . 1.1 THE TRUNCATED SVD AND PCA . Let A be an m×n real matrix and A = UΣV T its singular value decomposition ( SVD ) . The rank-k truncated SVD ( rank-k TSVD ) of A is the matrix Ak : = UkΣkV TK , where Uk and Vk are the first k columns of U and V , respectively , and Σk is the leading k × k block of Σ . The columns uj and vj of Uk and Vk are the left and right singular vectors of A , respectively , and the diagonal entries σ1 ( A ) ≥ · · · ≥ σk ( A ) ≥ 0 are the singular values of A . One common use of TSVD is in principal component analysis ( PCA ) . This is a dimensionality reduction technique that aims to find the directions in which the data varies the most . It turns out that these directions are given by the top k right singular vectors vj , 1 ≤ j ≤ k. Projecting the original data onto these directions then transforms the data from a high-dimensional space into a lower-dimensional one . Typically , k is chosen so that these principal directions explain a certain amount of variance in the data . For example , if the user wanted to explain 99 % of the variance , they would choose k so that ∑k i=1 σi ( A ) 2/ ∑n i=1 σi ( A ) 2 ≥ 0.99 . PCA is used to compress data in a variety of settings such as images , training data for machine learning algorithms , and even neural network weight matrices ( Xue et al. , 2013 ) . In this work , we will be interested in a slightly different version of PCA . Let ε be a user-prescribed tolerance , and instead choose k so that σk ( A ) ≥ ε ≥ σk+1 ( A ) . Since the ith principal component explains σi ( A ) 2/ ∑n i=1 σi ( A ) 2 fraction of the total variance , we are essentially ignoring any components that explain less than ε2/ ∑n i=1 σi ( A ) 2 fraction of the total variance . This can be interpreted as discarding principal components corresponding to noise , where ε describes the size of the noise . Despite its utility and importance , the main drawback of using TSVD for PCA is that it is expensive , especially when the user needs only the top few singular values/vectors . Thus , a large body of research has been devoted to finding faster ways of computing it without sacrificing too much accuracy . 1.2 PRIOR WORK . The literature on fast , approximate TSVD algorithms typically assume the user knows what rank k to use . Recent work uses randomization to reduce the run time while still maintaining a high level of accuracy . See , for example , Rokhlin et al . ( 2010 ) and Halko et al . ( 2010 ) and the references therein for typical examples of these types of algorithms . In Musco & Musco ( 2015 ) , the authors present a randomized algorithm based on block Krylov subspace methods to compute an approximate TSVD . For a matrix A , rank k , and tolerance ε , the algorithm produces a matrix Z whose columns approximate the top k left singular vectors of A and such that ∥∥A− ZZTA∥∥ 2 ≤ ( 1 + ε ) ∥A−Ak∥2 . They also prove stronger bounds on the quality of the singular vectors , which is important for PCA . This algorithm is especially suited to sparse matrices , which can be multiplied quickly . In some cases , the user may not know ahead of time what k to use , so it is useful to consider algorithms which accept a desired precision ε as input rather than rank . Algorithms in this vein incrementally build a matrix Q with orthogonal columns and another matrix B until ∥A−QB∥ < ε . Typically , the number of columns of Q ( or the number of rows of B ) is quite small so that QB is a compact approximation of the original data A . An approximate TSVD of A can then be produced from the SVD of B . Recent work again uses randomization to reduce the run time . We present a prototypical example of this style of algorithm in Algorithm 1 ( Yu et al. , 2018 ) . See Halko et al . ( 2010 ) and Martinsson & Voronin ( 2016 ) for more examples . While these algorithms guarantee a small approximation error , there are no guarantees on the accuracy of the singular values or vectors . We will compare the accuracy for Algorithm 1 to the proposed algorithm in Experiments . Algorithm 1 The randQB EI algorithm for the fixed-precision problem Input : an m× n matrix A ; desired accuracy tolerance ε ; block size b Output : Q , B such that ∥A−QB∥F < ε Q = [ ] ; B = [ ] ; E = ∥A∥2F for i = 1 , 2 , 3 , . . . do Ωi = randn ( n , b ) Qi = orth ( AΩi −Q ( BΩi ) ) Qi = orth ( Qi −Q ( QTQi ) ) Bi = Q T i A Q = [ Q , Qi ] B = [ B Bi ] E = E − ∥Bi∥2F if E < ε2 then stop end for 1.3 OUR WORK . In this work , we propose an algorithm that , for a matrix A , accuracy tolerance δ , and singular value tolerance ε , produces an approximate TSVD Ãk satisfying : 1 . The rank k of Ãk does not exceed the true rank of A , determined by the tolerance ε as described above , 2. σj ( Ãk ) ≥ ( 1− δ ) σj ( A ) for 1 ≤ j ≤ k , 3 . ∥∥∥A− Ãk∥∥∥ 2 ≤ 1+δ1−δ ε ≈ ( 1 + 2δ ) ε , and 4 . If k coincides with the true rank , then ∥∥∥A− Ãk∥∥∥ 2 ≤ ( 1+δ ) σk+1 ( A ) = ( 1+δ ) ∥A−Ak∥2 , i.e . the truncation error is a factor of 1 + δ from optimal . These properties are verified in the Appendix . The algorithm thus yields a high-quality approximation to TSVD and can be used in applications as an approximate PCA . The algorithm is fast for matrices whose singular values decay quickly when ε is set so that k will be relatively small . 2 PRELIMINARIES . Unless otherwise stated , we will consider matrices with more rows than columns . For a matrix with more columns than rows , apply the algorithm to its transpose . 2.1 FLIP-FLOP SPECTRUM REVEALING QR . The proposed algorithm is essentially a tolerance-based version of Flip-Flop Spectrum Revealing QR ( FFQR ) ( Feng et al. , 2019 ) . For a matrix A and integers k ≤ l , FFQR produces an approximation to the rank-k TSVD Ak whose accuracy depends on the ratio σk+1 ( A ) /σl+1 ( A ) . Thus , if A has rapidly decaying singular values , FFQR will be close to TSVD . FFQR is computed as follows . Let A be an m × n matrix ( m ≥ n ) and k ≤ l. Perform l steps of Randomized QR with Column Pivoting ( RQRCP ) ( Duersch & Gu , 2017 ) to get the factorization AΠ = QR = Q ( R11 R12 0 R22 ) , where Π is an n× n permutation matrix , Q is an m×m orthogonal matrix , R is m× n , and R11 is an l × l upper triangular matrix . The next phase of FFQR involves performing extra “ spectrum-revealing ” column swaps on R and using Givens rotations to restore its upper trapezoidal form . These swaps ensure ∥R22∥2 = O ( σl ( A ) ) . See Xiao et al . ( 2017 ) for more details . Next , perform l steps of QR on RT to get RT = PLT = ( P1 P2 ) ( L11 0 L21 L22 ) T , where P is an n× n orthogonal matrix , P1 is its leading l columns , L is an m× n matrix , and L11 is l × l lower triangular . Putting the above together yields A = QRΠT = Q ( L11 0 L21 L22 ) PTΠT . Discard L22 ( as in truncated QRCP ) and approximate ( L11 L21 ) with its rank-k TSVD ÛkΣ̂kV̂ Tk : Q ( L11 0 L21 L22 ) PTΠT ≈ Q ( L11 L21 ) PT1 Π T ≈ Q ( ÛkΣ̂kV̂ Tk ) PT1 ΠT Setting Ũk : = QÛk , Σ̃k : = Σ̂k , Ṽk : = ΠP1V̂k gives the rank-k approximation A ≈ ŨkΣ̃kṼ Tk . In Feng et al . ( 2019 ) , the authors prove the following bounds for FFQR . Given ε > 0 and g > 1 , there are matrix-dependent quantities g1 ≤ √ 1+ε 1−ε , g2 ≤ g , τ ≤ g1g2 √ ( l + 1 ) ( n− l ) , and τ̂ ≤ g1g2 √ l ( n− l ) such that for 1 ≤ j ≤ k , σj ( Σk ) ≥ σj ( A ) 4 √ 1 + min ( 2τ̂4 , τ4 ( 2 + 4τ̂4 ) ( σl+1 ( A ) σj ( A ) ) 4 ) and ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) 4 √ 1 + 2τ4 ( σl+1 ( A ) σk+1 ( A ) ) 4 . 2.2 THE QLP DECOMPOSITION . The basis of FFQR is the QLP decomposition ( Stewart , 1999 ) . Let A be an m× n matrix . Perform QRCP on A to obtain AΠ = QR and then perform QRCP on RT to get RTΠ1 = PLT , where L is lower triangular . Putting these together yields A = QΠ1LPTΠT . This is the pivoted QLP decomposition of A. Stewart observed that the diagonal entries Lii of L closely track the singular values of A . For the proposed algorithm , we choose not to pivot when factoring RT . In this case , Lii will not track σi ( A ) as well . We will discuss a partial remedy for this below . The advantage of not pivoting is that , just as in FFQR , we do not have to finish computing R before computing L. Once we have performed l steps of QRCP on A , we can compute the first l rows of L and thus have access to its first l diagonal entries . 3 A FAST , APPROXIMATE , TOLERANCE-BASED PCA ALGORITHM . 3.1 BLOCKED FFQR . Since we do not know what l is beforehand , we compute R and L incrementally in blocks . Select a block size b and perform b steps of RQRCP to get AΠ1 = Q1 ( R ( b ) 11 R ( b ) 12 0 R ( b ) 22 ) , where R ( b ) 11 is b × b upper triangular . The first b rows of R are essentially done since subsequent steps of RQRCP will only permute the columns of R ( b ) 12 . Perform QR on them ( to keep the notation simple , we write this as an LQ factorization ) : ( R ( b ) 11 R ( b ) 12 ) = ( L11 0 ) P T 1 , where L11 is b × b lower triangular , and P1 is orthogonal . We have just computed the first b rows of L and know the first b diagonal entries . For the next block , continue RQRCP for another b steps . The permutation matrix Π2 in this block will affect only columns b + 1 through n , leaving the first b columns untouched . Thus , Π2 can be written in block form as Π2 = ( Ib 0 0 Π̃2 ) , where Ib is the b× b identity matrix and Π̃2 is an ( n− b ) × ( n− b ) permutation matrix . We now have AΠ1Π2 = Q2Q1 R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 0 0 R ( 2b ) 22 , where R ( 2b ) 11 is b× b upper triangular . Since the first b rows have changed , we must account for this in the previous LQ : ( R ( b ) 11 R ( b ) 12 Π̃2 ) = ( R ( b ) 11 R ( b ) 12 ) Π2 = ( L11 0 ) P T 1 Π2 . Now apply the matrix ΠT2 P1 to the newly completed rows ( 0 R ( 2b ) 11 R ( 2b ) 12 ) and perform LQ on the last n− b columns to get ( 0 R ( 2b ) 11 R ( 2b ) 12 ) ΠT2 P1 = ( L21 L22 0 ) P T 2 , where L22 is b× b lower triangular . The orthogonal matrix P2 affects only the last n − b columns and can therefore be written in block form as P2 = ( Ib 0 0 P̃2 ) . Hence , ( L11 0 ) = ( L11 0 ) PT2 and ( R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 ) = ( L11 0 0 L21 L22 0 ) PT2 P T 1 Π2 , showing that we have computed the first 2b rows of L. We can continue this procedure , computing b rows of L at a time . Once we decide to stop , we finish the remaining rows of L by applying the orthogonal matrices from all previous LQ factorizations to the last rows of R. For example , if we wanted to stop after 2 blocks , apply ΠT2 P1P2 to ( 0 0 R ( 2b ) 22 ) to get ( 0 0 R ( 2b ) 22 ) ΠT2 P1P2 = ( L31 L32 L33 ) and the partial QLP decomposition AΠ1Π2 = Q2Q1 R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 0 0 R ( 2b ) 22 = Q2Q1 ( L11 0 0L21 L22 0 L31 L32 L33 ) PT2 P T 1 Π2 . Afterwards , spectrum-revealing swaps can be performed if desired . For each swap and uppertrapezoidal restoration , some nonzero entries will appear above the diagonal in L. These are easily eliminated with Givens rotations . 3.2 DETERMINING l We now derive a criterion to determine when to stop factoring in blocked FFQR and to find l. Let ε be the tolerance parameter , and define the rank k by σk+1 ( A ) ≤ ε ≤ σk ( A ) . One could use the bounds derived in Feng et al . ( 2019 ) , using the diagonal entries of L to estimate the singular values of A and stopping when σl+1 ( A ) /σk+1 ( A ) is sufficiently small . However , the dimension-dependent bounds for τ and τ̂ are impractical , so we will use a different bound . In Feng et al . ( 2019 ) , the authors prove that σj ( A ) 4 ≤ σj ( Σk ) 4+2 ∥R22∥42 , 1 ≤ j ≤ k. Rearranging this inequality gives σj ( Σk ) ≥ σj ( A ) 4 √ 1− 2 ∥R22∥42 σj ( A ) 4 , 1 ≤ j ≤ k. They also prove the following bound on the truncation error : ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) 4 √ 1 + 2 ∥R22∥42 σk+1 ( A ) 4 . ( 1 ) These bounds hold even without spectrum-revealing swaps . So , if ∥R22∥2 /σk+1 ( A ) , is small , then the leading k singular values of A will be revealed up to a certain number of digits and ŨkΣ̃kṼ Tk will be a nearly optimal rank-k approximation . In practice , the above two bounds are sufficient because ∥R22∥2 = O ( σl ( A ) ) already , without extra swaps . The earlier bounds still have theoretical value in that they show the algorithm works well when A has rapidly decaying singular values . The factors 4 √ 1− 2∥R22∥ 4 2 σj ( A ) 4 and 4 √ 1 + 2 ∥R22∥42 σk+1 ( A ) 4 are equal to 1 − 12 ∥R22∥42 σj ( A ) 4 and 1 + 12 ∥R22∥42 σk+1 ( A ) 4 , respectively , up to first order . Introduce an accuracy parameter δ , and say we have 12 ∥R22∥42 σk+1 ( A ) 4 ≤ δ . Then we have σj ( Σ̃k ) ≥ σj ( A ) ( 1− δ ) , 1 ≤ j ≤ k , and ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) ( 1+ δ ) up to first order . This means that ≈ − log δ digits of the top k singular values of A and optimal truncation error have been computed correctly . We can rewrite 12 ∥R22∥42 σk+1 ( A ) 4 ≤ δ as ∥R22∥2 ≤ σk+1 ( A ) 4 √ 2δ . This is the tolerance-based criterion to determine l. 3.2.1 ESTIMATING σk+1 AND ∥R22∥2 To estimate ∥R22∥2 and σk+1 ( A ) accurately , we use Stewart ’ s observation that the diagonal entries Lii of L closely track the singular values σi ( A ) of A . As stated above , Lii will not track σi ( A ) as well because we are not pivoting when factoring RT . A partial remedy is simply to sort the Lii ’ s . We show below that the resulting tracking behavior is similar in quality to that of fully pivoted QLP . Let L ( j ) be the j-th largest diagonal entry of L in magnitude , i.e . ∣∣L ( 1 ) ∣∣ ≥ ∣∣L ( 2 ) ∣∣ ≥ · · · ≥ ∣∣L ( n ) ∣∣ . In light of Stewart ’ s observation , we will assume that there are constants α and β such that α ∣∣L ( j ) ∣∣ ≤ σj ( A ) ≤ β ∣∣L ( j ) ∣∣ , 1 ≤ j ≤ n. The values of α and β will be estimated empirically below . A simple way to interpret these inequalities is that for each diagonal entry Ljj , there is a singular value of A in the interval [ α |Ljj | , β |Ljj | ] . Consider { Ljj : β |Ljj | ≤ ε } . This just corresponds to all the intervals [ α |Ljj | , β |Ljj | ] contained in ( −∞ , ε ] . For each Ljj in the set , there is a singular value σi ( A ) in the corresponding interval . Thus σi ( A ) ≤ ε . Since σk+1 ( A ) is the largest singular value of A less than or equal to ε , we must have σi ( A ) ≤ σk+1 ( A ) , which then implies α |Ljj | ≤ σk+1 ( A ) . This yields a lower bound on σk+1 ( A ) , namely max { α |Ljj | : β |Ljj | ≤ ε } . Since we will not know all the Ljj ’ s , we can obtain only a sub-optimal lower bound sk+1 on σk+1 ( A ) . Initialize sk+1 = 0 . After i blocks of blocked FFQR , update sk+1 = max { α |Ljj | : β |Ljj | ≤ ε and j ≤ ib } . To estimate ∥R22∥2 = σ1 ( R22 ) , we will use the first diagonal entry L11 of L in the fully pivoted QLP factorization . First , consider a general matrix A , and perform QRCP : AΠ = QR . Then in fully pivoted QLP , |L11| is just the largest row norm of R. As noted in Stewart ( 1999 ) , the largest row of R is usually among the first few rows . Thus we can estimate ∥A∥2 using max1≤i≤q ∥R ( i , : ) ∥2 , for some small integer q . This requires only q steps of QRCP . We can apply this idea to estimate ∥R22∥2 . After i steps of QRCP on A , the R factor has the form ( R ( i ) 1 0 R ( i ) 22 ) , where R ( i ) 1 is i×n upper triangular . The R factor in the QRCP factorization of R ( i ) 22 is just R ( n ) 1 ( i+1 : m , i+1 : n ) . Thus , QRCP-factoring A automatically yields the QRCP factorizations of all the trailing blocks R ( i ) 22 . Using the 2-norm estimation scheme in the previous paragraph , after j steps of QRCP , we have the upper bound ∥∥∥R ( i ) 22 ∥∥∥ 2 ≤ β max i≤ι≤i+q−1 ∥∥∥R ( j ) 1 ( ι , : ) ∥∥∥ 2 : = β ∥∥∥R ( i ) 22 ∥∥∥ j , q for 1 ≤ i ≤ j − q + 1 . Putting these estimates together will give us the final stopping criterion . After each block , we first update sk+1 with the newly computed Ljj ’ s and then check if ∥∥∥R ( i ) 22 ∥∥∥ j , q ≤ 1β sk+1 4 √ 2δ for some i . The smallest i for which this inequality holds will be l + 1 . Algorithm 2 Approximate , tolerance-based PCA Inputs : A , tolerance ε , accuracy δ , block size b , number of rows q , oversampling size p for RQRCP Outputs : Rank k , Ũk , Σ̃k , Ṽk c← 0 , sk+1 ← 0 while c < n do Perform steps c+ 1 to c+ b of RQRCP on A ; update Q , R , and Π Compute rows c+ 1 to c+ b of L ; update P for j = c+ 1 : c+ b do if |Ljj | ≤ ε/β and α |Ljj | ≥ sk+1 then sk+1 ← α |Ljj | end if end for for i = 1 : c+ b− q + 1 do if ∥∥∥R ( i ) 22 ∥∥∥ c+b , q ≤ 1β sk+1 4 √ 2δ then l← i− 1 exit while loop end if end for c← c+ b end while Compute rows c+ b+ 1 to m of L. Compute TSVD ÛkΣ̂kV̂k of L ( : , 1 : l ) , where k satisfies σk ( L ( : , 1 : l ) ) ≥ ε ≥ σk+1 ( L ( : , 1 : l ) ) . Ũk ← QÛk , Σ̃k ← Σ̂k , Ṽk ← ΠP1V̂k | This paper presents a PCA algorithm that terminates after approximate singular values fall below a user provided threshold. The proposed method is based on the FFQR algorithm of Feng et al, but includes a tolerance based stopping criteria. It is stated that the algorithm runs $O(mnl)$ time. Experimental results are provided for comparison between TSVD and randQB_EI of Yue et al. | SP:b91c2d68ececc4827e5619ade1afdd2249b0d962 |
An Efficient and Reliable Tolerance-Based Algorithm for Principal Component Analysis | 1 INTRODUCTION . 1.1 THE TRUNCATED SVD AND PCA . Let A be an m×n real matrix and A = UΣV T its singular value decomposition ( SVD ) . The rank-k truncated SVD ( rank-k TSVD ) of A is the matrix Ak : = UkΣkV TK , where Uk and Vk are the first k columns of U and V , respectively , and Σk is the leading k × k block of Σ . The columns uj and vj of Uk and Vk are the left and right singular vectors of A , respectively , and the diagonal entries σ1 ( A ) ≥ · · · ≥ σk ( A ) ≥ 0 are the singular values of A . One common use of TSVD is in principal component analysis ( PCA ) . This is a dimensionality reduction technique that aims to find the directions in which the data varies the most . It turns out that these directions are given by the top k right singular vectors vj , 1 ≤ j ≤ k. Projecting the original data onto these directions then transforms the data from a high-dimensional space into a lower-dimensional one . Typically , k is chosen so that these principal directions explain a certain amount of variance in the data . For example , if the user wanted to explain 99 % of the variance , they would choose k so that ∑k i=1 σi ( A ) 2/ ∑n i=1 σi ( A ) 2 ≥ 0.99 . PCA is used to compress data in a variety of settings such as images , training data for machine learning algorithms , and even neural network weight matrices ( Xue et al. , 2013 ) . In this work , we will be interested in a slightly different version of PCA . Let ε be a user-prescribed tolerance , and instead choose k so that σk ( A ) ≥ ε ≥ σk+1 ( A ) . Since the ith principal component explains σi ( A ) 2/ ∑n i=1 σi ( A ) 2 fraction of the total variance , we are essentially ignoring any components that explain less than ε2/ ∑n i=1 σi ( A ) 2 fraction of the total variance . This can be interpreted as discarding principal components corresponding to noise , where ε describes the size of the noise . Despite its utility and importance , the main drawback of using TSVD for PCA is that it is expensive , especially when the user needs only the top few singular values/vectors . Thus , a large body of research has been devoted to finding faster ways of computing it without sacrificing too much accuracy . 1.2 PRIOR WORK . The literature on fast , approximate TSVD algorithms typically assume the user knows what rank k to use . Recent work uses randomization to reduce the run time while still maintaining a high level of accuracy . See , for example , Rokhlin et al . ( 2010 ) and Halko et al . ( 2010 ) and the references therein for typical examples of these types of algorithms . In Musco & Musco ( 2015 ) , the authors present a randomized algorithm based on block Krylov subspace methods to compute an approximate TSVD . For a matrix A , rank k , and tolerance ε , the algorithm produces a matrix Z whose columns approximate the top k left singular vectors of A and such that ∥∥A− ZZTA∥∥ 2 ≤ ( 1 + ε ) ∥A−Ak∥2 . They also prove stronger bounds on the quality of the singular vectors , which is important for PCA . This algorithm is especially suited to sparse matrices , which can be multiplied quickly . In some cases , the user may not know ahead of time what k to use , so it is useful to consider algorithms which accept a desired precision ε as input rather than rank . Algorithms in this vein incrementally build a matrix Q with orthogonal columns and another matrix B until ∥A−QB∥ < ε . Typically , the number of columns of Q ( or the number of rows of B ) is quite small so that QB is a compact approximation of the original data A . An approximate TSVD of A can then be produced from the SVD of B . Recent work again uses randomization to reduce the run time . We present a prototypical example of this style of algorithm in Algorithm 1 ( Yu et al. , 2018 ) . See Halko et al . ( 2010 ) and Martinsson & Voronin ( 2016 ) for more examples . While these algorithms guarantee a small approximation error , there are no guarantees on the accuracy of the singular values or vectors . We will compare the accuracy for Algorithm 1 to the proposed algorithm in Experiments . Algorithm 1 The randQB EI algorithm for the fixed-precision problem Input : an m× n matrix A ; desired accuracy tolerance ε ; block size b Output : Q , B such that ∥A−QB∥F < ε Q = [ ] ; B = [ ] ; E = ∥A∥2F for i = 1 , 2 , 3 , . . . do Ωi = randn ( n , b ) Qi = orth ( AΩi −Q ( BΩi ) ) Qi = orth ( Qi −Q ( QTQi ) ) Bi = Q T i A Q = [ Q , Qi ] B = [ B Bi ] E = E − ∥Bi∥2F if E < ε2 then stop end for 1.3 OUR WORK . In this work , we propose an algorithm that , for a matrix A , accuracy tolerance δ , and singular value tolerance ε , produces an approximate TSVD Ãk satisfying : 1 . The rank k of Ãk does not exceed the true rank of A , determined by the tolerance ε as described above , 2. σj ( Ãk ) ≥ ( 1− δ ) σj ( A ) for 1 ≤ j ≤ k , 3 . ∥∥∥A− Ãk∥∥∥ 2 ≤ 1+δ1−δ ε ≈ ( 1 + 2δ ) ε , and 4 . If k coincides with the true rank , then ∥∥∥A− Ãk∥∥∥ 2 ≤ ( 1+δ ) σk+1 ( A ) = ( 1+δ ) ∥A−Ak∥2 , i.e . the truncation error is a factor of 1 + δ from optimal . These properties are verified in the Appendix . The algorithm thus yields a high-quality approximation to TSVD and can be used in applications as an approximate PCA . The algorithm is fast for matrices whose singular values decay quickly when ε is set so that k will be relatively small . 2 PRELIMINARIES . Unless otherwise stated , we will consider matrices with more rows than columns . For a matrix with more columns than rows , apply the algorithm to its transpose . 2.1 FLIP-FLOP SPECTRUM REVEALING QR . The proposed algorithm is essentially a tolerance-based version of Flip-Flop Spectrum Revealing QR ( FFQR ) ( Feng et al. , 2019 ) . For a matrix A and integers k ≤ l , FFQR produces an approximation to the rank-k TSVD Ak whose accuracy depends on the ratio σk+1 ( A ) /σl+1 ( A ) . Thus , if A has rapidly decaying singular values , FFQR will be close to TSVD . FFQR is computed as follows . Let A be an m × n matrix ( m ≥ n ) and k ≤ l. Perform l steps of Randomized QR with Column Pivoting ( RQRCP ) ( Duersch & Gu , 2017 ) to get the factorization AΠ = QR = Q ( R11 R12 0 R22 ) , where Π is an n× n permutation matrix , Q is an m×m orthogonal matrix , R is m× n , and R11 is an l × l upper triangular matrix . The next phase of FFQR involves performing extra “ spectrum-revealing ” column swaps on R and using Givens rotations to restore its upper trapezoidal form . These swaps ensure ∥R22∥2 = O ( σl ( A ) ) . See Xiao et al . ( 2017 ) for more details . Next , perform l steps of QR on RT to get RT = PLT = ( P1 P2 ) ( L11 0 L21 L22 ) T , where P is an n× n orthogonal matrix , P1 is its leading l columns , L is an m× n matrix , and L11 is l × l lower triangular . Putting the above together yields A = QRΠT = Q ( L11 0 L21 L22 ) PTΠT . Discard L22 ( as in truncated QRCP ) and approximate ( L11 L21 ) with its rank-k TSVD ÛkΣ̂kV̂ Tk : Q ( L11 0 L21 L22 ) PTΠT ≈ Q ( L11 L21 ) PT1 Π T ≈ Q ( ÛkΣ̂kV̂ Tk ) PT1 ΠT Setting Ũk : = QÛk , Σ̃k : = Σ̂k , Ṽk : = ΠP1V̂k gives the rank-k approximation A ≈ ŨkΣ̃kṼ Tk . In Feng et al . ( 2019 ) , the authors prove the following bounds for FFQR . Given ε > 0 and g > 1 , there are matrix-dependent quantities g1 ≤ √ 1+ε 1−ε , g2 ≤ g , τ ≤ g1g2 √ ( l + 1 ) ( n− l ) , and τ̂ ≤ g1g2 √ l ( n− l ) such that for 1 ≤ j ≤ k , σj ( Σk ) ≥ σj ( A ) 4 √ 1 + min ( 2τ̂4 , τ4 ( 2 + 4τ̂4 ) ( σl+1 ( A ) σj ( A ) ) 4 ) and ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) 4 √ 1 + 2τ4 ( σl+1 ( A ) σk+1 ( A ) ) 4 . 2.2 THE QLP DECOMPOSITION . The basis of FFQR is the QLP decomposition ( Stewart , 1999 ) . Let A be an m× n matrix . Perform QRCP on A to obtain AΠ = QR and then perform QRCP on RT to get RTΠ1 = PLT , where L is lower triangular . Putting these together yields A = QΠ1LPTΠT . This is the pivoted QLP decomposition of A. Stewart observed that the diagonal entries Lii of L closely track the singular values of A . For the proposed algorithm , we choose not to pivot when factoring RT . In this case , Lii will not track σi ( A ) as well . We will discuss a partial remedy for this below . The advantage of not pivoting is that , just as in FFQR , we do not have to finish computing R before computing L. Once we have performed l steps of QRCP on A , we can compute the first l rows of L and thus have access to its first l diagonal entries . 3 A FAST , APPROXIMATE , TOLERANCE-BASED PCA ALGORITHM . 3.1 BLOCKED FFQR . Since we do not know what l is beforehand , we compute R and L incrementally in blocks . Select a block size b and perform b steps of RQRCP to get AΠ1 = Q1 ( R ( b ) 11 R ( b ) 12 0 R ( b ) 22 ) , where R ( b ) 11 is b × b upper triangular . The first b rows of R are essentially done since subsequent steps of RQRCP will only permute the columns of R ( b ) 12 . Perform QR on them ( to keep the notation simple , we write this as an LQ factorization ) : ( R ( b ) 11 R ( b ) 12 ) = ( L11 0 ) P T 1 , where L11 is b × b lower triangular , and P1 is orthogonal . We have just computed the first b rows of L and know the first b diagonal entries . For the next block , continue RQRCP for another b steps . The permutation matrix Π2 in this block will affect only columns b + 1 through n , leaving the first b columns untouched . Thus , Π2 can be written in block form as Π2 = ( Ib 0 0 Π̃2 ) , where Ib is the b× b identity matrix and Π̃2 is an ( n− b ) × ( n− b ) permutation matrix . We now have AΠ1Π2 = Q2Q1 R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 0 0 R ( 2b ) 22 , where R ( 2b ) 11 is b× b upper triangular . Since the first b rows have changed , we must account for this in the previous LQ : ( R ( b ) 11 R ( b ) 12 Π̃2 ) = ( R ( b ) 11 R ( b ) 12 ) Π2 = ( L11 0 ) P T 1 Π2 . Now apply the matrix ΠT2 P1 to the newly completed rows ( 0 R ( 2b ) 11 R ( 2b ) 12 ) and perform LQ on the last n− b columns to get ( 0 R ( 2b ) 11 R ( 2b ) 12 ) ΠT2 P1 = ( L21 L22 0 ) P T 2 , where L22 is b× b lower triangular . The orthogonal matrix P2 affects only the last n − b columns and can therefore be written in block form as P2 = ( Ib 0 0 P̃2 ) . Hence , ( L11 0 ) = ( L11 0 ) PT2 and ( R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 ) = ( L11 0 0 L21 L22 0 ) PT2 P T 1 Π2 , showing that we have computed the first 2b rows of L. We can continue this procedure , computing b rows of L at a time . Once we decide to stop , we finish the remaining rows of L by applying the orthogonal matrices from all previous LQ factorizations to the last rows of R. For example , if we wanted to stop after 2 blocks , apply ΠT2 P1P2 to ( 0 0 R ( 2b ) 22 ) to get ( 0 0 R ( 2b ) 22 ) ΠT2 P1P2 = ( L31 L32 L33 ) and the partial QLP decomposition AΠ1Π2 = Q2Q1 R ( b ) 11 R ( b ) 12 Π̃2 0 R ( 2b ) 11 R ( 2b ) 12 0 0 R ( 2b ) 22 = Q2Q1 ( L11 0 0L21 L22 0 L31 L32 L33 ) PT2 P T 1 Π2 . Afterwards , spectrum-revealing swaps can be performed if desired . For each swap and uppertrapezoidal restoration , some nonzero entries will appear above the diagonal in L. These are easily eliminated with Givens rotations . 3.2 DETERMINING l We now derive a criterion to determine when to stop factoring in blocked FFQR and to find l. Let ε be the tolerance parameter , and define the rank k by σk+1 ( A ) ≤ ε ≤ σk ( A ) . One could use the bounds derived in Feng et al . ( 2019 ) , using the diagonal entries of L to estimate the singular values of A and stopping when σl+1 ( A ) /σk+1 ( A ) is sufficiently small . However , the dimension-dependent bounds for τ and τ̂ are impractical , so we will use a different bound . In Feng et al . ( 2019 ) , the authors prove that σj ( A ) 4 ≤ σj ( Σk ) 4+2 ∥R22∥42 , 1 ≤ j ≤ k. Rearranging this inequality gives σj ( Σk ) ≥ σj ( A ) 4 √ 1− 2 ∥R22∥42 σj ( A ) 4 , 1 ≤ j ≤ k. They also prove the following bound on the truncation error : ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) 4 √ 1 + 2 ∥R22∥42 σk+1 ( A ) 4 . ( 1 ) These bounds hold even without spectrum-revealing swaps . So , if ∥R22∥2 /σk+1 ( A ) , is small , then the leading k singular values of A will be revealed up to a certain number of digits and ŨkΣ̃kṼ Tk will be a nearly optimal rank-k approximation . In practice , the above two bounds are sufficient because ∥R22∥2 = O ( σl ( A ) ) already , without extra swaps . The earlier bounds still have theoretical value in that they show the algorithm works well when A has rapidly decaying singular values . The factors 4 √ 1− 2∥R22∥ 4 2 σj ( A ) 4 and 4 √ 1 + 2 ∥R22∥42 σk+1 ( A ) 4 are equal to 1 − 12 ∥R22∥42 σj ( A ) 4 and 1 + 12 ∥R22∥42 σk+1 ( A ) 4 , respectively , up to first order . Introduce an accuracy parameter δ , and say we have 12 ∥R22∥42 σk+1 ( A ) 4 ≤ δ . Then we have σj ( Σ̃k ) ≥ σj ( A ) ( 1− δ ) , 1 ≤ j ≤ k , and ∥∥∥A− ŨkΣ̃kṼ Tk ∥∥∥ 2 ≤ σk+1 ( A ) ( 1+ δ ) up to first order . This means that ≈ − log δ digits of the top k singular values of A and optimal truncation error have been computed correctly . We can rewrite 12 ∥R22∥42 σk+1 ( A ) 4 ≤ δ as ∥R22∥2 ≤ σk+1 ( A ) 4 √ 2δ . This is the tolerance-based criterion to determine l. 3.2.1 ESTIMATING σk+1 AND ∥R22∥2 To estimate ∥R22∥2 and σk+1 ( A ) accurately , we use Stewart ’ s observation that the diagonal entries Lii of L closely track the singular values σi ( A ) of A . As stated above , Lii will not track σi ( A ) as well because we are not pivoting when factoring RT . A partial remedy is simply to sort the Lii ’ s . We show below that the resulting tracking behavior is similar in quality to that of fully pivoted QLP . Let L ( j ) be the j-th largest diagonal entry of L in magnitude , i.e . ∣∣L ( 1 ) ∣∣ ≥ ∣∣L ( 2 ) ∣∣ ≥ · · · ≥ ∣∣L ( n ) ∣∣ . In light of Stewart ’ s observation , we will assume that there are constants α and β such that α ∣∣L ( j ) ∣∣ ≤ σj ( A ) ≤ β ∣∣L ( j ) ∣∣ , 1 ≤ j ≤ n. The values of α and β will be estimated empirically below . A simple way to interpret these inequalities is that for each diagonal entry Ljj , there is a singular value of A in the interval [ α |Ljj | , β |Ljj | ] . Consider { Ljj : β |Ljj | ≤ ε } . This just corresponds to all the intervals [ α |Ljj | , β |Ljj | ] contained in ( −∞ , ε ] . For each Ljj in the set , there is a singular value σi ( A ) in the corresponding interval . Thus σi ( A ) ≤ ε . Since σk+1 ( A ) is the largest singular value of A less than or equal to ε , we must have σi ( A ) ≤ σk+1 ( A ) , which then implies α |Ljj | ≤ σk+1 ( A ) . This yields a lower bound on σk+1 ( A ) , namely max { α |Ljj | : β |Ljj | ≤ ε } . Since we will not know all the Ljj ’ s , we can obtain only a sub-optimal lower bound sk+1 on σk+1 ( A ) . Initialize sk+1 = 0 . After i blocks of blocked FFQR , update sk+1 = max { α |Ljj | : β |Ljj | ≤ ε and j ≤ ib } . To estimate ∥R22∥2 = σ1 ( R22 ) , we will use the first diagonal entry L11 of L in the fully pivoted QLP factorization . First , consider a general matrix A , and perform QRCP : AΠ = QR . Then in fully pivoted QLP , |L11| is just the largest row norm of R. As noted in Stewart ( 1999 ) , the largest row of R is usually among the first few rows . Thus we can estimate ∥A∥2 using max1≤i≤q ∥R ( i , : ) ∥2 , for some small integer q . This requires only q steps of QRCP . We can apply this idea to estimate ∥R22∥2 . After i steps of QRCP on A , the R factor has the form ( R ( i ) 1 0 R ( i ) 22 ) , where R ( i ) 1 is i×n upper triangular . The R factor in the QRCP factorization of R ( i ) 22 is just R ( n ) 1 ( i+1 : m , i+1 : n ) . Thus , QRCP-factoring A automatically yields the QRCP factorizations of all the trailing blocks R ( i ) 22 . Using the 2-norm estimation scheme in the previous paragraph , after j steps of QRCP , we have the upper bound ∥∥∥R ( i ) 22 ∥∥∥ 2 ≤ β max i≤ι≤i+q−1 ∥∥∥R ( j ) 1 ( ι , : ) ∥∥∥ 2 : = β ∥∥∥R ( i ) 22 ∥∥∥ j , q for 1 ≤ i ≤ j − q + 1 . Putting these estimates together will give us the final stopping criterion . After each block , we first update sk+1 with the newly computed Ljj ’ s and then check if ∥∥∥R ( i ) 22 ∥∥∥ j , q ≤ 1β sk+1 4 √ 2δ for some i . The smallest i for which this inequality holds will be l + 1 . Algorithm 2 Approximate , tolerance-based PCA Inputs : A , tolerance ε , accuracy δ , block size b , number of rows q , oversampling size p for RQRCP Outputs : Rank k , Ũk , Σ̃k , Ṽk c← 0 , sk+1 ← 0 while c < n do Perform steps c+ 1 to c+ b of RQRCP on A ; update Q , R , and Π Compute rows c+ 1 to c+ b of L ; update P for j = c+ 1 : c+ b do if |Ljj | ≤ ε/β and α |Ljj | ≥ sk+1 then sk+1 ← α |Ljj | end if end for for i = 1 : c+ b− q + 1 do if ∥∥∥R ( i ) 22 ∥∥∥ c+b , q ≤ 1β sk+1 4 √ 2δ then l← i− 1 exit while loop end if end for c← c+ b end while Compute rows c+ b+ 1 to m of L. Compute TSVD ÛkΣ̂kV̂k of L ( : , 1 : l ) , where k satisfies σk ( L ( : , 1 : l ) ) ≥ ε ≥ σk+1 ( L ( : , 1 : l ) ) . Ũk ← QÛk , Σ̃k ← Σ̂k , Ṽk ← ΠP1V̂k | This paper develops an algorithm that approximates the principal components corresponding to the top singular values. The algorithm requires the user specified tolerance instead of the number of top singular values, which is often the case in practice. It presents the detailed algorithm and evaluate its performance using numerical experiments. | SP:b91c2d68ececc4827e5619ade1afdd2249b0d962 |
Invariant Causal Representation Learning for Out-of-Distribution Generalization | 1 INTRODUCTION . Modern machine learning algorithms still lack robustness , and may fail to generalize outside of a specific training distribution because they learn easy-to-fit spurious correlations which are prone to change between training and testing environments . We recall the widely used example of classifying images of camels and cows ( Beery et al. , 2018 ) . Here , the training dataset has a selection bias , i.e. , many pictures of cows are taken on green pastures , while most pictures of camels happen to be in deserts . After training , it is found that the model builds on spurious correlations , i.e. , it relates green pastures with cows and deserts with camels , and fails to recognize images of cows on the beach . To address this problem , a natural idea is to identify which features of the training data present domain-varying spurious correlations with labels and which features describe true correlations of interest that are stable across domains . In the example above , the former are the features describing the context ( e.g. , pastures and deserts ) , whilst the latter are the features describing the animals ( e.g. , animal shape ) . By exploiting the varying degrees of spurious correlation naturally present in training data collected from multiple environments , one can try to identify stable features and build invariant predictors . Invariant risk minimization ( IRM ) seeks to find data representations ( Arjovsky et al. , 2019 ) or features ( Rojas-Carulla et al. , 2018 ) for which the optimal predictor is invariant across all environments . The general formulation of IRM is a challenging bi-leveled optimization problem , and theoretical guarantees require constraining both data representations and classifiers to be linear ( Arjovsky et al. , 2019 , Theorem 9 ) , or considering the special case of feature selection ( Rojas-Carulla et al. , 2018 , Theorem 4 ) . Ahuja et al . ( 2020a ) study the problem from the perspective of game theory , with an approach termed invariant risk minimization games ( IRMG ) . They show that the set of Nash equilibria for a proposed game is equivalent to the set of invariant predictors for any finite number of environments , even with nonlinear data representations and nonlinear classifiers . However , these theoretical results in the nonlinear setting only guarantee that one can learn invariant predictors from training environments , but do not guarantee that the learned invariant predictors can generalize well across all environments including unseen testing environments . We propose invariant Causal Representation Learning ( iCaRL ) , a novel approach that enables outof-distribution ( OOD ) generalization in the nonlinear setting ( i.e. , nonlinear representations and nonlinear classifiers1 ) . We achieve this by extending and using methods from representation learning and graphical causal discovery . In more detail , we first introduce our main general assumption : when conditioning on the target ( e.g. , labels ) and the environment ( represented as an index ) , the prior over the data representation ( i.e. , a set of latent variables encoding the data ) belongs to a general exponential family . Unlike the conditionally factorized prior assumed in recent identifiable variational autoencoders ( iVAE ) ( Khemakhem et al. , 2020a ) , this is a more flexible conditionally non-factorized prior , which can actually capture complicated dependences between the latent variables . We then extend iVAE to the case in which the latent variable prior belongs to such a general exponential family . The combination of this result and the previous general assumption allows us to a guarantee that the data representation can be identified up to simple transformations . We then theoretically show that the direct causes of the target can be fully discovered by analyzing all possible graphs in a structural equation model setting . Once they are discovered , the challenging bi-leveled optimization problem in IRM and IRMG can be reduced to two simpler independent optimization problems , that is , learning the data representation and learning the optimal classifier can be performed separately . This leads to a practical algorithm and enables us to obtain generalization guarantees in the nonlinear setting . Overall , we make a number of key contributions : ( 1 ) We propose a general framework for out-ofdistribution generalization in the nonlinear setting with the theoretical guarantees on both identifiability and generalizability ; ( 2 ) We propose a general assumption on the underlying causal diagram for prediction ( Assumption 1 and Fig . 1c ) , which covers many real-world scenarios ( Section 3.2 ) ; ( 3 ) We propose a general assumption on the prior over the latent variables ( Assumption 2 ) , i.e. , a more flexible conditionally non-factorized prior ; ( 4 ) We prove that an extended iVAE with this conditionally non-factorized prior is also identifiable ( Theorems 1 , 2 & 3 ) ; ( 5 ) We prove that our framework has the theoretical guarantees for OOD generalization in the nonlinear setting ( Proposition 1 ) . 2 PRELIMINARIES . 2.1 IDENTIFIABLE VARIATIONAL AUTOENCODERS . Variational autoencoders ( VAEs , see Appendix B ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) lack identifiability guarantees . Consider a VAE model where O ∈ Rd stands for the observed variables ( data ) and X ∈ Rn for the latent variables . Khemakhem et al . ( 2020a ) show that a VAE with an unconditional prior distribution pθ ( X ) over the latent variables is unidentifiable . However , they also show that it is possible to obtain an identifiable model if one posits a conditionally factorized prior distribution over the latent variables , pθ ( X|U ) , where U ∈ Rm is an additional observed variable ( Hyvärinen et al. , 2019 ) . Specifically , let θ = ( f , T , λ ) ∈ Θ be the parameters of the conditional generative model pθ ( O , X|U ) = pf ( O|X ) pT , λ ( X|U ) , ( 1 ) where pf ( O|X ) = p ( O − f ( X ) ) in which is an independent noise variable with probability density function p ( ) . Importantly , the prior pT , λ ( X|U ) is assumed to be conditionally factorial , where each element of Xi ∈ X has a univariate exponential family distribution given U . The conditioning onU is through an arbitrary function λ ( U ) ( e.g. , a neural net ) that outputs the individual exponential family parameters λi ( U ) for each Xi . The prior probability density thus takes the form pT , λ ( X|U ) = ∏ i Qi ( Xi ) /Zi ( U ) exp [ ∑k j=1 Ti , j ( Xi ) λi , j ( U ) ] , ( 2 ) where Qi is the base measure , Xi the i-th dimension of X , Zi ( U ) the normalizing constant , Ti = ( Ti,1 , . . . , Ti , k ) the sufficient statistics , λi ( U ) = ( λi,1 ( U ) , . . . , λi , k ( U ) ) the corresponding natural parameters depending on U , and k the dimension of each sufficient statistic that is fixed in advance . It is worth noting that this prior is restrictive as it is factorial and therefore can not capture dependencies . As in VAEs , the model parameters are estimated by maximizing the corresponding evidence lower bound , LiVAE ( θ , φ ) : =EpD [ Eqφ ( X|O , U ) [ log pf ( O|X ) + log pT , λ ( X|U ) − log qφ ( X|O , U ) ] ] , ( 3 ) where we denote by pD the empirical data distribution given by the dataset D = { ( O ( i ) , U ( i ) ) } N i=1 and qφ ( X|O , U ) denotes an approximate conditional distribution for X given by a recognition 1In fact , we are not restricted to the classification case and allow the target to be either continuous or categorical , which will be formally defined in Section 2.2. network with parameters φ . This approach is called identifiable VAE ( iVAE ) . Most importantly , it can be proved that under the conditions stated in Theorem 2 of ( Khemakhem et al. , 2020a ) , iVAE can identify the latent variablesX up to a permutation and a simple componentwise transformation , see Appendix F . 2.2 INVARIANT RISK MINIMIZATION . Arjovsky et al . ( 2019 ) introduced invariant risk minimization ( IRM ) , whose goal is to construct an invariant predictor f that performs well across all environments Eall by exploiting data collected from multiple environments Etr , where Etr ⊆ Eall . Technically , they consider datasets De : = { ( oei , yei ) } ne i=1 from multiple training environments e ∈ Etr , where oei ∈ O ⊆ Rd is the input observation and its corresponding label is yei ∈ Y ⊆ Rs.2 The datasetDe , collected from environment e , consists of examples identically and independently distributed according to some probability distribution P ( Oe , Y e ) . The goal of IRM is to use these multiple datasets to learn a predictor Y = f ( O ) that performs well for all the environments . Here we define the risk reached by f in environment e as Re ( f ) = EOe , Y e [ ` ( f ( Oe ) , Y e ) ] , where ` ( · ) is a loss function . Then , the invariant predictor can be formally defined as follows : Definition 1 ( Invariant Predictor ( Arjovsky et al. , 2019 ) ) . We say that a data representation Φ ∈ HΦ : O → C elicits an invariant predictor w ◦ Φ across environments E if there is a classifier w ∈ Hw : C → Y simultaneously optimal for all environments , that is , w ∈ arg minw̄∈Hw Re ( w̄◦Φ ) for all e ∈ E , where ◦ means function composition . Mathematically , IRM can be phrased as the following constrained optimization problem : min Φ∈HΦ , w∈Hw ∑ e∈Etr Re ( w ◦ Φ ) s.t . w ∈ arg min w̄∈Hw Re ( w̄ ◦ Φ ) , ∀e ∈ Etr . ( 4 ) Since this is a generally infeasible bi-leveled optimization problem , Arjovsky et al . ( 2019 ) rephrased it as a tractable penalized optimization problem by transfering the inner optimization routine to a penalty term . The main generalization result ( Theorem 9 in Arjovsky et al . ( 2019 ) ) states that if both Φ and w come from the class of linear models ( i.e. , HΦ = Rn×n and Hw = Rn×1 ) , under certain conditions on the diversity of training environments ( Assumption 8 in Arjovsky et al . ( 2019 ) ) and the data generation , the invariant predictor w ◦ Φ obtained by solving Eq . ( 4 ) remains invariant in Eall . 3 PROBLEM SETUP . 3.1 A MOTIVATING EXAMPLE . In this section , we extend the example which was introduced by Wright ( 1921 ) and discussed by Arjovsky et al . ( 2019 ) , and provide a further in-depth analysis . Model 1 . Consider a structural equation model ( SEM ) with a discrete environment variable E that modulates the noises in the structural assignments connecting the other variables ( cf . Fig . 1a below ) : X1 ← Gaussian ( 0 , σ1 ( E ) ) , Y ← X1 + Gaussian ( 0 , σ2 ( E ) ) , X2 ← Y + Gaussian ( 0 , σ3 ( E ) ) , where Gaussian ( 0 , σ ) denotes a Gaussian random variable with zero mean and standard deviation σ , and σ1 , . . . , σ3 are functions of the value e ∈ Eall taken by the environment variable E. To ease exposition , here we consider the simple scenario in which Eall only contains all modifications varying the noises of X1 , X2 and Y within a finite range , i.e. , σi ( e ) ∈ [ 0 , σ2max ] . Then , to predict Y from ( X1 , X2 ) using a least-square predictor Ŷ e = α̂1Xe1 + α̂2X e 2 for environment e , we can • Case 1 : regress from Xe1 , to obtain α̂1 = 1 and α̂2 = 0 , • Case 2 : regress from Xe2 , to obtain α̂1 = 0 and α̂2 = σ1 ( e ) +σ2 ( e ) σ1 ( e ) +σ2 ( e ) +σ3 ( e ) , • Case 3 : regress from ( Xe1 , X e 2 ) , to obtain α̂1 = σ3 ( e ) σ2 ( e ) +σ3 ( e ) and α̂2 = σ2 ( e ) σ2 ( e ) +σ3 ( e ) . In the generic scenario ( i.e. , σ1 ( e ) 6= 0 , σ2 ( e ) 6= 0 , and σ3 ( e ) 6= 0 ) , the regression using X1 in Case 1 is an invariant correlation : it is the only regression whose coefficients do not vary with e. By contrast , the regressions in both Case 2 and Case 3 have coefficients that depend on e. Therefore , only the invariant correlation in Case 1 will generalize well to new test environments . 2The setup applies to both continuous and categorical data . If any observation or label is categorical , we one-hot encode it . Another way to understand Model 1 is through its graphical representation3 , as shown in Fig . 1a . We treat the environment as a random variable E , where E could be any information specific to the environment ( Storkey , 2009 ; Peters et al. , 2015 ; Zhang et al. , 2017 ; Huang et al. , 2020 ) . For simplicity , we let E be the environment index , i.e. , E ∈ { 1 , . . . , N } , where N is the number of training environments . A more realistic version appearing in many settings is shown in Fig . 1b , where the true variables { X1 , X2 } are unobserved and we can only observe their transformationO . In this case , Invariant Causal Prediction ( ICP ) ( Peters et al. , 2015 ) will fail when applied toO , even when Y is not affected by E ( i.e. , the edge E → Y is removed ) . The reason is that each variable ( i.e. , each dimension ) ofO is jointly influenced by both X1 and X2 so that ICP is unable to find the variables containing the information only about X1 by searching for a subset of variablesO . By contrast , both IRM and IRMG work , as long as the transformation is linear . These findings are also empirically illustrated in Section 5.1 . We now go even further and consider a more general causal graph in which Y can have more than one parent or child . | This paper proposes invariant Causal Representation Learning (iCaRL) for OOD generalization in the nonlinear setting. The work extends iVAE to a somewhat more general setting and shows the direct cause of the target can be discovered. iCARL is then developed based on the direct cause. . Extensive experiments verify the effectiveness of the proposed method. | SP:14efc52bb1949c529498fea95f1f5e94710c85a5 |
Invariant Causal Representation Learning for Out-of-Distribution Generalization | 1 INTRODUCTION . Modern machine learning algorithms still lack robustness , and may fail to generalize outside of a specific training distribution because they learn easy-to-fit spurious correlations which are prone to change between training and testing environments . We recall the widely used example of classifying images of camels and cows ( Beery et al. , 2018 ) . Here , the training dataset has a selection bias , i.e. , many pictures of cows are taken on green pastures , while most pictures of camels happen to be in deserts . After training , it is found that the model builds on spurious correlations , i.e. , it relates green pastures with cows and deserts with camels , and fails to recognize images of cows on the beach . To address this problem , a natural idea is to identify which features of the training data present domain-varying spurious correlations with labels and which features describe true correlations of interest that are stable across domains . In the example above , the former are the features describing the context ( e.g. , pastures and deserts ) , whilst the latter are the features describing the animals ( e.g. , animal shape ) . By exploiting the varying degrees of spurious correlation naturally present in training data collected from multiple environments , one can try to identify stable features and build invariant predictors . Invariant risk minimization ( IRM ) seeks to find data representations ( Arjovsky et al. , 2019 ) or features ( Rojas-Carulla et al. , 2018 ) for which the optimal predictor is invariant across all environments . The general formulation of IRM is a challenging bi-leveled optimization problem , and theoretical guarantees require constraining both data representations and classifiers to be linear ( Arjovsky et al. , 2019 , Theorem 9 ) , or considering the special case of feature selection ( Rojas-Carulla et al. , 2018 , Theorem 4 ) . Ahuja et al . ( 2020a ) study the problem from the perspective of game theory , with an approach termed invariant risk minimization games ( IRMG ) . They show that the set of Nash equilibria for a proposed game is equivalent to the set of invariant predictors for any finite number of environments , even with nonlinear data representations and nonlinear classifiers . However , these theoretical results in the nonlinear setting only guarantee that one can learn invariant predictors from training environments , but do not guarantee that the learned invariant predictors can generalize well across all environments including unseen testing environments . We propose invariant Causal Representation Learning ( iCaRL ) , a novel approach that enables outof-distribution ( OOD ) generalization in the nonlinear setting ( i.e. , nonlinear representations and nonlinear classifiers1 ) . We achieve this by extending and using methods from representation learning and graphical causal discovery . In more detail , we first introduce our main general assumption : when conditioning on the target ( e.g. , labels ) and the environment ( represented as an index ) , the prior over the data representation ( i.e. , a set of latent variables encoding the data ) belongs to a general exponential family . Unlike the conditionally factorized prior assumed in recent identifiable variational autoencoders ( iVAE ) ( Khemakhem et al. , 2020a ) , this is a more flexible conditionally non-factorized prior , which can actually capture complicated dependences between the latent variables . We then extend iVAE to the case in which the latent variable prior belongs to such a general exponential family . The combination of this result and the previous general assumption allows us to a guarantee that the data representation can be identified up to simple transformations . We then theoretically show that the direct causes of the target can be fully discovered by analyzing all possible graphs in a structural equation model setting . Once they are discovered , the challenging bi-leveled optimization problem in IRM and IRMG can be reduced to two simpler independent optimization problems , that is , learning the data representation and learning the optimal classifier can be performed separately . This leads to a practical algorithm and enables us to obtain generalization guarantees in the nonlinear setting . Overall , we make a number of key contributions : ( 1 ) We propose a general framework for out-ofdistribution generalization in the nonlinear setting with the theoretical guarantees on both identifiability and generalizability ; ( 2 ) We propose a general assumption on the underlying causal diagram for prediction ( Assumption 1 and Fig . 1c ) , which covers many real-world scenarios ( Section 3.2 ) ; ( 3 ) We propose a general assumption on the prior over the latent variables ( Assumption 2 ) , i.e. , a more flexible conditionally non-factorized prior ; ( 4 ) We prove that an extended iVAE with this conditionally non-factorized prior is also identifiable ( Theorems 1 , 2 & 3 ) ; ( 5 ) We prove that our framework has the theoretical guarantees for OOD generalization in the nonlinear setting ( Proposition 1 ) . 2 PRELIMINARIES . 2.1 IDENTIFIABLE VARIATIONAL AUTOENCODERS . Variational autoencoders ( VAEs , see Appendix B ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) lack identifiability guarantees . Consider a VAE model where O ∈ Rd stands for the observed variables ( data ) and X ∈ Rn for the latent variables . Khemakhem et al . ( 2020a ) show that a VAE with an unconditional prior distribution pθ ( X ) over the latent variables is unidentifiable . However , they also show that it is possible to obtain an identifiable model if one posits a conditionally factorized prior distribution over the latent variables , pθ ( X|U ) , where U ∈ Rm is an additional observed variable ( Hyvärinen et al. , 2019 ) . Specifically , let θ = ( f , T , λ ) ∈ Θ be the parameters of the conditional generative model pθ ( O , X|U ) = pf ( O|X ) pT , λ ( X|U ) , ( 1 ) where pf ( O|X ) = p ( O − f ( X ) ) in which is an independent noise variable with probability density function p ( ) . Importantly , the prior pT , λ ( X|U ) is assumed to be conditionally factorial , where each element of Xi ∈ X has a univariate exponential family distribution given U . The conditioning onU is through an arbitrary function λ ( U ) ( e.g. , a neural net ) that outputs the individual exponential family parameters λi ( U ) for each Xi . The prior probability density thus takes the form pT , λ ( X|U ) = ∏ i Qi ( Xi ) /Zi ( U ) exp [ ∑k j=1 Ti , j ( Xi ) λi , j ( U ) ] , ( 2 ) where Qi is the base measure , Xi the i-th dimension of X , Zi ( U ) the normalizing constant , Ti = ( Ti,1 , . . . , Ti , k ) the sufficient statistics , λi ( U ) = ( λi,1 ( U ) , . . . , λi , k ( U ) ) the corresponding natural parameters depending on U , and k the dimension of each sufficient statistic that is fixed in advance . It is worth noting that this prior is restrictive as it is factorial and therefore can not capture dependencies . As in VAEs , the model parameters are estimated by maximizing the corresponding evidence lower bound , LiVAE ( θ , φ ) : =EpD [ Eqφ ( X|O , U ) [ log pf ( O|X ) + log pT , λ ( X|U ) − log qφ ( X|O , U ) ] ] , ( 3 ) where we denote by pD the empirical data distribution given by the dataset D = { ( O ( i ) , U ( i ) ) } N i=1 and qφ ( X|O , U ) denotes an approximate conditional distribution for X given by a recognition 1In fact , we are not restricted to the classification case and allow the target to be either continuous or categorical , which will be formally defined in Section 2.2. network with parameters φ . This approach is called identifiable VAE ( iVAE ) . Most importantly , it can be proved that under the conditions stated in Theorem 2 of ( Khemakhem et al. , 2020a ) , iVAE can identify the latent variablesX up to a permutation and a simple componentwise transformation , see Appendix F . 2.2 INVARIANT RISK MINIMIZATION . Arjovsky et al . ( 2019 ) introduced invariant risk minimization ( IRM ) , whose goal is to construct an invariant predictor f that performs well across all environments Eall by exploiting data collected from multiple environments Etr , where Etr ⊆ Eall . Technically , they consider datasets De : = { ( oei , yei ) } ne i=1 from multiple training environments e ∈ Etr , where oei ∈ O ⊆ Rd is the input observation and its corresponding label is yei ∈ Y ⊆ Rs.2 The datasetDe , collected from environment e , consists of examples identically and independently distributed according to some probability distribution P ( Oe , Y e ) . The goal of IRM is to use these multiple datasets to learn a predictor Y = f ( O ) that performs well for all the environments . Here we define the risk reached by f in environment e as Re ( f ) = EOe , Y e [ ` ( f ( Oe ) , Y e ) ] , where ` ( · ) is a loss function . Then , the invariant predictor can be formally defined as follows : Definition 1 ( Invariant Predictor ( Arjovsky et al. , 2019 ) ) . We say that a data representation Φ ∈ HΦ : O → C elicits an invariant predictor w ◦ Φ across environments E if there is a classifier w ∈ Hw : C → Y simultaneously optimal for all environments , that is , w ∈ arg minw̄∈Hw Re ( w̄◦Φ ) for all e ∈ E , where ◦ means function composition . Mathematically , IRM can be phrased as the following constrained optimization problem : min Φ∈HΦ , w∈Hw ∑ e∈Etr Re ( w ◦ Φ ) s.t . w ∈ arg min w̄∈Hw Re ( w̄ ◦ Φ ) , ∀e ∈ Etr . ( 4 ) Since this is a generally infeasible bi-leveled optimization problem , Arjovsky et al . ( 2019 ) rephrased it as a tractable penalized optimization problem by transfering the inner optimization routine to a penalty term . The main generalization result ( Theorem 9 in Arjovsky et al . ( 2019 ) ) states that if both Φ and w come from the class of linear models ( i.e. , HΦ = Rn×n and Hw = Rn×1 ) , under certain conditions on the diversity of training environments ( Assumption 8 in Arjovsky et al . ( 2019 ) ) and the data generation , the invariant predictor w ◦ Φ obtained by solving Eq . ( 4 ) remains invariant in Eall . 3 PROBLEM SETUP . 3.1 A MOTIVATING EXAMPLE . In this section , we extend the example which was introduced by Wright ( 1921 ) and discussed by Arjovsky et al . ( 2019 ) , and provide a further in-depth analysis . Model 1 . Consider a structural equation model ( SEM ) with a discrete environment variable E that modulates the noises in the structural assignments connecting the other variables ( cf . Fig . 1a below ) : X1 ← Gaussian ( 0 , σ1 ( E ) ) , Y ← X1 + Gaussian ( 0 , σ2 ( E ) ) , X2 ← Y + Gaussian ( 0 , σ3 ( E ) ) , where Gaussian ( 0 , σ ) denotes a Gaussian random variable with zero mean and standard deviation σ , and σ1 , . . . , σ3 are functions of the value e ∈ Eall taken by the environment variable E. To ease exposition , here we consider the simple scenario in which Eall only contains all modifications varying the noises of X1 , X2 and Y within a finite range , i.e. , σi ( e ) ∈ [ 0 , σ2max ] . Then , to predict Y from ( X1 , X2 ) using a least-square predictor Ŷ e = α̂1Xe1 + α̂2X e 2 for environment e , we can • Case 1 : regress from Xe1 , to obtain α̂1 = 1 and α̂2 = 0 , • Case 2 : regress from Xe2 , to obtain α̂1 = 0 and α̂2 = σ1 ( e ) +σ2 ( e ) σ1 ( e ) +σ2 ( e ) +σ3 ( e ) , • Case 3 : regress from ( Xe1 , X e 2 ) , to obtain α̂1 = σ3 ( e ) σ2 ( e ) +σ3 ( e ) and α̂2 = σ2 ( e ) σ2 ( e ) +σ3 ( e ) . In the generic scenario ( i.e. , σ1 ( e ) 6= 0 , σ2 ( e ) 6= 0 , and σ3 ( e ) 6= 0 ) , the regression using X1 in Case 1 is an invariant correlation : it is the only regression whose coefficients do not vary with e. By contrast , the regressions in both Case 2 and Case 3 have coefficients that depend on e. Therefore , only the invariant correlation in Case 1 will generalize well to new test environments . 2The setup applies to both continuous and categorical data . If any observation or label is categorical , we one-hot encode it . Another way to understand Model 1 is through its graphical representation3 , as shown in Fig . 1a . We treat the environment as a random variable E , where E could be any information specific to the environment ( Storkey , 2009 ; Peters et al. , 2015 ; Zhang et al. , 2017 ; Huang et al. , 2020 ) . For simplicity , we let E be the environment index , i.e. , E ∈ { 1 , . . . , N } , where N is the number of training environments . A more realistic version appearing in many settings is shown in Fig . 1b , where the true variables { X1 , X2 } are unobserved and we can only observe their transformationO . In this case , Invariant Causal Prediction ( ICP ) ( Peters et al. , 2015 ) will fail when applied toO , even when Y is not affected by E ( i.e. , the edge E → Y is removed ) . The reason is that each variable ( i.e. , each dimension ) ofO is jointly influenced by both X1 and X2 so that ICP is unable to find the variables containing the information only about X1 by searching for a subset of variablesO . By contrast , both IRM and IRMG work , as long as the transformation is linear . These findings are also empirically illustrated in Section 5.1 . We now go even further and consider a more general causal graph in which Y can have more than one parent or child . | This paper proposes a general framework for so-called "out-of-distribution generalization" that can handle non-linear associations and causal links between variables. It provides proofs for identifiability and generalization. It proposes a general causal model that is sensible for many prediction problems. It proposes a conditionally non-factorized prior. It provides a tractable method that can be used in practice. | SP:14efc52bb1949c529498fea95f1f5e94710c85a5 |
Domino: Discovering Systematic Errors with Cross-Modal Embeddings | 1 INTRODUCTION . Machine learning models often make systematic errors on important subsets ( or slices ) of data1 . For instance , models trained to detect collapsed lungs in chest X-rays have been shown to make predictions based on the presence of chest drains , a device typically used during treatment ( OakdenRayner et al. , 2019 ) . As a result , these models frequently make prediction errors on cases without chest drains , a critical data slice where false negative predictions could be life-threatening . Similar performance gaps across slices have been observed in radiograph classification ( Badgeley et al. , 2019a ; Zech et al. , 2018a ; DeGrave et al. , 2021a ) , melanoma detection ( Winkler et al. , 2019a ) , natural language processing ( Orr et al. , 2020 ; Goel et al. , 2021 ) , and object detection ( de Vries et al. , 2019b ) , among others . If underperforming slices can be accurately identified and labeled , we can then improve model robustness by either updating the training dataset or using robust optimization techniques ( Zhang et al. , 2018 ; Sagawa et al. , 2020 ) . However , identifying underperforming slices is difficult in practice . When working with highdimensional inputs ( e.g . images , time-series data , video ) , slices are often “ hidden ” , meaning that they can not easily be extracted from the inputs and are not annotated in metadata ( Oakden-Rayner et al. , 2019 ) . For instance , in the collapsed lung example above , the absence of chest drains is challenging to identify from raw image data and may not be explicitly labeled in metadata . In this setting , we must perform slice discovery : the task of mining unstructured input data for semantically meaningful subgroups on which the model performs poorly . 1We define a data slice as a group of data examples united by a shared attribute or characteristic . In modern machine learning workflows , practitioners commonly attempt slice discovery with a combination of feature-based interpretability methods ( e.g . GradCAM , LIME ) and manual inspection ( Selvaraju et al. , 2017 ; Ribeiro et al. , 2016 ) . However , these approaches are time-consuming and susceptible to confirmation bias ( Adebayo et al. , 2018 ) . As a result , recent works have proposed automated slice discovery methods ( SDMs ) , which utilize learned input representations to identify semantically meaningful slices where the model makes prediction errors ( d ’ Eon et al. , 2021 ; Yeh et al. , 2020 ; Sohoni et al. , 2020 ; Kim et al. , 2018 ) . An ideal SDM should automatically identify data slices that fulfill two desiderata : ( a ) slices should contain examples on which the model underperforms , or has a high error rate and ( b ) slices should contain examples that are coherent , or align closely with a human-understandable concept . An SDM that is able to reliably satisfy these desiderata across a wide range of settings has yet to be demonstrated for two reasons : Issue 1 : No quantitative evaluation framework exists for measuring performance of SDMs with respect to these desiderata . Existing SDM evaluations are either qualitative ( d ’ Eon et al. , 2021 ) , performed on purely synthetic data ( Yeh et al. , 2020 ) , or consider only a small selection of tasks and slices ( Sohoni et al. , 2020 ) . A comprehensive evaluation framework should be quantitative , use realistic data , cover a broad range of contexts , and evaluate both underperformance and coherence . Currently , no datasets or frameworks exist to support such an evaluation , making it difficult to evaluate the tradeoffs among prior SDMs . Issue 2 : Prior qualitative evaluations have demonstrated that existing SDMs often identify slices that are incoherent . A practically useful SDM should discover coherent slices that are understandable by a domain expert . For example , in the chest x-ray setting described earlier , the slice “ patients without chest drains ” is meaningful to a physician . Slice coherence has previously been evaluated qualitatively by requiring users to manually inspect examples and identify common attributes ( d ’ Eon et al. , 2021 ; Yeh et al. , 2020 ) . Such evaluations have shown that discovered slices often do not align with concepts understandable to a domain expert . Additionally , even if slices do align well with concepts , it may be difficult for humans to identify the shared concept . Thus , an ideal SDM would not only output coherent slices , but also identify the concept connecting examples in each slice . In this work , we address both of these issues by ( 1 ) developing a framework to quantitatively evaluate the effectiveness of slice discovery methods at scale and ( 2 ) leveraging this framework to demonstrate that a powerful class of recently-developed cross-modal embeddings can be used to create an SDM that satisfies the above desiderata . Our approach – Domino – identifies coherent slices and generates automated slice descriptions . After formally describing the slice discovery problem in Section 2 , we introduce an evaluation framework for rigorously assessing SDM performance in Section 3 . We curate a set of 1235 slice discovery settings , each consisting of a real-world classification dataset , a trained model , and one or more “ ground truth ” slices corresponding to a meaningful concept in the domain . During evaluation , the SDM is provided with the dataset and the model , and we measure if the labeled slices can be successfully identified . We find that existing methods identify “ ground truth ” slices in no more than 23 % of these settings . Motivated by the recent development of large cross-modal representation learning approaches ( e.g . CLIP ) that embed inputs and text in the same latent representation space , in Section 4 we present Domino , a novel SDM that uses cross-modal embeddings to identify coherent slices . Crossmodal representations incorporate semantic meaning from text into input embeddings , which we demonstrate can improve slice coherence and enable the generation of automated slice descriptions . Domino embeds inputs alongside natural language with cross-modal representations , identifies coherent slices with an error-aware Gaussian mixture model , and generates natural language descriptions for discovered slices . In Section 5 , we use our evaluation framework to show that Domino identifies 36 % of the “ ground truth ” coherent slices across three input domains ( natural images , medical images , and time-series ) – a 12 percentage-point improvement over existing methods . 2 RELATED WORK . Slice performance gaps . Machine learning models are often limited by the presence of underperforming slices , and in Section A.1 , we provide a survey of underperforming slices reported by prior studies across a range of application domains and slice types . Oakden-Rayner et al . ( 2019 ) referred to this problem as “ hidden stratification ” and motivated the need for slice discovery techniques . Slice discovery . Prior work on slice discovery has predominantly focused on structured input datasets ( e.g . tabular data ) , where slicing can generally be performed with predicates ( e.g . nationality = Peruvian ) ( Chung et al. , 2019 ; Sagadeeva & Boehm , 2021 ) . The slice discovery problem becomes particularly complex when input data lacks explicit structure ( e.g . images , audio , etc . ) , and three recent studies present methods for performing slice discovery in this unstructured setting ( d ’ Eon et al. , 2021 ; Sohoni et al. , 2020 ; Kim et al. , 2018 ) . The proposed SDMs follow two steps : ( 1 ) embed input data in a representation space and ( 2 ) identify underperforming slices using clustering or dimensionality reduction techniques2 . These SDMs are typically evaluated by measuring performance over a limited number of slice settings or by performing qualitative assessments . The trade-offs between these SDMs have not been systematically compared , and as a result , the conditions under which these SDMs succeed at identifying coherent slices remain unclear . Benchmark datasets for machine learning robustness . Recently , several benchmark datasets have been proposed for evaluating the performance of models on dataset shifts . These benchmarks are valuable because they provide labels specifying important slices of data . However , these datasets do not suffice for systematic evaluations of SDMs because they either only annotate a small number of slices ( Koh et al. , 2021 ) or do not provide pretrained models that are known to underperform on the slices ( He et al. , 2021 ; Khosla et al. , 2011 ; Hendrycks & Dietterich , 2019 ; Liang & Zou , 2021 ) . Cross-modal embeddings . Cross-modal representation learning approaches , which embed input data and text in the same representation space , yield powerful embeddings that have contributed to large performance improvements across information retrieval and classification tasks . Often trained with contrastive learning techniques , cross-modal models generate semantically meaningful input representations that have been shown to be highly effective on zero-shot classification tasks ( Radford et al. , 2021 ) . Cross-modal models that have inspired our work include CLIP for natural images ( Radford et al. , 2021 ) , ConVIRT for medical images ( Zhang et al. , 2020 ) , and WikiSatNet ( Uzkent et al. , 2019 ) for satellite imagery . 3 SLICE DISCOVERY PRELIMINARIES . In this section , we formally define the slice discovery problem . Consider a standard classification setting with input X ∈ X ( e.g . an image , time-series , or graph ) and label Y ∈ Y = { 1 , 2 , ... , C } over C classes . Additionally , assume there exists a set of k slices that partition the data into coherent ( potentially overlapping ) subgroups , where each subgroup captures a distinct concept or attribute that would be familiar to a domain expert . For each input , we represent slice membership as S = { S ( j ) } kj=1 ∈ { 0 , 1 } k. As an example , in the collapsed lung scenario presented in Section 1 , X 2Additional implementation details are provided in Section A.2.2 . represents chest X-rays , Y is a binary label indicating the presence of collapsed lungs , and S = { S ( 1 ) , S ( 2 ) } represents two slices : one consisting of normal radiographs with chest drains and the other consisting of collapsed lungs without chest drains . The slices , inputs , and labels vary jointly according to a probability distribution P ( X , Y , S ) over X × Y × { 0 , 1 } k. We assume that training , validation and test data are drawn independently and identically from this distribution . For some application-dependent value of , a model hθ : X → Y exhibits degraded performance with respect to a slice S ( j ) and metric ` : Y × Y → R if EX , Y |S ( j ) =1 [ ` ( hθ ( X ) , Y ) ] < EX , Y |S ( j ) =0 [ ` ( hθ ( X ) , Y ) ] − . Assuming that a trained classifier hθ : X → Y exhibits degraded performance on each of the k slices in S , we define the slice discovery problem as follows : • Inputs : a trained classifier hθ and labeled datasetD = { ( xi , yi ) } ni=1 drawn from P ( X , Y ) . • Output : a set of k̂ slicing functions Ψ = { ψ ( j ) : X × Y → { 0 , 1 } } k̂j=1 that partition the data into k̂ subgroups . We consider an output to be successful if , for each ground truth slice S ( u ) , a slicing function ψ ( v ) predicts S ( u ) with precision above some threshold β : ∀u ∈ [ k ] . ∃v ∈ [ k̂ ] . P ( S ( u ) = 1|ψ ( v ) ( X , Y ) = 1 ) > β . A slice discovery method ( SDM ) , M ( D , hθ ) → Ψ , aims to solve the slice discovery problem . | The paper propose a framework for identifying on which subsets of data machine learning models make systematic errors. The problem is cast in two parts: (1) identify a model that can be identify a subset of data and predict degraded performance of the machine learning model for this subset and (2) ensure that the identified subset is "coherent". The framework is evaluated on a number of classification tasks in computer vision and medicine. | SP:d7bfb6a33941b5691275b77917b1d100764b91af |
Domino: Discovering Systematic Errors with Cross-Modal Embeddings | 1 INTRODUCTION . Machine learning models often make systematic errors on important subsets ( or slices ) of data1 . For instance , models trained to detect collapsed lungs in chest X-rays have been shown to make predictions based on the presence of chest drains , a device typically used during treatment ( OakdenRayner et al. , 2019 ) . As a result , these models frequently make prediction errors on cases without chest drains , a critical data slice where false negative predictions could be life-threatening . Similar performance gaps across slices have been observed in radiograph classification ( Badgeley et al. , 2019a ; Zech et al. , 2018a ; DeGrave et al. , 2021a ) , melanoma detection ( Winkler et al. , 2019a ) , natural language processing ( Orr et al. , 2020 ; Goel et al. , 2021 ) , and object detection ( de Vries et al. , 2019b ) , among others . If underperforming slices can be accurately identified and labeled , we can then improve model robustness by either updating the training dataset or using robust optimization techniques ( Zhang et al. , 2018 ; Sagawa et al. , 2020 ) . However , identifying underperforming slices is difficult in practice . When working with highdimensional inputs ( e.g . images , time-series data , video ) , slices are often “ hidden ” , meaning that they can not easily be extracted from the inputs and are not annotated in metadata ( Oakden-Rayner et al. , 2019 ) . For instance , in the collapsed lung example above , the absence of chest drains is challenging to identify from raw image data and may not be explicitly labeled in metadata . In this setting , we must perform slice discovery : the task of mining unstructured input data for semantically meaningful subgroups on which the model performs poorly . 1We define a data slice as a group of data examples united by a shared attribute or characteristic . In modern machine learning workflows , practitioners commonly attempt slice discovery with a combination of feature-based interpretability methods ( e.g . GradCAM , LIME ) and manual inspection ( Selvaraju et al. , 2017 ; Ribeiro et al. , 2016 ) . However , these approaches are time-consuming and susceptible to confirmation bias ( Adebayo et al. , 2018 ) . As a result , recent works have proposed automated slice discovery methods ( SDMs ) , which utilize learned input representations to identify semantically meaningful slices where the model makes prediction errors ( d ’ Eon et al. , 2021 ; Yeh et al. , 2020 ; Sohoni et al. , 2020 ; Kim et al. , 2018 ) . An ideal SDM should automatically identify data slices that fulfill two desiderata : ( a ) slices should contain examples on which the model underperforms , or has a high error rate and ( b ) slices should contain examples that are coherent , or align closely with a human-understandable concept . An SDM that is able to reliably satisfy these desiderata across a wide range of settings has yet to be demonstrated for two reasons : Issue 1 : No quantitative evaluation framework exists for measuring performance of SDMs with respect to these desiderata . Existing SDM evaluations are either qualitative ( d ’ Eon et al. , 2021 ) , performed on purely synthetic data ( Yeh et al. , 2020 ) , or consider only a small selection of tasks and slices ( Sohoni et al. , 2020 ) . A comprehensive evaluation framework should be quantitative , use realistic data , cover a broad range of contexts , and evaluate both underperformance and coherence . Currently , no datasets or frameworks exist to support such an evaluation , making it difficult to evaluate the tradeoffs among prior SDMs . Issue 2 : Prior qualitative evaluations have demonstrated that existing SDMs often identify slices that are incoherent . A practically useful SDM should discover coherent slices that are understandable by a domain expert . For example , in the chest x-ray setting described earlier , the slice “ patients without chest drains ” is meaningful to a physician . Slice coherence has previously been evaluated qualitatively by requiring users to manually inspect examples and identify common attributes ( d ’ Eon et al. , 2021 ; Yeh et al. , 2020 ) . Such evaluations have shown that discovered slices often do not align with concepts understandable to a domain expert . Additionally , even if slices do align well with concepts , it may be difficult for humans to identify the shared concept . Thus , an ideal SDM would not only output coherent slices , but also identify the concept connecting examples in each slice . In this work , we address both of these issues by ( 1 ) developing a framework to quantitatively evaluate the effectiveness of slice discovery methods at scale and ( 2 ) leveraging this framework to demonstrate that a powerful class of recently-developed cross-modal embeddings can be used to create an SDM that satisfies the above desiderata . Our approach – Domino – identifies coherent slices and generates automated slice descriptions . After formally describing the slice discovery problem in Section 2 , we introduce an evaluation framework for rigorously assessing SDM performance in Section 3 . We curate a set of 1235 slice discovery settings , each consisting of a real-world classification dataset , a trained model , and one or more “ ground truth ” slices corresponding to a meaningful concept in the domain . During evaluation , the SDM is provided with the dataset and the model , and we measure if the labeled slices can be successfully identified . We find that existing methods identify “ ground truth ” slices in no more than 23 % of these settings . Motivated by the recent development of large cross-modal representation learning approaches ( e.g . CLIP ) that embed inputs and text in the same latent representation space , in Section 4 we present Domino , a novel SDM that uses cross-modal embeddings to identify coherent slices . Crossmodal representations incorporate semantic meaning from text into input embeddings , which we demonstrate can improve slice coherence and enable the generation of automated slice descriptions . Domino embeds inputs alongside natural language with cross-modal representations , identifies coherent slices with an error-aware Gaussian mixture model , and generates natural language descriptions for discovered slices . In Section 5 , we use our evaluation framework to show that Domino identifies 36 % of the “ ground truth ” coherent slices across three input domains ( natural images , medical images , and time-series ) – a 12 percentage-point improvement over existing methods . 2 RELATED WORK . Slice performance gaps . Machine learning models are often limited by the presence of underperforming slices , and in Section A.1 , we provide a survey of underperforming slices reported by prior studies across a range of application domains and slice types . Oakden-Rayner et al . ( 2019 ) referred to this problem as “ hidden stratification ” and motivated the need for slice discovery techniques . Slice discovery . Prior work on slice discovery has predominantly focused on structured input datasets ( e.g . tabular data ) , where slicing can generally be performed with predicates ( e.g . nationality = Peruvian ) ( Chung et al. , 2019 ; Sagadeeva & Boehm , 2021 ) . The slice discovery problem becomes particularly complex when input data lacks explicit structure ( e.g . images , audio , etc . ) , and three recent studies present methods for performing slice discovery in this unstructured setting ( d ’ Eon et al. , 2021 ; Sohoni et al. , 2020 ; Kim et al. , 2018 ) . The proposed SDMs follow two steps : ( 1 ) embed input data in a representation space and ( 2 ) identify underperforming slices using clustering or dimensionality reduction techniques2 . These SDMs are typically evaluated by measuring performance over a limited number of slice settings or by performing qualitative assessments . The trade-offs between these SDMs have not been systematically compared , and as a result , the conditions under which these SDMs succeed at identifying coherent slices remain unclear . Benchmark datasets for machine learning robustness . Recently , several benchmark datasets have been proposed for evaluating the performance of models on dataset shifts . These benchmarks are valuable because they provide labels specifying important slices of data . However , these datasets do not suffice for systematic evaluations of SDMs because they either only annotate a small number of slices ( Koh et al. , 2021 ) or do not provide pretrained models that are known to underperform on the slices ( He et al. , 2021 ; Khosla et al. , 2011 ; Hendrycks & Dietterich , 2019 ; Liang & Zou , 2021 ) . Cross-modal embeddings . Cross-modal representation learning approaches , which embed input data and text in the same representation space , yield powerful embeddings that have contributed to large performance improvements across information retrieval and classification tasks . Often trained with contrastive learning techniques , cross-modal models generate semantically meaningful input representations that have been shown to be highly effective on zero-shot classification tasks ( Radford et al. , 2021 ) . Cross-modal models that have inspired our work include CLIP for natural images ( Radford et al. , 2021 ) , ConVIRT for medical images ( Zhang et al. , 2020 ) , and WikiSatNet ( Uzkent et al. , 2019 ) for satellite imagery . 3 SLICE DISCOVERY PRELIMINARIES . In this section , we formally define the slice discovery problem . Consider a standard classification setting with input X ∈ X ( e.g . an image , time-series , or graph ) and label Y ∈ Y = { 1 , 2 , ... , C } over C classes . Additionally , assume there exists a set of k slices that partition the data into coherent ( potentially overlapping ) subgroups , where each subgroup captures a distinct concept or attribute that would be familiar to a domain expert . For each input , we represent slice membership as S = { S ( j ) } kj=1 ∈ { 0 , 1 } k. As an example , in the collapsed lung scenario presented in Section 1 , X 2Additional implementation details are provided in Section A.2.2 . represents chest X-rays , Y is a binary label indicating the presence of collapsed lungs , and S = { S ( 1 ) , S ( 2 ) } represents two slices : one consisting of normal radiographs with chest drains and the other consisting of collapsed lungs without chest drains . The slices , inputs , and labels vary jointly according to a probability distribution P ( X , Y , S ) over X × Y × { 0 , 1 } k. We assume that training , validation and test data are drawn independently and identically from this distribution . For some application-dependent value of , a model hθ : X → Y exhibits degraded performance with respect to a slice S ( j ) and metric ` : Y × Y → R if EX , Y |S ( j ) =1 [ ` ( hθ ( X ) , Y ) ] < EX , Y |S ( j ) =0 [ ` ( hθ ( X ) , Y ) ] − . Assuming that a trained classifier hθ : X → Y exhibits degraded performance on each of the k slices in S , we define the slice discovery problem as follows : • Inputs : a trained classifier hθ and labeled datasetD = { ( xi , yi ) } ni=1 drawn from P ( X , Y ) . • Output : a set of k̂ slicing functions Ψ = { ψ ( j ) : X × Y → { 0 , 1 } } k̂j=1 that partition the data into k̂ subgroups . We consider an output to be successful if , for each ground truth slice S ( u ) , a slicing function ψ ( v ) predicts S ( u ) with precision above some threshold β : ∀u ∈ [ k ] . ∃v ∈ [ k̂ ] . P ( S ( u ) = 1|ψ ( v ) ( X , Y ) = 1 ) > β . A slice discovery method ( SDM ) , M ( D , hθ ) → Ψ , aims to solve the slice discovery problem . | Recent studies have proposed automated slice discovery methods (SDMs), which leverage learned model representations to mine input data for slices, or important subgroups of data, on which a model performs poorly. An ideal SDM should automatically identify: 1. Slices that contain examples on which the model underperforms, or has a high error rate. 2. Slices that contain examples that are coherent, or align closely with a human-understandable concept. This is difficult because: 1: No quantitative evaluation framework exists for measuring performance of SDMs; Existing SDM evaluations are either qualitative, performed on synthetic data, or consider only a small subset. 2. Prior qualitative evaluations have demonstrated that existing SDMs often identify slices that are incoherent, even though they may satisfy the first ideal case. Domino: The authors preset Domino, an SDM that leverages cross-modal embeddings and a novel error-aware mixture model to discover and describe coherent slices using natural language descriptions. The proposed method could also quantitatively compare SDMs, which has not been done before. Step 1. Embed: Encode inputs in a cross-modal embedding space with a function. Step 2. Slice: identify underperforming regions in the cross-modal embedding space using an error-aware mixture model fit on the input embeddings, model predictions, true class labels using expectation maximization. I.e. input embeddings, class labels, and model predictions as independent based on slice. Step 3. Describe: Use the text embedding function ψtext learned in step (1) to generate a set of k natural language descriptions of the discovered slice. Evaluation Approach of 3 popular slide types: Rare slice: To generate settings with rare slices, Construct a skewed dataset such that for a given class label Y, elements in subclass C occur with proportion α, where 0.01 < α < 0.1. Correlation slice: Construct a dataset such that a linear correlation α exists between the target variable and other class labels, where 0.2 < α < 0.8. Noisy label slice. Construct dataset such that for each given class label Y, the elements in subclass C exhibit label noise with probability α, where 0.01 < α < 0.3. Experiments show that when cross-modal embeddings are provided as input, the error-aware mixture model often outperforms previously-designed SDMs. | SP:d7bfb6a33941b5691275b77917b1d100764b91af |
Modelling neuronal behaviour with time series regression: Recurrent Neural Networks on synthetic C. elegans data | 1 INTRODUCTION . The study of the human brain is probably one of the greatest challenges in the field of neuroscience . Recent developments in experimental neuroscience have considerably increased the availability of novel recordings and reconstructions shedding further light into the structure and function of the brain as well as many other systems . But understanding the complexities behind the relations between structure and function as well as the behaviour of such systems across multiple scales in these neuronal collections is constrained by the methods available to study them . This challenge has raised interest in many related fields , such as electrophysiological analysis , imaging techniques , brain-related medicine , computational modelling and simulation , model reduction . Many of these efforts , while not directly providing specific information regarding structural or functional dynamics , do supply large volumes of recordings , measurements or simulations of observable input-output behaviour . The availability of these large datasets raises the question whether low complexity , data-driven , black-box models can be used to model such input-output relations with low error , avoiding the excessive inner detail which may not be known or available . To determine whether such an approach can be used for large , complex systems , one research direction is the study of smaller and simpler nervous systems , for which the underlying principles of network organization and information processing are easier to postulate . These organisms can become useful models to gain insight into the fundaments of neuronal dynamics and whole brain organization , to validate hypotheses , to develop and test modelling methods , simulation instruments and model reduction techniques . The hope is that the knowledge gained from these analyses and the techniques developed for these simpler organisms can later be used to model more complex systems . Caenorhabditis Elegans ( C. elegans ) belongs to this category of organisms and is quickly becoming one of the benchmarks in whole brain organization studies . C. elegans is a nematode ( roundworm ) of about 1 mm in length with a compact nervous system consisting of less than 1000 cells across all sexes and around 15000 connections ( Cook et al. , 2019 ) . This rather small nervous system allows the worm to solve basic problems such as feeding , predator avoidance and mate-finding . The relative simplicity of C. elegans allowed for its almost complete description from different perspectives and scales , from its genetics and genomics to the molecular biology , structural anatomy , neuronal function , circuits and behaviour . This information is available in comprehensive databases of genetics and genomics ( Hunt-Newbury et al. , 2007 ) , electron micrographs and associated data , online books and atlases of the neurobiology , structural and behavioural anatomy ( Jackson et al. , 2014 ) . Creating a realistic model that encapsulates all this information is not a trivial task . Open-source databases of digitally reconstructed neurons ( Gleeson et al. , 2019 ) , computational models ( Szigeti et al. , 2014 ) and collaborative solutions ( Cantarelli et al. , 2018 ) are opening the door for more flexible , multi-scale and multi-algorithm simulation environments for C. elegans and other complex biological systems . The underlying models are based on the connectome , the map of the neuronal connections in the brain . Usually described as a neuronal network , the connectome is a graph where the nodes are the neurons and the edges represent the synapses . The complete connectome of C. elegans contains 302 neurons for the adult hermaphrodite ( Varshney et al. , 2011 ) and 385 neurons for the male ( Cook et al. , 2019 ) , but for the latter the respective 3D reconstructions are not yet published . Digital reconstructions for the male are only available for the posterior nervous system of 144 neurons ( Jarrell et al. , 2012 ) . The more complex the organism , the more complicated the resulting model , needing more computationally demanding and potentially intractable simulations of its dynamic behaviour . This increased complexity stems from the detailed modelling of the internal structure . However , in many cases , especially of highly complex systems , this detail is not available since the internal mechanisms may not be well known or mapped or it may be simply impossible to examine and record . For that reason , frequently one is really only interested in the peripheral , or input-output behaviour . This motivates our efforts not only to place the focus more on observable input-output data , as well as to try and generate reduced models that avoid extraneous detail not necessary to explain these peripheral relations . In this work we propose a methodology for generating a reduced order model of the neuronal behaviour of organisms using only peripheral information . We use C. elegans as a proxy for our study . Realistic models of C. elegans , which take into account spatial distribution and biophysical properties of neuronal compartments have been reported in the literature ( Gleeson et al. , 2018 ) . We start with a similar model created in-house . Our model comprises the complete connectome of the adult hermaphrodite of C. elegans , with 302 multi-compartmental neurons and 6702 synapses ( Varshney et al. , 2011 ) . The model was validated ( Anonymous , 2021 ) against four scenarios described in related literature ( Kim et al. , 2019 ) : Forward Crawling Motion ( FCM ) for the full network , Ablation of AVB interneurons + FCM , Ablation of AVA interneurons + FCM and the Nictation behaviour . We reproduce here the FCM scenario , in which we apply stimulus on the touch sensitive sensory neurons and the interneurons known to be part of the forward movement circuit and we check the activity of the motor neurons associated with forward locomotion . Since we find strong activity in most of these neurons , we conclude that the worm moves forward . Based on synthetic data extracted from this high-fidelity model , we create a completely equation-free data-driven model assuming no prior knowledge of the original system ’ s structure and equations , using neural networks trained on datasets representing the system ’ s response to different input signals . The ultimate goal is to generate a reduced model to replace the original , detailed one . This reduced model should be able to reproduce with reasonably low RMSE the behaviour of the realistic model while having fewer degrees of freedom . In this work we focus on the issue of reduced RMSE , which we equate to fidelity in reproducing the system dynamics , showing that we can produce sufficiently accurate models for analysing the behaviour of the C. elegans nervous system using neural networks . 2 RELATED WORK AND CONTEXT . The connectome-based models mentioned above are often termed white-box models , as they are based on direct knowledge and access to the internal structure and parameters ’ values of the modelled system . These are distributed models , where each neuron has a 3D description and position in space and the synapses are associated with neuronal sections . Such models enable highly accurate simulation of the dynamic behaviour of organisms , but easily become extremely complex as they incorporate detailed structural and functional information of the system . While the white-box approach ensures access to and evaluation of inner parameters during simulation , it has been shown that the activity of complex networks of neurons can often be described by relatively few distinct patterns , which evolve on low-dimensional subspaces ( Karasözen , 2020 ) . This knowledge , together with the ever-present need to avoid potential numerical intractability in large-scale networks with many degrees of freedom , has generated renewed interest in applying model reduction , often also referred to as model compression , to these neuronal networks , including techniques such as Dynamic Mode Decomposition ( DMD ) ( Brunton et al. , 2016 ) , Proper Orthogonal Decomposition ( POD ) ( Kellems et al. , 2009 ) and Discrete Empirical Interpolation ( DEIM ) ( Lehtimäki et al. , 2019 ) . Depending on the level of morphological accuracy of the underlying models , reduction techniques can have any shade of grey from white-box to black-box , the latter assuming no preliminary knowledge of the system structure and building the model solely out of knowledge of its input-output behaviour . Black-box approaches are often built upon data-driven models , sometimes learning-based , which have the ability to grasp more naturally and more efficiently the complexity induced by the profound nonlinearities in the neuronal transmission of information . Machine-learning techniques are used to extract data-driven reduced order models for systems arising from differential equations describing the intrinsic dynamics ( Regazzoni et al. , 2019 ) and even to extract the governing equations of the estimated model ( Sun et al. , 2020 ) . It is therefore quite natural to consider using state of the art learning methods for developing reduced models of neuronal behaviour using data obtained from available recordings or even simulations obtained with more complex models . Especially designed to capture temporal dynamic behaviour , Recurrent Neural Networks ( RNNs ) , in their various architectures such as Long Short-Term Memory ( LSTMs ) and Gated Recurrent Units ( GRUs ) , have been extensively and successfully used for forecasting or detecting faults in multivariate time series data ( Massaoudi et al. , 2019 ) , ( Gallicchio et al. , 2018 ) , ( Yuan et al. , 2020 ) , ( Filonov et al. , 2016 ) . Bidirectional LSTMs were used to model genome data by Tavakoli ( 2019 ) , whereas a combination of CNNs and LSTMs generates a model for epileptic seizure recognition using EEG signal analysis in Xu et al . ( 2020 ) . An attempt to model the human brain activity based on fMRI using RNNs ( LSTMs and GRUs ) is reported in Güçlü & van Gerven ( 2017 ) . In recent years , deep network approaches were used to model realistic neural activity data ( Molano-Mazon et al. , 2018 ) , ( Bellec et al. , 2021 ) , ( Karampatziakis , 2010 ) . Few studies examined the behavioural output of network models of C. elegans using machine-learning techniques . RNNs are generated in a grey-box manner to study the chemotaxis behaviour ( Xu et al. , 2010 ) or to predict the synaptic polarities ( Lanza et al. , 2021 ) of C. elegans , yet these models only include a subset of the connectome . 3 METHODS . Given that the starting point is in fact represented by time series data obtained from simulations of the realistic connectome-based model , the modelling task is akin to a sequence to sequence conversion for which the most suitable neural network models are sequential ones . In this work we analyze the suitability of three of the most commonly used architectures for recurrent neural networks . We start with the least complex unit , the simple RNN , originally proposed in the 1980 ’ s to model sequence data ( Rumelhart et al. , 1986 ) , ( Werbos , 1988 ) , ( Elman , 1990 ) . The second model used for the recurrent layer is the LSTM unit , developed by Hochreiter & Schmidhuber ( 1997 ) and later improved with the introduction of the forget gate to adaptively release internal resources when necessary ( Gers et al. , 1999 ) . Finally we analyze its sibling , the GRU ( Cho et al. , 2014 ) . 3.1 RECURRENT NEURAL NETWORKS . RNNs ( Rumelhart et al. , 1986 ) , ( Werbos , 1988 ) , ( Elman , 1990 ) are a family of neural networks used for processing sequential data , particularly adept to processing a sequence of values x ( 1 ) , ... , x ( t ) , and in most cases capable to process sequences of variable length . RNNs appear from the relaxation of the condition on Feedforward Neural Networks ( FFNNs ) that neurons in a given layer do not form connections among themselves . Although RNNs , which are trained using Backpropagation Through Time ( BPTT ) ( Werbos , 1990 ) , seem to be a good model for sequential tasks , they are known to suffer mainly from two issues , vanishing and exploding gradients ( Bengio et al. , 1994 ) . Exploding gradients ( Bengio et al. , 1994 ) refer to a large increase in the norm of the gradient during training , which appears due to the explosion of long term components that can grow exponentially more than short term ones . This is the less common of the two problems and there are known solutions to handle it , such as the clipping gradient technique ( Pascanu et al. , 2012 ) . A harder to solve problem is the vanishing gradient issue ( Bengio et al. , 1994 ) , which refers to when long term components go exponentially fast to norm 0 , making it impossible for the model to learn the correlation between temporally distant events . In order to faithfully reproduce the dynamics of our system the simulations used for generating the datasets require the use of fine time steps , leading to long data sequences . This in turn implies that the response at a given time will depend on values which are far back in the sequence . This situation , however unavoidable , may lead the RNN to experience difficulties in learning our data resulting in a model with unacceptable RMSE . | Authors show how the nervous system of C. elegans can be modelled and simulated with data-driven models using different neural network architectures. Specifically, they target the use of state of the art recurrent neural networks architectures such as LSTMs and GRUs and compare these architectures in terms of their properties and their RMSE, as well as the complexity of the resulting models. Authors show that GRU models with a hidden layer size of 4 units are able to accurately reproduce the system’s response to very different stimuli. | SP:e0748a938f66f678cbe7827a9f336bdf4c1ec891 |
Modelling neuronal behaviour with time series regression: Recurrent Neural Networks on synthetic C. elegans data | 1 INTRODUCTION . The study of the human brain is probably one of the greatest challenges in the field of neuroscience . Recent developments in experimental neuroscience have considerably increased the availability of novel recordings and reconstructions shedding further light into the structure and function of the brain as well as many other systems . But understanding the complexities behind the relations between structure and function as well as the behaviour of such systems across multiple scales in these neuronal collections is constrained by the methods available to study them . This challenge has raised interest in many related fields , such as electrophysiological analysis , imaging techniques , brain-related medicine , computational modelling and simulation , model reduction . Many of these efforts , while not directly providing specific information regarding structural or functional dynamics , do supply large volumes of recordings , measurements or simulations of observable input-output behaviour . The availability of these large datasets raises the question whether low complexity , data-driven , black-box models can be used to model such input-output relations with low error , avoiding the excessive inner detail which may not be known or available . To determine whether such an approach can be used for large , complex systems , one research direction is the study of smaller and simpler nervous systems , for which the underlying principles of network organization and information processing are easier to postulate . These organisms can become useful models to gain insight into the fundaments of neuronal dynamics and whole brain organization , to validate hypotheses , to develop and test modelling methods , simulation instruments and model reduction techniques . The hope is that the knowledge gained from these analyses and the techniques developed for these simpler organisms can later be used to model more complex systems . Caenorhabditis Elegans ( C. elegans ) belongs to this category of organisms and is quickly becoming one of the benchmarks in whole brain organization studies . C. elegans is a nematode ( roundworm ) of about 1 mm in length with a compact nervous system consisting of less than 1000 cells across all sexes and around 15000 connections ( Cook et al. , 2019 ) . This rather small nervous system allows the worm to solve basic problems such as feeding , predator avoidance and mate-finding . The relative simplicity of C. elegans allowed for its almost complete description from different perspectives and scales , from its genetics and genomics to the molecular biology , structural anatomy , neuronal function , circuits and behaviour . This information is available in comprehensive databases of genetics and genomics ( Hunt-Newbury et al. , 2007 ) , electron micrographs and associated data , online books and atlases of the neurobiology , structural and behavioural anatomy ( Jackson et al. , 2014 ) . Creating a realistic model that encapsulates all this information is not a trivial task . Open-source databases of digitally reconstructed neurons ( Gleeson et al. , 2019 ) , computational models ( Szigeti et al. , 2014 ) and collaborative solutions ( Cantarelli et al. , 2018 ) are opening the door for more flexible , multi-scale and multi-algorithm simulation environments for C. elegans and other complex biological systems . The underlying models are based on the connectome , the map of the neuronal connections in the brain . Usually described as a neuronal network , the connectome is a graph where the nodes are the neurons and the edges represent the synapses . The complete connectome of C. elegans contains 302 neurons for the adult hermaphrodite ( Varshney et al. , 2011 ) and 385 neurons for the male ( Cook et al. , 2019 ) , but for the latter the respective 3D reconstructions are not yet published . Digital reconstructions for the male are only available for the posterior nervous system of 144 neurons ( Jarrell et al. , 2012 ) . The more complex the organism , the more complicated the resulting model , needing more computationally demanding and potentially intractable simulations of its dynamic behaviour . This increased complexity stems from the detailed modelling of the internal structure . However , in many cases , especially of highly complex systems , this detail is not available since the internal mechanisms may not be well known or mapped or it may be simply impossible to examine and record . For that reason , frequently one is really only interested in the peripheral , or input-output behaviour . This motivates our efforts not only to place the focus more on observable input-output data , as well as to try and generate reduced models that avoid extraneous detail not necessary to explain these peripheral relations . In this work we propose a methodology for generating a reduced order model of the neuronal behaviour of organisms using only peripheral information . We use C. elegans as a proxy for our study . Realistic models of C. elegans , which take into account spatial distribution and biophysical properties of neuronal compartments have been reported in the literature ( Gleeson et al. , 2018 ) . We start with a similar model created in-house . Our model comprises the complete connectome of the adult hermaphrodite of C. elegans , with 302 multi-compartmental neurons and 6702 synapses ( Varshney et al. , 2011 ) . The model was validated ( Anonymous , 2021 ) against four scenarios described in related literature ( Kim et al. , 2019 ) : Forward Crawling Motion ( FCM ) for the full network , Ablation of AVB interneurons + FCM , Ablation of AVA interneurons + FCM and the Nictation behaviour . We reproduce here the FCM scenario , in which we apply stimulus on the touch sensitive sensory neurons and the interneurons known to be part of the forward movement circuit and we check the activity of the motor neurons associated with forward locomotion . Since we find strong activity in most of these neurons , we conclude that the worm moves forward . Based on synthetic data extracted from this high-fidelity model , we create a completely equation-free data-driven model assuming no prior knowledge of the original system ’ s structure and equations , using neural networks trained on datasets representing the system ’ s response to different input signals . The ultimate goal is to generate a reduced model to replace the original , detailed one . This reduced model should be able to reproduce with reasonably low RMSE the behaviour of the realistic model while having fewer degrees of freedom . In this work we focus on the issue of reduced RMSE , which we equate to fidelity in reproducing the system dynamics , showing that we can produce sufficiently accurate models for analysing the behaviour of the C. elegans nervous system using neural networks . 2 RELATED WORK AND CONTEXT . The connectome-based models mentioned above are often termed white-box models , as they are based on direct knowledge and access to the internal structure and parameters ’ values of the modelled system . These are distributed models , where each neuron has a 3D description and position in space and the synapses are associated with neuronal sections . Such models enable highly accurate simulation of the dynamic behaviour of organisms , but easily become extremely complex as they incorporate detailed structural and functional information of the system . While the white-box approach ensures access to and evaluation of inner parameters during simulation , it has been shown that the activity of complex networks of neurons can often be described by relatively few distinct patterns , which evolve on low-dimensional subspaces ( Karasözen , 2020 ) . This knowledge , together with the ever-present need to avoid potential numerical intractability in large-scale networks with many degrees of freedom , has generated renewed interest in applying model reduction , often also referred to as model compression , to these neuronal networks , including techniques such as Dynamic Mode Decomposition ( DMD ) ( Brunton et al. , 2016 ) , Proper Orthogonal Decomposition ( POD ) ( Kellems et al. , 2009 ) and Discrete Empirical Interpolation ( DEIM ) ( Lehtimäki et al. , 2019 ) . Depending on the level of morphological accuracy of the underlying models , reduction techniques can have any shade of grey from white-box to black-box , the latter assuming no preliminary knowledge of the system structure and building the model solely out of knowledge of its input-output behaviour . Black-box approaches are often built upon data-driven models , sometimes learning-based , which have the ability to grasp more naturally and more efficiently the complexity induced by the profound nonlinearities in the neuronal transmission of information . Machine-learning techniques are used to extract data-driven reduced order models for systems arising from differential equations describing the intrinsic dynamics ( Regazzoni et al. , 2019 ) and even to extract the governing equations of the estimated model ( Sun et al. , 2020 ) . It is therefore quite natural to consider using state of the art learning methods for developing reduced models of neuronal behaviour using data obtained from available recordings or even simulations obtained with more complex models . Especially designed to capture temporal dynamic behaviour , Recurrent Neural Networks ( RNNs ) , in their various architectures such as Long Short-Term Memory ( LSTMs ) and Gated Recurrent Units ( GRUs ) , have been extensively and successfully used for forecasting or detecting faults in multivariate time series data ( Massaoudi et al. , 2019 ) , ( Gallicchio et al. , 2018 ) , ( Yuan et al. , 2020 ) , ( Filonov et al. , 2016 ) . Bidirectional LSTMs were used to model genome data by Tavakoli ( 2019 ) , whereas a combination of CNNs and LSTMs generates a model for epileptic seizure recognition using EEG signal analysis in Xu et al . ( 2020 ) . An attempt to model the human brain activity based on fMRI using RNNs ( LSTMs and GRUs ) is reported in Güçlü & van Gerven ( 2017 ) . In recent years , deep network approaches were used to model realistic neural activity data ( Molano-Mazon et al. , 2018 ) , ( Bellec et al. , 2021 ) , ( Karampatziakis , 2010 ) . Few studies examined the behavioural output of network models of C. elegans using machine-learning techniques . RNNs are generated in a grey-box manner to study the chemotaxis behaviour ( Xu et al. , 2010 ) or to predict the synaptic polarities ( Lanza et al. , 2021 ) of C. elegans , yet these models only include a subset of the connectome . 3 METHODS . Given that the starting point is in fact represented by time series data obtained from simulations of the realistic connectome-based model , the modelling task is akin to a sequence to sequence conversion for which the most suitable neural network models are sequential ones . In this work we analyze the suitability of three of the most commonly used architectures for recurrent neural networks . We start with the least complex unit , the simple RNN , originally proposed in the 1980 ’ s to model sequence data ( Rumelhart et al. , 1986 ) , ( Werbos , 1988 ) , ( Elman , 1990 ) . The second model used for the recurrent layer is the LSTM unit , developed by Hochreiter & Schmidhuber ( 1997 ) and later improved with the introduction of the forget gate to adaptively release internal resources when necessary ( Gers et al. , 1999 ) . Finally we analyze its sibling , the GRU ( Cho et al. , 2014 ) . 3.1 RECURRENT NEURAL NETWORKS . RNNs ( Rumelhart et al. , 1986 ) , ( Werbos , 1988 ) , ( Elman , 1990 ) are a family of neural networks used for processing sequential data , particularly adept to processing a sequence of values x ( 1 ) , ... , x ( t ) , and in most cases capable to process sequences of variable length . RNNs appear from the relaxation of the condition on Feedforward Neural Networks ( FFNNs ) that neurons in a given layer do not form connections among themselves . Although RNNs , which are trained using Backpropagation Through Time ( BPTT ) ( Werbos , 1990 ) , seem to be a good model for sequential tasks , they are known to suffer mainly from two issues , vanishing and exploding gradients ( Bengio et al. , 1994 ) . Exploding gradients ( Bengio et al. , 1994 ) refer to a large increase in the norm of the gradient during training , which appears due to the explosion of long term components that can grow exponentially more than short term ones . This is the less common of the two problems and there are known solutions to handle it , such as the clipping gradient technique ( Pascanu et al. , 2012 ) . A harder to solve problem is the vanishing gradient issue ( Bengio et al. , 1994 ) , which refers to when long term components go exponentially fast to norm 0 , making it impossible for the model to learn the correlation between temporally distant events . In order to faithfully reproduce the dynamics of our system the simulations used for generating the datasets require the use of fine time steps , leading to long data sequences . This in turn implies that the response at a given time will depend on values which are far back in the sequence . This situation , however unavoidable , may lead the RNN to experience difficulties in learning our data resulting in a model with unacceptable RMSE . | This paper investigates the use of recurrent neural networks as a model reduction tool in computational neuroscience. More specifically, the authors consider the problem of predicting the activity of a set of four neurons in the C Elegans nematode worm, resulting from the (simulated) electrical stimulation of other neurons in the animal's connectome. Three experiments are carried out, testing different network architectures, network sizes, and the effect of increasing the temporal resolution of the data. The results show that a small GRU-based network is sufficient for achieving excellent agreement with the starting data, which was generated using computationally demanding simulations of a network of multi-compartimental neurons. The paper also includes an introduction on popular RNN architectures, and on the problem of model reduction in computational neuroscience. | SP:e0748a938f66f678cbe7827a9f336bdf4c1ec891 |
Occupy & Specify: Investigations into a Maximum Credit Assignment Occupancy Objective for Data-efficient Reinforcement Learning | 1 PROBLEM STATEMENT . Learning in the real world implies dealing with very large , potentially unlimited environments , over which the data to collect is seemingly infinite . Efficient exploration is thus one of the key aspects of open-ended learning Santucci et al . ( 2020 ) , when no final model of the environment can feasibly be expected to be engineered or trained . On the one side , having access to unlimited data is very beneficial for the training of complex multi-layered perceptrons , for they are known to rely on large datasets to improve their performance . On the other side , the circular dependence between the learning algorithm and the data on which it operates renders the learning very tricky , at high risk of data overfitting and trapping in local optima . The open-ended learning problem is generally addressed through the lens of the reinforcement learning framework ( Sutton et al. , 1998 ) , where rewards are collected during the interaction , and the selection of action is fit so as to maximize the total number of positive rewards , and prevent the encounter of negative ones . Fitting behaviour to rewards is however at the risk of ignoring important data from the rest of the environment , where putatively more rewarding regions may be neglected . The agreement of reward-seeking ( that is exploitation ) with data collecting ( that is exploration ) , is still one of the fundamental issues of modern artificial intelligence . An important effort has recently been put on reframing the reinforcement learning setup into a more general probabilistic inference framework , allowing to link rewards seeking and data modelling under a single perspective ( Furmston & Barber , 2010 ; Levine , 2018 ; Haarnoja et al. , 2018 ; Abdolmaleki et al. , 2018 ; Fellows et al. , 2019 ) . This greater focus over the data collection problem is linked to an important set of training algorithms , that contain some forms of exploration bonuses , including “ curiosity ” drives ( Schmidhuber et al. , 2009 ; Pathak et al. , 2017 ) , intrinsic rewards ( Oudeyer et al. , 2007 ) and pseudo-counts ( Bellemare et al. , 2016 ; Tang et al. , 2017 ) . However , at the difference of the classic optimization on rewards alone , where the Bellman optimum is well defined , there is still no consensus about the objective followed when optimizing both on rewards and data collection under a variational perspective ( Eysenbach & Levine , 2019 ) . The data collection problem is effectively shadowed by the reward maximization objective , under which it is still considered as a incidental component . An important body of work has recently been devoted to addressing the data collection problem as such , with the notable design of the MaxEnt algorithm ( Hazan et al. , 2019 ) , State Marginal Matching ( Lee et al. , 2019 ) and E3D ( Daucé , 2020 ) , that aim at fitting the distribution of the states encountered to a uniform distribution , in the absence of definite rewards . This is here referred as a MaxEnt-on-state principle ( or MaxEnt to be short ) , not to be confounded with the MaxEnt-on-actions principle implemented in the soft actor critic ( Haarnoja et al. , 2018 ) for instance . Following a MaxEnt objective means optimizing the policy so as the states visited are maximally variable , ideally uniformly visiting all possible states . We develop in the following a possible extension of the MaxEnt principle , that brings a considerable simplification in the expression of the evidence lower bound ( ELBO ) with regards with the existing literature ( Furmston & Barber , 2010 ; Abdolmaleki et al. , 2018 ; Fellows et al. , 2019 ) . In contrast to pure MaxEnt , our approach provides a way to combine the MaxEnt objective with a reward maximization objective , under a variational inference perspective . An intriguing property of the resulting ELBO formula is that the future states ( the ones that are visited after the current observation ) play the role of a model for the current data , participating in the elaboration of the returns collected under the current policy . This gives ways toward optimizing the policy with respect to the distribution of the data , and provides a principled justification to the use of intrinsic rewards in the design of reinforcement learning algorithms . 2 PRINCIPLES . 2.1 PROBABILITY MATCHING RL . We assume an agent acting in a fully observable environment . The state of the environment is provided by an observation s ∈ S , with S the set of all possible states . The agent can act on the environment through its actuators . Such a motor command is described by a ∈ A , with A the set of all motor commands . In the following , the capital letters S and A will reflect random variables on S andA , and the lower cases s and a will either reflect observations or random draw realizations . The decision of which action to choose relies on a policy , that maps the current observation to the action space , generally expressed in a conditional probabilistic form π ( a|s ) . A reinforcement learning problem consists in finding a policy π∗ that maximizes a certain objective function , without knowing the physical or mechanical properties of the environment . It is supposed here , for simplicity , that the dynamics of the environment is Markovian ( no hidden states ) . Moreover , the environment is providing an auxiliary signal called the reward . Sending an action to the environment makes it possible to access to a new state s′ , and to obtain a reward r ∈ R. A classic objective in learning is to maximize the global return , generally described as a discounted sum of future rewards over all possible trajectories . Let us now denote by st the state visited at time t and τ ( st ) = ( st+1 , ... , st+T , ... ) a certain pathway that is visited after observing st. During this visit , a certain number of rewards can be collected , and R ( τ ) is the ( discounted ) return obtained over τ , i.e . R ( τ ) = ∑ t γ trt , with γ ∈ [ 0 , 1 [ a discounting factor that sums up the rewards up to an “ horizon ” of the order of 11−γ . This said , the dynamic programming objective ( Bellman , 1966 ) , is the result of π∗ = maxΠ Es∼p ( S0 ) , τ∼pπ ( τ |s ) R ( τ ) , with p ( S0 ) the distribution of initial states , and Π the set of all conditional policies . When a state transition model p ( S′|s , a ) is provided , the unique solution is given by the dynamic programming recurrent equation in the discrete case ( Bellman , 1966 ) . On the contrary , a large panel of reinforcement learning techniques allow to approach the solution in the model-free setup , assuming an effective sampling of all state-action pairs ( Sutton et al. , 1998 ) . We are here interested in a different class of objective function , that rely on fitting the rewards toward probabilities of state occupancies . A reward should indicate in which proportion the different states ( and actions ) should be visited ( and selected ) during trials ( with the idea that the states providing high return should be visited more often than the ones providing low returns ) . Solving the reinforcement learning problem then means to match the external cue to an actual distribution of visit over states and actions , where a differential in rewards only indicates a difference in the number of visits , allowing to seek rewards in a flexible way ( so it is also referred as to “ soft ” reinforcement learning ( Haarnoja et al. , 2018 ) ) . This idea stems back from empirical observations on human and animal behaviors , and was coined the “ matching law ” in the operant conditioning literature ( Herrnstein , 1961 ; Eysenbach & Levine , 2019 ) . 2.2 STATE OCCUPANCY AND CONDITIONAL STATE OCCUPANCY . Matching rewards to probabilities can be done in many different ways . We frame here the probability matching reinforcement learning problem into a state occupancy matching problem . It relies on the use of an occupancy distribution , that is a density of state visit under a certain policy . Importantly , it ignores the time order at which the different states are visited , still conserving some aspects of causality between states in the form of conditional probabilities as we see later . Dating back from Dayan ( 1993 ) , an occupancy distribution is a distribution on states , designed so as to match with the distribution measured over the trajectories of the MDP . Following the definitions of ( Puterman , 2014 ; Ho & Ermon , 2016 ; Hazan et al. , 2019 ) , a gammaabsorbing state occupancy of a Markov Decision process ( with a policy π ) is the ( discounted ) density of visit of the states — or ( state , action ) pairs — of the environment when starting from the initial distribution p ( S0 ) . It is defined , as : { ρπ ( s ) = ( 1− γ ) p0 ( s ) + γ ∑ s′ , a′ p ( s|s′ , a′ ) π ( a′|s′ ) ρπ ( s′ ) ρπ ( s , a ) = π ( a|s ) ρπ ( s ) ( 1 ) so that any policy π settled on an MDP defines an occupancy on the states of that MDP . It comes that , inversely , any valid ( state , action ) occupancy ( meaning that this occupancy is effectively feasible in a given agent/environment setup ) , defines a unique corresponding policy : π ( a|s ) = ρ ( s , a ) ρ ( s ) ( 2 ) that is a softmax ( stochastic ) conditional policy over the states . Following the same reasoning , let ρπ ( S+|s ... ) the conditional occupancy be defined recursively . Let Tπ ( s ) the set of trajectories starting from s : ∀s+ ∈ Tπ ( s ) , ρπ ( s+|s ... ) = pπ ( s+|s ) + γ ∑ s′∈Tπ ( s ) pπ ( s +|s′ ) ρπ ( s′|s ... ) The triple dots ( ... ) are intended to help distinguish the one-step distribution pπ ( S′|s ) from the longterm distribution ρπ ( S+|s ... ) . This conditional distribution provides a description of the “ future ” of s , that is the distribution of states that will most probably follow s. It can be seen as an instance of the “ successor ” representation of states initially proposed by Dayan ( 1993 ) . Those future states will generally be noted s+ , with the ’ + ’ exponent meaning the state being measured “ further away in time ” . 2.3 MATCHING REWARDS TO OCCUPANCIES . Those definitions provide a way toward interpreting rewards as occupancy templates , allowing to implement the “ matching law ” in a principled way . The mapping of rewards toward probabilities relies on using exponentiated returns in the parameters of a stochastic policy , such as in the softmax ( or Boltzmann ) decision rule case . Let π ( a|s ) = exp βQ ( s , a ) K ( s ) with K ( s ) = ∑ a expβQ ( s , a ) , with β the “ inverse temperature ” , and the state-action value Q ( s , a ) representing the total return estimated at ( s , a ) . Let τ = ( s0 , s1 , ... , st , ... ) a certain trajectory observed on the MDP under the policy π . The set of all possible trajectories is noted T , pπ ( τ ) is a measure over the trajectories for a certain policy π , and ρπ is the corresponding occupancy on states . Consider for instance the series of rewards encountered when following τ . It comes that : Es0∼p0V ( s0 ) = Eτ∼pπ ( T ) ∑ t γtr ( st , at ) ≈ E s∼ρπ ( S ) a∼π ( A|s ) r ( s , a ) ∑ t γt = Es , a∼ρπ ( S , A ) r ( s , a ) 1− γ so that ∀t , r ( st , at ) 1−γ is interpreted as an estimator of V ( s0 ) . Next , for any t , it comes that ∀t′ > t , r ( st′ , at′ ) 1−γ is an estimator of the state-action value Q ( st , at ) , i.e : Q ( st , at ) = Eτ∼pπ ( T ) st∈τ ∑ t′ > t γ ( t ′−t ) r ( st′ , at′ ) ≈ Es+∼ρπ ( S+|st , at ... ) a+∼π ( A|s+ ) r ( s+ , a+ ) 1− γ ( 3 ) In that setup , the rewards are interpreted as value samples . This means , in short , that each future reward r ( s+ , a+ ) takes the role of a “ model ” for the total returnQ ( st , at ) . The models are weighted according to the conditional occupancy ρπ ( S+ , A+|s , a ... ) , that takes the role of the “ mixture ” . Then , noting that log π ( a|s ) = βQ ( s , a ) −K ( s ) , we define : R̄ ( s , s+ , a+ ) , r ( s+ , a+ ) 1− γ − 1 β ( K ( s ) − log ρπ ( s ) ) ( 4 ) said the “ extended ” return composed of the return estimator plus a virtual baseline . Then , because the policy and the occupancy are exchangeable from eq . ( 2 ) , each reward collected after ( s , a ) may also take the role of a “ model ” for the occupancy , sampled from the conditional occupancy , i.e . : log ρπ ( s , a ) ≈ Es+∼ρπ ( S+|s , a ... ) a+∼π ( A|s+ ) βR̄ ( s , s+ , a+ ) ( 5 ) | # Summary & Contributions * This paper examines a variational approach to reinforcement learning, leveraging occupancy measures over previously visited and future state-action pairs in order to address the exploration challenge. * The author propose a variational approximation to the so-called "conditional occupancy" of the current behavior policy denoting the distribution over future state-action pairs. The approximation is used to induce broader state visitation from the behavior policy, coupled with a standard actor-critic algorithm. * Empirical results show considerable performance gains in simpler continuous control problems and matching performance against baseline methods in more high-dimensional control tasks. | SP:916a926ade24fe69c246bd54d314087bafb1b5b8 |
Occupy & Specify: Investigations into a Maximum Credit Assignment Occupancy Objective for Data-efficient Reinforcement Learning | 1 PROBLEM STATEMENT . Learning in the real world implies dealing with very large , potentially unlimited environments , over which the data to collect is seemingly infinite . Efficient exploration is thus one of the key aspects of open-ended learning Santucci et al . ( 2020 ) , when no final model of the environment can feasibly be expected to be engineered or trained . On the one side , having access to unlimited data is very beneficial for the training of complex multi-layered perceptrons , for they are known to rely on large datasets to improve their performance . On the other side , the circular dependence between the learning algorithm and the data on which it operates renders the learning very tricky , at high risk of data overfitting and trapping in local optima . The open-ended learning problem is generally addressed through the lens of the reinforcement learning framework ( Sutton et al. , 1998 ) , where rewards are collected during the interaction , and the selection of action is fit so as to maximize the total number of positive rewards , and prevent the encounter of negative ones . Fitting behaviour to rewards is however at the risk of ignoring important data from the rest of the environment , where putatively more rewarding regions may be neglected . The agreement of reward-seeking ( that is exploitation ) with data collecting ( that is exploration ) , is still one of the fundamental issues of modern artificial intelligence . An important effort has recently been put on reframing the reinforcement learning setup into a more general probabilistic inference framework , allowing to link rewards seeking and data modelling under a single perspective ( Furmston & Barber , 2010 ; Levine , 2018 ; Haarnoja et al. , 2018 ; Abdolmaleki et al. , 2018 ; Fellows et al. , 2019 ) . This greater focus over the data collection problem is linked to an important set of training algorithms , that contain some forms of exploration bonuses , including “ curiosity ” drives ( Schmidhuber et al. , 2009 ; Pathak et al. , 2017 ) , intrinsic rewards ( Oudeyer et al. , 2007 ) and pseudo-counts ( Bellemare et al. , 2016 ; Tang et al. , 2017 ) . However , at the difference of the classic optimization on rewards alone , where the Bellman optimum is well defined , there is still no consensus about the objective followed when optimizing both on rewards and data collection under a variational perspective ( Eysenbach & Levine , 2019 ) . The data collection problem is effectively shadowed by the reward maximization objective , under which it is still considered as a incidental component . An important body of work has recently been devoted to addressing the data collection problem as such , with the notable design of the MaxEnt algorithm ( Hazan et al. , 2019 ) , State Marginal Matching ( Lee et al. , 2019 ) and E3D ( Daucé , 2020 ) , that aim at fitting the distribution of the states encountered to a uniform distribution , in the absence of definite rewards . This is here referred as a MaxEnt-on-state principle ( or MaxEnt to be short ) , not to be confounded with the MaxEnt-on-actions principle implemented in the soft actor critic ( Haarnoja et al. , 2018 ) for instance . Following a MaxEnt objective means optimizing the policy so as the states visited are maximally variable , ideally uniformly visiting all possible states . We develop in the following a possible extension of the MaxEnt principle , that brings a considerable simplification in the expression of the evidence lower bound ( ELBO ) with regards with the existing literature ( Furmston & Barber , 2010 ; Abdolmaleki et al. , 2018 ; Fellows et al. , 2019 ) . In contrast to pure MaxEnt , our approach provides a way to combine the MaxEnt objective with a reward maximization objective , under a variational inference perspective . An intriguing property of the resulting ELBO formula is that the future states ( the ones that are visited after the current observation ) play the role of a model for the current data , participating in the elaboration of the returns collected under the current policy . This gives ways toward optimizing the policy with respect to the distribution of the data , and provides a principled justification to the use of intrinsic rewards in the design of reinforcement learning algorithms . 2 PRINCIPLES . 2.1 PROBABILITY MATCHING RL . We assume an agent acting in a fully observable environment . The state of the environment is provided by an observation s ∈ S , with S the set of all possible states . The agent can act on the environment through its actuators . Such a motor command is described by a ∈ A , with A the set of all motor commands . In the following , the capital letters S and A will reflect random variables on S andA , and the lower cases s and a will either reflect observations or random draw realizations . The decision of which action to choose relies on a policy , that maps the current observation to the action space , generally expressed in a conditional probabilistic form π ( a|s ) . A reinforcement learning problem consists in finding a policy π∗ that maximizes a certain objective function , without knowing the physical or mechanical properties of the environment . It is supposed here , for simplicity , that the dynamics of the environment is Markovian ( no hidden states ) . Moreover , the environment is providing an auxiliary signal called the reward . Sending an action to the environment makes it possible to access to a new state s′ , and to obtain a reward r ∈ R. A classic objective in learning is to maximize the global return , generally described as a discounted sum of future rewards over all possible trajectories . Let us now denote by st the state visited at time t and τ ( st ) = ( st+1 , ... , st+T , ... ) a certain pathway that is visited after observing st. During this visit , a certain number of rewards can be collected , and R ( τ ) is the ( discounted ) return obtained over τ , i.e . R ( τ ) = ∑ t γ trt , with γ ∈ [ 0 , 1 [ a discounting factor that sums up the rewards up to an “ horizon ” of the order of 11−γ . This said , the dynamic programming objective ( Bellman , 1966 ) , is the result of π∗ = maxΠ Es∼p ( S0 ) , τ∼pπ ( τ |s ) R ( τ ) , with p ( S0 ) the distribution of initial states , and Π the set of all conditional policies . When a state transition model p ( S′|s , a ) is provided , the unique solution is given by the dynamic programming recurrent equation in the discrete case ( Bellman , 1966 ) . On the contrary , a large panel of reinforcement learning techniques allow to approach the solution in the model-free setup , assuming an effective sampling of all state-action pairs ( Sutton et al. , 1998 ) . We are here interested in a different class of objective function , that rely on fitting the rewards toward probabilities of state occupancies . A reward should indicate in which proportion the different states ( and actions ) should be visited ( and selected ) during trials ( with the idea that the states providing high return should be visited more often than the ones providing low returns ) . Solving the reinforcement learning problem then means to match the external cue to an actual distribution of visit over states and actions , where a differential in rewards only indicates a difference in the number of visits , allowing to seek rewards in a flexible way ( so it is also referred as to “ soft ” reinforcement learning ( Haarnoja et al. , 2018 ) ) . This idea stems back from empirical observations on human and animal behaviors , and was coined the “ matching law ” in the operant conditioning literature ( Herrnstein , 1961 ; Eysenbach & Levine , 2019 ) . 2.2 STATE OCCUPANCY AND CONDITIONAL STATE OCCUPANCY . Matching rewards to probabilities can be done in many different ways . We frame here the probability matching reinforcement learning problem into a state occupancy matching problem . It relies on the use of an occupancy distribution , that is a density of state visit under a certain policy . Importantly , it ignores the time order at which the different states are visited , still conserving some aspects of causality between states in the form of conditional probabilities as we see later . Dating back from Dayan ( 1993 ) , an occupancy distribution is a distribution on states , designed so as to match with the distribution measured over the trajectories of the MDP . Following the definitions of ( Puterman , 2014 ; Ho & Ermon , 2016 ; Hazan et al. , 2019 ) , a gammaabsorbing state occupancy of a Markov Decision process ( with a policy π ) is the ( discounted ) density of visit of the states — or ( state , action ) pairs — of the environment when starting from the initial distribution p ( S0 ) . It is defined , as : { ρπ ( s ) = ( 1− γ ) p0 ( s ) + γ ∑ s′ , a′ p ( s|s′ , a′ ) π ( a′|s′ ) ρπ ( s′ ) ρπ ( s , a ) = π ( a|s ) ρπ ( s ) ( 1 ) so that any policy π settled on an MDP defines an occupancy on the states of that MDP . It comes that , inversely , any valid ( state , action ) occupancy ( meaning that this occupancy is effectively feasible in a given agent/environment setup ) , defines a unique corresponding policy : π ( a|s ) = ρ ( s , a ) ρ ( s ) ( 2 ) that is a softmax ( stochastic ) conditional policy over the states . Following the same reasoning , let ρπ ( S+|s ... ) the conditional occupancy be defined recursively . Let Tπ ( s ) the set of trajectories starting from s : ∀s+ ∈ Tπ ( s ) , ρπ ( s+|s ... ) = pπ ( s+|s ) + γ ∑ s′∈Tπ ( s ) pπ ( s +|s′ ) ρπ ( s′|s ... ) The triple dots ( ... ) are intended to help distinguish the one-step distribution pπ ( S′|s ) from the longterm distribution ρπ ( S+|s ... ) . This conditional distribution provides a description of the “ future ” of s , that is the distribution of states that will most probably follow s. It can be seen as an instance of the “ successor ” representation of states initially proposed by Dayan ( 1993 ) . Those future states will generally be noted s+ , with the ’ + ’ exponent meaning the state being measured “ further away in time ” . 2.3 MATCHING REWARDS TO OCCUPANCIES . Those definitions provide a way toward interpreting rewards as occupancy templates , allowing to implement the “ matching law ” in a principled way . The mapping of rewards toward probabilities relies on using exponentiated returns in the parameters of a stochastic policy , such as in the softmax ( or Boltzmann ) decision rule case . Let π ( a|s ) = exp βQ ( s , a ) K ( s ) with K ( s ) = ∑ a expβQ ( s , a ) , with β the “ inverse temperature ” , and the state-action value Q ( s , a ) representing the total return estimated at ( s , a ) . Let τ = ( s0 , s1 , ... , st , ... ) a certain trajectory observed on the MDP under the policy π . The set of all possible trajectories is noted T , pπ ( τ ) is a measure over the trajectories for a certain policy π , and ρπ is the corresponding occupancy on states . Consider for instance the series of rewards encountered when following τ . It comes that : Es0∼p0V ( s0 ) = Eτ∼pπ ( T ) ∑ t γtr ( st , at ) ≈ E s∼ρπ ( S ) a∼π ( A|s ) r ( s , a ) ∑ t γt = Es , a∼ρπ ( S , A ) r ( s , a ) 1− γ so that ∀t , r ( st , at ) 1−γ is interpreted as an estimator of V ( s0 ) . Next , for any t , it comes that ∀t′ > t , r ( st′ , at′ ) 1−γ is an estimator of the state-action value Q ( st , at ) , i.e : Q ( st , at ) = Eτ∼pπ ( T ) st∈τ ∑ t′ > t γ ( t ′−t ) r ( st′ , at′ ) ≈ Es+∼ρπ ( S+|st , at ... ) a+∼π ( A|s+ ) r ( s+ , a+ ) 1− γ ( 3 ) In that setup , the rewards are interpreted as value samples . This means , in short , that each future reward r ( s+ , a+ ) takes the role of a “ model ” for the total returnQ ( st , at ) . The models are weighted according to the conditional occupancy ρπ ( S+ , A+|s , a ... ) , that takes the role of the “ mixture ” . Then , noting that log π ( a|s ) = βQ ( s , a ) −K ( s ) , we define : R̄ ( s , s+ , a+ ) , r ( s+ , a+ ) 1− γ − 1 β ( K ( s ) − log ρπ ( s ) ) ( 4 ) said the “ extended ” return composed of the return estimator plus a virtual baseline . Then , because the policy and the occupancy are exchangeable from eq . ( 2 ) , each reward collected after ( s , a ) may also take the role of a “ model ” for the occupancy , sampled from the conditional occupancy , i.e . : log ρπ ( s , a ) ≈ Es+∼ρπ ( S+|s , a ... ) a+∼π ( A|s+ ) βR̄ ( s , s+ , a+ ) ( 5 ) | The authors address the problem of exploration in reinforcement learning. They suggest applying the maximum entropy principle over the state space and try to maximize the make the occupancy of the policy as entropic as possible while still optimizing the original goal of maximizing cumulative reward. They claims include an algorithm that does this using a replay buffer and off-policy learning, which improves sampling efficiency, in sparse and dense reward settings, in classic motor control benchmarks. | SP:916a926ade24fe69c246bd54d314087bafb1b5b8 |
Dynamic Graph Representation Learning via Graph Transformer Networks | 1 INTRODUCTION . In recent years , graph representation learning has been recognized as a fundamental learning problem and has received much attention due to its widespread use in various domains , including social network analysis ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ) , traffic prediction ( Cui et al. , 2019 ; Rahimi et al. , 2018 ) , knowledge graphs ( Wang et al. , 2019a ; b ) , drug discovery ( Do et al. , 2019 ; Duvenaud et al. , 2015 ) , and recommendation systems ( Berg et al. , 2017 ; Ying et al. , 2018 ) . Most existing graph representation learning work focuses on static graphs . However , real-world graphs are intrinsically dynamic where nodes and edges can appear and disappear over time . This dynamic nature of real-world graphs motivates dynamic graph representation learning methods that can model temporal evolutionary patterns and accurately predict node properties and future edges . Recently , several attempts ( Sankar et al. , 2018 ; Pareja et al. , 2020 ; Goyal et al. , 2018 ) have been made to generalize graph learning algorithms from static graphs to dynamic graphs by first learning node representations on each static graph snapshot then aggregating these representations from the temporal dimension . However , these methods are vulnerable to noisy information such as missing or spurious links . This is due to the ineffective message aggregation over unrelated neighbors from noisy connections . The temporal aggregation makes this issue severe by further carrying the noise information over time . Over-relying on graph structures makes the model sensitive to noisy input and can significantly affect downstream task accuracy . A remedy is to consider the input graph as fully connected and learn a graph topology by assigning lower weights to task-irrelevant edges during training ( Devlin et al. , 2019 ) . However , completely ignoring the graph structure makes the optimization inefficient because the model has to estimate the underlying graph structure while learn model parameters at the same time . To resolve the above challenges , we propose a Transformer-based dynamic graph learning method named Dynamic Graph Transformer ( DGT ) that can “ leverage underlying graph structures ” and “ capture implicit edge connections ” to balance this trade-off . Transformers ( Vaswani et al. , 2017 ) , designed to automatically capture the inter-dependencies between tokens in a sequence , have been successfully applied in several domains such as Natural Language Processing ( Devlin et al. , 2019 ; Brown et al. , 2020 ) and Computer Vision ( Dosovitskiy et al. , 2020 ; Liu et al. , 2021 ) . We summarize the success of Transformers into three main factors , which can also help resolve the aforementioned challenges in dynamic graph representation learning : ( 1 ) fully-connected self-attention : by modeling all pair-wise node relations , DGT can capture implicit edge connections , thus become robust to graphs with noisy information such as missing links ; ( 2 ) positional encoding : by generalizing positional encoding to the graph domain using spatial-temporal encoding , we can inject both spatial and temporal graph evolutionary information as inductive biases into DGT to learn a graph ’ s evolutionary patterns over time ; ( 3 ) self-supervised pre-training : by optimizing two complementary pre-training tasks , DGT presents a better performance on the downstream tasks . Though powerful , training Transformers on large-scale graphs is non-trivial due to the quadratic complexity of the fully connected self-attention on the graph size ( Zaheer et al. , 2020 ; Wang et al. , 2020 ) . This issue is more severe on dynamic graphs as the computation cost grows with the number of time-steps in a dynamic graph ( Pareja et al. , 2020 ; Sankar et al. , 2018 ) . To make the training scalable and independent of both the graph size and the number of time-steps , we first propose a temporal-union graph structure that aggregates graph information from multiple time-steps into a unified meta-graph ; we then develop a two-tower architecture with a novel target-context node sampling strategy to model a subset of nodes with their contextual information . These approaches improve DGT ’ s training efficiency and scalability from both the temporal and spatial perspectives . To this end , we summarize our contributions as follows : ( 1 ) a two-tower Transformer-based method named DGT with spatial-temporal encoding that can capture implicit edge connections in addition to the input graph topology ; ( 2 ) a temporal-union graph data structure that efficiently summarizes the spatial-temporal information of dynamic graphs and a novel target-context node sampling strategy for large-scale training ; ( 3 ) two complementary pre-training tasks that can facilitate performing downstream tasks and are proven beneficial using information theory ; and ( 4 ) a comprehensive evaluation on real-world datasets with ablation studies to validate the effectiveness of DGT . 2 PRELIMINARIES AND RELATED WORKS . In this section , we first define dynamic graphs , then review related literature on dynamic graph representation learning and Transformers on graphs . Dynamic graph definition . The nodes and edges in a dynamic graph may appear and disappear over time . In this paper , we define a dynamic graph as a sequence of static graph snapshots with a temporal order G , { G1 , . . . , GT } , where the t-th snapshot graph Gt ( V , Et ) is an undirected graph with a shared node set V of all time steps and an edge set Et . We also denote its adjacency matrix as At . Our goal is to learn a latent representation of each node at each time-step t , such that the learned representation can be used for any specific downstream task such as link prediction or node classification . Please notice that the shared node set V is not static and will be updated when new snapshot graph arrives , which is the same as Sankar et al . ( 2018 ) ; Pareja et al . ( 2020 ) . Dynamic graph representation learning . Previous dynamic graph representation learning methods usually extend static graph algorithms by further taking the temporal information into consideration . They can mainly be classified into three categories : ( 1 ) smoothness-based methods learn a graph autoencoder to generate node embeddings on each graph snapshot and ensure the temporal smoothness of the node embeddings across consecutive time-steps . For example , DYGEM ( Goyal et al. , 2018 ) uses the learned embeddings from the previous time-step to initialize the embeddings in the next time-step . DYNAERNN applies RNN to smooth node embeddings at different timesteps ; ( 2 ) Recurrent-based methods capture the temporal dependency using RNN . For example , GCRN ( Seo et al. , 2018 ) first computes node embeddings on each snapshot using GCN ( Defferrard et al. , 2016 ) , then feeds the node embeddings into an RNN to learn their temporal dependency . EVOLVEGCN ( Pareja et al. , 2020 ) uses RNN to estimate the GCN weight parameters at different time-steps ; ( 3 ) Attention-based methods use self-attention mechanism for both spatial and temporal message aggregation . For example , DYSAT ( Sankar et al. , 2018 ) propose to use the self-attention mechanism for temporal and spatial information aggregation . TGAT ( Xu et al. , 2020 ) encodes the temporal information into the node feature , then applies self-attention on the temporal augmented node features . However , smoothness-based methods heavily rely on the temporal smoothness and are inadequate when nodes exhibit vastly different evolutionary behaviors , recurrent-based methods scale poorly when the number of time-steps increases due to the recurrent nature of RNN , attention-based methods only consider the self-attention on existing edges and are sensitive to noisy graphs . In contrast , DGT leverages Transformer to capture the spatial-temporal dependency between all nodes pairs , does not over-relying on the given graph structures , and is less sensitive to noisy edges . Graph Transformers . Recently , several attempts have been made to leverage Transformer for Key graph representation learning . For example , GRAPHORMER ( Ying et al. , 2021 ) and GRAPHTRANSFORMER ( Dwivedi & Bresson , 2020 ) use scaled dot-product attention ( Vaswani et al. , 2017 ) for message aggregation and generalizes the idea of positional encoding to graph domains . GRAPHBERT ( Zhang et al. , 2020 ) first samples an egocentric network for each node , then order all nodes into a sequence based on node importance , and feed into the Transformer . However , GRAPHORMER is only feasible to small molecule graphs and can not scale to large graphs due to the significant computation cost of full attention ; GRAPHTRANSFORMER only considers the first-hop neighbor aggregation , which makes it sensitive to noisy graphs ; GRAPHBERT does not leverage the graph topology and can perform poorly when graph topology is important . In contrast , DGT encodes the input graph structures as an inductive bias to guide the full-attention optimization , which balances the trade-offs between noisy input robustness and efficiently learning an underlying graph structure . A detailed comparison is deferred to Appendix D . 3 METHOD . In this section , we first introduce the temporal union-graph ( in Section 3.1 ) and our sampling strategy ( in Section 3.2 ) that can reduce the overall complexity from the temporal and spatial perspectives respectively . Then , we introduce our spatial-temporal encoding technique ( in Section 3.3 ) , describe the two-tower transformer architecture design , and explain how to integrate the spatial-temporal encoding to DGT ( in Section 3.4 ) . Figure 1 illustrates the overall DGT design . 3.1 TEMPORAL-UNION GRAPH GENERATION . One major challenge of applying Transformers on graph representation learning is its significant computation and memory overhead . In Transformers , the computation cost of self-attention is O ( |E| d ) and its memory cost is O ( |E|+ |V| d ) . When using full attention , the computation graph is fully connected with |E| = |V|2 , where the overall complexity is quadratic in the graph size . On dynamic graphs , this problem can be even more severe if one naively extends the static graph algorithm to a dynamic graph , e.g. , first extracting the spatial information of each snapshot graph separately , then jointly reasoning the temporal information on all snapshot graphs ( Sankar et al. , 2018 ; Pareja et al. , 2020 ) . By doing so , the overall complexity grows linearly with the number of time-steps T , i.e. , with O ( |V|2Td ) computation and O ( |V|2T + |V|Td ) memory cost . To reduce the dependency of the overall complexity on the number of time-steps , we propose to first aggregate dynamic graphs G = { G1 , . . . , GT } into a temporal-union graph Gunion ( V , E ′ ) then employ DGT on the generated temporal-union graph , where E ′ = Unique { ( i , j ) : ( i , j ) ∈ Et , t ∈ [ T ] } is the set of all possible unique edges in G. As a result , the overall complexity of DGT does not grow with the number of time-steps . Details on how to leverage spatial-temporal encoding to recover the temporal information of edges are described in Section 3.3 . 3.2 TARGET NODE DRIVEN CONTEXT NODE SAMPLING . Although the temporal-union graph can alleviate the computation burden from the temporal dimension , due to the overall quadratic complexity of self-attention with respect to the input graph size , scaling the training of Transformer to real-world graphs is still non-trivial . Therefore , a properly designed sampling strategy that makes the overall complexity independent with graph sizes is necessary . Our goal is to design a sub-graph sampling strategy that ensures a fixed number of well-connected nodes and a lower computational complexity . To this end , we propose to first sample a subset of nodes that we are interested in as target nodes , then sample their common neighbors as context nodes . Let target nodes Vtgt ⊆ V be the set of nodes that we are interested in and want to compute its node representation . For example , for the link prediction task , Vtgt are the set of nodes that we aim to predict whether they are connected . Then , the context nodes Vctx ⊆ { N ( i ) | ∀i ∈ Vtgt } are sampled as the common neighbors of the target nodes . Notice that since context nodes Vctx are sampled as the common neighbors of the target nodes , they can provide local structure information for nodes in the target node set . Besides , since two different nodes in the target node set can be far apart with a disconnected neighborhood , the neighborhood of two nodes can provide an approximation of the global view of the full graph . During the sampling process , to control the randomness involved in the sampling process , Vctx are chosen as the subset of nodes with the top-K joint Personalized PageRank ( PPR ) score ( Andersen et al. , 2006 ) to nodes in Vtgt , where PPR score is a node proximity measure that captures the importance of two nodes in the graph . More specifically , our joint PPR sampler proceeds as follows : First , we compute the approximated PPR vector π ( i ) ∈ RN for all node i ∈ Vtgt , where the j-th element in π ( i ) can be interpreted as the probability of a random walk to start at node i and end at node j . We then compute the approximated joint PPR vector π̂ ( Vtgt ) = ∑ i∈Vtgt π ( i ) ∈ R N . Finally , we select K context nodes where each node j ∈ Vctx has the top-K joint PPR score in π̂ ( Vtgt ) . In practice , we select the context node size the same as the target node size , i.e. , K = |Vtgt| . | In this study, the authors propose a new graph transformer network for dynamic graph representation. To solve the challenges of static graphs learning and the temporal information aggregating, this paper introduces a Dynamic Graph Transformer (DGT) which contains three components: (1) a two-tower Transformer-based method, (2) temporal-union graph construction (3) a complementary pre-training task. Extensive experiments on the two datasets of link prediction and node classification demonstrate the superiority of the model. The ablation studies justify the effectiveness of each module in the DGT model. | SP:f24b5b36d4329213d20b80cf6da2ed289f52890d |
Dynamic Graph Representation Learning via Graph Transformer Networks | 1 INTRODUCTION . In recent years , graph representation learning has been recognized as a fundamental learning problem and has received much attention due to its widespread use in various domains , including social network analysis ( Kipf & Welling , 2017 ; Hamilton et al. , 2017 ) , traffic prediction ( Cui et al. , 2019 ; Rahimi et al. , 2018 ) , knowledge graphs ( Wang et al. , 2019a ; b ) , drug discovery ( Do et al. , 2019 ; Duvenaud et al. , 2015 ) , and recommendation systems ( Berg et al. , 2017 ; Ying et al. , 2018 ) . Most existing graph representation learning work focuses on static graphs . However , real-world graphs are intrinsically dynamic where nodes and edges can appear and disappear over time . This dynamic nature of real-world graphs motivates dynamic graph representation learning methods that can model temporal evolutionary patterns and accurately predict node properties and future edges . Recently , several attempts ( Sankar et al. , 2018 ; Pareja et al. , 2020 ; Goyal et al. , 2018 ) have been made to generalize graph learning algorithms from static graphs to dynamic graphs by first learning node representations on each static graph snapshot then aggregating these representations from the temporal dimension . However , these methods are vulnerable to noisy information such as missing or spurious links . This is due to the ineffective message aggregation over unrelated neighbors from noisy connections . The temporal aggregation makes this issue severe by further carrying the noise information over time . Over-relying on graph structures makes the model sensitive to noisy input and can significantly affect downstream task accuracy . A remedy is to consider the input graph as fully connected and learn a graph topology by assigning lower weights to task-irrelevant edges during training ( Devlin et al. , 2019 ) . However , completely ignoring the graph structure makes the optimization inefficient because the model has to estimate the underlying graph structure while learn model parameters at the same time . To resolve the above challenges , we propose a Transformer-based dynamic graph learning method named Dynamic Graph Transformer ( DGT ) that can “ leverage underlying graph structures ” and “ capture implicit edge connections ” to balance this trade-off . Transformers ( Vaswani et al. , 2017 ) , designed to automatically capture the inter-dependencies between tokens in a sequence , have been successfully applied in several domains such as Natural Language Processing ( Devlin et al. , 2019 ; Brown et al. , 2020 ) and Computer Vision ( Dosovitskiy et al. , 2020 ; Liu et al. , 2021 ) . We summarize the success of Transformers into three main factors , which can also help resolve the aforementioned challenges in dynamic graph representation learning : ( 1 ) fully-connected self-attention : by modeling all pair-wise node relations , DGT can capture implicit edge connections , thus become robust to graphs with noisy information such as missing links ; ( 2 ) positional encoding : by generalizing positional encoding to the graph domain using spatial-temporal encoding , we can inject both spatial and temporal graph evolutionary information as inductive biases into DGT to learn a graph ’ s evolutionary patterns over time ; ( 3 ) self-supervised pre-training : by optimizing two complementary pre-training tasks , DGT presents a better performance on the downstream tasks . Though powerful , training Transformers on large-scale graphs is non-trivial due to the quadratic complexity of the fully connected self-attention on the graph size ( Zaheer et al. , 2020 ; Wang et al. , 2020 ) . This issue is more severe on dynamic graphs as the computation cost grows with the number of time-steps in a dynamic graph ( Pareja et al. , 2020 ; Sankar et al. , 2018 ) . To make the training scalable and independent of both the graph size and the number of time-steps , we first propose a temporal-union graph structure that aggregates graph information from multiple time-steps into a unified meta-graph ; we then develop a two-tower architecture with a novel target-context node sampling strategy to model a subset of nodes with their contextual information . These approaches improve DGT ’ s training efficiency and scalability from both the temporal and spatial perspectives . To this end , we summarize our contributions as follows : ( 1 ) a two-tower Transformer-based method named DGT with spatial-temporal encoding that can capture implicit edge connections in addition to the input graph topology ; ( 2 ) a temporal-union graph data structure that efficiently summarizes the spatial-temporal information of dynamic graphs and a novel target-context node sampling strategy for large-scale training ; ( 3 ) two complementary pre-training tasks that can facilitate performing downstream tasks and are proven beneficial using information theory ; and ( 4 ) a comprehensive evaluation on real-world datasets with ablation studies to validate the effectiveness of DGT . 2 PRELIMINARIES AND RELATED WORKS . In this section , we first define dynamic graphs , then review related literature on dynamic graph representation learning and Transformers on graphs . Dynamic graph definition . The nodes and edges in a dynamic graph may appear and disappear over time . In this paper , we define a dynamic graph as a sequence of static graph snapshots with a temporal order G , { G1 , . . . , GT } , where the t-th snapshot graph Gt ( V , Et ) is an undirected graph with a shared node set V of all time steps and an edge set Et . We also denote its adjacency matrix as At . Our goal is to learn a latent representation of each node at each time-step t , such that the learned representation can be used for any specific downstream task such as link prediction or node classification . Please notice that the shared node set V is not static and will be updated when new snapshot graph arrives , which is the same as Sankar et al . ( 2018 ) ; Pareja et al . ( 2020 ) . Dynamic graph representation learning . Previous dynamic graph representation learning methods usually extend static graph algorithms by further taking the temporal information into consideration . They can mainly be classified into three categories : ( 1 ) smoothness-based methods learn a graph autoencoder to generate node embeddings on each graph snapshot and ensure the temporal smoothness of the node embeddings across consecutive time-steps . For example , DYGEM ( Goyal et al. , 2018 ) uses the learned embeddings from the previous time-step to initialize the embeddings in the next time-step . DYNAERNN applies RNN to smooth node embeddings at different timesteps ; ( 2 ) Recurrent-based methods capture the temporal dependency using RNN . For example , GCRN ( Seo et al. , 2018 ) first computes node embeddings on each snapshot using GCN ( Defferrard et al. , 2016 ) , then feeds the node embeddings into an RNN to learn their temporal dependency . EVOLVEGCN ( Pareja et al. , 2020 ) uses RNN to estimate the GCN weight parameters at different time-steps ; ( 3 ) Attention-based methods use self-attention mechanism for both spatial and temporal message aggregation . For example , DYSAT ( Sankar et al. , 2018 ) propose to use the self-attention mechanism for temporal and spatial information aggregation . TGAT ( Xu et al. , 2020 ) encodes the temporal information into the node feature , then applies self-attention on the temporal augmented node features . However , smoothness-based methods heavily rely on the temporal smoothness and are inadequate when nodes exhibit vastly different evolutionary behaviors , recurrent-based methods scale poorly when the number of time-steps increases due to the recurrent nature of RNN , attention-based methods only consider the self-attention on existing edges and are sensitive to noisy graphs . In contrast , DGT leverages Transformer to capture the spatial-temporal dependency between all nodes pairs , does not over-relying on the given graph structures , and is less sensitive to noisy edges . Graph Transformers . Recently , several attempts have been made to leverage Transformer for Key graph representation learning . For example , GRAPHORMER ( Ying et al. , 2021 ) and GRAPHTRANSFORMER ( Dwivedi & Bresson , 2020 ) use scaled dot-product attention ( Vaswani et al. , 2017 ) for message aggregation and generalizes the idea of positional encoding to graph domains . GRAPHBERT ( Zhang et al. , 2020 ) first samples an egocentric network for each node , then order all nodes into a sequence based on node importance , and feed into the Transformer . However , GRAPHORMER is only feasible to small molecule graphs and can not scale to large graphs due to the significant computation cost of full attention ; GRAPHTRANSFORMER only considers the first-hop neighbor aggregation , which makes it sensitive to noisy graphs ; GRAPHBERT does not leverage the graph topology and can perform poorly when graph topology is important . In contrast , DGT encodes the input graph structures as an inductive bias to guide the full-attention optimization , which balances the trade-offs between noisy input robustness and efficiently learning an underlying graph structure . A detailed comparison is deferred to Appendix D . 3 METHOD . In this section , we first introduce the temporal union-graph ( in Section 3.1 ) and our sampling strategy ( in Section 3.2 ) that can reduce the overall complexity from the temporal and spatial perspectives respectively . Then , we introduce our spatial-temporal encoding technique ( in Section 3.3 ) , describe the two-tower transformer architecture design , and explain how to integrate the spatial-temporal encoding to DGT ( in Section 3.4 ) . Figure 1 illustrates the overall DGT design . 3.1 TEMPORAL-UNION GRAPH GENERATION . One major challenge of applying Transformers on graph representation learning is its significant computation and memory overhead . In Transformers , the computation cost of self-attention is O ( |E| d ) and its memory cost is O ( |E|+ |V| d ) . When using full attention , the computation graph is fully connected with |E| = |V|2 , where the overall complexity is quadratic in the graph size . On dynamic graphs , this problem can be even more severe if one naively extends the static graph algorithm to a dynamic graph , e.g. , first extracting the spatial information of each snapshot graph separately , then jointly reasoning the temporal information on all snapshot graphs ( Sankar et al. , 2018 ; Pareja et al. , 2020 ) . By doing so , the overall complexity grows linearly with the number of time-steps T , i.e. , with O ( |V|2Td ) computation and O ( |V|2T + |V|Td ) memory cost . To reduce the dependency of the overall complexity on the number of time-steps , we propose to first aggregate dynamic graphs G = { G1 , . . . , GT } into a temporal-union graph Gunion ( V , E ′ ) then employ DGT on the generated temporal-union graph , where E ′ = Unique { ( i , j ) : ( i , j ) ∈ Et , t ∈ [ T ] } is the set of all possible unique edges in G. As a result , the overall complexity of DGT does not grow with the number of time-steps . Details on how to leverage spatial-temporal encoding to recover the temporal information of edges are described in Section 3.3 . 3.2 TARGET NODE DRIVEN CONTEXT NODE SAMPLING . Although the temporal-union graph can alleviate the computation burden from the temporal dimension , due to the overall quadratic complexity of self-attention with respect to the input graph size , scaling the training of Transformer to real-world graphs is still non-trivial . Therefore , a properly designed sampling strategy that makes the overall complexity independent with graph sizes is necessary . Our goal is to design a sub-graph sampling strategy that ensures a fixed number of well-connected nodes and a lower computational complexity . To this end , we propose to first sample a subset of nodes that we are interested in as target nodes , then sample their common neighbors as context nodes . Let target nodes Vtgt ⊆ V be the set of nodes that we are interested in and want to compute its node representation . For example , for the link prediction task , Vtgt are the set of nodes that we aim to predict whether they are connected . Then , the context nodes Vctx ⊆ { N ( i ) | ∀i ∈ Vtgt } are sampled as the common neighbors of the target nodes . Notice that since context nodes Vctx are sampled as the common neighbors of the target nodes , they can provide local structure information for nodes in the target node set . Besides , since two different nodes in the target node set can be far apart with a disconnected neighborhood , the neighborhood of two nodes can provide an approximation of the global view of the full graph . During the sampling process , to control the randomness involved in the sampling process , Vctx are chosen as the subset of nodes with the top-K joint Personalized PageRank ( PPR ) score ( Andersen et al. , 2006 ) to nodes in Vtgt , where PPR score is a node proximity measure that captures the importance of two nodes in the graph . More specifically , our joint PPR sampler proceeds as follows : First , we compute the approximated PPR vector π ( i ) ∈ RN for all node i ∈ Vtgt , where the j-th element in π ( i ) can be interpreted as the probability of a random walk to start at node i and end at node j . We then compute the approximated joint PPR vector π̂ ( Vtgt ) = ∑ i∈Vtgt π ( i ) ∈ R N . Finally , we select K context nodes where each node j ∈ Vctx has the top-K joint PPR score in π̂ ( Vtgt ) . In practice , we select the context node size the same as the target node size , i.e. , K = |Vtgt| . | This paper makes an attempt to study the dynamic graph representation learning. The paper proposes a couple tricks for the combination with graph transformer networks. The tricks include sampling, union graph, pretraining etc. Some experiments have been conducted. | SP:f24b5b36d4329213d20b80cf6da2ed289f52890d |
A Class of Short-term Recurrence Anderson Mixing Methods and Their Applications | 1 INTRODUCTION . Anderson mixing ( AM ) ( Anderson , 1965 ) is a sequence acceleration method ( Brezinski et al. , 2018 ) in scientific computing . It is widely used to accelerate the slow convergence of fixed-point iterations ( Lin et al. , 2019 ; Fu et al. , 2020 ; An et al. , 2017 ) , e.g. , the self-consistent field iterations in electronic structure computations ( Garza & Scuseria , 2012 ; Arora et al. , 2017 ) . Specifically , we consider a fixed-point iteration xk+1 = g ( xk ) , k = 0 , 1 , . . . , where g : Rd 7→ Rd is the fixed-point map . By usingm historical iterations , AM ( m ) aims to extrapolate a new iterate that satisfies certain optimality property . When the function evaluation is costly , the reduction of the number of iterations brought by AM can save a large amount of computation ( Fang & Saad , 2009 ) . AM can be used as a method for solving nonlinear equations ( Kelley , 2018 ) as the fixed-point problem x = g ( x ) is equivalent to h ( x ) : = x − g ( x ) = 0 . In practice , since computing the Jacobian of h ( x ) is commonly difficult or even unavailable ( Nocedal & Wright , 2006 ) , AM can be seen as a practical alternate for Newton ’ s method ( An et al. , 2017 ) . Also , compared with the classical iterative methods such as the nonlinear conjugate gradient ( CG ) method ( Hager & Zhang , 2006 ) , no line-search or trust-region technique is used in AM , which is preferable for large-scale unconstrained optimization . Empirically , it is observable that AM can largely accelerate convergence , though its theoretical analysis is still under-explored . It turns out that in the linear case ( Walker & Ni , 2011 ; Potra & Engler , 2013 ) , the full-memory AM ( m = k ) is essentially equivalent to GMRES ( Saad & Schultz , 1986 ) , a powerful Krylov subspace method that can exhibit superlinear convergence behaviour in solving linear systems ( Van der Vorst & Vuik , 1993 ) . For general nonlinear problems , AM is recognized as a multisecant quasi-Newton method ( Fang & Saad , 2009 ; Brezinski et al. , 2018 ) . As far as we know , only local linear convergence has been obtained for the limited-memory AM ( m < k ) in general ( Toth & Kelley , 2015 ; Evans et al. , 2020 ; De Sterck & He , 2021 ) . For the application of AM , one of the major concerns is the historical length m , a critical factor related to the efficiency of AM ( Walker & Ni , 2011 ) . A larger m can incorporate more historical ∗Corresponding author . information into one extrapolation , but it incurs heavier memory overhead since 2m vectors of dimension d need to be stored in AM ( m ) . The additional memory footprint can be prohibitive for solving high-dimensional problems in a resource-limited machine ( Deng , 2019 ) . Using small m can alleviate the memory overhead but may deteriorate the efficacy of AM since much historical information is omitted in the extrapolation ( Walker & Ni , 2011 ; Evans et al. , 2020 ) . To address the memory issue of AM , we deeply investigate the properties of the historical iterations produced by AM and leverage them to develop the short-term recurrence variant , namely ST-AM . The basic version of ST-AM imposes some orthogonalization property on the historical sequence , which is inspired by the CG method ( Hestenes & Stiefel , 1952 ) that enjoys a three-term recurrence . Furthermore , to better suit the more difficult nonconvex optimization , a regularized short-term form is introduced . We highlight the main contributions of our work as follows . 1 . We develop a novel class of short-term recurrence AM methods ( ST-AM ) , including the basic ST-AM , the modified ST-AM ( MST-AM ) , and the regularized ST-AM ( RST-AM ) . The basic ST-AM is applicable for linear systems , MST-AM can solve general fixed-point problems , and RST-AM aims for solving stochastic optimization . An important feature of ST-AM is that all methods only need to store two previous iterations with cheap corrections , which significantly reduces the memory requirement compared with the classical AM . 2 . A complete theoretical analysis of the ST-AM methods is given . When solving strongly convex quadratic optimization , we prove that the basic ST-AM is equivalent to full-memory AM and the convergence rate is similar to CG method . We also prove that MST-AM has improved local linear convergence for solving fixed-point problems . Besides , we establish the global convergence property and complexity analysis for RST-AM when solving stochastic optimization problems . 3 . The numerical results on solving ( non ) linear equations and cubic-regularized quadratic optimization are consistent with the theoretical results for the basic ST-AM and MST-AM . Furthermore , extensive experiments on training deep neural networks for image classification and language models show that RST-AM is competitive with the long-memory AM and outperforms many existing optimizers such as SGD and ADAM . 2 RELATED WORK . AM is also known as an extrapolation algorithm in scientific computing ( Anderson , 2019 ) . A parallel method is Shanks transformation ( Shanks , 1955 ) which transforms an existing sequence to a new sequence for faster convergence . Related classical algorithms include Minimal Polynomial Extrapolation ( Cabay & Jackson , 1976 ) and Reduced Rank Extrapolation ( Eddy , 1979 ) , and a framework of these extrapolation algorithms including AM is given in ( Brezinski et al. , 2018 ) . Note that an elegant recursive algorithm named -algorithm has been discovered for Shanks transformation for scalar sequence ( Wynn , 1956 ) , and was later generalized as the vector -algorithm ( Wynn , 1962 ) for handling vector sequences , but this short-term recurrence form is not equivalent to the original Shanks transformation in general ( Brezinski & Redivo-Zaglia , 2017 ) . Since AM is closely related to quasi-Newton methods ( Fang & Saad , 2009 ) , there are also some works trying to derive equivalent forms of the full-memory quasi-Newton methods using limited memory ( Kolda et al. , 1998 ; Berahas et al. , 2021 ) , while no short-term recurrence is available . To the best of our knowledge , ST-AM is the first attempt to short-term recurrence quasi-Newton methods . Recently , there have been growing demands for solving large-scale and high-dimensional fixedpoint problems in scientific computing ( Lin et al. , 2019 ) and machine learning ( Bottou et al. , 2018 ) . For these applications , Newton-like methods ( Byrd et al. , 2016 ; Wang et al. , 2017 ; Mokhtari et al. , 2018 ) are less appealing due to the heavy memory and computational cost , especially in nonconvex stochastic optimization , where only sublinear convergence can be expected if only stochastic gradients can be accessed ( Nemirovskij & Yudin , 1983 ) . On the other side , first-order methods ( Necoara et al. , 2019 ) stand out for their low per-iteration cost , though the convergence can be slow in practice . When training neural networks , SGD with momentum ( SGDM ) ( Qian , 1999 ) , and adaptive learning rate methods , e.g . AdaGrad ( Duchi et al. , 2011 ) , RMSprop ( Tieleman & Hinton , 2012 ) , Adam ( Kingma & Ba , 2014 ) , are very popular optimizers . Our methods have the nature of quasiNewton methods while the memory footprint is largely reduced to be close to first-order methods . Thus , ST-AM can be a competitive optimizer from both theoretical and practical perspectives . 3 METHODOLOGY . In this section , we give the details of the proposed ST-AM . We always assume the objective function as f : Rd → R , the fixed-point map g : Rd 7→ Rd . Moreover , we do not distinguish rk = −∇f ( xk ) and rk = g ( xk ) − xk in our discussion as∇f ( x ) = 0 is equivalent to g ( x ) = −∇f ( x ) + x = x . 3.1 ANDERSON MIXING . The AM finds the fixed point of g via maintaining two sequences of length m ( m ≤ k ) : Xk = [ ∆xk−m , ∆xk−m+1 , · · · , ∆xk−1 ] , Rk = [ ∆rk−m , ∆rk−m+1 , · · · , ∆rk−1 ] ∈ Rd×m , ( 1 ) where the operator ∆ denotes the forward difference , e.g . ∆xk = xk+1 − xk . Each update of AM can be decoupled into two steps , namely the projection step and the mixing step : x̄k = xk −XkΓk , ( Projection step ) , xk+1 = x̄k + βkr̄k , ( Mixing step ) , ( 2 ) where r̄k : = rk −RkΓk and βk > 0 is the mixing parameter . The Γk is determined by Γk = arg min Γ∈Rm ‖rk −RkΓ‖2 . ( 3 ) Thus , the full form of AM ( Fang & Saad , 2009 ; Walker & Ni , 2011 ) is xk+1 = xk + βkrk − ( Xk + βkRk ) Γk . ( 4 ) Remark 1 . To see the rationality of AM , assume g is continuously differentiable , then we have h ( xj ) −h ( xj−1 ) ≈ h′ ( xk ) ( xj−xj−1 ) around xk , where h′ ( xk ) is the Jacobian of h ( x ) : = x−g ( x ) . So , it is reasonable to assume Rk ≈ −h′ ( xk ) Xk , and we see ‖rk −RkΓ‖2 ≈ ‖rk + h′ ( xk ) XkΓ‖2 . Thus , we can recognize ( 3 ) as solving h′ ( xk ) dk = h ( xk ) in a least-squares sense , where dk = XkΓk . The mixing step incorporates rk into the new update xk+1 if βk > 0 . Otherwise , xk+1 = x̄k is an interpolation of the previous iterates , leading to a stagnating sequence . 3.2 THE BASIC SHORT-TERM RECURRENCE ANDERSON MIXING . The basic ST-AM is to solve the strongly convex quadratic optimization : min x∈Rd f ( x ) : = 1 2 xTAx− bTx , ( 5 ) where A 0 . Initialized with p−1 = q−1 = p0 = q0 = 0 ∈ Rd , at the k-th iteration , given the two matrices Pk−1 = ( pk−2 , pk−1 ) ∈ Rd×2 , Qk−1 = ( qk−2 , qk−1 ) ∈ Rd×2 and defining p = xk−xk−1 and q = rk − rk−1 , the basic ST-AM constructs p̃ = p− Pk−1 ( QTk−1q ) , q̃ = q −Qk−1 ( QTk−1q ) , ( 6a ) pk = p̃/‖q̃‖2 , qk = q̃/‖q̃‖2 . ( 6b ) Then , we update Pk = ( pk−1 , pk ) , Qk = ( qk−1 , qk ) ∈ Rd×2 . Such construction ensures QTkQk = I2 for k ≥ 2 and the storage of Pk and Qk is equal to AM ( 2 ) . With the corrected Pk and Qk , the ST-AM method modifies the projection and mixing step accordingly , that is , x̄k = xk − PkΓk , ( Projection step ) , xk+1 = x̄k + βkr̄k , ( Mixing step ) , ( 7 ) where Γk = arg min ‖rk−QkΓ‖2 = QTk rk and r̄k = rk−QkΓk . Thus , the ST-AM replacesXk and Rk in ( 1 ) by Pk and Qk respectively and imposes the orthogonalization property on Qk . The details of basic ST-AM are given in Algorithm 2 in Appendix C.1 . Define P̄k = ( p1 , p2 , . . . , pk ) , Q̄k = ( q1 , q2 , . . . , qk ) , the Krylov subspace Km ( A , v ) ≡ span { v , Av , A2v , . . . , Am−1v } , the range of X as range ( X ) . We give the properties of the basic ST-AM in Theorem 1 . Theorem 1 . Let { xk } be the sequence generated by the basic ST-AM . The following relations hold : ( i ) ‖q̃‖2 > 0 , range ( P̄k ) = range ( Xk ) = Kk ( A , r0 ) , range ( Q̄k ) = range ( Rk ) = AKk ( A , r0 ) ; ( ii ) Q̄k = −AP̄k , Q̄Tk Q̄k = Ik ; ( iii ) r̄k ⊥ range ( Q̄k ) and x̄k = x0 + zk , where zk = arg minz∈Kk ( A , r0 ) ‖r0 −Az‖2 . If ‖r̄k‖2 = 0 , then xk+1 is the exact solution . The proof is in Appendix C.1 . Note that the property ( iii ) in Theorem 1 exactly describes the relation x̄k = x G k , where x G k is the output of the k-th iteration of GMRES ( Saad & Schultz , 1986 ) . Moreover , let x̄AMk be the k-th intermediate iterate in full-memory AM ( m = k ) . We prove that x̄ AM k = x G k ( See Proposition 1 in Appendix C.1 . ) , which induces that x̄k = x̄AMk = x G k . This equivalence indicates that ST-AM is more efficient than AM and GMRES since only two historical iterations need to be stored . Moreover , by directly applying the convergence analysis of GMRES ( Corollary 6.33 in ( Saad , 2003 ) ) , we obtain the convergence rate of the basic ST-AM for solving ( 5 ) : Corollary 1 . Suppose the eigenvalues of A lie in [ µ , L ] with µ > 0 , and let { xk } be the sequence generated by the basic ST-AM , then the k-th intermediate residual r̄k satisfies ‖r̄k‖2 ≤ 2 ( √ L/µ−1√ L/µ+1 ) k ‖r0‖2 . Moreover , the algorithm finds the exact solution in at most ( d+ 1 ) iterations . Remark 2 . The GMRES can be simplified to an elegant three-term recurrence algorithm called the conjugate residual ( CR ) method ( Algorithm 6.20 in ( Saad , 2003 ) ) when solving ( 5 ) . Thus , a similar simplification for AM is expected to exist . Like CG and Chebyshev acceleration ( Algorithm 12.1 in ( Saad , 2003 ) ) , the convergence rate of ST-AM has the optimal dependence on the condition number , while ST-AM does not form the Hessian-vector products explicitly . | The paper introduces 3 new variants of Anderson Mixing methods relying on very limited short term memory. This makes these methods more attractive for usual machine learning workloads. The paper also provides detailed analysis of the performance of each of these AM algorithms, as well as thorough experiments, showcasing improved performance of select neural network training. | SP:03a357be8e34c07221c6f2829928bf733428f0e3 |
A Class of Short-term Recurrence Anderson Mixing Methods and Their Applications | 1 INTRODUCTION . Anderson mixing ( AM ) ( Anderson , 1965 ) is a sequence acceleration method ( Brezinski et al. , 2018 ) in scientific computing . It is widely used to accelerate the slow convergence of fixed-point iterations ( Lin et al. , 2019 ; Fu et al. , 2020 ; An et al. , 2017 ) , e.g. , the self-consistent field iterations in electronic structure computations ( Garza & Scuseria , 2012 ; Arora et al. , 2017 ) . Specifically , we consider a fixed-point iteration xk+1 = g ( xk ) , k = 0 , 1 , . . . , where g : Rd 7→ Rd is the fixed-point map . By usingm historical iterations , AM ( m ) aims to extrapolate a new iterate that satisfies certain optimality property . When the function evaluation is costly , the reduction of the number of iterations brought by AM can save a large amount of computation ( Fang & Saad , 2009 ) . AM can be used as a method for solving nonlinear equations ( Kelley , 2018 ) as the fixed-point problem x = g ( x ) is equivalent to h ( x ) : = x − g ( x ) = 0 . In practice , since computing the Jacobian of h ( x ) is commonly difficult or even unavailable ( Nocedal & Wright , 2006 ) , AM can be seen as a practical alternate for Newton ’ s method ( An et al. , 2017 ) . Also , compared with the classical iterative methods such as the nonlinear conjugate gradient ( CG ) method ( Hager & Zhang , 2006 ) , no line-search or trust-region technique is used in AM , which is preferable for large-scale unconstrained optimization . Empirically , it is observable that AM can largely accelerate convergence , though its theoretical analysis is still under-explored . It turns out that in the linear case ( Walker & Ni , 2011 ; Potra & Engler , 2013 ) , the full-memory AM ( m = k ) is essentially equivalent to GMRES ( Saad & Schultz , 1986 ) , a powerful Krylov subspace method that can exhibit superlinear convergence behaviour in solving linear systems ( Van der Vorst & Vuik , 1993 ) . For general nonlinear problems , AM is recognized as a multisecant quasi-Newton method ( Fang & Saad , 2009 ; Brezinski et al. , 2018 ) . As far as we know , only local linear convergence has been obtained for the limited-memory AM ( m < k ) in general ( Toth & Kelley , 2015 ; Evans et al. , 2020 ; De Sterck & He , 2021 ) . For the application of AM , one of the major concerns is the historical length m , a critical factor related to the efficiency of AM ( Walker & Ni , 2011 ) . A larger m can incorporate more historical ∗Corresponding author . information into one extrapolation , but it incurs heavier memory overhead since 2m vectors of dimension d need to be stored in AM ( m ) . The additional memory footprint can be prohibitive for solving high-dimensional problems in a resource-limited machine ( Deng , 2019 ) . Using small m can alleviate the memory overhead but may deteriorate the efficacy of AM since much historical information is omitted in the extrapolation ( Walker & Ni , 2011 ; Evans et al. , 2020 ) . To address the memory issue of AM , we deeply investigate the properties of the historical iterations produced by AM and leverage them to develop the short-term recurrence variant , namely ST-AM . The basic version of ST-AM imposes some orthogonalization property on the historical sequence , which is inspired by the CG method ( Hestenes & Stiefel , 1952 ) that enjoys a three-term recurrence . Furthermore , to better suit the more difficult nonconvex optimization , a regularized short-term form is introduced . We highlight the main contributions of our work as follows . 1 . We develop a novel class of short-term recurrence AM methods ( ST-AM ) , including the basic ST-AM , the modified ST-AM ( MST-AM ) , and the regularized ST-AM ( RST-AM ) . The basic ST-AM is applicable for linear systems , MST-AM can solve general fixed-point problems , and RST-AM aims for solving stochastic optimization . An important feature of ST-AM is that all methods only need to store two previous iterations with cheap corrections , which significantly reduces the memory requirement compared with the classical AM . 2 . A complete theoretical analysis of the ST-AM methods is given . When solving strongly convex quadratic optimization , we prove that the basic ST-AM is equivalent to full-memory AM and the convergence rate is similar to CG method . We also prove that MST-AM has improved local linear convergence for solving fixed-point problems . Besides , we establish the global convergence property and complexity analysis for RST-AM when solving stochastic optimization problems . 3 . The numerical results on solving ( non ) linear equations and cubic-regularized quadratic optimization are consistent with the theoretical results for the basic ST-AM and MST-AM . Furthermore , extensive experiments on training deep neural networks for image classification and language models show that RST-AM is competitive with the long-memory AM and outperforms many existing optimizers such as SGD and ADAM . 2 RELATED WORK . AM is also known as an extrapolation algorithm in scientific computing ( Anderson , 2019 ) . A parallel method is Shanks transformation ( Shanks , 1955 ) which transforms an existing sequence to a new sequence for faster convergence . Related classical algorithms include Minimal Polynomial Extrapolation ( Cabay & Jackson , 1976 ) and Reduced Rank Extrapolation ( Eddy , 1979 ) , and a framework of these extrapolation algorithms including AM is given in ( Brezinski et al. , 2018 ) . Note that an elegant recursive algorithm named -algorithm has been discovered for Shanks transformation for scalar sequence ( Wynn , 1956 ) , and was later generalized as the vector -algorithm ( Wynn , 1962 ) for handling vector sequences , but this short-term recurrence form is not equivalent to the original Shanks transformation in general ( Brezinski & Redivo-Zaglia , 2017 ) . Since AM is closely related to quasi-Newton methods ( Fang & Saad , 2009 ) , there are also some works trying to derive equivalent forms of the full-memory quasi-Newton methods using limited memory ( Kolda et al. , 1998 ; Berahas et al. , 2021 ) , while no short-term recurrence is available . To the best of our knowledge , ST-AM is the first attempt to short-term recurrence quasi-Newton methods . Recently , there have been growing demands for solving large-scale and high-dimensional fixedpoint problems in scientific computing ( Lin et al. , 2019 ) and machine learning ( Bottou et al. , 2018 ) . For these applications , Newton-like methods ( Byrd et al. , 2016 ; Wang et al. , 2017 ; Mokhtari et al. , 2018 ) are less appealing due to the heavy memory and computational cost , especially in nonconvex stochastic optimization , where only sublinear convergence can be expected if only stochastic gradients can be accessed ( Nemirovskij & Yudin , 1983 ) . On the other side , first-order methods ( Necoara et al. , 2019 ) stand out for their low per-iteration cost , though the convergence can be slow in practice . When training neural networks , SGD with momentum ( SGDM ) ( Qian , 1999 ) , and adaptive learning rate methods , e.g . AdaGrad ( Duchi et al. , 2011 ) , RMSprop ( Tieleman & Hinton , 2012 ) , Adam ( Kingma & Ba , 2014 ) , are very popular optimizers . Our methods have the nature of quasiNewton methods while the memory footprint is largely reduced to be close to first-order methods . Thus , ST-AM can be a competitive optimizer from both theoretical and practical perspectives . 3 METHODOLOGY . In this section , we give the details of the proposed ST-AM . We always assume the objective function as f : Rd → R , the fixed-point map g : Rd 7→ Rd . Moreover , we do not distinguish rk = −∇f ( xk ) and rk = g ( xk ) − xk in our discussion as∇f ( x ) = 0 is equivalent to g ( x ) = −∇f ( x ) + x = x . 3.1 ANDERSON MIXING . The AM finds the fixed point of g via maintaining two sequences of length m ( m ≤ k ) : Xk = [ ∆xk−m , ∆xk−m+1 , · · · , ∆xk−1 ] , Rk = [ ∆rk−m , ∆rk−m+1 , · · · , ∆rk−1 ] ∈ Rd×m , ( 1 ) where the operator ∆ denotes the forward difference , e.g . ∆xk = xk+1 − xk . Each update of AM can be decoupled into two steps , namely the projection step and the mixing step : x̄k = xk −XkΓk , ( Projection step ) , xk+1 = x̄k + βkr̄k , ( Mixing step ) , ( 2 ) where r̄k : = rk −RkΓk and βk > 0 is the mixing parameter . The Γk is determined by Γk = arg min Γ∈Rm ‖rk −RkΓ‖2 . ( 3 ) Thus , the full form of AM ( Fang & Saad , 2009 ; Walker & Ni , 2011 ) is xk+1 = xk + βkrk − ( Xk + βkRk ) Γk . ( 4 ) Remark 1 . To see the rationality of AM , assume g is continuously differentiable , then we have h ( xj ) −h ( xj−1 ) ≈ h′ ( xk ) ( xj−xj−1 ) around xk , where h′ ( xk ) is the Jacobian of h ( x ) : = x−g ( x ) . So , it is reasonable to assume Rk ≈ −h′ ( xk ) Xk , and we see ‖rk −RkΓ‖2 ≈ ‖rk + h′ ( xk ) XkΓ‖2 . Thus , we can recognize ( 3 ) as solving h′ ( xk ) dk = h ( xk ) in a least-squares sense , where dk = XkΓk . The mixing step incorporates rk into the new update xk+1 if βk > 0 . Otherwise , xk+1 = x̄k is an interpolation of the previous iterates , leading to a stagnating sequence . 3.2 THE BASIC SHORT-TERM RECURRENCE ANDERSON MIXING . The basic ST-AM is to solve the strongly convex quadratic optimization : min x∈Rd f ( x ) : = 1 2 xTAx− bTx , ( 5 ) where A 0 . Initialized with p−1 = q−1 = p0 = q0 = 0 ∈ Rd , at the k-th iteration , given the two matrices Pk−1 = ( pk−2 , pk−1 ) ∈ Rd×2 , Qk−1 = ( qk−2 , qk−1 ) ∈ Rd×2 and defining p = xk−xk−1 and q = rk − rk−1 , the basic ST-AM constructs p̃ = p− Pk−1 ( QTk−1q ) , q̃ = q −Qk−1 ( QTk−1q ) , ( 6a ) pk = p̃/‖q̃‖2 , qk = q̃/‖q̃‖2 . ( 6b ) Then , we update Pk = ( pk−1 , pk ) , Qk = ( qk−1 , qk ) ∈ Rd×2 . Such construction ensures QTkQk = I2 for k ≥ 2 and the storage of Pk and Qk is equal to AM ( 2 ) . With the corrected Pk and Qk , the ST-AM method modifies the projection and mixing step accordingly , that is , x̄k = xk − PkΓk , ( Projection step ) , xk+1 = x̄k + βkr̄k , ( Mixing step ) , ( 7 ) where Γk = arg min ‖rk−QkΓ‖2 = QTk rk and r̄k = rk−QkΓk . Thus , the ST-AM replacesXk and Rk in ( 1 ) by Pk and Qk respectively and imposes the orthogonalization property on Qk . The details of basic ST-AM are given in Algorithm 2 in Appendix C.1 . Define P̄k = ( p1 , p2 , . . . , pk ) , Q̄k = ( q1 , q2 , . . . , qk ) , the Krylov subspace Km ( A , v ) ≡ span { v , Av , A2v , . . . , Am−1v } , the range of X as range ( X ) . We give the properties of the basic ST-AM in Theorem 1 . Theorem 1 . Let { xk } be the sequence generated by the basic ST-AM . The following relations hold : ( i ) ‖q̃‖2 > 0 , range ( P̄k ) = range ( Xk ) = Kk ( A , r0 ) , range ( Q̄k ) = range ( Rk ) = AKk ( A , r0 ) ; ( ii ) Q̄k = −AP̄k , Q̄Tk Q̄k = Ik ; ( iii ) r̄k ⊥ range ( Q̄k ) and x̄k = x0 + zk , where zk = arg minz∈Kk ( A , r0 ) ‖r0 −Az‖2 . If ‖r̄k‖2 = 0 , then xk+1 is the exact solution . The proof is in Appendix C.1 . Note that the property ( iii ) in Theorem 1 exactly describes the relation x̄k = x G k , where x G k is the output of the k-th iteration of GMRES ( Saad & Schultz , 1986 ) . Moreover , let x̄AMk be the k-th intermediate iterate in full-memory AM ( m = k ) . We prove that x̄ AM k = x G k ( See Proposition 1 in Appendix C.1 . ) , which induces that x̄k = x̄AMk = x G k . This equivalence indicates that ST-AM is more efficient than AM and GMRES since only two historical iterations need to be stored . Moreover , by directly applying the convergence analysis of GMRES ( Corollary 6.33 in ( Saad , 2003 ) ) , we obtain the convergence rate of the basic ST-AM for solving ( 5 ) : Corollary 1 . Suppose the eigenvalues of A lie in [ µ , L ] with µ > 0 , and let { xk } be the sequence generated by the basic ST-AM , then the k-th intermediate residual r̄k satisfies ‖r̄k‖2 ≤ 2 ( √ L/µ−1√ L/µ+1 ) k ‖r0‖2 . Moreover , the algorithm finds the exact solution in at most ( d+ 1 ) iterations . Remark 2 . The GMRES can be simplified to an elegant three-term recurrence algorithm called the conjugate residual ( CR ) method ( Algorithm 6.20 in ( Saad , 2003 ) ) when solving ( 5 ) . Thus , a similar simplification for AM is expected to exist . Like CG and Chebyshev acceleration ( Algorithm 12.1 in ( Saad , 2003 ) ) , the convergence rate of ST-AM has the optimal dependence on the condition number , while ST-AM does not form the Hessian-vector products explicitly . | The paper proposes a new class of memory-efficient Anderson mixing (AM) methods. Compared with classical Anderson mixing which requires saving m historical iterates, the new variants require only storing two historical iterates while keeping good performance. Convergence analyses are given to the proposed variants showing a variant for strongly convex quadratic problem enjoys the same guarantee as full-memory AM, and another variant converges with a similar convergence rate as SGD (O(1/\sqrt{number of iterations})) on nonconvex problems. Experiments on MNIST, CIFAR-10, and PENN TREEBANK with some popular deep models validates the superior performance of one of the proposed method. | SP:03a357be8e34c07221c6f2829928bf733428f0e3 |
Relational Multi-Task Learning: Modeling Relations between Data and Tasks | 1 INTRODUCTION . The general idea of learning from multiple tasks has been explored under different settings , including multi-task learning ( Caruana , 1997 ) , meta learning ( Finn et al. , 2017 ) , and few-shot learning ( Vinyals et al. , 2016 ) . While these learning settings have inspired models that can utilize relationships among tasks ( Chen et al. , 2019 ; Zamir et al. , 2018 ; Sener & Koltun , 2018 ; Lin et al. , 2019 ; Ma et al. , 2020 ) , they are not able to capture the full complexity of real-world machine learning applications . Concretely , when learning from multiple tasks , current approaches assume that the test data points have no access to the labels from other tasks when making predictions on a new task . However , this assumption oversimplifies potential useful knowledge in many applications . In reality , when making predictions for a given task , one may have access and want to utilize any known auxiliary task labels to further improve the prediction performance . Intuitively , imagine we want to predict whether it is safe to use a chemical compound x in the production of a recently discovered drug . In the meantime if ( 1 ) we know the compound x has positive results on two toxicology tests , and ( 2 ) the two toxicology tests have a high correlation with the task/test we are studying , then we could make a more accurate prediction with higher confidence by leveraging the additional knowledge . The example above shows how modeling and leveraging auxiliary tasks may benefit model performance . However , current deep learning architectures can not model such knowledge transfer from auxiliary task labels to the task of interest . Naively concatenating the known labels to the input features has its limitations especially since auxiliary task labels are sparsely available and it is also unclear how to use the approach for new and unseen tasks . Another potential solution to model such flexible and conditional inference is through generative models ( Dempster et al. , 1977 ; Koller & Friedman , 2009 ) . Although generative models are powerful , they are notoriously data-hungry , thus it is very difficult to construct and train a generative model for high dimensional data ( Turhan & Bilge , 2018 ) . State-of-the-art deep generative models have diverged quite heavily from state-of-the-art discriminative architectures in terms of accuracy on most of the downstream tasks . Here we propose a new multi-task learning setting called relational multi-task learning , where the goal is to achieve data efficiency through leveraging labels of a given data point on other already known auxiliary tasks . This setting is especially important for biochemical domains where knowledge is scattered in multiple datasets and tasks , e.g. , solving the molecule toxicity prediction problem we mentioned earlier . To tackle the relational multi-task learning , we propose MetaLink , a general discriminative model that can explicitly incorporate the knowledge from auxiliary tasks . Our key innovation is to build a knowledge graph that connects different tasks tj and data points x ( i ) ( Figure 1 ) . The first step of our approach is to take input data points x ( i ) and the feature extractor ( i.e. , neural network ) fθ to get its embedding z ( i ) . Then we build the knowledge graph which consists of two types of nodes : data nodes x ( i ) and task nodes tj . A data node x ( i ) connects to a task node tj if data point x ( i ) participates in task tj and the edge is annotated with the label y ( i ) j of x ( i ) on task tj . We initialize data node features to be the last layer embedding z ( i ) in the feature extractor fθ , and task node tj features are instantiated as the last layer ’ s weights wj . Given our knowledge graph , we reformulate the multi-task learning problem as a link-label prediction problem between data nodes and task nodes . This means that at the inference time MetaLink is able to use all the information about a given data point x ( i ) ( including its labels on auxiliary tasks { tj } ) to predict its label on a new task tn . We solve this link label prediction learning task via a Graph Neural Network ( GNN ) ( Hamilton et al. , 2017 ; He et al. , 2019 ; Xue et al. , 2021 ) . Unlike previous works , e.g. , ML-GCN ( Chen et al. , 2019 ) , that solely model relationships among tasks , MetaLink allows flexible and automatic modeling for data-task , data-data and task-task relationships . We evaluate MetaLink on six benchmark datasets in both biochemical and vision domains under various settings . Empirical demonstrate that MetaLink can successfully utilize the relations among different tasks , outperforming the state-of-the-art methods under the proposed relational multi-task learning setting , with up to 27 % improvement in ROC AUC . 2 RELATIONAL MULTI-TASK LEARNING SETTINGS . Here we first formally introduce the settings for relational multi-task learning . Suppose we have m machine learning tasks { tj } j∈T , where T = { 1 , 2 , ... , m } is integers between 1 and m. We propose to categorize different settings in two dimensions : ( 1 ) whether the task is a relational task , i.e. , if auxiliary task labels can be used at inference time ; and , ( 2 ) whether the task is a meta task , i.e. , if the task at test time has been seen at the training time . Altogether , there are four possible task settings , which are illustrated in Figure 2 and below . Standard supervised setting . Let x ( i ) denote the input and y ( i ) j denote the corresponding label associated with task tj , i.e. , y ( i ) j ∼ tj . Standard supervised multi-task learning can be represented as Train : { x ( i ) → { y ( i ) j ∼ tj } j∈T } Test : { x ( i ) → { y ( i ) j ∼ tj } j∈T } where→ connects the input and the output . Training and test sets cover non-overlapping data points . We use y ( i ) j to concisely represent y ( i ) j ∼ tj later on . Relational setting . In relational setting , in addition to input x ( i ) , we assume we also have access to auxiliary task labels when making predictions . Taux and Ttest are partitions of integers ( T ) that relates to subsets of tasks . Specifically , Taux refers to the indices of tasks that input x has access to , and Ttest are the indices of tasks that we wish to predict ; these two sets are non-overlapping , i.e. , Taux ∩ Ttest = ∅ , and input-dependent , i.e. , the partition T ( 1 ) test and T ( 2 ) test can be different . The input-output pairs are now in the form of Train : { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) test } Test : { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) test } Meta setting . In the meta setting , we want to learn to predict unseen tasks at the test time . Formally , let Ts , Tu denote the set of partitions for seen tasks ( used at training time ) and unseen tasks ( used at test time ) , where Ts ∩ Tu = ∅ . Here , we have access to a batch of samples with labels as the support set S and the objective is to correctly predict samples in the query set Q . Train : given S = { ( x ( i ) , { y ( i ) j } j∈Ts ) } , predict Q = { x ( i ) → { y ( i ) j } j∈Ts } Test : given S = { ( x ( i ) , { y ( i ) j } j∈Tu ) } , predict Q = { x ( i ) → { y ( i ) j } j∈Tu } Relational meta setting . Relational meta setting combines the features of relational setting and meta setting . Similar to the meta setting , we aim to predict unseen tasks Tu at test time ; meanwhile , similar to the relational setting , we also assume having labels on a limited number of auxiliary tasks Taux ⊆ Ts to harness . Formally , we have a support set and a query set in the form of Train : given S = { ( x ( i ) , { y ( i ) j } j∈T ( i ) s ) } , predict Q = { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) s \T ( i ) aux } Test : given S = { ( x ( i ) , { y ( i ) j } j∈T ( i ) u ) } , predict Q = { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) u } 3 METALINK FRAMEWORK . Next , we describe our MetaLink framework , which allows us to formulate the above multi-task learning settings in a single framework . In particular , MetaLink formulates them as a link label prediction task on a heterogeneous knowledge graph , this way , MetaLink can harness the relational information about data and tasks . 3.1 BUILD A KNOWLEDGE GRAPH ON TASK HEADS . We first recap the general formulation of a neural network . Given data points { x ( i ) } ni=1 and labels { { y ( i ) j } j∈T } ni=1 , a deep learning model can be formulated as a parameterized embedding function fθ ( which is deep ) and a task head fw , consisting of only a single weight matrix w. fθ maps a data point x ( i ) to a vector embedding space , fθ ( x ( i ) ) = z ( i ) ∈ RD . fw then maps an embedding z ( i ) to prediction ŷ ( i ) ∈ R1 , fw ( z ( i ) ) = wT z ( i ) = ŷ ( i ) . When a task head involves multi-layer transformation , we have fw ( z ( i ) ) = wT g ( z ( i ) ) = ŷ ( i ) , where g ( · ) can be an arbitrary function . In multi-task learning settings , people usually assign multiple task heads to a neural network . Suppose we have m tasks { tj } mj=1 , then there are m task heads such that ŷ ( i ) j = fwj ( z ( i ) ) . Here , our observation is that the weights in task heads w1 , . . . , wj , and the data embeddings z ( i ) play symmetric roles in a multi-task prediction task ( due to the dot product ) . Therefore , instead of viewing weights w1 , . . . , wj as parameters in a neural network , we propose to represent w1 , . . . , wj as another type of input that supports the prediction . Essentially , we reformulate a task head from ŷ ( i ) j = fwj ( z ( i ) ) to ŷ ( i ) j = fφ ( wj , z ( i ) ) . This new perspective , where both task weights wj and embedding z ( i ) are viewed as input , enables us to build a more sophisticated predictive model fφ . fφ in the sense that it contains two main steps , i.e. , GraphConv ( · ) and EdgePred ( · ) . In general , EdgePred ( · ) has a similar model complexity as fwj , whereas GraphConv ( · ) provides additional expressiveness . In MetaLink , we propose to build a knowledge graph over task weights wj and embedding z ( i ) . By building this knowledge graph , we can succinctly represent relationships between data points and tasks , as well as different multi-task learning settings . Concretely , a knowledge graph helps us easily express any data-task relationship ( e.g. , a data point has a label on a given task ) , data-data relationship ( e.g. , two data points are similar or not ) , or task-task relationship ( e.g. , hierarchy of different tasks ) . Moreover , a knowledge graph greatly simplifies the representation of all the multi-task learning settings that we outlined in Section 2 ; in fact , all the settings can be viewed as link label prediction tasks where different portions of the knowledge graph can be constructed , as illustrated in Figure 2 . We define the knowledge graph as G = { V , E } , where V is the node set and E ⊆ V × V is the edge set . We define two types of nodes , data nodes Vd = { x ( 1 ) , . . . , x ( n ) } and task nodes Vt = { t1 , . . . , tm } . We can then define edges between data and task nodes Edt ⊆ Vd × Vt , within data nodes Edd ⊆ Vd×Vd , and within task nodes Ett ⊆ Vt×Vt . MetaLink framework can work with all three types of edges ; however , since most benchmark datasets do not have information on datadata or task-task relationship , we focus on data-task relationship Edt in the remaining discussions . Specifically , we define Edt based on task labels , Edt = { ( x ( i ) , tj ) ∼ y ( i ) j∈Taux } , i.e. , we connect a data node x ( i ) with a task node tj if label y ( i ) j exists . | The paper exploits the multi-task modeling using a heterogenous Graph Neural Network. The key contribution of the work is having both data (sample) and task nodes in the same graph, focusing on data-task relation, accommodating for sparse task labels by design. Experimental results show relevant improvements with the proposed relational model on biomedical datasets and Imagenet splits for few-shot. | SP:40aeb37eea243288569e41cdd3100403021fc866 |
Relational Multi-Task Learning: Modeling Relations between Data and Tasks | 1 INTRODUCTION . The general idea of learning from multiple tasks has been explored under different settings , including multi-task learning ( Caruana , 1997 ) , meta learning ( Finn et al. , 2017 ) , and few-shot learning ( Vinyals et al. , 2016 ) . While these learning settings have inspired models that can utilize relationships among tasks ( Chen et al. , 2019 ; Zamir et al. , 2018 ; Sener & Koltun , 2018 ; Lin et al. , 2019 ; Ma et al. , 2020 ) , they are not able to capture the full complexity of real-world machine learning applications . Concretely , when learning from multiple tasks , current approaches assume that the test data points have no access to the labels from other tasks when making predictions on a new task . However , this assumption oversimplifies potential useful knowledge in many applications . In reality , when making predictions for a given task , one may have access and want to utilize any known auxiliary task labels to further improve the prediction performance . Intuitively , imagine we want to predict whether it is safe to use a chemical compound x in the production of a recently discovered drug . In the meantime if ( 1 ) we know the compound x has positive results on two toxicology tests , and ( 2 ) the two toxicology tests have a high correlation with the task/test we are studying , then we could make a more accurate prediction with higher confidence by leveraging the additional knowledge . The example above shows how modeling and leveraging auxiliary tasks may benefit model performance . However , current deep learning architectures can not model such knowledge transfer from auxiliary task labels to the task of interest . Naively concatenating the known labels to the input features has its limitations especially since auxiliary task labels are sparsely available and it is also unclear how to use the approach for new and unseen tasks . Another potential solution to model such flexible and conditional inference is through generative models ( Dempster et al. , 1977 ; Koller & Friedman , 2009 ) . Although generative models are powerful , they are notoriously data-hungry , thus it is very difficult to construct and train a generative model for high dimensional data ( Turhan & Bilge , 2018 ) . State-of-the-art deep generative models have diverged quite heavily from state-of-the-art discriminative architectures in terms of accuracy on most of the downstream tasks . Here we propose a new multi-task learning setting called relational multi-task learning , where the goal is to achieve data efficiency through leveraging labels of a given data point on other already known auxiliary tasks . This setting is especially important for biochemical domains where knowledge is scattered in multiple datasets and tasks , e.g. , solving the molecule toxicity prediction problem we mentioned earlier . To tackle the relational multi-task learning , we propose MetaLink , a general discriminative model that can explicitly incorporate the knowledge from auxiliary tasks . Our key innovation is to build a knowledge graph that connects different tasks tj and data points x ( i ) ( Figure 1 ) . The first step of our approach is to take input data points x ( i ) and the feature extractor ( i.e. , neural network ) fθ to get its embedding z ( i ) . Then we build the knowledge graph which consists of two types of nodes : data nodes x ( i ) and task nodes tj . A data node x ( i ) connects to a task node tj if data point x ( i ) participates in task tj and the edge is annotated with the label y ( i ) j of x ( i ) on task tj . We initialize data node features to be the last layer embedding z ( i ) in the feature extractor fθ , and task node tj features are instantiated as the last layer ’ s weights wj . Given our knowledge graph , we reformulate the multi-task learning problem as a link-label prediction problem between data nodes and task nodes . This means that at the inference time MetaLink is able to use all the information about a given data point x ( i ) ( including its labels on auxiliary tasks { tj } ) to predict its label on a new task tn . We solve this link label prediction learning task via a Graph Neural Network ( GNN ) ( Hamilton et al. , 2017 ; He et al. , 2019 ; Xue et al. , 2021 ) . Unlike previous works , e.g. , ML-GCN ( Chen et al. , 2019 ) , that solely model relationships among tasks , MetaLink allows flexible and automatic modeling for data-task , data-data and task-task relationships . We evaluate MetaLink on six benchmark datasets in both biochemical and vision domains under various settings . Empirical demonstrate that MetaLink can successfully utilize the relations among different tasks , outperforming the state-of-the-art methods under the proposed relational multi-task learning setting , with up to 27 % improvement in ROC AUC . 2 RELATIONAL MULTI-TASK LEARNING SETTINGS . Here we first formally introduce the settings for relational multi-task learning . Suppose we have m machine learning tasks { tj } j∈T , where T = { 1 , 2 , ... , m } is integers between 1 and m. We propose to categorize different settings in two dimensions : ( 1 ) whether the task is a relational task , i.e. , if auxiliary task labels can be used at inference time ; and , ( 2 ) whether the task is a meta task , i.e. , if the task at test time has been seen at the training time . Altogether , there are four possible task settings , which are illustrated in Figure 2 and below . Standard supervised setting . Let x ( i ) denote the input and y ( i ) j denote the corresponding label associated with task tj , i.e. , y ( i ) j ∼ tj . Standard supervised multi-task learning can be represented as Train : { x ( i ) → { y ( i ) j ∼ tj } j∈T } Test : { x ( i ) → { y ( i ) j ∼ tj } j∈T } where→ connects the input and the output . Training and test sets cover non-overlapping data points . We use y ( i ) j to concisely represent y ( i ) j ∼ tj later on . Relational setting . In relational setting , in addition to input x ( i ) , we assume we also have access to auxiliary task labels when making predictions . Taux and Ttest are partitions of integers ( T ) that relates to subsets of tasks . Specifically , Taux refers to the indices of tasks that input x has access to , and Ttest are the indices of tasks that we wish to predict ; these two sets are non-overlapping , i.e. , Taux ∩ Ttest = ∅ , and input-dependent , i.e. , the partition T ( 1 ) test and T ( 2 ) test can be different . The input-output pairs are now in the form of Train : { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) test } Test : { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) test } Meta setting . In the meta setting , we want to learn to predict unseen tasks at the test time . Formally , let Ts , Tu denote the set of partitions for seen tasks ( used at training time ) and unseen tasks ( used at test time ) , where Ts ∩ Tu = ∅ . Here , we have access to a batch of samples with labels as the support set S and the objective is to correctly predict samples in the query set Q . Train : given S = { ( x ( i ) , { y ( i ) j } j∈Ts ) } , predict Q = { x ( i ) → { y ( i ) j } j∈Ts } Test : given S = { ( x ( i ) , { y ( i ) j } j∈Tu ) } , predict Q = { x ( i ) → { y ( i ) j } j∈Tu } Relational meta setting . Relational meta setting combines the features of relational setting and meta setting . Similar to the meta setting , we aim to predict unseen tasks Tu at test time ; meanwhile , similar to the relational setting , we also assume having labels on a limited number of auxiliary tasks Taux ⊆ Ts to harness . Formally , we have a support set and a query set in the form of Train : given S = { ( x ( i ) , { y ( i ) j } j∈T ( i ) s ) } , predict Q = { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) s \T ( i ) aux } Test : given S = { ( x ( i ) , { y ( i ) j } j∈T ( i ) u ) } , predict Q = { ( x ( i ) , { y ( i ) j } j∈T ( i ) aux ) → { y ( i ) j } j∈T ( i ) u } 3 METALINK FRAMEWORK . Next , we describe our MetaLink framework , which allows us to formulate the above multi-task learning settings in a single framework . In particular , MetaLink formulates them as a link label prediction task on a heterogeneous knowledge graph , this way , MetaLink can harness the relational information about data and tasks . 3.1 BUILD A KNOWLEDGE GRAPH ON TASK HEADS . We first recap the general formulation of a neural network . Given data points { x ( i ) } ni=1 and labels { { y ( i ) j } j∈T } ni=1 , a deep learning model can be formulated as a parameterized embedding function fθ ( which is deep ) and a task head fw , consisting of only a single weight matrix w. fθ maps a data point x ( i ) to a vector embedding space , fθ ( x ( i ) ) = z ( i ) ∈ RD . fw then maps an embedding z ( i ) to prediction ŷ ( i ) ∈ R1 , fw ( z ( i ) ) = wT z ( i ) = ŷ ( i ) . When a task head involves multi-layer transformation , we have fw ( z ( i ) ) = wT g ( z ( i ) ) = ŷ ( i ) , where g ( · ) can be an arbitrary function . In multi-task learning settings , people usually assign multiple task heads to a neural network . Suppose we have m tasks { tj } mj=1 , then there are m task heads such that ŷ ( i ) j = fwj ( z ( i ) ) . Here , our observation is that the weights in task heads w1 , . . . , wj , and the data embeddings z ( i ) play symmetric roles in a multi-task prediction task ( due to the dot product ) . Therefore , instead of viewing weights w1 , . . . , wj as parameters in a neural network , we propose to represent w1 , . . . , wj as another type of input that supports the prediction . Essentially , we reformulate a task head from ŷ ( i ) j = fwj ( z ( i ) ) to ŷ ( i ) j = fφ ( wj , z ( i ) ) . This new perspective , where both task weights wj and embedding z ( i ) are viewed as input , enables us to build a more sophisticated predictive model fφ . fφ in the sense that it contains two main steps , i.e. , GraphConv ( · ) and EdgePred ( · ) . In general , EdgePred ( · ) has a similar model complexity as fwj , whereas GraphConv ( · ) provides additional expressiveness . In MetaLink , we propose to build a knowledge graph over task weights wj and embedding z ( i ) . By building this knowledge graph , we can succinctly represent relationships between data points and tasks , as well as different multi-task learning settings . Concretely , a knowledge graph helps us easily express any data-task relationship ( e.g. , a data point has a label on a given task ) , data-data relationship ( e.g. , two data points are similar or not ) , or task-task relationship ( e.g. , hierarchy of different tasks ) . Moreover , a knowledge graph greatly simplifies the representation of all the multi-task learning settings that we outlined in Section 2 ; in fact , all the settings can be viewed as link label prediction tasks where different portions of the knowledge graph can be constructed , as illustrated in Figure 2 . We define the knowledge graph as G = { V , E } , where V is the node set and E ⊆ V × V is the edge set . We define two types of nodes , data nodes Vd = { x ( 1 ) , . . . , x ( n ) } and task nodes Vt = { t1 , . . . , tm } . We can then define edges between data and task nodes Edt ⊆ Vd × Vt , within data nodes Edd ⊆ Vd×Vd , and within task nodes Ett ⊆ Vt×Vt . MetaLink framework can work with all three types of edges ; however , since most benchmark datasets do not have information on datadata or task-task relationship , we focus on data-task relationship Edt in the remaining discussions . Specifically , we define Edt based on task labels , Edt = { ( x ( i ) , tj ) ∼ y ( i ) j∈Taux } , i.e. , we connect a data node x ( i ) with a task node tj if label y ( i ) j exists . | In this paper, they introduce relational multi-task learning in which they construct a graph with the data points and task and labels as edges. They represent the data points as the embedding of NN model and task as the last layer of NN model for that task. Then they solve the link label prediction problem between each node and task by using GNN and heterogeneous message passing method to predict the label of test data point on a new task at inference time. | SP:40aeb37eea243288569e41cdd3100403021fc866 |
Containerized Distributed Value-Based Multi-Agent Reinforcement Learning | 1 INTRODUCTION . Deep reinforcement learning ( DRL ) has been proved effective in various complex domains , including the game of Go ( Silver et al. , 2017 ) , Dota ( OpenAI , 2018 ) , and StarCraft II ( Vinyals et al. , 2017 ) . However , as problems increase in scale , the training of DRL models is increasingly timeconsuming ( Mnih et al. , 2016 ) , which is partly because complex tasks typically require large amounts of training samples . Distributed learning provides a promising direction to significantly reduce training costs by allowing the RL learner to effectively leverage massive experience collected by a large number of actors interacting with different environment instances . Compared to its single-agent counterparts , multi-agent tasks involve more learning agents and a larger search space consists of joint action-observation history . Therefore , multi-agent reinforcement learning ( MARL ) typically requires more samples ( Kurach et al. , 2020 ) and is more time-consuming . However , most of the impressive progress achieved by distributed DRL focuses on the single-agent setting and leaves the efficient training of MARL algorithms largely unstudied . To makeup for this shortage , in this paper , we study distributed value-based multi-agent reinforcement learning . We first pinpoint three unique challenges posed by the increasing number of agents in multi-agent settings listed as follows . ( 1 ) Demanding data transfer . Coming with the increased number of agents is a larger volume of experience – modern MARL algorithms typically require local observation history of all agents apart from global states . If we deploy environments on CPUs like state-of-the-art single-agent distributed DRL algorithms ( Espeholt et al. , 2019 ) , the data transfer between CPUs and GPUs will consume significant CPU computation utility . ( 2 ) Inter-process communication . Inter-process communication between environments , buffers , and learners is more likely to block in multi-agent settings . This is because the experience volume is large and reading/rewriting becomes more time-consuming . ( 3 ) Exploration . The search space of multi-agent problems grows exponentially with the number of agents . Learning performance of MARL algorithms largely rely on efficient exploration in such a large space . In this paper , we propose a containerized distributed value-based multi-agent reinforcement learning framework ( CMARL ) to address these problems . We pack several actors interacting with environments , a local learner , a local buffer , and a carefully designed multi-queue manager into a container . A container interacts with its environment instances , collects data , avoids block via its multi-queue manager , and actively updates its local policy . Data with high priority is transferred to a global learner that brings together the most talented and valuable experience to train the target policy . We further share the parameters of shallow layers for local and global learners to accelerate training while encouraging deep layers of local learners to be as diverse as possible to improve exploration . The advantages of the CMARL framework are as follows . ( 1 ) A container can be deployed on either CPUs or a GPU , making our method scalable and adaptive with the available computational resources . ( 2 ) Largely reduced data transfer . Data collection and prioritization happens within the container , and only highly prioritized data is transferred . ( 3 ) Multi-queue managers work asynchronously from policy learning , enabling efficient and unblocked inter-process communication when data collection . ( 4 ) Diverse behavior enables efficient exploration in the large search space . In this way , CMARL makes a scalable , time-efficient , and diverse distributed MARL framework with high system throughput . We empirically evaluate the performance of our architecture on both Google Research Football ( Kurach et al. , 2020 ) and StarCraft II micromanagement challenges ( Samvelyan et al. , 2019 ) . Our method is the only algorithm that can obtain a positive goal difference on the three GRF tasks , and is the first algorithm which can solve the challenging 5_v_5 full game . On the SMAC benchmark , our method obtains 4-18× better results compared against state-of-the-art non-distributed MARL algorithms . 2 METHODS . In this section , we present our novel containerized framework ( Fig . 1 ) for distributed MARL . We consider fully cooperative multi-agent tasks that can be modelled as a Dec-POMDP ( Oliehoek et al. , 2016 ) consisting of a tuple G=〈I , S , A , P , R , Ω , O , n , γ〉 , where I is the finite set of n agents , γ ∈ [ 0 , 1 ) is the discount factor , and s ∈ S is the true state of the environment . At each timestep , each agent i receives an observation oi ∈ Ω drawn according to the observation function O ( s , i ) and selects an action ai ∈ A , forming a joint action a ∈ An , leading to a next state s′ according to the transition function p ( s′|s , a ) , and observing a reward r = R ( s , a ) shared by all agents . Each agent has local action-observation history τi ∈ T ≡ ( Ω×A ) ∗ . Distributed deep reinforcement learning aims to provide a scalable and time-efficient computational framework . In the multi-agent setting , distributed RL encounters unique challenges . ( 1 ) The experience of MARL agents typically consists of local observations , and actions of all agents . Moreover , the centralized training with decentralized execution paradigm ( Foerster et al. , 2017 ; Rashid et al. , 2018 ) requires global states that contain information of all agents . Therefore , the size of experience grows quadratically with the number of agents . Consequently , transferring experience across different devices is very consuming , leading to a very high CPU usage . Meanwhile , large volume experience may also cause block in inter-process communication . In order to reduce such overhead , we pack several actors and environments into one container and design a multi-queue manager to avoid blocking . The container only sends a portion of experience to the centralized learner , and the centralized learner learns a global policy from these experiences . The whole architecture consists of several containers and one centralized learner . ( 2 ) Another challenge of multi-agent reinforcement learning is that the action-observation space grows exponentially with the number of agents , posing a great challenge to exploration . Multiple containers allow us to do diverse exploration in a way that each container learns an individual policy different from others and uses that policy to explore . Therefore , the proposed containerized framework ( Fig . 1 ) holds the promise to solve these unique challenges of distributed multi-agent reinforcement learning . However , to realize this goal , many structural details need to be designed for each framework component , including the container , the centralized learner , and the training scheme . We now describe them in greater detail . 2.1 CONTAINER . Inside each container , there are k actors interacting with k environment instances to collect experience , one container buffer storing experience , and one container learner training the container policy with batches of trajectories sampled from the local buffer . A critical design consideration of a successful distributed reinforcement learning framework is the uninterrupted learning of learners . To this end , we need to constantly sample batches from the container buffer . Meanwhile , the buffer needs to update itself with new experience constantly . In order to well manage these two operations and avoid read/write conflicts , we introduce a buffer manager , which is the only process controlling the buffer . The buffer manager repeatedly inserts new experience and samples batches . Directly sending new experience from actors to the buffer manager has two shortcomings . ( 1 ) The new experience would be stacked in the multi-process data-transfer queue when the buffer manager is sampling . In this case , actors have to wait , without collecting new trajectories until the buffer finishes sampling . Consequently , experience collection is slowed down . ( 2 ) Receiving trajectories one by one is slower than receiving trajectories in a batch . Moreover , receiving and inserting new experience frequently increases the waiting time between batch sampling . As sampling has to wait , the container learner has to wait when there is no batch to train . These two shortcomings become particularly problematic in multi-agent settings as trajectories consume more space in the multi-process data-transfer queue . In order to tackle these issues , we introduce a multi-queue manager . There is a shared signal between the multi-queue and the buffer manager . The multi-queue manager constantly gathers new experience together unless the signal indicates that the buffer manager requires new batches . When the signal is set , the multi-queue manager compacts all new experience it has gathered to a batch and send them to the buffer manager . Since we use prioritized experience replay , this batch goes through an initial priority calculator before the buffer manager where its priority is calculated . The priority of one trajectory is computed by pτ = Normalize ( ∑ t rt ) + , where Normalize ( X ) = X−L H−L , andL , H are the lower and upper bound of the sum of rewards in a whole trajectory , respectively . is a small constant that avoids a zero probability during sampling . 2.2 CENTRALIZER . The centralizer has an architecture similar to the container ( Fig . 1 ) , except that new experience comes from containers rather than actors . After containers ’ initial priority calculator receive a batch of new experience and compute their priority , containers will send η % of the experience to the centralizer ’ s experience receiver . Transferred experience is sampled with a probability proportional to the priority . Here , η is a real number between 0 and 100 , indicating the fraction of experience to be sent to the centralized learner . Although our architecture can be combined with any value-based MARL algorithms , in this paper , we use QMIX ( Rashid et al. , 2018 ) as the underlying algorithm . The centralized learner updates a QMIX network . Specifically , agents share a three-layer local Q-network , with a GRU ( Cho et al. , 2014 ) between two fully-connected layers , and the global Q value Qθ ( τ , a ) , parameterized by θ , is learned as a monotonic combination of local Q values . The centralized learner is updated by the following TD loss : LTD ( θ ) = EB∼Dcen [ ∑ τ∈B ∑Tτ−1 t=0 [ Qθ ( τt , at ) − ( rt + γmaxaQθ′ ( st+1 , a ) ) ] 2∑ τ∈B Tτ ] ( 1 ) where Tτ is the length of trajectory τ , Dcen is the centralized buffer , the expectation means that batches are sampled from Dcen according to the priority of trajectories , and θ′ is parameters of a target network copied from θ every C Q-network updates . 2.3 ENCOURAGING DIVERSITY AMONG CONTAINERS . Using multiple containers to interact with the environment leads to more time-efficient experience collection . Training will be boosted in large exploration spaces posed by multi-agent tasks when the collected experience is diverse . Such diversity can be achieved by letting containers act and explore differently from each other . In our architecture , containers maintain a Q-network with the same architecture as the centralized learner . Although the architecture is the same , container Q-networks are learned individually and encouraged to be different . To explicitly encourage diversity among containers , in addition to the local TD loss , every container includes a diversity objective in the loss function to maximize the mutual information between container id and its local experience I ( τ , id ) = Eτ , id [ log p ( τ |id ) p ( τ ) ] . ( 2 ) We expand the mutual information as follows : I ( τ , id ) = Eτ , id [ log p ( o0|id ) p ( o0 ) + ∑ t log p ( at|τt , id ) p ( at|τt ) + ∑ t log p ( ot+1|τt , at , id ) p ( ot+1|τt , at ) ] ( 3 ) Here , o0 is the initial observation , and its distribution is independent of container id . Therefore , p ( o0|id ) = p ( o0 ) . Similarly , p ( ot+1|τt , at ) is decided by the transition function and is the same for all containers . So we have p ( ot+1|τt , at , id ) = p ( ot+1|τt , at ) . It follows that I ( τ , id ) = Eτ , id [ ∑ t log p ( at|τt , id ) p ( at|τt ) ] . ( 4 ) However , p ( at|τt , id ) is typically a distribution induced by -greedy , distinguishing only the action with the highest probability and concealing most information about value functions . Therefore , we use the Boltzmann SoftMax distribution of local Q values to replace p ( at|τt , id ) and optimize a lower bound of Eq . 4 : I ( τ , id ) ≥ Eτ , id [ ∑ t log πid ( at|τt ) p ( at|τt ) ] , ( 5 ) where πid ( at|τt ) = Πni=1πiid ( ait|τ it ) . The inequality holds because DKL [ πid ( at|τt ) ‖p ( at|τt , id ) ] is non-negative . We approximate p ( at|τt ) = Πni=1pi ( ait|τ it ) by p ( at|τt ) ≈ Πni=1 ( 1N ∑N j=1 πj ( a i t|τ it ) ) , where N is the number of containers . Then we get the lower bound of Eq . 4 to optimize : I ( τ , id ) ≥ Eτ , id [ ∑ t n∑ i=1 log πid ( a i t|τ it ) 1 N ∑N j=1 πj ( a i t|τ it ) ] ( 6 ) = Eτ , id ∑ t n∑ i=1 DKL πid ( ·|τ it ) ‖ 1N N∑ j=1 πj ( ·|τ it ) ( 7 ) In practice , we minimize the following loss for training the learner of the id-th container : L ( θi ; B ) = LTD ( θi ) + β 1 |B| ∑ τ∈B ∑ t n∑ i=1 DKL πid ( ·|τ it ) ‖ 1N N∑ j=1 πj ( ·|τ it ) − λ 2 ( 8 ) where θi is the parameters of the container Q-function , β is a scaling factor , and λ is a factor controlling the value of the KL divergence . To balance diversity and learning sharing , we split agent network in containers into two parts . The lower two layers are shared among the global learner and all containers . Training data is sampled from the global buffer , and weights are periodically copied to the containers every tglobal_update_time seconds to avoid frequent transfer and unstable learning in containers . The last layer differs in each container and is updated locally , which enables containers to act differently under the same observation . | This paper introduces a new distributed value-based multi-agent reinforcement learning framework to solve problems faced by multi-agent tasks. It divides the system into two parts, multiple containers, and one centralizer. Containers are trained with trajectories generated by their own actors interacting with the environment. In contrast, the centralizer is trained with high-priority samples sent by all containers, easing the demanding data transfer. Besides, this paper designs a multi-queue manager between actors and replay buffer to avoid inter-process communication blocking. Furthermore, this paper proposes a new loss function encouraging different containers to be diversified to promote exploration. Finally, it achieves better results on both Google Research Football and StarCraft II micromanagement benchmark. | SP:1585c85c36d252c0d9f3d321a7ae59f12ea60dbd |
Containerized Distributed Value-Based Multi-Agent Reinforcement Learning | 1 INTRODUCTION . Deep reinforcement learning ( DRL ) has been proved effective in various complex domains , including the game of Go ( Silver et al. , 2017 ) , Dota ( OpenAI , 2018 ) , and StarCraft II ( Vinyals et al. , 2017 ) . However , as problems increase in scale , the training of DRL models is increasingly timeconsuming ( Mnih et al. , 2016 ) , which is partly because complex tasks typically require large amounts of training samples . Distributed learning provides a promising direction to significantly reduce training costs by allowing the RL learner to effectively leverage massive experience collected by a large number of actors interacting with different environment instances . Compared to its single-agent counterparts , multi-agent tasks involve more learning agents and a larger search space consists of joint action-observation history . Therefore , multi-agent reinforcement learning ( MARL ) typically requires more samples ( Kurach et al. , 2020 ) and is more time-consuming . However , most of the impressive progress achieved by distributed DRL focuses on the single-agent setting and leaves the efficient training of MARL algorithms largely unstudied . To makeup for this shortage , in this paper , we study distributed value-based multi-agent reinforcement learning . We first pinpoint three unique challenges posed by the increasing number of agents in multi-agent settings listed as follows . ( 1 ) Demanding data transfer . Coming with the increased number of agents is a larger volume of experience – modern MARL algorithms typically require local observation history of all agents apart from global states . If we deploy environments on CPUs like state-of-the-art single-agent distributed DRL algorithms ( Espeholt et al. , 2019 ) , the data transfer between CPUs and GPUs will consume significant CPU computation utility . ( 2 ) Inter-process communication . Inter-process communication between environments , buffers , and learners is more likely to block in multi-agent settings . This is because the experience volume is large and reading/rewriting becomes more time-consuming . ( 3 ) Exploration . The search space of multi-agent problems grows exponentially with the number of agents . Learning performance of MARL algorithms largely rely on efficient exploration in such a large space . In this paper , we propose a containerized distributed value-based multi-agent reinforcement learning framework ( CMARL ) to address these problems . We pack several actors interacting with environments , a local learner , a local buffer , and a carefully designed multi-queue manager into a container . A container interacts with its environment instances , collects data , avoids block via its multi-queue manager , and actively updates its local policy . Data with high priority is transferred to a global learner that brings together the most talented and valuable experience to train the target policy . We further share the parameters of shallow layers for local and global learners to accelerate training while encouraging deep layers of local learners to be as diverse as possible to improve exploration . The advantages of the CMARL framework are as follows . ( 1 ) A container can be deployed on either CPUs or a GPU , making our method scalable and adaptive with the available computational resources . ( 2 ) Largely reduced data transfer . Data collection and prioritization happens within the container , and only highly prioritized data is transferred . ( 3 ) Multi-queue managers work asynchronously from policy learning , enabling efficient and unblocked inter-process communication when data collection . ( 4 ) Diverse behavior enables efficient exploration in the large search space . In this way , CMARL makes a scalable , time-efficient , and diverse distributed MARL framework with high system throughput . We empirically evaluate the performance of our architecture on both Google Research Football ( Kurach et al. , 2020 ) and StarCraft II micromanagement challenges ( Samvelyan et al. , 2019 ) . Our method is the only algorithm that can obtain a positive goal difference on the three GRF tasks , and is the first algorithm which can solve the challenging 5_v_5 full game . On the SMAC benchmark , our method obtains 4-18× better results compared against state-of-the-art non-distributed MARL algorithms . 2 METHODS . In this section , we present our novel containerized framework ( Fig . 1 ) for distributed MARL . We consider fully cooperative multi-agent tasks that can be modelled as a Dec-POMDP ( Oliehoek et al. , 2016 ) consisting of a tuple G=〈I , S , A , P , R , Ω , O , n , γ〉 , where I is the finite set of n agents , γ ∈ [ 0 , 1 ) is the discount factor , and s ∈ S is the true state of the environment . At each timestep , each agent i receives an observation oi ∈ Ω drawn according to the observation function O ( s , i ) and selects an action ai ∈ A , forming a joint action a ∈ An , leading to a next state s′ according to the transition function p ( s′|s , a ) , and observing a reward r = R ( s , a ) shared by all agents . Each agent has local action-observation history τi ∈ T ≡ ( Ω×A ) ∗ . Distributed deep reinforcement learning aims to provide a scalable and time-efficient computational framework . In the multi-agent setting , distributed RL encounters unique challenges . ( 1 ) The experience of MARL agents typically consists of local observations , and actions of all agents . Moreover , the centralized training with decentralized execution paradigm ( Foerster et al. , 2017 ; Rashid et al. , 2018 ) requires global states that contain information of all agents . Therefore , the size of experience grows quadratically with the number of agents . Consequently , transferring experience across different devices is very consuming , leading to a very high CPU usage . Meanwhile , large volume experience may also cause block in inter-process communication . In order to reduce such overhead , we pack several actors and environments into one container and design a multi-queue manager to avoid blocking . The container only sends a portion of experience to the centralized learner , and the centralized learner learns a global policy from these experiences . The whole architecture consists of several containers and one centralized learner . ( 2 ) Another challenge of multi-agent reinforcement learning is that the action-observation space grows exponentially with the number of agents , posing a great challenge to exploration . Multiple containers allow us to do diverse exploration in a way that each container learns an individual policy different from others and uses that policy to explore . Therefore , the proposed containerized framework ( Fig . 1 ) holds the promise to solve these unique challenges of distributed multi-agent reinforcement learning . However , to realize this goal , many structural details need to be designed for each framework component , including the container , the centralized learner , and the training scheme . We now describe them in greater detail . 2.1 CONTAINER . Inside each container , there are k actors interacting with k environment instances to collect experience , one container buffer storing experience , and one container learner training the container policy with batches of trajectories sampled from the local buffer . A critical design consideration of a successful distributed reinforcement learning framework is the uninterrupted learning of learners . To this end , we need to constantly sample batches from the container buffer . Meanwhile , the buffer needs to update itself with new experience constantly . In order to well manage these two operations and avoid read/write conflicts , we introduce a buffer manager , which is the only process controlling the buffer . The buffer manager repeatedly inserts new experience and samples batches . Directly sending new experience from actors to the buffer manager has two shortcomings . ( 1 ) The new experience would be stacked in the multi-process data-transfer queue when the buffer manager is sampling . In this case , actors have to wait , without collecting new trajectories until the buffer finishes sampling . Consequently , experience collection is slowed down . ( 2 ) Receiving trajectories one by one is slower than receiving trajectories in a batch . Moreover , receiving and inserting new experience frequently increases the waiting time between batch sampling . As sampling has to wait , the container learner has to wait when there is no batch to train . These two shortcomings become particularly problematic in multi-agent settings as trajectories consume more space in the multi-process data-transfer queue . In order to tackle these issues , we introduce a multi-queue manager . There is a shared signal between the multi-queue and the buffer manager . The multi-queue manager constantly gathers new experience together unless the signal indicates that the buffer manager requires new batches . When the signal is set , the multi-queue manager compacts all new experience it has gathered to a batch and send them to the buffer manager . Since we use prioritized experience replay , this batch goes through an initial priority calculator before the buffer manager where its priority is calculated . The priority of one trajectory is computed by pτ = Normalize ( ∑ t rt ) + , where Normalize ( X ) = X−L H−L , andL , H are the lower and upper bound of the sum of rewards in a whole trajectory , respectively . is a small constant that avoids a zero probability during sampling . 2.2 CENTRALIZER . The centralizer has an architecture similar to the container ( Fig . 1 ) , except that new experience comes from containers rather than actors . After containers ’ initial priority calculator receive a batch of new experience and compute their priority , containers will send η % of the experience to the centralizer ’ s experience receiver . Transferred experience is sampled with a probability proportional to the priority . Here , η is a real number between 0 and 100 , indicating the fraction of experience to be sent to the centralized learner . Although our architecture can be combined with any value-based MARL algorithms , in this paper , we use QMIX ( Rashid et al. , 2018 ) as the underlying algorithm . The centralized learner updates a QMIX network . Specifically , agents share a three-layer local Q-network , with a GRU ( Cho et al. , 2014 ) between two fully-connected layers , and the global Q value Qθ ( τ , a ) , parameterized by θ , is learned as a monotonic combination of local Q values . The centralized learner is updated by the following TD loss : LTD ( θ ) = EB∼Dcen [ ∑ τ∈B ∑Tτ−1 t=0 [ Qθ ( τt , at ) − ( rt + γmaxaQθ′ ( st+1 , a ) ) ] 2∑ τ∈B Tτ ] ( 1 ) where Tτ is the length of trajectory τ , Dcen is the centralized buffer , the expectation means that batches are sampled from Dcen according to the priority of trajectories , and θ′ is parameters of a target network copied from θ every C Q-network updates . 2.3 ENCOURAGING DIVERSITY AMONG CONTAINERS . Using multiple containers to interact with the environment leads to more time-efficient experience collection . Training will be boosted in large exploration spaces posed by multi-agent tasks when the collected experience is diverse . Such diversity can be achieved by letting containers act and explore differently from each other . In our architecture , containers maintain a Q-network with the same architecture as the centralized learner . Although the architecture is the same , container Q-networks are learned individually and encouraged to be different . To explicitly encourage diversity among containers , in addition to the local TD loss , every container includes a diversity objective in the loss function to maximize the mutual information between container id and its local experience I ( τ , id ) = Eτ , id [ log p ( τ |id ) p ( τ ) ] . ( 2 ) We expand the mutual information as follows : I ( τ , id ) = Eτ , id [ log p ( o0|id ) p ( o0 ) + ∑ t log p ( at|τt , id ) p ( at|τt ) + ∑ t log p ( ot+1|τt , at , id ) p ( ot+1|τt , at ) ] ( 3 ) Here , o0 is the initial observation , and its distribution is independent of container id . Therefore , p ( o0|id ) = p ( o0 ) . Similarly , p ( ot+1|τt , at ) is decided by the transition function and is the same for all containers . So we have p ( ot+1|τt , at , id ) = p ( ot+1|τt , at ) . It follows that I ( τ , id ) = Eτ , id [ ∑ t log p ( at|τt , id ) p ( at|τt ) ] . ( 4 ) However , p ( at|τt , id ) is typically a distribution induced by -greedy , distinguishing only the action with the highest probability and concealing most information about value functions . Therefore , we use the Boltzmann SoftMax distribution of local Q values to replace p ( at|τt , id ) and optimize a lower bound of Eq . 4 : I ( τ , id ) ≥ Eτ , id [ ∑ t log πid ( at|τt ) p ( at|τt ) ] , ( 5 ) where πid ( at|τt ) = Πni=1πiid ( ait|τ it ) . The inequality holds because DKL [ πid ( at|τt ) ‖p ( at|τt , id ) ] is non-negative . We approximate p ( at|τt ) = Πni=1pi ( ait|τ it ) by p ( at|τt ) ≈ Πni=1 ( 1N ∑N j=1 πj ( a i t|τ it ) ) , where N is the number of containers . Then we get the lower bound of Eq . 4 to optimize : I ( τ , id ) ≥ Eτ , id [ ∑ t n∑ i=1 log πid ( a i t|τ it ) 1 N ∑N j=1 πj ( a i t|τ it ) ] ( 6 ) = Eτ , id ∑ t n∑ i=1 DKL πid ( ·|τ it ) ‖ 1N N∑ j=1 πj ( ·|τ it ) ( 7 ) In practice , we minimize the following loss for training the learner of the id-th container : L ( θi ; B ) = LTD ( θi ) + β 1 |B| ∑ τ∈B ∑ t n∑ i=1 DKL πid ( ·|τ it ) ‖ 1N N∑ j=1 πj ( ·|τ it ) − λ 2 ( 8 ) where θi is the parameters of the container Q-function , β is a scaling factor , and λ is a factor controlling the value of the KL divergence . To balance diversity and learning sharing , we split agent network in containers into two parts . The lower two layers are shared among the global learner and all containers . Training data is sampled from the global buffer , and weights are periodically copied to the containers every tglobal_update_time seconds to avoid frequent transfer and unstable learning in containers . The last layer differs in each container and is updated locally , which enables containers to act differently under the same observation . | This paper focuses on an interesting and important question: how to perform distributed multi-agent deep reinforcement learning? The author first proposed three challenges to be considered: 1) Demanding data transfer. 2) Inter-process communication. 3) Effective Exploration. Further, the author proposed a container-based distributed marl framework, by placing the part that interacts with the environment in the container relieves the pressure of the cpu, and at the same time encourages different containers to have different policies and uses PER to select high-value samples, thereby improving training efficiency. | SP:1585c85c36d252c0d9f3d321a7ae59f12ea60dbd |
A Generalised Inverse Reinforcement Learning Framework | 1 INTRODUCTION . Modelling the behaviours of rational agents is a long active research topic . From early attempts to decompose human and animal locomotion Muybridge ( 1979 ) to more recent approaches to simulate human movements Li & Todorov ( 2006 ) ; Mombaur ( 2009 ) ; Schultz & Mombaur ( 2009 ) , the common thread is an underlying assumption that the agents are acting according to some stationary policies . To rationalise these behaviours , it is natural to assume that they are optimal with respect to some objective function ( there are evidences to back this assumption in the case of animal conditioned learning Schmajuk & Zanutto ( 1997 ) ; Verschure & Althaus ( 2003 ) ; Maia ( 2010 ) ; Verschure et al . ( 2014 ) ) . The global objective of Inverse Reinforcement Learning ( IRL ) is inferring such objective function given measurements of the rational agent ’ s behaviour , its sensory inputs and a model of the environment Russell ( 1998 ) . IRL builds upon the standard Reinforcement Learning ( RL ) formulation , where the goal is to find the policy that minimises discounted cumulative costs of some Markov Decision Process Puterman ( 2014 ) . It aims at finding cost functions for which the observed behaviour is “ approximately optimal ” . However this simplistic formulation admits degenerate solutions Abbeel & Ng ( 2004 ) . This led to a series of innovative reformulations to lift this indeterminacy by favouring costs for which the observed behaviour is particularly better than alternative ones , namely maximum margin IRL Ratliff et al . ( 2006 ) and maximum entropy IRL Ziebart et al . ( 2008 ; 2010 ) . The latter formulation ended up as the building block of recent breakthroughs , with both tractable and highly performing algorithms Finn et al . ( 2016 ) ; Ho & Ermon ( 2016 ) ; Fu et al . ( 2017 ) . These improvements provided the ground for multiple practical real-life applications Ziebart et al . ( 2008 ) ; Bougrain et al . ( 2012 ) ; Sharifzadeh et al . ( 2016 ) ; Jarboui et al . ( 2019 ) ; Martinez-Gil et al . ( 2020 ) . We propose an orthogonal improvement to this literature . We question the very pertinence of characterising optimality w.r.t . the cumulative discounted costs as it induces a bias against policies with longer mixing times . We propose an extension of this criterion to alleviate this issue . From this novel objective , we derive reformulations for both the RL and IRL problems . We discuss the ability of existing RL algorithms to solve this new formulation and we generalise existing IRL algorithms to solve the problem under the new criterion . We back up our proposition with empirical evidence of improved performances in multiple OpenAI gym environments . 2 GENERALISED OPTIMALITY CRITERION . In this section , we introduce the classical settings of RL and IRL , as well as the new generalised settings we introduce to alleviate some inherent biases of current methods . 2.1 A CLASSICAL RL SETTING . Consider an infinite horizon Markov Decision Process ( MDP ) M = { S , A , P , c , γ , p0 } , where : – S is either a finite or a compact subset of Rd , for some dimension d ∈ N – A is either a finite or a compact subset of Rd′ , for d′ ∈ N – P is the state transition kernel , i.e. , a continuous mapping from S × A to ∆ ( S ) , where ∆ ( · ) denotes the set of probability measures1 over some set , – c : S ×A → R is a continuous non-negative cost function , – p0 ∈ ∆ ( S ) is the initial state distribution , and γ ∈ ( 0 , 1 ) is the discount factor . A policy π is a mapping indicating , at each time step t ∈ N , the action at to be chosen at the current state st ; it could depend on the whole past history of states/actions/rewards but it is well known that one can focus solely , at least under mild assumptions , on stationary policies π : S → ∆ ( A ) . The choice of a policy π , along with a kernel P and the initial probability p0 , generates a unique probability distribution over the sequences of states denoted by Pπ ( the solution to the forward Chapman–Kolmogorov equation ) . The expected cumulative discounted cost of this policy , in the MDP M is consequently equal to Ep0 , π [ ∑ t γ tc ( st , at ) ] = ∫ s0 p0 ( s0 ) ∑∞ t=0 ∫ st , at γtPπ ( st , at|s0 ) c ( st , at ) . Optimal policies are minimisers of this quantity ( existence is ensured under mild assumptions Puterman ( 2014 ) ) . A standard way to compute optimal policies , is to minimise the state-action value mapping defined as : Qcπ ( s , a ) = c ( s , a ) + ∑∞ t=1 ∫ st , at γtPπ ( st , at|s ) c ( st , at ) . Indeed , the expected cumulative discounted cost of a policy is the expectation of Q-function against p0 : Ep0 , π [ ∞∑ t=0 γtc ( st , at ) ] = ∫ s0 , a0 p0 ( s0 ) π ( a0|s0 ) Qcπ ( s0 , a0 ) 2.2 A BUILT-IN BIAS IN THE IRL FORMULATION . The problem gets more complicated in Inverse Reinforcement Learning where the objective is to learn an unknown cost function c whose associated optimal policy coincides with a given one πE ( referred to as the “ expert ” policy ) . This problem is unfortunately ill-posed as all policies are optimal w.r.t . a constant cost function Abbeel & Ng ( 2004 ) . In order to lift this indeterminacy , the most used alternative formulation is called maximum entropy inverse reinforcement learning Ziebart et al . ( 2008 ; 2010 ) that aims at finding a cost function c∗ such that the expert policy πE has a relatively small cumulative cost Ep0 , πE [ ∑∞ t=0 γ tc∗ ] while other policies incur a much higher cost . This implicitly boils down to learning an optimal policy ( associated to some learned cost ) that matches the expert ’ s future state occupancy measure ρπE marginalised over the initial state distribution , where ρπ ( s , a|s0 ) = ∑ t γ tPπ ( st = s , at = a|s0 ) . State of the art approaches Ho & Ermon ( 2016 ) ; Fu et al . ( 2017 ) consist , roughly speaking , in a two-step procedure . In the first step , given a cost function ĉ , an ( approximately ) optimal policy π̂ of M̂ ( the MDPM with ĉ for cost function ) , is learned . In the second step , trajectories generated by π̂ are compared to expert ones ( in the sense of ρπ ) ; then ĉ is updated to penalise states unvisited by the expert ( say , by gradient descent over some parameters ) . Obviously , those two steps can be repeated until convergence ( or until the generated and the original data-sets are close enough ) . However , the presence of a discount factor in the definition of ρπ has a huge undesirable effect : the total weight of the states in the far future ( say , after some stage t∗ ) is negligible in the global 1The σ-field is always the Borel one . loss , as it would be of the order of γt ∗ . So trying to match the future state occupancy measure will implicitly favours policies mimicking the behaviour in the short term . As a consequence , this would end up in penalising policies with longer mixing times even if their stationary distribution matches the experts on the long run . This built-in bias is a consequence of solving the reinforcement learning step with policies that optimise the cumulative discounted costs ( minimises the expectation of the Q-functions against p0 ) rather than policies that achieve the Bellman optimality criterion ( minimises the Q-function for any state action pairs ) . Unfortunately , there is no IRL framework solving the problem under the latter assumption . In order to bridge this gap , we introduce a more general optimality criterion for the reinforcement learning step ; it is still defined as the expectation of the Q-function , yet not against p0 as in traditional RL , but against both the initial and the future states distributions . To get some flexibility , we allow the loss to weight present and future states differently by considering a probability distribution η over N. Formally , we define the η-weighted future state measurement distribution : P ηπ ( s+ , a+|s0 ) : = ∞∑ n=0 η ( n ) Pπ ( sn = s+ , an = a+|s0 ) . Using P ηπ , the new criterion is defined as : Eηp0 , π [ Q c π ] : = ∫ s0 p0 ( s0 ) ∫ s+ , a+ P ηπ ( s+ , a+|s0 ) Qcπ ( s+ , a+ ) = Ep0 , π [ ∑ k η ( k ) ∑ t γtct+k ] where ct denotes the cost at the tth observation ( c ( st , at ) ) . Any policy that minimises Eηp0 , π [ Q c π ] will now be referred to as “ η-optimal ” ( w.r.t . the cost function c ) . As mentioned before , the inverse RL problem can be decomposed in two sub-problems , learning approximate optimal strategies ( given a candidate ĉ ) and optimizing over ĉ ( taking into account the expert distribution πE ) . In order to avoid over-fitting when learning optimal policies , the standard way is to regularize the optimization loss Geist et al . ( 2019 ) . As a consequence , we consider any mapping Ω : ∆ ( A ) S → R that is a concave over the space of policies . The associated regularised loss of adopting a policy π given the cost function c is defined as : LηΩ ( π , c ) = E η p0 , π [ Qcπ ] − Ω ( π ) ( 1 ) The generalised RL problem is then defined as : RLηΩ ( c ) : = arg min π LηΩ ( π , c ) ( 2 ) Similarly , in order to learn simpler cost functions Ho & Ermon ( 2016 ) , the optimization loss considered is in turn penalised by a convex ( over the space of cost functions ) regularizer ψ : R ( S×A ) → R. The problem of Generalised ( Maximum Entropy ) Inverse Reinforcement learning , whose objective is to learn an appropriate cost function c , is formally defined as : IRLηψ , Ω ( πE ) : = arg max c min π LηΩ ( π , c ) − L η Ω ( πE , c ) − ψ ( c ) ( 3 ) We emphasise that simply choosing δ0 ( a Dirac mass at 0 ) for the distribution η induces the classical definitions of both the RL and IRL problems Ho & Ermon ( 2016 ) . On the other hand , choosing η = Geom ( γ ) transforms the loss into the expectation of the sum of discounted Q-functions along the trajectory . Hypothetically , there could be other generalisations of discounted cost . However , preserving the compatibility of the Bellman criterion with the proposed generalisation for RL and duality properties for IRL is not trivial ( for example , polynomial decay γtn would break these properties ) . In the following , we prove that the η-optimality framework satisfies both properties . | This paper points out that the classical IRL approach has a tendency to match those occupancy measures that favor short-term behavior. To address this issue, a reformulation is proposed based on GAIL in order to put more emphasis on matching longer-term behavior. Specifically, the main difference is to replace the standard objective (i.e., the expectation of Q function over some initial state distribution) with the expectation of Q function over both the initial and an $\eta$-weighted future state distribution, where $\eta$ is some probability distribution over the support set of nonnegative integers. Built on this formulation, this paper proposes GIRL (and the resulting algorithm MEGAN), which follows the framework of GAIL to learn a policy that matches the $\eta$-weighted variant of occupancy measure of the expert policy. Experimental results on MuJoCo are provided to demonstrate the effectiveness of GIRL. | SP:735cdc64faed0eb28babb286e250fd3fbb8d9047 |
A Generalised Inverse Reinforcement Learning Framework | 1 INTRODUCTION . Modelling the behaviours of rational agents is a long active research topic . From early attempts to decompose human and animal locomotion Muybridge ( 1979 ) to more recent approaches to simulate human movements Li & Todorov ( 2006 ) ; Mombaur ( 2009 ) ; Schultz & Mombaur ( 2009 ) , the common thread is an underlying assumption that the agents are acting according to some stationary policies . To rationalise these behaviours , it is natural to assume that they are optimal with respect to some objective function ( there are evidences to back this assumption in the case of animal conditioned learning Schmajuk & Zanutto ( 1997 ) ; Verschure & Althaus ( 2003 ) ; Maia ( 2010 ) ; Verschure et al . ( 2014 ) ) . The global objective of Inverse Reinforcement Learning ( IRL ) is inferring such objective function given measurements of the rational agent ’ s behaviour , its sensory inputs and a model of the environment Russell ( 1998 ) . IRL builds upon the standard Reinforcement Learning ( RL ) formulation , where the goal is to find the policy that minimises discounted cumulative costs of some Markov Decision Process Puterman ( 2014 ) . It aims at finding cost functions for which the observed behaviour is “ approximately optimal ” . However this simplistic formulation admits degenerate solutions Abbeel & Ng ( 2004 ) . This led to a series of innovative reformulations to lift this indeterminacy by favouring costs for which the observed behaviour is particularly better than alternative ones , namely maximum margin IRL Ratliff et al . ( 2006 ) and maximum entropy IRL Ziebart et al . ( 2008 ; 2010 ) . The latter formulation ended up as the building block of recent breakthroughs , with both tractable and highly performing algorithms Finn et al . ( 2016 ) ; Ho & Ermon ( 2016 ) ; Fu et al . ( 2017 ) . These improvements provided the ground for multiple practical real-life applications Ziebart et al . ( 2008 ) ; Bougrain et al . ( 2012 ) ; Sharifzadeh et al . ( 2016 ) ; Jarboui et al . ( 2019 ) ; Martinez-Gil et al . ( 2020 ) . We propose an orthogonal improvement to this literature . We question the very pertinence of characterising optimality w.r.t . the cumulative discounted costs as it induces a bias against policies with longer mixing times . We propose an extension of this criterion to alleviate this issue . From this novel objective , we derive reformulations for both the RL and IRL problems . We discuss the ability of existing RL algorithms to solve this new formulation and we generalise existing IRL algorithms to solve the problem under the new criterion . We back up our proposition with empirical evidence of improved performances in multiple OpenAI gym environments . 2 GENERALISED OPTIMALITY CRITERION . In this section , we introduce the classical settings of RL and IRL , as well as the new generalised settings we introduce to alleviate some inherent biases of current methods . 2.1 A CLASSICAL RL SETTING . Consider an infinite horizon Markov Decision Process ( MDP ) M = { S , A , P , c , γ , p0 } , where : – S is either a finite or a compact subset of Rd , for some dimension d ∈ N – A is either a finite or a compact subset of Rd′ , for d′ ∈ N – P is the state transition kernel , i.e. , a continuous mapping from S × A to ∆ ( S ) , where ∆ ( · ) denotes the set of probability measures1 over some set , – c : S ×A → R is a continuous non-negative cost function , – p0 ∈ ∆ ( S ) is the initial state distribution , and γ ∈ ( 0 , 1 ) is the discount factor . A policy π is a mapping indicating , at each time step t ∈ N , the action at to be chosen at the current state st ; it could depend on the whole past history of states/actions/rewards but it is well known that one can focus solely , at least under mild assumptions , on stationary policies π : S → ∆ ( A ) . The choice of a policy π , along with a kernel P and the initial probability p0 , generates a unique probability distribution over the sequences of states denoted by Pπ ( the solution to the forward Chapman–Kolmogorov equation ) . The expected cumulative discounted cost of this policy , in the MDP M is consequently equal to Ep0 , π [ ∑ t γ tc ( st , at ) ] = ∫ s0 p0 ( s0 ) ∑∞ t=0 ∫ st , at γtPπ ( st , at|s0 ) c ( st , at ) . Optimal policies are minimisers of this quantity ( existence is ensured under mild assumptions Puterman ( 2014 ) ) . A standard way to compute optimal policies , is to minimise the state-action value mapping defined as : Qcπ ( s , a ) = c ( s , a ) + ∑∞ t=1 ∫ st , at γtPπ ( st , at|s ) c ( st , at ) . Indeed , the expected cumulative discounted cost of a policy is the expectation of Q-function against p0 : Ep0 , π [ ∞∑ t=0 γtc ( st , at ) ] = ∫ s0 , a0 p0 ( s0 ) π ( a0|s0 ) Qcπ ( s0 , a0 ) 2.2 A BUILT-IN BIAS IN THE IRL FORMULATION . The problem gets more complicated in Inverse Reinforcement Learning where the objective is to learn an unknown cost function c whose associated optimal policy coincides with a given one πE ( referred to as the “ expert ” policy ) . This problem is unfortunately ill-posed as all policies are optimal w.r.t . a constant cost function Abbeel & Ng ( 2004 ) . In order to lift this indeterminacy , the most used alternative formulation is called maximum entropy inverse reinforcement learning Ziebart et al . ( 2008 ; 2010 ) that aims at finding a cost function c∗ such that the expert policy πE has a relatively small cumulative cost Ep0 , πE [ ∑∞ t=0 γ tc∗ ] while other policies incur a much higher cost . This implicitly boils down to learning an optimal policy ( associated to some learned cost ) that matches the expert ’ s future state occupancy measure ρπE marginalised over the initial state distribution , where ρπ ( s , a|s0 ) = ∑ t γ tPπ ( st = s , at = a|s0 ) . State of the art approaches Ho & Ermon ( 2016 ) ; Fu et al . ( 2017 ) consist , roughly speaking , in a two-step procedure . In the first step , given a cost function ĉ , an ( approximately ) optimal policy π̂ of M̂ ( the MDPM with ĉ for cost function ) , is learned . In the second step , trajectories generated by π̂ are compared to expert ones ( in the sense of ρπ ) ; then ĉ is updated to penalise states unvisited by the expert ( say , by gradient descent over some parameters ) . Obviously , those two steps can be repeated until convergence ( or until the generated and the original data-sets are close enough ) . However , the presence of a discount factor in the definition of ρπ has a huge undesirable effect : the total weight of the states in the far future ( say , after some stage t∗ ) is negligible in the global 1The σ-field is always the Borel one . loss , as it would be of the order of γt ∗ . So trying to match the future state occupancy measure will implicitly favours policies mimicking the behaviour in the short term . As a consequence , this would end up in penalising policies with longer mixing times even if their stationary distribution matches the experts on the long run . This built-in bias is a consequence of solving the reinforcement learning step with policies that optimise the cumulative discounted costs ( minimises the expectation of the Q-functions against p0 ) rather than policies that achieve the Bellman optimality criterion ( minimises the Q-function for any state action pairs ) . Unfortunately , there is no IRL framework solving the problem under the latter assumption . In order to bridge this gap , we introduce a more general optimality criterion for the reinforcement learning step ; it is still defined as the expectation of the Q-function , yet not against p0 as in traditional RL , but against both the initial and the future states distributions . To get some flexibility , we allow the loss to weight present and future states differently by considering a probability distribution η over N. Formally , we define the η-weighted future state measurement distribution : P ηπ ( s+ , a+|s0 ) : = ∞∑ n=0 η ( n ) Pπ ( sn = s+ , an = a+|s0 ) . Using P ηπ , the new criterion is defined as : Eηp0 , π [ Q c π ] : = ∫ s0 p0 ( s0 ) ∫ s+ , a+ P ηπ ( s+ , a+|s0 ) Qcπ ( s+ , a+ ) = Ep0 , π [ ∑ k η ( k ) ∑ t γtct+k ] where ct denotes the cost at the tth observation ( c ( st , at ) ) . Any policy that minimises Eηp0 , π [ Q c π ] will now be referred to as “ η-optimal ” ( w.r.t . the cost function c ) . As mentioned before , the inverse RL problem can be decomposed in two sub-problems , learning approximate optimal strategies ( given a candidate ĉ ) and optimizing over ĉ ( taking into account the expert distribution πE ) . In order to avoid over-fitting when learning optimal policies , the standard way is to regularize the optimization loss Geist et al . ( 2019 ) . As a consequence , we consider any mapping Ω : ∆ ( A ) S → R that is a concave over the space of policies . The associated regularised loss of adopting a policy π given the cost function c is defined as : LηΩ ( π , c ) = E η p0 , π [ Qcπ ] − Ω ( π ) ( 1 ) The generalised RL problem is then defined as : RLηΩ ( c ) : = arg min π LηΩ ( π , c ) ( 2 ) Similarly , in order to learn simpler cost functions Ho & Ermon ( 2016 ) , the optimization loss considered is in turn penalised by a convex ( over the space of cost functions ) regularizer ψ : R ( S×A ) → R. The problem of Generalised ( Maximum Entropy ) Inverse Reinforcement learning , whose objective is to learn an appropriate cost function c , is formally defined as : IRLηψ , Ω ( πE ) : = arg max c min π LηΩ ( π , c ) − L η Ω ( πE , c ) − ψ ( c ) ( 3 ) We emphasise that simply choosing δ0 ( a Dirac mass at 0 ) for the distribution η induces the classical definitions of both the RL and IRL problems Ho & Ermon ( 2016 ) . On the other hand , choosing η = Geom ( γ ) transforms the loss into the expectation of the sum of discounted Q-functions along the trajectory . Hypothetically , there could be other generalisations of discounted cost . However , preserving the compatibility of the Bellman criterion with the proposed generalisation for RL and duality properties for IRL is not trivial ( for example , polynomial decay γtn would break these properties ) . In the following , we prove that the η-optimality framework satisfies both properties . | The paper proposes a new formulation for inverse reinforcement learning that aims to address the _bias against policies with longer mixing times_. The key contribution of the paper is the proposal of an alternative optimality criterion that arguably addresses the aforementioned bias by considering, for a given policy, the value $L(\pi,c)=E_{p_0,\pi}\left[\sum_{k=0}^\infty\eta(k)\sum_{t=0}^\infty\gamma^tc_{t+k}\right]$ instead of the more standard definition $L(\pi,c)=E_{p_0,\pi}\left[\sum_{t=0}^\infty\gamma^tc_{t}\right],$ where $c$ is such that $E[c_t\mid s_t,a_t]=c(s_t,a_t)$. To solve the IRL problem associated with this new optimality criterion (or, rather, a regularized version thereof) the paper proposes the use of maximum causal entropy IRL, which can roughly be broken down in two subproblems: - Given a candidate cost function, $\hat{c}$, find a candidate policy, $\hat{\pi}$, that minimizes $L(\hat{\pi},\hat{c})$. In a sense, $\hat{\pi}$ is the "optimal" policy given the cost function $\hat{c}$. The paper proposes the use of soft actor-critic approach (although other value-based approaches could be used). - Given the expert policy, $\pi_E$, and the candidate policy, $\hat{\pi}$, come up with a candidate cost function $\hat{c}$ such that the expert policy has a low cost and other policies have a high cost, which the paper shows that can be done by minimizing a measure of divergence between the (weighted) distributions induced by $\hat{\pi}$ and $\pi_E$. The resulting algorithm is a variation of the generative adversarial IRL approach of Ho and Ermon, that the experiments suggest may be able to better recover the expert's policy. | SP:735cdc64faed0eb28babb286e250fd3fbb8d9047 |
Sharper Utility Bounds for Differentially Private Models | ) high probability excess population risk bound for differentially private al- gorithms under the assumptions G-Lipschitz , L-smooth , and Polyak-Łojasiewicz condition , based on gradient perturbation method . If we replace the properties G-Lipschitz and L-smooth by α-Hölder smoothness ( which can be used in nonsmooth setting ) , the high probability bound comes to O ( n− 2α 1+2α ) w.r.t n , which can not achieve O ( 1/n ) when α ∈ ( 0 , 1 ] . To solve this problem , we propose a variant of gradient perturbation method , max { 1 , g } -Normalized Gradient Perturbation ( m-NGP ) . We further show that by normalization , the high probability excess population risk bound under assumptions α-Hölder smooth and PolyakŁojasiewicz condition can achieveO ( √p n ) , which is the firstO ( 1/n ) high probability utility bound w.r.t n for differentially private algorithms under non-smooth conditions . Moreover , we evaluate the performance of the new proposed algorithm m-NGP , the experimental results show that m-NGP improves the performance ( measured by accuracy ) of the DP model over real datasets . It demonstrates that m-NGP improves the excess population risk bound and the accuracy of the DP model on real datasets simultaneously . 1 INTRODUCTION . Machine learning has been widely used and found effective in many fields in recent years ( Singha et al. , 2021 ; Swapna & Soman , 2021 ; Ponnusamy et al. , 2021 ) . When training machine learning models , tremendous data was collected , and the data often contains sensitive information of individuals , which may leakage personal privacy ( Shokri et al. , 2017 ; Carlini et al. , 2019 ) . Differential Privacy ( DP ) ( Dwork et al. , 2006 ; Dwork & Lei , 2009 ; Dwork et al. , 2014 ) is a theoretically rigorous tool to prevent sensitive information . It introduces random noise to the machine learning model and blocks adversaries from inferring any single individual included in the dataset by observing the model . The mathematical definition of DP is well accepted and relative technologies are performed by Google ( Erlingsson et al. , 2014 ) , Apple ( McMillan , 2016 ) and Microsoft ( Ding et al. , 2017 ) . As such , DP has attracted attention from the researchers and has been applied to numerous machine learning problems ( Ullman & Sealfon , 2019 ; Xu et al. , 2019 ; Bernstein & Sheldon , 2019 ; Wang & Xu , 2019 ; Heikkilä et al. , 2019 ; Kulkarni et al. , 2021 ; Bun et al. , 2021 ; Nguyen & Vullikanti , 2021 ) . There are mainly three approaches to guarantee differential privacy : output perturbation ( Chaudhuri et al. , 2011 ) , objective perturbation ( Chaudhuri et al. , 2011 ) , and gradient perturbation ( Song et al. , 2013 ) . Considering that gradient descent is a widely used optimization method , the gradient perturbation method can be used for a wide range of applications , and adding random noise to the gradient allows the model to escape local minima ( Raginsky et al. , 2017 ) , we focus on the gradient perturbation method to guarantee DP in this paper . In this paper , we aim to minimize the population risk , and measure the utility of the DP model by the excess population risk . To get the excess population risk , an important step is to analyze the generalization error ( the reason is demonstrated in Section 3 ) . Complexity theory ( Bartlett et al. , 2002 ) and algorithm stability theory ( Bousquet & Elisseeff , 2002 ) are popular tools to analyze the generalization error . On one hand , Chaudhuri et al . ( 2011 ) applied the complexity theory and achieved an O ( max { 1√ n , 2/3 √ p n } ) high probability excess population risk bound under the assumption of strongly convex ; Kifer et al . ( 2012 ) achieved O ( √p n ) expected excess population risk bound via complexity theory . On the other hand , the sharpest known high probability generalization bounds for DP algorithms analyzed via stability theory under different assumptions ( Wu et al. , 2017 ; Bassily et al. , 2019 ; Feldman et al. , 2020 ; Bassily et al. , 2020 ; Wang et al. , 2021 ) are O ( √p n + 1√ n ) or O ( 4√p√ n ) , containing an inevitable O ( 1√ n ) term , which is a bottleneck on the utility analysis . Thus , we are focusing on the following question , which is still an open problem : Can we achieve the high probability excess risk bounds with rate O ( √ p n ) for differentially private models via uniform stability ? This paper answers the question positively under more ( or different ) assumptions and provides the first high probability bound allowing an O ( √p n ) rate of convergence in the setting of DP . By in- troducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , we remove the O ( 1√ n ) term in the generalization error and furthermore improve the high probability excess population risk bound . Comparing with previous high probability bounds , the improvement is approximately up toO ( √ n ) . CONTRIBUTIONS We first prove that by introducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , under the assumptions G-Lipschitz , L-smooth , and Polyak-Łojasiewicz ( PL ) condition , the high probability excess population risk bound can be improved to O ( √p n ) . To the best of our knowledge , this is the first O ( √p n ) high probability excess population risk bound in the field of DP . Then , we relax the assumptions G-Lipschitz and L-smooth , by introducing α-Hölder smooth . Under these assumptions , we prove that the high probability excess population risk bound comes to O ( √p n −2α 1+2α ) . Considering that α ∈ ( 0 , 1 ] , the result can not achieve O ( √p n ) . To overcome the bottleneck , we design a variant of gradient perturbation method , called max { 1 , g } Normalized Gradient Perturbation ( m-NGP ) algorithm . Via this new proposed algorithm , we prove that under the assumptions α-Hölder smooth , PL condition , and generalized Bernstein condition , the high probability excess population risk bound can be improved to O ( √p n ) . To the best of our knowledge , this is the firstO ( √p n ) high probability excess population risk bound for non-smooth loss in the field of DP . Moreover , to evaluate the performance of our proposed max { 1 , g } -Normalized Gradient Perturbation algorithm , we perform experiments on real datasets , the experimental results show that m-NGP method also improves the accuracy of the DP model on real datasets . The rest of the paper is organized as follows . We discuss some related work in Section 2 . Some preliminaries are formally introduced in Section 3 . In Section 4 , we propose sharper utility bounds under different assumptions and design a variant of gradient perturbation method , max { 1 , g } Normalized Gradient Perturbation . The experimental results are shown in Section 5 . Finally , we conclude the paper in Section 6 . 2 RELATED WORK . Dwork et al . ( 2006 ) proposed the mathematical definition of DP for the first time . Then , it was developed to protect the privacy in the field of machine learning ( e.g . Empirical Risk Minimization ( ERM ) ) via output perturbation , objective perturbation , and gradient perturbation methods . For DP-ERM formulations , Chaudhuri et al . ( 2011 ) first proposed output perturbation and objective perturbation methods , and Song et al . ( 2013 ) first proposed the gradient perturbation method . Based on these works , Kifer et al . ( 2012 ) ; Bassily et al . ( 2014 ) ; Abadi et al . ( 2016 ) ; Wang et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Wu et al . ( 2017 ) ; Bassily et al . ( 2019 ) ; Feldman et al . ( 2020 ) ; Bassily et al . ( 2020 ) further improved the results under different assumptions . Among the works mentioned above , some of them only analyzed the privacy guarantees ( Song et al. , 2013 ; Abadi et al. , 2016 ) , some of them only discussed the excess empirical risk bound ( Wang et al. , 2017 ; Zhang et al. , 2017 ; Wu et al. , 2017 ) . Some works discussed the excess population risk under expectation , from different points of view , such as complexity theory , optimization theory , and stability theory : Kifer et al . ( 2012 ) achieved an O ( √p n ) expected excess population risk bound via complexity theory ; Bassily et al . ( 2014 ) achieved similar expected bound under convexity assumption , via optimization theory ; and Wang et al . ( 2019 ) proposed anO ( p log ( n ) 2 ) expected excess pop- ulation risk bound under non-convex condition , via Langevin Dynamics ( Gelfand & Mitter , 1991 ) and the stability of Gibbs algorithm . Considering that the high probability bound is more concerned by researchers , we focus on the high probability utility bound . Meanwhile , we concentrate on the stability theory in this paper . Among many notions of stability , uniform stability is arguably the most popular one , which yields exponential generalization bounds . Via uniform stability , the high probability excess population risk bounds under different assumptions given by previous works all contain anO ( 1√ n ) term , details can be found in Table 1 . The reason is that when analyzing the generalization error , the technical routes followed works Bousquet & Elisseeff ( 2002 ) ; Hardt et al . ( 2016 ) . In this paper , by introducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , we remove the O ( 1√ n ) term from the generalization error , and further improve the excess population risk bound of DP models . The improved convergence rate is up toO ( √p n ) , which positively answers the question : Can the high probability excess population risk bound achieve O ( 1/n ) w.r.t n. The improvements are shown in Table 1 . Table 1 first shows that by adding more assumptions ( we assume the loss function to be Lipschitz , smooth , and satisfy Polyak-Łojasiewicz ( PL ) condition , while previous results require α-Hölder smoothness and convexity ) , we achieve a better high probability excess population risk bound , O ( √p n ) , which is state-of-the-art to the best of our knowledge . Then , we replace the Lipschitz and smooth property by α-Hölder smoothness and achieveO ( √p n 2α 1+2α ) high probability excess population risk bound , when α ∈ [ 12 , 1 ] , our result is better than previous ones , but it can not achieve the same bound ( O ( 1/n ) w.r.t n ) under the condition that the loss function is Lipschitz , smooth , and satisfies PL condition . To overcome it , we propose an algorithm called m-NGP , and achieve the O ( √p n ) result under the same assumptions : α-Hölder smooth and PL condition . Moreover , although it is hard to directly compare PL condition with convexity , PL condition can be applied to many non-convex conditions ( more information can be found in Section 4.2 ) . So , in this paper , we analyze the utility bound of DP algorithm under cases different from previous scenarios . | This paper analyzes the utility bounds of the gradient-perturbation based DP algorithm. They first provide DP by previous result (it is not the key point in this paper). Then, by applying the Generalized Bernstein condition, they give $O(p^{0.5}/(n\epsilon))$ high probability excess population risk bound under the properties Lipschitzness, smoothness, and PL condition. Furthermore, under the more general assumption (Holder smoothness), they analyze the utility bound but the result is not so good as before. So they propose an algorithm (called m-NGP) to improve it under the assumption Holder smooth, and it is claimed that the utility bound can be improved to $O(p^{0.5}/(n\epsilon))$. Their results are sharper than previous analyses in different settings: previous results require convex assumption but this paper requires PL condition. Moreover, experiments are performed to evaluate the accuracy of m-NGP. | SP:1bc5cf890e7e8ff9921c1754e3013df7223caa1d |
Sharper Utility Bounds for Differentially Private Models | ) high probability excess population risk bound for differentially private al- gorithms under the assumptions G-Lipschitz , L-smooth , and Polyak-Łojasiewicz condition , based on gradient perturbation method . If we replace the properties G-Lipschitz and L-smooth by α-Hölder smoothness ( which can be used in nonsmooth setting ) , the high probability bound comes to O ( n− 2α 1+2α ) w.r.t n , which can not achieve O ( 1/n ) when α ∈ ( 0 , 1 ] . To solve this problem , we propose a variant of gradient perturbation method , max { 1 , g } -Normalized Gradient Perturbation ( m-NGP ) . We further show that by normalization , the high probability excess population risk bound under assumptions α-Hölder smooth and PolyakŁojasiewicz condition can achieveO ( √p n ) , which is the firstO ( 1/n ) high probability utility bound w.r.t n for differentially private algorithms under non-smooth conditions . Moreover , we evaluate the performance of the new proposed algorithm m-NGP , the experimental results show that m-NGP improves the performance ( measured by accuracy ) of the DP model over real datasets . It demonstrates that m-NGP improves the excess population risk bound and the accuracy of the DP model on real datasets simultaneously . 1 INTRODUCTION . Machine learning has been widely used and found effective in many fields in recent years ( Singha et al. , 2021 ; Swapna & Soman , 2021 ; Ponnusamy et al. , 2021 ) . When training machine learning models , tremendous data was collected , and the data often contains sensitive information of individuals , which may leakage personal privacy ( Shokri et al. , 2017 ; Carlini et al. , 2019 ) . Differential Privacy ( DP ) ( Dwork et al. , 2006 ; Dwork & Lei , 2009 ; Dwork et al. , 2014 ) is a theoretically rigorous tool to prevent sensitive information . It introduces random noise to the machine learning model and blocks adversaries from inferring any single individual included in the dataset by observing the model . The mathematical definition of DP is well accepted and relative technologies are performed by Google ( Erlingsson et al. , 2014 ) , Apple ( McMillan , 2016 ) and Microsoft ( Ding et al. , 2017 ) . As such , DP has attracted attention from the researchers and has been applied to numerous machine learning problems ( Ullman & Sealfon , 2019 ; Xu et al. , 2019 ; Bernstein & Sheldon , 2019 ; Wang & Xu , 2019 ; Heikkilä et al. , 2019 ; Kulkarni et al. , 2021 ; Bun et al. , 2021 ; Nguyen & Vullikanti , 2021 ) . There are mainly three approaches to guarantee differential privacy : output perturbation ( Chaudhuri et al. , 2011 ) , objective perturbation ( Chaudhuri et al. , 2011 ) , and gradient perturbation ( Song et al. , 2013 ) . Considering that gradient descent is a widely used optimization method , the gradient perturbation method can be used for a wide range of applications , and adding random noise to the gradient allows the model to escape local minima ( Raginsky et al. , 2017 ) , we focus on the gradient perturbation method to guarantee DP in this paper . In this paper , we aim to minimize the population risk , and measure the utility of the DP model by the excess population risk . To get the excess population risk , an important step is to analyze the generalization error ( the reason is demonstrated in Section 3 ) . Complexity theory ( Bartlett et al. , 2002 ) and algorithm stability theory ( Bousquet & Elisseeff , 2002 ) are popular tools to analyze the generalization error . On one hand , Chaudhuri et al . ( 2011 ) applied the complexity theory and achieved an O ( max { 1√ n , 2/3 √ p n } ) high probability excess population risk bound under the assumption of strongly convex ; Kifer et al . ( 2012 ) achieved O ( √p n ) expected excess population risk bound via complexity theory . On the other hand , the sharpest known high probability generalization bounds for DP algorithms analyzed via stability theory under different assumptions ( Wu et al. , 2017 ; Bassily et al. , 2019 ; Feldman et al. , 2020 ; Bassily et al. , 2020 ; Wang et al. , 2021 ) are O ( √p n + 1√ n ) or O ( 4√p√ n ) , containing an inevitable O ( 1√ n ) term , which is a bottleneck on the utility analysis . Thus , we are focusing on the following question , which is still an open problem : Can we achieve the high probability excess risk bounds with rate O ( √ p n ) for differentially private models via uniform stability ? This paper answers the question positively under more ( or different ) assumptions and provides the first high probability bound allowing an O ( √p n ) rate of convergence in the setting of DP . By in- troducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , we remove the O ( 1√ n ) term in the generalization error and furthermore improve the high probability excess population risk bound . Comparing with previous high probability bounds , the improvement is approximately up toO ( √ n ) . CONTRIBUTIONS We first prove that by introducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , under the assumptions G-Lipschitz , L-smooth , and Polyak-Łojasiewicz ( PL ) condition , the high probability excess population risk bound can be improved to O ( √p n ) . To the best of our knowledge , this is the first O ( √p n ) high probability excess population risk bound in the field of DP . Then , we relax the assumptions G-Lipschitz and L-smooth , by introducing α-Hölder smooth . Under these assumptions , we prove that the high probability excess population risk bound comes to O ( √p n −2α 1+2α ) . Considering that α ∈ ( 0 , 1 ] , the result can not achieve O ( √p n ) . To overcome the bottleneck , we design a variant of gradient perturbation method , called max { 1 , g } Normalized Gradient Perturbation ( m-NGP ) algorithm . Via this new proposed algorithm , we prove that under the assumptions α-Hölder smooth , PL condition , and generalized Bernstein condition , the high probability excess population risk bound can be improved to O ( √p n ) . To the best of our knowledge , this is the firstO ( √p n ) high probability excess population risk bound for non-smooth loss in the field of DP . Moreover , to evaluate the performance of our proposed max { 1 , g } -Normalized Gradient Perturbation algorithm , we perform experiments on real datasets , the experimental results show that m-NGP method also improves the accuracy of the DP model on real datasets . The rest of the paper is organized as follows . We discuss some related work in Section 2 . Some preliminaries are formally introduced in Section 3 . In Section 4 , we propose sharper utility bounds under different assumptions and design a variant of gradient perturbation method , max { 1 , g } Normalized Gradient Perturbation . The experimental results are shown in Section 5 . Finally , we conclude the paper in Section 6 . 2 RELATED WORK . Dwork et al . ( 2006 ) proposed the mathematical definition of DP for the first time . Then , it was developed to protect the privacy in the field of machine learning ( e.g . Empirical Risk Minimization ( ERM ) ) via output perturbation , objective perturbation , and gradient perturbation methods . For DP-ERM formulations , Chaudhuri et al . ( 2011 ) first proposed output perturbation and objective perturbation methods , and Song et al . ( 2013 ) first proposed the gradient perturbation method . Based on these works , Kifer et al . ( 2012 ) ; Bassily et al . ( 2014 ) ; Abadi et al . ( 2016 ) ; Wang et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Wu et al . ( 2017 ) ; Bassily et al . ( 2019 ) ; Feldman et al . ( 2020 ) ; Bassily et al . ( 2020 ) further improved the results under different assumptions . Among the works mentioned above , some of them only analyzed the privacy guarantees ( Song et al. , 2013 ; Abadi et al. , 2016 ) , some of them only discussed the excess empirical risk bound ( Wang et al. , 2017 ; Zhang et al. , 2017 ; Wu et al. , 2017 ) . Some works discussed the excess population risk under expectation , from different points of view , such as complexity theory , optimization theory , and stability theory : Kifer et al . ( 2012 ) achieved an O ( √p n ) expected excess population risk bound via complexity theory ; Bassily et al . ( 2014 ) achieved similar expected bound under convexity assumption , via optimization theory ; and Wang et al . ( 2019 ) proposed anO ( p log ( n ) 2 ) expected excess pop- ulation risk bound under non-convex condition , via Langevin Dynamics ( Gelfand & Mitter , 1991 ) and the stability of Gibbs algorithm . Considering that the high probability bound is more concerned by researchers , we focus on the high probability utility bound . Meanwhile , we concentrate on the stability theory in this paper . Among many notions of stability , uniform stability is arguably the most popular one , which yields exponential generalization bounds . Via uniform stability , the high probability excess population risk bounds under different assumptions given by previous works all contain anO ( 1√ n ) term , details can be found in Table 1 . The reason is that when analyzing the generalization error , the technical routes followed works Bousquet & Elisseeff ( 2002 ) ; Hardt et al . ( 2016 ) . In this paper , by introducing Generalized Bernstein condition ( Koltchinskii , 2006 ) , we remove the O ( 1√ n ) term from the generalization error , and further improve the excess population risk bound of DP models . The improved convergence rate is up toO ( √p n ) , which positively answers the question : Can the high probability excess population risk bound achieve O ( 1/n ) w.r.t n. The improvements are shown in Table 1 . Table 1 first shows that by adding more assumptions ( we assume the loss function to be Lipschitz , smooth , and satisfy Polyak-Łojasiewicz ( PL ) condition , while previous results require α-Hölder smoothness and convexity ) , we achieve a better high probability excess population risk bound , O ( √p n ) , which is state-of-the-art to the best of our knowledge . Then , we replace the Lipschitz and smooth property by α-Hölder smoothness and achieveO ( √p n 2α 1+2α ) high probability excess population risk bound , when α ∈ [ 12 , 1 ] , our result is better than previous ones , but it can not achieve the same bound ( O ( 1/n ) w.r.t n ) under the condition that the loss function is Lipschitz , smooth , and satisfies PL condition . To overcome it , we propose an algorithm called m-NGP , and achieve the O ( √p n ) result under the same assumptions : α-Hölder smooth and PL condition . Moreover , although it is hard to directly compare PL condition with convexity , PL condition can be applied to many non-convex conditions ( more information can be found in Section 4.2 ) . So , in this paper , we analyze the utility bound of DP algorithm under cases different from previous scenarios . | The paper achieves high probability excess risk bound with rate O(1/n) w.r.t n for DP models via uniform stability by using Generalized Bernstein condition under G-Lipschitz, L-smooth, and PL condition. Then the authors expand the result to a more general case, only requiring α-Ho ̈lder smoothness, Polyak-Łojasiewicz condition, and generalized Bernstein condition. But the result is worse than before, so in order to get a better result, they propose m-NGP algorithm to achieve O(1/n) high probability bound w.r.t n under α-Ho ̈lder smoothness, Polyak-Łojasiewicz condition, and generalized Bernstein condition. The authors also show the experimental better accuracy results of m-NGP compared to traditional gradient perturbation method on real datasets. | SP:1bc5cf890e7e8ff9921c1754e3013df7223caa1d |
Back to Basics: Efficient Network Compression via IMP | 1 INTRODUCTION . Modern Neural Network architectures are commonly highly over-parameterized ( Zhang et al. , 2016 ) , containing millions or even billions of parameters , resulting in both high memory requirements as well as computationally intensive and long training and inference times . It has been shown however ( LeCun et al. , 1989 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; Gale et al. , 2019 ; Lin et al. , 2020 ; Blalock et al. , 2020 ) that modern architectures can be compressed dramatically by pruning , i.e. , removing redundant structures such as individual weights , entire neurons or convolutional filters . The resulting sparse models require only a fraction of storage and floating-point operations ( FLOPs ) for inference , while experiencing little to no degradation in predictive power compared to the dense model . There is of course an inherent tradeoff between sparsity and model performance ; a very heavily pruned model will normally be less performant than its dense ( or moderately pruned ) counterpart , though it has been observed that pruning might have a regularizing effect and be beneficial to the generalization capacities ( Blalock et al. , 2020 ; Hoefler et al. , 2021 ) . One approach to pruning consists of removing part of a network ’ s weights after a standard training process , seemingly losing most of its predictive performance , and then retraining to compensate for that pruning-induced loss . This can be done either once ( One Shot ) , or the process of pruning and retraining can be repeated iteratively until the desired level of sparsity is reached . Although dating back to the early work of Janowsky ( 1989 ) , this approach was most notably proposed by Han et al . ( 2015 ) in the form of ITERATIVE MAGNITUDE PRUNING ( IMP ) . Because it is arguably one of the simplest pruning algorithms , IMP has been widely applied as a baseline comparison for other approaches ( Carreira-Perpiñán & Idelbayev , 2018 ; Ding et al. , 2019 ; Savarese et al. , 2020 ; Siegel et al. , 2020 ; Hoefler et al. , 2021 ) . As such , it is often subject to criticism , with the most commonly made claims arguing against the efficacy of IMP being the following : 1 . ) Inherent to the justification of many proposed alternatives is the claim , that sparsification should be part of the training . Methods of this type reach a sparse model at the end of training , ideally eliminating the need for further training . One desired benefit of doing so , is to improve the sparsity vs. performance tradeoff by reducing the impact of the actual ‘ hard ’ pruning , which results in a “ failure to properly recover the pruned weights ” ( Liu et al. , 2020 ) . It is argued that IMP achieves sub-optimal states since learning the pruning set throughout training “ helps find a better subset and hence prune more weights with no or little loss degradation ” ( Carreira-Perpiñán & Idelbayev , 2018 ) . Another frequently claimed advantage is that incorporating the sparsification into the training cuts down on computational cost by not requiring additional retraining epochs . Ding et al . ( 2019 ) for example advertise that there is “ no need for a time consuming re-training ” and Hoefler et al . ( 2021 ) argue that `` the sparsify-during-training schedule ( ... ) is usually cheaper than the train-then-sparsify schedule ” . 2 . ) IMP determines a single numerical threshold for pruning and applies it globally to every parameter , potentially resulting in very different levels of sparsity among the layers of the network . This behavior is often considered to be sub-optimal and it is argued that pruning should be layerdependent ( Liu et al. , 2020 ) , so more complex saliency criteria have been proposed ( Gale et al. , 2019 ; Lee et al. , 2020 ) . Kusupati et al . ( 2020 ) for example claim that “ uniform or heuristic nonuniform sparsity budgets ( ... ) have sub-optimal layer-wise parameter allocation resulting in a ) lower prediction accuracy or b ) higher inference cost ( FLOPs ) ” . 3 . ) While only the iterative approach , that is repeatedly removing only a small fraction of the parameters followed by extensive retraining , is said to achieve results on the Pareto frontier ( Renda et al. , 2020 ) , its iterative nature is also considered to be computationally tedious , if not impractical : “ iterative pruning is computationally intensive , requiring training a network 15 or more times consecutively for multiple trials ” ( Frankle & Carbin , 2018 ) , leading Liu et al . ( 2020 ) to trying to “ avoid the expensive pruning and fine-tuning iterations ” . Our interest lies in exploring these claimed disadvantages of IMP through rigorous and consistent computational experimentation with a focus on recent advancements concerning the retraining phase , see the results of Renda et al . ( 2020 ) and Le & Hua ( 2021 ) . This comparative study is in fact intended to complement both of these works , which focused on improving the sparsity-vs.performance tradeoff of IMP through improved learning rate schemes during training , by putting an additional spotlight on the total computational cost of IMP in a direct comparison with methods that are commonly assumed to outperform IMP in that aspect by avoiding retraining . Contributions . We empirically find that , using an appropriate learning rate scheme , only few retraining epochs are needed in practice to achieve most of the sparsity vs. performance tradeoff of IMP . We also find that the global selection criterion not only finds sparsity distributions on par with but , somewhat surprisingly , often better than those of more sophisticated layer-dependent pruning criteria . Finally , we conclude that , using an appropriate learning rate scheme , IMP performs well even when compared to state-of-the-art approaches that incorporate sparsification into the training without or with only little computational overhead . That is , not only can IMP find some of the best performing architectures at any given sparsity level , but due to the compressed retraining time it does so without needing to leverage a longer running time even when compared to methods typically considered to be superior to IMP in that particular aspect . Outline . Section 2 contains a complete overview over related works , including a brief summary of all pruning methods and approaches considered here . In Section 3 we provide the computational results and their interpretation by first addressing how IMP can develop its full potential within a restricted computational envelope in Subsection 3.1 and Subsection 3.2 . We then use the resulting lessons in order to draw up a fair comparison to methods that incorporate pruning into their training in Subsection 3.3 . We conclude with some discussion in Section 4 . 2 OVERVIEW OF PRUNING METHODS AND METHODOLOGY . While the sparsification of Neural Networks includes a wide variety of approaches , we will focus on Model Pruning , i.e. , the removal of redundant structures in a Neural Network . More specifically , our results will be limited to unstructured pruning , that is the removal of individual weights , as opposed to its structured counterpart , where entire groups of elements , such as neurons or convolutional filters , are removed . We will also focus on approaches that start with a dense network and then either prune the network during training or after training as already discussed in the introduction . Following Bartoldson et al . ( 2020 ) , we will also refer to methods of the former category as pruning stable , since the final pruning should result in a negligible decrease in performance , where methods of the latter category are referred to as unstable . For a full and detailed survey of Pruning algorithms we refer the reader to Hoefler et al . ( 2021 ) . Pruning unstable methods are exemplified by ITERATIVE MAGNITUDE PRUNING ( IMP ) ( Han et al. , 2015 ) . In its original form , it first employs standard network training , adding a common ` 2- regularization term on the objective , and then removes all weights from the network whose absolute values are below a certain threshold . The network at this point commonly loses some or even all of its learned predictive power , so it is then retrained for a fixed number of epochs . This prune-retrain cycle is usually repeated a number of times ; the threshold at every pruning step is determined as the appropriate percentile such that , at the end of given number of iterations , a desired target sparsity is met.1 In the following we will first discuss two particular details of IMP that have been the focus of recent research : the questions of ( a ) how to select the parameters to be pruned and ( b ) how to retrain . We will then conclude this section by briefly outlining the pruning stable methods we have selected for this comparison and establish how to fairly compare them to IMP . 2.1 RETRAINING APPROACHES . Let us first consider the learning rate scheme used during retraining . The original approach by Han et al . ( 2015 ) is commonly referred to as FINE TUNING ( FT ) : suppose we train for T epochs using the learning rate schedule ( ηt ) t≤T and retrain for Trt epochs per prune-retrain-cycle , then FT retrains the pruned network for Trt epochs using a fixed constant learning rate , most commonly ηT . It was first noticed by Renda et al . ( 2020 ) that the precise learning rate schedule during retraining can have a dramatic impact on the predictive performance of the pruned network . Motivated by WEIGHT REWINDING ( WR ) ( Frankle et al. , 2019 ) , they proposed LEARNING RATE REWINDING ( LRW ) , where one retrains the pruned network for Trt epochs using the last T − Trt learning rates ηT−Trt+1 , . . . , ηT . Le & Hua ( 2021 ) argued that the reason behind the success of LRW is the usage of large learning rates and proposed SCALED LEARNING RATE RESTARTING ( SLR ) , where the pruned network is retrained using a proportionally identical learning schedule , i.e. , by compressing ( ηt ) t≤T into the retraining time frame of Trt epochs with a short warm-up phase . They also introduced CYCLIC LEARNING RATE RESTARTING ( CLR ) based on the the 1-cycle learning rate schedule of Smith & Topin ( 2017 ) . We think that the nature of the proposed retraining methods indicates that the retraining phase is , at its core , similar to the usual training phase . Following this rationale , the success of LRW , SLR and CLR over FT should be attributed to the existence of both a large- and small-step retraining regime . In fact , a large initial and exponentially decaying learning rate has become the standard practice for regular training ( Leclerc & Madry , 2020 ) . Note that such a scheme is employed not just by SLR and CLR , but also by LRW if Trt is sufficiently large to model the decaying learning rate schedule of the original training phase . The conventional approach to explaining the success of decaying learning rate schedules comes from an optimization perspective , i.e. , an initially large learning rate accelerates training and avoids local minima , while the gradual decay helps to converge to an optimum without oscillation around it . However , an active line of research has theoretically supported the usage of large learning rates and separating training into a large- and small-step regime from a generalization perspective ( Jastrzębski et al. , 2017 ; Li et al. , 2019 ; You et al. , 2019 ; Leclerc & Madry , 2020 ) . Put more succinctly : retraining is training and therefore requires that some effort is put into tuning the learning rate scheme . LRW , SLR and CLR provide some good heuristic guidance for how to effectively do so without an insurmountable amount of hyperparameter tuning . While One Shot IMP , that is IMP with a single prune-retrain cycle , is a viable approach to model pruning , only the iterative approach ( with multiple prune-retrain cycles ) has been shown to achieve 1There is another way to view this relation : one can fix a given percentile to be pruned in every iteration and then simply repeat the prune-retrain cycle until either a desired level of sparsity is reached or the performance degradation exceeds a given threshold . This is in fact how it appears to be used by Han et al . ( 2015 ) and how it is for example presented by Renda et al . ( 2020 ) . While this reframing may appear trivial , it in fact highlights a strength of IMP that we will further emphasize when contrasting it with pruning stable approaches . state-of-the-art accuracy-vs.-sparsity tradeoffs ( Han et al. , 2015 ; Renda et al. , 2020 ) . This iterative approach however commonly consists of a significant amount of prune-retrain cycles , each needing the full original training time , that is T = Trt , resulting in several thousand epochs worth of total training time . Renda et al . ( 2020 ) for example suggested the following approach : train a network for T epochs and then iteratively prune 20 % percent of the weights and retrain for Trt = T epochs using LRW , i.e. , use the same learning rate scheme as during training , until the desired sparsity is reached . We note that for T = Trt the learning rate scheme of SLR becomes essentially identical to that of LRW . For a goal sparsity of 98 % and T = 200 original training epochs , the algorithm would therefore require 18 prune-retrain-cycles for a massive 3800 total retrain epochs . In Subsection 3.1 we will study the effect of the number of prune-retrain cycles , the number of retraining epochs and the learning rate scheme on the performance of the pruned network to establish whether IMP truly requires this massive amount of computational investment to develop its full potential . | The paper studies a fundamental and important research approach in network pruning: iterative magnitude pruning (IMP). Previously IMP is criticized to be time-consuming, layer-independent and sub-optimal in performance. In this paper, extensive empirical studies are conducted to show that under proper learning rates, IMP can have close performance with more advanced pruning approaches, with little training time increased. | SP:6afe8cd7741417913dd2ccef7cb4feccd5a592ef |
Back to Basics: Efficient Network Compression via IMP | 1 INTRODUCTION . Modern Neural Network architectures are commonly highly over-parameterized ( Zhang et al. , 2016 ) , containing millions or even billions of parameters , resulting in both high memory requirements as well as computationally intensive and long training and inference times . It has been shown however ( LeCun et al. , 1989 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; Gale et al. , 2019 ; Lin et al. , 2020 ; Blalock et al. , 2020 ) that modern architectures can be compressed dramatically by pruning , i.e. , removing redundant structures such as individual weights , entire neurons or convolutional filters . The resulting sparse models require only a fraction of storage and floating-point operations ( FLOPs ) for inference , while experiencing little to no degradation in predictive power compared to the dense model . There is of course an inherent tradeoff between sparsity and model performance ; a very heavily pruned model will normally be less performant than its dense ( or moderately pruned ) counterpart , though it has been observed that pruning might have a regularizing effect and be beneficial to the generalization capacities ( Blalock et al. , 2020 ; Hoefler et al. , 2021 ) . One approach to pruning consists of removing part of a network ’ s weights after a standard training process , seemingly losing most of its predictive performance , and then retraining to compensate for that pruning-induced loss . This can be done either once ( One Shot ) , or the process of pruning and retraining can be repeated iteratively until the desired level of sparsity is reached . Although dating back to the early work of Janowsky ( 1989 ) , this approach was most notably proposed by Han et al . ( 2015 ) in the form of ITERATIVE MAGNITUDE PRUNING ( IMP ) . Because it is arguably one of the simplest pruning algorithms , IMP has been widely applied as a baseline comparison for other approaches ( Carreira-Perpiñán & Idelbayev , 2018 ; Ding et al. , 2019 ; Savarese et al. , 2020 ; Siegel et al. , 2020 ; Hoefler et al. , 2021 ) . As such , it is often subject to criticism , with the most commonly made claims arguing against the efficacy of IMP being the following : 1 . ) Inherent to the justification of many proposed alternatives is the claim , that sparsification should be part of the training . Methods of this type reach a sparse model at the end of training , ideally eliminating the need for further training . One desired benefit of doing so , is to improve the sparsity vs. performance tradeoff by reducing the impact of the actual ‘ hard ’ pruning , which results in a “ failure to properly recover the pruned weights ” ( Liu et al. , 2020 ) . It is argued that IMP achieves sub-optimal states since learning the pruning set throughout training “ helps find a better subset and hence prune more weights with no or little loss degradation ” ( Carreira-Perpiñán & Idelbayev , 2018 ) . Another frequently claimed advantage is that incorporating the sparsification into the training cuts down on computational cost by not requiring additional retraining epochs . Ding et al . ( 2019 ) for example advertise that there is “ no need for a time consuming re-training ” and Hoefler et al . ( 2021 ) argue that `` the sparsify-during-training schedule ( ... ) is usually cheaper than the train-then-sparsify schedule ” . 2 . ) IMP determines a single numerical threshold for pruning and applies it globally to every parameter , potentially resulting in very different levels of sparsity among the layers of the network . This behavior is often considered to be sub-optimal and it is argued that pruning should be layerdependent ( Liu et al. , 2020 ) , so more complex saliency criteria have been proposed ( Gale et al. , 2019 ; Lee et al. , 2020 ) . Kusupati et al . ( 2020 ) for example claim that “ uniform or heuristic nonuniform sparsity budgets ( ... ) have sub-optimal layer-wise parameter allocation resulting in a ) lower prediction accuracy or b ) higher inference cost ( FLOPs ) ” . 3 . ) While only the iterative approach , that is repeatedly removing only a small fraction of the parameters followed by extensive retraining , is said to achieve results on the Pareto frontier ( Renda et al. , 2020 ) , its iterative nature is also considered to be computationally tedious , if not impractical : “ iterative pruning is computationally intensive , requiring training a network 15 or more times consecutively for multiple trials ” ( Frankle & Carbin , 2018 ) , leading Liu et al . ( 2020 ) to trying to “ avoid the expensive pruning and fine-tuning iterations ” . Our interest lies in exploring these claimed disadvantages of IMP through rigorous and consistent computational experimentation with a focus on recent advancements concerning the retraining phase , see the results of Renda et al . ( 2020 ) and Le & Hua ( 2021 ) . This comparative study is in fact intended to complement both of these works , which focused on improving the sparsity-vs.performance tradeoff of IMP through improved learning rate schemes during training , by putting an additional spotlight on the total computational cost of IMP in a direct comparison with methods that are commonly assumed to outperform IMP in that aspect by avoiding retraining . Contributions . We empirically find that , using an appropriate learning rate scheme , only few retraining epochs are needed in practice to achieve most of the sparsity vs. performance tradeoff of IMP . We also find that the global selection criterion not only finds sparsity distributions on par with but , somewhat surprisingly , often better than those of more sophisticated layer-dependent pruning criteria . Finally , we conclude that , using an appropriate learning rate scheme , IMP performs well even when compared to state-of-the-art approaches that incorporate sparsification into the training without or with only little computational overhead . That is , not only can IMP find some of the best performing architectures at any given sparsity level , but due to the compressed retraining time it does so without needing to leverage a longer running time even when compared to methods typically considered to be superior to IMP in that particular aspect . Outline . Section 2 contains a complete overview over related works , including a brief summary of all pruning methods and approaches considered here . In Section 3 we provide the computational results and their interpretation by first addressing how IMP can develop its full potential within a restricted computational envelope in Subsection 3.1 and Subsection 3.2 . We then use the resulting lessons in order to draw up a fair comparison to methods that incorporate pruning into their training in Subsection 3.3 . We conclude with some discussion in Section 4 . 2 OVERVIEW OF PRUNING METHODS AND METHODOLOGY . While the sparsification of Neural Networks includes a wide variety of approaches , we will focus on Model Pruning , i.e. , the removal of redundant structures in a Neural Network . More specifically , our results will be limited to unstructured pruning , that is the removal of individual weights , as opposed to its structured counterpart , where entire groups of elements , such as neurons or convolutional filters , are removed . We will also focus on approaches that start with a dense network and then either prune the network during training or after training as already discussed in the introduction . Following Bartoldson et al . ( 2020 ) , we will also refer to methods of the former category as pruning stable , since the final pruning should result in a negligible decrease in performance , where methods of the latter category are referred to as unstable . For a full and detailed survey of Pruning algorithms we refer the reader to Hoefler et al . ( 2021 ) . Pruning unstable methods are exemplified by ITERATIVE MAGNITUDE PRUNING ( IMP ) ( Han et al. , 2015 ) . In its original form , it first employs standard network training , adding a common ` 2- regularization term on the objective , and then removes all weights from the network whose absolute values are below a certain threshold . The network at this point commonly loses some or even all of its learned predictive power , so it is then retrained for a fixed number of epochs . This prune-retrain cycle is usually repeated a number of times ; the threshold at every pruning step is determined as the appropriate percentile such that , at the end of given number of iterations , a desired target sparsity is met.1 In the following we will first discuss two particular details of IMP that have been the focus of recent research : the questions of ( a ) how to select the parameters to be pruned and ( b ) how to retrain . We will then conclude this section by briefly outlining the pruning stable methods we have selected for this comparison and establish how to fairly compare them to IMP . 2.1 RETRAINING APPROACHES . Let us first consider the learning rate scheme used during retraining . The original approach by Han et al . ( 2015 ) is commonly referred to as FINE TUNING ( FT ) : suppose we train for T epochs using the learning rate schedule ( ηt ) t≤T and retrain for Trt epochs per prune-retrain-cycle , then FT retrains the pruned network for Trt epochs using a fixed constant learning rate , most commonly ηT . It was first noticed by Renda et al . ( 2020 ) that the precise learning rate schedule during retraining can have a dramatic impact on the predictive performance of the pruned network . Motivated by WEIGHT REWINDING ( WR ) ( Frankle et al. , 2019 ) , they proposed LEARNING RATE REWINDING ( LRW ) , where one retrains the pruned network for Trt epochs using the last T − Trt learning rates ηT−Trt+1 , . . . , ηT . Le & Hua ( 2021 ) argued that the reason behind the success of LRW is the usage of large learning rates and proposed SCALED LEARNING RATE RESTARTING ( SLR ) , where the pruned network is retrained using a proportionally identical learning schedule , i.e. , by compressing ( ηt ) t≤T into the retraining time frame of Trt epochs with a short warm-up phase . They also introduced CYCLIC LEARNING RATE RESTARTING ( CLR ) based on the the 1-cycle learning rate schedule of Smith & Topin ( 2017 ) . We think that the nature of the proposed retraining methods indicates that the retraining phase is , at its core , similar to the usual training phase . Following this rationale , the success of LRW , SLR and CLR over FT should be attributed to the existence of both a large- and small-step retraining regime . In fact , a large initial and exponentially decaying learning rate has become the standard practice for regular training ( Leclerc & Madry , 2020 ) . Note that such a scheme is employed not just by SLR and CLR , but also by LRW if Trt is sufficiently large to model the decaying learning rate schedule of the original training phase . The conventional approach to explaining the success of decaying learning rate schedules comes from an optimization perspective , i.e. , an initially large learning rate accelerates training and avoids local minima , while the gradual decay helps to converge to an optimum without oscillation around it . However , an active line of research has theoretically supported the usage of large learning rates and separating training into a large- and small-step regime from a generalization perspective ( Jastrzębski et al. , 2017 ; Li et al. , 2019 ; You et al. , 2019 ; Leclerc & Madry , 2020 ) . Put more succinctly : retraining is training and therefore requires that some effort is put into tuning the learning rate scheme . LRW , SLR and CLR provide some good heuristic guidance for how to effectively do so without an insurmountable amount of hyperparameter tuning . While One Shot IMP , that is IMP with a single prune-retrain cycle , is a viable approach to model pruning , only the iterative approach ( with multiple prune-retrain cycles ) has been shown to achieve 1There is another way to view this relation : one can fix a given percentile to be pruned in every iteration and then simply repeat the prune-retrain cycle until either a desired level of sparsity is reached or the performance degradation exceeds a given threshold . This is in fact how it appears to be used by Han et al . ( 2015 ) and how it is for example presented by Renda et al . ( 2020 ) . While this reframing may appear trivial , it in fact highlights a strength of IMP that we will further emphasize when contrasting it with pruning stable approaches . state-of-the-art accuracy-vs.-sparsity tradeoffs ( Han et al. , 2015 ; Renda et al. , 2020 ) . This iterative approach however commonly consists of a significant amount of prune-retrain cycles , each needing the full original training time , that is T = Trt , resulting in several thousand epochs worth of total training time . Renda et al . ( 2020 ) for example suggested the following approach : train a network for T epochs and then iteratively prune 20 % percent of the weights and retrain for Trt = T epochs using LRW , i.e. , use the same learning rate scheme as during training , until the desired sparsity is reached . We note that for T = Trt the learning rate scheme of SLR becomes essentially identical to that of LRW . For a goal sparsity of 98 % and T = 200 original training epochs , the algorithm would therefore require 18 prune-retrain-cycles for a massive 3800 total retrain epochs . In Subsection 3.1 we will study the effect of the number of prune-retrain cycles , the number of retraining epochs and the learning rate scheme on the performance of the pruned network to establish whether IMP truly requires this massive amount of computational investment to develop its full potential . | This work focuses on highlighting the strengths of Iterative Magnitude Pruning (IMP). Specifically, that it is capable of achieving strong performance when compared to more complex pruning approaches. The work explores the common arguments against IMP like, a) it reaches sub-optimal states since training doesn't compensate for sparse structures, b) it fails to identify optimal layer-wise pruning ratios and c) it is expensive, slow and non-competitive. The critical outcome shown is that IMP, with a global selection criterion and extremely small overhead, remains highly competitive with common state-of-the-art pruning approaches, both in sparsity, performance and theoretical speedup. | SP:6afe8cd7741417913dd2ccef7cb4feccd5a592ef |
Data-Efficient Augmentation for Training Neural Networks | 1 INTRODUCTION . Data augmentation expands the training data by applying transformations , such as rotations or crops for images , to the original training examples . Due to its effectiveness , data augmentation is a key component in achieving nearly all state-of-the-art results in deep learning applications ( Shorten & Khoshgoftaar , 2019 ) . The most effective data augmentation techniques often search over a ( possibly large ) space of transformations to find sequences of transformations that speeds up training the most ( Cubuk et al. , 2019 ; 2020 ; Luo et al. , 2020 ; Wu et al. , 2020 ) . In addition , multiple augmented examples are usually generated for a single data point to obtain better results , increasing the size of the training data by orders of magnitude . As a result , state-of-the-art data augmentation techniques become computationally prohibitive for large real-world problems ( c.f . Fig . 1 ) . To make data augmentation more efficient and scalable , an effective approach is to carefully select a small subset of the training data such that augmenting only the subset have similar training dynamics to that of full data augmentation . If such a subset can be quickly found , it would directly lead to a significant reduction in storage and training costs , and lower costs incurred from selecting and tuning the optimal set of transformations to apply . Despite the efficiency and scalability that it can provide , this direction has remained largely unexplored . Existing studies are limited to fully training a network and subsampling data points based on its loss or influence for augmentation in subsequent training runs ( Kuchnik & Smith , 2018 ) . However , this method is prohibitive for large datasets , provides a marginal improvement over augmenting random subsets , and does not provide any theoretical guarantee for the performance of the network trained on the augmented subsets . A major challenge in finding the most effective data points for augmentation is to theoretically understand how data augmentation affects the optimization and generalization of neural networks . Existing theoretical results are mainly limited to simple linear classifiers and analyze data augmentation as enlarging the span of the training data ( Wu et al. , 2020 ) , providing a regularization effect ( Bishop , 1995 ; Dao et al. , 2019 ; Wager et al. , 2013 ; Wu et al. , 2020 ) , enlarging the margin of a linear classifier ( Rajput et al. , 2019 ) , or having a variance reduction effect ( Chen et al. , 2019 ) . However , such tools do not provide insights on the effect of data augmentation on training deep neural networks . Here , we study the effect of label invariant data augmentation modeled by small additive perturbations ( Rajput et al. , 2019 ) on training dynamics of overparameterized neural networks . In particular , we rely on recent results that characterize training dynamics of neural networks based on the alignment of the labels/residuals with the singular subspace of the network ’ s Jacobian matrix containing all its first-order partial derivatives ( Arora et al. , 2019 ) . We show that label invariant data augmentation enlarges smaller singular values of the information space , and prove that this will speed up training . Next , we develop a rigorous method to iteratively find small weighted subsets ( coresets ) that when augmented , closely capture the alignment of the full augmented data with the label/residual , at every point during the training . Augmenting the coresets guarantees similar training dynamics to that of full data augmentation . Our key observation is that early in training , this alignment is best captured by data points that are highly representative of their classes . However towards the end of training when the network converges , data points with maximum loss best capture this alignment . Data augmentation has been empirically shown to mainly affect the initial phase of training ( Golatkar et al. , 2019 ) , which crucially determines the final basin of convergence ( Fort et al. , 2020 ) . Better selection of points by our method during this initial phase explains the superior accuracy improvement resulted by augmenting our coresets vs. the max-loss and the better final generalization performance . Importantly , we show that our coresets can be provably trained on even in absence of full data , and even when a high fraction of labels are noisy . We demonstrate the effectiveness of our approach applied to training ResNet20 , ResNet32 , WideResNet on CIFAR10 , CIFAR10-IB and SVHN , compared to random and max-loss baselines ( Kuchnik & Smith , 2018 ) . We show that augmenting coresets found by our approach outperforms the stateof-the-art even in absence of the full data . For instance , when small augmented subsets of size 30 % found by our approach are appended to CIFAR10 , we attain 75 % of the improvement in test accuracy compared to augmenting the full dataset while enjoying a 3.4x speedup in training time . Even in the absence of full data , training and augmenting tiny coresets of size 1 % can achieve 74.7 % accuracy on CIFAR10/ResNet20 while providing a 39x speedup compared to using the full dataset . On CIFAR10 with 50 % noisy labels , augmenting 50 % of the training data outperforms full data augmentation . 2 PROBLEM FORMULATION . We begin by formally describing the problem of learning from augmented data . Consider a dataset Dtrain = ( Xtrain , ytrain ) , where Xtrain = ( x1 , · · · , xn ) ∈ Rd×n is the set of n normalized data points xi ∈ [ 0 , 1 ] d , from the index set V , i.e. , i ∈ V = { 1 , · · · , n } , and ytrain = ( y1 , · · · , yn ) ∈ { y ∈ { ν1 , ν2 , · · · , νC } } with { νj } Cj=1 ∈ [ 0 , 1 ] . Assume at every step t during training , we have a set of augmented examples Dtaug generated by a set of label-invariant transformations . In particular , following ( Rajput et al. , 2019 ) we model data augmentation as an arbitrary bounded additive perturbation , with ‖ ‖≤ 0 . Formally , for a given upper bound 0 and the set of all possible transformations A , we study the transformations selected from S ⊆ A satisfying S = { Ti ∈ A | ‖Ti ( x ) − x‖≤ 0 ∀x ∈Xtrain } . ( 1 ) Under the smoothness constraint of images , where adjacent pixels have close intensities , such as small translations , crops , rotations , and for other pixel-wise augmentation methods such as sharpening , blurring , and color distortions ( Cubuk et al. , 2020 ) , 0 is small . This model is also especially suitable for modelling state-of-the-art augmentation techniques such as structured adversarial perturbation ( Luo et al. , 2020 ) , in which pixel intensities are changed minimally . While in our analysis we focus on small perturbations ε0 , our experiments use variety of strong and weak augmentations . Although other transformations such as data synthesis ( Baluja & Fischer , 2017 ; Mirza & Osindero , 2014 ) , semantic augmentation ( Wang et al. , 2019 ) , large translations , crops , rotations , and flips are still valid under the additive perturbation model , they can be more effectively modelled using matrices of linear transforms ( Wu et al. , 2020 ) , as we analyze in Appendix B.3 . In practice , multiple augmentations are generated for each example xi , and each augmented data point can be a combination of multiple transformations , e.g . random cropping and rotating followed by horizontal flipping . The set of augmentations at iteration t generating r augmented examples per data point can be specified , with abuse of notation , as Dtaug = { ⋃r i=1 ( T t i ( Xtrain ) , ytrain ) } , where |Dtaug|= rn and T ti ( Xtrain ) transforms all the training data points with the set of transformations T ti ⊂ S at iteration t. We denoteXtaug = { ⋃r i=1 T t i ( Xtrain ) } and ytaug = { ⋃r i=1 ytrain } . Let f ( W , x ) be an arbitrary neural network with m vectorized ( trainable ) parametersW ∈ Rm . We assume that the network is trained using ( stochastic ) gradient descent with learning rate η to minimize the squared loss L over the original and augmented training examples Dt = { Dtrain ∪ Dtaug } with associated index set V t , at every iteration t : L ( W t , X ) : = 1 2 ∑ i∈V t Li ( W t , xi ) : = 1 2 ∑ ( xi , yi ) ∈Dt ‖f ( W t , xi ) − yi‖22 . ( 2 ) The gradient update at iteration t is given by W t+1 = W t − η∇L ( W t , X ) , ∇L ( W t , X ) = J T ( W t , X ) ( f ( W t , X ) − y ) , ( 3 ) where Xt = { Xtrain ∪Xtaug } and yt = { ytrain ∪ ytaug } are the set of original and augmented examples and their labels , J ( W , X ) ∈ Rn×m is the Jacobian matrix associated with f , and rt = f ( W t , X ) − y is the residual . We further assume that J is smooth with Lipschitz constant L : ‖J ( W , xi ) − J ( W , xj ) ‖≤ L‖ xi − xj‖ ∀ xi , xj ∈X . ( 4 ) This trivially holds for linear models , and whenW is bounded , it holds for deep ReLU , and generally for networks with any activation φ with bounded derivatives φ′ and φ′′ ( Jordan & Dimakis , 2020 ) . Under this assumption , augmentation as defined in Eq . ( 1 ) results in bounded perturbations to the Jacobian matrix . I.e. , for any transformation Tj ∈ S , we have ‖J ( W , xi ) −J ( W , Tj ( xi ) ) ‖≤ L 0 . Using the shorthand notations J = J ( W , Xtrain ) and J̃ = J ( W , Tj ( Xtrain ) ) , we obtain J̃ = J +E , where E is the perturbation matrix with ‖E‖2≤ ‖E‖F≤ √ nL 0 . 3 DATA AUGMENTATION SPEEDS UP LEARNING . In this section , we analyze the effect of data augmentation on training dynamics of neural networks , and show that data augmentation can provably speed up learning . To do so , we leverage the recent results that characterize the training dynamics based on properties of neural network Jacobian matrix and the corresponding Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) defined as Θ = J ( W , X ) J ( W , X ) T . Formally ( Arora et al. , 2019 ) : rt = n∑ i=1 ( 1− ηλi ) ( uiuTi ) rt−1 = n∑ i=1 ( 1− ηλi ) t ( uiuTi ) r0 , ( 5 ) where Θ = UΛUT = ∑ i=1 λiuiu T i is the eigendecomposition of the NTK . Although the constant NTK assumption holds only in the infinite width limit , Lee et al . ( 2019 ) found close empirical agreement between the NTK dynamics and the true dynamics for wide but practical networks , such as wide ResNet architectures ( Zagoruyko & Komodakis , 2016 ) . Eq . ( 5 ) shows that training dynamics depend on the alignment of the NTK with the residual vector at every iteration t. In particular , shrinkage of residuals along the directions associated with larger eigenvalues of the NTK is fast and happens early during the training , while learning along the space associated with the small eigenvalues is slow and happens later . In the following , we prove that for small perturbations 0 , data augmentation speeds up training by enlarging smaller eigenvalues of the NTK , while decreasing larger eigenvalues with a high probability . Intuitively , this can be characterized as decreasing the learning rate for dimensions with larger gradient and slightly increasing the learning in dimensions with smaller gradients , and having a regularization effect by slightly perturbing the eigenvectors . | Deep learning uses augmentations to improve generalization performance. Using all augmentations for a dataset may slow down training. A subset selection technique is proposed (e.g., "coreset") using insights from the Neural Tangent Kernel (NMT) framework such that an alignment between the NMT Jacobian and the residuals is preserved. This alignment score is used to select the coreset using submodular optimization, which allows the model to be trained on a subset of augmented data (e.g., 0.1% to 30%) while preserving most augmentation benefits. The speedup of the method is reported to be up to 6.3x. | SP:2d12ba88cb0ad6b2d1f6174b3bb10d138d32c4e9 |
Data-Efficient Augmentation for Training Neural Networks | 1 INTRODUCTION . Data augmentation expands the training data by applying transformations , such as rotations or crops for images , to the original training examples . Due to its effectiveness , data augmentation is a key component in achieving nearly all state-of-the-art results in deep learning applications ( Shorten & Khoshgoftaar , 2019 ) . The most effective data augmentation techniques often search over a ( possibly large ) space of transformations to find sequences of transformations that speeds up training the most ( Cubuk et al. , 2019 ; 2020 ; Luo et al. , 2020 ; Wu et al. , 2020 ) . In addition , multiple augmented examples are usually generated for a single data point to obtain better results , increasing the size of the training data by orders of magnitude . As a result , state-of-the-art data augmentation techniques become computationally prohibitive for large real-world problems ( c.f . Fig . 1 ) . To make data augmentation more efficient and scalable , an effective approach is to carefully select a small subset of the training data such that augmenting only the subset have similar training dynamics to that of full data augmentation . If such a subset can be quickly found , it would directly lead to a significant reduction in storage and training costs , and lower costs incurred from selecting and tuning the optimal set of transformations to apply . Despite the efficiency and scalability that it can provide , this direction has remained largely unexplored . Existing studies are limited to fully training a network and subsampling data points based on its loss or influence for augmentation in subsequent training runs ( Kuchnik & Smith , 2018 ) . However , this method is prohibitive for large datasets , provides a marginal improvement over augmenting random subsets , and does not provide any theoretical guarantee for the performance of the network trained on the augmented subsets . A major challenge in finding the most effective data points for augmentation is to theoretically understand how data augmentation affects the optimization and generalization of neural networks . Existing theoretical results are mainly limited to simple linear classifiers and analyze data augmentation as enlarging the span of the training data ( Wu et al. , 2020 ) , providing a regularization effect ( Bishop , 1995 ; Dao et al. , 2019 ; Wager et al. , 2013 ; Wu et al. , 2020 ) , enlarging the margin of a linear classifier ( Rajput et al. , 2019 ) , or having a variance reduction effect ( Chen et al. , 2019 ) . However , such tools do not provide insights on the effect of data augmentation on training deep neural networks . Here , we study the effect of label invariant data augmentation modeled by small additive perturbations ( Rajput et al. , 2019 ) on training dynamics of overparameterized neural networks . In particular , we rely on recent results that characterize training dynamics of neural networks based on the alignment of the labels/residuals with the singular subspace of the network ’ s Jacobian matrix containing all its first-order partial derivatives ( Arora et al. , 2019 ) . We show that label invariant data augmentation enlarges smaller singular values of the information space , and prove that this will speed up training . Next , we develop a rigorous method to iteratively find small weighted subsets ( coresets ) that when augmented , closely capture the alignment of the full augmented data with the label/residual , at every point during the training . Augmenting the coresets guarantees similar training dynamics to that of full data augmentation . Our key observation is that early in training , this alignment is best captured by data points that are highly representative of their classes . However towards the end of training when the network converges , data points with maximum loss best capture this alignment . Data augmentation has been empirically shown to mainly affect the initial phase of training ( Golatkar et al. , 2019 ) , which crucially determines the final basin of convergence ( Fort et al. , 2020 ) . Better selection of points by our method during this initial phase explains the superior accuracy improvement resulted by augmenting our coresets vs. the max-loss and the better final generalization performance . Importantly , we show that our coresets can be provably trained on even in absence of full data , and even when a high fraction of labels are noisy . We demonstrate the effectiveness of our approach applied to training ResNet20 , ResNet32 , WideResNet on CIFAR10 , CIFAR10-IB and SVHN , compared to random and max-loss baselines ( Kuchnik & Smith , 2018 ) . We show that augmenting coresets found by our approach outperforms the stateof-the-art even in absence of the full data . For instance , when small augmented subsets of size 30 % found by our approach are appended to CIFAR10 , we attain 75 % of the improvement in test accuracy compared to augmenting the full dataset while enjoying a 3.4x speedup in training time . Even in the absence of full data , training and augmenting tiny coresets of size 1 % can achieve 74.7 % accuracy on CIFAR10/ResNet20 while providing a 39x speedup compared to using the full dataset . On CIFAR10 with 50 % noisy labels , augmenting 50 % of the training data outperforms full data augmentation . 2 PROBLEM FORMULATION . We begin by formally describing the problem of learning from augmented data . Consider a dataset Dtrain = ( Xtrain , ytrain ) , where Xtrain = ( x1 , · · · , xn ) ∈ Rd×n is the set of n normalized data points xi ∈ [ 0 , 1 ] d , from the index set V , i.e. , i ∈ V = { 1 , · · · , n } , and ytrain = ( y1 , · · · , yn ) ∈ { y ∈ { ν1 , ν2 , · · · , νC } } with { νj } Cj=1 ∈ [ 0 , 1 ] . Assume at every step t during training , we have a set of augmented examples Dtaug generated by a set of label-invariant transformations . In particular , following ( Rajput et al. , 2019 ) we model data augmentation as an arbitrary bounded additive perturbation , with ‖ ‖≤ 0 . Formally , for a given upper bound 0 and the set of all possible transformations A , we study the transformations selected from S ⊆ A satisfying S = { Ti ∈ A | ‖Ti ( x ) − x‖≤ 0 ∀x ∈Xtrain } . ( 1 ) Under the smoothness constraint of images , where adjacent pixels have close intensities , such as small translations , crops , rotations , and for other pixel-wise augmentation methods such as sharpening , blurring , and color distortions ( Cubuk et al. , 2020 ) , 0 is small . This model is also especially suitable for modelling state-of-the-art augmentation techniques such as structured adversarial perturbation ( Luo et al. , 2020 ) , in which pixel intensities are changed minimally . While in our analysis we focus on small perturbations ε0 , our experiments use variety of strong and weak augmentations . Although other transformations such as data synthesis ( Baluja & Fischer , 2017 ; Mirza & Osindero , 2014 ) , semantic augmentation ( Wang et al. , 2019 ) , large translations , crops , rotations , and flips are still valid under the additive perturbation model , they can be more effectively modelled using matrices of linear transforms ( Wu et al. , 2020 ) , as we analyze in Appendix B.3 . In practice , multiple augmentations are generated for each example xi , and each augmented data point can be a combination of multiple transformations , e.g . random cropping and rotating followed by horizontal flipping . The set of augmentations at iteration t generating r augmented examples per data point can be specified , with abuse of notation , as Dtaug = { ⋃r i=1 ( T t i ( Xtrain ) , ytrain ) } , where |Dtaug|= rn and T ti ( Xtrain ) transforms all the training data points with the set of transformations T ti ⊂ S at iteration t. We denoteXtaug = { ⋃r i=1 T t i ( Xtrain ) } and ytaug = { ⋃r i=1 ytrain } . Let f ( W , x ) be an arbitrary neural network with m vectorized ( trainable ) parametersW ∈ Rm . We assume that the network is trained using ( stochastic ) gradient descent with learning rate η to minimize the squared loss L over the original and augmented training examples Dt = { Dtrain ∪ Dtaug } with associated index set V t , at every iteration t : L ( W t , X ) : = 1 2 ∑ i∈V t Li ( W t , xi ) : = 1 2 ∑ ( xi , yi ) ∈Dt ‖f ( W t , xi ) − yi‖22 . ( 2 ) The gradient update at iteration t is given by W t+1 = W t − η∇L ( W t , X ) , ∇L ( W t , X ) = J T ( W t , X ) ( f ( W t , X ) − y ) , ( 3 ) where Xt = { Xtrain ∪Xtaug } and yt = { ytrain ∪ ytaug } are the set of original and augmented examples and their labels , J ( W , X ) ∈ Rn×m is the Jacobian matrix associated with f , and rt = f ( W t , X ) − y is the residual . We further assume that J is smooth with Lipschitz constant L : ‖J ( W , xi ) − J ( W , xj ) ‖≤ L‖ xi − xj‖ ∀ xi , xj ∈X . ( 4 ) This trivially holds for linear models , and whenW is bounded , it holds for deep ReLU , and generally for networks with any activation φ with bounded derivatives φ′ and φ′′ ( Jordan & Dimakis , 2020 ) . Under this assumption , augmentation as defined in Eq . ( 1 ) results in bounded perturbations to the Jacobian matrix . I.e. , for any transformation Tj ∈ S , we have ‖J ( W , xi ) −J ( W , Tj ( xi ) ) ‖≤ L 0 . Using the shorthand notations J = J ( W , Xtrain ) and J̃ = J ( W , Tj ( Xtrain ) ) , we obtain J̃ = J +E , where E is the perturbation matrix with ‖E‖2≤ ‖E‖F≤ √ nL 0 . 3 DATA AUGMENTATION SPEEDS UP LEARNING . In this section , we analyze the effect of data augmentation on training dynamics of neural networks , and show that data augmentation can provably speed up learning . To do so , we leverage the recent results that characterize the training dynamics based on properties of neural network Jacobian matrix and the corresponding Neural Tangent Kernel ( NTK ) ( Jacot et al. , 2018 ) defined as Θ = J ( W , X ) J ( W , X ) T . Formally ( Arora et al. , 2019 ) : rt = n∑ i=1 ( 1− ηλi ) ( uiuTi ) rt−1 = n∑ i=1 ( 1− ηλi ) t ( uiuTi ) r0 , ( 5 ) where Θ = UΛUT = ∑ i=1 λiuiu T i is the eigendecomposition of the NTK . Although the constant NTK assumption holds only in the infinite width limit , Lee et al . ( 2019 ) found close empirical agreement between the NTK dynamics and the true dynamics for wide but practical networks , such as wide ResNet architectures ( Zagoruyko & Komodakis , 2016 ) . Eq . ( 5 ) shows that training dynamics depend on the alignment of the NTK with the residual vector at every iteration t. In particular , shrinkage of residuals along the directions associated with larger eigenvalues of the NTK is fast and happens early during the training , while learning along the space associated with the small eigenvalues is slow and happens later . In the following , we prove that for small perturbations 0 , data augmentation speeds up training by enlarging smaller eigenvalues of the NTK , while decreasing larger eigenvalues with a high probability . Intuitively , this can be characterized as decreasing the learning rate for dimensions with larger gradient and slightly increasing the learning in dimensions with smaller gradients , and having a regularization effect by slightly perturbing the eigenvectors . | The authors model data augmentation as an additive perturbation and analyze its effect on training dynamics and how it enlarges the smaller singular values of the network jacobian. Then they propose a new method to iteratively extract a subset of the training data that when augmented closely capture the full augmented data dynamics. Authors show that by augmenting this subset combined with full training data they can outperform the state-of-the-art method by 7.7% on CIFAR-10 and 4.7% on SVHN while achieving 6.3x and 2.2x speedup respectively. | SP:2d12ba88cb0ad6b2d1f6174b3bb10d138d32c4e9 |
Bayesian Active Learning with Fully Bayesian Gaussian Processes | 1 INTRODUCTION . Gaussian Processes ( GPs ) are the canonical models to use for Bayesian optimization and metamodeling ( Snoek et al. , 2012 ; Gramacy , 2020 ) . GPs are well-known for their ability to deal with small to medium size data sets as well as balancing complexity and regularization - together with their inherent ability to handling uncertainties - this makes them ideal in such applications ( Williams & Rasmussen , 2006 ) . In both cases , often only limited data is accessible so the natural balance between complexity and regularization helps prevent severe overfitting , additionally making the model flexible enough to model nonlinear functions . Likewise , the quantification of uncertainty is commonly used in the acquisition function to guide the Bayesian optimization algorithms and the active learning schemes that are almost inevitable to efficiently build a metamodel . On the other hand , it is not a flawless procedure to use GPs to guide the two schemes . The same GP is used as both predictor and guide , and thus the choice of predictor will affect the guide , and vice versa . Trivially , the more data there is available for modeling , the less pronounced this problem will be . However , in the context of both Bayesian optimization and active learning , where the data sets tend to be rather small , a wrong predictor can result in misguidance , thus hindering the performance and efficiency . In this paper , we mitigate this problem by not only focusing on a single predictive model but consider many predictive models through multiple model hypotheses at once . A GP is typically fitted through evaluation of the marginal likelihood , which automatically incorporates a trade-off between complexity and regularization ( Williams & Rasmussen , 2006 ) . However , when the data is scarce , it is more challenging to choose the appropriate trade-off , and different configurations of the hyperparameters of the GP can give rise to distinct fits . This is illustrated in Figure 1 , where two seemingly reasonable fits might guide the schemes quite differently . The problem is directly related to the well-known bias-variance trade-off , although we reformulate it as a balance between modeling the data as signal or noise . For the common stationary covariance functions of GPs , e.g . the radial-basis function or the Matérn class of functions , together with a Gaussian High noise regime Low noise regime Figure 1 : Two GPs with different hyperparameters . The left plot shows a GP with high noise and a long length scale , and the right plot shows a GP with low noise and a short length scale . likelihood , this is directly reflected in the two hyperparameters length scale ` and noise σ2ε . If the data is modeled primarily as noise , both σ2ε and ` are large , whereas if the data is modeled primarily as a signal , both σ2ε and ` are small . In the case of limited data , the joint posterior distribution of the two hyperparameters is likely to be characterized by two modes , as illustrated in Figure 2 for the data in Figure 1 . In that case , it is difficult to tell whether it is best to model the data as noise or signal , and a wrong choice of mode will imply non-optimal guidance from the acquisition function . The literature suggests handling this problem with clever initializations of the hyperparameters Williams & Rasmussen ( 1996 ) or by favoring small ` and σ2ε by either always initializing hyperparameters in the low noise regime or by applying strong priors ( Gramacy , 2020 ) . However , none of these approaches directly address the core problem : which mode to choose ? Ideally , this should be answered with prior information about the problem , although typically that is not available , making these approaches less practical . In this paper , we follow a general approach and assume no prior knowledge about the kernel or hyperparameters . We consider multiple model hypotheses by replacing the fitting procedure of the marginal likelihood with Markov Chain Monte Carlo ( MCMC ) sampling . Lalchand & Rasmussen ( 2020 ) show that with fixed , medium-sized data sets and carefully chosen kernels , it is beneficial to fit GPs with MCMC instead of by maximizing the marginal likelihood . We show that the same is true for very small data sets and with a general kernel . Our main contribution is the proposal of two new acquisition functions for active learning that utilizes the extra information from the hyperparamters ’ posteriors estimated by MCMC to seek the most reasonable mode alongside minimizing the predictive variance . We show that the two acquisition functions are more accurate and robust than other common functions across multiple benchmark simulators used in the related literature . 2 RELATED WORK . The two proposed acquisition functions are specifically designed for active learning schemes for regression tasks . In this section , we lay out the related work , although the specific acquisition functions used for comparison purposes in the experiments are described in detail in section 4 . Further , in this section , we cover the essentials of Query-by-Committee and Gaussian Mixture Models , as these constitute the backbone of the proposed acquisition functions . Active Learning The main idea of active learning ( AL ) is to actively choose a new data point to label and add to the current training data set ( Settles , 2009 ) . In the context of metamodeling , new data is often added sequentially , i.e. , one data point at a time ( Gramacy , 2020 ) , but in other applications , it can be beneficial to query batches of data instead ( Kirsch et al. , 2019 ) . The acquisition functions can be divided into model-based and model-free functions , where the former utilize information from the model and the latter do not ( O ’ Neill et al. , 2017 ) . Both types of functions seek to minimize the expected predictive loss of the model . Another approach is to minimize the number of possible models . Houlsby et al . ( 2011 ) divide the active learning acquisition functions into being based on either decision or information theory . Decision-based functions seek to minimize the expected predictive loss of the model in the hope of maximizing the performance on the test set . Information-theoretic-based functions instead try to reduce the number of possible models , for example , through the KL-divergence or Shannon entropy ( Houlsby et al. , 2011 ) . It is not straightforward to use information-theoretic acquisition functions . However , if you have access to the posterior of the model ’ s parameters , Houlsby et al . ( 2011 ) have derived the algorithm Bayesian Active Learning by Disagreement ( BALD ) , which can be applied in general . Generally , BALD seeks the data point that maximizes the decrease in the expected posterior entropy of the parameters . Query-by-Committee The Query-by-Committee ( QBC ) is a specific acquisition function that was originally proposed for classification tasks ( Seung et al. , 1992 ) . It aims to maximize the disagreement among the committee to get the highest information gain and minimize the version space , which is the set of model hypotheses aligned with the training data . The construction of the committee is the core component of QBC since it is the committee ’ s ability to accurately and diversely represent the version space that gives rise to informative disagreement criteria ( Settles , 2009 ) . QBC can also be applied for regression problems . Krogh & Vedelsby ( 1995 ) construct the members of the committee by random initializations of the weights in the neural networks . RayChaudhuri & Hamey ( 1995 ) apply bagging and train the members on different subsets of the data set . In general , QBC constructed by bagging has been used as a benchmark with mixed results ( Cai et al. , 2013 ; Wu , 2018 ; Wu et al. , 2019 ) . Burbidge et al . ( 2007 ) show that the less noise there is in the output , the better QBC is compared to random querying . They also highlight the fact that with a misspecified model , QBC might perform worse than random querying . None of these approaches explore the usage of MCMC samples of the posterior to construct a committee . To the best of our knowledge , we are the first to propose QBC based on model hypotheses drawn from the posterior . Gaussian Process as a Gaussian Mixture Model Mixture models have recently been applied in active learning for classification tasks . Iswanto ( 2021 ) propose to use Gaussian Mixture Models ( GMMs ) with active learning , where they design a specific acquisition function that queries the data point that maximizes the expected likelihood of the model . Zhao et al . ( 2020 ) use a mixture of GPs in active learning , where each component is fitted to a subset of the training set . The combination of GMMs and GPs have previously been explored for static data sets . Chen & Ren ( 2009 ) investigate regression tasks and apply bagging , where they repeatedly randomly sample data points from the training set to construct new subsets to get GPs fitted to different data . Among other combination rules , they combine the predictive posteriors of these GPs into GMMs . They obtain even better performance by weighting the models by the predictive uncertainty such that models with high uncertainty are given smaller weights , and vice versa . Instead of using bagging , we construct the multiple GPs by using the MCMC samples of the hyperparameters ’ joint posterior , and then obtain a natural weighting of the GPs : the GMM will consist of more GPs with hyperparameters close to the modes than hyperparameters far away . The formal procedure is given in section 4 . To the best of our knowledge , we are the first to combine GMMs and GPs in this manner . 3 GAUSSIAN PROCESSES . The Gaussian Processes ( GPs ) are the central models in this work . In this section , we give a brief overview of GPs before covering the Fully Bayesian GPs . For a thorough description of GPs , we refer to Williams & Rasmussen ( 2006 ) . Gaussian Processes A Gaussian Process ( GP ) is a stochastic function fully defined by a mean function m ( · ) and a covariance function ( often called a kernel ) k ( · , · ) . Given the data ( X , y ) = { xi , yi } Ni=1 , where yi is the corrupted observations of some latent function values f with Gaussian noise ε , i.e. , yi = fi + εi , εi ∈ N ( 0 , σ2ε ) , a GP is typically denoted as GP ( mf ( x ) , kf ( x , x′ ) ) . It is common practice to set the mean function equal to the zero-value vector and thus , the GP is fully determined by the kernel kf ( x , x′ ) . For short , we will denote the kernel Kθ , which explicitly states that the kernel is parameterized with some hyperparameters θ . Given the optimal hyperparameters , the predictive posterior for unknown test inputs x∗ is given by p ( f∗|θ̂ , y , X , X∗ ) = N ( µ∗ , Σ∗ ) with µ∗ = K∗θ ( Kθ + σ 2 εI ) −1 y and Σ∗ = K ? ? θ −K∗θ ( Kθ + σ 2 εI ) −1 K ? > θ ( 1 ) where K ? ? θ denotes the covariance matrix between the test inputs , and K ∗ θ denotes the covariance matrix between the test inputs and training inputs . Covariance matrix We use the canonical kernel automatic relevance determination ( ARD ) Radial-basis function ( RBF ) given by k ( x , x′ ) = exp ( −||x− x′||2/2 ` 2 ) where ` is a vector of length scales ` 1 , ... , ` d , one for each input dimension . Often the kernel is scaled by an output variance but here we fix it to one and solely focus on the two other hyperparameters : length scale and noise-term . The noise-term σ2ε is integrated into the kernel with an indicator variable by adding the term σ2εI { x=x′ } to the current kernel . Fully Bayesian Gaussian Processes ( FBGP ) A FBGP extends a GP by putting a prior over the hyperparameters θ ∼ p ( θ ) and approximate their full posteriors . The joint posterior is then given by p ( f , θ|y , X ) ∝ p ( y|f ) p ( f |θ , X ) p ( θ ) ( 2 ) and the predictive posterior for the test inputs X∗ is p ( f∗|y ) = ∫∫ p ( f∗|f , θ ) p ( f |θ , y ) p ( θ|y ) dfdθ ( 3 ) where the conditioning on X and X∗ have been omitted for brevity . The inner integral reduces to the predictive posterior given by a normal GP . However , the outer integral remains intractable and is approximated with MCMC inference as p ( f∗|y ) = ∫ p ( f∗|y , θ ) p ( θ|y ) dθ ' 1 M M∑ j=1 p ( f∗|y , θj ) , θj ∼ p ( θ|y ) ( 4 ) As well known in machine learning modeling , there is no free lunch . Adapting the hyperparameters of a FBGP is computationally expensive compared to the approach with GPs and maximum likelihood estimates . However in Bayesian optimization and active learning , the computational burden for querying a new data point will often be of magnitudes higher . Evaluation and Fitting of GPs A GP is typically fitted by maximizing the marginal likelihood with gradient descent , where the marginal likelihood can be computed analytically . For the FBGP , the inner integral is intractable and is therefore optimized with approximate inference using the selftuning method of Monte Carlo Markov Chain ( MCMC ) called the No-U-Turn-Sampler ( NUTS ) ( Hoffman & Gelman , 2014 ) . The MCMC inference makes the full posterior of the hyperparameters available , making it possible to extend the point estimates to a joint distribution . In the experiment , we apply acquisition functions that use the full posterior distribution ; however , since the experiments are designed to benchmark the acquisition functions , we always use the mode of the joint posterior for prediction and evaluation . | This paper takes a fully Bayesian approach to Gaussian Process (GP) active learning by using MCMC sampling to consider multiple model hypotheses from a full posterior, from which it selects examples for GP regression using two new active learning strategies --- Bayesian Query-by-Committee (B-QBC) and Query by Mixture of Gaussian Processes (QB-MGP). B-QBC queries the data point that maximizes the disagreement between the sampled models’ mean values. The idea is that this should provide the highest information about the optimal posterior mode. QB-MGP uses a combination of B-QBC with entropy sampling. The authors evaluate these strategies against several baseline active learning methods on several simulators. | SP:993d684939ae8074669ba646e49b48ba6b2bf0b9 |
Bayesian Active Learning with Fully Bayesian Gaussian Processes | 1 INTRODUCTION . Gaussian Processes ( GPs ) are the canonical models to use for Bayesian optimization and metamodeling ( Snoek et al. , 2012 ; Gramacy , 2020 ) . GPs are well-known for their ability to deal with small to medium size data sets as well as balancing complexity and regularization - together with their inherent ability to handling uncertainties - this makes them ideal in such applications ( Williams & Rasmussen , 2006 ) . In both cases , often only limited data is accessible so the natural balance between complexity and regularization helps prevent severe overfitting , additionally making the model flexible enough to model nonlinear functions . Likewise , the quantification of uncertainty is commonly used in the acquisition function to guide the Bayesian optimization algorithms and the active learning schemes that are almost inevitable to efficiently build a metamodel . On the other hand , it is not a flawless procedure to use GPs to guide the two schemes . The same GP is used as both predictor and guide , and thus the choice of predictor will affect the guide , and vice versa . Trivially , the more data there is available for modeling , the less pronounced this problem will be . However , in the context of both Bayesian optimization and active learning , where the data sets tend to be rather small , a wrong predictor can result in misguidance , thus hindering the performance and efficiency . In this paper , we mitigate this problem by not only focusing on a single predictive model but consider many predictive models through multiple model hypotheses at once . A GP is typically fitted through evaluation of the marginal likelihood , which automatically incorporates a trade-off between complexity and regularization ( Williams & Rasmussen , 2006 ) . However , when the data is scarce , it is more challenging to choose the appropriate trade-off , and different configurations of the hyperparameters of the GP can give rise to distinct fits . This is illustrated in Figure 1 , where two seemingly reasonable fits might guide the schemes quite differently . The problem is directly related to the well-known bias-variance trade-off , although we reformulate it as a balance between modeling the data as signal or noise . For the common stationary covariance functions of GPs , e.g . the radial-basis function or the Matérn class of functions , together with a Gaussian High noise regime Low noise regime Figure 1 : Two GPs with different hyperparameters . The left plot shows a GP with high noise and a long length scale , and the right plot shows a GP with low noise and a short length scale . likelihood , this is directly reflected in the two hyperparameters length scale ` and noise σ2ε . If the data is modeled primarily as noise , both σ2ε and ` are large , whereas if the data is modeled primarily as a signal , both σ2ε and ` are small . In the case of limited data , the joint posterior distribution of the two hyperparameters is likely to be characterized by two modes , as illustrated in Figure 2 for the data in Figure 1 . In that case , it is difficult to tell whether it is best to model the data as noise or signal , and a wrong choice of mode will imply non-optimal guidance from the acquisition function . The literature suggests handling this problem with clever initializations of the hyperparameters Williams & Rasmussen ( 1996 ) or by favoring small ` and σ2ε by either always initializing hyperparameters in the low noise regime or by applying strong priors ( Gramacy , 2020 ) . However , none of these approaches directly address the core problem : which mode to choose ? Ideally , this should be answered with prior information about the problem , although typically that is not available , making these approaches less practical . In this paper , we follow a general approach and assume no prior knowledge about the kernel or hyperparameters . We consider multiple model hypotheses by replacing the fitting procedure of the marginal likelihood with Markov Chain Monte Carlo ( MCMC ) sampling . Lalchand & Rasmussen ( 2020 ) show that with fixed , medium-sized data sets and carefully chosen kernels , it is beneficial to fit GPs with MCMC instead of by maximizing the marginal likelihood . We show that the same is true for very small data sets and with a general kernel . Our main contribution is the proposal of two new acquisition functions for active learning that utilizes the extra information from the hyperparamters ’ posteriors estimated by MCMC to seek the most reasonable mode alongside minimizing the predictive variance . We show that the two acquisition functions are more accurate and robust than other common functions across multiple benchmark simulators used in the related literature . 2 RELATED WORK . The two proposed acquisition functions are specifically designed for active learning schemes for regression tasks . In this section , we lay out the related work , although the specific acquisition functions used for comparison purposes in the experiments are described in detail in section 4 . Further , in this section , we cover the essentials of Query-by-Committee and Gaussian Mixture Models , as these constitute the backbone of the proposed acquisition functions . Active Learning The main idea of active learning ( AL ) is to actively choose a new data point to label and add to the current training data set ( Settles , 2009 ) . In the context of metamodeling , new data is often added sequentially , i.e. , one data point at a time ( Gramacy , 2020 ) , but in other applications , it can be beneficial to query batches of data instead ( Kirsch et al. , 2019 ) . The acquisition functions can be divided into model-based and model-free functions , where the former utilize information from the model and the latter do not ( O ’ Neill et al. , 2017 ) . Both types of functions seek to minimize the expected predictive loss of the model . Another approach is to minimize the number of possible models . Houlsby et al . ( 2011 ) divide the active learning acquisition functions into being based on either decision or information theory . Decision-based functions seek to minimize the expected predictive loss of the model in the hope of maximizing the performance on the test set . Information-theoretic-based functions instead try to reduce the number of possible models , for example , through the KL-divergence or Shannon entropy ( Houlsby et al. , 2011 ) . It is not straightforward to use information-theoretic acquisition functions . However , if you have access to the posterior of the model ’ s parameters , Houlsby et al . ( 2011 ) have derived the algorithm Bayesian Active Learning by Disagreement ( BALD ) , which can be applied in general . Generally , BALD seeks the data point that maximizes the decrease in the expected posterior entropy of the parameters . Query-by-Committee The Query-by-Committee ( QBC ) is a specific acquisition function that was originally proposed for classification tasks ( Seung et al. , 1992 ) . It aims to maximize the disagreement among the committee to get the highest information gain and minimize the version space , which is the set of model hypotheses aligned with the training data . The construction of the committee is the core component of QBC since it is the committee ’ s ability to accurately and diversely represent the version space that gives rise to informative disagreement criteria ( Settles , 2009 ) . QBC can also be applied for regression problems . Krogh & Vedelsby ( 1995 ) construct the members of the committee by random initializations of the weights in the neural networks . RayChaudhuri & Hamey ( 1995 ) apply bagging and train the members on different subsets of the data set . In general , QBC constructed by bagging has been used as a benchmark with mixed results ( Cai et al. , 2013 ; Wu , 2018 ; Wu et al. , 2019 ) . Burbidge et al . ( 2007 ) show that the less noise there is in the output , the better QBC is compared to random querying . They also highlight the fact that with a misspecified model , QBC might perform worse than random querying . None of these approaches explore the usage of MCMC samples of the posterior to construct a committee . To the best of our knowledge , we are the first to propose QBC based on model hypotheses drawn from the posterior . Gaussian Process as a Gaussian Mixture Model Mixture models have recently been applied in active learning for classification tasks . Iswanto ( 2021 ) propose to use Gaussian Mixture Models ( GMMs ) with active learning , where they design a specific acquisition function that queries the data point that maximizes the expected likelihood of the model . Zhao et al . ( 2020 ) use a mixture of GPs in active learning , where each component is fitted to a subset of the training set . The combination of GMMs and GPs have previously been explored for static data sets . Chen & Ren ( 2009 ) investigate regression tasks and apply bagging , where they repeatedly randomly sample data points from the training set to construct new subsets to get GPs fitted to different data . Among other combination rules , they combine the predictive posteriors of these GPs into GMMs . They obtain even better performance by weighting the models by the predictive uncertainty such that models with high uncertainty are given smaller weights , and vice versa . Instead of using bagging , we construct the multiple GPs by using the MCMC samples of the hyperparameters ’ joint posterior , and then obtain a natural weighting of the GPs : the GMM will consist of more GPs with hyperparameters close to the modes than hyperparameters far away . The formal procedure is given in section 4 . To the best of our knowledge , we are the first to combine GMMs and GPs in this manner . 3 GAUSSIAN PROCESSES . The Gaussian Processes ( GPs ) are the central models in this work . In this section , we give a brief overview of GPs before covering the Fully Bayesian GPs . For a thorough description of GPs , we refer to Williams & Rasmussen ( 2006 ) . Gaussian Processes A Gaussian Process ( GP ) is a stochastic function fully defined by a mean function m ( · ) and a covariance function ( often called a kernel ) k ( · , · ) . Given the data ( X , y ) = { xi , yi } Ni=1 , where yi is the corrupted observations of some latent function values f with Gaussian noise ε , i.e. , yi = fi + εi , εi ∈ N ( 0 , σ2ε ) , a GP is typically denoted as GP ( mf ( x ) , kf ( x , x′ ) ) . It is common practice to set the mean function equal to the zero-value vector and thus , the GP is fully determined by the kernel kf ( x , x′ ) . For short , we will denote the kernel Kθ , which explicitly states that the kernel is parameterized with some hyperparameters θ . Given the optimal hyperparameters , the predictive posterior for unknown test inputs x∗ is given by p ( f∗|θ̂ , y , X , X∗ ) = N ( µ∗ , Σ∗ ) with µ∗ = K∗θ ( Kθ + σ 2 εI ) −1 y and Σ∗ = K ? ? θ −K∗θ ( Kθ + σ 2 εI ) −1 K ? > θ ( 1 ) where K ? ? θ denotes the covariance matrix between the test inputs , and K ∗ θ denotes the covariance matrix between the test inputs and training inputs . Covariance matrix We use the canonical kernel automatic relevance determination ( ARD ) Radial-basis function ( RBF ) given by k ( x , x′ ) = exp ( −||x− x′||2/2 ` 2 ) where ` is a vector of length scales ` 1 , ... , ` d , one for each input dimension . Often the kernel is scaled by an output variance but here we fix it to one and solely focus on the two other hyperparameters : length scale and noise-term . The noise-term σ2ε is integrated into the kernel with an indicator variable by adding the term σ2εI { x=x′ } to the current kernel . Fully Bayesian Gaussian Processes ( FBGP ) A FBGP extends a GP by putting a prior over the hyperparameters θ ∼ p ( θ ) and approximate their full posteriors . The joint posterior is then given by p ( f , θ|y , X ) ∝ p ( y|f ) p ( f |θ , X ) p ( θ ) ( 2 ) and the predictive posterior for the test inputs X∗ is p ( f∗|y ) = ∫∫ p ( f∗|f , θ ) p ( f |θ , y ) p ( θ|y ) dfdθ ( 3 ) where the conditioning on X and X∗ have been omitted for brevity . The inner integral reduces to the predictive posterior given by a normal GP . However , the outer integral remains intractable and is approximated with MCMC inference as p ( f∗|y ) = ∫ p ( f∗|y , θ ) p ( θ|y ) dθ ' 1 M M∑ j=1 p ( f∗|y , θj ) , θj ∼ p ( θ|y ) ( 4 ) As well known in machine learning modeling , there is no free lunch . Adapting the hyperparameters of a FBGP is computationally expensive compared to the approach with GPs and maximum likelihood estimates . However in Bayesian optimization and active learning , the computational burden for querying a new data point will often be of magnitudes higher . Evaluation and Fitting of GPs A GP is typically fitted by maximizing the marginal likelihood with gradient descent , where the marginal likelihood can be computed analytically . For the FBGP , the inner integral is intractable and is therefore optimized with approximate inference using the selftuning method of Monte Carlo Markov Chain ( MCMC ) called the No-U-Turn-Sampler ( NUTS ) ( Hoffman & Gelman , 2014 ) . The MCMC inference makes the full posterior of the hyperparameters available , making it possible to extend the point estimates to a joint distribution . In the experiment , we apply acquisition functions that use the full posterior distribution ; however , since the experiments are designed to benchmark the acquisition functions , we always use the mode of the joint posterior for prediction and evaluation . | This paper introduces two new active-learning strategies for Gaussian process regression, based on a fully-Bayesian treatment of GPs. Instead of using fixed hyperparamers obtained by maximizing the marginal log-likelihood of the GP model, the authors suggest learning a posterior belief over GP hyperparameters, and make use of the full distribution to design more effective active-learning methods. In practice, this results in two concrete proposals: 1) a strategy that is similar to query-by-committee, where the committee is formed of multiple GPs sampled from the hyper-posterior (B-QBC). 2) a variant that combines a notion of disagreement with the predictive uncertainty (QB-MGP) These methods are then compared to others on 8 synthetic datasets. | SP:993d684939ae8074669ba646e49b48ba6b2bf0b9 |
Low-Cost Algorithmic Recourse for Users With Uncertain Cost Functions | 1 INTRODUCTION . Over the past few years ML models have been increasingly deployed to make critical decisions related to loan approval ( Siddiqi , 2012 ) , insurance ( Scism , 2019 ) , allocation of public resources ( Chouldechova et al. , 2018 ; Shroff , 2017 ) and hiring decisions ( Ajunwa et al. , 2016 ) . Decisions from these models have real-life consequences for the individuals ( users ) involved . As a result , there is a growing emphasis on explaining these models ’ decisions ( Ribeiro et al. , 2018 ; Lundberg & Lee , 2017 ; Poulin et al. , 2006 ) and providing recourse for unfavorable decisions ( Voigt & dem Bussche , 2018 ; Karimi et al. , 2020a ) . A recourse is an actionable plan that is given to someone allowing them to change the decision of a deployed model to a desired alternative ( Wachter et al. , 2017 ) . Recourses can be highly valuable for users in situations where model decisions determine important life outcomes . Or , in cases where no feasible recourse is possible , users may wish to dispute the use of a model in the first place , and we might take this as evidence that greater reforms to the decision-making system are needed ( Venkatasubramanian & Alfano , 2020 ) . Recourses are desired to be actionable , feasible , and non-discriminatory . Actionable means that only features which can be changed by the user are requested to be changed . These changes should also be possible under the data distribution . For example , Education level can not be decreased from a Masters to Bachelors degree but can be increased from Masters to PhD . It is also not actionable to change your Race ( Mothilal et al. , 2020 ) . A recourse is feasible if it is reasonably easy for the user to adopt , i.e . it is actionable and has a low cost for the user . Non-Discriminatory means that the recourse method should be equitable across population subgroups . There are now many fairness metrics that can be used to measure this ( Hinnefeld et al. , 2018 ) , e.g . the ratio between the average cost of recourse for two subgroups in a population . While we want recourses to be feasible for all users , it is difficult to directly optimize for a user ’ s incurred cost unless we have access to their ground-truth cost function . In the absence of detailed cost function data , prior work has used other heuristic objectives for feasibility . For instance , Mothilal et al . ( 2020 ) and Wachter et al . ( 2017 ) assume that if the vector distance between the user ’ s current state and the recourse is small , then recourse will be low cost . These works encourage this property via a proximity objective . Meanwhile , sparsity quantifies the number of features that require modification to implement a recourse ( Mothilal et al. , 2020 ) . When providing multiple recourse options , diversity in proposed recourses is used to counter uncertainty around the user cost function ( Mothilal et al. , 2020 ; Cheng et al. , 2021 ) . The assumption is that if users are provided with diverse options then they are more likely to find at least one feasible solution . Later in section 5.2 , we show that diversity as an objective correlates poorly with user cost , suggesting it would be strongly preferable to optimize for user cost directly . A few approaches to recourse do directly optimize for the cost of recourse , but they assume there is a single cost function shared by all users ( Ustun et al. , 2019 ; Rawal & Lakkaraju , 2020 ; Karimi et al. , 2020c ; d ; Cui et al. , 2015 ) . We believe it is crucial to have user-specific cost functions , as a global cost function might poorly represent different users in a diverse population . In this work , we propose a method for identifying a user-specific recourse set that contain at least one good solution for the user . We directly optimize for user cost by quantifying the actionability and feasibility of proposed recourses . In the absence of data about user cost functions , we treat them as hidden from the recourse method and assume they follow an underlying cost distribution . However , we provide users with an option to specify their preferred editable features or the complete cost function detailing the costs of transitions between features values . We model this cost distribution via a highly flexible hierarchical cost sampling procedure which makes minimal assumptions about user preferences ( Algorithm 1 ) . Based on this distribution , we propose an objective function , Expected Minimum Cost ( EMC ) , which allows us to approximately optimize for user satisfaction by first sampling plausible cost functions , then finding a set that achieves a good cost in expectation . The EMC objective encourages the solution set to consist of counterfactuals that are each a good counterfactual under some particular cluster of cost functions from the distribution . Hence , no matter what the user ’ s ground-truth cost function is , we will have some counterfactual that is well suited to the user ’ s cost function ( shown in Figure 1 ) . Next , we propose a simple discrete optimization method , Cost-Optimized Local Search ( COLS ) , in order to optimize for Expected Minimum Cost . COLS guarantees a monotonic reduction in the Expected Minimum Cost of the counterfactual set , which we show leads to large empirical reductions in user-incurred cost . To evaluate the effectiveness of our proposed techniques , we run experiments on two popular realworld datasets : Adult-Income ( Dua & Graff , 2017 ) and COMPAS ( Larson et al. , 2016 ) . We compare our method with multiple strong baselines methods like Diverse Counterfactual Explanations ( DICE ) ( Mothilal et al. , 2020 ) , Feasible and Actionable Counterfactual Explanations ( FACE ) ( Poyi- adzi et al. , 2020 ) , and Actionable Recourse ( AR ) ( Ustun et al. , 2019 ) . We evaluate these methods on existing metrics from the literature like diversity , proximity , sparsity , and validity ( Section 5.1 ) along with two cost-based metrics . In particular , we measure the fraction of satisfied users , based on whether their cost of recourse is below a certain threshold k. We also report coverage , which is the fraction of users with at least one actionable recourse ( Rawal & Lakkaraju , 2020 ) . Using simulated user cost functions , we show that our method satisfies 25.89 % and 17.93 % percentage points more users than strong baseline methods while covering 22.35 % and 17.13 % more users , on the Adult-Income and COMPAS dataset respectively . We perform important ablations to show whether performance can be attributed to the COLS optimization method or the EMC objective . Additionally , we evaluate the robustness of our method to various distribution shifts that can occur between the user ’ s hidden cost distribution and the hierarchical cost sampling distribution . We find that our method is robust to these distribution shifts and generalizes well to user cost function from these shifted distributions . Lastly , we perform a fairness analysis of all the methods across demographic subgroups based on Gender and Race . Standard fairness metrics demonstrate that , in most comparisons , our method is more fair relative to the strongest baseline methods . Our primary contributions in this paper are listed below . 1 . We propose to evaluate user-incurred cost and fraction of satisfied users by means of hidden user-specific cost functions , rather than a known global cost function . 2 . We propose a new objective function , Expected Minimum Cost ( EMC ) , which allows us to approximately optimize for user satisfaction when user cost functions are not known . 3 . We propose a discrete optimization method , Cost-Optimized Local Search ( COLS ) , which achieves up to 25.89 % percentage points higher user satisfaction relative to the next-best baseline . COLS guarantees a monotonic reduction in EMC , which we find provides a 19 % point improvement over a simple local search . 4 . We show that in most settings , COLS provides more fair solutions across demographics subgroup than comparable recourse methods , while offering recourse to a substantially higher fraction of users . 2 RELATED WORK . A wide variety of methods have been proposed for generating recourses . For a comprehensive survey of existing recourse methods , we refer readers to Karimi et al . ( 2020b ) . Here , we distinguish our approach based on our recourse objectives , optimizer , and evaluation . We primarily discuss recourse methods , though there is useful complementary work on problems such as providing recourse when there is distribution shift in the data ( Upadhyay et al. , 2021 ; Slack et al. , 2021 ) and training models which guarantee recourse to affected individuals with high probability ( Ross et al. , 2021 ) . Objectives : The most prominent family of objectives for recourse includes distance-based objectives ( Wachter et al. , 2017 ; Karimi et al. , 2020a ; Dhurandhar et al. , 2018 ; Mothilal et al. , 2020 ; Rasouli & Yu , 2021 ) . These methods seek recourses that are close to the original data point . In DICE , Mothilal et al . ( 2020 ) provide users with a set of counterfactuals while trading off between proximity , a distance-based objective , and diversity . Diversity-based methods assume that providing diverse options will increase the chance a user is satisfied by one of the options . A second category of methods uses other heuristics based on the data distribution ( Aguilar-Palacios et al. , 2020 ; Gomez et al. , 2020 ) to come up with counterfactuals . FACE constructs a graph from the given data and then tries to find a high-density path between points in order to generate counterfactuals ( Poyiadzi et al. , 2020 ) . Lastly , the works closest to ours are the cost-based objectives , which capture feasibility in terms of the cost of recourse : ( 1 ) Cui et al . ( 2015 ) define a cost function based on the minimum and maximum values a factor can take in their additive tree model . ( 2 ) Karimi et al . ( 2020c ; d ) take a causal intervention perspective on the task and define cost in terms of the normalized distance between the user state and the counterfactual . ( 3 ) Ustun et al . ( 2019 ) define cost in terms of the number of changed features and frame recourse generation as an Integer Linear Program . ( 4 ) Rawal & Lakkaraju ( 2020 ) infer a cost function from simulated rankings of features for actionability , then optimize recourses for this cost function . Importantly , all of these works assume there is a known global cost function that is shared by all users . In our work , we drop this assumption , and instead we optimize for cost over a distribution of plausible user-specific cost functions . Optimization : Early work on recourse methods uses gradient-based optimization to search for counterfactuals close to a user ’ s data point ( Wachter et al. , 2017 ) . Several methods since then also use gradient-based optimization ( Mothilal et al. , 2020 ; Chen et al. , 2020 ) . Some recent approaches use tree-based techniques ( Rawal & Lakkaraju , 2020 ; Aguilar-Palacios et al. , 2020 ; von Kügelgen et al. , 2020 ; Hashemi & Fathi , 2020 ; Kanamori et al. , 2020 ) , kernel-based methods ( Dandl et al. , 2020 ; Gomez et al. , 2020 ; Ramon et al. , 2020 ) , while others employ some heuristic ( Poyiadzi et al. , 2020 ; Aguilar-Palacios et al. , 2020 ) to generate counterfactuals . A few works use latent space perturbation with autoencoders to generate recourses ( Pawelczyk et al. , 2020 ; Joshi et al. , 2019 ) , while Karimi et al . ( 2020a ) and Ustun et al . ( 2019 ) utilize SAT and ILP solvers , respectively . Here , we introduce a discrete optimization method specialized for our Expected Minimum Cost objective . Evaluation : Besides ensuring that recourses are classified as the favorable class by a model ( validity ) , the most prominent approaches to evaluate recourses rely on Distance-based metrics . In DICE , Mothilal et al . ( 2020 ) evaluate recourses according to their proximity , sparsity , and diversity . Meanwhile , several works directly consider the cost of the recourses , using a known global cost function as a metric , meaning that all users share a cost function , which is available to the recourse generation method ( Cui et al. , 2015 ; Karimi et al. , 2020c ; d ) . In a slight departure from this setting , Rawal & Lakkaraju ( 2020 ) estimate a cost function from simulated pairwise feature comparisons , but this single estimate is used for both recourse generation and evaluation . In contrast , we evaluate a recourse method by simulating user-specific cost functions which can very greatly across users , and these cost functions are not known in advance to recourse generation methods . We will also measure recourse coverage as defined by Rawal & Lakkaraju ( 2020 ) , which measures the fraction of users that were provided with a recourse by the method . | In this paper, the problem of algorithmic recourse is studied where the goal is to find best recourse (counterfactual set) that is optimized for user cost. The author proposed new user-incurred cost evaluation method, Expected Minimum Cost (EMC), which approximate user satisfaction without assuming a fixed global user cost function, and instead consider user cost functions as hidden and user-specific. Specifically, the authors define cost function for each user as a set of feature-specific functions of user-incurred cost when transitioning between feature states, and define MinCost as the minimum transition cost across possible recourses. To cover diverse user cost functions, they propose to model user cost distribution with a hierarchical sampling procedure and estimated expected minimum cost by drawing samples from it. Next, they formulate a discrete optimization problem using EMC as objective, and propose a search algorithm (COLS) for best recourse generation. They introduce three new metrics for user satisfaction (all related to MinCost): FS@k, Coverage and PAC. Finally, they test with two real-world datasets and show that COLS achieves significant outperformance against baselines (that optimize for distance-based metrics) on the newly proposed metrics and show that their method is doing better in fairness as well. | SP:af5ebe07a96714c0bb85aef1f4b3e23120db142e |
Low-Cost Algorithmic Recourse for Users With Uncertain Cost Functions | 1 INTRODUCTION . Over the past few years ML models have been increasingly deployed to make critical decisions related to loan approval ( Siddiqi , 2012 ) , insurance ( Scism , 2019 ) , allocation of public resources ( Chouldechova et al. , 2018 ; Shroff , 2017 ) and hiring decisions ( Ajunwa et al. , 2016 ) . Decisions from these models have real-life consequences for the individuals ( users ) involved . As a result , there is a growing emphasis on explaining these models ’ decisions ( Ribeiro et al. , 2018 ; Lundberg & Lee , 2017 ; Poulin et al. , 2006 ) and providing recourse for unfavorable decisions ( Voigt & dem Bussche , 2018 ; Karimi et al. , 2020a ) . A recourse is an actionable plan that is given to someone allowing them to change the decision of a deployed model to a desired alternative ( Wachter et al. , 2017 ) . Recourses can be highly valuable for users in situations where model decisions determine important life outcomes . Or , in cases where no feasible recourse is possible , users may wish to dispute the use of a model in the first place , and we might take this as evidence that greater reforms to the decision-making system are needed ( Venkatasubramanian & Alfano , 2020 ) . Recourses are desired to be actionable , feasible , and non-discriminatory . Actionable means that only features which can be changed by the user are requested to be changed . These changes should also be possible under the data distribution . For example , Education level can not be decreased from a Masters to Bachelors degree but can be increased from Masters to PhD . It is also not actionable to change your Race ( Mothilal et al. , 2020 ) . A recourse is feasible if it is reasonably easy for the user to adopt , i.e . it is actionable and has a low cost for the user . Non-Discriminatory means that the recourse method should be equitable across population subgroups . There are now many fairness metrics that can be used to measure this ( Hinnefeld et al. , 2018 ) , e.g . the ratio between the average cost of recourse for two subgroups in a population . While we want recourses to be feasible for all users , it is difficult to directly optimize for a user ’ s incurred cost unless we have access to their ground-truth cost function . In the absence of detailed cost function data , prior work has used other heuristic objectives for feasibility . For instance , Mothilal et al . ( 2020 ) and Wachter et al . ( 2017 ) assume that if the vector distance between the user ’ s current state and the recourse is small , then recourse will be low cost . These works encourage this property via a proximity objective . Meanwhile , sparsity quantifies the number of features that require modification to implement a recourse ( Mothilal et al. , 2020 ) . When providing multiple recourse options , diversity in proposed recourses is used to counter uncertainty around the user cost function ( Mothilal et al. , 2020 ; Cheng et al. , 2021 ) . The assumption is that if users are provided with diverse options then they are more likely to find at least one feasible solution . Later in section 5.2 , we show that diversity as an objective correlates poorly with user cost , suggesting it would be strongly preferable to optimize for user cost directly . A few approaches to recourse do directly optimize for the cost of recourse , but they assume there is a single cost function shared by all users ( Ustun et al. , 2019 ; Rawal & Lakkaraju , 2020 ; Karimi et al. , 2020c ; d ; Cui et al. , 2015 ) . We believe it is crucial to have user-specific cost functions , as a global cost function might poorly represent different users in a diverse population . In this work , we propose a method for identifying a user-specific recourse set that contain at least one good solution for the user . We directly optimize for user cost by quantifying the actionability and feasibility of proposed recourses . In the absence of data about user cost functions , we treat them as hidden from the recourse method and assume they follow an underlying cost distribution . However , we provide users with an option to specify their preferred editable features or the complete cost function detailing the costs of transitions between features values . We model this cost distribution via a highly flexible hierarchical cost sampling procedure which makes minimal assumptions about user preferences ( Algorithm 1 ) . Based on this distribution , we propose an objective function , Expected Minimum Cost ( EMC ) , which allows us to approximately optimize for user satisfaction by first sampling plausible cost functions , then finding a set that achieves a good cost in expectation . The EMC objective encourages the solution set to consist of counterfactuals that are each a good counterfactual under some particular cluster of cost functions from the distribution . Hence , no matter what the user ’ s ground-truth cost function is , we will have some counterfactual that is well suited to the user ’ s cost function ( shown in Figure 1 ) . Next , we propose a simple discrete optimization method , Cost-Optimized Local Search ( COLS ) , in order to optimize for Expected Minimum Cost . COLS guarantees a monotonic reduction in the Expected Minimum Cost of the counterfactual set , which we show leads to large empirical reductions in user-incurred cost . To evaluate the effectiveness of our proposed techniques , we run experiments on two popular realworld datasets : Adult-Income ( Dua & Graff , 2017 ) and COMPAS ( Larson et al. , 2016 ) . We compare our method with multiple strong baselines methods like Diverse Counterfactual Explanations ( DICE ) ( Mothilal et al. , 2020 ) , Feasible and Actionable Counterfactual Explanations ( FACE ) ( Poyi- adzi et al. , 2020 ) , and Actionable Recourse ( AR ) ( Ustun et al. , 2019 ) . We evaluate these methods on existing metrics from the literature like diversity , proximity , sparsity , and validity ( Section 5.1 ) along with two cost-based metrics . In particular , we measure the fraction of satisfied users , based on whether their cost of recourse is below a certain threshold k. We also report coverage , which is the fraction of users with at least one actionable recourse ( Rawal & Lakkaraju , 2020 ) . Using simulated user cost functions , we show that our method satisfies 25.89 % and 17.93 % percentage points more users than strong baseline methods while covering 22.35 % and 17.13 % more users , on the Adult-Income and COMPAS dataset respectively . We perform important ablations to show whether performance can be attributed to the COLS optimization method or the EMC objective . Additionally , we evaluate the robustness of our method to various distribution shifts that can occur between the user ’ s hidden cost distribution and the hierarchical cost sampling distribution . We find that our method is robust to these distribution shifts and generalizes well to user cost function from these shifted distributions . Lastly , we perform a fairness analysis of all the methods across demographic subgroups based on Gender and Race . Standard fairness metrics demonstrate that , in most comparisons , our method is more fair relative to the strongest baseline methods . Our primary contributions in this paper are listed below . 1 . We propose to evaluate user-incurred cost and fraction of satisfied users by means of hidden user-specific cost functions , rather than a known global cost function . 2 . We propose a new objective function , Expected Minimum Cost ( EMC ) , which allows us to approximately optimize for user satisfaction when user cost functions are not known . 3 . We propose a discrete optimization method , Cost-Optimized Local Search ( COLS ) , which achieves up to 25.89 % percentage points higher user satisfaction relative to the next-best baseline . COLS guarantees a monotonic reduction in EMC , which we find provides a 19 % point improvement over a simple local search . 4 . We show that in most settings , COLS provides more fair solutions across demographics subgroup than comparable recourse methods , while offering recourse to a substantially higher fraction of users . 2 RELATED WORK . A wide variety of methods have been proposed for generating recourses . For a comprehensive survey of existing recourse methods , we refer readers to Karimi et al . ( 2020b ) . Here , we distinguish our approach based on our recourse objectives , optimizer , and evaluation . We primarily discuss recourse methods , though there is useful complementary work on problems such as providing recourse when there is distribution shift in the data ( Upadhyay et al. , 2021 ; Slack et al. , 2021 ) and training models which guarantee recourse to affected individuals with high probability ( Ross et al. , 2021 ) . Objectives : The most prominent family of objectives for recourse includes distance-based objectives ( Wachter et al. , 2017 ; Karimi et al. , 2020a ; Dhurandhar et al. , 2018 ; Mothilal et al. , 2020 ; Rasouli & Yu , 2021 ) . These methods seek recourses that are close to the original data point . In DICE , Mothilal et al . ( 2020 ) provide users with a set of counterfactuals while trading off between proximity , a distance-based objective , and diversity . Diversity-based methods assume that providing diverse options will increase the chance a user is satisfied by one of the options . A second category of methods uses other heuristics based on the data distribution ( Aguilar-Palacios et al. , 2020 ; Gomez et al. , 2020 ) to come up with counterfactuals . FACE constructs a graph from the given data and then tries to find a high-density path between points in order to generate counterfactuals ( Poyiadzi et al. , 2020 ) . Lastly , the works closest to ours are the cost-based objectives , which capture feasibility in terms of the cost of recourse : ( 1 ) Cui et al . ( 2015 ) define a cost function based on the minimum and maximum values a factor can take in their additive tree model . ( 2 ) Karimi et al . ( 2020c ; d ) take a causal intervention perspective on the task and define cost in terms of the normalized distance between the user state and the counterfactual . ( 3 ) Ustun et al . ( 2019 ) define cost in terms of the number of changed features and frame recourse generation as an Integer Linear Program . ( 4 ) Rawal & Lakkaraju ( 2020 ) infer a cost function from simulated rankings of features for actionability , then optimize recourses for this cost function . Importantly , all of these works assume there is a known global cost function that is shared by all users . In our work , we drop this assumption , and instead we optimize for cost over a distribution of plausible user-specific cost functions . Optimization : Early work on recourse methods uses gradient-based optimization to search for counterfactuals close to a user ’ s data point ( Wachter et al. , 2017 ) . Several methods since then also use gradient-based optimization ( Mothilal et al. , 2020 ; Chen et al. , 2020 ) . Some recent approaches use tree-based techniques ( Rawal & Lakkaraju , 2020 ; Aguilar-Palacios et al. , 2020 ; von Kügelgen et al. , 2020 ; Hashemi & Fathi , 2020 ; Kanamori et al. , 2020 ) , kernel-based methods ( Dandl et al. , 2020 ; Gomez et al. , 2020 ; Ramon et al. , 2020 ) , while others employ some heuristic ( Poyiadzi et al. , 2020 ; Aguilar-Palacios et al. , 2020 ) to generate counterfactuals . A few works use latent space perturbation with autoencoders to generate recourses ( Pawelczyk et al. , 2020 ; Joshi et al. , 2019 ) , while Karimi et al . ( 2020a ) and Ustun et al . ( 2019 ) utilize SAT and ILP solvers , respectively . Here , we introduce a discrete optimization method specialized for our Expected Minimum Cost objective . Evaluation : Besides ensuring that recourses are classified as the favorable class by a model ( validity ) , the most prominent approaches to evaluate recourses rely on Distance-based metrics . In DICE , Mothilal et al . ( 2020 ) evaluate recourses according to their proximity , sparsity , and diversity . Meanwhile , several works directly consider the cost of the recourses , using a known global cost function as a metric , meaning that all users share a cost function , which is available to the recourse generation method ( Cui et al. , 2015 ; Karimi et al. , 2020c ; d ) . In a slight departure from this setting , Rawal & Lakkaraju ( 2020 ) estimate a cost function from simulated pairwise feature comparisons , but this single estimate is used for both recourse generation and evaluation . In contrast , we evaluate a recourse method by simulating user-specific cost functions which can very greatly across users , and these cost functions are not known in advance to recourse generation methods . We will also measure recourse coverage as defined by Rawal & Lakkaraju ( 2020 ) , which measures the fraction of users that were provided with a recourse by the method . | This work introduces a new method for identifying actionable recourses for users with user-specific cost functions. Users’ cost functions are hidden from the recourse method. The paper proposed a discrete optimization algorithm COLS to solve the objective EMC. It further used a popular real-world dataset to illustrate the performance. | SP:af5ebe07a96714c0bb85aef1f4b3e23120db142e |
Amortized Implicit Differentiation for Stochastic Bilevel Optimization | 1 INTRODUCTION . Bilevel optimization refers to a class of algorithms for solving problems with a hierarchical structure involving two levels : an inner and an outer level . The inner-level problem seeks a solution y ? ( x ) minimizing a cost g ( x , y ) over a set Y given a fixed outer variable x in a set X . The outer-level problem minimizes an objective of the form L ( x ) =f ( x , y ? ( x ) ) over X for some upper-level cost f . When the solution y ? ( x ) is unique , the bilevel optimization problem takes the following form : min x∈X L ( x ) : = f ( x , y ? ( x ) ) , such that y ? ( x ) = arg min y∈Y g ( x , y ) . ( 1 ) First introduced in the field of economic game theory by Stackelberg ( 1934 ) , this problem has recently received increasing attention in the machine learning community ( Domke , 2012 ; Gould et al. , 2016 ; Liao et al. , 2018 ; Blondel et al. , 2021 ; Liu et al. , 2021 ; Shaban et al. , 2019 ) . Indeed , many machine learning applications can be reduced to ( 1 ) including hyper-parameter optimization ( Feurer and Hutter , 2019 ) , meta-learning ( Bertinetto et al. , 2018 ) , reinforcement learning ( Hong et al. , 2020b ; Liu et al. , 2021 ) or dictionary learning ( Mairal et al. , 2011 ; Lecouat et al. , 2020a ; b ) . The hierarchical nature of ( 1 ) introduces additional challenges compared to standard optimization problems , such as finding a suitable trade-off between the computational budget for approximating the inner and outer level problems ( Ghadimi and Wang , 2018 ; Dempe and Zemkoho , 2020 ) . These considerations are exacerbated in machine learning applications , where the costs f and g often come as an average of functions over a large or infinite number of data points ( Franceschi et al. , 2018 ) . All these challenges highlight the need for methods that are able to control the computational costs inherent to ( 1 ) while dealing with the large-scale setting encountered in machine learning . Gradient-based bilevel optimization methods appear to be viable approaches for solving ( 1 ) in largescale settings ( Lorraine et al. , 2020 ) . They can be divided into two categories : Iterative differentiation ( ITD ) and Approximate implicit differentiation ( AID ) . ITD approaches approximate the map y ? ( x ) by a differentiable optimization algorithm A ( x ) viewed as a function of x . The resulting surrogate loss L̃ ( x ) = f ( x , A ( x ) ) is optimized instead of L ( x ) using reverse-mode automatic differentiation ( see Baydin et al. , 2018 ) . AID approaches ( Pedregosa , 2016 ) rely on an expression of the gradient ∇L resulting from the implicit function theorem ( Lang , 2012 , Theorem 5.9 ) . Unlike ITD , AID avoids differentiating the algorithm approximating y ? ( x ) and , instead , approximately solves a linear system using only Hessian and Jacobian-vector products to estimate the gradient∇L ( Rajeswaran et al. , 2019 ) . These methods can also rely on stochastic approximation to increase scalability ( Franceschi et al. , 2018 ; Grazzi et al. , 2020 ; 2021 ) . In the context of machine-learning , Ghadimi and Wang ( 2018 ) provided one of the first comprehensive studies of the computational complexity for a class of bilevel algorithms based on AID approaches . Subsequently , Hong et al . ( 2020b ) ; Ji et al . ( 2021 ) ; Ji and Liang ( 2021 ) ; Yang et al . ( 2021 ) proposed different algorithms for solving ( 1 ) and obtained improved overall complexity by achieving a better trade-off between the cost of the inner and outer level problems . Still , the question of whether these complexities can be improved by better exploiting the structure of ( 1 ) through heuristics such as warm-start remains open ( Grazzi et al. , 2020 ) . Moreover , these studies proposed separate analysis of their algorithms depending on the convexity of the loss L and whether a stochastic or deterministic setting is considered . This points out to a lack of unified and systematic theoretical framework for analyzing bilevel problems , which is what the present work addresses . We consider the Amortized Implicit Gradient Optimization ( AmIGO ) algorithm , a bilevel optimization algorithm based on Approximate Implicit Differentiation ( AID ) approaches that exploits a warm-start strategy when estimating the gradient of L. We then propose a unified theoretical framework for analyzing the convergence of AmIGO when the inner-level problem is strongly convex in both stochastic and deterministic settings . The proposed framework is inspired from the early work of Habets ( 1974 ) on singularly perturbed systems and analyzes the effect of warm start by viewing the iterates of AmIGO algorithm as a dynamical system . The evolution of such system is described by a total energy function which allows to recover the convergence rates of unbiased oracle methods which have access to an unbiased estimate of ∇L ( c.f . Table 1 ) . To the best of our knowledge , this is the first time a bilevel optimization algorithm based on a warm-start strategy provably recovers the rates of unbiased oracle methods across a wide range of settings including the stochastic ones . 2 RELATED WORK . Singularly perturbed systems ( SPS ) are continuous-time deterministic dynamical systems of coupled variables ( x ( t ) , y ( t ) ) with two time-scales where y ( t ) evolves much faster than x ( t ) . As such , they exhibit a hierarchical structure similar to ( 1 ) . The early work of Habets ( 1974 ) ; Saberi and Khalil ( 1984 ) provided convergence rates for SPS towards equilibria by studying the evolution of a single scalar energy function summarizing these systems . The present work takes inspiration from these works to analyze the convergence of AmIGO which involves three time-scales . Two time-scale Stochastic Approximation ( TTSA ) can be viewed as a discrete-time stochastic version of SPS . ( Kaledin et al. , 2020 ) showed that TTSA achieves a finite-time complexity of O ( −1 ) for linear systems while Doan ( 2020 ) obtained a complexity of O ( −3/2 ) for general non-linear systems by extending the analysis for SPS . Hong et al . ( 2020b ) further adapted the non-linear TTSA for solving ( 1 ) . In the present work , we obtain faster rates by taking into account the dynamics of a third variable zk appearing in AmIGO , thus resulting in a three time-scale dynamics . Warm-start in bilevel optimization . Ji et al . ( 2021 ) ; Ji and Liang ( 2021 ) used a warm-start for the inner-level algorithm to obtain an improved computational complexity over algorithms without warm-start . In the deterministic non-convex setting , Ji et al . ( 2021 ) used a warm-start strategy when solving the linear system appearing in AID approaches to obtain improved convergence rates . However , it remained open whether using a warm-start when solving both inner-level problem and linear system arising in AID approaches can yield faster algorithms in the more challenging stochastic setting ( Grazzi et al. , 2020 ) . In the present work , we provide a positive answer to this question . 3 AMORTIZED IMPLICIT GRADIENT OPTIMIZATION . 3.1 GENERAL SETTING AND MAIN ASSUMPTIONS . Notations . In all what follows , X and Y are Euclidean spaces . For a differentiable function h ( x , y ) : X ×Y → R , we denote by∇h its gradient w.r.t . ( x , y ) , by ∂xh and ∂yh its partial derivatives w.r.t . x and y and by ∂xyh and ∂yyh the partial derivatives of ∂yh w.r.t x and y , respectively . Geometries Setting Algorithms Complexity BA ( Ghadimi and Wang , 2018 ) O ( κ2L ∨ κ2g log 2 −1 ) AccBio ( Ji and Liang , 2021 ) O ( κ1/2L κ 1/2 g log 2 −1 ) ( D ) AmIGO ( Corollary 1 ) O ( κLκg log −1 ) BSA ( Ghadimi and Wang , 2018 ) O ( κ4L −2 ) TTSA ( Hong et al. , 2020b ) O ( κ0.5L ( κ 8.5 g + κ 3 L ) −3/2 log −1 ) ( SC ) ( S ) AmIGO ( Corollary 2 ) O ( κ2Lκ 3 g −1 log −1 ) BA ( Ghadimi and Wang , 2018 ) O ( κ5g −5/4 ) AID-BiO ( Ji et al. , 2021 ) O ( κ4g −1 ) ( D ) AmIGO ( Corollary 3 ) O ( κ4g −1 ) BSA ( Ghadimi and Wang , 2018 ) O ( κ9g −3 + κ6g −2 ) TTSA ( Hong et al. , 2020b ) O ( κ16g −5/2 log −1 ) stocBiO ( Ji et al. , 2021 ) O ( κ9g −2+κ6g −2 log −1 ) MRBO/VRBO ? ( Yang et al. , 2021 ) O ( poly ( κg ) −3/2 log −1 ) ( NC ) ( S ) AmIGO ( Corollary 4 ) O ( κ9g −2 ) Table 1 : Cost of finding an -accurate solution as measured by E [ L ( xk ) −L ? ] ∧2−1µE [ ‖xk−x ? ‖2 ] when L is µ-strongly-convex ( SC ) and 1k ∑k i=1 E [ ‖∇L ( xi ) ‖2 ] when L is non-convex ( NC ) . The settings ( D ) and ( S ) stand for the deterministic and stochastic settings . The cost corresponds to the total number of gradients , Jacobian and Hessian-vector products used by the algorithm . κL and κg are the conditioning numbers of L and g whenever applicable . The dependence on κL and κg for TTSA and AccBio are derived in Proposition 11 of Appendix A.4 . The rate of MRBO/VRBO is obtained under the additional mean-squared smoothness assumption ( Arjevani et al. , 2019 ) . To ensure that ( 1 ) is well-defined , we consider the setting where the inner-level problem is strongly convex so that the solution y ? ( x ) is unique as stated by the following assumption : Assumption 1 . For any x ∈ X , the function y 7→ g ( x , y ) is Lg-smooth and µg-strongly convex . Assumption 1 holds in the context of hyper-parameter selection when the inner-level is a kernel regression problem ( Franceschi et al. , 2018 ) , or when the variable y represents the last linear layer of a neural network as in many meta-learning tasks ( Ji et al. , 2021 ) . Under Assumption 1 and additional smoothness assumptions on f and g , the next proposition shows that L is differentiable : Proposition 1 . Let g be a twice differentiable function satisfying Assumption 1 . Assume that f is differentiable and consider the quadratic problem : min z∈Rdy Q ( x , y , z ) : = 1 2 z > ( ∂yyg ( x , y ) ) z + z > ∂yf ( x , y ) . ( 2 ) Then , ( 2 ) admits a unique minimizer z ? ( x , y ) for any ( x , y ) in X × Y . Moreover , y ? ( x ) is unique and well-defined for any x in X and L is differentiable with gradient given by : ∇L ( x ) = ∂xf ( x , y ? ( x ) ) + ∂xyg ( x , y ? ( x ) ) z ? ( x , y ? ( x ) ) . ( 3 ) Proposition 1 follows by application of the implicit function theorem ( Lang , 2012 , Theorem 5.9 ) and provides an expression for ∇L solely in terms of partial derivatives of f and g evaluated at ( x , y ? ( x ) ) . Following Ghadimi and Wang ( 2018 ) , we further make two smoothness assumptions on f and g : Assumption 2 . There exist positive constants Lf and B such that for all x , x′ ∈ X and y , y′ ∈ Y : ‖∇f ( x , y ) −∇f ( x′ , y′ ) ‖ ≤ Lf‖ ( x , y ) − ( x′ , y′ ) ‖ , ‖∂yf ( x , y ) ‖ ≤ B . Assumption 3 . There exit positive constants L′g , Mg such that for any x , x′ ∈ X and y , y′ ∈ Y : max { ‖∂xyg ( x , y ) − ∂xyg ( x′ , y′ ) ‖ , ‖∂yyg ( x , y ) − ∂yyg ( x′ , y′ ) ‖ } ≤Mg‖ ( x , y ) − ( x′ , y′ ) ‖ ‖∂yg ( x , y ) − ∂yg ( x′ , y ) ‖ ≤ L′g‖x− x′‖ . Assumptions 1 to 3 allow a control of the variations of y ? and z ? and ensure L is L-smooth for some positive constant L as shown in Proposition 6 of Appendix B.2 . As an L-smooth function , L is necessarily weakly convex ( Davis et al. , 2018 ) , meaning thatL satisfies the inequalityL ( x ) −L ( y ) ≤ ∇L ( x ) > ( x− y ) − µ2 ‖x− y‖ 2 for some fixed µ ∈ R with |µ| ≤ L. In particular , L is convex when µ ≥ 0 , strongly convex when µ > 0 and generally non-convex when µ < 0 . We thus consider two cases for L , the strongly convex case ( µ > 0 ) and the non-convex case ( µ < 0 ) . When L is convex , we denote by L ? its minimum value achieved at a point x ? and define κL=L/µ when µ > 0 . Stochastic/deterministic settings . We consider the general setting where f ( x , y ) and g ( x , y ) are expressed as an expectation of stochastic functions f̂ ( x , y , ξ ) and ĝ ( x , y , ξ ) over a noise variable ξ . We recover the deterministic setting as a particular case when the variable ξ has zero variance , thus allowing us to treat both stochastic ( S ) and deterministic ( D ) settings in a unified framework . As often in machine-learning , we assume we can always draw a new batch D of i.i.d . samples of the noise variable ξ with size |D| ≥ 1 and use it to compute stochastic approximations of f and g defined by abuse of notation as f̂ ( x , y , D ) : = 1|D| ∑ ξ∈D f̂ ( x , y , ξ ) and ĝ ( x , y , D ) : = 1 |D| ∑ ξ∈D ĝ ( x , y , ξ ) . We make the following noise assumptions which are implied by those in Ghadimi and Wang ( 2018 ) : Assumption 4 . For any batchD , ∇f̂ ( x , y , D ) and ∂y ĝ ( x , y , D ) are unbiased estimator of∇f ( x , y ) and ∂yg ( x , y ) with a uniformly bounded variance , i.e . for all x , y ∈ X × Y : E [ ∥∥∥∇f̂ ( x , y , D ) −∇f ( x , y ) ∥∥∥2 ] ≤ σ̃2f |D|−1 , E [ ‖∂y ĝ ( x , y , D ) − ∂yg ( x , y ) ‖2 ] ≤ σ̃2g |D|−1 . Assumption 5 . For any batch D , the matrices F1 ( x , y , D ) : = ∂xy ĝ ( x , y , D ) − ∂xyg ( x , y ) and F2 ( x , y , D ) : = ∂yy ĝ ( x , y , D ) − ∂yyg ( x , y ) have zero mean and satisfy for all x , y ∈ X × Y : ∥∥E [ F1 ( x , y , D ) > F1 ( x , y , D ) ] ∥∥op ≤ σ̃2gxy |D|−1 , ∥∥E [ F2 ( x , y , D ) > F2 ( x , y , D ) ] ∥∥op ≤ σ̃2gyy |D|−1 . For conciseness , we will use the notations σ2f : =σ̃ 2 f |D| −1 , σ2g : =σ̃ 2 g |D| −1 , σ2gxy : =σ̃ 2 gxy |D| −1 and σ2gyy : =σ̃ 2 gyy |D| −1 , without explicit reference to the batch D. Next , we describe the algorithm . | The paper studies the problem of bi-level optimization. In particular, it considers algorithms based on inexact implicit differentiation, where the inner problem and the implicit differentiation are not solved exactly. Warm-up is used when solving the inner problem and implicit differentiation. The convergence of the proposed method is analyzed by viewing the iterates of the proposed method as a dynamical system using the idea of singularly perturbed systems. | SP:857b454e408e1ad21ccb9372ad5feb89d95cb055 |
Amortized Implicit Differentiation for Stochastic Bilevel Optimization | 1 INTRODUCTION . Bilevel optimization refers to a class of algorithms for solving problems with a hierarchical structure involving two levels : an inner and an outer level . The inner-level problem seeks a solution y ? ( x ) minimizing a cost g ( x , y ) over a set Y given a fixed outer variable x in a set X . The outer-level problem minimizes an objective of the form L ( x ) =f ( x , y ? ( x ) ) over X for some upper-level cost f . When the solution y ? ( x ) is unique , the bilevel optimization problem takes the following form : min x∈X L ( x ) : = f ( x , y ? ( x ) ) , such that y ? ( x ) = arg min y∈Y g ( x , y ) . ( 1 ) First introduced in the field of economic game theory by Stackelberg ( 1934 ) , this problem has recently received increasing attention in the machine learning community ( Domke , 2012 ; Gould et al. , 2016 ; Liao et al. , 2018 ; Blondel et al. , 2021 ; Liu et al. , 2021 ; Shaban et al. , 2019 ) . Indeed , many machine learning applications can be reduced to ( 1 ) including hyper-parameter optimization ( Feurer and Hutter , 2019 ) , meta-learning ( Bertinetto et al. , 2018 ) , reinforcement learning ( Hong et al. , 2020b ; Liu et al. , 2021 ) or dictionary learning ( Mairal et al. , 2011 ; Lecouat et al. , 2020a ; b ) . The hierarchical nature of ( 1 ) introduces additional challenges compared to standard optimization problems , such as finding a suitable trade-off between the computational budget for approximating the inner and outer level problems ( Ghadimi and Wang , 2018 ; Dempe and Zemkoho , 2020 ) . These considerations are exacerbated in machine learning applications , where the costs f and g often come as an average of functions over a large or infinite number of data points ( Franceschi et al. , 2018 ) . All these challenges highlight the need for methods that are able to control the computational costs inherent to ( 1 ) while dealing with the large-scale setting encountered in machine learning . Gradient-based bilevel optimization methods appear to be viable approaches for solving ( 1 ) in largescale settings ( Lorraine et al. , 2020 ) . They can be divided into two categories : Iterative differentiation ( ITD ) and Approximate implicit differentiation ( AID ) . ITD approaches approximate the map y ? ( x ) by a differentiable optimization algorithm A ( x ) viewed as a function of x . The resulting surrogate loss L̃ ( x ) = f ( x , A ( x ) ) is optimized instead of L ( x ) using reverse-mode automatic differentiation ( see Baydin et al. , 2018 ) . AID approaches ( Pedregosa , 2016 ) rely on an expression of the gradient ∇L resulting from the implicit function theorem ( Lang , 2012 , Theorem 5.9 ) . Unlike ITD , AID avoids differentiating the algorithm approximating y ? ( x ) and , instead , approximately solves a linear system using only Hessian and Jacobian-vector products to estimate the gradient∇L ( Rajeswaran et al. , 2019 ) . These methods can also rely on stochastic approximation to increase scalability ( Franceschi et al. , 2018 ; Grazzi et al. , 2020 ; 2021 ) . In the context of machine-learning , Ghadimi and Wang ( 2018 ) provided one of the first comprehensive studies of the computational complexity for a class of bilevel algorithms based on AID approaches . Subsequently , Hong et al . ( 2020b ) ; Ji et al . ( 2021 ) ; Ji and Liang ( 2021 ) ; Yang et al . ( 2021 ) proposed different algorithms for solving ( 1 ) and obtained improved overall complexity by achieving a better trade-off between the cost of the inner and outer level problems . Still , the question of whether these complexities can be improved by better exploiting the structure of ( 1 ) through heuristics such as warm-start remains open ( Grazzi et al. , 2020 ) . Moreover , these studies proposed separate analysis of their algorithms depending on the convexity of the loss L and whether a stochastic or deterministic setting is considered . This points out to a lack of unified and systematic theoretical framework for analyzing bilevel problems , which is what the present work addresses . We consider the Amortized Implicit Gradient Optimization ( AmIGO ) algorithm , a bilevel optimization algorithm based on Approximate Implicit Differentiation ( AID ) approaches that exploits a warm-start strategy when estimating the gradient of L. We then propose a unified theoretical framework for analyzing the convergence of AmIGO when the inner-level problem is strongly convex in both stochastic and deterministic settings . The proposed framework is inspired from the early work of Habets ( 1974 ) on singularly perturbed systems and analyzes the effect of warm start by viewing the iterates of AmIGO algorithm as a dynamical system . The evolution of such system is described by a total energy function which allows to recover the convergence rates of unbiased oracle methods which have access to an unbiased estimate of ∇L ( c.f . Table 1 ) . To the best of our knowledge , this is the first time a bilevel optimization algorithm based on a warm-start strategy provably recovers the rates of unbiased oracle methods across a wide range of settings including the stochastic ones . 2 RELATED WORK . Singularly perturbed systems ( SPS ) are continuous-time deterministic dynamical systems of coupled variables ( x ( t ) , y ( t ) ) with two time-scales where y ( t ) evolves much faster than x ( t ) . As such , they exhibit a hierarchical structure similar to ( 1 ) . The early work of Habets ( 1974 ) ; Saberi and Khalil ( 1984 ) provided convergence rates for SPS towards equilibria by studying the evolution of a single scalar energy function summarizing these systems . The present work takes inspiration from these works to analyze the convergence of AmIGO which involves three time-scales . Two time-scale Stochastic Approximation ( TTSA ) can be viewed as a discrete-time stochastic version of SPS . ( Kaledin et al. , 2020 ) showed that TTSA achieves a finite-time complexity of O ( −1 ) for linear systems while Doan ( 2020 ) obtained a complexity of O ( −3/2 ) for general non-linear systems by extending the analysis for SPS . Hong et al . ( 2020b ) further adapted the non-linear TTSA for solving ( 1 ) . In the present work , we obtain faster rates by taking into account the dynamics of a third variable zk appearing in AmIGO , thus resulting in a three time-scale dynamics . Warm-start in bilevel optimization . Ji et al . ( 2021 ) ; Ji and Liang ( 2021 ) used a warm-start for the inner-level algorithm to obtain an improved computational complexity over algorithms without warm-start . In the deterministic non-convex setting , Ji et al . ( 2021 ) used a warm-start strategy when solving the linear system appearing in AID approaches to obtain improved convergence rates . However , it remained open whether using a warm-start when solving both inner-level problem and linear system arising in AID approaches can yield faster algorithms in the more challenging stochastic setting ( Grazzi et al. , 2020 ) . In the present work , we provide a positive answer to this question . 3 AMORTIZED IMPLICIT GRADIENT OPTIMIZATION . 3.1 GENERAL SETTING AND MAIN ASSUMPTIONS . Notations . In all what follows , X and Y are Euclidean spaces . For a differentiable function h ( x , y ) : X ×Y → R , we denote by∇h its gradient w.r.t . ( x , y ) , by ∂xh and ∂yh its partial derivatives w.r.t . x and y and by ∂xyh and ∂yyh the partial derivatives of ∂yh w.r.t x and y , respectively . Geometries Setting Algorithms Complexity BA ( Ghadimi and Wang , 2018 ) O ( κ2L ∨ κ2g log 2 −1 ) AccBio ( Ji and Liang , 2021 ) O ( κ1/2L κ 1/2 g log 2 −1 ) ( D ) AmIGO ( Corollary 1 ) O ( κLκg log −1 ) BSA ( Ghadimi and Wang , 2018 ) O ( κ4L −2 ) TTSA ( Hong et al. , 2020b ) O ( κ0.5L ( κ 8.5 g + κ 3 L ) −3/2 log −1 ) ( SC ) ( S ) AmIGO ( Corollary 2 ) O ( κ2Lκ 3 g −1 log −1 ) BA ( Ghadimi and Wang , 2018 ) O ( κ5g −5/4 ) AID-BiO ( Ji et al. , 2021 ) O ( κ4g −1 ) ( D ) AmIGO ( Corollary 3 ) O ( κ4g −1 ) BSA ( Ghadimi and Wang , 2018 ) O ( κ9g −3 + κ6g −2 ) TTSA ( Hong et al. , 2020b ) O ( κ16g −5/2 log −1 ) stocBiO ( Ji et al. , 2021 ) O ( κ9g −2+κ6g −2 log −1 ) MRBO/VRBO ? ( Yang et al. , 2021 ) O ( poly ( κg ) −3/2 log −1 ) ( NC ) ( S ) AmIGO ( Corollary 4 ) O ( κ9g −2 ) Table 1 : Cost of finding an -accurate solution as measured by E [ L ( xk ) −L ? ] ∧2−1µE [ ‖xk−x ? ‖2 ] when L is µ-strongly-convex ( SC ) and 1k ∑k i=1 E [ ‖∇L ( xi ) ‖2 ] when L is non-convex ( NC ) . The settings ( D ) and ( S ) stand for the deterministic and stochastic settings . The cost corresponds to the total number of gradients , Jacobian and Hessian-vector products used by the algorithm . κL and κg are the conditioning numbers of L and g whenever applicable . The dependence on κL and κg for TTSA and AccBio are derived in Proposition 11 of Appendix A.4 . The rate of MRBO/VRBO is obtained under the additional mean-squared smoothness assumption ( Arjevani et al. , 2019 ) . To ensure that ( 1 ) is well-defined , we consider the setting where the inner-level problem is strongly convex so that the solution y ? ( x ) is unique as stated by the following assumption : Assumption 1 . For any x ∈ X , the function y 7→ g ( x , y ) is Lg-smooth and µg-strongly convex . Assumption 1 holds in the context of hyper-parameter selection when the inner-level is a kernel regression problem ( Franceschi et al. , 2018 ) , or when the variable y represents the last linear layer of a neural network as in many meta-learning tasks ( Ji et al. , 2021 ) . Under Assumption 1 and additional smoothness assumptions on f and g , the next proposition shows that L is differentiable : Proposition 1 . Let g be a twice differentiable function satisfying Assumption 1 . Assume that f is differentiable and consider the quadratic problem : min z∈Rdy Q ( x , y , z ) : = 1 2 z > ( ∂yyg ( x , y ) ) z + z > ∂yf ( x , y ) . ( 2 ) Then , ( 2 ) admits a unique minimizer z ? ( x , y ) for any ( x , y ) in X × Y . Moreover , y ? ( x ) is unique and well-defined for any x in X and L is differentiable with gradient given by : ∇L ( x ) = ∂xf ( x , y ? ( x ) ) + ∂xyg ( x , y ? ( x ) ) z ? ( x , y ? ( x ) ) . ( 3 ) Proposition 1 follows by application of the implicit function theorem ( Lang , 2012 , Theorem 5.9 ) and provides an expression for ∇L solely in terms of partial derivatives of f and g evaluated at ( x , y ? ( x ) ) . Following Ghadimi and Wang ( 2018 ) , we further make two smoothness assumptions on f and g : Assumption 2 . There exist positive constants Lf and B such that for all x , x′ ∈ X and y , y′ ∈ Y : ‖∇f ( x , y ) −∇f ( x′ , y′ ) ‖ ≤ Lf‖ ( x , y ) − ( x′ , y′ ) ‖ , ‖∂yf ( x , y ) ‖ ≤ B . Assumption 3 . There exit positive constants L′g , Mg such that for any x , x′ ∈ X and y , y′ ∈ Y : max { ‖∂xyg ( x , y ) − ∂xyg ( x′ , y′ ) ‖ , ‖∂yyg ( x , y ) − ∂yyg ( x′ , y′ ) ‖ } ≤Mg‖ ( x , y ) − ( x′ , y′ ) ‖ ‖∂yg ( x , y ) − ∂yg ( x′ , y ) ‖ ≤ L′g‖x− x′‖ . Assumptions 1 to 3 allow a control of the variations of y ? and z ? and ensure L is L-smooth for some positive constant L as shown in Proposition 6 of Appendix B.2 . As an L-smooth function , L is necessarily weakly convex ( Davis et al. , 2018 ) , meaning thatL satisfies the inequalityL ( x ) −L ( y ) ≤ ∇L ( x ) > ( x− y ) − µ2 ‖x− y‖ 2 for some fixed µ ∈ R with |µ| ≤ L. In particular , L is convex when µ ≥ 0 , strongly convex when µ > 0 and generally non-convex when µ < 0 . We thus consider two cases for L , the strongly convex case ( µ > 0 ) and the non-convex case ( µ < 0 ) . When L is convex , we denote by L ? its minimum value achieved at a point x ? and define κL=L/µ when µ > 0 . Stochastic/deterministic settings . We consider the general setting where f ( x , y ) and g ( x , y ) are expressed as an expectation of stochastic functions f̂ ( x , y , ξ ) and ĝ ( x , y , ξ ) over a noise variable ξ . We recover the deterministic setting as a particular case when the variable ξ has zero variance , thus allowing us to treat both stochastic ( S ) and deterministic ( D ) settings in a unified framework . As often in machine-learning , we assume we can always draw a new batch D of i.i.d . samples of the noise variable ξ with size |D| ≥ 1 and use it to compute stochastic approximations of f and g defined by abuse of notation as f̂ ( x , y , D ) : = 1|D| ∑ ξ∈D f̂ ( x , y , ξ ) and ĝ ( x , y , D ) : = 1 |D| ∑ ξ∈D ĝ ( x , y , ξ ) . We make the following noise assumptions which are implied by those in Ghadimi and Wang ( 2018 ) : Assumption 4 . For any batchD , ∇f̂ ( x , y , D ) and ∂y ĝ ( x , y , D ) are unbiased estimator of∇f ( x , y ) and ∂yg ( x , y ) with a uniformly bounded variance , i.e . for all x , y ∈ X × Y : E [ ∥∥∥∇f̂ ( x , y , D ) −∇f ( x , y ) ∥∥∥2 ] ≤ σ̃2f |D|−1 , E [ ‖∂y ĝ ( x , y , D ) − ∂yg ( x , y ) ‖2 ] ≤ σ̃2g |D|−1 . Assumption 5 . For any batch D , the matrices F1 ( x , y , D ) : = ∂xy ĝ ( x , y , D ) − ∂xyg ( x , y ) and F2 ( x , y , D ) : = ∂yy ĝ ( x , y , D ) − ∂yyg ( x , y ) have zero mean and satisfy for all x , y ∈ X × Y : ∥∥E [ F1 ( x , y , D ) > F1 ( x , y , D ) ] ∥∥op ≤ σ̃2gxy |D|−1 , ∥∥E [ F2 ( x , y , D ) > F2 ( x , y , D ) ] ∥∥op ≤ σ̃2gyy |D|−1 . For conciseness , we will use the notations σ2f : =σ̃ 2 f |D| −1 , σ2g : =σ̃ 2 g |D| −1 , σ2gxy : =σ̃ 2 gxy |D| −1 and σ2gyy : =σ̃ 2 gyy |D| −1 , without explicit reference to the batch D. Next , we describe the algorithm . | This work focuses on bilevel optimization. The key innovation here is the warm start, which enables improved complexity bounds (under some settings). The analysis nicely builds on singularly perturbed systems (SPS). Numerical tests are also provided on both synthetic and real problems, where the merit of warm start is demonstrated. | SP:857b454e408e1ad21ccb9372ad5feb89d95cb055 |
Optimized Separable Convolution: Yet Another Efficient Convolution Operator | The convolution operation is the most critical component in recent surge of deep learning research . Conventional 2D convolution needs O ( C2K2 ) parameters to represent , where C is the channel size and K is the kernel size . The amount of parameters has become really costly considering that these parameters increased tremendously recently to meet the needs of demanding applications . Among various implementations of the convolution , separable convolution has been proven to be more efficient in reducing the model size . For example , depth separable convolution reduces the complexity to O ( C · ( C + K2 ) ) while spatial separable convolution reduces the complexity to O ( C2K ) . However , these are considered ad hoc designs which can not ensure that they can in general achieve optimal separation . In this research , we propose a novel and principled operator called optimized separable convolution by optimal design for the internal number of groups and kernel sizes for general separable convolutions can achieve the complexity of O ( C 3 2K ) . When the restriction in the number of separated convolutions can be lifted , an even lower complexity at O ( C · log ( CK2 ) ) can be achieved . Experimental results demonstrate that the proposed optimized separable convolution is able to achieve an improved performance in terms of accuracy- # Params trade-offs over both conventional , depth-wise , and depth/spatial separable convolutions . 1 INTRODUCTION . Tremendous progresses have been made in recent years towards more accurate image analysis tasks , such as image classification , with deep convolutional neural networks ( DCNNs ) ( Krizhevsky et al. , 2012 ; Srivastava et al. , 2015 ; He et al. , 2016 ; Real et al. , 2019 ; Tan & Le , 2019 ; Dai et al. , 2020 ) . However , the complexity of state-of-the-art DCNN models has also become increasingly high . This can significantly deter their deployment to real-world applications , such as mobile platforms and robotics , where the resources and networks are highly constrained ( Howard et al. , 2017 ; Dai et al. , 2020 ) . The most resource-consuming building block of a DCNN is the convolutional layer . There have been many previous works aiming at reducing the amount of parameters in the convolutional layer . Network pruning ( Han et al. , 2015 ) strategies are developed to reduce redundant parameters that are not sensitive to performances . Quantization and binarization ( Gong et al. , 2014 ; Courbariaux et al. , 2016 ) techniques are introduced to compress the original network by reducing the number of bits required to represent each parameter . Low-rank factorization methods ( Jaderberg et al. , 2014 ; Ioannou et al. , 2015 ) are designed to approximate the original weights using matrix decomposition . Knowledge distillation ( Hinton et al. , 2015 ) is applied to train a compact network with distilled knowledge from a large ensemble model . However , all these existing methods start from a pre-trained model . Besides , they mainly focus on network compression and have limited or no improvements in terms of network acceleration . In this research , we study how to design a separable convolution to achieve an optimal implementation in terms of model size ( representational complexity ) . Enabling convolution to be separable has been proven to be an efficient way to reduce the representational complexity ( Sifre & Mallat , 2014 ; Howard et al. , 2017 ; Szegedy et al. , 2016 ) . Comparing to the network compression related approaches , a well-designed separable convolution shall be more efficient in both storage and computation and shall not require a pre-trained model to begin with . In the DCNN research , the two most well-known separable convolutions are depth separable ( Sifre & Mallat , 2014 ) and spatial separable ( Szegedy et al. , 2016 ) convolutions . Both are able to reduce the complexity of a convolution . The representational complexity of a conventional 2D convolution is quadratic with two hyper-parameters : number of channels ( C ) and kernel size ( K ) , and its representational complexity is actually O ( C2K2 ) . Depth separable convolution is constructed as a depth-wise convolution followed by a point-wise convolution , where depth-wise convolution is a group convolution with its number of groups g = C and point-wise convolution is a 1 × 1 convolution . Spatial separable convolution replaces a K × K kernel with a K × 1 and a 1 × K kernel . Different types of convolutions and their complexities are summarized in Table 1 . From this table , we can see that , for all convolutions , their computational complexities equal to the corresponding representational complexity times a constant . We can also verify that depth separable convolution has a complexity ofO ( C · ( C+K2 ) ) and spatial separable convolution has a complexity ofO ( C2K ) . Both depth and spatial separable convolutions follow an ad hoc design mode and are non-principled . They are able to reduce the complexity to some degree but normally can not achieve an optimal separation . A separable convolution in general has three sets of hyperparameters : the internal number of groups , channel size , and kernel size of each separated convolution . Instead of setting these hyperparameters in an ad hoc ( manual ) fashion , we design a novel and principled ( auto ) scheme to achieve an optimal separation . The resulting separable convolution is called optimized separable convolution in this research . The proposed scheme in general performs better than the other convolution operator counterparts and it also enriches the separable convolution family . To prevent the proposed optimized separable convolution from being degenerated , we assume that the internal channel size is in an order of O ( C ) and propose the following volumetric receptive field condition . As illustrated in Fig . 1a , similar to the receptive field ( RF ) of a convolution which is defined as the region in the input space that a particular CNN ’ s feature is looking at ( or affected by ) ( Lindeberg , 2013 ) , we define the volumetric RF of a convolution to be the volume in the input space that affects CNN ’ s output . The volumetric RF condition requires a properly decomposed separable convolution to maintain the same volumetric RF as the original convolution before decomposition . Hence , the proposed optimized separable convolution will be equivalent to optimizing the internal number of groups and kernel sizes to achieve the target objective ( measured in # Params ) while satisfying the proposed volumetric RF condition . Formally , the objective function is defined by Equation ( 2 ) under the constraints defined by Equations ( 3 ) - ( 6 ) . The solution to this optimization problem will be elaborated in Section 2 . We shall show that the proposed optimized separable convolution can be represented with the order of O ( C 3 2K ) . This is at least a factor of √ C more efficient than the depth and spatial separable convolutions . The proposed optimized separable convolution is able to be generalized into an N - separable case , where the number of separated convolutions N can be optimized further . In such a generalized case , an even lower complexity at O ( C · log ( CK2 ) ) may be achieved . Extensive experiments have been carried out to demonstrate the effectiveness of the proposed optimized separable convolution over other alternatives , including conventional , depth-wise , depth and spatial separable convolutions ( Fig . 3 ( c ) and Fig . 4 ( c ) ) . As further illustrated in Fig . 3 and Fig . 4 , on the CIFAR10 and CIFAR100 datasets ( Krizhevsky et al. , 2009 ) , the proposed optimized separable convolution achieves a better Pareto-frontier1 than both conventional and depth separable convolutions using the ResNet ( He et al. , 2016 ) architecture . To demonstrate that the proposed optimized separable convolution generalizes well to other DCNN architectures , we adopt the DARTS ( Liu et al. , 2018 ) architecture by replacing the depth separable convolution with the proposed optimized separable convolution . The accuracy is improved from 97.24 % to 97.67 % with reduced representational complexity . On the ImageNet dataset ( Deng et al. , 2009 ) , the proposed optimized separable convolution also achieves improved performance . For the DARTS architecture , the proposed approach achieves 74.2 % top1 accuracy with only 4.5 million parameters . For MobileNet , the proposed approach achieves 71.1 % top1 accuracy with only 3.0 million parameters . 2 THE PROPOSED APPROACH . 2.1 CONVOLUTION AND ITS COMPLEXITY . A convolutional layer takes an input tensor Bl−1 of shape ( Cl−1 , Hl−1 , Wl−1 ) and produces an output tensor Bl of shape ( Cl , Hl , Wl ) , where C∗ , H∗ , W∗ are input and output channels , feature heights and widths . The convolutional layer is parameterized with a convolutional kernel of shape ( Cl , Cl−1 , K H l , K W l ) , where K ∗ l are the kernel sizes , and the superscript indicates whether it is aligned with the features in height or width . In this research , we take C∗ = O ( C ) , H∗ = O ( H ) , W∗ = O ( W ) , and K H|W ∗ = O ( K ) for complexity analysis . Formally , we have Bl ( cl , hl , wl ) = ∑ cl−1 ∑ kHl ∑ kWl Bl−1 ( cl−1 , hl−1 , wl−1 ) · Fl ( cl , cl−1 , kHl , kWl ) , ( 1 ) where hl = hl−1 + kHl and wl = wl−1 + k W l . Hence , the number of parameters for convolution is ClCl−1K H l K W l and its representational complexity isO ( C 2K2 ) . The number of FLOPs ( multiplyadds ) for convolution isClHlWl ·Cl−1KHl KWl and its computational complexity isO ( C2K2HW ) . For a group convolution , we have g convolutions with kernels of shape ( Cl/g , Cl−1/g , KHl , K W l ) . Hence , it has O ( C2K2/g ) parameters and O ( C2K2HW/g ) FLOPs , where g is the number of groups . A depth-wise convolution is equivalent to a group convolution with g = C∗ = C. A pointwise convolution is a 1×1 convolution . A depth separable convolution is composed of a depth-wise convolution and a point-wise convolution . A spatial separable convolution replaces a K ×K kernel with K × 1 and 1 ×K kernels . Different types of convolutions are summarized in Table 1 . From this table , their number of parameters and FLOPs can be easily verified . It can also be seen that , for a convolution , its representational complexity is equivalent to its computational complexity for up to a constant ( HW ) . 2.2 RETHINKING CONVOLUTION AND THE VOLUMETRIC RECEPTIVE FIELD CONDITION . Separable convolution has been proven to be efficient in reducing the representational demand in convolution . However , existing approaches including both depth and spatial separable convolutions follow an ad hoc design and are non-principled . They are able to reduce the complexity to some extent but will not normally achieve an optimal separation . In this research , we shall design an 1In multi-objective optimization , a Pareto-frontier is the set of parameterizations ( allocations ) that are all Pareto-optimal . An allocation is Pareto-optimal if there is no alternative allocation where improvement can be made to one participant ’ s well-being without sacrificing any other ’ s . Here , Pareto-frontier represents the curve of the accuracies we are able to achieve for different # Params ( or FLOPs ) . efficient convolution operator capable of achieving the representational objective by optimal design of its internal hyper-parameters . The resulting operator is called optimized separable convolution . The proposed optimized separable convolution is called principled as it optimizes the representational complexity under the following volumetric receptive field condition . As illustrated in Fig . 1a , the receptive field ( RF ) of a convolution is defined to be the region in the input space that a particular CNN ’ s feature is affected by ( Lindeberg , 2013 ) . We define the channel RF to be the channels that affect CNN ’ s output and define the volumetric RF to be the Cartesian product of the RF and channel RF of this convolution . The volumetric RF of a convolution actually represents the volume in the input space that affects CNN ’ s output . The volumetric RF condition requires that a properly decomposed separable convolution at least maintains the same volumetric RF as the original convolution before decomposition . Hence , the proposed optimized separable convolution will be equivalent to optimizing its internal parameters while satisfying the volumetric RF condition . Formally , we shall have the objective function defined by Equation ( 2 ) and the volumetric RF constraints defined by Equations ( 3 ) - ( 6 ) . The volumetric RF of a convolution needs to be maintained for technical , conceptual , and experimental reasons . Technically , if we do not pose any restriction to a separable convolution , optimizing the representational complexity will resulting in a separable convolution being equivalent to a degenerated channel scaling operator2 . The composition of such operators is not meaningful because the composition itself is equivalent to a single channel scaling operator . Conceptually , maintaining the volumetric RF encourages the fusion of channel information , which shall contribute to the good performance of a DCNN . In fact , all modern DCNNs are designed following this rule . Without this channel information exchange , the performance of a DCNN shall be significantly degraded ( depth-wise vs depth separable convolutions in Section 3 ) . Finally , the necessity of maintaining the volumetric RF is experimentally verified . We shall quantize the degree of necessity as overlap coefficient ( γ ) in Section 2.3 and elaborate the experimental results in Section 3 . | The convolution operator is the fundamental unit of most modern DNNs. This paper summarizes the existing (efficient) convolution operators and formulates an optimization problem to choose a few important parameters for the convolution. The authors show that their convolution under certain constraints requires fewer parameters and operations compared to the commonly used operators. They evaluate their proposed operator on CIFAR10, CIFAR100, and on ImageNet. | SP:0e1607f0f226624429ad959c1f1ee2960fc7de53 |
Optimized Separable Convolution: Yet Another Efficient Convolution Operator | The convolution operation is the most critical component in recent surge of deep learning research . Conventional 2D convolution needs O ( C2K2 ) parameters to represent , where C is the channel size and K is the kernel size . The amount of parameters has become really costly considering that these parameters increased tremendously recently to meet the needs of demanding applications . Among various implementations of the convolution , separable convolution has been proven to be more efficient in reducing the model size . For example , depth separable convolution reduces the complexity to O ( C · ( C + K2 ) ) while spatial separable convolution reduces the complexity to O ( C2K ) . However , these are considered ad hoc designs which can not ensure that they can in general achieve optimal separation . In this research , we propose a novel and principled operator called optimized separable convolution by optimal design for the internal number of groups and kernel sizes for general separable convolutions can achieve the complexity of O ( C 3 2K ) . When the restriction in the number of separated convolutions can be lifted , an even lower complexity at O ( C · log ( CK2 ) ) can be achieved . Experimental results demonstrate that the proposed optimized separable convolution is able to achieve an improved performance in terms of accuracy- # Params trade-offs over both conventional , depth-wise , and depth/spatial separable convolutions . 1 INTRODUCTION . Tremendous progresses have been made in recent years towards more accurate image analysis tasks , such as image classification , with deep convolutional neural networks ( DCNNs ) ( Krizhevsky et al. , 2012 ; Srivastava et al. , 2015 ; He et al. , 2016 ; Real et al. , 2019 ; Tan & Le , 2019 ; Dai et al. , 2020 ) . However , the complexity of state-of-the-art DCNN models has also become increasingly high . This can significantly deter their deployment to real-world applications , such as mobile platforms and robotics , where the resources and networks are highly constrained ( Howard et al. , 2017 ; Dai et al. , 2020 ) . The most resource-consuming building block of a DCNN is the convolutional layer . There have been many previous works aiming at reducing the amount of parameters in the convolutional layer . Network pruning ( Han et al. , 2015 ) strategies are developed to reduce redundant parameters that are not sensitive to performances . Quantization and binarization ( Gong et al. , 2014 ; Courbariaux et al. , 2016 ) techniques are introduced to compress the original network by reducing the number of bits required to represent each parameter . Low-rank factorization methods ( Jaderberg et al. , 2014 ; Ioannou et al. , 2015 ) are designed to approximate the original weights using matrix decomposition . Knowledge distillation ( Hinton et al. , 2015 ) is applied to train a compact network with distilled knowledge from a large ensemble model . However , all these existing methods start from a pre-trained model . Besides , they mainly focus on network compression and have limited or no improvements in terms of network acceleration . In this research , we study how to design a separable convolution to achieve an optimal implementation in terms of model size ( representational complexity ) . Enabling convolution to be separable has been proven to be an efficient way to reduce the representational complexity ( Sifre & Mallat , 2014 ; Howard et al. , 2017 ; Szegedy et al. , 2016 ) . Comparing to the network compression related approaches , a well-designed separable convolution shall be more efficient in both storage and computation and shall not require a pre-trained model to begin with . In the DCNN research , the two most well-known separable convolutions are depth separable ( Sifre & Mallat , 2014 ) and spatial separable ( Szegedy et al. , 2016 ) convolutions . Both are able to reduce the complexity of a convolution . The representational complexity of a conventional 2D convolution is quadratic with two hyper-parameters : number of channels ( C ) and kernel size ( K ) , and its representational complexity is actually O ( C2K2 ) . Depth separable convolution is constructed as a depth-wise convolution followed by a point-wise convolution , where depth-wise convolution is a group convolution with its number of groups g = C and point-wise convolution is a 1 × 1 convolution . Spatial separable convolution replaces a K × K kernel with a K × 1 and a 1 × K kernel . Different types of convolutions and their complexities are summarized in Table 1 . From this table , we can see that , for all convolutions , their computational complexities equal to the corresponding representational complexity times a constant . We can also verify that depth separable convolution has a complexity ofO ( C · ( C+K2 ) ) and spatial separable convolution has a complexity ofO ( C2K ) . Both depth and spatial separable convolutions follow an ad hoc design mode and are non-principled . They are able to reduce the complexity to some degree but normally can not achieve an optimal separation . A separable convolution in general has three sets of hyperparameters : the internal number of groups , channel size , and kernel size of each separated convolution . Instead of setting these hyperparameters in an ad hoc ( manual ) fashion , we design a novel and principled ( auto ) scheme to achieve an optimal separation . The resulting separable convolution is called optimized separable convolution in this research . The proposed scheme in general performs better than the other convolution operator counterparts and it also enriches the separable convolution family . To prevent the proposed optimized separable convolution from being degenerated , we assume that the internal channel size is in an order of O ( C ) and propose the following volumetric receptive field condition . As illustrated in Fig . 1a , similar to the receptive field ( RF ) of a convolution which is defined as the region in the input space that a particular CNN ’ s feature is looking at ( or affected by ) ( Lindeberg , 2013 ) , we define the volumetric RF of a convolution to be the volume in the input space that affects CNN ’ s output . The volumetric RF condition requires a properly decomposed separable convolution to maintain the same volumetric RF as the original convolution before decomposition . Hence , the proposed optimized separable convolution will be equivalent to optimizing the internal number of groups and kernel sizes to achieve the target objective ( measured in # Params ) while satisfying the proposed volumetric RF condition . Formally , the objective function is defined by Equation ( 2 ) under the constraints defined by Equations ( 3 ) - ( 6 ) . The solution to this optimization problem will be elaborated in Section 2 . We shall show that the proposed optimized separable convolution can be represented with the order of O ( C 3 2K ) . This is at least a factor of √ C more efficient than the depth and spatial separable convolutions . The proposed optimized separable convolution is able to be generalized into an N - separable case , where the number of separated convolutions N can be optimized further . In such a generalized case , an even lower complexity at O ( C · log ( CK2 ) ) may be achieved . Extensive experiments have been carried out to demonstrate the effectiveness of the proposed optimized separable convolution over other alternatives , including conventional , depth-wise , depth and spatial separable convolutions ( Fig . 3 ( c ) and Fig . 4 ( c ) ) . As further illustrated in Fig . 3 and Fig . 4 , on the CIFAR10 and CIFAR100 datasets ( Krizhevsky et al. , 2009 ) , the proposed optimized separable convolution achieves a better Pareto-frontier1 than both conventional and depth separable convolutions using the ResNet ( He et al. , 2016 ) architecture . To demonstrate that the proposed optimized separable convolution generalizes well to other DCNN architectures , we adopt the DARTS ( Liu et al. , 2018 ) architecture by replacing the depth separable convolution with the proposed optimized separable convolution . The accuracy is improved from 97.24 % to 97.67 % with reduced representational complexity . On the ImageNet dataset ( Deng et al. , 2009 ) , the proposed optimized separable convolution also achieves improved performance . For the DARTS architecture , the proposed approach achieves 74.2 % top1 accuracy with only 4.5 million parameters . For MobileNet , the proposed approach achieves 71.1 % top1 accuracy with only 3.0 million parameters . 2 THE PROPOSED APPROACH . 2.1 CONVOLUTION AND ITS COMPLEXITY . A convolutional layer takes an input tensor Bl−1 of shape ( Cl−1 , Hl−1 , Wl−1 ) and produces an output tensor Bl of shape ( Cl , Hl , Wl ) , where C∗ , H∗ , W∗ are input and output channels , feature heights and widths . The convolutional layer is parameterized with a convolutional kernel of shape ( Cl , Cl−1 , K H l , K W l ) , where K ∗ l are the kernel sizes , and the superscript indicates whether it is aligned with the features in height or width . In this research , we take C∗ = O ( C ) , H∗ = O ( H ) , W∗ = O ( W ) , and K H|W ∗ = O ( K ) for complexity analysis . Formally , we have Bl ( cl , hl , wl ) = ∑ cl−1 ∑ kHl ∑ kWl Bl−1 ( cl−1 , hl−1 , wl−1 ) · Fl ( cl , cl−1 , kHl , kWl ) , ( 1 ) where hl = hl−1 + kHl and wl = wl−1 + k W l . Hence , the number of parameters for convolution is ClCl−1K H l K W l and its representational complexity isO ( C 2K2 ) . The number of FLOPs ( multiplyadds ) for convolution isClHlWl ·Cl−1KHl KWl and its computational complexity isO ( C2K2HW ) . For a group convolution , we have g convolutions with kernels of shape ( Cl/g , Cl−1/g , KHl , K W l ) . Hence , it has O ( C2K2/g ) parameters and O ( C2K2HW/g ) FLOPs , where g is the number of groups . A depth-wise convolution is equivalent to a group convolution with g = C∗ = C. A pointwise convolution is a 1×1 convolution . A depth separable convolution is composed of a depth-wise convolution and a point-wise convolution . A spatial separable convolution replaces a K ×K kernel with K × 1 and 1 ×K kernels . Different types of convolutions are summarized in Table 1 . From this table , their number of parameters and FLOPs can be easily verified . It can also be seen that , for a convolution , its representational complexity is equivalent to its computational complexity for up to a constant ( HW ) . 2.2 RETHINKING CONVOLUTION AND THE VOLUMETRIC RECEPTIVE FIELD CONDITION . Separable convolution has been proven to be efficient in reducing the representational demand in convolution . However , existing approaches including both depth and spatial separable convolutions follow an ad hoc design and are non-principled . They are able to reduce the complexity to some extent but will not normally achieve an optimal separation . In this research , we shall design an 1In multi-objective optimization , a Pareto-frontier is the set of parameterizations ( allocations ) that are all Pareto-optimal . An allocation is Pareto-optimal if there is no alternative allocation where improvement can be made to one participant ’ s well-being without sacrificing any other ’ s . Here , Pareto-frontier represents the curve of the accuracies we are able to achieve for different # Params ( or FLOPs ) . efficient convolution operator capable of achieving the representational objective by optimal design of its internal hyper-parameters . The resulting operator is called optimized separable convolution . The proposed optimized separable convolution is called principled as it optimizes the representational complexity under the following volumetric receptive field condition . As illustrated in Fig . 1a , the receptive field ( RF ) of a convolution is defined to be the region in the input space that a particular CNN ’ s feature is affected by ( Lindeberg , 2013 ) . We define the channel RF to be the channels that affect CNN ’ s output and define the volumetric RF to be the Cartesian product of the RF and channel RF of this convolution . The volumetric RF of a convolution actually represents the volume in the input space that affects CNN ’ s output . The volumetric RF condition requires that a properly decomposed separable convolution at least maintains the same volumetric RF as the original convolution before decomposition . Hence , the proposed optimized separable convolution will be equivalent to optimizing its internal parameters while satisfying the volumetric RF condition . Formally , we shall have the objective function defined by Equation ( 2 ) and the volumetric RF constraints defined by Equations ( 3 ) - ( 6 ) . The volumetric RF of a convolution needs to be maintained for technical , conceptual , and experimental reasons . Technically , if we do not pose any restriction to a separable convolution , optimizing the representational complexity will resulting in a separable convolution being equivalent to a degenerated channel scaling operator2 . The composition of such operators is not meaningful because the composition itself is equivalent to a single channel scaling operator . Conceptually , maintaining the volumetric RF encourages the fusion of channel information , which shall contribute to the good performance of a DCNN . In fact , all modern DCNNs are designed following this rule . Without this channel information exchange , the performance of a DCNN shall be significantly degraded ( depth-wise vs depth separable convolutions in Section 3 ) . Finally , the necessity of maintaining the volumetric RF is experimentally verified . We shall quantize the degree of necessity as overlap coefficient ( γ ) in Section 2.3 and elaborate the experimental results in Section 3 . | This paper proposed an optimized version of depth separable convolution. Optimal separable convolution reduces the model size by replacing both depth-wise and point-wise convolution with group convolution. Furthermore, they allow overlapped channel between group convolution and this was swept to show ablation comparisons. The authors showed that the combination of group convolution methods outperformed the previous ones when the volumetric receptive field (RF) conditions were met. | SP:0e1607f0f226624429ad959c1f1ee2960fc7de53 |
Improving Out-of-Distribution Robustness via Selective Augmentation | 1 INTRODUCTION . To deploy machine learning algorithms in real-world applications , we must pay attention to distribution shifts , i.e . when the test distribution is different from the training distribution , which substantially degrades model performance . In this paper , we refer this problem as out-of-distribution ( OOD ) generalization and specifically consider performance gaps caused by two kinds of distribution shifts : domain shifts and subpopulation shifts . In domain shifts , the test data is sampled from different domains than the training data , which requires the trained model to generalize well to test domains without seeing training data from those domains . Take health risk prediction as an example . We may want to train a model on patients from a few sampled hospitals and then deploy the model to a broader set of hospitals ( Koh et al. , 2021 ) . In subpopulation shifts , the proportions of subpopulations in the test distribution differ from the proportions in the training distribution . When subpopulation shift occur , models perform poorly when they falsely rely on spurious correlations , which may occur when some subpopulations are under-represented in the training set . For example , in financial risk prediction , a machine learning model trained on the entire population may associate the labels with demographic features ( e.g. , religion and race ) , making the model fail on the test set when such an association does not hold in reality . To improve model robustness under these two kinds of distribution shifts , methods for learning invariant representations have shown effectiveness in various applications . These methods learn features or prediction mechanisms that are invariant to different domains while still containing sufficient information for the targeted task ( Li et al. , 2018 ; Arjovsky et al. , 2019 ) . Concretely , some prior works learn invariant representations by aligning and regularizing the domain-specific representations ( Li et al. , 2018 ; Sun & Saenko , 2016 ) . Other works aim to find invariant representations by balancing the risk across domains using regularizers ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Rosenfeld et al. , 2021 ) , which further increases the dependency between the invariant representations and labels . However , designing regularizers that are widely suitable to datasets from diverse domains is especially challenging and insuitable regularizers may adversely limit the model ’ s expressive power , leading to inconsistent performance among various real-world datasets . For example , on the WILDS datasets ( Koh et al. , 2021 ) , invariant risk minimization ( IRM ) ( Arjovsky et al. , 2019 ) outperforms empirical risk minimization ( ERM ) on CivilComments , but fails to improve robustness on a variety of other datasets like Camelyon17 and RxRx1 . A similar phenomenon is also reflected in the performance of CORAL ( Sun & Saenko , 2016 ) . Instead of explicitly imposing regularization to learn invariant representations , we turn towards an implicit solution . Inspired by mixup ( Zhang et al. , 2018 ) , we aim to alleviate the effects of domainrelated spurious information through data interpolation , leading to a simple algorithm called LISA ( Learning Invariant Representations with Selective Augmentation ) . Concretely , LISA linearly interpolates the features for a pair of samples and applies the same interpolation strategy on the corresponding labels . Critically , the pairs are selectively chosen according to two sample selection strategies . In selection strategy I , LISA interpolates samples with the same label but from different domains , aiming to eliminate domain-related spurious correlations . In selection strategy II , LISA interpolates samples with the same domain but different labels , where the model should to ignore the domain information and generate different predicted values as the interpolation ratio changes . In this way , LISA encourages the model to learn domain-invariant predictors without explicitly constraining or regularizing the representation . The primary contributions of this paper are as follows : ( 1 ) We develop a method that tackles the problem of distribution shifts by canceling out the domain-related spurious correlations via data interpolation . ( 2 ) We conduct broad empirical experiments to evaluate the effectiveness of LISA on nine benchmark datasets from diverse domains . In these experiments , we make the following observations . First , we find that LISA consistently outperforms seven prior methods in addressing both domain shifts and subpopulation shifts . Second , we identify that the performance gains of LISA are indeed caused by canceling out domain-specific information and learning invariant representations , rather than simply involving more data via interpolation . Third , when the degree of distribution shift increases , LISA achieves more significant performance gains . ( 3 ) Finally , we provide theoretical analysis of the phenomena distilled from the empirical studies , where we provably demonstrate that LISA can achieve smaller worst-domain error compared with ERM and vanilla mixup . We also note that to the best of our knowledge , this is the first theoretical analysis of how mixup ( with or without the selection strategies ) affects mis-classification error . 2 PRELIMINARIES In this paper , we consider the setting where one predicts the label y ∈ Y based on the input feature x ∈ X . Given a parameter space Θ and a loss function ℓ , we are supposed to train a model fθ under the training distribution Ptr , where θ ∈ Θ . In empirical risk minimization ( ERM ) , assume the empirical distribution over training data is P̂tr , ERM optimizes the following objective : θ∗ : = argmin θ∈Θ E ( x , y ) ∼P̂ [ ℓ ( fθ ( x ) , y ) ] . ( 1 ) In a traditional machine learning setting , a test set , sampled from a test distribution Pts , is used to evaluate the generalization of the trained model θ∗ , where the test distribution is assumed to be the same as the training distribution , i.e. , P tr = P ts . In this paper , we are interested in the setting when distribution shift occurs , i.e. , P tr ̸= P ts . Specifically , follow Muandet et al . ( 2013 ) ; Albuquerque et al . ( 2019 ) ; Koh et al . ( 2021 ) , we regard the overall data distribution containing D = { 1 , . . . , D } domains and each domain d ∈ D is associated with a data distribution Pd over a set ( X , Y , d ) = { ( xi , yi , d ) } N d i=1 , where N d is the number of samples in domain d. Then , we formulate the training distribution as the mixture of D domains , i.e. , P tr = ∑ d∈D r tr d Pd , where { rtrd } denotes the mixture probabilities in training set . Here , the training domains are defined as Dtr = { d ∈ D|rtrd > 0 } . Similarly , the test distribution could be represented as P ts = ∑ d∈D r ts d Pd , where { rtsd } is the mixture probabilities in test set . The test domains are defined as Dts = { d ∈ D|rtsd > 0 } . In domain shifts , we investigate the problem that the test domains are disjoint from the training domains , i.e. , Dtr ∩ Dts = ∅ . In general , we assume the test domains share some common properties with the training domains . For example , in Camelyon17 ( Koh et al. , 2021 ) data , we train the model on some hospitals and test it in a new hospital . We evaluate the worst-domain or average performance of the classifier among all test domains . In subpopulation shifts , the test set have domains that have been seen in the training set , but with a different proportion of subpopulations , i.e. , Dts ⊆ Dtr but { rtsd } ≠ { rtrd } . Under this setting , follow Sagawa et al . ( 2020a ) , we specially consider group-based spurious correlations , where each group g ∈ G is defined to be associated with a domain d and a label y , i.e. , g = ( d , y ) . We assume the domain identification is spuriously correlated with the label . For example , we illustrate the Waterbirds dataset in Figure 1 , where the background d ( water or land ) is spuriously correlated with the label y ( waterbird or landbird ) . Based on the group definition , we evaluate the model via the worst test group error , i.e. , maxg E ( x , y ) ∼g [ ℓ0−1 ( fθ ( x ) , y ) ] , where ℓ0−1 represents the 0-1 loss . 3 LEARNING INVARIANT REPRESENTATIONS WITH SELECTIVE AUGMENTATION . This section presents LISA , a simple way to improve robustness to domain shifts or subpopulation shifts . The key idea behind LISA is to encourage the model to alleviate the effects of domain-related spurious correlations by selective data interpolation . Before detailing how to select interpolated samples , we first provide a general formulation for data interpolation . In LISA , we perform linear interpolation between training samples . Specifically , given samples ( xi , yi , di ) and ( xj , yj , dj ) drawn from domains di and dj , we apply mixup ( Zhang et al. , 2018 ) , a simple data interpolation strategy , separately on the input features and corresponding labels as : xmix = λxi + ( 1− λ ) xj , ymix = λyi + ( 1− λ ) yj , ( 2 ) where the interpolation ratio λ ∈ [ 0 , 1 ] is sampled from a Beta distribution Beta ( α , β ) and yi and yj are one-hot vectors for classification problem . Notice that the mixup approach in equation 2 can be replaced by CutMix ( Yun et al. , 2019 ) , which shows stronger empirical performance in visionbased applications . In text-based applications , we replace the feature interpolation in equation 2 with Manifold Mixup ( Verma et al. , 2019 ) , where the interpolation strategy is performed on the output representation of a pre-trained model , e.g. , the output of BERT ( Devlin et al. , 2019 ) . After obtaining the interpolated features and labels , we replace the original features and labels in ERM with the interpolated ones . Then , the optimization process in equation 1 is reformulated as : θ∗ : = argmin θ∈Θ E { ( xi , yi , di ) , ( xj , yj , dj ) } ∼P̂ [ ℓ ( fθ ( xmix ) , ymix ) ] . ( 3 ) Without additional selection strategies , vanilla mixup will regularize the model and reduce overfitting ( Zhang et al. , 2021b ) , allowing it to attain good in-distribution generalization . However , vanilla mixup may not be able to cancel out spurious correlations , causing the model to still fail at attaining good OOD generalization ( see empirical comparisons in Section 4.3 and theoretical discussion in Section 5 ) . In LISA , we instead adopt a new strategy where mixup is only applied across specific domains or groups , which leans towards learning invariant representations and thus better OOD performance . Specifically , the two kinds of sample selection strategies are presented as follows : • Selection Strategy I : Interpolating samples with the same label . In selection strategy I , LISA interpolates samples with the same label but different domains ( i.e. , di ̸= dj , yi = yj ) . This produces datapoints that have both domains partially present , effectively eliminating spurious correlations between domain and label in cases where the pair of domains correlate differently with the label . Additionally , if domain information does not fully reflect the spurious correlations in some datasets , we can also enlarge the interpolation scope to cover more potentially spurious correlations by only interpolating samples within the same class regardless domain information ( i.e. , yi = yj ) . As a result , LISA with selection strategy I should learn domain-invariant representations for each class and thus achieve better OOD robustness . • Selection Strategy II : Interpolating samples with the same domain . Supposing domain information is highly spuriously correlated with the label information , selection strategy II applies the interpolation strategy on samples with the same domain but different labels , i.e. , di = dj , yi ̸= yj . Intuitively , even within the same domain , the model is supposed to generate different predicted labels since the interpolation ratio λ is randomly sampled , corresponding to different labels ymix . This causes the model to make predictions that are less dependent on the domain , again improving OOD robustness . In LISA , we randomly perform selection strategies I or II during the training process with probability psel and 1−psel for each batch of data , where psel is treated as a hyperparameter in our experiments . The choice of psel depends on the number of domains and the relation between domain information and spurious correlations . Empirically , using selection strategy I only brings much more benefits when there are more domains , and/or the domain information can not fully reflect the spurious correlations . LISA with selection strategy II can benefit the performance when domain information is highly spuriously correlated with the label , where we find a balanced ratio ( i.e. , psel = 0.5 ) performs the best . The pseudocode of the training procedure of LISA is shown in Algorithm 1 . Algorithm 1 Training Procedure of LISA Require : Training data , Step size η 1 : while not converge do 2 : Sample λ ∼ Beta ( α , β ) 3 : Sample a set of samples B1 uniformly from the training data 4 : Randomly select a sample selection strategy I or II with the probability psel and 1− psel 5 : if use selection strategy I then 6 : For each sample ( xi , yi , di ) , find another one ( xj , yj , dj ) from the dataset with the same label ( yi = yj ) but different domains ( di ̸= dj ) , and construct set B2 . 7 : else if use selection strategy II then 8 : For each sample ( xi , yi , di ) , find another one ( xj , yj , dj ) from the same domain ( di = dj ) but different labels ( yi ̸= yj ) , constructing set B2 . 9 : Update θ with data λB1 + ( 1− λ ) B2 . | This paper propose a mixup-style data augmentation method under the data distribution shift context. In particular, data distributions are formulated as mixture of distributions (i.e., domains), and two distribution shift scenarios are considered: (1) domain shift, where the test domain and train domain are disjoint. (2) subpopulation shift, where test distribution has different mixture proportion than train distribution. It's assumed that domain identification spuriously correlates with labels. To tackle this problem, this paper proposes two mixup strategies: (I) mixup two examples with same label but different domains; (II) mixup two examples with same domain but different labels. It's claimed that such mixup could cancel out the spurious correlations. Extensive experiments on a variety of datasets show its superiority compared to empirical risk minimization (ERM) and alternative data augmentation methods. The paper further provide theoretical analysis that under certain conditions, the proposed method has asymptotically smaller worst case classification errors than ERM and vanilla mixup. | SP:ca6acbc11e7d3f693e4710fe6adb8d71cde3fe6b |
Improving Out-of-Distribution Robustness via Selective Augmentation | 1 INTRODUCTION . To deploy machine learning algorithms in real-world applications , we must pay attention to distribution shifts , i.e . when the test distribution is different from the training distribution , which substantially degrades model performance . In this paper , we refer this problem as out-of-distribution ( OOD ) generalization and specifically consider performance gaps caused by two kinds of distribution shifts : domain shifts and subpopulation shifts . In domain shifts , the test data is sampled from different domains than the training data , which requires the trained model to generalize well to test domains without seeing training data from those domains . Take health risk prediction as an example . We may want to train a model on patients from a few sampled hospitals and then deploy the model to a broader set of hospitals ( Koh et al. , 2021 ) . In subpopulation shifts , the proportions of subpopulations in the test distribution differ from the proportions in the training distribution . When subpopulation shift occur , models perform poorly when they falsely rely on spurious correlations , which may occur when some subpopulations are under-represented in the training set . For example , in financial risk prediction , a machine learning model trained on the entire population may associate the labels with demographic features ( e.g. , religion and race ) , making the model fail on the test set when such an association does not hold in reality . To improve model robustness under these two kinds of distribution shifts , methods for learning invariant representations have shown effectiveness in various applications . These methods learn features or prediction mechanisms that are invariant to different domains while still containing sufficient information for the targeted task ( Li et al. , 2018 ; Arjovsky et al. , 2019 ) . Concretely , some prior works learn invariant representations by aligning and regularizing the domain-specific representations ( Li et al. , 2018 ; Sun & Saenko , 2016 ) . Other works aim to find invariant representations by balancing the risk across domains using regularizers ( Arjovsky et al. , 2019 ; Krueger et al. , 2021 ; Rosenfeld et al. , 2021 ) , which further increases the dependency between the invariant representations and labels . However , designing regularizers that are widely suitable to datasets from diverse domains is especially challenging and insuitable regularizers may adversely limit the model ’ s expressive power , leading to inconsistent performance among various real-world datasets . For example , on the WILDS datasets ( Koh et al. , 2021 ) , invariant risk minimization ( IRM ) ( Arjovsky et al. , 2019 ) outperforms empirical risk minimization ( ERM ) on CivilComments , but fails to improve robustness on a variety of other datasets like Camelyon17 and RxRx1 . A similar phenomenon is also reflected in the performance of CORAL ( Sun & Saenko , 2016 ) . Instead of explicitly imposing regularization to learn invariant representations , we turn towards an implicit solution . Inspired by mixup ( Zhang et al. , 2018 ) , we aim to alleviate the effects of domainrelated spurious information through data interpolation , leading to a simple algorithm called LISA ( Learning Invariant Representations with Selective Augmentation ) . Concretely , LISA linearly interpolates the features for a pair of samples and applies the same interpolation strategy on the corresponding labels . Critically , the pairs are selectively chosen according to two sample selection strategies . In selection strategy I , LISA interpolates samples with the same label but from different domains , aiming to eliminate domain-related spurious correlations . In selection strategy II , LISA interpolates samples with the same domain but different labels , where the model should to ignore the domain information and generate different predicted values as the interpolation ratio changes . In this way , LISA encourages the model to learn domain-invariant predictors without explicitly constraining or regularizing the representation . The primary contributions of this paper are as follows : ( 1 ) We develop a method that tackles the problem of distribution shifts by canceling out the domain-related spurious correlations via data interpolation . ( 2 ) We conduct broad empirical experiments to evaluate the effectiveness of LISA on nine benchmark datasets from diverse domains . In these experiments , we make the following observations . First , we find that LISA consistently outperforms seven prior methods in addressing both domain shifts and subpopulation shifts . Second , we identify that the performance gains of LISA are indeed caused by canceling out domain-specific information and learning invariant representations , rather than simply involving more data via interpolation . Third , when the degree of distribution shift increases , LISA achieves more significant performance gains . ( 3 ) Finally , we provide theoretical analysis of the phenomena distilled from the empirical studies , where we provably demonstrate that LISA can achieve smaller worst-domain error compared with ERM and vanilla mixup . We also note that to the best of our knowledge , this is the first theoretical analysis of how mixup ( with or without the selection strategies ) affects mis-classification error . 2 PRELIMINARIES In this paper , we consider the setting where one predicts the label y ∈ Y based on the input feature x ∈ X . Given a parameter space Θ and a loss function ℓ , we are supposed to train a model fθ under the training distribution Ptr , where θ ∈ Θ . In empirical risk minimization ( ERM ) , assume the empirical distribution over training data is P̂tr , ERM optimizes the following objective : θ∗ : = argmin θ∈Θ E ( x , y ) ∼P̂ [ ℓ ( fθ ( x ) , y ) ] . ( 1 ) In a traditional machine learning setting , a test set , sampled from a test distribution Pts , is used to evaluate the generalization of the trained model θ∗ , where the test distribution is assumed to be the same as the training distribution , i.e. , P tr = P ts . In this paper , we are interested in the setting when distribution shift occurs , i.e. , P tr ̸= P ts . Specifically , follow Muandet et al . ( 2013 ) ; Albuquerque et al . ( 2019 ) ; Koh et al . ( 2021 ) , we regard the overall data distribution containing D = { 1 , . . . , D } domains and each domain d ∈ D is associated with a data distribution Pd over a set ( X , Y , d ) = { ( xi , yi , d ) } N d i=1 , where N d is the number of samples in domain d. Then , we formulate the training distribution as the mixture of D domains , i.e. , P tr = ∑ d∈D r tr d Pd , where { rtrd } denotes the mixture probabilities in training set . Here , the training domains are defined as Dtr = { d ∈ D|rtrd > 0 } . Similarly , the test distribution could be represented as P ts = ∑ d∈D r ts d Pd , where { rtsd } is the mixture probabilities in test set . The test domains are defined as Dts = { d ∈ D|rtsd > 0 } . In domain shifts , we investigate the problem that the test domains are disjoint from the training domains , i.e. , Dtr ∩ Dts = ∅ . In general , we assume the test domains share some common properties with the training domains . For example , in Camelyon17 ( Koh et al. , 2021 ) data , we train the model on some hospitals and test it in a new hospital . We evaluate the worst-domain or average performance of the classifier among all test domains . In subpopulation shifts , the test set have domains that have been seen in the training set , but with a different proportion of subpopulations , i.e. , Dts ⊆ Dtr but { rtsd } ≠ { rtrd } . Under this setting , follow Sagawa et al . ( 2020a ) , we specially consider group-based spurious correlations , where each group g ∈ G is defined to be associated with a domain d and a label y , i.e. , g = ( d , y ) . We assume the domain identification is spuriously correlated with the label . For example , we illustrate the Waterbirds dataset in Figure 1 , where the background d ( water or land ) is spuriously correlated with the label y ( waterbird or landbird ) . Based on the group definition , we evaluate the model via the worst test group error , i.e. , maxg E ( x , y ) ∼g [ ℓ0−1 ( fθ ( x ) , y ) ] , where ℓ0−1 represents the 0-1 loss . 3 LEARNING INVARIANT REPRESENTATIONS WITH SELECTIVE AUGMENTATION . This section presents LISA , a simple way to improve robustness to domain shifts or subpopulation shifts . The key idea behind LISA is to encourage the model to alleviate the effects of domain-related spurious correlations by selective data interpolation . Before detailing how to select interpolated samples , we first provide a general formulation for data interpolation . In LISA , we perform linear interpolation between training samples . Specifically , given samples ( xi , yi , di ) and ( xj , yj , dj ) drawn from domains di and dj , we apply mixup ( Zhang et al. , 2018 ) , a simple data interpolation strategy , separately on the input features and corresponding labels as : xmix = λxi + ( 1− λ ) xj , ymix = λyi + ( 1− λ ) yj , ( 2 ) where the interpolation ratio λ ∈ [ 0 , 1 ] is sampled from a Beta distribution Beta ( α , β ) and yi and yj are one-hot vectors for classification problem . Notice that the mixup approach in equation 2 can be replaced by CutMix ( Yun et al. , 2019 ) , which shows stronger empirical performance in visionbased applications . In text-based applications , we replace the feature interpolation in equation 2 with Manifold Mixup ( Verma et al. , 2019 ) , where the interpolation strategy is performed on the output representation of a pre-trained model , e.g. , the output of BERT ( Devlin et al. , 2019 ) . After obtaining the interpolated features and labels , we replace the original features and labels in ERM with the interpolated ones . Then , the optimization process in equation 1 is reformulated as : θ∗ : = argmin θ∈Θ E { ( xi , yi , di ) , ( xj , yj , dj ) } ∼P̂ [ ℓ ( fθ ( xmix ) , ymix ) ] . ( 3 ) Without additional selection strategies , vanilla mixup will regularize the model and reduce overfitting ( Zhang et al. , 2021b ) , allowing it to attain good in-distribution generalization . However , vanilla mixup may not be able to cancel out spurious correlations , causing the model to still fail at attaining good OOD generalization ( see empirical comparisons in Section 4.3 and theoretical discussion in Section 5 ) . In LISA , we instead adopt a new strategy where mixup is only applied across specific domains or groups , which leans towards learning invariant representations and thus better OOD performance . Specifically , the two kinds of sample selection strategies are presented as follows : • Selection Strategy I : Interpolating samples with the same label . In selection strategy I , LISA interpolates samples with the same label but different domains ( i.e. , di ̸= dj , yi = yj ) . This produces datapoints that have both domains partially present , effectively eliminating spurious correlations between domain and label in cases where the pair of domains correlate differently with the label . Additionally , if domain information does not fully reflect the spurious correlations in some datasets , we can also enlarge the interpolation scope to cover more potentially spurious correlations by only interpolating samples within the same class regardless domain information ( i.e. , yi = yj ) . As a result , LISA with selection strategy I should learn domain-invariant representations for each class and thus achieve better OOD robustness . • Selection Strategy II : Interpolating samples with the same domain . Supposing domain information is highly spuriously correlated with the label information , selection strategy II applies the interpolation strategy on samples with the same domain but different labels , i.e. , di = dj , yi ̸= yj . Intuitively , even within the same domain , the model is supposed to generate different predicted labels since the interpolation ratio λ is randomly sampled , corresponding to different labels ymix . This causes the model to make predictions that are less dependent on the domain , again improving OOD robustness . In LISA , we randomly perform selection strategies I or II during the training process with probability psel and 1−psel for each batch of data , where psel is treated as a hyperparameter in our experiments . The choice of psel depends on the number of domains and the relation between domain information and spurious correlations . Empirically , using selection strategy I only brings much more benefits when there are more domains , and/or the domain information can not fully reflect the spurious correlations . LISA with selection strategy II can benefit the performance when domain information is highly spuriously correlated with the label , where we find a balanced ratio ( i.e. , psel = 0.5 ) performs the best . The pseudocode of the training procedure of LISA is shown in Algorithm 1 . Algorithm 1 Training Procedure of LISA Require : Training data , Step size η 1 : while not converge do 2 : Sample λ ∼ Beta ( α , β ) 3 : Sample a set of samples B1 uniformly from the training data 4 : Randomly select a sample selection strategy I or II with the probability psel and 1− psel 5 : if use selection strategy I then 6 : For each sample ( xi , yi , di ) , find another one ( xj , yj , dj ) from the dataset with the same label ( yi = yj ) but different domains ( di ̸= dj ) , and construct set B2 . 7 : else if use selection strategy II then 8 : For each sample ( xi , yi , di ) , find another one ( xj , yj , dj ) from the same domain ( di = dj ) but different labels ( yi ̸= yj ) , constructing set B2 . 9 : Update θ with data λB1 + ( 1− λ ) B2 . | Authors introduced approaches aimed at learning invariant predictors across data sources. Rather than using distribution/risk matching schemes as often done by previous work, they propose to train models against mixtures of data points as a means to avoid that models rely on spurious correlations between domain and class labels, since such correlations observed during training might not hold at testing time. The proposed setting uses the idea of mixup to combine data instances in two different schemes: I-combine data points from the same class but different domains, and II-combine data points from the same domain but from different classes. | SP:ca6acbc11e7d3f693e4710fe6adb8d71cde3fe6b |
Best Practices in Pool-based Active Learning for Image Classification | 1 INTRODUCTION . Deep learning methods require large amounts of labeled data samples to train . Unfortunately , annotating new datasets consisting of thousands or millions of images is very costly . A research topic that focuses on maximizing the performance of deep learning models with a given annotation budget is active learning ( AL ) . AL is a machine learning ’ s sub-field in which the algorithm is allowed to query an information source for the label of new data samples ( Settles , 2009 ) . Recently , an abundance of pool-based AL methods for image classification have been proposed ( Caramalau et al. , 2021a ; b ; Kim et al. , 2021 ; Liu et al. , 2021 ; Choi et al. , 2021 ) . In pool-based AL ( Lewis & Gale , 1994 ) there exists a large unlabeled U and a small labeled sample set L. The labeled set is used to train the classifier and the large unlabeled set is used to query new samples that then are annotated and added to the labeled set in order to include them for training . The goal of pool-based AL is to iteratively sample and annotate unlabeled training samples from the pool and add them to the training set in order to achieve the best performance given a certain annotation budget . Pool based AL is often particularly useful because large amounts of unlabeled data is often available but annotating it is cumbersome and costly . In AL there exist multiple baselines that either form lower or upper bounds for AL methods . Typically , using all the unlabeled samples , annotate them and include them for training forms an upper bound that AL methods aim to reach with as few samples as possible . In contrast , selecting new samples that should be labeled and used for training randomly from the set of unlabeled samples establishes a lower bound that any AL method should exceed in every AL cycle . AL methods can be split into uncertainty or diversity based samples . The former select samples for which the classifier is uncertain ( Gal et al. , 2017 ; Beluch et al. , 2018 ; Yoo & Kweon , 2019 ; Mayer & Timofte , 2020 ) , while the latter selects samples in a diverse way ( Sener & Savarese , 2018 ; Sinha et al. , 2019 ; Gissin & Shalev-Shwartz , 2019 ; Caramalau et al. , 2021a ) , ensuring to cover the whole data distribution of the unlabeled set . Recently proposed strategies , are often still based on these concepts , combine them ( Ash et al. , 2019 ; Zhang et al. , 2020 ; Kim et al. , 2021 ) or propose new ideas such as using unlabeled data to train addition modules ( Shui et al. , 2020 ; Caramalau et al. , 2021b ) used for sample selection or combine AL with semi-supervised learning ( Sim ’ eoni et al. , 2021 ; Huang et al. , 2021 ; Gao et al. , 2020 ; Mittal et al. , 2019 ; Liao et al. , 2021 ) . The recent popularity of AL methods complicates comparing these works in a complete and standardized manner . However , assessing the improvements made by new methods is crucial to boost the progress in AL . Hence , this work provides best practices to keep in mind , when proposing new pool-based AL methods for image classification using deep learning and comparing them to existing methods form the literature . Contributions : In summary , our contributions are as follows : ( i ) We perform an extensive analysis of popular AL methods and study the effect of different settings typically used in the literature . ( ii ) In addition , we discuss the merit of recent trends in AL such as using unlabeled data , pretraining or initial set construction . ( iii ) We incorporate our findings into a collection of best practices to keep in mind when evaluating pool based AL methods for image classification . ( iv ) We make a new Pytorch code base available 1for AL that contains many popular AL methods and datasets and allows to evaluate and compare different strategies in a fair way . Code will be released upon publication . 2 RELATED WORK . AL evaluations : Recently the attention on benchmarking and unifying results of new AL strategies increased . Beck et al . ( 2021 ) conducted a rich set of experiments to evaluate the performance of AL methods , including ( Wei et al. , 2015 ; Sener & Savarese , 2018 ; Ash et al. , 2019 ; Killamsetty et al. , 2021 ) . They assessed the robustness of the methods by adding redundancy to the datasets , concluding that diversity based strategies are more stable in this scenario . In addition , they studied the effect of using data augmentation , using different optimizers , updating the models instead of reinitializing them in every iteration , and using different batch sizes . In contrast , we perform similar experiments but include more AL methods on multiple datasets , evaluated additional settings , and study the effect of using unlabeled samples for AL . Munjal et al . ( 2020 ) focused on benchmarking the strategies proposed in ( Gal et al. , 2017 ; Beluch et al. , 2018 ; Sener & Savarese , 2018 ; Sinha et al. , 2019 ) using a uniform experimental setting . They vary the AL batch size , the validation set size , and the amount of class imbalance . They find that under changing experimental condition no strategy offers gain over Random sampling . Conversely , our experiments show that AL methods clearly outperform Random sampling when training the classifier carefully . Chong et al . ( 2021 ) evaluates traditional AL methods and Coreset on an imbalanced medical dataset ( Rahman et al. , 2021 ) and on CIFAR10 . They highlight the importance of respecting class imbalance in AL and conclude that Coreset performs better than Uncertainty sampling . In contrast to these last two works , we omit analyzing the robustness of AL strategies on imbalanced datasets but rather focus on balanced datasets such as CIFAR10 . Investigated AL strategies : The investigated AL strategies are a relevant selection of recent deep pool based AL methods used in deep learning . In particular , we study Coreset , BADGE , LL4AL , JLS and WAAL , and Uncertainty sampling . We briefly summarize the most recent ones . Coreset ( Sener & Savarese , 2018 ) selects new unlabeled samples by solving the k-Center problem ( Wolf , 2011 ) on the feature space of the last fully-connected layer . Ash et al . ( 2019 ) propose an acquisition strategy ( BADGE ) based on k-MEANS++ ( Arthur & Vassilvitskii , 2007 ) , which is applied on so called hallucinated gradients with respect to the parameters of the final layer of the deep network . Hallucinated gradients are used because the true labels are not available for unlabeled samples . Therefore , the most likely labels according to the classifier are used to compute the gradient . Yoo & Kweon ( 2019 ) propose LL4AL , based on the assumption that data points for which the classification network is likely to produce a wrong prediction are most informative and should be used for training . To this end , they jointly train a target module and a loss prediction module that aims at predicting the loss of a given unlabeled sample . The samples achieving the highest losses are then added to the training set . JLS ( Caramalau et al. , 2021b ) employs a discriminator network besides the classifier . The task of the discriminator is differentiating whether a given sample belongs to the set of labeled or unlabeled samples . The samples that the discriminator predicts to be unlabeled with a high confidence are selected and annotated . JLS shares intermediate backbone layers for classification and discrimination such that training the discriminator with unlabeled data turns out to be beneficial for 1The code will be made available after publication . the classifier as well . Shui et al . ( 2020 ) propose an acquisition strategy ( WAAL ) that combines the uncertainty score of the task model with a diversity term based on the Wasserstein metric . To compute the diversity metric , an adversarial network is used that is optimized to discriminate between labeled and unlabeled data . Both networks share the same feature extractor and are jointly trained through a min-max optimization problem that uses labeled and unlabeled data . 3 EXPERIMENTAL SETUP . Since the accuracy range of AL methods extensively changes across the literature and their provided codebases , we provide our own that aims at maximizing AL accuracy for all the implemented methods . Our codebase builds upon a repository2 which only implements the LL4AL strategy for CIFAR10 and achieves the result presented in ( Yoo & Kweon , 2019 ) . We re-implement multiple other methods such as Random sampling , Uncertainty sampling , Coreset ( greedy K-center variant ) , BADGE , JLS , VAAL and include them into the codebase . Furthermore , we adapt the codebase in order to support additional datasets such as SVHN and FashionMNIST . The different methods can be tested on any dataset and our codebase allows to examine the effect of various different settings such as warm or cold start , different classifiers , unsupervised pretraining , changing the acquisition strategy to sample the initial dataset , different training settings , such as jointly training a discriminator or a loss prediction module for all methods . We use the settings in ( Yoo & Kweon , 2019 ) because they achieve results with high accuracy on CIFAR10 for all the reported methods . Note that the default settings serves mainly as comparison benchmark , and does not lead to the highest absolute accuracy for each method across all datasets . Unless stated otherwise , our default training setting is as follows : We use ResNet-18 ( He et al. , 2016 ) as backbone and train with a mini-batch size of 128 , for 200 epochs , with SGD optimizer , an initial learning rate of 0.1 , momentum of 0.9 and weight decay of 0.0005 . After training for 160 epochs , we decrease the learning rate to 0.01 . Instead of initializing the network weights in every AL cycle we use the weights of the network obtained in the previous AL cycle ( warm start ) . We use data augmentation ( random horizontal flips and random crop ) and normalize the input images . The initial training set consists of 1000 labeled samples . We add 1000 samples in each AL step , except for the experiments focusing on the use of unlabeled data where we use the JLS and WAAL settings . Our codebase allows to reproduce state-of-the-art results for the aforementioned methods for all three datasets , for different training setting and annotation budgets . All results reported in the paper are averaged over three runs with different random seeds . For the experiments we use three common datasets used in the AL literature : CIFAR10 ( Krizhevsky , 2009 ) , consisting of 60k 32 × 32 RGB images , divided into 50k training and 10k testing images split into 10 classes . The datasets are balanced , i.e . each class has the same number of images . SVHN ( Netzer et al. , 2011 ) contains images showing house numbers obtained from Google Street View . It consists of 73,257 training , 26,032 testing , and 53,1131 extra training images . The RGB images have a resolution of 32× 32 , are centered around a single digit and are split into 10 classes . The extra training images are not used in this work . FashionMNIST ( Xiao et al. , 2017 ) contains 28×28 gray-scale images showing articles from an online shop . The dataset consists of 60k training and 10k testing images . Figure 1 shows the results when using our codebase and the default settings on three datasets . In the paper we often report only the accuracy difference plots but omit the figures showing the absolute accuracy , or we only show the result on a single dataset , or we omit other AL strategies such as VAAL or JLS to keep the figures clean , or we only report the mean but omit the standard deviation . For additional plots containing all these results we refer the reader to the Appendix . | The paper provides benchmarking of some of the popular active learning methods on CIFAR10, SVHN and FashionMNIST datasets. Effects of factors such as choice of backbone, data augmentation, optimizers, learning rate, cold vs warm starting are studied and the conclusions are provided as best practices. Analysis is also performed w.r.t using unlabeled data, choosing the initial labeled pool (random vs K-Means++/K-Center), and unsupervised pre-training of the backbone. | SP:ce6ab36fc3d97a419858fb6f5dd6a0425a389b8b |
Best Practices in Pool-based Active Learning for Image Classification | 1 INTRODUCTION . Deep learning methods require large amounts of labeled data samples to train . Unfortunately , annotating new datasets consisting of thousands or millions of images is very costly . A research topic that focuses on maximizing the performance of deep learning models with a given annotation budget is active learning ( AL ) . AL is a machine learning ’ s sub-field in which the algorithm is allowed to query an information source for the label of new data samples ( Settles , 2009 ) . Recently , an abundance of pool-based AL methods for image classification have been proposed ( Caramalau et al. , 2021a ; b ; Kim et al. , 2021 ; Liu et al. , 2021 ; Choi et al. , 2021 ) . In pool-based AL ( Lewis & Gale , 1994 ) there exists a large unlabeled U and a small labeled sample set L. The labeled set is used to train the classifier and the large unlabeled set is used to query new samples that then are annotated and added to the labeled set in order to include them for training . The goal of pool-based AL is to iteratively sample and annotate unlabeled training samples from the pool and add them to the training set in order to achieve the best performance given a certain annotation budget . Pool based AL is often particularly useful because large amounts of unlabeled data is often available but annotating it is cumbersome and costly . In AL there exist multiple baselines that either form lower or upper bounds for AL methods . Typically , using all the unlabeled samples , annotate them and include them for training forms an upper bound that AL methods aim to reach with as few samples as possible . In contrast , selecting new samples that should be labeled and used for training randomly from the set of unlabeled samples establishes a lower bound that any AL method should exceed in every AL cycle . AL methods can be split into uncertainty or diversity based samples . The former select samples for which the classifier is uncertain ( Gal et al. , 2017 ; Beluch et al. , 2018 ; Yoo & Kweon , 2019 ; Mayer & Timofte , 2020 ) , while the latter selects samples in a diverse way ( Sener & Savarese , 2018 ; Sinha et al. , 2019 ; Gissin & Shalev-Shwartz , 2019 ; Caramalau et al. , 2021a ) , ensuring to cover the whole data distribution of the unlabeled set . Recently proposed strategies , are often still based on these concepts , combine them ( Ash et al. , 2019 ; Zhang et al. , 2020 ; Kim et al. , 2021 ) or propose new ideas such as using unlabeled data to train addition modules ( Shui et al. , 2020 ; Caramalau et al. , 2021b ) used for sample selection or combine AL with semi-supervised learning ( Sim ’ eoni et al. , 2021 ; Huang et al. , 2021 ; Gao et al. , 2020 ; Mittal et al. , 2019 ; Liao et al. , 2021 ) . The recent popularity of AL methods complicates comparing these works in a complete and standardized manner . However , assessing the improvements made by new methods is crucial to boost the progress in AL . Hence , this work provides best practices to keep in mind , when proposing new pool-based AL methods for image classification using deep learning and comparing them to existing methods form the literature . Contributions : In summary , our contributions are as follows : ( i ) We perform an extensive analysis of popular AL methods and study the effect of different settings typically used in the literature . ( ii ) In addition , we discuss the merit of recent trends in AL such as using unlabeled data , pretraining or initial set construction . ( iii ) We incorporate our findings into a collection of best practices to keep in mind when evaluating pool based AL methods for image classification . ( iv ) We make a new Pytorch code base available 1for AL that contains many popular AL methods and datasets and allows to evaluate and compare different strategies in a fair way . Code will be released upon publication . 2 RELATED WORK . AL evaluations : Recently the attention on benchmarking and unifying results of new AL strategies increased . Beck et al . ( 2021 ) conducted a rich set of experiments to evaluate the performance of AL methods , including ( Wei et al. , 2015 ; Sener & Savarese , 2018 ; Ash et al. , 2019 ; Killamsetty et al. , 2021 ) . They assessed the robustness of the methods by adding redundancy to the datasets , concluding that diversity based strategies are more stable in this scenario . In addition , they studied the effect of using data augmentation , using different optimizers , updating the models instead of reinitializing them in every iteration , and using different batch sizes . In contrast , we perform similar experiments but include more AL methods on multiple datasets , evaluated additional settings , and study the effect of using unlabeled samples for AL . Munjal et al . ( 2020 ) focused on benchmarking the strategies proposed in ( Gal et al. , 2017 ; Beluch et al. , 2018 ; Sener & Savarese , 2018 ; Sinha et al. , 2019 ) using a uniform experimental setting . They vary the AL batch size , the validation set size , and the amount of class imbalance . They find that under changing experimental condition no strategy offers gain over Random sampling . Conversely , our experiments show that AL methods clearly outperform Random sampling when training the classifier carefully . Chong et al . ( 2021 ) evaluates traditional AL methods and Coreset on an imbalanced medical dataset ( Rahman et al. , 2021 ) and on CIFAR10 . They highlight the importance of respecting class imbalance in AL and conclude that Coreset performs better than Uncertainty sampling . In contrast to these last two works , we omit analyzing the robustness of AL strategies on imbalanced datasets but rather focus on balanced datasets such as CIFAR10 . Investigated AL strategies : The investigated AL strategies are a relevant selection of recent deep pool based AL methods used in deep learning . In particular , we study Coreset , BADGE , LL4AL , JLS and WAAL , and Uncertainty sampling . We briefly summarize the most recent ones . Coreset ( Sener & Savarese , 2018 ) selects new unlabeled samples by solving the k-Center problem ( Wolf , 2011 ) on the feature space of the last fully-connected layer . Ash et al . ( 2019 ) propose an acquisition strategy ( BADGE ) based on k-MEANS++ ( Arthur & Vassilvitskii , 2007 ) , which is applied on so called hallucinated gradients with respect to the parameters of the final layer of the deep network . Hallucinated gradients are used because the true labels are not available for unlabeled samples . Therefore , the most likely labels according to the classifier are used to compute the gradient . Yoo & Kweon ( 2019 ) propose LL4AL , based on the assumption that data points for which the classification network is likely to produce a wrong prediction are most informative and should be used for training . To this end , they jointly train a target module and a loss prediction module that aims at predicting the loss of a given unlabeled sample . The samples achieving the highest losses are then added to the training set . JLS ( Caramalau et al. , 2021b ) employs a discriminator network besides the classifier . The task of the discriminator is differentiating whether a given sample belongs to the set of labeled or unlabeled samples . The samples that the discriminator predicts to be unlabeled with a high confidence are selected and annotated . JLS shares intermediate backbone layers for classification and discrimination such that training the discriminator with unlabeled data turns out to be beneficial for 1The code will be made available after publication . the classifier as well . Shui et al . ( 2020 ) propose an acquisition strategy ( WAAL ) that combines the uncertainty score of the task model with a diversity term based on the Wasserstein metric . To compute the diversity metric , an adversarial network is used that is optimized to discriminate between labeled and unlabeled data . Both networks share the same feature extractor and are jointly trained through a min-max optimization problem that uses labeled and unlabeled data . 3 EXPERIMENTAL SETUP . Since the accuracy range of AL methods extensively changes across the literature and their provided codebases , we provide our own that aims at maximizing AL accuracy for all the implemented methods . Our codebase builds upon a repository2 which only implements the LL4AL strategy for CIFAR10 and achieves the result presented in ( Yoo & Kweon , 2019 ) . We re-implement multiple other methods such as Random sampling , Uncertainty sampling , Coreset ( greedy K-center variant ) , BADGE , JLS , VAAL and include them into the codebase . Furthermore , we adapt the codebase in order to support additional datasets such as SVHN and FashionMNIST . The different methods can be tested on any dataset and our codebase allows to examine the effect of various different settings such as warm or cold start , different classifiers , unsupervised pretraining , changing the acquisition strategy to sample the initial dataset , different training settings , such as jointly training a discriminator or a loss prediction module for all methods . We use the settings in ( Yoo & Kweon , 2019 ) because they achieve results with high accuracy on CIFAR10 for all the reported methods . Note that the default settings serves mainly as comparison benchmark , and does not lead to the highest absolute accuracy for each method across all datasets . Unless stated otherwise , our default training setting is as follows : We use ResNet-18 ( He et al. , 2016 ) as backbone and train with a mini-batch size of 128 , for 200 epochs , with SGD optimizer , an initial learning rate of 0.1 , momentum of 0.9 and weight decay of 0.0005 . After training for 160 epochs , we decrease the learning rate to 0.01 . Instead of initializing the network weights in every AL cycle we use the weights of the network obtained in the previous AL cycle ( warm start ) . We use data augmentation ( random horizontal flips and random crop ) and normalize the input images . The initial training set consists of 1000 labeled samples . We add 1000 samples in each AL step , except for the experiments focusing on the use of unlabeled data where we use the JLS and WAAL settings . Our codebase allows to reproduce state-of-the-art results for the aforementioned methods for all three datasets , for different training setting and annotation budgets . All results reported in the paper are averaged over three runs with different random seeds . For the experiments we use three common datasets used in the AL literature : CIFAR10 ( Krizhevsky , 2009 ) , consisting of 60k 32 × 32 RGB images , divided into 50k training and 10k testing images split into 10 classes . The datasets are balanced , i.e . each class has the same number of images . SVHN ( Netzer et al. , 2011 ) contains images showing house numbers obtained from Google Street View . It consists of 73,257 training , 26,032 testing , and 53,1131 extra training images . The RGB images have a resolution of 32× 32 , are centered around a single digit and are split into 10 classes . The extra training images are not used in this work . FashionMNIST ( Xiao et al. , 2017 ) contains 28×28 gray-scale images showing articles from an online shop . The dataset consists of 60k training and 10k testing images . Figure 1 shows the results when using our codebase and the default settings on three datasets . In the paper we often report only the accuracy difference plots but omit the figures showing the absolute accuracy , or we only show the result on a single dataset , or we omit other AL strategies such as VAAL or JLS to keep the figures clean , or we only report the mean but omit the standard deviation . For additional plots containing all these results we refer the reader to the Appendix . | This paper conducts an extensive analysis of state-of-the-art Active Learning (AL) methods (Coreset, BADGE, LL4AL, JLS, and WAAL) and studies the effect of different training settings (Backbone architecture, Initializing backbone weights, Optimizer, and learning rates, with and without data augmentation) and their effect on AL evaluation for image classification. It also highlights the main factors that can influence the performance of AL methods: the construction of an initial training set following a certain strategy instead of random sampling, and pretraining the backbone of the network in an unsupervised manner. In addition, it provides solid benchmarks to compare new with existing methods in sections 5 and 6. | SP:ce6ab36fc3d97a419858fb6f5dd6a0425a389b8b |
HYPOCRITE: Homoglyph Adversarial Examples for Natural Language Web Services in the Physical World | 1 INTRODUCTION . Artificial Intelligence ( AI ) has shown the potential of convenience in many domains . With the advance of AI , people are living affluent lives by AI . AI can judge what is difficult for humans to make , classify what humans struggle with , predict what humans can never measure , and even recommend tasks that fall within a pattern ( Naumov et al . ( 2019 ) ) . Due to the development of the AI industry , it is not an exaggeration to say that mankind coexists with AI as many companies in various industries are trying to use AI by grafting it into their domains . As the demand on AI increases , various cloud service providers ( e.g. , Amazon Comprehend ( Amazon ) , Google Cloud Natural Language ( Google ) , Watson Natural Language Understanding ( IBM ) , and Text Analytics ( Microsoft ) are providing easy-to-use Machine-Learning-as-a-Service ( Ribeiro et al . ( 2015 ) ) to people and companies who want to use AI services through their cloud . Among the MLaaS , Natural Language Processing ( NLP ) based on text is one of the important AI services . NLP , which contains various information such as emotional and semantic analysis of text-based data ( Dang et al . ( 2020 ) ; Kamath & Ananthanarayana ( 2016 ) ) , can be used to develop platforms for various recommendation systems . For example , it is possible to provide effective data analysis to corporate management based on quick information delivery by identifying the needs of users and identifying only the core of a system or long article based on the sentiment analysis ? sentimentanalysis ) based on the user ’ s review . Like this various cloud service providers ’ MLaaS superiority is sufficiently proven through many studies . However , although these AI services are very advanced and well-made , security vulnerabilities are still existing . Because these security vulnerabilities can interfere with normal AI services , so cause a fatal problem , the integrity of such services should be protected . This paper shows the security vulnerabilities for natural language web services in the physical world ( Rodriguez et al . ( 2019 ) ) . The key idea of the adversarial examples ( Goodfellow et al . ( 2014 ) ; Creswell et al . ( 2018 ) ) for natural language web services is to replace English characters with other similar international characters ( e.g. , homoglyph ) in order to give the dataset noise ( Boucher et al . ( 2021 ) ) . By using this key idea , parts of text can be appropriately replaced with subtext with malicious meaning through black-box attacks ( Ilyas et al . ( 2018 ) ) for natural language web services in order to cause misclassification . The main contributions of this paper are summarized as follows : • Text adversarial examples for natural language web services in the Physical World : In order to show the feasibility of our attack , we implemented a framework that can generate text adversarial examples for natural language web services in the physical world ( see Section 3 ) . • Untargeted attacks and targeted attacks : For various goals of the adversarial attacks , we carried out the text adversarial attacks for not only non-targeted attacks ( i.e. , misclassification ) but also targeted attacks ( i.e. , targeted misclassification and source/target misclassification ) ( see Section 3 ) . • The performance evaluation of the proposed framework : Through extensive experiments , it is shown that the proposed framework outperforms a baseline framework in terms of both attack success rate and perturbed ratio ( see Section 4 ) . • The impact of human understanding : To evaluate the attack text generated by our proposed adversarial attack model , we used Amazon Mechanical Turk ( Mturk ) how difficult it is to find the attacked word , we conducted a survey using the attack text and obtained and analyzed the success rate of the attack on the survey problem ( see Section 4.2.2 ) . The remainder of this paper is organized as follows . The background and related work of text adversarial examples is given in Section 2 . Section 3 describes the overview of the proposed adversarial attack and explains the process of the text adversarial attack of generating text adversarial examples for natural language web services in the physical world . Section 4 evaluates the performance of the our proposed framework through misclassification attacks for sentiment analysis of natural language web services in the physical world . Section 5 discusses some research challenges for our attack . Finally , Section 6 concludes this paper along with future work . 2 RELATED WORK . Research on Adversarial attacks for NLP models has been presented . In 2016 , ( Papernot et al . ( 2016 ) ) proposes a method to craft a sequential input on Recurrent Neural Network ( RNN ) models to manipulate an output of classifiers . ( Ebrahimi et al . ( 2017 ) ) presents a method to generate adversarial examples for text classification by crafting a few characters of an input string . Unlike ( Ebrahimi et al . ( 2017 ) ) whose attacks were white-box adversarial examples , ( Gao et al . ( 2018 ) ) used black-box adversarial text sequence to make deep learning-based classifiers misclassify . ( Li et al . ( 2018 ) ) shows various methodologies to generate adversarial text for NLP models , and evaluates that popular NLP services for web services are vulnerable to those attacks . In our work , we show a new methodology to generate adversarial text which is not considered in ( Li et al . ( 2018 ) ) , and also show that most of the NLP services are still vulnerable to our attack . ( Wolff & Wolff ( 2020 ) ) proposes homoglyph attacks generating adversarial examples to neural text detectors . Our attacks are targeted to sentimental analysis services in the real world , and we try to perturb every unit of target text ( e.g. , word , sentence , and paragraph ) instead of replacing several letters with homoglyphs in order to show the most effective way to generate adversarial examples . 3 ATTACK MODEL . This section presents the goal , overview , and attack process of HYPOCRITE . The goal of HYPOCRITE is to generate text adversarial examples for a sentiment analysis of natural language web services in the physical world . In other words , the generated adversarial examples can cause misclassification from positive sentiment to negative sentiment or from negative sentiment to positive sentiment . 3.1 HYPOCRITE OVERVIEW . In this subsection , the proposed HYPOCRITE for generating homoglyph adversarial examples is described . The key idea of the HYPOCRITE is to replace English characters with other similar international characters ( i.e. , homoglyph ) in order to give dataset noise . Such dataset noise can cause misclassification different from the original results . This is because the original meaning disappears due to the noise . With this key idea , HYPOCRITE can generate homoglyph adversarial examples by appropriately changing text from a word unit to a paragraph through a black-box attacks for natural language web services . The homoglyph adversarial examples mean text that looks the same to the human , but causes different results through AI services . Figure 1 shows the four homoglyph adversarial examples for sentiment analysis web services ( i.e. , Amazon comprehend , Google cloud natural language AI , IBM Watson natural language understanding , and Microsoft text analytics ) generated by HYPOCRITE . As homoglyph adversarial examples , characters with red color and bold font mean homoglyph that looks the same to our eyes but has different Unicode values . As shown in Figure 1 , although they look like the same text to perception , the result of the sentiment analysis web service is different from positive to negative , respectively . The user study on the perception of human for adversarial examples is explained in detail in Section 4.2.2 , and the score for each MLaaS company ’ s sentiment analysis result is explained in detail in Section 4.1 . 3.2 ADVERSARIAL EXAMPLE GENERATION . Algorithm 1 : Non-Targeted Adversarial Example Generation resulttext ← get sentiment ( target model , text ) ; units← [ word , sentence , paragraph ] ; for unit ∈ units do tokens← tokenize ( resulttext , unit ) ; for token ∈ tokens do resulttoken ← get sentiment ( target model , token ) ; if min sentiment ( resulttoken ) is not original sentiment then Append resulttoken to attackers ; end end attackers← Sort ( attackers ) according to descending of original sentiment ; for resulttoken ∈ attackers do AE ← make adversarial example ( resulttext , resulttoken ) ; resultAE ← get sentiment ( target model , AE ) ; if sentiment of resultAE is changed then return AE ; else if original sentiment score of resultAE is less than original sentiment score of resulttext then resulttext ← resultAE ; end end end end Algorithm 2 : Targeted Adversarial Example Generation resulttext ← get sentiment ( target model , text ) ; unitss← [ word , sentence , paragraph ] ; for unit ∈ units do tokens← tokenize ( resulttext , unit ) ; for token ∈ tokens do resulttoken ← get sentiment ( target model , token ) ; if max sentiment ( resulttoken ) is not target sentiment then Append resulttoken to attackers ; end end attackers← Sort ( attackers ) according to ascending of target sentiment ; for resulttoken ∈ attackers do AE ← make adversarial example ( resulttext , resulttoken ) ; resultAE ← get sentiment ( target model , AE ) ; if sentiment of resultAE is target sentiment then return AE ; else difftarget ← target sentiment score of resultAE − target sentiment score of resulttext ; diffmax ← max sentiment score of resultAE − max sentiment score of resulttext ; if difftarget is more than 0 and difftarget is more than diffmax then resulttext ← resultAE ; end end end end This subsection describes the process of our HYPOCRITE that generates homoglyph adversarial examples for sentiment analysis web services in the physical world . The adversarial example generation is classified into a non-targeted adversarial example generation and a targeted adversarial example generation . The non-targeted adversarial example generation means to generate homoglyph adversarial examples that misclassify a positive sentiment into sentiments other than the positive sentiment , or a negative sentiment into sentiments other than the negative sentiment . The targeted adversarial example generation means to generate homoglyph adversarial examples that misclassify a positive sentiment into target sentiments ( e.g. , negative , neutral , and mixed ) , or a negative sentiment into target sentiments ( e.g. , positive , neutral , and mixed ) . Algorithms 1 and 2 show an adversarial example generation algorithm of the HYPOCRITE . As shown in Algorithms 1 and 2 , for the adversarial example generation , HYPOCRITE consists of five steps : ( i ) Get score of original text ( i ) Tokenize the text , ( iii ) Get score of the tokens and sorting , ( iv ) Make adversarial examples , and ( v ) Verify the effectiveness of the adversarial examples . Through this process , the non-targeted and targeted adversarial examples are generated , respectively . 4 EXPERIMENTS . 4.1 EXPERIMENTAL-SETUP . Dataset We used IMDB Dataset to evaluate our attacks on sentimental analysis ( Maas et al . ( 2011 ) ) . IMDB contains 25,000 reviews for each positive and negative label , respectively . In our experiments , to determine the effect of text length on the success of the adversarial example , the dataset used in the experiment was divided into seven sections by length . The first section is 500 characters or less , and the second section is 500 characters or more and 800 characters or less . The third section is 800 characters or more and 1,100 characters or less , and the fourth section is 1,100 characters or more and 1,400 characters or less . The fifth section is 1,400 characters or more and 1,700 characters or less , and the sixth section is 1,700 characters or more and 2,100 characters or less . The last seventh sections are over 2,100 characters.Then , we randomly sampled 96 review data per divided section . The number of sample reviews ( 96 reviews ) in our evaluation was determined by a statistically recommended sample size when the confidential level is 95 % , the population size is 50,000 , and the margin of error is 10 % . Targeted Models To evaluate our attacks , we performed the attacks on four sentimental analysis services ( Amazon , Google , IBM , and Microsoft ) in real world . Since every service had different sentimental labels and scoring systems , we briefly described labeling and scoring metric for each system in Table 1 . Amazon and Microsoft use four sentimental labels ( Positive , Negative , Neutral , and Mixed ) , and the systems provide each score for all the labels . In addition , the final output as the re- sult is the label which is the biggest score among the sentimental labels . On the other hand , IBM uses three sentimental labels ( i.e. , Positive , Negative , and Neutral ) and Google dose not provide any exact label . Both systems provide overall score of the input texts as final output ranging from -1 to 1 ( The score closer to -1 means negative , and to 1 means positive ) . As there is no sentimental decision provided from the systems , we considered the score less than 0 as negative , and more than 0 as positive . Baseline To compare the performance of our attack , we evaluate our attack with an attack which is the most similar method to ours ( Wolff & Wolff ( 2020 ) ) . In ( Wolff & Wolff ( 2020 ) ) , the attack is targeted to the neural text detectors . Therefore , we performed the baseline attack to our targeted systems and measure the performance of the attack . Evaluation Metrics In order to evaluate the algorithmic performance , we adopt two metrics such as attack success rate and perturbed rate . The average attack success rate is defined as the ratio of generated adversarial examples that cause misclassification to randomly selected samples . In order to show diversity , we evaluated the performance under various misclassification conditions such as non-targeted misclassification and targeted misclassification . The perturbed rate is defined as the ratio of replaced characters to the total characters throughout the sentence . | This paper proposes using homoglyphs to attack commercial NLP models for sentiment classification. Homoglyphs look like the characters in English language but they are encoded differently and, therefore, treated differently by the model. They experiment on various MLaaS models and show that their attack can effectively cause both targeted and untargeted misclassifications. | SP:dccdd07d4daa907b04b330248f9a796cf2e2f361 |
HYPOCRITE: Homoglyph Adversarial Examples for Natural Language Web Services in the Physical World | 1 INTRODUCTION . Artificial Intelligence ( AI ) has shown the potential of convenience in many domains . With the advance of AI , people are living affluent lives by AI . AI can judge what is difficult for humans to make , classify what humans struggle with , predict what humans can never measure , and even recommend tasks that fall within a pattern ( Naumov et al . ( 2019 ) ) . Due to the development of the AI industry , it is not an exaggeration to say that mankind coexists with AI as many companies in various industries are trying to use AI by grafting it into their domains . As the demand on AI increases , various cloud service providers ( e.g. , Amazon Comprehend ( Amazon ) , Google Cloud Natural Language ( Google ) , Watson Natural Language Understanding ( IBM ) , and Text Analytics ( Microsoft ) are providing easy-to-use Machine-Learning-as-a-Service ( Ribeiro et al . ( 2015 ) ) to people and companies who want to use AI services through their cloud . Among the MLaaS , Natural Language Processing ( NLP ) based on text is one of the important AI services . NLP , which contains various information such as emotional and semantic analysis of text-based data ( Dang et al . ( 2020 ) ; Kamath & Ananthanarayana ( 2016 ) ) , can be used to develop platforms for various recommendation systems . For example , it is possible to provide effective data analysis to corporate management based on quick information delivery by identifying the needs of users and identifying only the core of a system or long article based on the sentiment analysis ? sentimentanalysis ) based on the user ’ s review . Like this various cloud service providers ’ MLaaS superiority is sufficiently proven through many studies . However , although these AI services are very advanced and well-made , security vulnerabilities are still existing . Because these security vulnerabilities can interfere with normal AI services , so cause a fatal problem , the integrity of such services should be protected . This paper shows the security vulnerabilities for natural language web services in the physical world ( Rodriguez et al . ( 2019 ) ) . The key idea of the adversarial examples ( Goodfellow et al . ( 2014 ) ; Creswell et al . ( 2018 ) ) for natural language web services is to replace English characters with other similar international characters ( e.g. , homoglyph ) in order to give the dataset noise ( Boucher et al . ( 2021 ) ) . By using this key idea , parts of text can be appropriately replaced with subtext with malicious meaning through black-box attacks ( Ilyas et al . ( 2018 ) ) for natural language web services in order to cause misclassification . The main contributions of this paper are summarized as follows : • Text adversarial examples for natural language web services in the Physical World : In order to show the feasibility of our attack , we implemented a framework that can generate text adversarial examples for natural language web services in the physical world ( see Section 3 ) . • Untargeted attacks and targeted attacks : For various goals of the adversarial attacks , we carried out the text adversarial attacks for not only non-targeted attacks ( i.e. , misclassification ) but also targeted attacks ( i.e. , targeted misclassification and source/target misclassification ) ( see Section 3 ) . • The performance evaluation of the proposed framework : Through extensive experiments , it is shown that the proposed framework outperforms a baseline framework in terms of both attack success rate and perturbed ratio ( see Section 4 ) . • The impact of human understanding : To evaluate the attack text generated by our proposed adversarial attack model , we used Amazon Mechanical Turk ( Mturk ) how difficult it is to find the attacked word , we conducted a survey using the attack text and obtained and analyzed the success rate of the attack on the survey problem ( see Section 4.2.2 ) . The remainder of this paper is organized as follows . The background and related work of text adversarial examples is given in Section 2 . Section 3 describes the overview of the proposed adversarial attack and explains the process of the text adversarial attack of generating text adversarial examples for natural language web services in the physical world . Section 4 evaluates the performance of the our proposed framework through misclassification attacks for sentiment analysis of natural language web services in the physical world . Section 5 discusses some research challenges for our attack . Finally , Section 6 concludes this paper along with future work . 2 RELATED WORK . Research on Adversarial attacks for NLP models has been presented . In 2016 , ( Papernot et al . ( 2016 ) ) proposes a method to craft a sequential input on Recurrent Neural Network ( RNN ) models to manipulate an output of classifiers . ( Ebrahimi et al . ( 2017 ) ) presents a method to generate adversarial examples for text classification by crafting a few characters of an input string . Unlike ( Ebrahimi et al . ( 2017 ) ) whose attacks were white-box adversarial examples , ( Gao et al . ( 2018 ) ) used black-box adversarial text sequence to make deep learning-based classifiers misclassify . ( Li et al . ( 2018 ) ) shows various methodologies to generate adversarial text for NLP models , and evaluates that popular NLP services for web services are vulnerable to those attacks . In our work , we show a new methodology to generate adversarial text which is not considered in ( Li et al . ( 2018 ) ) , and also show that most of the NLP services are still vulnerable to our attack . ( Wolff & Wolff ( 2020 ) ) proposes homoglyph attacks generating adversarial examples to neural text detectors . Our attacks are targeted to sentimental analysis services in the real world , and we try to perturb every unit of target text ( e.g. , word , sentence , and paragraph ) instead of replacing several letters with homoglyphs in order to show the most effective way to generate adversarial examples . 3 ATTACK MODEL . This section presents the goal , overview , and attack process of HYPOCRITE . The goal of HYPOCRITE is to generate text adversarial examples for a sentiment analysis of natural language web services in the physical world . In other words , the generated adversarial examples can cause misclassification from positive sentiment to negative sentiment or from negative sentiment to positive sentiment . 3.1 HYPOCRITE OVERVIEW . In this subsection , the proposed HYPOCRITE for generating homoglyph adversarial examples is described . The key idea of the HYPOCRITE is to replace English characters with other similar international characters ( i.e. , homoglyph ) in order to give dataset noise . Such dataset noise can cause misclassification different from the original results . This is because the original meaning disappears due to the noise . With this key idea , HYPOCRITE can generate homoglyph adversarial examples by appropriately changing text from a word unit to a paragraph through a black-box attacks for natural language web services . The homoglyph adversarial examples mean text that looks the same to the human , but causes different results through AI services . Figure 1 shows the four homoglyph adversarial examples for sentiment analysis web services ( i.e. , Amazon comprehend , Google cloud natural language AI , IBM Watson natural language understanding , and Microsoft text analytics ) generated by HYPOCRITE . As homoglyph adversarial examples , characters with red color and bold font mean homoglyph that looks the same to our eyes but has different Unicode values . As shown in Figure 1 , although they look like the same text to perception , the result of the sentiment analysis web service is different from positive to negative , respectively . The user study on the perception of human for adversarial examples is explained in detail in Section 4.2.2 , and the score for each MLaaS company ’ s sentiment analysis result is explained in detail in Section 4.1 . 3.2 ADVERSARIAL EXAMPLE GENERATION . Algorithm 1 : Non-Targeted Adversarial Example Generation resulttext ← get sentiment ( target model , text ) ; units← [ word , sentence , paragraph ] ; for unit ∈ units do tokens← tokenize ( resulttext , unit ) ; for token ∈ tokens do resulttoken ← get sentiment ( target model , token ) ; if min sentiment ( resulttoken ) is not original sentiment then Append resulttoken to attackers ; end end attackers← Sort ( attackers ) according to descending of original sentiment ; for resulttoken ∈ attackers do AE ← make adversarial example ( resulttext , resulttoken ) ; resultAE ← get sentiment ( target model , AE ) ; if sentiment of resultAE is changed then return AE ; else if original sentiment score of resultAE is less than original sentiment score of resulttext then resulttext ← resultAE ; end end end end Algorithm 2 : Targeted Adversarial Example Generation resulttext ← get sentiment ( target model , text ) ; unitss← [ word , sentence , paragraph ] ; for unit ∈ units do tokens← tokenize ( resulttext , unit ) ; for token ∈ tokens do resulttoken ← get sentiment ( target model , token ) ; if max sentiment ( resulttoken ) is not target sentiment then Append resulttoken to attackers ; end end attackers← Sort ( attackers ) according to ascending of target sentiment ; for resulttoken ∈ attackers do AE ← make adversarial example ( resulttext , resulttoken ) ; resultAE ← get sentiment ( target model , AE ) ; if sentiment of resultAE is target sentiment then return AE ; else difftarget ← target sentiment score of resultAE − target sentiment score of resulttext ; diffmax ← max sentiment score of resultAE − max sentiment score of resulttext ; if difftarget is more than 0 and difftarget is more than diffmax then resulttext ← resultAE ; end end end end This subsection describes the process of our HYPOCRITE that generates homoglyph adversarial examples for sentiment analysis web services in the physical world . The adversarial example generation is classified into a non-targeted adversarial example generation and a targeted adversarial example generation . The non-targeted adversarial example generation means to generate homoglyph adversarial examples that misclassify a positive sentiment into sentiments other than the positive sentiment , or a negative sentiment into sentiments other than the negative sentiment . The targeted adversarial example generation means to generate homoglyph adversarial examples that misclassify a positive sentiment into target sentiments ( e.g. , negative , neutral , and mixed ) , or a negative sentiment into target sentiments ( e.g. , positive , neutral , and mixed ) . Algorithms 1 and 2 show an adversarial example generation algorithm of the HYPOCRITE . As shown in Algorithms 1 and 2 , for the adversarial example generation , HYPOCRITE consists of five steps : ( i ) Get score of original text ( i ) Tokenize the text , ( iii ) Get score of the tokens and sorting , ( iv ) Make adversarial examples , and ( v ) Verify the effectiveness of the adversarial examples . Through this process , the non-targeted and targeted adversarial examples are generated , respectively . 4 EXPERIMENTS . 4.1 EXPERIMENTAL-SETUP . Dataset We used IMDB Dataset to evaluate our attacks on sentimental analysis ( Maas et al . ( 2011 ) ) . IMDB contains 25,000 reviews for each positive and negative label , respectively . In our experiments , to determine the effect of text length on the success of the adversarial example , the dataset used in the experiment was divided into seven sections by length . The first section is 500 characters or less , and the second section is 500 characters or more and 800 characters or less . The third section is 800 characters or more and 1,100 characters or less , and the fourth section is 1,100 characters or more and 1,400 characters or less . The fifth section is 1,400 characters or more and 1,700 characters or less , and the sixth section is 1,700 characters or more and 2,100 characters or less . The last seventh sections are over 2,100 characters.Then , we randomly sampled 96 review data per divided section . The number of sample reviews ( 96 reviews ) in our evaluation was determined by a statistically recommended sample size when the confidential level is 95 % , the population size is 50,000 , and the margin of error is 10 % . Targeted Models To evaluate our attacks , we performed the attacks on four sentimental analysis services ( Amazon , Google , IBM , and Microsoft ) in real world . Since every service had different sentimental labels and scoring systems , we briefly described labeling and scoring metric for each system in Table 1 . Amazon and Microsoft use four sentimental labels ( Positive , Negative , Neutral , and Mixed ) , and the systems provide each score for all the labels . In addition , the final output as the re- sult is the label which is the biggest score among the sentimental labels . On the other hand , IBM uses three sentimental labels ( i.e. , Positive , Negative , and Neutral ) and Google dose not provide any exact label . Both systems provide overall score of the input texts as final output ranging from -1 to 1 ( The score closer to -1 means negative , and to 1 means positive ) . As there is no sentimental decision provided from the systems , we considered the score less than 0 as negative , and more than 0 as positive . Baseline To compare the performance of our attack , we evaluate our attack with an attack which is the most similar method to ours ( Wolff & Wolff ( 2020 ) ) . In ( Wolff & Wolff ( 2020 ) ) , the attack is targeted to the neural text detectors . Therefore , we performed the baseline attack to our targeted systems and measure the performance of the attack . Evaluation Metrics In order to evaluate the algorithmic performance , we adopt two metrics such as attack success rate and perturbed rate . The average attack success rate is defined as the ratio of generated adversarial examples that cause misclassification to randomly selected samples . In order to show diversity , we evaluated the performance under various misclassification conditions such as non-targeted misclassification and targeted misclassification . The perturbed rate is defined as the ratio of replaced characters to the total characters throughout the sentence . | The paper proposes an attack method that generates homoglyph adversarial examples for NLP APIs. The method replaces English characters with other international characters that look similar. The paper shows empirically that the method achieves good performance for several real-world APIs. | SP:dccdd07d4daa907b04b330248f9a796cf2e2f361 |
Almost Tight L0-norm Certified Robustness of Top-k Predictions against Adversarial Perturbations | Top-k predictions are used in many real-world applications such as machine learning as a service , recommender systems , and web searches . ℓ0-norm adversarial perturbation characterizes an attack that arbitrarily modifies some features of an input such that a classifier makes an incorrect prediction for the perturbed input . ℓ0-norm adversarial perturbation is easy to interpret and can be implemented in the physical world . Therefore , certifying robustness of top-k predictions against ℓ0-norm adversarial perturbation is important . However , existing studies either focused on certifying ℓ0-norm robustness of top-1 predictions or ℓ2-norm robustness of top-k predictions . In this work , we aim to bridge the gap . Our approach is based on randomized smoothing , which builds a provably robust classifier from an arbitrary classifier via randomizing an input . Our major theoretical contribution is an almost tight ℓ0-norm certified robustness guarantee for top-k predictions . We empirically evaluate our method on CIFAR10 and ImageNet . For instance , our method can build a classifier that achieves a certified top-3 accuracy of 69.2 % on ImageNet when an attacker can arbitrarily perturb 5 pixels of a testing image . 1 INTRODUCTION . Adversarial example is a well-known severe security vulnerability of classifiers . Specifically , given a classifier f and a testing input x , an attacker can carefully craft a human-imperceptible perturbation δ such that f ( x ) ̸= f ( x+ δ ) . The perturbation δ is called adversarial perturbation , while the input x+ δ is called an adversarial example . Many empirical defenses ( Goodfellow et al. , 2015 ; Na et al. , 2018 ; Metzen et al. , 2017 ; Svoboda et al. , 2019 ; Buckman et al. , 2018 ; Ma et al. , 2018 ; Guo et al. , 2018 ; Dhillon et al. , 2018 ; Xie et al. , 2018 ; Song et al. , 2018 ) have been developed to defend against adversarial examples in the past several years . However , these empirical defenses were often soon broken by strong adaptive adversaries ( Carlini & Wagner , 2017 ; Athalye et al. , 2018 ; Uesato et al. , 2018 ; Athalye & Carlini , 2018 ) . To end this cat-and-mouse game , many certified defenses ( Scheibler et al. , 2015 ; Carlini et al. , 2017 ; Ehlers , 2017 ; Katz et al. , 2017 ; Cheng et al. , 2017 ; Lomuscio & Maganti , 2017 ; Fischetti & Jo , 2018 ; Bunel et al. , 2018 ; Wong & Kolter , 2018 ; Wong et al. , 2018 ; Raghunathan et al. , 2018a ; b ; Dvijotham et al. , 2018a ; b ; Gehr et al. , 2018 ; Mirman et al. , 2018 ; Singh et al. , 2018 ; Weng et al. , 2018 ; Zhang et al. , 2018 ; Gowal et al. , 2018 ; Wang et al. , 2018 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ; Lee et al. , 2019 ; Salman et al. , 2019 ; Wang et al. , 2020 ; Jia et al. , 2020 ; Zhai et al. , 2020 ) have been proposed . In particular , a classifier f is said to be certifiably robust for an input x if it provably predicts the same top-1 label ( i.e. , f ( x ) = f ( x+ δ ) ) when the adversarial perturbation δ is bounded , e.g. , the ℓp-norm of δ is smaller than a threshold . The threshold is also called certified radius . In this work , we focus on ℓ0-norm adversarial perturbation , which arbitrarily manipulates some features of a testing input and can be implemented in the physical world . However , most existing certified defenses focus on top-1 predictions . In many applications , top-k predictions that return the k most likely labels are more relevant . For instance , when a classifier is deployed as a cloud service ( also called machine learning as a service ) ( Google Cloud Vision ; Microsoft ; Amazon AWS ; Clarifai ) , top-k labels for a testing input are often returned to a customer for more informed decisions ; in recommender systems and web searches , top-k items/webpages are recommended to a user . Despite the importance and relevance of top-k predictions , their certified robustness against adversarial perturbations is largely unexplored . One exception is the recent work from Jia et al . ( 2020 ) , which derived a tight ℓ2-norm certified robustness for top-k predictions . Such ℓ2-norm certified robustness can be transformed to ℓ0-norm certified robustness via employing the inequality between ℓ0-norm and ℓ2-norm . However , the ℓ0-norm certified robustness derived from such transformations is suboptimal . Our work : We aim to develop ℓ0-norm certified robustness of top-k predictions . Our approach is based on randomized smoothing ( Cao & Gong , 2017 ; Liu et al. , 2018 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ; Lee et al. , 2019 ; Jia et al. , 2020 ; Levine & Feizi , 2019 ) , which can build a certifiably robust classifier from any base classifier via randomizing the input . We adopt randomized smoothing because it is applicable to any classifier and scalable to large neural networks . In particular , we use a randomized smoothing method called randomized ablation ( Levine & Feizi , 2019 ) , which achieves state-of-the-art ℓ0-norm certified robustness for top-1 predictions . Unlike other randomized smoothing methods ( Cao & Gong , 2017 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ) that randomize an input via adding additive noise ( e.g. , Gaussian , Laplacian , or discrete noise ) to it , randomized ablation randomizes an input via subsampling its features . Specifically , given an arbitrary classifier ( called base classifier ) and a testing input x , randomized ablation creates an ablated input via retaining some randomly selected features in x and setting the remaining features to a special value , e.g. , median of the feature value , mean of the feature value , or a special symbol . When the testing input is an image , the features are the image ’ s pixels . Then , we feed the ablated input to the base classifier . Since the ablated input is random , the output of the base classifier is also random . Specifically , we denote by pj the probability that the base classifier outputs a label j for the random ablated input . The original randomized ablation method builds a smoothed classifier that outputs the label with the largest label probability pj for a testing input x . In our work , the smoothed classifier returns the k labels with the largest label probabilities for x . Our major theoretical contribution is an almost tight ℓ0-norm certified robustness guarantee of top-k predictions for the smoothed classifier constructed by randomized ablation . Specifically , we first derive an ℓ0-norm certified robustness guarantee of top-k predictions for the smoothed classifier . Our results show that a label l is provably among the top-k labels predicted by the smoothed classifier for a testing input x when the attacker arbitrarily perturbs at most rl features of x , where rl is the ℓ0-norm certified radius . Moreover , we prove that our certified radius is tight when k = 1 and is almost tight when k > 1 . In particular , if no assumptions on the base classifier are made , it is impossible to derive a certified radius that is larger than rl + I ( k ̸= 1 ) . In other words , when an attacker manipulates at least rl + 1 + I ( k ̸= 1 ) features of a testing input , there exists a base classifier from which the smoothed classifier ’ s top-k predicted labels do not include l or there exist ties . Our work has several technical differences with Levine & Feizi ( 2019 ) . First , we derive the ℓ0-norm certified radius of top-k predictions for randomized ablation , while Levine & Feizi ( 2019 ) only derived the certified radius of top-1 predictions . Second , our certified radius is the same as or larger than that in Levine & Feizi ( 2019 ) for top-1 predictions , because we leverage the discrete property of the label probabilities to derive our certified radius . Third , we prove the ( almost ) tightness of the certified radius , while Levine & Feizi ( 2019 ) didn ’ t . Our work also has several technical differences with Jia et al . ( 2020 ) , which derived a tight ℓ2-norm certified radius of top-k predictions for randomized smoothing with Gaussian additive noise . Since they add additive Gaussian noise to a testing input , the space of randomized inputs is continuous . However , our space of ablated inputs is discrete , as we randomize a testing input via subsampling its features . As a result , Jia et al . and our work use substantially different techniques to derive the ℓ2/ℓ0-norm certified radiuses and prove their ( almost ) tightness . In particular , when deriving the ℓ2/ℓ0-norm certified radiuses , our work needs to construct different regions in the discrete space of ablated inputs such that the Neyman-Pearson Lemma ( Neyman & Pearson , 1933 ) can be applied . When proving the ( almost ) tightness , we use a completely different approach from Jia et al .. First , Jia et al . relies on the Intermediate Value Theorem , which is not applicable to our discrete data . Second , since Gaussian noise is not uniform , Jia et al . need to prove the results via Mathematical Induction . However , Mathematical Induction is unnecessary in our case because the ablated inputs that can be derived from an input are uniformly distributed in the space of ablated inputs . We evaluate our method on CIFAR10 and ImageNet . Our results show that our method substantially outperforms state-of-the-art for top-k predictions . For instance , our method achieves a certified top-3 accuracy of 69.2 % on ImageNet when an attacker arbitrarily perturbs 5 pixels of a testing image . Under the same setting , Jia et al . ( 2020 ) achieves a certified top-3 accuracy of only 9.0 % , when transforming their ℓ2-norm certified robustness to ℓ0-norm certified robustness . Our contributions can be summarized as follows : • We derive an ℓ0-norm certified radius of top-k predictions for randomized ablation . • We prove that our certified radius is tight when k = 1 and almost tight when k > 1 . • We empirically evaluate our method on CIFAR10 and ImageNet . 2 THEORETICAL RESULTS . In this section , we show our core theoretical contributions . 2.1 BUILDING A SMOOTHED CLASSIFIER VIA RANDOMIZED ABLATION . Suppose we have a base classifier f , which classifies a testing input x to one of c classes { 1 , 2 , · · · , c } deterministically . For simplicity , we assume x is an image with d pixels . Given an input x , randomized ablation ( Levine & Feizi , 2019 ) creates an ablated input as follows : we first randomly subsample e pixels from x without replacement and keep their values . Then , we set the remaining pixel values in the ablated input to a special value , e.g. , median of the pixel value , mean of the pixel value , or a special symbol . When the image is a color image , we set the values of the three channels of each pixel separately . Note that an ablated input has the same size with x . We use h ( x , e ) to denote the randomly ablated input for simplicity . Given h ( x , e ) as input , the output of the base classifier f is also random . We use pj to denote the probability that the base classifier f predicts class j when taking h ( x , e ) as input , i.e. , pj = Pr ( f ( h ( x , e ) ) = j ) . Note that pj is an integer multiple of 1 ( de ) , which we will leverage to derive a tighter certified robustness guarantee . We build a smoothed classifier g that outputs the k labels with the largest label probabilities pj ’ s for x . Moreover , we denote by gk ( x ) the set of k labels predicted for x . | This paper provides an almost tight l0-norm certified robustness guarantee for top-k predictions against adversarial perturbations, which extends certified radius of the top-1 prediction from Levine & Feizi (2019) to that of the top-k predictions, and the l2-norm certified radius from Jia et al. (2020) to the l0-norm certified radius. The experiments on CIFAR10 and ImageNet show that the proposed method substantially outperforms state-of-the-art for top-k predictions. | SP:ee6c7dc9a106d5bebb879ca226723a2fc294b9fb |
Almost Tight L0-norm Certified Robustness of Top-k Predictions against Adversarial Perturbations | Top-k predictions are used in many real-world applications such as machine learning as a service , recommender systems , and web searches . ℓ0-norm adversarial perturbation characterizes an attack that arbitrarily modifies some features of an input such that a classifier makes an incorrect prediction for the perturbed input . ℓ0-norm adversarial perturbation is easy to interpret and can be implemented in the physical world . Therefore , certifying robustness of top-k predictions against ℓ0-norm adversarial perturbation is important . However , existing studies either focused on certifying ℓ0-norm robustness of top-1 predictions or ℓ2-norm robustness of top-k predictions . In this work , we aim to bridge the gap . Our approach is based on randomized smoothing , which builds a provably robust classifier from an arbitrary classifier via randomizing an input . Our major theoretical contribution is an almost tight ℓ0-norm certified robustness guarantee for top-k predictions . We empirically evaluate our method on CIFAR10 and ImageNet . For instance , our method can build a classifier that achieves a certified top-3 accuracy of 69.2 % on ImageNet when an attacker can arbitrarily perturb 5 pixels of a testing image . 1 INTRODUCTION . Adversarial example is a well-known severe security vulnerability of classifiers . Specifically , given a classifier f and a testing input x , an attacker can carefully craft a human-imperceptible perturbation δ such that f ( x ) ̸= f ( x+ δ ) . The perturbation δ is called adversarial perturbation , while the input x+ δ is called an adversarial example . Many empirical defenses ( Goodfellow et al. , 2015 ; Na et al. , 2018 ; Metzen et al. , 2017 ; Svoboda et al. , 2019 ; Buckman et al. , 2018 ; Ma et al. , 2018 ; Guo et al. , 2018 ; Dhillon et al. , 2018 ; Xie et al. , 2018 ; Song et al. , 2018 ) have been developed to defend against adversarial examples in the past several years . However , these empirical defenses were often soon broken by strong adaptive adversaries ( Carlini & Wagner , 2017 ; Athalye et al. , 2018 ; Uesato et al. , 2018 ; Athalye & Carlini , 2018 ) . To end this cat-and-mouse game , many certified defenses ( Scheibler et al. , 2015 ; Carlini et al. , 2017 ; Ehlers , 2017 ; Katz et al. , 2017 ; Cheng et al. , 2017 ; Lomuscio & Maganti , 2017 ; Fischetti & Jo , 2018 ; Bunel et al. , 2018 ; Wong & Kolter , 2018 ; Wong et al. , 2018 ; Raghunathan et al. , 2018a ; b ; Dvijotham et al. , 2018a ; b ; Gehr et al. , 2018 ; Mirman et al. , 2018 ; Singh et al. , 2018 ; Weng et al. , 2018 ; Zhang et al. , 2018 ; Gowal et al. , 2018 ; Wang et al. , 2018 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ; Lee et al. , 2019 ; Salman et al. , 2019 ; Wang et al. , 2020 ; Jia et al. , 2020 ; Zhai et al. , 2020 ) have been proposed . In particular , a classifier f is said to be certifiably robust for an input x if it provably predicts the same top-1 label ( i.e. , f ( x ) = f ( x+ δ ) ) when the adversarial perturbation δ is bounded , e.g. , the ℓp-norm of δ is smaller than a threshold . The threshold is also called certified radius . In this work , we focus on ℓ0-norm adversarial perturbation , which arbitrarily manipulates some features of a testing input and can be implemented in the physical world . However , most existing certified defenses focus on top-1 predictions . In many applications , top-k predictions that return the k most likely labels are more relevant . For instance , when a classifier is deployed as a cloud service ( also called machine learning as a service ) ( Google Cloud Vision ; Microsoft ; Amazon AWS ; Clarifai ) , top-k labels for a testing input are often returned to a customer for more informed decisions ; in recommender systems and web searches , top-k items/webpages are recommended to a user . Despite the importance and relevance of top-k predictions , their certified robustness against adversarial perturbations is largely unexplored . One exception is the recent work from Jia et al . ( 2020 ) , which derived a tight ℓ2-norm certified robustness for top-k predictions . Such ℓ2-norm certified robustness can be transformed to ℓ0-norm certified robustness via employing the inequality between ℓ0-norm and ℓ2-norm . However , the ℓ0-norm certified robustness derived from such transformations is suboptimal . Our work : We aim to develop ℓ0-norm certified robustness of top-k predictions . Our approach is based on randomized smoothing ( Cao & Gong , 2017 ; Liu et al. , 2018 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ; Lee et al. , 2019 ; Jia et al. , 2020 ; Levine & Feizi , 2019 ) , which can build a certifiably robust classifier from any base classifier via randomizing the input . We adopt randomized smoothing because it is applicable to any classifier and scalable to large neural networks . In particular , we use a randomized smoothing method called randomized ablation ( Levine & Feizi , 2019 ) , which achieves state-of-the-art ℓ0-norm certified robustness for top-1 predictions . Unlike other randomized smoothing methods ( Cao & Gong , 2017 ; Lecuyer et al. , 2019 ; Li et al. , 2019 ; Cohen et al. , 2019 ) that randomize an input via adding additive noise ( e.g. , Gaussian , Laplacian , or discrete noise ) to it , randomized ablation randomizes an input via subsampling its features . Specifically , given an arbitrary classifier ( called base classifier ) and a testing input x , randomized ablation creates an ablated input via retaining some randomly selected features in x and setting the remaining features to a special value , e.g. , median of the feature value , mean of the feature value , or a special symbol . When the testing input is an image , the features are the image ’ s pixels . Then , we feed the ablated input to the base classifier . Since the ablated input is random , the output of the base classifier is also random . Specifically , we denote by pj the probability that the base classifier outputs a label j for the random ablated input . The original randomized ablation method builds a smoothed classifier that outputs the label with the largest label probability pj for a testing input x . In our work , the smoothed classifier returns the k labels with the largest label probabilities for x . Our major theoretical contribution is an almost tight ℓ0-norm certified robustness guarantee of top-k predictions for the smoothed classifier constructed by randomized ablation . Specifically , we first derive an ℓ0-norm certified robustness guarantee of top-k predictions for the smoothed classifier . Our results show that a label l is provably among the top-k labels predicted by the smoothed classifier for a testing input x when the attacker arbitrarily perturbs at most rl features of x , where rl is the ℓ0-norm certified radius . Moreover , we prove that our certified radius is tight when k = 1 and is almost tight when k > 1 . In particular , if no assumptions on the base classifier are made , it is impossible to derive a certified radius that is larger than rl + I ( k ̸= 1 ) . In other words , when an attacker manipulates at least rl + 1 + I ( k ̸= 1 ) features of a testing input , there exists a base classifier from which the smoothed classifier ’ s top-k predicted labels do not include l or there exist ties . Our work has several technical differences with Levine & Feizi ( 2019 ) . First , we derive the ℓ0-norm certified radius of top-k predictions for randomized ablation , while Levine & Feizi ( 2019 ) only derived the certified radius of top-1 predictions . Second , our certified radius is the same as or larger than that in Levine & Feizi ( 2019 ) for top-1 predictions , because we leverage the discrete property of the label probabilities to derive our certified radius . Third , we prove the ( almost ) tightness of the certified radius , while Levine & Feizi ( 2019 ) didn ’ t . Our work also has several technical differences with Jia et al . ( 2020 ) , which derived a tight ℓ2-norm certified radius of top-k predictions for randomized smoothing with Gaussian additive noise . Since they add additive Gaussian noise to a testing input , the space of randomized inputs is continuous . However , our space of ablated inputs is discrete , as we randomize a testing input via subsampling its features . As a result , Jia et al . and our work use substantially different techniques to derive the ℓ2/ℓ0-norm certified radiuses and prove their ( almost ) tightness . In particular , when deriving the ℓ2/ℓ0-norm certified radiuses , our work needs to construct different regions in the discrete space of ablated inputs such that the Neyman-Pearson Lemma ( Neyman & Pearson , 1933 ) can be applied . When proving the ( almost ) tightness , we use a completely different approach from Jia et al .. First , Jia et al . relies on the Intermediate Value Theorem , which is not applicable to our discrete data . Second , since Gaussian noise is not uniform , Jia et al . need to prove the results via Mathematical Induction . However , Mathematical Induction is unnecessary in our case because the ablated inputs that can be derived from an input are uniformly distributed in the space of ablated inputs . We evaluate our method on CIFAR10 and ImageNet . Our results show that our method substantially outperforms state-of-the-art for top-k predictions . For instance , our method achieves a certified top-3 accuracy of 69.2 % on ImageNet when an attacker arbitrarily perturbs 5 pixels of a testing image . Under the same setting , Jia et al . ( 2020 ) achieves a certified top-3 accuracy of only 9.0 % , when transforming their ℓ2-norm certified robustness to ℓ0-norm certified robustness . Our contributions can be summarized as follows : • We derive an ℓ0-norm certified radius of top-k predictions for randomized ablation . • We prove that our certified radius is tight when k = 1 and almost tight when k > 1 . • We empirically evaluate our method on CIFAR10 and ImageNet . 2 THEORETICAL RESULTS . In this section , we show our core theoretical contributions . 2.1 BUILDING A SMOOTHED CLASSIFIER VIA RANDOMIZED ABLATION . Suppose we have a base classifier f , which classifies a testing input x to one of c classes { 1 , 2 , · · · , c } deterministically . For simplicity , we assume x is an image with d pixels . Given an input x , randomized ablation ( Levine & Feizi , 2019 ) creates an ablated input as follows : we first randomly subsample e pixels from x without replacement and keep their values . Then , we set the remaining pixel values in the ablated input to a special value , e.g. , median of the pixel value , mean of the pixel value , or a special symbol . When the image is a color image , we set the values of the three channels of each pixel separately . Note that an ablated input has the same size with x . We use h ( x , e ) to denote the randomly ablated input for simplicity . Given h ( x , e ) as input , the output of the base classifier f is also random . We use pj to denote the probability that the base classifier f predicts class j when taking h ( x , e ) as input , i.e. , pj = Pr ( f ( h ( x , e ) ) = j ) . Note that pj is an integer multiple of 1 ( de ) , which we will leverage to derive a tighter certified robustness guarantee . We build a smoothed classifier g that outputs the k labels with the largest label probabilities pj ’ s for x . Moreover , we denote by gk ( x ) the set of k labels predicted for x . | The paper provides both theoretical progress and experimental results on certified robustness of top-$k$ predictions. Specifically, on the theory side, the paper shows that the randomized ablation (Levin & Feizi) has $\ell_0$-norm certified radius of top-$k$ predictions. Also, the paper proves that the certified radius is tight for k = 1 and almost tight for k > 1. (The certified radius cannot be larger than “the derived radius plus 1”.) On the experiment side, the paper compares the proposed method to existing competitors and explored the impact of the related parameters. | SP:ee6c7dc9a106d5bebb879ca226723a2fc294b9fb |
Lottery Tickets can have Structural Sparsity | The lottery ticket hypothesis ( LTH ) has shown that dense models contain highly sparse subnetworks ( i.e. , winning tickets ) that can be trained in isolation to match full accuracy . Despite many exciting efforts being made , there is one “ commonsense ” seldomly challenged : a winning ticket is found by iterative magnitude pruning ( IMP ) and hence the resultant pruned subnetworks have only unstructured sparsity . That gap limits the appeal of winning tickets in practice , since the highly irregular sparse patterns are challenging to accelerate on hardware . Meanwhile , directly substituting structured pruning for unstructured pruning in IMP damages performance more severely and is usually unable to locate winning tickets . In this paper , we demonstrate the first positive result that a structurally sparse winning ticket can be effectively found in general . The core idea is to append “ post-processing techniques ” after each round of ( unstructured ) IMP , to enforce the formation of structural sparsity . Specifically , we first “ re-fill ” pruned elements back in some channels deemed to be important , and then “ re-group ” non-zero elements to create flexible group-wise structural patterns . Both our identified channel- and group-wise structural subnetworks win the lottery , with substantial inference speedups readily supported by practical hardware . Extensive experiments , conducted on diverse datasets across multiple network backbones , consistently validate our proposal , showing that the hardware acceleration roadblock of LTH is now removed . Specifically , the structural winning tickets obtain up to { 64.93 % , 64.84 % , 64.84 % } running time savings at { 36 % ∼ 80 % , 74 % , 58 % } sparsity on { CIFAR , Tiny-ImageNet , ImageNet } , while maintaining comparable accuracy . All the codes and pre-trained models will be publicly released . 1 INTRODUCTION . Recently , the machine learning research community has devoted considerable efforts and financial outlay to scaling deep neural networks ( DNNs ) to enormous sizes ( 175 billion parameter-counts in GPT-3 ( Brown et al. , 2020 ) ) . Although such overparameterization simplifies the training of DNNs and dramatically improves their generalization ( Bartlett et al. , 2021 ; Du et al. , 2018 ; Kaplan et al. , 2020 ) , it may severely obstruct the practical usage on resource-limited platforms like mobile devices , due to its large memory footprint and inference time ( Hoefler et al. , 2021 ) . Pruning as one of the effective remedies can be dated back to LeCun et al . ( 1990 ) : it can eliminate substantial redundant model parameters and boost the computational and storage efficiency of DNNs . Such benefits drive numerous interests in designing model pruning algorithms ( Han et al. , 2015a ; b ; Ren et al. , 2018 ; He et al. , 2017 ; Liu et al. , 2017 ) . Among this huge family , an emerging representative studies the prospect of training sparse subnetworks in lieu of the full dense models without impacting performance ( Frankle & Carbin , 2019 ; Chen et al. , 2020b ) . For instance , Frankle & Carbin ( 2019 ) demonstrates that dense models contain sparse , matching subnetworks ( Frankle et al. , 2020a ) ( a.k.a . winning tickets ) capable of training in isolation from the original initialization to match or even surpass the full accuracy . This phenomenon is referred to as the lottery tickets hypothesis ( LTH ) , which indicates several impressive observations : ( i ) usually extreme sparsity levels ( e.g. , 90 % , 95 % ) can be achieved without sacrificing the test accuracy ; ( ii ) the located winning ticket maintains undamaged expressive power as its dense counterpart , and can be easily trained from scratch or early-epoch weights ( Renda et al. , 2020 ; Frankle et al. , 2020a ) to recover the full performance . These advances are positive signs about the substantial potential of sparse DNNs . 1 However , almost all LTH literature investigates unstructured sparsity only . In practical scenarios , it brings little hardware efficiency benefits due to the poor data locality and low parallelism ( He et al. , 2017 ; Mao et al. , 2017 ; Wen et al. , 2016 ) caused by highly irregular sparse patterns . Meanwhile , most of the accelerators are optimized for dense matrix operations ( Han et al. , 2016 ) , which means there is limited speedup for unstructured pruned subnetworks even the sparsity level exceeds 95 % ( Wen et al. , 2016 ) . Structural pruning ( He et al. , 2017 ; Liu et al. , 2017 ) as an alternative to exploring sparse subnetworks , removes the entire filter or channel in DNNs to gain more computational efficiency at the cost of ( more ) accuracy degradation . As shown in Figure 1 , traditional channel-wise structural pruning approaches ( He et al. , 2017 ; Liu et al. , 2017 ; Bartoldson et al. , 2019 ; Molchanov et al. , 2019 ) quickly degrade performance and can not lead to winning tickets , which was also echoed in You et al . ( 2020 ) . In our paper , we present the first study into the structural lottery tickets , which explores hardwarefriendly structural sparsity ( including channel-wise and group-wise patterns ) in order to find lottery tickets . Specifically , we start from unstructured sparse subnetworks , and then adopt proposed refilling techniques to create channel-wise structural sparsity by growing back the pruned elements within the most important channels and abandoning the rest . Our results ( Section 4 ) show such refined channel-wise structural subnetworks win the lottery at a moderate sparsity level with∼ 50 % running time savings on an Nvidia 2080 TI . In order to push the compression ratio higher , we introduce a regrouping algorithm based on hypergraph partitioning ( Rumi et al. , 2020 ) to establish group-wise structural patterns which are more amenable to pruning due to the shape flexibility of grouped dense blocks . These group-wise structural winning tickets achieve ∼ 60 % running time savings at 50 % ∼ 80 % sparsity without any performance degradation compared to the dense models . Our main contributions lie in the following aspects : • To our best knowledge , we are the first to demonstrate the existence of structurally sparse winning tickets at non-trivial sparsity levels ( i.e. , > 30 % ) , and with both channel-wise and group-wise sparse patterns . • We propose the refilling technique and introduce the regrouping algorithm to form channelwise and group-wise structural sparsity , respectively . Such refined structural subnetworks match the trainability and expressiveness of dense networks , while enabling the inference speedup on practical hardware platforms like GPU machines . • Extensive experiments validate our proposal on diverse datasets ( i.e. , CIFAR-10/100 , TinyImageNet , and ImageNet ) across multiple network architectures , including ResNets , VGG , and MobileNet . Specifically , our structural winning tickets achieve 53.75 % ∼ 64.93 % GPU running time savings at 45 % ∼ 80 % channel- and group-wise sparsity . 2 RELATED WORK . Pruning . Network pruning is a technique that aims at eliminating the unnecessary model parameters ( Blalock et al. , 2020 ) , which can effectively shrink models for the deployment on resourceconstrained devices ( LeCun et al. , 1990 ; Hanson & Pratt , 1988 ) . Pruning algorithms are roughly categorized into two groups : ( 1 ) unstructured pruning ( LeCun et al. , 1990 ; Han et al. , 2015a ; b ; Ren et al. , 2018 ; Zhang et al. , 2018 ) with irregular sparse patterns ; ( 2 ) structural pruning ( He et al. , 2017 ; Liu et al. , 2017 ; Li et al. , 2016 ; Hu et al. , 2016 ; Wen et al. , 2016 ; Hong et al. , 2018 ) with structural sparse patterns such as channel-wise , block-wise , column-wise , etc .. Within the group of unstructured pruning , Han et al . ( 2015a ; b ) remove insignificant connections of models in the post-training stage , with respect to certain heuristics like weight/gradient magnitudes ; during training sparsification is also another popular trend for pruning by leveraging ` 0 regularization ( Louizos et al. , 2017 ) or alternating direction method of multipliers ( ADMM ) ( Ren et al. , 2 2018 ; Zhang et al. , 2018 ) . Recently , several pruning-at-initialization methods ( Wang et al. , 2020 ; Lee et al. , 2019b ; Tanaka et al. , 2020 ) are proposed to identify critical unstructured connections for gradient-flow preserving , without any training . Although the unstructured sparse model has superior performance , it usually suffers from poor data locality and low parallelism ( He et al. , 2017 ; Mao et al. , 2017 ; Wen et al. , 2016 ) , which make it hard to speed up in real-world applications . On the contrary , structural pruning is more hardware-friendly at the cost of notable accuracy loss when the compression ratio increases . He et al . ( 2017 ) ; Liu et al . ( 2017 ) slim the network channels via ` 1 regularization , and Bartoldson et al . ( 2019 ) selects important channels according to heuristics of feature maps . To combine the benefits of structural and unstructured pruning , hybrid pruning strategies have been introduced to pursue more general structural spares patterns which are also capable of acceleration . For example , convolution kernels with half regular sparsity ( Chen et al. , 2018 ) or pattern-based structural sparsity ( Ma et al. , 2020 ) or vector-wise ( Zhu et al. , 2019 ) and group-wise ( Rumi et al. , 2020 ) regular sparsity . The lottery tickets hypothesis ( LTH ) . The lottery ticket hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) conjectures that there exists a sparse subnetwork called winning ticket within a dense network , whose performance can match with the dense network when training from the same initialization . With the assistance of weight rewinding techniques ( Renda et al. , 2020 ; Frankle et al. , 2020a ) , the original LTH can be scaled up to larger networks and datasets . The existence of winning tickets are broadly verified under diverse contexts , such as image classification ( Frankle & Carbin , 2019 ; Liu et al. , 2019 ; Wang et al. , 2020 ; Evci et al. , 2019 ; Frankle et al. , 2020b ; Savarese et al. , 2020 ; You et al. , 2020 ; Ma et al. , 2021a ; Chen et al. , 2020a ) , object detection Girish et al . ( 2020 ) , natural language processing Gale et al . ( 2019 ) ; Yu et al . ( 2020 ) ; Prasanna et al . ( 2020 ) ; Chen et al . ( 2020b ; c ) , generative adversarial networks Chen et al . ( 2021d ) ; Kalibhat et al . ( 2020 ) ; Chen et al . ( 2021a ) , graph neural networks Chen et al . ( 2021b ) , reinforcement learning Yu et al . ( 2020 ) , and life-long learning Chen et al . ( 2021c ) . However , all of the above LTH literature only locate unstructured sparse winning tickets , which can hardly bring hardware efficiency boost on real-world applications . As the most related work , You et al . ( 2020 ) finds structural winning tickets at only low sparsity levels around 30 % in few cases . It again reveals the complication and difficulty of identifying computation-friendly sparse patterns . Another concurrent work ( Alabdulmohsin et al. , 2021 ) investigates a generalized LTH with weight space factorization , which is orthogonal to our work . Sparse convolutional neural network ( CNN ) acceleration on GPU . Previous works have explored the acceleration of sparse convolution operations in two different directions . One direction is to design efficient implementation of unstructured pruned networks for improved data locality and utilization of hardware ( Chen , 2018 ; Park et al. , 2016 ) . For example , Dong et al . ( 2019 ) proposes “ Acorns ” to accelerate the sparse computations of convolution kernels with an input sparsity . Peng et al . ( 2017 ) has proposed a matrix splitting algorithm for efficient CNN inference . Nvidia ’ s cuSPARSE1 library contains various efficient sparse matrix computation algorithms like SpMM on GPUs , drawing great attention in efficient scientific computing . Furthermore , advanced approaches are developed based on SpMM , such as Adaptive Sparse Tiling ( ASpT ) ( Hong et al. , 2019 ) . ASpT significantly improves the data usage of SpMM and achieves the current state-of-the-art performance among SpMM implementation variants . Another direction focuses on more hardware-friendly pruning methods ( Chen et al. , 2018 ; Ma et al. , 2020 ; Niu et al. , 2020 ) . During the model pruning , these works aim to maintain certain regular sparse patterns , which benefit the hardware processing/computing of corresponding sparse matrices . However , Chen et al . ( 2018 ) achieves unsatisfactory compression ratio , while the pruning methods used in Ma et al . ( 2020 ) and Niu et al . ( 2020 ) require dedicated compiler optimization to accelerate network execution . | LTH (lottery ticket hypothesis) was mainly proposed for unstructured pruning. This paper shows it can also be validated on structured pruning, for the first time. The key for them to achieve so is the newly proposed post-processing techniques, refilling(+) and regrouping. They show by these techniques, structural winning tickets can be found, with up to 6.67x on hardware platforms. | SP:3030aeb9862c75808ed5e9111432287520ff5062 |
Lottery Tickets can have Structural Sparsity | The lottery ticket hypothesis ( LTH ) has shown that dense models contain highly sparse subnetworks ( i.e. , winning tickets ) that can be trained in isolation to match full accuracy . Despite many exciting efforts being made , there is one “ commonsense ” seldomly challenged : a winning ticket is found by iterative magnitude pruning ( IMP ) and hence the resultant pruned subnetworks have only unstructured sparsity . That gap limits the appeal of winning tickets in practice , since the highly irregular sparse patterns are challenging to accelerate on hardware . Meanwhile , directly substituting structured pruning for unstructured pruning in IMP damages performance more severely and is usually unable to locate winning tickets . In this paper , we demonstrate the first positive result that a structurally sparse winning ticket can be effectively found in general . The core idea is to append “ post-processing techniques ” after each round of ( unstructured ) IMP , to enforce the formation of structural sparsity . Specifically , we first “ re-fill ” pruned elements back in some channels deemed to be important , and then “ re-group ” non-zero elements to create flexible group-wise structural patterns . Both our identified channel- and group-wise structural subnetworks win the lottery , with substantial inference speedups readily supported by practical hardware . Extensive experiments , conducted on diverse datasets across multiple network backbones , consistently validate our proposal , showing that the hardware acceleration roadblock of LTH is now removed . Specifically , the structural winning tickets obtain up to { 64.93 % , 64.84 % , 64.84 % } running time savings at { 36 % ∼ 80 % , 74 % , 58 % } sparsity on { CIFAR , Tiny-ImageNet , ImageNet } , while maintaining comparable accuracy . All the codes and pre-trained models will be publicly released . 1 INTRODUCTION . Recently , the machine learning research community has devoted considerable efforts and financial outlay to scaling deep neural networks ( DNNs ) to enormous sizes ( 175 billion parameter-counts in GPT-3 ( Brown et al. , 2020 ) ) . Although such overparameterization simplifies the training of DNNs and dramatically improves their generalization ( Bartlett et al. , 2021 ; Du et al. , 2018 ; Kaplan et al. , 2020 ) , it may severely obstruct the practical usage on resource-limited platforms like mobile devices , due to its large memory footprint and inference time ( Hoefler et al. , 2021 ) . Pruning as one of the effective remedies can be dated back to LeCun et al . ( 1990 ) : it can eliminate substantial redundant model parameters and boost the computational and storage efficiency of DNNs . Such benefits drive numerous interests in designing model pruning algorithms ( Han et al. , 2015a ; b ; Ren et al. , 2018 ; He et al. , 2017 ; Liu et al. , 2017 ) . Among this huge family , an emerging representative studies the prospect of training sparse subnetworks in lieu of the full dense models without impacting performance ( Frankle & Carbin , 2019 ; Chen et al. , 2020b ) . For instance , Frankle & Carbin ( 2019 ) demonstrates that dense models contain sparse , matching subnetworks ( Frankle et al. , 2020a ) ( a.k.a . winning tickets ) capable of training in isolation from the original initialization to match or even surpass the full accuracy . This phenomenon is referred to as the lottery tickets hypothesis ( LTH ) , which indicates several impressive observations : ( i ) usually extreme sparsity levels ( e.g. , 90 % , 95 % ) can be achieved without sacrificing the test accuracy ; ( ii ) the located winning ticket maintains undamaged expressive power as its dense counterpart , and can be easily trained from scratch or early-epoch weights ( Renda et al. , 2020 ; Frankle et al. , 2020a ) to recover the full performance . These advances are positive signs about the substantial potential of sparse DNNs . 1 However , almost all LTH literature investigates unstructured sparsity only . In practical scenarios , it brings little hardware efficiency benefits due to the poor data locality and low parallelism ( He et al. , 2017 ; Mao et al. , 2017 ; Wen et al. , 2016 ) caused by highly irregular sparse patterns . Meanwhile , most of the accelerators are optimized for dense matrix operations ( Han et al. , 2016 ) , which means there is limited speedup for unstructured pruned subnetworks even the sparsity level exceeds 95 % ( Wen et al. , 2016 ) . Structural pruning ( He et al. , 2017 ; Liu et al. , 2017 ) as an alternative to exploring sparse subnetworks , removes the entire filter or channel in DNNs to gain more computational efficiency at the cost of ( more ) accuracy degradation . As shown in Figure 1 , traditional channel-wise structural pruning approaches ( He et al. , 2017 ; Liu et al. , 2017 ; Bartoldson et al. , 2019 ; Molchanov et al. , 2019 ) quickly degrade performance and can not lead to winning tickets , which was also echoed in You et al . ( 2020 ) . In our paper , we present the first study into the structural lottery tickets , which explores hardwarefriendly structural sparsity ( including channel-wise and group-wise patterns ) in order to find lottery tickets . Specifically , we start from unstructured sparse subnetworks , and then adopt proposed refilling techniques to create channel-wise structural sparsity by growing back the pruned elements within the most important channels and abandoning the rest . Our results ( Section 4 ) show such refined channel-wise structural subnetworks win the lottery at a moderate sparsity level with∼ 50 % running time savings on an Nvidia 2080 TI . In order to push the compression ratio higher , we introduce a regrouping algorithm based on hypergraph partitioning ( Rumi et al. , 2020 ) to establish group-wise structural patterns which are more amenable to pruning due to the shape flexibility of grouped dense blocks . These group-wise structural winning tickets achieve ∼ 60 % running time savings at 50 % ∼ 80 % sparsity without any performance degradation compared to the dense models . Our main contributions lie in the following aspects : • To our best knowledge , we are the first to demonstrate the existence of structurally sparse winning tickets at non-trivial sparsity levels ( i.e. , > 30 % ) , and with both channel-wise and group-wise sparse patterns . • We propose the refilling technique and introduce the regrouping algorithm to form channelwise and group-wise structural sparsity , respectively . Such refined structural subnetworks match the trainability and expressiveness of dense networks , while enabling the inference speedup on practical hardware platforms like GPU machines . • Extensive experiments validate our proposal on diverse datasets ( i.e. , CIFAR-10/100 , TinyImageNet , and ImageNet ) across multiple network architectures , including ResNets , VGG , and MobileNet . Specifically , our structural winning tickets achieve 53.75 % ∼ 64.93 % GPU running time savings at 45 % ∼ 80 % channel- and group-wise sparsity . 2 RELATED WORK . Pruning . Network pruning is a technique that aims at eliminating the unnecessary model parameters ( Blalock et al. , 2020 ) , which can effectively shrink models for the deployment on resourceconstrained devices ( LeCun et al. , 1990 ; Hanson & Pratt , 1988 ) . Pruning algorithms are roughly categorized into two groups : ( 1 ) unstructured pruning ( LeCun et al. , 1990 ; Han et al. , 2015a ; b ; Ren et al. , 2018 ; Zhang et al. , 2018 ) with irregular sparse patterns ; ( 2 ) structural pruning ( He et al. , 2017 ; Liu et al. , 2017 ; Li et al. , 2016 ; Hu et al. , 2016 ; Wen et al. , 2016 ; Hong et al. , 2018 ) with structural sparse patterns such as channel-wise , block-wise , column-wise , etc .. Within the group of unstructured pruning , Han et al . ( 2015a ; b ) remove insignificant connections of models in the post-training stage , with respect to certain heuristics like weight/gradient magnitudes ; during training sparsification is also another popular trend for pruning by leveraging ` 0 regularization ( Louizos et al. , 2017 ) or alternating direction method of multipliers ( ADMM ) ( Ren et al. , 2 2018 ; Zhang et al. , 2018 ) . Recently , several pruning-at-initialization methods ( Wang et al. , 2020 ; Lee et al. , 2019b ; Tanaka et al. , 2020 ) are proposed to identify critical unstructured connections for gradient-flow preserving , without any training . Although the unstructured sparse model has superior performance , it usually suffers from poor data locality and low parallelism ( He et al. , 2017 ; Mao et al. , 2017 ; Wen et al. , 2016 ) , which make it hard to speed up in real-world applications . On the contrary , structural pruning is more hardware-friendly at the cost of notable accuracy loss when the compression ratio increases . He et al . ( 2017 ) ; Liu et al . ( 2017 ) slim the network channels via ` 1 regularization , and Bartoldson et al . ( 2019 ) selects important channels according to heuristics of feature maps . To combine the benefits of structural and unstructured pruning , hybrid pruning strategies have been introduced to pursue more general structural spares patterns which are also capable of acceleration . For example , convolution kernels with half regular sparsity ( Chen et al. , 2018 ) or pattern-based structural sparsity ( Ma et al. , 2020 ) or vector-wise ( Zhu et al. , 2019 ) and group-wise ( Rumi et al. , 2020 ) regular sparsity . The lottery tickets hypothesis ( LTH ) . The lottery ticket hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) conjectures that there exists a sparse subnetwork called winning ticket within a dense network , whose performance can match with the dense network when training from the same initialization . With the assistance of weight rewinding techniques ( Renda et al. , 2020 ; Frankle et al. , 2020a ) , the original LTH can be scaled up to larger networks and datasets . The existence of winning tickets are broadly verified under diverse contexts , such as image classification ( Frankle & Carbin , 2019 ; Liu et al. , 2019 ; Wang et al. , 2020 ; Evci et al. , 2019 ; Frankle et al. , 2020b ; Savarese et al. , 2020 ; You et al. , 2020 ; Ma et al. , 2021a ; Chen et al. , 2020a ) , object detection Girish et al . ( 2020 ) , natural language processing Gale et al . ( 2019 ) ; Yu et al . ( 2020 ) ; Prasanna et al . ( 2020 ) ; Chen et al . ( 2020b ; c ) , generative adversarial networks Chen et al . ( 2021d ) ; Kalibhat et al . ( 2020 ) ; Chen et al . ( 2021a ) , graph neural networks Chen et al . ( 2021b ) , reinforcement learning Yu et al . ( 2020 ) , and life-long learning Chen et al . ( 2021c ) . However , all of the above LTH literature only locate unstructured sparse winning tickets , which can hardly bring hardware efficiency boost on real-world applications . As the most related work , You et al . ( 2020 ) finds structural winning tickets at only low sparsity levels around 30 % in few cases . It again reveals the complication and difficulty of identifying computation-friendly sparse patterns . Another concurrent work ( Alabdulmohsin et al. , 2021 ) investigates a generalized LTH with weight space factorization , which is orthogonal to our work . Sparse convolutional neural network ( CNN ) acceleration on GPU . Previous works have explored the acceleration of sparse convolution operations in two different directions . One direction is to design efficient implementation of unstructured pruned networks for improved data locality and utilization of hardware ( Chen , 2018 ; Park et al. , 2016 ) . For example , Dong et al . ( 2019 ) proposes “ Acorns ” to accelerate the sparse computations of convolution kernels with an input sparsity . Peng et al . ( 2017 ) has proposed a matrix splitting algorithm for efficient CNN inference . Nvidia ’ s cuSPARSE1 library contains various efficient sparse matrix computation algorithms like SpMM on GPUs , drawing great attention in efficient scientific computing . Furthermore , advanced approaches are developed based on SpMM , such as Adaptive Sparse Tiling ( ASpT ) ( Hong et al. , 2019 ) . ASpT significantly improves the data usage of SpMM and achieves the current state-of-the-art performance among SpMM implementation variants . Another direction focuses on more hardware-friendly pruning methods ( Chen et al. , 2018 ; Ma et al. , 2020 ; Niu et al. , 2020 ) . During the model pruning , these works aim to maintain certain regular sparse patterns , which benefit the hardware processing/computing of corresponding sparse matrices . However , Chen et al . ( 2018 ) achieves unsatisfactory compression ratio , while the pruning methods used in Ma et al . ( 2020 ) and Niu et al . ( 2020 ) require dedicated compiler optimization to accelerate network execution . | This work proposes a method to effectively find structurally sparse winning tickets. It consists of some post-processing techniques that can be added to each round of standard iterative magnitude pruning (IMP) methods. Starting from unstructured sparse sub-networks, the method uses a "re-filling and re-grouping" manner to enforce the formation of structural sparsity. | SP:3030aeb9862c75808ed5e9111432287520ff5062 |
Universal Joint Approximation of Manifolds and Densities by Simple Injective Flows | 1 INTRODUCTION . In the past several years , invertible flow networks emerged as powerful deep learning models to learn maps between distributions ( Durkan et al. , 2019a ; Grathwohl et al. , 2018 ; Huang et al. , 2018 ; Jaini et al. , 2019 ; Kingma et al. , 2016 ; Kingma & Dhariwal , 2018 ; Kobyzev et al. , 2020 ; Kruse et al. , 2019 ; Papamakarios et al. , 2019 ) . They generate excellent samples ( Kingma & Dhariwal , 2018 ) and facilitate solving scientific inference problems ( Brehmer & Cranmer , 2020 ; Kruse et al. , 2021 ) . By design , invertible flows are bijective and , hence , may not be a natural choice when the target distribution has low-dimensional support . This problem can be overcome by combining bijective flows with expansive , injective layers , which map to higher dimensions ( Brehmer & Cranmer , 2020 ; Cunningham et al. , 2020 ; Kothari et al. , 2021 ) . Despite their empirical success , the theoretical aspects of such globally injective architectures are not well understood . In this work , we present approximation-theoretic properties of injective flows whose architecture combines bijective flows and expansive , injective layers , with an emphasis on approximating measures with low-dimensional support . We state conditions under which these networks are universal approximators and describe how their design enables applications to inference and inverse problems . 1.1 PRIOR WORK . The idea to combine invertible ( coupling ) layers with expansive layers has been explored by Brehmer & Cranmer ( 2020 ) and Kothari et al . ( 2021 ) . Brehmer & Cranmer ( 2020 ) combine two flow networks with a simple expansive element ( in the sense made precise in Section 2.1 ) and obtain a network that paramterizes probability distributions supported on manifolds . They suggest that such constructions may be universal but neither they not Kothari et al . ( 2021 ) derive theoretical results . We discuss in detail the connection between these two empirical works and the approximation results derived here in Appendix B.1 . Kothari et al . ( 2021 ) propose expansive coupling layers and build networks similar to that of Brehmer & Cranmer ( 2020 ) but with an arbitrary number of expressive and expansive elements . They observe that the resulting network trains much faster with a smaller memory footprint , while producing high-quality samples on a variety of benchmark datasets . While to the best of our knowledge , there are no approximation-theoretic results for injective flows , there exists a body of work on universality of invertible flows ; see Kobyzev et al . ( 2020 ) for an overview . Several works show that certain bijective flow architectures are distributionally universal . This was proved for autoregressive flows with sigmoidal activations by Huang et al . ( 2018 ) and for sum-of-squares polynomial flows by Jaini et al . ( 2019 ) . Teshima et al . ( 2020 ) show that several flow networks including those from Huang et al . ( 2018 ) and Jaini et al . ( 2019 ) are also universal approximators of diffeomorphisms . The injective flows considered here have key applications in inference and inverse problems ; for an overview of deep learning approaches to inverse problems , see Arridge et al . ( 2019 ) . Bora et al . ( 2017 ) proposed to regularize compressed sensing problems by constraining the recovery to the range of ( pre-trained ) generative models . Injective flows with efficient inverses as generative models gives an algorithmic projection1 on the range , which facilitates implementation of reconstruction algorithms . An alternative approach is Bayesian , where flows are used to obtain tractable variational approximations of posterior distributions over parameters of interest , via supervised training on labeled input-output data pairs . Ardizzone et al . ( 2018 ) encode the dimension-reducing forward process by an invertible neural network ( INN ) , with additional outputs used to encode posterior variability . Invertibility guarantees that a model of the inverse process is learned implicitly . For a given measurement , the inverse pass of the INN approximates the posterior over parameters . Sun & Bouman ( 2020 ) propose variational approximations of the posterior using an untrained deep generative model . They train a normalizing flow which produces samples from the posterior , with the prior and the noise model given implicitly by the regularized misfit functional . In Kothari et al . ( 2021 ) this procedure is adapted to priors specified by injective flows which yields significant improvements in computational efficiency . 1.2 OUR CONTRIBUTION . We derive new approximation results for neural networks composed of bijective flows and injective expansive layers , including those introduced by Brehmer & Cranmer ( 2020 ) and Kothari et al . ( 2021 ) . We show that these networks universally jointly approximate a large class of manifolds and densities supported on them . We build on the results of Teshima et al . ( 2020 ) and develop a new theoretical device which we refer to as the embedding gap . This gap is a measure of how nearly a mapping from Ro → Rm embeds an n-dimensional manifold in Rm , where n ≤ o . We find a natural relationship between the embedding gap and the problem of approximating probability measures with low-dimensional support . We then relate the embedding gap to a relaxation of universality we call manifold embedding property . We show that this property captures the essential geometric aspects of universality and uncover important topological restrictions on the approximation power of these networks , to our knowledge , heretofore unknown in the literature . We give an example of an absolutely continuous measure µ and embedding f : R2 → R3 such that f # µ can not be approximated with combinations of flow layers and linear expansive layers . This may be surprising since it was previously thought that networks such as those of Brehmer & Cranmer ( 2020 ) can approximate any “ nice ” density supported on a “ nice ” manifold . We establish universality for manifolds with suitable topology , described in terms of extendable embeddings . Our proof shows that optimality of the approximating network can be established in reverse : optimality of a given layer can be established without optimality of preceding layers . This settles a ( generalization of a ) conjecture posed for a two-layer case in ( Brehmer & Cranmer , 2020 ) . Finally , we show that these universal architectures are also practical and admit exact layer-wise projections , as well as other properties discussed in Section 3.4 . 2 DESCRIPTION OF THE ARCHITECTURE . Let C ( X , Y ) denote the space of continuous functions X → Y . We study networks in F ⊂ C ( X , Y ) that are of the form : F = T nLL ◦ R nL−1 , nL L ◦ · · · ◦ T n11 ◦ Rn0 , n11 ◦ T n00 ( 1 ) 1Idempotent but in general not orthogonal . whereRn ` −1 , n `` ⊂ C ( Rn ` −1 , Rn ` ) , T n `` ⊂ C ( Rn ` , Rn ` ) , L ∈ N is the number of networks , n0 = n , nL = m , and n ` ≥ n ` −1 for ` = 1 , . . . , L. We introduce a well-tuned shorthand notation and write H ◦ G : = { h ◦ g : h ∈ H , g ∈ G } throughout the paper . We identify R with the expansive layers and T with the bijective flows . Loosely speaking , the purpose of the expansive layers is to allow the network to parameterize high-dimensional functions by low-dimensional coordinates in an injective way . The flow networks give the network the expressivity necessary for universal approximation of manifold-supported distributions . 2.1 EXPANSIVE LAYERS . The expansive elements transform an n-dimensional manifoldM embedded in Rn ` −1 , and embed it in a higher dimensional space Rn ` . To preserve the topology of the manifold , this must be done injectively . We thus make the following assumptions about the expansive elements : Definition 1 ( Expansive Element ) . Let ` = 1 , . . . , L , and Rn ` −1 , n `` be a family of functions from Rn ` −1 → Rn ` . Rn ` −1 , n `` is a family of expansive elements if every R ∈ R n ` −1 , n ` ` is injective and Lipschitz . Examples of expansive elements include ( R1 ) Zero padding : R ( x ) = [ xT ,0 ( m−n ) ] T where 0 ( m−n ) is the zero vector ( Brehmer & Cran- mer , 2020 ) . ( R2 ) Multiplication by an arbitrary full-rank matrix , or one-by-one convolution : R ( x ) = Wx , or R ( x ) = w ? x ( 2 ) where W ∈ Rm×n and rank ( W ) = n ( Cunningham et al. , 2020 ) , and w is a convolution kernel ? denotes convolution Kingma & Dhariwal ( 2018 ) . ( R3 ) Injective ReLU layers : R = ReLU ( Wx ) , W = [ BT , −DBT , MT ] T , R ( x ) = ReLU ( [ wT , −wT ] ? x ) for matrix B ∈ GLn ( R ) , positive diagonal matrix D ∈ Rn×n , and arbitrary matrix M ∈ R ( m−2n ) ×n ( Puthawala et al. , 2020 ) . ( R4 ) Injective ReLU networks ( Puthawala et al. , 2020 , Theorem 15 ) . These are functions R : Rn → Rm of the formR ( x ) = WL+1 ReLU ( . . .ReLU ( W1x+b1 ) . . . ) +bL whereW ` are n ` +1 × n ` matrices and b ` are the bias vectors in Rn ` +1 . The weight matrices WL satisfy the Directed Spanning Set ( DSS ) condition for ` ≤ L ( that make all layers injective ) and WL+1 is a generic matrix which makes the mapR : Rn → Rm injective . Note that the DSS condition requires that n ` ≥ 2n ` −1 + 1 for ` ≤ L and we have n1 = n and nL+1 = m . 2.2 BIJECTIVE FLOW NETWORKS . The bulk of our theoretical analysis is devoted to expressive elements . The expressive elements bend the range of the expansive elements into the correct shape . We make the following assumptions about the expressive elements : Definition 2 ( Bijective Flow Network ) . Let ` = 0 , . . . , L be given and let T n `` ⊂ C ( Rn ` , Rn ` ) . T n `` is a family of bijective flow networks if every T ∈ T n `` is Lipschitz continuous and bijective . Examples of bijective flow networks include ( T1 ) Coupling flows , introduced by Dinh et al . ( 2014 ) consider R ( x ) = Hk ◦ · · · ◦H1 ( x ) where Hi ( x ) = [ hi ( [ x ] 1 : d , gi ( [ x ] d+1 : n ) ) [ x ] d+1 : n ] . ( 3 ) In Eqn . 3 , hi : Rd × Re → Rd is invertible w.r.t . the first argument given the second , and gi : Rn−d → Re is arbitrary . Typically in practice the operation in Eqn . 3 is combined with additional invertible operations such as permutations , masking or convolutions Dinh et al . ( 2014 ; 2016 ) ; Kingma & Dhariwal ( 2018 ) . ( T2 ) Autoregressive flows , introduced by Kingma et al . ( 2016 ) are generalizations of triangular flows A : Rn → Rn where for i = 1 , . . . , n the i ’ th value of A is given by of the form [ A ] i ( x ) = hi ( [ x ] i , gi ( [ x ] 1 : i−1 ) ) ( 4 ) In Eqn . 4 , hi : R × Rm → R where again hi is invertible w.r.t . the first argument given the second , and gi : Ri−1 → Rm is arbitrary except for g1 = 0 . In Huang et al . ( 2018 ) , the authors choose hi ( x , y ) , where y ∈ Rm , to be a multi-layer perceptron ( MLP ) of the form hi ( x , y ) = φ ◦Wp , y ◦ · · · ◦ φ ◦W1 , y ( x ) ( 5 ) where φ is a sigmoidal increasing non-linear activation function . | This paper studied the expressive power of models composed of invertible flows and injective embeddings. First, this paper defined the concept of the Embedding Gap as the measure by which a model can approximate an embedding with low-dimensional support. Then, this paper defined the concept of MEP as the ability to approximate the target embedding arbitrarily small in terms of the Embedding Gap. This paper showed that when invertible layers have the MEP properties and the first layer is a distributively universal approximator (and some additional assumptions), the model is a universal approximator in terms of 2-Wasserstein distance (Theorem 1). Finally, this paper gave a method to compute the inverse transformation of an injective layer with a special form of linear transformation and ReLU nonlinearity. (Theorem 2). | SP:5bd15d735380afa17fd1dde6df22de951699a755 |
Universal Joint Approximation of Manifolds and Densities by Simple Injective Flows | 1 INTRODUCTION . In the past several years , invertible flow networks emerged as powerful deep learning models to learn maps between distributions ( Durkan et al. , 2019a ; Grathwohl et al. , 2018 ; Huang et al. , 2018 ; Jaini et al. , 2019 ; Kingma et al. , 2016 ; Kingma & Dhariwal , 2018 ; Kobyzev et al. , 2020 ; Kruse et al. , 2019 ; Papamakarios et al. , 2019 ) . They generate excellent samples ( Kingma & Dhariwal , 2018 ) and facilitate solving scientific inference problems ( Brehmer & Cranmer , 2020 ; Kruse et al. , 2021 ) . By design , invertible flows are bijective and , hence , may not be a natural choice when the target distribution has low-dimensional support . This problem can be overcome by combining bijective flows with expansive , injective layers , which map to higher dimensions ( Brehmer & Cranmer , 2020 ; Cunningham et al. , 2020 ; Kothari et al. , 2021 ) . Despite their empirical success , the theoretical aspects of such globally injective architectures are not well understood . In this work , we present approximation-theoretic properties of injective flows whose architecture combines bijective flows and expansive , injective layers , with an emphasis on approximating measures with low-dimensional support . We state conditions under which these networks are universal approximators and describe how their design enables applications to inference and inverse problems . 1.1 PRIOR WORK . The idea to combine invertible ( coupling ) layers with expansive layers has been explored by Brehmer & Cranmer ( 2020 ) and Kothari et al . ( 2021 ) . Brehmer & Cranmer ( 2020 ) combine two flow networks with a simple expansive element ( in the sense made precise in Section 2.1 ) and obtain a network that paramterizes probability distributions supported on manifolds . They suggest that such constructions may be universal but neither they not Kothari et al . ( 2021 ) derive theoretical results . We discuss in detail the connection between these two empirical works and the approximation results derived here in Appendix B.1 . Kothari et al . ( 2021 ) propose expansive coupling layers and build networks similar to that of Brehmer & Cranmer ( 2020 ) but with an arbitrary number of expressive and expansive elements . They observe that the resulting network trains much faster with a smaller memory footprint , while producing high-quality samples on a variety of benchmark datasets . While to the best of our knowledge , there are no approximation-theoretic results for injective flows , there exists a body of work on universality of invertible flows ; see Kobyzev et al . ( 2020 ) for an overview . Several works show that certain bijective flow architectures are distributionally universal . This was proved for autoregressive flows with sigmoidal activations by Huang et al . ( 2018 ) and for sum-of-squares polynomial flows by Jaini et al . ( 2019 ) . Teshima et al . ( 2020 ) show that several flow networks including those from Huang et al . ( 2018 ) and Jaini et al . ( 2019 ) are also universal approximators of diffeomorphisms . The injective flows considered here have key applications in inference and inverse problems ; for an overview of deep learning approaches to inverse problems , see Arridge et al . ( 2019 ) . Bora et al . ( 2017 ) proposed to regularize compressed sensing problems by constraining the recovery to the range of ( pre-trained ) generative models . Injective flows with efficient inverses as generative models gives an algorithmic projection1 on the range , which facilitates implementation of reconstruction algorithms . An alternative approach is Bayesian , where flows are used to obtain tractable variational approximations of posterior distributions over parameters of interest , via supervised training on labeled input-output data pairs . Ardizzone et al . ( 2018 ) encode the dimension-reducing forward process by an invertible neural network ( INN ) , with additional outputs used to encode posterior variability . Invertibility guarantees that a model of the inverse process is learned implicitly . For a given measurement , the inverse pass of the INN approximates the posterior over parameters . Sun & Bouman ( 2020 ) propose variational approximations of the posterior using an untrained deep generative model . They train a normalizing flow which produces samples from the posterior , with the prior and the noise model given implicitly by the regularized misfit functional . In Kothari et al . ( 2021 ) this procedure is adapted to priors specified by injective flows which yields significant improvements in computational efficiency . 1.2 OUR CONTRIBUTION . We derive new approximation results for neural networks composed of bijective flows and injective expansive layers , including those introduced by Brehmer & Cranmer ( 2020 ) and Kothari et al . ( 2021 ) . We show that these networks universally jointly approximate a large class of manifolds and densities supported on them . We build on the results of Teshima et al . ( 2020 ) and develop a new theoretical device which we refer to as the embedding gap . This gap is a measure of how nearly a mapping from Ro → Rm embeds an n-dimensional manifold in Rm , where n ≤ o . We find a natural relationship between the embedding gap and the problem of approximating probability measures with low-dimensional support . We then relate the embedding gap to a relaxation of universality we call manifold embedding property . We show that this property captures the essential geometric aspects of universality and uncover important topological restrictions on the approximation power of these networks , to our knowledge , heretofore unknown in the literature . We give an example of an absolutely continuous measure µ and embedding f : R2 → R3 such that f # µ can not be approximated with combinations of flow layers and linear expansive layers . This may be surprising since it was previously thought that networks such as those of Brehmer & Cranmer ( 2020 ) can approximate any “ nice ” density supported on a “ nice ” manifold . We establish universality for manifolds with suitable topology , described in terms of extendable embeddings . Our proof shows that optimality of the approximating network can be established in reverse : optimality of a given layer can be established without optimality of preceding layers . This settles a ( generalization of a ) conjecture posed for a two-layer case in ( Brehmer & Cranmer , 2020 ) . Finally , we show that these universal architectures are also practical and admit exact layer-wise projections , as well as other properties discussed in Section 3.4 . 2 DESCRIPTION OF THE ARCHITECTURE . Let C ( X , Y ) denote the space of continuous functions X → Y . We study networks in F ⊂ C ( X , Y ) that are of the form : F = T nLL ◦ R nL−1 , nL L ◦ · · · ◦ T n11 ◦ Rn0 , n11 ◦ T n00 ( 1 ) 1Idempotent but in general not orthogonal . whereRn ` −1 , n `` ⊂ C ( Rn ` −1 , Rn ` ) , T n `` ⊂ C ( Rn ` , Rn ` ) , L ∈ N is the number of networks , n0 = n , nL = m , and n ` ≥ n ` −1 for ` = 1 , . . . , L. We introduce a well-tuned shorthand notation and write H ◦ G : = { h ◦ g : h ∈ H , g ∈ G } throughout the paper . We identify R with the expansive layers and T with the bijective flows . Loosely speaking , the purpose of the expansive layers is to allow the network to parameterize high-dimensional functions by low-dimensional coordinates in an injective way . The flow networks give the network the expressivity necessary for universal approximation of manifold-supported distributions . 2.1 EXPANSIVE LAYERS . The expansive elements transform an n-dimensional manifoldM embedded in Rn ` −1 , and embed it in a higher dimensional space Rn ` . To preserve the topology of the manifold , this must be done injectively . We thus make the following assumptions about the expansive elements : Definition 1 ( Expansive Element ) . Let ` = 1 , . . . , L , and Rn ` −1 , n `` be a family of functions from Rn ` −1 → Rn ` . Rn ` −1 , n `` is a family of expansive elements if every R ∈ R n ` −1 , n ` ` is injective and Lipschitz . Examples of expansive elements include ( R1 ) Zero padding : R ( x ) = [ xT ,0 ( m−n ) ] T where 0 ( m−n ) is the zero vector ( Brehmer & Cran- mer , 2020 ) . ( R2 ) Multiplication by an arbitrary full-rank matrix , or one-by-one convolution : R ( x ) = Wx , or R ( x ) = w ? x ( 2 ) where W ∈ Rm×n and rank ( W ) = n ( Cunningham et al. , 2020 ) , and w is a convolution kernel ? denotes convolution Kingma & Dhariwal ( 2018 ) . ( R3 ) Injective ReLU layers : R = ReLU ( Wx ) , W = [ BT , −DBT , MT ] T , R ( x ) = ReLU ( [ wT , −wT ] ? x ) for matrix B ∈ GLn ( R ) , positive diagonal matrix D ∈ Rn×n , and arbitrary matrix M ∈ R ( m−2n ) ×n ( Puthawala et al. , 2020 ) . ( R4 ) Injective ReLU networks ( Puthawala et al. , 2020 , Theorem 15 ) . These are functions R : Rn → Rm of the formR ( x ) = WL+1 ReLU ( . . .ReLU ( W1x+b1 ) . . . ) +bL whereW ` are n ` +1 × n ` matrices and b ` are the bias vectors in Rn ` +1 . The weight matrices WL satisfy the Directed Spanning Set ( DSS ) condition for ` ≤ L ( that make all layers injective ) and WL+1 is a generic matrix which makes the mapR : Rn → Rm injective . Note that the DSS condition requires that n ` ≥ 2n ` −1 + 1 for ` ≤ L and we have n1 = n and nL+1 = m . 2.2 BIJECTIVE FLOW NETWORKS . The bulk of our theoretical analysis is devoted to expressive elements . The expressive elements bend the range of the expansive elements into the correct shape . We make the following assumptions about the expressive elements : Definition 2 ( Bijective Flow Network ) . Let ` = 0 , . . . , L be given and let T n `` ⊂ C ( Rn ` , Rn ` ) . T n `` is a family of bijective flow networks if every T ∈ T n `` is Lipschitz continuous and bijective . Examples of bijective flow networks include ( T1 ) Coupling flows , introduced by Dinh et al . ( 2014 ) consider R ( x ) = Hk ◦ · · · ◦H1 ( x ) where Hi ( x ) = [ hi ( [ x ] 1 : d , gi ( [ x ] d+1 : n ) ) [ x ] d+1 : n ] . ( 3 ) In Eqn . 3 , hi : Rd × Re → Rd is invertible w.r.t . the first argument given the second , and gi : Rn−d → Re is arbitrary . Typically in practice the operation in Eqn . 3 is combined with additional invertible operations such as permutations , masking or convolutions Dinh et al . ( 2014 ; 2016 ) ; Kingma & Dhariwal ( 2018 ) . ( T2 ) Autoregressive flows , introduced by Kingma et al . ( 2016 ) are generalizations of triangular flows A : Rn → Rn where for i = 1 , . . . , n the i ’ th value of A is given by of the form [ A ] i ( x ) = hi ( [ x ] i , gi ( [ x ] 1 : i−1 ) ) ( 4 ) In Eqn . 4 , hi : R × Rm → R where again hi is invertible w.r.t . the first argument given the second , and gi : Ri−1 → Rm is arbitrary except for g1 = 0 . In Huang et al . ( 2018 ) , the authors choose hi ( x , y ) , where y ∈ Rm , to be a multi-layer perceptron ( MLP ) of the form hi ( x , y ) = φ ◦Wp , y ◦ · · · ◦ φ ◦W1 , y ( x ) ( 5 ) where φ is a sigmoidal increasing non-linear activation function . | In this paper, the authors studies flow models by a newly developed approximation measure when the data is on a low-dimensional manifold. Specifically, they consider an architecture that alternates a bijective function with the same input and output dimensions, and a function with a larger dimension at the output. There are several successful methods for this, but the globally invertible flow is not well understood. To address this problem, this work shows the approximate properties of the flow architecture. Specifically, they show the approximation accuracy of the models with distributions that have a certain manifold as their support. In doing so, they proposed a new notion of embedding gap to evaluate the manifold embedding. This may allow them to represent cases that cannot be represented by existing topologies. In addition, they defined a value of MEP, which allows us to evaluate the approximation capability under different topologies. This establishes the validity of evaluating the performance for each layer. | SP:5bd15d735380afa17fd1dde6df22de951699a755 |
How to Improve Sample Complexity of SGD over Highly Dependent Data? | 1 INTRODUCTION . Stochastic optimization algorithms have attracted great attention in the past decade due to its successful applications to a broad research areas , including deep learning ( Goodfellow et al. , 2016 ) , reinforcement learning ( Sutton & Barto , 2018 ) , online learning ( Bottou , 2010 ; Hazan , 2017 ) , control ( Marti , 2017 ) , etc . In the conventional analysis of stochastic optimization algorithms , it is usually assumed that all data samples are independently and identically distributed ( i.i.d . ) and queried . For example , data samples in the traditional empirical risk minimization framework are assumed to be queried independently from the underlying data distribution , while data samples in reinforcement learning are assumed to be queried from the stationary distribution of the underlying Markov chain . Although the i.i.d . data assumption leads to a comprehensive understanding of the statistical limit and computation complexity of SGD , it violates the nature of many practical data-generating stochastic processes , which generate highly correlated samples that depend on the history . In fact , dependent data can be found almost everywhere , e.g. , daily stock price , weather/climate data , state transitions in Markov chains , etc . To understand the impact of data dependence on the convergence and complexity of stochastic algorithms , there is a growing number of recent works that introduce various definitions to quantify data dependence . Specifically , to analyze the finite-time convergence of various stochastic reinforcement learning algorithms , recent studies assume that the dependent samples queried from the Markov decision process satisfy a geometric mixing property ( Dalal et al. , 2018 ; Zou et al. , 2019 ; Xu & Gu , 2020 ; Qu & Wierman , 2020 ) , which requires the underlying Markov chain to be uniformly ergodic or has a finite mixing time ( Even-Dar et al. , 2003 ) . On the other hand , to analyze the convergence of stochastic optimization algorithms over dependent data , Karimi et al . ( 2019 ) assumed the existence of a solution to the Poisson equation associated with the underlying Markov chain , which is a weaker condition than the uniform ergodic condition ( Glynn & Meyn , 1996 ) . Moreover , Agarwal & Duchi ( 2012 ) introduced a φ-mixing property of the datagenerating process that quantifies how fast the distribution of future data samples ( conditioned on a fixed filtration ) converges to the underlying stationary data distribution . In particular , the φ-mixing property is more general than the previous two notions of data dependence ( Douc et al. , 2018 ) . While the aforementioned works leveraged the above notions of data dependence to characterize the sample complexity of various standard stochastic algorithms over dependent data , there still lacks theoretical understanding of how algorithm structure affects the sample complexity of stochastic algorithms under different levels of data dependence . In particular , a key algorithm structure is the stochastic update scheme , which critically affects the bias and variance of the stochastic optimization process . In fact , under i.i.d . data and convex geometry , it is well known that SGD achieves the sample complexity lower bound under various stochastic update schemes ( Bottou , 2010 ) , e.g. , single-sample update and mini-batch update . However , these stochastic update schemes may lead to substantially different convergence behaviors over highly dependent data , as they are no longer unbiased . Therefore , it is of vital importance to understand the interplay among data dependence , structure of stochastic update and convergence rate of stochastic algorithms , and we want to ask the following fundamental question . • Q : How does the structure of stochastic updates affect the convergence rate and sample complexity of stochastic algorithms over dependent data ? In this paper , we provide comprehensive answers to the above fundamental question . Specifically , we conduct a comprehensive study of the convergence rate and sample complexity of the SGD algorithm over a wide spectrum of data dependence levels under various types of stochastic updates , including periodic subsampling and mini-batch sampling . Our results show that SGD with both stochastic updates achieves a substantially improved sample complexity over the standard SGD under highly dependent data . We summarize our contributions as follows . 1.1 OUR CONTRIBUTIONS . We consider the following standard stochastic optimization problem . min w∈W f ( w ) : = Eξ∼µ [ F ( w ; ξ ) ] , ( P ) where the objective function f is convex and Lipschitz continuous , and the expectation is taken over the stationary distribution µ of the underlying data-generating process P. To perform stochastic optimization , we query a stream of dependent data samples from the underlying data-generating process . Specifically , we adopt the φ-mixing model to quantify the data dependence via a decaying mixing coefficient function φξ ( k ) ( see Definition 2.2 ) ( Agarwal & Duchi , 2012 ) . We study the convergence of the stochastic gradient descent ( SGD ) algorithm over φ-mixing dependent data samples under various stochastic update schemes , including data subsampling and mini-batch sampling . We first study the convergence of SGD over φ-mixing dependent data samples under the data subsampling update scheme . In particular , the data subsampling update scheme utilizes only one data sample per r consecutive data samples by periodically skipping r − 1 samples . With this data subsampling scheme , the subsampled data samples are less dependent for a larger subsampling period r. Consequently , we show that SGD with a proper data subsampling period achieves an improved sample complexity over that of the standard SGD in the full spectrum of the convergence rate of the φ-mixing coefficient . In particular , the improvement is substantial when the data is highly dependent with an algebraic decaying φ-mixing coefficient . Moreover , we study the sample complexity of SGD over φ-mixing dependent data samples under the mini-batch update scheme . Compare to the data subsampling update , mini-batch update can substantially reduce the mini-batch data dependence without skipping data samples . Consequently , mini-batch update leverages the sample average over a mini batch of data samples to reduce both the bias ( caused by the data dependence ) and the optimization variance . Specifically , we show that SGD with mini-batch update achieves an orderwise lower sample complexity than both the standard SGD and the SGD with data subsampling in the full spectrum of the convergence rate of the φ-mixing coefficient . We summarize and compare the sample complexities of these stochastic algorithms under different φ-mixing data dependence models in Table 1 . 1.2 RELATED WORK . Stochastic Algorithms over Dependent Data Steinwart & Christmann ( 2009 ) and Modha & Masry ( 1996 ) established the convergence analysis of online stochastic algorithms for streaming data with geometric ergodicity . Duchi et al . ( 2011 ) proved that the stochastic subgradient method has strong convergence guarantee if the mixing time is uniformly bounded . Agarwal & Duchi ( 2012 ) studied the convex/strongly convex stochastic optimization problem and proved high-probability convergence bounds for general stochastic algorithms under general stationary mixing processes . Godichon-Baggioni et al . ( 2021 ) provided the non-asymptotic analysis of stochastic algorithms with strongly convex objective function over streaming mini-batch data . In a more general setting , the stochastic approximation ( SA ) problem was studied in ( Karimi et al. , 2019 ) by assuming the existence of solution to a Poisson equation . Recently , Debavelaere et al . ( 2021 ) developed the asymptotic convergence analysis of SA problem for sub-geometric Markov dynamic noises . Finite-time convergence of reinforcement learning Recently , a series of work studied the finitetime convergence of many stochastic reinforcement learning algorithms over Markovian dependent samples , including TD learning ( Dalal et al. , 2018 ; Xu et al. , 2019 ; Kaledin et al. , 2020 ) , Q-learning ( Qu & Wierman , 2020 ; Li et al. , 2021 ; Melo et al. , 2008 ; Chen et al. , 2019 ; Xu & Gu , 2020 ) , fitted Qiteration ( Mnih et al. , 2013 ; 2015 ; Agarwal et al. , 2021 ) , actor-critic algorithms ( Wang et al. , 2019 ; Yang et al. , 2019 ; Kumar et al. , 2019 ; Qiu et al. , 2019 ; Wu et al. , 2020 ; Xu et al. , 2020 ) , etc . In these studies , the dependent Markovian samples are assumed to satisfy the geometric φ-mixing property , which is satisfied when the underlying Markov chain is uniformly ergodic or time-homogeneous with finite-states . Regret of Stochastic Convex Optimization There have been many known regret bounds for online convex optimization problem . Hazan ( 2017 ) has built the standardO ( √ T ) regret bound for online SGD algorithm with assuming the bounded gradient . Xiao ( 2009 ) introduces the regret bound of online dual averaging method . To our best knowledge , there is no high-probability guaranteed regret bound for mini-batch SGD algorithm with considering the data dependence . 2 PROBLEM FORMULATION AND ASSUMPTIONS . In this section , we introduce the problem formulation and some basic assumptions . Consider a model with parameters w. For any data sample ξ , denote F ( w ; ξ ) ∈ R as the sample loss of this data sample under the model w. In this paper , we consider the following standard stochastic optimization problem that has broad applications in machine learning . min w∈W f ( w ) : = Eξ∼µ [ F ( w ; ξ ) ] . ( P ) Here , the expectation is taken over the randomness of the data sample ξ , which is drawn from an underlying distribution µ . In particular , we make the following standard assumptions regarding the problem ( P ) ( Agarwal & Duchi , 2012 ) . Assumption 2.1 . The stochastic optimization problem ( P ) satisfies 1 . For every ξ , function F ( · ; ξ ) is G-Lipschitz continuous overW , i.e. , for all w , v ∈ W , |F ( w ; ξ ) − F ( v ; ξ ) | ≤ G‖w − v‖ . 2 . Function f ( · ) is convex and bounded below , i.e. , f ( w∗ ) : = infw∈W f ( w ) > −∞ . 3 . W is a convex and compact set with bounded diameter R , i.e. , supw , v∈W ‖w − v‖ ≤ R. To solve this stochastic optimization problem , one often needs to query a set of data samples from the distribution µ to perform optimization . Unlike traditional stochastic optimization that usually assumes that the data samples are i.i.d . we consider a more general and practical dependent datagenerating process as we elaborate below . Dependent data-generating process : We consider a stochastic process P that generates a stream of data samples { ξ1 , ξ2 , ... , } , which are not necessarily independent . In particular , the stochastic process P has an underlying stationary distribution µ . To quantify the dependence of the data generation process , we introduce the following standard φ-mixing model ( Agarwal & Duchi , 2012 ) , where we denote { Ft } t as the canonical filtration generated by { ξt } t. Definition 2.2 ( φ-mixing process ) . Consider a stochastic process { ξt } t with a stationary distribution µ . Let P ( ξt+k ∈ ·|Ft ) be the distribution of the ( t+k ) -th sample conditioned on Ft , and denote dTV as the total variation distance . Then , the process { ξt } t is called φ-mixing if the following mixing coefficient φξ ( · ) converges to 0 as k tends to infinity . φξ ( k ) : = sup t∈N , A∈Ft 2dTV ( P ( ξt+k ∈ ·|A ) , µ ) . Intuitively , the φ-mixing coefficient describes how fast the distribution of sample ξt+k converges to the stationary distribution µ when conditioned on the filtration Ft , as the time gap k → ∞ . The φmixing process can be found in many applications , which involve mixing coefficients that converge to zero at different convergence rates . Below we mention some popular examples . • Geometric φ-mixing process . Such a type of process has a geometrically diminishing mixing coefficient , i.e. , φξ ( k ) ≤ φ0 exp ( −ckθ ) for some φ0 , c , θ > 0 . Examples include finite-state ergodic Markov chains and some aperiodic Harris-recurrent Markov processes ( Modha & Masry , 1996 ; Agarwal & Duchi , 2012 ; Meyn & Tweedie , 2012 ) ; • Algebraic φ-mixing process . Such a type of process has a polynomially diminishing mixing coefficient , i.e. , φξ ( k ) ≤ φ0k−θ for some φ0 , θ > 0 . Examples include a large class of Metropolis-Hastings samplers ( Jarner & Roberts , 2002 ) and some queuing systems ( Agarwal & Duchi , 2012 ) . | In stochastic convex optimization (SCO) characterized by the following objective for convex $f$, $$\min_w f(w) := \mathbb{E}_{\xi\sim \mu}[F(w; \xi)],$$ we typically assume repeated access to the noise distribution $\mu$, for sampling i.i.d. random variables $(\xi_t)_t$. This access can be used to obtain unbiased estimates $\nabla F(w; \xi_t)$ of the true gradient $\nabla f(w)$. This oracle access can be used to implement stochastic gradient methods, which are well studied and known to have optimal sample complexity under certain regularity conditions. On the other hand in online convex optimization, at each time step, we obtain a loss function $f_t$ from some function class $\mathcal{F}$, and we have to minimize some notion of regret. This can be modeled like SCO by defining, $f_t:= F(.; \xi_t)$, but since there was no restriction on $f_t$'s, the $\xi_t$'s here can have arbitrary dependencies over time. In particular, they could be chosen adversarially. In between both these extremes is the setting where $\xi_t$ could have some dependency structure. One such structure called $\phi$-mixing was introduced by [Agarwal and Duchi](https://arxiv.org/abs/1110.2529). Under this dependence assumption, they provide upper bounds on the convergence of SGD. This paper generalizes these upper bounds to a sub-sampling variant of SGD as well as mini-batch SGD. It shows that mini-batch SGD essentially attains the $1/\epsilon^2$ sample complexity of for i.i.d. sampling when there is a low level of dependence in $\xi_t$'s, and more generally improves over vanilla SGD across various levels of dependence captured by the $\phi$-mixing assumption. | SP:ac7517dabc5ac45ae486f427a2efeeed0191e5e7 |
How to Improve Sample Complexity of SGD over Highly Dependent Data? | 1 INTRODUCTION . Stochastic optimization algorithms have attracted great attention in the past decade due to its successful applications to a broad research areas , including deep learning ( Goodfellow et al. , 2016 ) , reinforcement learning ( Sutton & Barto , 2018 ) , online learning ( Bottou , 2010 ; Hazan , 2017 ) , control ( Marti , 2017 ) , etc . In the conventional analysis of stochastic optimization algorithms , it is usually assumed that all data samples are independently and identically distributed ( i.i.d . ) and queried . For example , data samples in the traditional empirical risk minimization framework are assumed to be queried independently from the underlying data distribution , while data samples in reinforcement learning are assumed to be queried from the stationary distribution of the underlying Markov chain . Although the i.i.d . data assumption leads to a comprehensive understanding of the statistical limit and computation complexity of SGD , it violates the nature of many practical data-generating stochastic processes , which generate highly correlated samples that depend on the history . In fact , dependent data can be found almost everywhere , e.g. , daily stock price , weather/climate data , state transitions in Markov chains , etc . To understand the impact of data dependence on the convergence and complexity of stochastic algorithms , there is a growing number of recent works that introduce various definitions to quantify data dependence . Specifically , to analyze the finite-time convergence of various stochastic reinforcement learning algorithms , recent studies assume that the dependent samples queried from the Markov decision process satisfy a geometric mixing property ( Dalal et al. , 2018 ; Zou et al. , 2019 ; Xu & Gu , 2020 ; Qu & Wierman , 2020 ) , which requires the underlying Markov chain to be uniformly ergodic or has a finite mixing time ( Even-Dar et al. , 2003 ) . On the other hand , to analyze the convergence of stochastic optimization algorithms over dependent data , Karimi et al . ( 2019 ) assumed the existence of a solution to the Poisson equation associated with the underlying Markov chain , which is a weaker condition than the uniform ergodic condition ( Glynn & Meyn , 1996 ) . Moreover , Agarwal & Duchi ( 2012 ) introduced a φ-mixing property of the datagenerating process that quantifies how fast the distribution of future data samples ( conditioned on a fixed filtration ) converges to the underlying stationary data distribution . In particular , the φ-mixing property is more general than the previous two notions of data dependence ( Douc et al. , 2018 ) . While the aforementioned works leveraged the above notions of data dependence to characterize the sample complexity of various standard stochastic algorithms over dependent data , there still lacks theoretical understanding of how algorithm structure affects the sample complexity of stochastic algorithms under different levels of data dependence . In particular , a key algorithm structure is the stochastic update scheme , which critically affects the bias and variance of the stochastic optimization process . In fact , under i.i.d . data and convex geometry , it is well known that SGD achieves the sample complexity lower bound under various stochastic update schemes ( Bottou , 2010 ) , e.g. , single-sample update and mini-batch update . However , these stochastic update schemes may lead to substantially different convergence behaviors over highly dependent data , as they are no longer unbiased . Therefore , it is of vital importance to understand the interplay among data dependence , structure of stochastic update and convergence rate of stochastic algorithms , and we want to ask the following fundamental question . • Q : How does the structure of stochastic updates affect the convergence rate and sample complexity of stochastic algorithms over dependent data ? In this paper , we provide comprehensive answers to the above fundamental question . Specifically , we conduct a comprehensive study of the convergence rate and sample complexity of the SGD algorithm over a wide spectrum of data dependence levels under various types of stochastic updates , including periodic subsampling and mini-batch sampling . Our results show that SGD with both stochastic updates achieves a substantially improved sample complexity over the standard SGD under highly dependent data . We summarize our contributions as follows . 1.1 OUR CONTRIBUTIONS . We consider the following standard stochastic optimization problem . min w∈W f ( w ) : = Eξ∼µ [ F ( w ; ξ ) ] , ( P ) where the objective function f is convex and Lipschitz continuous , and the expectation is taken over the stationary distribution µ of the underlying data-generating process P. To perform stochastic optimization , we query a stream of dependent data samples from the underlying data-generating process . Specifically , we adopt the φ-mixing model to quantify the data dependence via a decaying mixing coefficient function φξ ( k ) ( see Definition 2.2 ) ( Agarwal & Duchi , 2012 ) . We study the convergence of the stochastic gradient descent ( SGD ) algorithm over φ-mixing dependent data samples under various stochastic update schemes , including data subsampling and mini-batch sampling . We first study the convergence of SGD over φ-mixing dependent data samples under the data subsampling update scheme . In particular , the data subsampling update scheme utilizes only one data sample per r consecutive data samples by periodically skipping r − 1 samples . With this data subsampling scheme , the subsampled data samples are less dependent for a larger subsampling period r. Consequently , we show that SGD with a proper data subsampling period achieves an improved sample complexity over that of the standard SGD in the full spectrum of the convergence rate of the φ-mixing coefficient . In particular , the improvement is substantial when the data is highly dependent with an algebraic decaying φ-mixing coefficient . Moreover , we study the sample complexity of SGD over φ-mixing dependent data samples under the mini-batch update scheme . Compare to the data subsampling update , mini-batch update can substantially reduce the mini-batch data dependence without skipping data samples . Consequently , mini-batch update leverages the sample average over a mini batch of data samples to reduce both the bias ( caused by the data dependence ) and the optimization variance . Specifically , we show that SGD with mini-batch update achieves an orderwise lower sample complexity than both the standard SGD and the SGD with data subsampling in the full spectrum of the convergence rate of the φ-mixing coefficient . We summarize and compare the sample complexities of these stochastic algorithms under different φ-mixing data dependence models in Table 1 . 1.2 RELATED WORK . Stochastic Algorithms over Dependent Data Steinwart & Christmann ( 2009 ) and Modha & Masry ( 1996 ) established the convergence analysis of online stochastic algorithms for streaming data with geometric ergodicity . Duchi et al . ( 2011 ) proved that the stochastic subgradient method has strong convergence guarantee if the mixing time is uniformly bounded . Agarwal & Duchi ( 2012 ) studied the convex/strongly convex stochastic optimization problem and proved high-probability convergence bounds for general stochastic algorithms under general stationary mixing processes . Godichon-Baggioni et al . ( 2021 ) provided the non-asymptotic analysis of stochastic algorithms with strongly convex objective function over streaming mini-batch data . In a more general setting , the stochastic approximation ( SA ) problem was studied in ( Karimi et al. , 2019 ) by assuming the existence of solution to a Poisson equation . Recently , Debavelaere et al . ( 2021 ) developed the asymptotic convergence analysis of SA problem for sub-geometric Markov dynamic noises . Finite-time convergence of reinforcement learning Recently , a series of work studied the finitetime convergence of many stochastic reinforcement learning algorithms over Markovian dependent samples , including TD learning ( Dalal et al. , 2018 ; Xu et al. , 2019 ; Kaledin et al. , 2020 ) , Q-learning ( Qu & Wierman , 2020 ; Li et al. , 2021 ; Melo et al. , 2008 ; Chen et al. , 2019 ; Xu & Gu , 2020 ) , fitted Qiteration ( Mnih et al. , 2013 ; 2015 ; Agarwal et al. , 2021 ) , actor-critic algorithms ( Wang et al. , 2019 ; Yang et al. , 2019 ; Kumar et al. , 2019 ; Qiu et al. , 2019 ; Wu et al. , 2020 ; Xu et al. , 2020 ) , etc . In these studies , the dependent Markovian samples are assumed to satisfy the geometric φ-mixing property , which is satisfied when the underlying Markov chain is uniformly ergodic or time-homogeneous with finite-states . Regret of Stochastic Convex Optimization There have been many known regret bounds for online convex optimization problem . Hazan ( 2017 ) has built the standardO ( √ T ) regret bound for online SGD algorithm with assuming the bounded gradient . Xiao ( 2009 ) introduces the regret bound of online dual averaging method . To our best knowledge , there is no high-probability guaranteed regret bound for mini-batch SGD algorithm with considering the data dependence . 2 PROBLEM FORMULATION AND ASSUMPTIONS . In this section , we introduce the problem formulation and some basic assumptions . Consider a model with parameters w. For any data sample ξ , denote F ( w ; ξ ) ∈ R as the sample loss of this data sample under the model w. In this paper , we consider the following standard stochastic optimization problem that has broad applications in machine learning . min w∈W f ( w ) : = Eξ∼µ [ F ( w ; ξ ) ] . ( P ) Here , the expectation is taken over the randomness of the data sample ξ , which is drawn from an underlying distribution µ . In particular , we make the following standard assumptions regarding the problem ( P ) ( Agarwal & Duchi , 2012 ) . Assumption 2.1 . The stochastic optimization problem ( P ) satisfies 1 . For every ξ , function F ( · ; ξ ) is G-Lipschitz continuous overW , i.e. , for all w , v ∈ W , |F ( w ; ξ ) − F ( v ; ξ ) | ≤ G‖w − v‖ . 2 . Function f ( · ) is convex and bounded below , i.e. , f ( w∗ ) : = infw∈W f ( w ) > −∞ . 3 . W is a convex and compact set with bounded diameter R , i.e. , supw , v∈W ‖w − v‖ ≤ R. To solve this stochastic optimization problem , one often needs to query a set of data samples from the distribution µ to perform optimization . Unlike traditional stochastic optimization that usually assumes that the data samples are i.i.d . we consider a more general and practical dependent datagenerating process as we elaborate below . Dependent data-generating process : We consider a stochastic process P that generates a stream of data samples { ξ1 , ξ2 , ... , } , which are not necessarily independent . In particular , the stochastic process P has an underlying stationary distribution µ . To quantify the dependence of the data generation process , we introduce the following standard φ-mixing model ( Agarwal & Duchi , 2012 ) , where we denote { Ft } t as the canonical filtration generated by { ξt } t. Definition 2.2 ( φ-mixing process ) . Consider a stochastic process { ξt } t with a stationary distribution µ . Let P ( ξt+k ∈ ·|Ft ) be the distribution of the ( t+k ) -th sample conditioned on Ft , and denote dTV as the total variation distance . Then , the process { ξt } t is called φ-mixing if the following mixing coefficient φξ ( · ) converges to 0 as k tends to infinity . φξ ( k ) : = sup t∈N , A∈Ft 2dTV ( P ( ξt+k ∈ ·|A ) , µ ) . Intuitively , the φ-mixing coefficient describes how fast the distribution of sample ξt+k converges to the stationary distribution µ when conditioned on the filtration Ft , as the time gap k → ∞ . The φmixing process can be found in many applications , which involve mixing coefficients that converge to zero at different convergence rates . Below we mention some popular examples . • Geometric φ-mixing process . Such a type of process has a geometrically diminishing mixing coefficient , i.e. , φξ ( k ) ≤ φ0 exp ( −ckθ ) for some φ0 , c , θ > 0 . Examples include finite-state ergodic Markov chains and some aperiodic Harris-recurrent Markov processes ( Modha & Masry , 1996 ; Agarwal & Duchi , 2012 ; Meyn & Tweedie , 2012 ) ; • Algebraic φ-mixing process . Such a type of process has a polynomially diminishing mixing coefficient , i.e. , φξ ( k ) ≤ φ0k−θ for some φ0 , θ > 0 . Examples include a large class of Metropolis-Hastings samplers ( Jarner & Roberts , 2002 ) and some queuing systems ( Agarwal & Duchi , 2012 ) . | This paper studies the sample complexity of a few variants of SGD in solving optimization problems over dependent data. The dependent data introduces non-negligible bias in SGD that slows down convergence of the algorithm, and this paper adopts \phi-mixing data dependence models, to quantify the level of dependence in the queried samples, and analyze how much the convergence of SGD can be slowed down in terms of the phi-mixing model. Then, this paper demonstrates the benefits of SGD with subsampling and mini-batch SGD over SGD for dependent data. | SP:ac7517dabc5ac45ae486f427a2efeeed0191e5e7 |
A Boosting Approach to Reinforcement Learning | 1 INTRODUCTION . The field of reinforcement learning , formally modelled as learning in Markov decision processes ( MDP ) , models the mechanism of learning from rewards , as opposed to examples . Although the case of tabular MDPs is well understood , the main difficulty in applying RL to practice is the size of the state space . Various techniques have been suggested and applied to cope with very large MDPs . The most common of which is function approximation of either the value or the transition function of the underlying MDP , many times using deep neural networks . Training deep neural networks in the supervised learning model is known to be computationally hard . Therefore reinforcement learning with neural function approximation is also computationally hard in general , and for this reason lacks provable guarantees . This challenge of finding efficient and provable algorithms for MDPs with large state space is the focus of our study . Previous approaches can be categorized in terms of the structural assumptions made on the MDP to circumvent the computational hardness . Some studies focus on structured dynamics , whereas others on structured value function or policy classes w.r.t . to the dynamics . In this paper we study another methodology to derive provable algorithms for reinforcement learning : ensemble methods for aggregating weak or approximate algorithms into substantially more accurate solutions . Our method can be thought of as extending the methodology of boosting from supervised learning ( Schapire & Freund , 2012 ) to reinforcement learning . Interestingly , however , our resulting aggregation of weak learners is not linear . In order to circumvent the computational hardness of solving general MDPs with function approximation , we assumes access to a weak learner : an efficient sample-based procedure that is capable of generating an approximate solution to any linear optimization objective over the space of policies . We describe an algorithm that iteratively calls this procedure on carefully constructed new objectives , and aggregates the solution into a single policy . We prove that after sufficiently many iterations , our resulting policy is provably near-optimal . 1.1 CHALLENGES AND TECHNIQUES . Reinforcement learning is quite different from supervised learning and several difficulties have to be circumvented for boosting to work . Amongst the challenges that the reinforcement learning setting presents , consider the following , ( a ) The value function is not a convex or concave function of the policy . This is true even in the tabular case , and even more so if we use a parameterized policy class . ( b ) The transition matrix is unknown , or prohibitively large to manipulate for large state spaces . This means that even evaluation of a policy can not be exact , and can only be computed approximately . ( c ) It is unrealistic to expect a weak learner that attains near-optimal value for a given linear objective over the policy class . At most one can hope for a multiplicative and/or additive approximation of the overall value . Our approach overcomes these challenges by applied several new as well as recently developed techniques . To overcome the nonconvexity of the value function , we use a novel variant of the Frank-Wolfe optimization algorithm that simultaneously delivers on two guarantees . First , it finds a first order stationary point with near-optimal rate . Secondly , if the objective happens to admit a certain gradient domination property , an important generalization of convexity , it also guarantees near optimal value . The application of the nonconvex Frank-Wolfe method is justified due to previous recent investigation of the policy gradient algorithm ( Agarwal et al. , 2019 ; 2020a ) , which identified conditions under which the value function is gradient dominated . The second information-theoretic challenge of the unknown transition function is overcome by careful algorithmic design : our boosting algorithm requires only samples of the transitions and rewards . These are obtained by rollouts on the MDP . The third challenge is perhaps the most difficult to overcome . Thus far , the use of the Frank-Wolfe method in reinforcement learning did not include a multiplicative approximation , which is critical for our application . Luckily , recent work in the area of online convex optimization ( Hazan & Singh , 2021 ) studies boosting with a multiplicative weak learner . We make critical use of this new technique which includes a non-linear aggregation ( using a 2-layer neural network ) of the weak learners . This aspect is perhaps of general interest to boosting algorithm design , which is mostly based on linear aggregation . 1.2 OUR CONTRIBUTIONS . Our main contribution is a novel efficient boosting algorithm for reinforcement learning . The input to this algorithm is a weak learning method capable of approximately optimizing a linear function over a certain policy class . The output of the algorithm is a policy which does not belong to the original class considered . It is rather a non-linear aggregation of policies from the original class , according to a two-layer neural network . This is a result of the two-tier structure of our algorithm : an outer loop of non-convex Frank-Wolfe method , and an inner loop of online convex optimization boosting . The final policy comes with provable guarantees against the class of all possible policies . Our algorithm and guarantees come in four flavors , depending on the mode of accessing the MDP ( two options ) , and the boosting methodology for the inner online convex optimization problem ( two options ) . It is important to point out that we study the question from an optimization perspective , and hence , assume the availability of an efficient exploration scheme – either via access to a reset distribution that has some overlap with the state distribution of the optimal policy , or constraining the policy class to policies that explore sufficiently . Such considerations also arise when reducing reinforcement learning to a sequence of supervised learning problems , e.g . Conservative Policy Iteration ( Kakade & Langford , 2002 ) assumes the former . One contribution we make here is to quantitatively differentiate between these two modes of exploration in terms of the rates of convergence they enable for the boosting setting . 1.3 RELATED WORK . To cope with prohibitively large MDPs , the method of choice to approximate the policy and transition space are deep neural networks , dubbed “ deep reinforcement learning '' . Deep RL gave rise to beyond human performance in games such as Go , protein folding , as well as near-human level autonomous driving . In terms of provable methods for deep RL , there are two main lines of work . The first is a robust analysis of the policy gradient algorithm ( Agarwal et al. , 2019 ; 2020a ) . Importantly , the gradient domination property of the value function established in this work is needed in order to achieve global convergence guarantees of our boosting method . The other line of work for provable approaches is policy iteration , which uses a restricted policy class , making incremental updates , such as Conservative Policy Iteration ( CPI ) ( Kakade & Langford , 2002 ; Scherrer & Geist , 2014 ) , and Policy Search by Dynamic Programming ( PSDP ) ( Bagnell et al. , 2003 ) . Our boosting approach for provable deep RL builds on the vast literature of boosting for supervised learning ( Schapire & Freund , 2012 ) , and recently online learning ( Leistner et al. , 2009 ; Chen et al. , 2012 ; 2014 ; Beygelzimer et al. , 2015 ; Jung et al. , 2017 ; Jung & Tewari , 2018 ) . One of the crucial techniques important for our application is the extension of boosting to the online convex optimization setting , with bandit information ( Brukhim & Hazan , 2021 ) , and critically with a multiplicative weak learner ( Hazan & Singh , 2021 ) . This latter technique implies a non-linear aggregation of the weak learners . Non-linear boosting was only recently investigated in the context of classification ( Alon et al. , 2020 ) , where it was shown to potentially enable significantly more efficient boosting . Perhaps the closest work to ours is boosting in the context of control of dynamical systems ( Agarwal et al. , 2020b ) . However , this work critically requires knowledge of the underlying dynamics ( transitions ) , which we do not , and can not cope with a multiplicative approximate weak learner . The Frank-Wolfe algorithm is extensively used in machine learning , see e.g . ( Jaggi , 2013 ) , references therein , and recent progress in stochastic Frank-Wolfe methods ( Hassani et al. , 2017 ; Mokhtari et al. , 2018 ; Chen et al. , 2018 ; Xie et al. , 2019 ) . Recent literature has applied a variant of this algorithm to reinforcement learning in the context of state space exploration ( Hazan et al. , 2019 ) . 2 PRELIMINARIES . Optimization . We say that a differentiable function f : K 7→ R over some domain K is L-smooth with respect to some norm ‖ · ‖∗ if for every x , y ∈ K we have ∣∣f ( y ) − f ( x ) −∇f ( x ) > ( y − x ) ∣∣ ≤ L 2 ‖x− y‖2∗ . For constrained optimization ( such as over ∆A ) , the projection Γ : R|A| → ∆A of a point x to onto a domain ∆A is Γ [ x ] = arg min y∈∆A ‖x− y‖ . An important generalization of convex function we use henceforth is that of gradient domination , Definition 1 ( Gradient Domination ) . A function f : K → R is said to be ( κ , τ , K1 , K2 ) -locally gradient dominated ( around K1 by K2 ) if for all x ∈ K1 , it holds that max y∈K f ( y ) − f ( x ) ≤ κ× max y∈K2 { ∇f ( x ) > ( y − x ) } + τ. Markov decision process . An infinite-horizon discounted Markov Decision Process ( MDP ) M = ( S , A , P , r , γ , d0 ) is specified by : a state space S , an action space A , a transition model P where P ( s′|s , a ) denotes the probability of immediately transitioning to state s′ upon taking action a at state s , a reward function r : S ×A→ [ 0 , 1 ] where r ( s , a ) is the immediate reward associated with taking action a at state s , a discount factor γ ∈ [ 0 , 1 ) ; a starting state distribution d0 over S. For any infinite-length state-action sequence ( hereafter , called a trajectory ) , we assign the following value V ( τ = ( s0 , a0 , s1 , a1 , . . . ) ) = ∞∑ t=0 γtr ( st , at ) . The agent interacts with the MDP through the choice of stochastic policy π : S → ∆A it executes , where ∆A denotes the probability simplex over A . The execution of such a policy induces a distribution over trajectories τ = ( s0 , a0 , . . . ) as P ( τ |π ) = d0 ( s0 ) ∞∏ t=0 ( P ( st+1|st , at ) π ( at|st ) ) . ( 1 ) Using this description we can associate a state V π ( s ) and state-action Qπ ( s , a ) value function with any policy π . For an arbitrary distrbution d over S , define : Qπ ( s ) = E [ ∞∑ t=0 γtr ( st , at ) ∣∣∣ π , s0 = s , a0 = a ] , V π ( s ) = Ea∼π ( ·|s ) [ Qπ ( s , a ) |π , s ] , V πd = Es0∼d [ V π ( s ) |π ] . Here the expectation is with respect to the randomness of the trajectory induced by π in M . When convenient , we shall use V π to denote V πd0 , and V ∗ to denote maxπ V π . Similarly , to any policy π , one may ascribe a ( discounted ) state-visitation distribution dπ = dπd0 . dπd ( s ) = ( 1− γ ) ∞∑ t=0 γt ∑ τ : st=s P ( τ |π , s0 ∼ d ) Modes of Accessing the MDP . We henceforth consider two modes of accessing the MDP , that are standard in the reinforcement learning literature , and provide different results for each . The first natural access model is called the episodic rollout setting . This mode of interaction allows us to execute a policy , stop and restart at any point , and do this multiple times . Another interaction model we consider is called rollout with ν-restarts . This is similar to the episodic setting , but here the agent may draw from the MDP a trajectory seeded with an initial state distribution ν 6= d0 . This interaction model was considered in prior work on policy optimization Kakade & Langford ( 2002 ) ; Agarwal et al . ( 2019 ) . The motivation for this model is two-fold : first , ν can be used to incorporate priors ( or domain knowledge ) about the state coverage of the optimal policy ; second , ν provides a mechanism to incorporate exploration into policy optimization procedures . | In this paper, the authors study boosting in RL, i.e., how to convert weak learners into effective policies. The authors provide an algorithm that improves the accuracy of the weak learners iteratively, and the sample complexity and running time do not explicitly depend on the number of states. In order to overcome the non-convexity of the value function (with respect to the policy space), the authors use a non-convex variant of the Frank-Wolfe method together with recent advances in gradient boosting. | SP:954686264f83d5d8a4ccaff7cc5130be733f7bb0 |
A Boosting Approach to Reinforcement Learning | 1 INTRODUCTION . The field of reinforcement learning , formally modelled as learning in Markov decision processes ( MDP ) , models the mechanism of learning from rewards , as opposed to examples . Although the case of tabular MDPs is well understood , the main difficulty in applying RL to practice is the size of the state space . Various techniques have been suggested and applied to cope with very large MDPs . The most common of which is function approximation of either the value or the transition function of the underlying MDP , many times using deep neural networks . Training deep neural networks in the supervised learning model is known to be computationally hard . Therefore reinforcement learning with neural function approximation is also computationally hard in general , and for this reason lacks provable guarantees . This challenge of finding efficient and provable algorithms for MDPs with large state space is the focus of our study . Previous approaches can be categorized in terms of the structural assumptions made on the MDP to circumvent the computational hardness . Some studies focus on structured dynamics , whereas others on structured value function or policy classes w.r.t . to the dynamics . In this paper we study another methodology to derive provable algorithms for reinforcement learning : ensemble methods for aggregating weak or approximate algorithms into substantially more accurate solutions . Our method can be thought of as extending the methodology of boosting from supervised learning ( Schapire & Freund , 2012 ) to reinforcement learning . Interestingly , however , our resulting aggregation of weak learners is not linear . In order to circumvent the computational hardness of solving general MDPs with function approximation , we assumes access to a weak learner : an efficient sample-based procedure that is capable of generating an approximate solution to any linear optimization objective over the space of policies . We describe an algorithm that iteratively calls this procedure on carefully constructed new objectives , and aggregates the solution into a single policy . We prove that after sufficiently many iterations , our resulting policy is provably near-optimal . 1.1 CHALLENGES AND TECHNIQUES . Reinforcement learning is quite different from supervised learning and several difficulties have to be circumvented for boosting to work . Amongst the challenges that the reinforcement learning setting presents , consider the following , ( a ) The value function is not a convex or concave function of the policy . This is true even in the tabular case , and even more so if we use a parameterized policy class . ( b ) The transition matrix is unknown , or prohibitively large to manipulate for large state spaces . This means that even evaluation of a policy can not be exact , and can only be computed approximately . ( c ) It is unrealistic to expect a weak learner that attains near-optimal value for a given linear objective over the policy class . At most one can hope for a multiplicative and/or additive approximation of the overall value . Our approach overcomes these challenges by applied several new as well as recently developed techniques . To overcome the nonconvexity of the value function , we use a novel variant of the Frank-Wolfe optimization algorithm that simultaneously delivers on two guarantees . First , it finds a first order stationary point with near-optimal rate . Secondly , if the objective happens to admit a certain gradient domination property , an important generalization of convexity , it also guarantees near optimal value . The application of the nonconvex Frank-Wolfe method is justified due to previous recent investigation of the policy gradient algorithm ( Agarwal et al. , 2019 ; 2020a ) , which identified conditions under which the value function is gradient dominated . The second information-theoretic challenge of the unknown transition function is overcome by careful algorithmic design : our boosting algorithm requires only samples of the transitions and rewards . These are obtained by rollouts on the MDP . The third challenge is perhaps the most difficult to overcome . Thus far , the use of the Frank-Wolfe method in reinforcement learning did not include a multiplicative approximation , which is critical for our application . Luckily , recent work in the area of online convex optimization ( Hazan & Singh , 2021 ) studies boosting with a multiplicative weak learner . We make critical use of this new technique which includes a non-linear aggregation ( using a 2-layer neural network ) of the weak learners . This aspect is perhaps of general interest to boosting algorithm design , which is mostly based on linear aggregation . 1.2 OUR CONTRIBUTIONS . Our main contribution is a novel efficient boosting algorithm for reinforcement learning . The input to this algorithm is a weak learning method capable of approximately optimizing a linear function over a certain policy class . The output of the algorithm is a policy which does not belong to the original class considered . It is rather a non-linear aggregation of policies from the original class , according to a two-layer neural network . This is a result of the two-tier structure of our algorithm : an outer loop of non-convex Frank-Wolfe method , and an inner loop of online convex optimization boosting . The final policy comes with provable guarantees against the class of all possible policies . Our algorithm and guarantees come in four flavors , depending on the mode of accessing the MDP ( two options ) , and the boosting methodology for the inner online convex optimization problem ( two options ) . It is important to point out that we study the question from an optimization perspective , and hence , assume the availability of an efficient exploration scheme – either via access to a reset distribution that has some overlap with the state distribution of the optimal policy , or constraining the policy class to policies that explore sufficiently . Such considerations also arise when reducing reinforcement learning to a sequence of supervised learning problems , e.g . Conservative Policy Iteration ( Kakade & Langford , 2002 ) assumes the former . One contribution we make here is to quantitatively differentiate between these two modes of exploration in terms of the rates of convergence they enable for the boosting setting . 1.3 RELATED WORK . To cope with prohibitively large MDPs , the method of choice to approximate the policy and transition space are deep neural networks , dubbed “ deep reinforcement learning '' . Deep RL gave rise to beyond human performance in games such as Go , protein folding , as well as near-human level autonomous driving . In terms of provable methods for deep RL , there are two main lines of work . The first is a robust analysis of the policy gradient algorithm ( Agarwal et al. , 2019 ; 2020a ) . Importantly , the gradient domination property of the value function established in this work is needed in order to achieve global convergence guarantees of our boosting method . The other line of work for provable approaches is policy iteration , which uses a restricted policy class , making incremental updates , such as Conservative Policy Iteration ( CPI ) ( Kakade & Langford , 2002 ; Scherrer & Geist , 2014 ) , and Policy Search by Dynamic Programming ( PSDP ) ( Bagnell et al. , 2003 ) . Our boosting approach for provable deep RL builds on the vast literature of boosting for supervised learning ( Schapire & Freund , 2012 ) , and recently online learning ( Leistner et al. , 2009 ; Chen et al. , 2012 ; 2014 ; Beygelzimer et al. , 2015 ; Jung et al. , 2017 ; Jung & Tewari , 2018 ) . One of the crucial techniques important for our application is the extension of boosting to the online convex optimization setting , with bandit information ( Brukhim & Hazan , 2021 ) , and critically with a multiplicative weak learner ( Hazan & Singh , 2021 ) . This latter technique implies a non-linear aggregation of the weak learners . Non-linear boosting was only recently investigated in the context of classification ( Alon et al. , 2020 ) , where it was shown to potentially enable significantly more efficient boosting . Perhaps the closest work to ours is boosting in the context of control of dynamical systems ( Agarwal et al. , 2020b ) . However , this work critically requires knowledge of the underlying dynamics ( transitions ) , which we do not , and can not cope with a multiplicative approximate weak learner . The Frank-Wolfe algorithm is extensively used in machine learning , see e.g . ( Jaggi , 2013 ) , references therein , and recent progress in stochastic Frank-Wolfe methods ( Hassani et al. , 2017 ; Mokhtari et al. , 2018 ; Chen et al. , 2018 ; Xie et al. , 2019 ) . Recent literature has applied a variant of this algorithm to reinforcement learning in the context of state space exploration ( Hazan et al. , 2019 ) . 2 PRELIMINARIES . Optimization . We say that a differentiable function f : K 7→ R over some domain K is L-smooth with respect to some norm ‖ · ‖∗ if for every x , y ∈ K we have ∣∣f ( y ) − f ( x ) −∇f ( x ) > ( y − x ) ∣∣ ≤ L 2 ‖x− y‖2∗ . For constrained optimization ( such as over ∆A ) , the projection Γ : R|A| → ∆A of a point x to onto a domain ∆A is Γ [ x ] = arg min y∈∆A ‖x− y‖ . An important generalization of convex function we use henceforth is that of gradient domination , Definition 1 ( Gradient Domination ) . A function f : K → R is said to be ( κ , τ , K1 , K2 ) -locally gradient dominated ( around K1 by K2 ) if for all x ∈ K1 , it holds that max y∈K f ( y ) − f ( x ) ≤ κ× max y∈K2 { ∇f ( x ) > ( y − x ) } + τ. Markov decision process . An infinite-horizon discounted Markov Decision Process ( MDP ) M = ( S , A , P , r , γ , d0 ) is specified by : a state space S , an action space A , a transition model P where P ( s′|s , a ) denotes the probability of immediately transitioning to state s′ upon taking action a at state s , a reward function r : S ×A→ [ 0 , 1 ] where r ( s , a ) is the immediate reward associated with taking action a at state s , a discount factor γ ∈ [ 0 , 1 ) ; a starting state distribution d0 over S. For any infinite-length state-action sequence ( hereafter , called a trajectory ) , we assign the following value V ( τ = ( s0 , a0 , s1 , a1 , . . . ) ) = ∞∑ t=0 γtr ( st , at ) . The agent interacts with the MDP through the choice of stochastic policy π : S → ∆A it executes , where ∆A denotes the probability simplex over A . The execution of such a policy induces a distribution over trajectories τ = ( s0 , a0 , . . . ) as P ( τ |π ) = d0 ( s0 ) ∞∏ t=0 ( P ( st+1|st , at ) π ( at|st ) ) . ( 1 ) Using this description we can associate a state V π ( s ) and state-action Qπ ( s , a ) value function with any policy π . For an arbitrary distrbution d over S , define : Qπ ( s ) = E [ ∞∑ t=0 γtr ( st , at ) ∣∣∣ π , s0 = s , a0 = a ] , V π ( s ) = Ea∼π ( ·|s ) [ Qπ ( s , a ) |π , s ] , V πd = Es0∼d [ V π ( s ) |π ] . Here the expectation is with respect to the randomness of the trajectory induced by π in M . When convenient , we shall use V π to denote V πd0 , and V ∗ to denote maxπ V π . Similarly , to any policy π , one may ascribe a ( discounted ) state-visitation distribution dπ = dπd0 . dπd ( s ) = ( 1− γ ) ∞∑ t=0 γt ∑ τ : st=s P ( τ |π , s0 ∼ d ) Modes of Accessing the MDP . We henceforth consider two modes of accessing the MDP , that are standard in the reinforcement learning literature , and provide different results for each . The first natural access model is called the episodic rollout setting . This mode of interaction allows us to execute a policy , stop and restart at any point , and do this multiple times . Another interaction model we consider is called rollout with ν-restarts . This is similar to the episodic setting , but here the agent may draw from the MDP a trajectory seeded with an initial state distribution ν 6= d0 . This interaction model was considered in prior work on policy optimization Kakade & Langford ( 2002 ) ; Agarwal et al . ( 2019 ) . The motivation for this model is two-fold : first , ν can be used to incorporate priors ( or domain knowledge ) about the state coverage of the optimal policy ; second , ν provides a mechanism to incorporate exploration into policy optimization procedures . | This paper proposes a new approach for solving RL problems with sample complexity independent of the number of states. Rather than imposing structural assumptions, the authors consider access to weak learners and propose a way to combine these weak learners effectively to generate a near optimal policy. The sample complexity result is competitive and does not depend on the number of states, under the assumption of access to weak learners. | SP:954686264f83d5d8a4ccaff7cc5130be733f7bb0 |
A Simple Reward-free Approach to Constrained Reinforcement Learning | In constrained reinforcement learning ( RL ) , a learning agent seeks to not only optimize the overall reward but also satisfy the additional safety , diversity , or budget constraints . Consequently , existing constrained RL solutions require several new algorithmic ingredients that are notably different from standard RL . On the other hand , reward-free RL is independently developed in the unconstrained literature , which learns the transition dynamics without using the reward information , and thus naturally capable of addressing RL with multiple objectives under the common dynamics . This paper bridges reward-free RL and constrained RL . Particularly , we propose a simple meta-algorithm such that given any reward-free RL oracle , the approachability and constrained RL problems can be directly solved with negligible overheads in sample complexity . Utilizing the existing reward-free RL solvers , our framework provides sharp sample complexity results for constrained RL in the tabular MDP setting , matching the best existing results up to a factor of horizon dependence ; our framework directly extends to a setting of tabular two-player Markov games , and gives a new result for constrained RL with linear function approximation . 1 INTRODUCTION . In a wide range of modern reinforcement learning ( RL ) applications , it is not sufficient for the learning agents to only maximize a scalar reward . More importantly , they must satisfy various constraints . For instance , such constraints can be the physical limit of power consumption or torque in motors for robotics tasks ( Tessler et al. , 2019 ) ; the budget for computation and the frequency of actions for real-time strategy games ( Vinyals et al. , 2019 ) ; and the requirement for safety , fuel efficiency and human comfort for autonomous drive ( Le et al. , 2019 ) . In addition , constraints are also crucial in tasks such as dynamic pricing with limited supply ( Besbes & Zeevi , 2009 ; Babaioff et al. , 2015 ) , scheduling of resources on a computer cluster ( Mao et al. , 2016 ) , imitation learning ( Syed & Schapire , 2007 ; Ziebart et al. , 2008 ; Sun et al. , 2019 ) , as well as RL with fairness ( Jabbari et al. , 2017 ) . These huge demand in practice gives rise to a subfield—constrained RL , which focuses on designing efficient algorithms to find near-optimal policies for RL problems under linear or general convex constraints . Most constrained RL works directly combine the existing techniques such as value iteration and optimism from unconstrained literature , with new techniques specifically designed to deal with linear constraints ( Efroni et al. , 2020 ; Ding et al. , 2021 ; Qiu et al. , 2020 ) or general convex constraints ( Brantley et al. , 2020 ; Yu et al. , 2021 ) . The end product is a single new complex algorithm which is tasked to solve all the challenges of learning dynamics , exploration , planning as well as constraints satisfaction simultaneously . Thus , these algorithms need to be re-analyzed from scratch , and it is highly nontrivial to translate the progress in the unconstrained RL to the constrained setting . On the other hand , reward-free RL—proposed in Jin et al . ( 2020a ) —is a framework for the unconstrained setting , which learns the transition dynamics without using the reward . The framework has two phases : in the exploration phase , the agent first collects trajectories from a Markov decision process ( MDP ) and learns the dynamics without a pre-specified reward function . After exploration , the agent is tasked with computing near-optimal policies under the MDP for a collection of given reward functions . This framework is particularly suitable when there are multiple reward functions of interest , and has been developed recently to attack various settings including tabular MDPs ( Jin et al. , 2020a ; Zhang et al. , 2020 ) , linear MDPs ( Wang et al. , 2020 ; Zanette et al. , 2020 ) , and tabular Markov games ( Liu et al. , 2020 ) . Contribution . In this paper , we propose a simple approach to solve constrained RL problems by bridging the reward-free RL literature and constrained RL literature . Our approach isolates the challenges of constraint satisfaction , and leaves the remaining RL challenges such as learning dynamics and exploration to reward-free RL . This allows us to design a new algorithm which purely focuses on addressing the constraints . Formally , we design a meta-algorithm for RL problems with general convex constraints . Our meta-algorithm takes a reward-free RL solver , and can be used to directly solve the approachability problem , as well as the constrained MDP problems using very small amount of samples in addition to what is required for reward-free RL . Our framework enables direct translation of any progress in reward-free RL to constrained RL . Leveraging recent advances in reward-free RL , our meta-algorithm directly implies sample-efficient guarantees of constrained RL in the settings of tabular MDP , linear MDP , as well as tabular two-player Markov games . In particular , • Tabular setting : Our work achieves sample complexity of Õ ( min { d , S } H4SA/ 2 ) for all three tasks of reward-free RL for Vector-valued MDPs ( VMDP ) , approachability , and RL with general convex constraints . Here d is the dimension of VMDP or the number of constraints , S , A are the number of states and actions , H is the horizon , and is the error tolerance . It matches the best existing results up to a factor of H . • Linear setting : Our work provides new sample complexity of Õ ( d3linH6/ 2 ) for all three tasks above for linear MDPs . To our best knowledge , this result is the first sample-efficient result for approachability and also constrained RL with general convex constraints in the linear function approximation setting . • Two-player setting : Our work extends to the setting of tabular two-player vector-valued Markov games and achieves low regret of α ( T ) = O ( /2 + √ H2ι/T ) at the cost of this O ( ) bias in regret as well as additional samples for preprocessing . 1.1 RELATED WORK . In this section , we review the related works on three tasks studied in this paper—reward-free RL , approachability , and constrained RL . Reward-free RL . Reward-free exploration has been formalized by Jin et al . ( 2020a ) for the tabular setting . Furthermore , Jin et al . ( 2020a ) proposed an algorithm which has sample complexity Õ ( poly ( H ) S2A/ 2 ) outputting -optimal policy for arbitrary number of reward functions . More 1The presented sample complexities are all under the L2 normalization conditions as studied in this paper . We comment that the results of ( Wu et al. , 2020 ; Brantley et al. , 2020 ; Yu et al. , 2021 ) are originally presented under L1/L∞ normalization conditions . While the results in Wu et al . ( 2020 ) can be directly adapted to our setting as stated in the table , the other two results Brantley et al . ( 2020 ) ; Yu et al . ( 2021 ) will be no better than the displayed results after adaptation . recently , Zhang et al . ( 2020 ) ; Liu et al . ( 2020 ) propose algorithm VI-Zero with sharp sample complexity of Õ ( poly ( H ) log ( N ) SA/ 2 ) capable of handling N fixed reward functions . Wang et al . ( 2020 ) ; Zanette et al . ( 2020 ) further provide reward-free learning results in the setting of linear function approximation , in particular , Wang et al . ( 2020 ) guarantees to find the near-optimal policies for an arbitrary number of ( linear ) reward functions within a sample complexity of Õ ( poly ( H ) d3lin/ 2 ) . All results mentioned above are for scalar-valued MDPs . For the vector-valued MDPs ( VMDPs ) , very recent work of Wu et al . ( 2020 ) designs a reward-free algorithm with sample complexity guarantee Õ ( poly ( H ) min { d , S } SA/ 2 ) in the tabular setting . Compared to Wu et al . ( 2020 ) , our reward-free algorithms for VMDP is adapted from the VI-Zero algorithm presented in Liu et al . ( 2020 ) ; While achieving the same sample complexity , it allows arbitrary planning algorithms in the planning phase . Approachability and Constrained RL Approachability and Constrained RL are two related tasks involving constraints . Inspired by Blackwell approachability ( Blackwell et al. , 1956 ) , recent work of Miryoosefi et al . ( 2019 ) introduces approachability task for VMDPs . However , the proposed algorithm does not have polynomial sample complexity guarantees . More recently , Yu et al . ( 2021 ) gave a new algorithm for approachability for both VMDPs and vector-valued Markov games ( VMGs ) . Yu et al . ( 2021 ) provides regret bounds for the proposed algorithm resulting in sample complexity guarantees of Õ ( poly ( H ) min { d , S } SA/ 2 ) for approachability in VMDPs and Õ ( poly ( H ) min { d , S } SAB/ 2 ) for approachability in VMGs . Sample-efficient exploration in constrained reinforcement learning has been recently studied in a recent line of work by Brantley et al . ( 2020 ) ; Qiu et al . ( 2020 ) ; Efroni et al . ( 2020 ) ; Ding et al . ( 2021 ) ; Singh et al . ( 2020 ) . All these works are also limited to linear constraints except Brantley et al . ( 2020 ) which extends their approach to general convex constraints achieving sample complexity of Õ ( poly ( H ) d2S2A/ 2 ) . However , Brantley et al . ( 2020 ) requires solving a large-scale convex optimization sub-problem . The best result for constrained RL with general convex constraints can be achieved by the approachability-based algorithm in Yu et al . ( 2021 ) obtaining sample complexity of Õ ( poly ( H ) min { d , S } SA/ 2 ) . Technically , our meta-algorithm is based on the Fenchel ’ s duality , which is similar to Yu et al . ( 2021 ) . In contrast , Yu et al . ( 2021 ) does not use reward-free RL , and is thus different from our results in terms of algorithmic approaches . Consequently , Yu et al . ( 2021 ) does not reveal the deep connections between reward-free RL and constrained RL , which is one of the main contribution of this paper . In addition , Yu et al . ( 2021 ) does not address the function approximation setting . Finally , we note that among all results mentioned above , only Ding et al . ( 2021 ) has considered models beyond tabular setting in the context of constrained RL . The model studied in Ding et al . ( 2021 ) is known as linear mixture MDPs which is different and incomparable to the linear MDP models considered in this paper . We further comment that Ding et al . ( 2021 ) can only handle linear constraints for CMDP , while our results is capable of solving CMDPs with general convex constraints . 2 PRELIMINARIES AND PROBLEM SETUP . We consider an episodic vector-valued Markov decision process ( VMDP ) specified by a tuple M = ( S , A , H , P , r ) , where S is the state space , A is the action space , H is the length of each episode , P = { Ph } Hh=1 is the collection of unknown transition probabilities with Ph ( s′ | s , a ) equal to the probability of transiting to s′ after taking action a in state s at the hth step , and r = { rh : S × A → B ( 1 ) } Hh=1 is a collection of unknown d-dimensional return functions , where B ( r ) is the d-dimensional Euclidean ball of radius r centered at the origin . Interaction protocol . In each episode , agent starts at a fixed initial state s1 . Then , at each step h ∈ [ H ] , the agent observes the current state sh , takes action ah , receives stochastic sample of the return vector rh ( sh , ah ) , and it causes the environment to transit to sh+1 ∼ Ph ( · | sh , ah ) . We assume that stochastic samples of the return function are also in B ( 1 ) , almost surely . Policy and value function . A policy π of an agent is a collection of H functions { πh : S → ∆ ( A ) } Hh=1 that map states to distribution over actions . The agent following policy π , picks action ah ∼ πh ( sh ) at the hth step . We denote Vπh : S → B ( H ) as the value func- tion at step h for policy π , defined as Vπh ( s ) : = Eπ [ ∑H h′=h rh′ ( sh′ , ah′ ) | sh = s ] . Similarly , we denote Qπh : S × A → B ( H ) as the Q-value function at step h for policy π , where Qπh ( s , a ) : = Eπ [ ∑H h′=h rh′ ( sh′ , ah′ ) | sh = s , ah = a ] . Scalarized MDP . For a VMDP M and θ ∈ B ( 1 ) , we define scalar-valued MDP Mθ = ( S , A , H , P , rθ ) , where rθ = { 〈θ , rh〉 : S ×A → [ −1 , 1 ] } Hh=1 . We denote V πh ( · ; θ ) : S → [ −H , H ] as the scalarized value function at step h for policy π , defined as V πh ( s ; θ ) : = Eπ [ ∑H h′=h〈θ , rh′ ( sh′ , ah′ ) 〉 | sh = s ] = 〈θ , Vπh ( s ) 〉 . Similarly , we denote Qπh ( · ; θ ) : S ×A → [ −H , H ] as the scalarized Q-value function at step h for policy π , where Qπh ( s , a ; θ ) : = Eπ [ ∑H h′=h〈θ , rh′ ( sh′ , ah′ ) 〉 | sh = s , ah = a ] = 〈θ , Qπh ( s , a ) 〉 . For a fixed θ ∈ Rd , there exists an optimal policy π ? θ , maximizing value for all states ( Puterman , 2014 ) ; i.e. , V π ? θ h ( s ; θ ) = supπ V π h ( s ; θ ) for all s ∈ S and h ∈ [ H ] . We abbreviate V π ? θ ( · ; θ ) and Qπ ? θ ( · ; θ ) as V ? ( · ; θ ) and Q ? ( · ; θ ) respectively . | The paper applies the techniques from reward-free RL literature to the constrained RL setting. They propose a meta-algorithm that takes a reward-free RL solver and uses it to solve the approachability and constrained-RL problems with convex constraints. The proposed approach comes with an overhead factor that is logarithmic in the number of samples. They apply this approach to provide sharp analysis on three different settings: tabular VMDPs, linear VMDPs and two-player VMGs. | SP:d1ed10fc70ad59ec4b69fa48a20155835e655b2d |
A Simple Reward-free Approach to Constrained Reinforcement Learning | In constrained reinforcement learning ( RL ) , a learning agent seeks to not only optimize the overall reward but also satisfy the additional safety , diversity , or budget constraints . Consequently , existing constrained RL solutions require several new algorithmic ingredients that are notably different from standard RL . On the other hand , reward-free RL is independently developed in the unconstrained literature , which learns the transition dynamics without using the reward information , and thus naturally capable of addressing RL with multiple objectives under the common dynamics . This paper bridges reward-free RL and constrained RL . Particularly , we propose a simple meta-algorithm such that given any reward-free RL oracle , the approachability and constrained RL problems can be directly solved with negligible overheads in sample complexity . Utilizing the existing reward-free RL solvers , our framework provides sharp sample complexity results for constrained RL in the tabular MDP setting , matching the best existing results up to a factor of horizon dependence ; our framework directly extends to a setting of tabular two-player Markov games , and gives a new result for constrained RL with linear function approximation . 1 INTRODUCTION . In a wide range of modern reinforcement learning ( RL ) applications , it is not sufficient for the learning agents to only maximize a scalar reward . More importantly , they must satisfy various constraints . For instance , such constraints can be the physical limit of power consumption or torque in motors for robotics tasks ( Tessler et al. , 2019 ) ; the budget for computation and the frequency of actions for real-time strategy games ( Vinyals et al. , 2019 ) ; and the requirement for safety , fuel efficiency and human comfort for autonomous drive ( Le et al. , 2019 ) . In addition , constraints are also crucial in tasks such as dynamic pricing with limited supply ( Besbes & Zeevi , 2009 ; Babaioff et al. , 2015 ) , scheduling of resources on a computer cluster ( Mao et al. , 2016 ) , imitation learning ( Syed & Schapire , 2007 ; Ziebart et al. , 2008 ; Sun et al. , 2019 ) , as well as RL with fairness ( Jabbari et al. , 2017 ) . These huge demand in practice gives rise to a subfield—constrained RL , which focuses on designing efficient algorithms to find near-optimal policies for RL problems under linear or general convex constraints . Most constrained RL works directly combine the existing techniques such as value iteration and optimism from unconstrained literature , with new techniques specifically designed to deal with linear constraints ( Efroni et al. , 2020 ; Ding et al. , 2021 ; Qiu et al. , 2020 ) or general convex constraints ( Brantley et al. , 2020 ; Yu et al. , 2021 ) . The end product is a single new complex algorithm which is tasked to solve all the challenges of learning dynamics , exploration , planning as well as constraints satisfaction simultaneously . Thus , these algorithms need to be re-analyzed from scratch , and it is highly nontrivial to translate the progress in the unconstrained RL to the constrained setting . On the other hand , reward-free RL—proposed in Jin et al . ( 2020a ) —is a framework for the unconstrained setting , which learns the transition dynamics without using the reward . The framework has two phases : in the exploration phase , the agent first collects trajectories from a Markov decision process ( MDP ) and learns the dynamics without a pre-specified reward function . After exploration , the agent is tasked with computing near-optimal policies under the MDP for a collection of given reward functions . This framework is particularly suitable when there are multiple reward functions of interest , and has been developed recently to attack various settings including tabular MDPs ( Jin et al. , 2020a ; Zhang et al. , 2020 ) , linear MDPs ( Wang et al. , 2020 ; Zanette et al. , 2020 ) , and tabular Markov games ( Liu et al. , 2020 ) . Contribution . In this paper , we propose a simple approach to solve constrained RL problems by bridging the reward-free RL literature and constrained RL literature . Our approach isolates the challenges of constraint satisfaction , and leaves the remaining RL challenges such as learning dynamics and exploration to reward-free RL . This allows us to design a new algorithm which purely focuses on addressing the constraints . Formally , we design a meta-algorithm for RL problems with general convex constraints . Our meta-algorithm takes a reward-free RL solver , and can be used to directly solve the approachability problem , as well as the constrained MDP problems using very small amount of samples in addition to what is required for reward-free RL . Our framework enables direct translation of any progress in reward-free RL to constrained RL . Leveraging recent advances in reward-free RL , our meta-algorithm directly implies sample-efficient guarantees of constrained RL in the settings of tabular MDP , linear MDP , as well as tabular two-player Markov games . In particular , • Tabular setting : Our work achieves sample complexity of Õ ( min { d , S } H4SA/ 2 ) for all three tasks of reward-free RL for Vector-valued MDPs ( VMDP ) , approachability , and RL with general convex constraints . Here d is the dimension of VMDP or the number of constraints , S , A are the number of states and actions , H is the horizon , and is the error tolerance . It matches the best existing results up to a factor of H . • Linear setting : Our work provides new sample complexity of Õ ( d3linH6/ 2 ) for all three tasks above for linear MDPs . To our best knowledge , this result is the first sample-efficient result for approachability and also constrained RL with general convex constraints in the linear function approximation setting . • Two-player setting : Our work extends to the setting of tabular two-player vector-valued Markov games and achieves low regret of α ( T ) = O ( /2 + √ H2ι/T ) at the cost of this O ( ) bias in regret as well as additional samples for preprocessing . 1.1 RELATED WORK . In this section , we review the related works on three tasks studied in this paper—reward-free RL , approachability , and constrained RL . Reward-free RL . Reward-free exploration has been formalized by Jin et al . ( 2020a ) for the tabular setting . Furthermore , Jin et al . ( 2020a ) proposed an algorithm which has sample complexity Õ ( poly ( H ) S2A/ 2 ) outputting -optimal policy for arbitrary number of reward functions . More 1The presented sample complexities are all under the L2 normalization conditions as studied in this paper . We comment that the results of ( Wu et al. , 2020 ; Brantley et al. , 2020 ; Yu et al. , 2021 ) are originally presented under L1/L∞ normalization conditions . While the results in Wu et al . ( 2020 ) can be directly adapted to our setting as stated in the table , the other two results Brantley et al . ( 2020 ) ; Yu et al . ( 2021 ) will be no better than the displayed results after adaptation . recently , Zhang et al . ( 2020 ) ; Liu et al . ( 2020 ) propose algorithm VI-Zero with sharp sample complexity of Õ ( poly ( H ) log ( N ) SA/ 2 ) capable of handling N fixed reward functions . Wang et al . ( 2020 ) ; Zanette et al . ( 2020 ) further provide reward-free learning results in the setting of linear function approximation , in particular , Wang et al . ( 2020 ) guarantees to find the near-optimal policies for an arbitrary number of ( linear ) reward functions within a sample complexity of Õ ( poly ( H ) d3lin/ 2 ) . All results mentioned above are for scalar-valued MDPs . For the vector-valued MDPs ( VMDPs ) , very recent work of Wu et al . ( 2020 ) designs a reward-free algorithm with sample complexity guarantee Õ ( poly ( H ) min { d , S } SA/ 2 ) in the tabular setting . Compared to Wu et al . ( 2020 ) , our reward-free algorithms for VMDP is adapted from the VI-Zero algorithm presented in Liu et al . ( 2020 ) ; While achieving the same sample complexity , it allows arbitrary planning algorithms in the planning phase . Approachability and Constrained RL Approachability and Constrained RL are two related tasks involving constraints . Inspired by Blackwell approachability ( Blackwell et al. , 1956 ) , recent work of Miryoosefi et al . ( 2019 ) introduces approachability task for VMDPs . However , the proposed algorithm does not have polynomial sample complexity guarantees . More recently , Yu et al . ( 2021 ) gave a new algorithm for approachability for both VMDPs and vector-valued Markov games ( VMGs ) . Yu et al . ( 2021 ) provides regret bounds for the proposed algorithm resulting in sample complexity guarantees of Õ ( poly ( H ) min { d , S } SA/ 2 ) for approachability in VMDPs and Õ ( poly ( H ) min { d , S } SAB/ 2 ) for approachability in VMGs . Sample-efficient exploration in constrained reinforcement learning has been recently studied in a recent line of work by Brantley et al . ( 2020 ) ; Qiu et al . ( 2020 ) ; Efroni et al . ( 2020 ) ; Ding et al . ( 2021 ) ; Singh et al . ( 2020 ) . All these works are also limited to linear constraints except Brantley et al . ( 2020 ) which extends their approach to general convex constraints achieving sample complexity of Õ ( poly ( H ) d2S2A/ 2 ) . However , Brantley et al . ( 2020 ) requires solving a large-scale convex optimization sub-problem . The best result for constrained RL with general convex constraints can be achieved by the approachability-based algorithm in Yu et al . ( 2021 ) obtaining sample complexity of Õ ( poly ( H ) min { d , S } SA/ 2 ) . Technically , our meta-algorithm is based on the Fenchel ’ s duality , which is similar to Yu et al . ( 2021 ) . In contrast , Yu et al . ( 2021 ) does not use reward-free RL , and is thus different from our results in terms of algorithmic approaches . Consequently , Yu et al . ( 2021 ) does not reveal the deep connections between reward-free RL and constrained RL , which is one of the main contribution of this paper . In addition , Yu et al . ( 2021 ) does not address the function approximation setting . Finally , we note that among all results mentioned above , only Ding et al . ( 2021 ) has considered models beyond tabular setting in the context of constrained RL . The model studied in Ding et al . ( 2021 ) is known as linear mixture MDPs which is different and incomparable to the linear MDP models considered in this paper . We further comment that Ding et al . ( 2021 ) can only handle linear constraints for CMDP , while our results is capable of solving CMDPs with general convex constraints . 2 PRELIMINARIES AND PROBLEM SETUP . We consider an episodic vector-valued Markov decision process ( VMDP ) specified by a tuple M = ( S , A , H , P , r ) , where S is the state space , A is the action space , H is the length of each episode , P = { Ph } Hh=1 is the collection of unknown transition probabilities with Ph ( s′ | s , a ) equal to the probability of transiting to s′ after taking action a in state s at the hth step , and r = { rh : S × A → B ( 1 ) } Hh=1 is a collection of unknown d-dimensional return functions , where B ( r ) is the d-dimensional Euclidean ball of radius r centered at the origin . Interaction protocol . In each episode , agent starts at a fixed initial state s1 . Then , at each step h ∈ [ H ] , the agent observes the current state sh , takes action ah , receives stochastic sample of the return vector rh ( sh , ah ) , and it causes the environment to transit to sh+1 ∼ Ph ( · | sh , ah ) . We assume that stochastic samples of the return function are also in B ( 1 ) , almost surely . Policy and value function . A policy π of an agent is a collection of H functions { πh : S → ∆ ( A ) } Hh=1 that map states to distribution over actions . The agent following policy π , picks action ah ∼ πh ( sh ) at the hth step . We denote Vπh : S → B ( H ) as the value func- tion at step h for policy π , defined as Vπh ( s ) : = Eπ [ ∑H h′=h rh′ ( sh′ , ah′ ) | sh = s ] . Similarly , we denote Qπh : S × A → B ( H ) as the Q-value function at step h for policy π , where Qπh ( s , a ) : = Eπ [ ∑H h′=h rh′ ( sh′ , ah′ ) | sh = s , ah = a ] . Scalarized MDP . For a VMDP M and θ ∈ B ( 1 ) , we define scalar-valued MDP Mθ = ( S , A , H , P , rθ ) , where rθ = { 〈θ , rh〉 : S ×A → [ −1 , 1 ] } Hh=1 . We denote V πh ( · ; θ ) : S → [ −H , H ] as the scalarized value function at step h for policy π , defined as V πh ( s ; θ ) : = Eπ [ ∑H h′=h〈θ , rh′ ( sh′ , ah′ ) 〉 | sh = s ] = 〈θ , Vπh ( s ) 〉 . Similarly , we denote Qπh ( · ; θ ) : S ×A → [ −H , H ] as the scalarized Q-value function at step h for policy π , where Qπh ( s , a ; θ ) : = Eπ [ ∑H h′=h〈θ , rh′ ( sh′ , ah′ ) 〉 | sh = s , ah = a ] = 〈θ , Qπh ( s , a ) 〉 . For a fixed θ ∈ Rd , there exists an optimal policy π ? θ , maximizing value for all states ( Puterman , 2014 ) ; i.e. , V π ? θ h ( s ; θ ) = supπ V π h ( s ; θ ) for all s ∈ S and h ∈ [ H ] . We abbreviate V π ? θ ( · ; θ ) and Qπ ? θ ( · ; θ ) as V ? ( · ; θ ) and Q ? ( · ; θ ) respectively . | The paper introduces a connection between reward-free and constrained MDPs. The interesting result in the paper is the fact that it is possible to use any reward-free method to solve constrained and approachability problems. In particular, they show that starting from an RFE method with sample guarantees, it is possible to obtain guarantees in these settings paying only a small cost. This meta-framework can be used to solve many different problems (e.g., tabular and linear problems). | SP:d1ed10fc70ad59ec4b69fa48a20155835e655b2d |
Universal Controllers with Differentiable Physics for Online System Identification | 1 INTRODUCTION . In order for robots to shine in real-world applications , they need to handle ever-changing and unpredictable situations in real environments . For instance , a robot waiter should be able to serve a new type of dish without spilling food , and an autonomous vehicle should take a person safely to an unvisited destination . Creating artificial agents that can operate in changing and unknown environments is a longstanding problem in the robotics community . The collective wisdom of the robotic research community in recent years indicates that enabling learning agents to work in changing and unknown environments is not about making one big breakthrough , but rather making many small but informed decisions . One general approach advances control policies such that they can operate more robustly ( Tan et al. , 2018 ) or more adaptively ( Cully et al. , 2015 ) in testing environments . However , these methods usually exhibit sub-optimal task performance or require additional fine-tuning in the target environment . Alternative approaches advance simulation techniques to bring the training environment closer to the testing one prior to learning a control policy , such as training a dynamics model ( Jiang et al. , 2021 ) or identifying simulation parameters ( Tan et al. , 2018 ) from data . These methods are often used in offline settings as learning or identifying an accurate simulation model can be time consuming . Thus , they can not handle changing environments naturally . Work such as Yu et al . ( 2017 ) have also investigated methods that learn models to perform online system identification . However , a learned model often does not generalize well to unknown environments or those not seen during training . Recent developments in differentiable physics simulation potentially offer a more effective way to address these challenges by advancing both control and simulation techniques . By utilizing fast computation of analytical gradients , one can devise more computationally and sample efficient optimal control and system identification algorithms . Recent differentiable physics simulators , such as NimblePhysics ( Werling et al. , 2021 ) , provide fast computation of analytical gradients in the face of constraint satisfaction and non-differentiable contact handling . These enable generic gradient-based optimizers to solve contact-rich optimal control problems . While promising , differentiable physics simulation does not solve the fundamental problem of multiple local minima due to ill-conditioned cost functions , often exacerbated by long-horizon and highly nonlinear differential equations . This paper introduces a new approach for creating resilient and adaptive agents by combining differentiable physics simulation for online system identification and reinforcement learning for offline policy training . Online system identification can be formulated as a short-horizon , local optimization problem , but must be solved fast . This plays to the strength of differentiable physics simulation which provides analytical gradients efficiently , while avoiding the pitfalls of poor cost function landscapes . On the other hand , for challenging control problems with long-horizon cost functions , we resort to a reinforcement learning approach leveraging samples ( “ rollouts ” ) generated offline at scale to train a control policy . We explore many possible situations the agent might encounter when operating in the testing environment by varying the simulation parameters during training and learning a Universal Controller ( UC ) conditioned on the simulation parameters . At test time , we use differentiable physics simulation to continuously optimize the simulation parameters based on the most recent history of observations ( DiffOSI ) . The optimal simulation parameters will “ modulate ” the universal policy to output the optimal action for the currently identified environment . We evaluate our approach on two robotic control tasks , a cartpole balancing problem and a robot arm table wiping task involving rich contact phenomena . We show that our proposed approach combining a Universal Controller and a Differentiable physics-based Online System Identification module ( UC-DiffOSI ) can outperform pure learning-based or traditional system identification methods . Finally , we demonstrate that our approach can be applied to environments with changing dynamics or un-modeled effects . 2 RELATED WORK . Deep Reinforcement Learning and Domain Randomization . Deep reinforcement learning has been proven to be effective in learning complex motor skills for simulated robots , such as running ( Yu et al. , 2018 ) , parkour ( Heess et al. , 2017 ) , and dressing ( Clegg et al. , 2018 ) . However , these controllers often perform poorly on real robot hardware due to the discrepancies between the simulated and real environment , also known as the sim-to-real gap ( Neunert et al. , 2017 ) . Domain randomization of the simulation physics parameters has been extensively explored to help the simulation-trained controller transfer to a different target environment , where a robust control policy is trained to perform well for a wide variety of simulated environments ( Peng et al. , 2017 ; Tan et al. , 2018 ; Hwangbo et al. , 2019 ; Exarchos et al. , 2020 ; OpenAI et al. , 2019 ) . However , policies trained from domain randomization often exhibit over-conservative behaviors , leading to sub-optimal performance ( Tan et al. , 2018 ) . Different from these methods , we develop a domain adaptation approach by training adaptive controllers that can adjust behavior for different environments using an estimation of the environment parameters . This enables our controller to achieve better performance than a domain randomization controller . Domain Adaptation . To achieve better task performance in novel situations , researchers have developed adaptive controllers that can adjust behavior for different environments . Szita et al . ( 2003 ) showed that Q-learning , using event-learning , can find near-optimal policies in varying environments . Heess et al . ( 2015 ) demonstrated that control policies modified to use recurrent networks are also capable of dealing with unknown kinematic parameters such as link lengths . Xu et al . ( 2020 ) presented a deep reinforcement learning method that encodes the dynamic context online to achieve a stable non-planar pushing task controller . Yu et al . ( 2017 ) proposed a system using a Universal Policy and Online System Identification ( OSI ) function to explicitly incorporate model parameters to adapt to varying environments . These methods usually identify the environment parameters ( explicitly or implicitly ) and then adjust the controllers to adapt to the new environment . Differentiable Simulation . In recent years , researchers have built more efficient and featurecomplete differentiable physics engines . These engines support 3D rigid body and contact constraints between spheres and planes ( Degrave et al. , 2016 ) , analytic differentiation of a linear com- plementarity problem ( de Avila Belbute-Peres et al. , 2018 ) , modeling soft bodies via a differentiable real-time differentiable Material Point Method ( Hu et al. , 2018 ) , support differentiable cloth simulation ( Liang et al. , 2019 ) , optimize for large numbers of objects and contact interactions ( Qiao et al. , 2020 ) , and support articulated rigid bodies with contact ( Werling et al. , 2021 ) . Prior work , such as Toussaint et al . ( 2018 ) and Heiden et al . ( 2019 ) , also showed that differentiable physics can be integrated for end-to-end controller learning , in addition to parameter learning . Jatavallabhula et al . ( 2021 ) further integrated differentiable rendering to remove dependency on 3D vision in an end-to-end learning pipeline . 3 METHODS . Our goal is to design a system that can handle changing or unknown dynamics in the environment . The true dynamics in the target environment can be described by xt+1 = fµ ( xt , τt ) , where x = ( q , q̇ ) denotes the robot ’ s sensed states and their time derivatives , and τ denotes the control actions . fµ evolves the system from timestep t to t + 1 with dynamics parameters µ . We aim to predict optimal controls τ ∗t which maximize task performance . The controls are predicted in the first part of our system , the universal controller ( UC ) : ( x , µ ) 7→ τ . The second part is a differentiable physics engine that performs online system identification ( DiffOSI ) : { ( xi , xi+1 , τi ) } 7→ µ . The overview of the system is shown in Figure 1 . Together , they form a robust controller capable of handling unknown or changing environment dynamics . 3.1 LEARNING A UNIVERSAL CONTROLLER . Universal Controller ( UC ) augments a regular robotic controller by conditioning it on parameters of the environment µ , such as friction coefficient or robot payload . This information is crucial for the controller to select appropriate actions for different environments , yet are non-trivial to infer directly from sensory input . By providing this additional information to the UC , we expect it to outperform a regular policy given the true environment parameters . A successful UC should perform near-optimally for a wide range of µ ’ s . Given that the best way to obtain a control policy can be different across tasks , the training of UC largely depends on the task to be performed . In this work , we tailor the training of UC to two control tasks of interest : cart pole balancing and table wiping . For the cart-pole balancing problem , we want to obtain a controller that directly sends torque commands to the robot at high-frequency . Thus , we directly apply a reinforcement learning approach to obtain a Universal Control Policy as done in Yu et al . ( 2017 ) . On the other hand , for the table wiping problem , we adopt a hierarchical control structure where the learned UC needs to modulate the parameters of a low-level admittance controller per wiping motion . A black-box optimization technique is more suitable for this low-frequency problem . More details on how we train our UPs can be found in Section 4 . Note that we train our UC with a set of training environments gµ̂ , which approximates the target environment fµ̄ . µ̄ and µ̂ need not represent the same set of parameters , and neither do fµ̄ and gµ̂ need to represent the same model , as the exact governing equations of fµ̄ is usually unknown . We aim to use a gµ̂ diverse enough to train a robust UC and expressive enough to approximate all possible trajectories evolved with fµ̄ . 3.2 DIFFERENTIABLE PHYSICS FOR ONLINE SYSTEM IDENTIFICATION . We use differentiable physics to identify some unknown physics parameters µ̂ ∈ Rg that parameterize the dynamics of the system . The numerical modeling , xt+1 = gµ̂ ( xt , τt ) , in the differentiable physics engine should be the same as in UC training approximating the target environment dynamics , xt+1 = fµ̄ ( xt , τt ) . This way , the nature of the UC ’ s inputs stays consistent . To perform system identification , DiffOSI requires first collecting a small number of samples X̄ = { x̄t , τ̄t } from target environment fµ̄ . DiffOSI uses these samples to optimize for a µ̂ that minimizes the differences between the resulted trajectory { x̂t , τ̂t } and the target state-action history { x̄t , τ̄t } . DiffOSI requires a minimum of two samples , but if the problem is nondeterministically underconstrained ( e.g. , in the presence of contact ) , more samples ( e.g. , 30-50 ) may be required to exercise all dynamics of the system . At the beginning ( first iteration k = 0 ) , we initialize µ̂ = µ0 ( e.g. , mean of expected distribution ) . For each iteration of DiffOSI optimization k , we execute the UC for a certain number of steps Tk ≤ |X̄k| using actions predicted with UC ( x̄k , µ̂k ) . With the collected samples X̄k , we use DiffOSI to optimize for the µ̂k that minimizes the following objective function : L ( X̄k ) = ∑ t∈X̄k φ ( q̂t+1 , q̄t+1 ) + φ ( ˆ̇qt+1 , ¯̇qt+1 ) , ( 1 ) where ( q̂t+1 , ˆ̇qt+1 ) = gµ̂k ( q̄t , ¯̇qt , τ̄t ) ( 2 ) and φ is any differentiable distance function . A differentiable physics engine enables the computation of gradients of L with respect to the unknown parameters µ : ∂L ( X̄k ) ∂µ̂k ( 3 ) Our system is agnostic to the choice of the differentiable physics engine . We use the Nimble differentiable physics engine ( based on DART ) by Werling et al . ( 2021 ) , which has the advantage of being able to handle articulated rigid bodies and differentiate through contact . | The paper tackles the problem of learning robot controllers that can handle changing or unknown environments. It proposes to use differentiable physics for online system identification and reinforcement learning for offline policy training. The differentiable physics module estimates simulation parameters from robot history and feeds this to the controller that is parameterized by these simulation parameters. They use domain randomization to ensure the universal controller conditioned on simulation parameters is robust to changing environments (simulation parameters). At test time, the differential physics simulation is used to estimate the simulation parameters to bias the controller to output controls for the 'correct' simulation parameters. The proposed approached is evaluated against several benchmarks on the cartpole and a tabletop wiping tasks and has been shown to outperform the baselines, which include domain randomization and some domain adaptation approaches. | SP:a8e7d4ce947d6525daace6f13bac6cfb3a68be6e |
Universal Controllers with Differentiable Physics for Online System Identification | 1 INTRODUCTION . In order for robots to shine in real-world applications , they need to handle ever-changing and unpredictable situations in real environments . For instance , a robot waiter should be able to serve a new type of dish without spilling food , and an autonomous vehicle should take a person safely to an unvisited destination . Creating artificial agents that can operate in changing and unknown environments is a longstanding problem in the robotics community . The collective wisdom of the robotic research community in recent years indicates that enabling learning agents to work in changing and unknown environments is not about making one big breakthrough , but rather making many small but informed decisions . One general approach advances control policies such that they can operate more robustly ( Tan et al. , 2018 ) or more adaptively ( Cully et al. , 2015 ) in testing environments . However , these methods usually exhibit sub-optimal task performance or require additional fine-tuning in the target environment . Alternative approaches advance simulation techniques to bring the training environment closer to the testing one prior to learning a control policy , such as training a dynamics model ( Jiang et al. , 2021 ) or identifying simulation parameters ( Tan et al. , 2018 ) from data . These methods are often used in offline settings as learning or identifying an accurate simulation model can be time consuming . Thus , they can not handle changing environments naturally . Work such as Yu et al . ( 2017 ) have also investigated methods that learn models to perform online system identification . However , a learned model often does not generalize well to unknown environments or those not seen during training . Recent developments in differentiable physics simulation potentially offer a more effective way to address these challenges by advancing both control and simulation techniques . By utilizing fast computation of analytical gradients , one can devise more computationally and sample efficient optimal control and system identification algorithms . Recent differentiable physics simulators , such as NimblePhysics ( Werling et al. , 2021 ) , provide fast computation of analytical gradients in the face of constraint satisfaction and non-differentiable contact handling . These enable generic gradient-based optimizers to solve contact-rich optimal control problems . While promising , differentiable physics simulation does not solve the fundamental problem of multiple local minima due to ill-conditioned cost functions , often exacerbated by long-horizon and highly nonlinear differential equations . This paper introduces a new approach for creating resilient and adaptive agents by combining differentiable physics simulation for online system identification and reinforcement learning for offline policy training . Online system identification can be formulated as a short-horizon , local optimization problem , but must be solved fast . This plays to the strength of differentiable physics simulation which provides analytical gradients efficiently , while avoiding the pitfalls of poor cost function landscapes . On the other hand , for challenging control problems with long-horizon cost functions , we resort to a reinforcement learning approach leveraging samples ( “ rollouts ” ) generated offline at scale to train a control policy . We explore many possible situations the agent might encounter when operating in the testing environment by varying the simulation parameters during training and learning a Universal Controller ( UC ) conditioned on the simulation parameters . At test time , we use differentiable physics simulation to continuously optimize the simulation parameters based on the most recent history of observations ( DiffOSI ) . The optimal simulation parameters will “ modulate ” the universal policy to output the optimal action for the currently identified environment . We evaluate our approach on two robotic control tasks , a cartpole balancing problem and a robot arm table wiping task involving rich contact phenomena . We show that our proposed approach combining a Universal Controller and a Differentiable physics-based Online System Identification module ( UC-DiffOSI ) can outperform pure learning-based or traditional system identification methods . Finally , we demonstrate that our approach can be applied to environments with changing dynamics or un-modeled effects . 2 RELATED WORK . Deep Reinforcement Learning and Domain Randomization . Deep reinforcement learning has been proven to be effective in learning complex motor skills for simulated robots , such as running ( Yu et al. , 2018 ) , parkour ( Heess et al. , 2017 ) , and dressing ( Clegg et al. , 2018 ) . However , these controllers often perform poorly on real robot hardware due to the discrepancies between the simulated and real environment , also known as the sim-to-real gap ( Neunert et al. , 2017 ) . Domain randomization of the simulation physics parameters has been extensively explored to help the simulation-trained controller transfer to a different target environment , where a robust control policy is trained to perform well for a wide variety of simulated environments ( Peng et al. , 2017 ; Tan et al. , 2018 ; Hwangbo et al. , 2019 ; Exarchos et al. , 2020 ; OpenAI et al. , 2019 ) . However , policies trained from domain randomization often exhibit over-conservative behaviors , leading to sub-optimal performance ( Tan et al. , 2018 ) . Different from these methods , we develop a domain adaptation approach by training adaptive controllers that can adjust behavior for different environments using an estimation of the environment parameters . This enables our controller to achieve better performance than a domain randomization controller . Domain Adaptation . To achieve better task performance in novel situations , researchers have developed adaptive controllers that can adjust behavior for different environments . Szita et al . ( 2003 ) showed that Q-learning , using event-learning , can find near-optimal policies in varying environments . Heess et al . ( 2015 ) demonstrated that control policies modified to use recurrent networks are also capable of dealing with unknown kinematic parameters such as link lengths . Xu et al . ( 2020 ) presented a deep reinforcement learning method that encodes the dynamic context online to achieve a stable non-planar pushing task controller . Yu et al . ( 2017 ) proposed a system using a Universal Policy and Online System Identification ( OSI ) function to explicitly incorporate model parameters to adapt to varying environments . These methods usually identify the environment parameters ( explicitly or implicitly ) and then adjust the controllers to adapt to the new environment . Differentiable Simulation . In recent years , researchers have built more efficient and featurecomplete differentiable physics engines . These engines support 3D rigid body and contact constraints between spheres and planes ( Degrave et al. , 2016 ) , analytic differentiation of a linear com- plementarity problem ( de Avila Belbute-Peres et al. , 2018 ) , modeling soft bodies via a differentiable real-time differentiable Material Point Method ( Hu et al. , 2018 ) , support differentiable cloth simulation ( Liang et al. , 2019 ) , optimize for large numbers of objects and contact interactions ( Qiao et al. , 2020 ) , and support articulated rigid bodies with contact ( Werling et al. , 2021 ) . Prior work , such as Toussaint et al . ( 2018 ) and Heiden et al . ( 2019 ) , also showed that differentiable physics can be integrated for end-to-end controller learning , in addition to parameter learning . Jatavallabhula et al . ( 2021 ) further integrated differentiable rendering to remove dependency on 3D vision in an end-to-end learning pipeline . 3 METHODS . Our goal is to design a system that can handle changing or unknown dynamics in the environment . The true dynamics in the target environment can be described by xt+1 = fµ ( xt , τt ) , where x = ( q , q̇ ) denotes the robot ’ s sensed states and their time derivatives , and τ denotes the control actions . fµ evolves the system from timestep t to t + 1 with dynamics parameters µ . We aim to predict optimal controls τ ∗t which maximize task performance . The controls are predicted in the first part of our system , the universal controller ( UC ) : ( x , µ ) 7→ τ . The second part is a differentiable physics engine that performs online system identification ( DiffOSI ) : { ( xi , xi+1 , τi ) } 7→ µ . The overview of the system is shown in Figure 1 . Together , they form a robust controller capable of handling unknown or changing environment dynamics . 3.1 LEARNING A UNIVERSAL CONTROLLER . Universal Controller ( UC ) augments a regular robotic controller by conditioning it on parameters of the environment µ , such as friction coefficient or robot payload . This information is crucial for the controller to select appropriate actions for different environments , yet are non-trivial to infer directly from sensory input . By providing this additional information to the UC , we expect it to outperform a regular policy given the true environment parameters . A successful UC should perform near-optimally for a wide range of µ ’ s . Given that the best way to obtain a control policy can be different across tasks , the training of UC largely depends on the task to be performed . In this work , we tailor the training of UC to two control tasks of interest : cart pole balancing and table wiping . For the cart-pole balancing problem , we want to obtain a controller that directly sends torque commands to the robot at high-frequency . Thus , we directly apply a reinforcement learning approach to obtain a Universal Control Policy as done in Yu et al . ( 2017 ) . On the other hand , for the table wiping problem , we adopt a hierarchical control structure where the learned UC needs to modulate the parameters of a low-level admittance controller per wiping motion . A black-box optimization technique is more suitable for this low-frequency problem . More details on how we train our UPs can be found in Section 4 . Note that we train our UC with a set of training environments gµ̂ , which approximates the target environment fµ̄ . µ̄ and µ̂ need not represent the same set of parameters , and neither do fµ̄ and gµ̂ need to represent the same model , as the exact governing equations of fµ̄ is usually unknown . We aim to use a gµ̂ diverse enough to train a robust UC and expressive enough to approximate all possible trajectories evolved with fµ̄ . 3.2 DIFFERENTIABLE PHYSICS FOR ONLINE SYSTEM IDENTIFICATION . We use differentiable physics to identify some unknown physics parameters µ̂ ∈ Rg that parameterize the dynamics of the system . The numerical modeling , xt+1 = gµ̂ ( xt , τt ) , in the differentiable physics engine should be the same as in UC training approximating the target environment dynamics , xt+1 = fµ̄ ( xt , τt ) . This way , the nature of the UC ’ s inputs stays consistent . To perform system identification , DiffOSI requires first collecting a small number of samples X̄ = { x̄t , τ̄t } from target environment fµ̄ . DiffOSI uses these samples to optimize for a µ̂ that minimizes the differences between the resulted trajectory { x̂t , τ̂t } and the target state-action history { x̄t , τ̄t } . DiffOSI requires a minimum of two samples , but if the problem is nondeterministically underconstrained ( e.g. , in the presence of contact ) , more samples ( e.g. , 30-50 ) may be required to exercise all dynamics of the system . At the beginning ( first iteration k = 0 ) , we initialize µ̂ = µ0 ( e.g. , mean of expected distribution ) . For each iteration of DiffOSI optimization k , we execute the UC for a certain number of steps Tk ≤ |X̄k| using actions predicted with UC ( x̄k , µ̂k ) . With the collected samples X̄k , we use DiffOSI to optimize for the µ̂k that minimizes the following objective function : L ( X̄k ) = ∑ t∈X̄k φ ( q̂t+1 , q̄t+1 ) + φ ( ˆ̇qt+1 , ¯̇qt+1 ) , ( 1 ) where ( q̂t+1 , ˆ̇qt+1 ) = gµ̂k ( q̄t , ¯̇qt , τ̄t ) ( 2 ) and φ is any differentiable distance function . A differentiable physics engine enables the computation of gradients of L with respect to the unknown parameters µ : ∂L ( X̄k ) ∂µ̂k ( 3 ) Our system is agnostic to the choice of the differentiable physics engine . We use the Nimble differentiable physics engine ( based on DART ) by Werling et al . ( 2021 ) , which has the advantage of being able to handle articulated rigid bodies and differentiate through contact . | This paper proposes an algorithm to control robots with a universal controller conditioned on the robot parameters, that are identified online using differential simulation. The idea is simple yet interesting: giving the controller explicit information about the system could definitely help performance. Estimating those parameters with differential simulation definitely makes sense. The approach could be valuable for helping robots handle internal or external changes during operation. The approach is evaluated on a series of rigid body control tasks, where it is on pair or better than previous solutions. | SP:a8e7d4ce947d6525daace6f13bac6cfb3a68be6e |
Mirror Descent Policy Optimization | 1 INTRODUCTION . An important class of RL algorithms consider an additional objective in their policy optimization that aims at constraining the consecutive policies to remain close to each other . These algorithms are referred to as trust region or proximity-based , resonating the fact that they make the new policy to lie within a trust-region around the old one . This class includes the theoretically grounded conservative policy iteration ( CPI ) algorithm [ 15 ] , as well as the state-of-the-art deep RL algorithms , such as trust-region policy optimization ( TRPO ) [ 26 ] and proximal policy optimization ( PPO ) [ 28 ] . The main difference between these algorithms is in the way that they enforce the trust-region constraint . TRPO enforces it explicitly through a line-search procedure that ensures the new policy is selected such that its KL-divergence with the old policy is below a certain threshold . PPO takes a more relaxed approach and updates its policies by solving an unconstrained optimization problem in which the ratio of the new to old policies is clipped to remain bounded . It has been shown that this procedure does not prevent the policy ratios to go out of bound , and only reduces its probability [ 31 , 9 ] . Mirror descent ( MD ) [ 6 , 4 ] is a first-order optimization method for solving constrained convex problems . Although MD is theoretically well-understood in optimization [ 3 , 14 ] , only recently , has it been investigated for policy optimization in RL [ 25 , 12 , 20 , 29 , 1 ] . Despite the progress made by these results in establishing connections between MD and trust-region policy optimization , there are still considerable gaps between the trust-region RL algorithms that have been theoretically analyzed in their tabular form [ 29 ] and those that are used in practice , such as TRPO and PPO . In this paper , motivated by the theory of MD in tabular RL , our goal is to derive scaleable and practical RL algorithms from the MD principles , and to use the MD theory to better understand and explain the popular trust-region policy optimization methods . Going beyond the tabular case , when the policy belongs to a parametric class , the trust-region problems for policy update in RL can not be solved in closed-form . We propose an algorithm , called mirror descent policy optimization ( MDPO ) , that addresses this issue by approximately solving these trust-region problems via taking multiple gradient steps on their objective functions . We derive on-policy and off-policy variants of MDPO ( Section 4 ) . We highlight the connection between on-policy MDPO and TRPO and PPO ( Section 4.1 ) , and empirically compare it against these algorithms on several continuous control tasks from OpenAI Gym [ 7 ] ( Section 5.3 ) . We then show that if we define the trust-region w.r.t . the uniform policy , instead of the old one , our off-policy MDPO coincides with the popular soft actor-critic ( SAC ) algorithm [ 13 ] . We discuss this connection in detail ( Section 4.2 ) and empirically compare these algorithms using the same set of continuous control problems ( Section 5.4 ) . Our observations on the comparison between the MDPO algorithms and TRPO , PPO , and SAC are a result of extensive empirical studies on different versions of these algorithms ( Section 5 and Appendices E and F ) . In particular , we first compare the vanilla versions of these algorithms in order to better understand how the core of these methods work relative to each other . We then add a number of code-level optimization techniques derived from the code-bases of TRPO , PPO , and SAC to these algorithms to compare their best form ( those that obtain the best results reported in the literature ) against each other , while also evaluating MDPO with PPO on 21 Atari games . We address the common belief within the community that explicitly enforcing the trust-region constraint is a necessity for good performance in TRPO , by showing that MDPO , a trust-region method based on the MD principles , does not require enforcing a hard constraint and achieves strong performance by solely solving an unconstrained problem . We address another common belief that PPO is a better performing algorithm than TRPO . By reporting results of both the vanilla version and the version loaded with code-level optimization techniques for all algorithms , we show that in both cases , TRPO consistently outperforms PPO . This is in line with some of the findings from a recent study on PPO and TRPO [ 9 ] . Finally , we provide an optimization perspective for SAC , instead of its initial motivation as an entropy-regularized ( soft ) approximate dynamic programming algorithm . Through comprehensive experiments , we show that on-policy and off-policy MDPO achieve state-of-the-art performance across a number of benchmark tasks , and can be excellent alternatives to popular policy optimization algorithms , such as TRPO , PPO , and SAC . 2 PRELIMINARIES . In this paper , we assume that the agent ’ s interaction with the environment is modeled as a γ-discounted Markov decision process ( MDP ) , denoted byM = ( S , A , P , R , γ , µ ) , where S and A are the state and action spaces ; P ≡ P ( s′|s , a ) is the transition kernel ; R ≡ r ( s , a ) is the reward function ; γ ∈ ( 0 , 1 ) is the discount factor ; and µ is the initial state distribution . Let π : S → ∆A be a stationary Markovian policy , where ∆A is the set of probability distributions onA . The discounted frequency of visiting a state s by following a policy π is defined as ρπ ( s ) ≡ ( 1−γ ) E [ ∑ t≥0 γ tI { st = s } |µ , π ] . The value function of a policy π at a state s ∈ S is defined as V π ( s ) ≡ E [ ∑ t≥0 γ tr ( st , at ) |s0 = s , π ] . Similarly , the action-value function of π is defined as Qπ ( s , a ) = E [ ∑ t≥0 γ tr ( st , at ) |s0 = s , a0 = a , π ] . The difference between the action-value Q and value V functions is referred to as the advantage function Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . Since finding an optimal policy for an MDP involves solving a non-linear system of equations and the optimal policy may be deterministic ( less explorative ) , many researchers have proposed to add a regularizer in the form of an entropy term to the reward function , and then solve the entropyregularized ( or soft ) MDP ( e.g. , [ 16 , 30 , 25 ] ) . In this formulation , the reward function is modified as rλ ( s , a ) = r ( s , a ) +λH ( π ( ·|s ) ) , where λ is the regularization parameter and H is an entropy-related term , such as Shannon entropy [ 10 , 23 ] , Tsallis entropy [ 17 , 24 ] , or relative entropy [ 2 , 22 ] . Setting λ = 0 , we return to the original formulation , also referred to as the hard MDP . In what follows , we use the terms ‘ regularized ’ and ‘ soft ’ interchangeably . 2.1 MIRROR DESCENT IN CONVEX OPTIMIZATION . Mirror Descent ( MD ) [ 4 ] is a first-order trust-region optimization method for solving constrained convex problems , i.e. , x∗ ∈ arg minx∈C f ( x ) , where f is a convex function and the constraint set C is convex compact . In each iteration , MD minimizes a sum of two terms : 1 ) a linear approximation of the objective function f at the previous estimate xk , and 2 ) a proximity term that measures the distance between the updated xk+1 and current xk estimates . MD is considered a trust-region method , since the proximity term keeps the updates xk and xk+1 close to each other . We may write the MD update as xk+1 ∈ arg min x∈C 〈∇f ( xk ) , x− xk〉+ 1 tk Bψ ( x , xk ) , ( 1 ) where Bψ ( x , xk ) : = ψ ( x ) − ψ ( xk ) − 〈∇ψ ( xk ) , x− xk〉 is the Bregman divergence associated with a strongly convex potential function ψ , and tk is a step-size determined by the MD analysis . When ψ = 12‖·‖ 2 2 , the Bergman divergence is the Euclidean distance Bψ ( x , xk ) = 1 2‖x − xk‖ 2 2 , and ( 1 ) becomes the projected gradient descent algorithm [ 3 ] . When ψ is the negative Shannon entropy , the Bregman divergence term takes the form of the KL divergence , i.e. , Bψ ( x , xk ) = KL ( x , xk ) . In this case , when the constraint set C is the unit simplex , C = ∆X , MD becomes the exponentiated gradient descent algorithm and ( 1 ) has the following closed form [ 4 ] : xik+1 = xik exp ( − tk∇if ( xk ) ) ∑n j=1 x j k exp ( − tk∇jf ( xk ) ) , ( 2 ) where xik and ∇if are the ith coordinates of xk and ∇f . 3 MIRROR DESCENT IN RL . The goal in RL is to find an optimal policy π∗ . Two common notions of optimality , and as a result , two distinct ways to formulate RL as an optimization problem are as follows : ( a ) π∗ ( ·|s ) ∈ arg max π V π ( s ) , ∀s ∈ S , ( b ) π∗ ∈ arg max π Es∼µ [ V π ( s ) ] . ( 3 ) In ( 3a ) , the value function is optimized over the entire state space S . This formulation is mainly used in value function based RL algorithms . On the other hand , the formulation in ( 3b ) is more common in policy optimization , where a scalar that is the value function at the initial state ( s ∼ µ ) is optimized . Unlike the MD optimization problem , the objective function is not convex in π in either of the above two RL optimization problems . Despite this issue , [ 12 ] and [ 29 ] have shown that we can still use the general MD update rule ( 1 ) and derive MD-style RL algorithms with the update rules πk+1 ( ·|s ) ← arg max π∈Π Ea∼π [ Aπk ( s , a ) ] − 1 tk KL ( s ; π , πk ) , ∀s ∈ S , ( 4 ) πk+1← arg max π∈Π Es∼ρπk [ Ea∼π [ Aπk ( s , a ) ] − 1 tk KL ( s ; π , πk ) ] , ( 5 ) for the optimization problems ( 3a ) and ( 3b ) , respectively . Note that while in ( 4 ) , the policy is optimized uniformly over the state space S , in ( 5 ) , it is optimized over the measure ρπk , i.e. , the state frequency induced by the current policy πk . | The paper connects the optimization method, mirror descent, to the study of the policy optimization method. Based on the mirror descent principle, the paper proposes the MDPO algorithm, which updates the policy via approximately solving a trust-region problem. The paper proposes the on-policy and off-policy variants of MDPO. Furthermore, the paper connects the on-policy MDPO to PPO and TRPO and connects the off-policy MDPO to SAC. The contribution of the paper is to provide a unified viewpoint of several RL algorithms and shows that MDPO performs equally or better than TRPO, PPO, and SAC in different tasks. | SP:d4bbe950c85fca32385520bf998941552e7543c1 |
Mirror Descent Policy Optimization | 1 INTRODUCTION . An important class of RL algorithms consider an additional objective in their policy optimization that aims at constraining the consecutive policies to remain close to each other . These algorithms are referred to as trust region or proximity-based , resonating the fact that they make the new policy to lie within a trust-region around the old one . This class includes the theoretically grounded conservative policy iteration ( CPI ) algorithm [ 15 ] , as well as the state-of-the-art deep RL algorithms , such as trust-region policy optimization ( TRPO ) [ 26 ] and proximal policy optimization ( PPO ) [ 28 ] . The main difference between these algorithms is in the way that they enforce the trust-region constraint . TRPO enforces it explicitly through a line-search procedure that ensures the new policy is selected such that its KL-divergence with the old policy is below a certain threshold . PPO takes a more relaxed approach and updates its policies by solving an unconstrained optimization problem in which the ratio of the new to old policies is clipped to remain bounded . It has been shown that this procedure does not prevent the policy ratios to go out of bound , and only reduces its probability [ 31 , 9 ] . Mirror descent ( MD ) [ 6 , 4 ] is a first-order optimization method for solving constrained convex problems . Although MD is theoretically well-understood in optimization [ 3 , 14 ] , only recently , has it been investigated for policy optimization in RL [ 25 , 12 , 20 , 29 , 1 ] . Despite the progress made by these results in establishing connections between MD and trust-region policy optimization , there are still considerable gaps between the trust-region RL algorithms that have been theoretically analyzed in their tabular form [ 29 ] and those that are used in practice , such as TRPO and PPO . In this paper , motivated by the theory of MD in tabular RL , our goal is to derive scaleable and practical RL algorithms from the MD principles , and to use the MD theory to better understand and explain the popular trust-region policy optimization methods . Going beyond the tabular case , when the policy belongs to a parametric class , the trust-region problems for policy update in RL can not be solved in closed-form . We propose an algorithm , called mirror descent policy optimization ( MDPO ) , that addresses this issue by approximately solving these trust-region problems via taking multiple gradient steps on their objective functions . We derive on-policy and off-policy variants of MDPO ( Section 4 ) . We highlight the connection between on-policy MDPO and TRPO and PPO ( Section 4.1 ) , and empirically compare it against these algorithms on several continuous control tasks from OpenAI Gym [ 7 ] ( Section 5.3 ) . We then show that if we define the trust-region w.r.t . the uniform policy , instead of the old one , our off-policy MDPO coincides with the popular soft actor-critic ( SAC ) algorithm [ 13 ] . We discuss this connection in detail ( Section 4.2 ) and empirically compare these algorithms using the same set of continuous control problems ( Section 5.4 ) . Our observations on the comparison between the MDPO algorithms and TRPO , PPO , and SAC are a result of extensive empirical studies on different versions of these algorithms ( Section 5 and Appendices E and F ) . In particular , we first compare the vanilla versions of these algorithms in order to better understand how the core of these methods work relative to each other . We then add a number of code-level optimization techniques derived from the code-bases of TRPO , PPO , and SAC to these algorithms to compare their best form ( those that obtain the best results reported in the literature ) against each other , while also evaluating MDPO with PPO on 21 Atari games . We address the common belief within the community that explicitly enforcing the trust-region constraint is a necessity for good performance in TRPO , by showing that MDPO , a trust-region method based on the MD principles , does not require enforcing a hard constraint and achieves strong performance by solely solving an unconstrained problem . We address another common belief that PPO is a better performing algorithm than TRPO . By reporting results of both the vanilla version and the version loaded with code-level optimization techniques for all algorithms , we show that in both cases , TRPO consistently outperforms PPO . This is in line with some of the findings from a recent study on PPO and TRPO [ 9 ] . Finally , we provide an optimization perspective for SAC , instead of its initial motivation as an entropy-regularized ( soft ) approximate dynamic programming algorithm . Through comprehensive experiments , we show that on-policy and off-policy MDPO achieve state-of-the-art performance across a number of benchmark tasks , and can be excellent alternatives to popular policy optimization algorithms , such as TRPO , PPO , and SAC . 2 PRELIMINARIES . In this paper , we assume that the agent ’ s interaction with the environment is modeled as a γ-discounted Markov decision process ( MDP ) , denoted byM = ( S , A , P , R , γ , µ ) , where S and A are the state and action spaces ; P ≡ P ( s′|s , a ) is the transition kernel ; R ≡ r ( s , a ) is the reward function ; γ ∈ ( 0 , 1 ) is the discount factor ; and µ is the initial state distribution . Let π : S → ∆A be a stationary Markovian policy , where ∆A is the set of probability distributions onA . The discounted frequency of visiting a state s by following a policy π is defined as ρπ ( s ) ≡ ( 1−γ ) E [ ∑ t≥0 γ tI { st = s } |µ , π ] . The value function of a policy π at a state s ∈ S is defined as V π ( s ) ≡ E [ ∑ t≥0 γ tr ( st , at ) |s0 = s , π ] . Similarly , the action-value function of π is defined as Qπ ( s , a ) = E [ ∑ t≥0 γ tr ( st , at ) |s0 = s , a0 = a , π ] . The difference between the action-value Q and value V functions is referred to as the advantage function Aπ ( s , a ) = Qπ ( s , a ) − V π ( s ) . Since finding an optimal policy for an MDP involves solving a non-linear system of equations and the optimal policy may be deterministic ( less explorative ) , many researchers have proposed to add a regularizer in the form of an entropy term to the reward function , and then solve the entropyregularized ( or soft ) MDP ( e.g. , [ 16 , 30 , 25 ] ) . In this formulation , the reward function is modified as rλ ( s , a ) = r ( s , a ) +λH ( π ( ·|s ) ) , where λ is the regularization parameter and H is an entropy-related term , such as Shannon entropy [ 10 , 23 ] , Tsallis entropy [ 17 , 24 ] , or relative entropy [ 2 , 22 ] . Setting λ = 0 , we return to the original formulation , also referred to as the hard MDP . In what follows , we use the terms ‘ regularized ’ and ‘ soft ’ interchangeably . 2.1 MIRROR DESCENT IN CONVEX OPTIMIZATION . Mirror Descent ( MD ) [ 4 ] is a first-order trust-region optimization method for solving constrained convex problems , i.e. , x∗ ∈ arg minx∈C f ( x ) , where f is a convex function and the constraint set C is convex compact . In each iteration , MD minimizes a sum of two terms : 1 ) a linear approximation of the objective function f at the previous estimate xk , and 2 ) a proximity term that measures the distance between the updated xk+1 and current xk estimates . MD is considered a trust-region method , since the proximity term keeps the updates xk and xk+1 close to each other . We may write the MD update as xk+1 ∈ arg min x∈C 〈∇f ( xk ) , x− xk〉+ 1 tk Bψ ( x , xk ) , ( 1 ) where Bψ ( x , xk ) : = ψ ( x ) − ψ ( xk ) − 〈∇ψ ( xk ) , x− xk〉 is the Bregman divergence associated with a strongly convex potential function ψ , and tk is a step-size determined by the MD analysis . When ψ = 12‖·‖ 2 2 , the Bergman divergence is the Euclidean distance Bψ ( x , xk ) = 1 2‖x − xk‖ 2 2 , and ( 1 ) becomes the projected gradient descent algorithm [ 3 ] . When ψ is the negative Shannon entropy , the Bregman divergence term takes the form of the KL divergence , i.e. , Bψ ( x , xk ) = KL ( x , xk ) . In this case , when the constraint set C is the unit simplex , C = ∆X , MD becomes the exponentiated gradient descent algorithm and ( 1 ) has the following closed form [ 4 ] : xik+1 = xik exp ( − tk∇if ( xk ) ) ∑n j=1 x j k exp ( − tk∇jf ( xk ) ) , ( 2 ) where xik and ∇if are the ith coordinates of xk and ∇f . 3 MIRROR DESCENT IN RL . The goal in RL is to find an optimal policy π∗ . Two common notions of optimality , and as a result , two distinct ways to formulate RL as an optimization problem are as follows : ( a ) π∗ ( ·|s ) ∈ arg max π V π ( s ) , ∀s ∈ S , ( b ) π∗ ∈ arg max π Es∼µ [ V π ( s ) ] . ( 3 ) In ( 3a ) , the value function is optimized over the entire state space S . This formulation is mainly used in value function based RL algorithms . On the other hand , the formulation in ( 3b ) is more common in policy optimization , where a scalar that is the value function at the initial state ( s ∼ µ ) is optimized . Unlike the MD optimization problem , the objective function is not convex in π in either of the above two RL optimization problems . Despite this issue , [ 12 ] and [ 29 ] have shown that we can still use the general MD update rule ( 1 ) and derive MD-style RL algorithms with the update rules πk+1 ( ·|s ) ← arg max π∈Π Ea∼π [ Aπk ( s , a ) ] − 1 tk KL ( s ; π , πk ) , ∀s ∈ S , ( 4 ) πk+1← arg max π∈Π Es∼ρπk [ Ea∼π [ Aπk ( s , a ) ] − 1 tk KL ( s ; π , πk ) ] , ( 5 ) for the optimization problems ( 3a ) and ( 3b ) , respectively . Note that while in ( 4 ) , the policy is optimized uniformly over the state space S , in ( 5 ) , it is optimized over the measure ρπk , i.e. , the state frequency induced by the current policy πk . | Summary: Inspired by recent theoretical analysis of TRPO and PPO that use mirror descent, this paper proposes two new algorithms that directly minimize a mirror descent objective by taking multiple gradient steps. While similar to TRPO and PPO, MDPO is different in important ways, and happens to perform better in practice. The authors also propose a similar off-policy version of MDPO that happens to be closely related to SAC while also outperforming SAC experimentally. | SP:d4bbe950c85fca32385520bf998941552e7543c1 |
Can an Image Classifier Suffice For Action Recognition? | 1 INTRODUCTION The recent advances in convolutional neural networks ( CNNs ) ( He et al. , 2016 ; Tan & Le , 2019 ) , along with the availability of large-scale video benchmark datasets ( Kay et al. , 2017 ; Monfort et al. , 2019 ; Damen et al. , 2020 ) , have significantly improved action recognition , one of the fundamental problems of video understanding . Many existing approaches for action recognition naturally extend or borrow ideas from image recognition . At the core of these approaches is spatio-temporal modeling , which regards time as an additional dimension and jointly models it with space by extending image models ( i.e. , 3D CNNs ) ( Tran et al. , 2015 ; Carreira et al. , 2017 ; Feichtenhofer , 2020 ) or fuses temporal information with spatial information processed separately by 2D CNN models ( Lin et al. , 2019 ; Fan et al. , 2019 ) . CNN-based approaches demonstrate strong capabilities in learning saptio-temporal feature representations from video data . Videos present long-range pixel interactions in both space and time . It ’ s known in approaches like non-local networks ( Wang et al. , 2018 ) that modeling such relationships helps action recognition . The recently emerging Vision Transformers naturally own the strength of capturing long-range dependencies in data , making them very suitable for video understanding . Several approaches ( Bertasius et al. , 2021a ; Li et al. , 2021 ; Arnab et al. , 2021 ) have applied ViTs for action recognition and shown better performance than their CNN counterparts . However , these approaches are still following the conventional paradigm of video action recognition , and perform temporal modeling in a similar way to CNN-based approaches using dedicated self-attention modules . In this work , we explore a different perspective for action recognition by casting the problem as an image recognition task . We ask if it is possible to model temporal information with ViT directly without using dedicated temporal modules . In other words , can an image classifier alone suffice for action recognition ? To this end , we first propose a simple idea to turn a 3D video into a 2D image . Given a sequence of input video frames , we rearrange them into a super image according to a pre-defined spatial layout , as illustrated in Fig . 2 . The super image encodes 3D spatio-temporal patterns in a video into 2D spatial image patterns . We then train an image classifier to fulfill the task of action recognition , in exactly the same way as image classification . Without surprise , based on the concept of super images , any image classifier can be re-purposed for action recognition . For convenience , we dub our approach SIFAR , short for Super Image for Action Recognition . We validate our idea by using Swin Transformer ( Liu et al. , 2021 ) , a recently developed vision transformer that has demonstrated good performance on both image classification and object detection . Since a super image has a larger size than an input frame , we modify Swin Transformer to allow for full self-attention in the last layer of the model , which further strengthens the model ’ s ability in capturing long-range temporal relations across frames in the super image . With such a change , we show that SIFAR produces strong performance against the existing SOTA approaches ( Fig . 1 ) on several benchmarks including Kinetics400 ( Kay et al. , 2017 ) , Moments in Time ( Monfort et al. , 2019 ) , Something-Something V2 ( SSV2 ) Goyal et al . ( 2017 ) , Jester ( Materzynska et al. , 2019 ) and Diving48 ( Li et al. , 2018 ) . SIFAR also enjoys efficiency in computation as well as in parameters . We further study the potential of CNN-based classifiers directly used for action recognition under the proposed SIFAR framework . Surprisingly , they achieve very competitive results on Kinetics400 against existing CNN-based approaches that rely on much more sophisticated spatio-temporal modeling . Since 3 × 3 convolutions focus on local pixels only , CNN-based SIFAR handles temporal actions on Something-Something less effectively . We experiment with larger kernel sizes to expand the temporal receptive field of CNNs , which substantially improves CNN-based SIFAR by 4 % -6.8 % with ResNet50 . SIFAR brings several advantages compared to the traditional spatio-temporal action modeling . Firstly , it is simple but effective . With one single line of code change in pytorch , SIFAR can use any image classifier for action recognition . We expect that similar ideas can also work well with other video tasks such as video object segmentation ( Duke et al. , 2021 ) . Secondly , SIFAR makes action modeling easier and more computationally efficient as it doesn ’ t require dedicated modules for temporal modeling . Nevertheless , we do not tend to underestimate the significance of temporal modeling for action recognition . Quite opposite , SIFAR highly relies on the ability of its backbone network to model long-range temporal dependencies in super images for more efficacy . Lastly , but not the least , the perspective of treating action recognition the same as image recognition unleashes many possibilities of reusing existing techniques in a more mature image field to improve video understanding from various aspects . For example , better model architectures ( Tan & Le , 2019 ) , model pruning ( Liu et al. , 2017 ) and interpretability ( Desai & Ramaswamy , 2020 ) , to name a few . 2 RELATED WORK . Action Recognition from a Single Image . One direction for video action recognition is purely based on a single image ( Davis & Bobick , 1997 ; Zhao et al. , 2017 ; Safaei & Foroosh , 2019 ; Bilen et al. , 2016 ) . In ( Davis & Bobick , 1997 ) , multiple small objects are first identified in a still image and then the target action is inferred from the relationship among the objects . Other approaches such as ( Safaei & Foroosh , 2019 ) propose to predict the missing temporal information in still images and then combine it with spatial information for action classification . There are also approaches that attempt to summarize RGB or motion information in a video into a representation image for action recognition . For instance , motion-energy image ( MEI ) ( Davis & Bobick , 1997 ) , Dynamic Image Network ( Bilen et al. , 2016 ) , Informative Frame Synthesis ( IFS ) ( Qiu et al. , 2021 ) , Adaptive Weighted Spatio-temporal Distillation ( AWSD ) ( Tavakolian et al. , 2019b ) and Adversarial Video Distillation ( AVD ) ( Tavakolian et al. , 2019a ) . Nonetheless , our approach does not attempt to understand a video from a single input image or a summarization image . Instead the approach composites the video into a super image , and then classifies the image with an image classifier directly . Action Recognition with CNNs . Action recognition is dominated by CNN-based models recently ( Feichtenhofer et al. , 2018 ; Carreira et al. , 2017 ; Fan et al. , 2019 ; Feichtenhofer , 2020 ; Chen et al. , 2021 ; Lin et al. , 2019 ; Wang et al. , 2016 ; Zhou et al. , 2018 ; Liu et al. , 2020 ; Jiang et al. , 2019a ; Tran et al. , 2019 ) . These models process the video as a cube to extract spatial-temporal features via the proposed temporal modeling methods . E.g. , SlowFast ( Feichtenhofer et al. , 2018 ) proposes two pathways whose speed is different to capture short-range and long-range time dependencies . TSM ( Lin et al. , 2019 ) applies a temporal shifting module to exchange information between neighboring frames and TAM ( Fan et al. , 2019 ) further enhances TSM by determining the amount of information to be shifted and blended . On the other hand , another thread of work attempts to select the key frame of an activity for faster recognition ( Wu et al. , 2019 ; 2020 ; Meng et al. , 2020 ; 2021 ) . E.g. , Adaframe ( Wu et al. , 2019 ) employs a policy network to determine whether or not this is a key frame , and the main network only processes the key frames . ARNet ( Meng et al. , 2020 ) determines what the image resolution should be used to save computations based on the importance of input frame images . Nonetheless , our approach is fundamentally different from conventional action recognition . It simply uses an image classifier as a video classifier by laying out a video to a super image without explicitly modeling temporal information . Action Recognition with Transformer . Following the vision transformer ( ViT ) ( Dosovitskiy et al. , 2021 ) , which demonstrates competitive performance against CNN models on image classification , many recent works attempt to extend the vision transformer for action recognition ( Neimark et al. , 2021 ; Li et al. , 2021 ; Bertasius et al. , 2021b ; Arnab et al. , 2021 ; Fan et al. , 2021 ) . VTN ( Neimark et al. , 2021 ) , VidTr ( Li et al. , 2021 ) , TimeSformer ( Bertasius et al. , 2021b ) and ViViT ( Arnab et al. , 2021 ) share the same concept that inserts a temporal modeling module into the existing ViT to enhance the features from the temporal direction . E.g. , VTN ( Neimark et al. , 2021 ) processes each frame independently and then uses a longformer to aggregate the features across frames . On the other hand , divided-space-time modeling in TimeSformer ( Bertasius et al. , 2021a ) inserts a temporal attention module into each transformer encoder for more fine-grained temporal interaction . MViT ( Fan et al. , 2021 ) develops a compact architecture based on the pyramid structure for action recognition . It further proposes a pooling-based attention to mix the tokens before computing the attention map so that the model can focus more on neighboring information . Nonetheless , our method is straightforward and applies the Swin ( Liu et al. , 2021 ) model to classify super images composed from input frames . Note that the joint-space-time attention in TimeSformer ( Bertasius et al. , 2021a ) is a special case of our approach since their method can be considered as flattening all tokens into one plane and then performing self-attention over all tokens . However , the memory complexity of such an approach is prohibitively high , and it is only applicable to the vanilla ViT ( Dosovitskiy et al. , 2021 ) without inductive bias . On the other hand , our SIFAR is general and applicable to any image classifiers . 3 APPROACH . 3.1 OVERVIEW OF OUR APPROACH . The key insight of SIFAR is to turn spatio-temporal patterns in video data into purely 2D spatial patterns in images . Like their 3D counterparts , these 2D patterns may not be visible and recognizable by human . However , we expect they are characteristic of actions and thus identifiable by powerful neural network models . To that end , we make a sequence of input frame images from a video into a super image , as illustrated in Fig . 2 , and then apply an image classifier to predict the label of the video . Note that the action patterns embedded in a super image can be complex and may involve both local ( i.e. , spatial information in a video frame ) and global contexts ( i.e. , temporal dependencies across frames ) . It is thus understandable that effective learning can only be ensured by image classifiers with strong capabilities in modeling short-range and long-range spatial dependencies in super images . For this reason , we explore the recently developed vision transformers based on self-attention to validate our proposed idea . These methods come naturally with the ability to model global image contexts and have demonstrated competitive performance against the best-performed CNN-based approaches on image classification as well as action recognition . Next we briefly describe Swin Transformer ( Liu et al. , 2021 ) , an efficient approach that we choose to implement our main idea in this work . Preliminary . The Vision Transformer ( ViT ) [ 13 ] is a purely attention-based classifier borrowed from NLP . It consists of stacked transformer encoders , each of which is featured with a multi-head self-attention module ( MSA ) and a feed-forward network ( FFN ) . While demonstrating promising results on image classification , ViT uses an isotropic structure and has a quadruple complexity w.r.t image resolution in terms of memory and computation . This significantly limits the application of ViT to many vision applications that requires high-resolution features such as object detection and segmentation . In light of this issue , several approaches ( Liu et al. , 2021 ; Chu et al. , 2021 ; Zhang et al. , 2021 ) have been proposed to perform region-level local self-attention to reduce memory usage and computation , and Swin Transformer is one of such improved vision transformers . Swin Transformer ( Liu et al. , 2021 ) first adopts a pyramid structure widely used in CNNs to reduce computation and memory . At the earlier layers , the network keeps high image resolution with fewer feature channels to learn fine-grained information . As the network goes deeper , it gradually reduces spatial resolution while expanding feature channels to model coarse-grained information . To further save memory , Swin Transformer limits self-attention to non-overlapping local windows ( W-MSA ) only.The communications between W-MSA blocks is achieved through shifting them in the succeeding transformer encoder . The shifted W-MSA is named as SW-MSA . Mathematically , the two consecutive blocks can be expressed as : yk = W-MSA ( LN ( xk−1 ) ) + xk−1 , xk = FFN ( LN ( yk ) ) + yk , yk+1 = SW-MSA ( LN ( xk ) ) + xk , xk+1 = FFN ( LN ( yk+1 ) ) + yk+1 , ( 1 ) where xl is the features at the lth layer and FFN and LN are feed-forward network and layer normalization , respectively . SIFAR . In our case , SIFAR learns action patterns by sliding window , as illustrated in Fig 3 . When the sliding window ( blue box ) is within a frame , spatial dependencies are learned . On the other hand , when the window ( red box ) spans across frames , temporal dependencies between them are effectively captured . The spatial pooling further ensures longer-range dependencies across frames captured . Creation of Super Image . Given a set of video frames , we order them by a given layout ( Fig . 4 ) to form a large super image . Different layouts give different spatial patterns for an action class . We hypothesize that a more compact structure such as a square grid may facilitate a model to learn temporal dependencies across frames as such a shape provides the shortest maximum distance between any two images . Given n input frames , we create a super image by placing all the frames in order onto a grid of size ( m− 1 ) ×m when n < ( m− 1 ) ×m or m×m when n ≥ ( m− 1 ) ×m where m = d √ ne . Empty images are padded at the end if the grid is not full . With this method , for example , 12 frames will be fit into a 3×4 grid while 14 frames into a 4×4 grid . In the default setting , we use a 3× 3 layout for 8 images and a 4× 4 one for 16 images , respectively . There are other spatial arrangements as well ( see Fig . 4 for more examples ) . However our experiments empirically show that a square grid performs the best . our approach has linear computational complexity w.r.t the number of input frames . As described above , the size of a super image is m ( m = d √ ne ) times as large as the size of a frame image , suggesting that the total number of tokens ( or image patches ) in Swin grows linearly by n. Sliding Window . As previously mentioned , Swin Transformer performs self-attention within a small local window to save memory . It uses a uniform window size across all layers , and the default window size is 7 in the original paper . Since a larger window leads to more interactions across frames , which is beneficial for SIFAR to learn long-range temporal dependencies in super images , we slightly modify the architecture of Swin Transformer ( Liu et al. , 2021 ) for it to take different window sizes flexibly in self-attention . In particular , we keep the same window size for all the layers except the last one , whose window is as large as its image resolution , implying a global self-attention including all the tokens . Since the last layer has only two transformer encoders , the computational overhead imposed by an increased window size is quite small , as indicated in Table 1 . The change of window size may result in adjustment of the input image size as the image resolution at each layer must be divisible by the window size in Swin Transformer . As noted in Table 1 , SIFAR-B-7 keeps the vanilla architecture of Swin-B . SIFAR-B-12 is more efficient than SIFAR-B-7 because SIFAR-B-12 takes smaller images ( 1922 ) as input . We demonstrate later in Sec . 4 that a larger window is critical for SIFAR to achieve good performance on more temporal datasets such as SSV2 . Implementation . Once the spatial layout for the input frames is determined , implementing our idea in pytorch is as simple as inserting into an image classifier the following line of code , which changes the input of a video to a super image . # create a super image with a layout ( sh , sw ) pre-specified by the user . x = rearrange ( x , ’ b c ( sh sw ) h w - > b c ( sh h ) ( sw w ) ’ , sh=sh , sw=sw ) The trivial code change described above transforms an image classifier into an video action classifier . Our experiments show that the same training and evaluation protocols for action models can be still applied to the repurposed image classifier . | The paper deals with action recognition in videos, i.e. detecting to which class a given sequence of frames belongs to. However, the paper proposes to explore whether an image classifier (instead of a video or spatiotemporal-based classifier) would already be enough to accomplish this task. In order to do so, the authors organize the frames from a video into a single image by organizing them into a grid, then proceed to learn them using Swin Transformers (Swin-B) image classification models. The authors report surprising results which are indeed on-par or higher than the SotA in Kinetics400, MiT, Jester and Diving48 datasets. | SP:5d9783cb0a70b17938f30263aac12ab010d63844 |
Can an Image Classifier Suffice For Action Recognition? | 1 INTRODUCTION The recent advances in convolutional neural networks ( CNNs ) ( He et al. , 2016 ; Tan & Le , 2019 ) , along with the availability of large-scale video benchmark datasets ( Kay et al. , 2017 ; Monfort et al. , 2019 ; Damen et al. , 2020 ) , have significantly improved action recognition , one of the fundamental problems of video understanding . Many existing approaches for action recognition naturally extend or borrow ideas from image recognition . At the core of these approaches is spatio-temporal modeling , which regards time as an additional dimension and jointly models it with space by extending image models ( i.e. , 3D CNNs ) ( Tran et al. , 2015 ; Carreira et al. , 2017 ; Feichtenhofer , 2020 ) or fuses temporal information with spatial information processed separately by 2D CNN models ( Lin et al. , 2019 ; Fan et al. , 2019 ) . CNN-based approaches demonstrate strong capabilities in learning saptio-temporal feature representations from video data . Videos present long-range pixel interactions in both space and time . It ’ s known in approaches like non-local networks ( Wang et al. , 2018 ) that modeling such relationships helps action recognition . The recently emerging Vision Transformers naturally own the strength of capturing long-range dependencies in data , making them very suitable for video understanding . Several approaches ( Bertasius et al. , 2021a ; Li et al. , 2021 ; Arnab et al. , 2021 ) have applied ViTs for action recognition and shown better performance than their CNN counterparts . However , these approaches are still following the conventional paradigm of video action recognition , and perform temporal modeling in a similar way to CNN-based approaches using dedicated self-attention modules . In this work , we explore a different perspective for action recognition by casting the problem as an image recognition task . We ask if it is possible to model temporal information with ViT directly without using dedicated temporal modules . In other words , can an image classifier alone suffice for action recognition ? To this end , we first propose a simple idea to turn a 3D video into a 2D image . Given a sequence of input video frames , we rearrange them into a super image according to a pre-defined spatial layout , as illustrated in Fig . 2 . The super image encodes 3D spatio-temporal patterns in a video into 2D spatial image patterns . We then train an image classifier to fulfill the task of action recognition , in exactly the same way as image classification . Without surprise , based on the concept of super images , any image classifier can be re-purposed for action recognition . For convenience , we dub our approach SIFAR , short for Super Image for Action Recognition . We validate our idea by using Swin Transformer ( Liu et al. , 2021 ) , a recently developed vision transformer that has demonstrated good performance on both image classification and object detection . Since a super image has a larger size than an input frame , we modify Swin Transformer to allow for full self-attention in the last layer of the model , which further strengthens the model ’ s ability in capturing long-range temporal relations across frames in the super image . With such a change , we show that SIFAR produces strong performance against the existing SOTA approaches ( Fig . 1 ) on several benchmarks including Kinetics400 ( Kay et al. , 2017 ) , Moments in Time ( Monfort et al. , 2019 ) , Something-Something V2 ( SSV2 ) Goyal et al . ( 2017 ) , Jester ( Materzynska et al. , 2019 ) and Diving48 ( Li et al. , 2018 ) . SIFAR also enjoys efficiency in computation as well as in parameters . We further study the potential of CNN-based classifiers directly used for action recognition under the proposed SIFAR framework . Surprisingly , they achieve very competitive results on Kinetics400 against existing CNN-based approaches that rely on much more sophisticated spatio-temporal modeling . Since 3 × 3 convolutions focus on local pixels only , CNN-based SIFAR handles temporal actions on Something-Something less effectively . We experiment with larger kernel sizes to expand the temporal receptive field of CNNs , which substantially improves CNN-based SIFAR by 4 % -6.8 % with ResNet50 . SIFAR brings several advantages compared to the traditional spatio-temporal action modeling . Firstly , it is simple but effective . With one single line of code change in pytorch , SIFAR can use any image classifier for action recognition . We expect that similar ideas can also work well with other video tasks such as video object segmentation ( Duke et al. , 2021 ) . Secondly , SIFAR makes action modeling easier and more computationally efficient as it doesn ’ t require dedicated modules for temporal modeling . Nevertheless , we do not tend to underestimate the significance of temporal modeling for action recognition . Quite opposite , SIFAR highly relies on the ability of its backbone network to model long-range temporal dependencies in super images for more efficacy . Lastly , but not the least , the perspective of treating action recognition the same as image recognition unleashes many possibilities of reusing existing techniques in a more mature image field to improve video understanding from various aspects . For example , better model architectures ( Tan & Le , 2019 ) , model pruning ( Liu et al. , 2017 ) and interpretability ( Desai & Ramaswamy , 2020 ) , to name a few . 2 RELATED WORK . Action Recognition from a Single Image . One direction for video action recognition is purely based on a single image ( Davis & Bobick , 1997 ; Zhao et al. , 2017 ; Safaei & Foroosh , 2019 ; Bilen et al. , 2016 ) . In ( Davis & Bobick , 1997 ) , multiple small objects are first identified in a still image and then the target action is inferred from the relationship among the objects . Other approaches such as ( Safaei & Foroosh , 2019 ) propose to predict the missing temporal information in still images and then combine it with spatial information for action classification . There are also approaches that attempt to summarize RGB or motion information in a video into a representation image for action recognition . For instance , motion-energy image ( MEI ) ( Davis & Bobick , 1997 ) , Dynamic Image Network ( Bilen et al. , 2016 ) , Informative Frame Synthesis ( IFS ) ( Qiu et al. , 2021 ) , Adaptive Weighted Spatio-temporal Distillation ( AWSD ) ( Tavakolian et al. , 2019b ) and Adversarial Video Distillation ( AVD ) ( Tavakolian et al. , 2019a ) . Nonetheless , our approach does not attempt to understand a video from a single input image or a summarization image . Instead the approach composites the video into a super image , and then classifies the image with an image classifier directly . Action Recognition with CNNs . Action recognition is dominated by CNN-based models recently ( Feichtenhofer et al. , 2018 ; Carreira et al. , 2017 ; Fan et al. , 2019 ; Feichtenhofer , 2020 ; Chen et al. , 2021 ; Lin et al. , 2019 ; Wang et al. , 2016 ; Zhou et al. , 2018 ; Liu et al. , 2020 ; Jiang et al. , 2019a ; Tran et al. , 2019 ) . These models process the video as a cube to extract spatial-temporal features via the proposed temporal modeling methods . E.g. , SlowFast ( Feichtenhofer et al. , 2018 ) proposes two pathways whose speed is different to capture short-range and long-range time dependencies . TSM ( Lin et al. , 2019 ) applies a temporal shifting module to exchange information between neighboring frames and TAM ( Fan et al. , 2019 ) further enhances TSM by determining the amount of information to be shifted and blended . On the other hand , another thread of work attempts to select the key frame of an activity for faster recognition ( Wu et al. , 2019 ; 2020 ; Meng et al. , 2020 ; 2021 ) . E.g. , Adaframe ( Wu et al. , 2019 ) employs a policy network to determine whether or not this is a key frame , and the main network only processes the key frames . ARNet ( Meng et al. , 2020 ) determines what the image resolution should be used to save computations based on the importance of input frame images . Nonetheless , our approach is fundamentally different from conventional action recognition . It simply uses an image classifier as a video classifier by laying out a video to a super image without explicitly modeling temporal information . Action Recognition with Transformer . Following the vision transformer ( ViT ) ( Dosovitskiy et al. , 2021 ) , which demonstrates competitive performance against CNN models on image classification , many recent works attempt to extend the vision transformer for action recognition ( Neimark et al. , 2021 ; Li et al. , 2021 ; Bertasius et al. , 2021b ; Arnab et al. , 2021 ; Fan et al. , 2021 ) . VTN ( Neimark et al. , 2021 ) , VidTr ( Li et al. , 2021 ) , TimeSformer ( Bertasius et al. , 2021b ) and ViViT ( Arnab et al. , 2021 ) share the same concept that inserts a temporal modeling module into the existing ViT to enhance the features from the temporal direction . E.g. , VTN ( Neimark et al. , 2021 ) processes each frame independently and then uses a longformer to aggregate the features across frames . On the other hand , divided-space-time modeling in TimeSformer ( Bertasius et al. , 2021a ) inserts a temporal attention module into each transformer encoder for more fine-grained temporal interaction . MViT ( Fan et al. , 2021 ) develops a compact architecture based on the pyramid structure for action recognition . It further proposes a pooling-based attention to mix the tokens before computing the attention map so that the model can focus more on neighboring information . Nonetheless , our method is straightforward and applies the Swin ( Liu et al. , 2021 ) model to classify super images composed from input frames . Note that the joint-space-time attention in TimeSformer ( Bertasius et al. , 2021a ) is a special case of our approach since their method can be considered as flattening all tokens into one plane and then performing self-attention over all tokens . However , the memory complexity of such an approach is prohibitively high , and it is only applicable to the vanilla ViT ( Dosovitskiy et al. , 2021 ) without inductive bias . On the other hand , our SIFAR is general and applicable to any image classifiers . 3 APPROACH . 3.1 OVERVIEW OF OUR APPROACH . The key insight of SIFAR is to turn spatio-temporal patterns in video data into purely 2D spatial patterns in images . Like their 3D counterparts , these 2D patterns may not be visible and recognizable by human . However , we expect they are characteristic of actions and thus identifiable by powerful neural network models . To that end , we make a sequence of input frame images from a video into a super image , as illustrated in Fig . 2 , and then apply an image classifier to predict the label of the video . Note that the action patterns embedded in a super image can be complex and may involve both local ( i.e. , spatial information in a video frame ) and global contexts ( i.e. , temporal dependencies across frames ) . It is thus understandable that effective learning can only be ensured by image classifiers with strong capabilities in modeling short-range and long-range spatial dependencies in super images . For this reason , we explore the recently developed vision transformers based on self-attention to validate our proposed idea . These methods come naturally with the ability to model global image contexts and have demonstrated competitive performance against the best-performed CNN-based approaches on image classification as well as action recognition . Next we briefly describe Swin Transformer ( Liu et al. , 2021 ) , an efficient approach that we choose to implement our main idea in this work . Preliminary . The Vision Transformer ( ViT ) [ 13 ] is a purely attention-based classifier borrowed from NLP . It consists of stacked transformer encoders , each of which is featured with a multi-head self-attention module ( MSA ) and a feed-forward network ( FFN ) . While demonstrating promising results on image classification , ViT uses an isotropic structure and has a quadruple complexity w.r.t image resolution in terms of memory and computation . This significantly limits the application of ViT to many vision applications that requires high-resolution features such as object detection and segmentation . In light of this issue , several approaches ( Liu et al. , 2021 ; Chu et al. , 2021 ; Zhang et al. , 2021 ) have been proposed to perform region-level local self-attention to reduce memory usage and computation , and Swin Transformer is one of such improved vision transformers . Swin Transformer ( Liu et al. , 2021 ) first adopts a pyramid structure widely used in CNNs to reduce computation and memory . At the earlier layers , the network keeps high image resolution with fewer feature channels to learn fine-grained information . As the network goes deeper , it gradually reduces spatial resolution while expanding feature channels to model coarse-grained information . To further save memory , Swin Transformer limits self-attention to non-overlapping local windows ( W-MSA ) only.The communications between W-MSA blocks is achieved through shifting them in the succeeding transformer encoder . The shifted W-MSA is named as SW-MSA . Mathematically , the two consecutive blocks can be expressed as : yk = W-MSA ( LN ( xk−1 ) ) + xk−1 , xk = FFN ( LN ( yk ) ) + yk , yk+1 = SW-MSA ( LN ( xk ) ) + xk , xk+1 = FFN ( LN ( yk+1 ) ) + yk+1 , ( 1 ) where xl is the features at the lth layer and FFN and LN are feed-forward network and layer normalization , respectively . SIFAR . In our case , SIFAR learns action patterns by sliding window , as illustrated in Fig 3 . When the sliding window ( blue box ) is within a frame , spatial dependencies are learned . On the other hand , when the window ( red box ) spans across frames , temporal dependencies between them are effectively captured . The spatial pooling further ensures longer-range dependencies across frames captured . Creation of Super Image . Given a set of video frames , we order them by a given layout ( Fig . 4 ) to form a large super image . Different layouts give different spatial patterns for an action class . We hypothesize that a more compact structure such as a square grid may facilitate a model to learn temporal dependencies across frames as such a shape provides the shortest maximum distance between any two images . Given n input frames , we create a super image by placing all the frames in order onto a grid of size ( m− 1 ) ×m when n < ( m− 1 ) ×m or m×m when n ≥ ( m− 1 ) ×m where m = d √ ne . Empty images are padded at the end if the grid is not full . With this method , for example , 12 frames will be fit into a 3×4 grid while 14 frames into a 4×4 grid . In the default setting , we use a 3× 3 layout for 8 images and a 4× 4 one for 16 images , respectively . There are other spatial arrangements as well ( see Fig . 4 for more examples ) . However our experiments empirically show that a square grid performs the best . our approach has linear computational complexity w.r.t the number of input frames . As described above , the size of a super image is m ( m = d √ ne ) times as large as the size of a frame image , suggesting that the total number of tokens ( or image patches ) in Swin grows linearly by n. Sliding Window . As previously mentioned , Swin Transformer performs self-attention within a small local window to save memory . It uses a uniform window size across all layers , and the default window size is 7 in the original paper . Since a larger window leads to more interactions across frames , which is beneficial for SIFAR to learn long-range temporal dependencies in super images , we slightly modify the architecture of Swin Transformer ( Liu et al. , 2021 ) for it to take different window sizes flexibly in self-attention . In particular , we keep the same window size for all the layers except the last one , whose window is as large as its image resolution , implying a global self-attention including all the tokens . Since the last layer has only two transformer encoders , the computational overhead imposed by an increased window size is quite small , as indicated in Table 1 . The change of window size may result in adjustment of the input image size as the image resolution at each layer must be divisible by the window size in Swin Transformer . As noted in Table 1 , SIFAR-B-7 keeps the vanilla architecture of Swin-B . SIFAR-B-12 is more efficient than SIFAR-B-7 because SIFAR-B-12 takes smaller images ( 1922 ) as input . We demonstrate later in Sec . 4 that a larger window is critical for SIFAR to achieve good performance on more temporal datasets such as SSV2 . Implementation . Once the spatial layout for the input frames is determined , implementing our idea in pytorch is as simple as inserting into an image classifier the following line of code , which changes the input of a video to a super image . # create a super image with a layout ( sh , sw ) pre-specified by the user . x = rearrange ( x , ’ b c ( sh sw ) h w - > b c ( sh h ) ( sw w ) ’ , sh=sh , sw=sw ) The trivial code change described above transforms an image classifier into an video action classifier . Our experiments show that the same training and evaluation protocols for action models can be still applied to the repurposed image classifier . | The paper proposes to perform action recognition by first rearranging the frames from a video into a 3x3 or 4x4 grid to form a "super image", and then giving the super image to a standard image classifier to perform action recognition. Given that this super image will be a larger image, the paper leverages the more memory efficient Swin Transformer [1] as an image classifier to perform action recognition. Experiments on Kinetics400, Moments In Time, Something-Something V2 (SSV2), Jester and Diving48 show that the proposed method is on par or exceeds SOTA in terms of accuracy. On Kinetics400, the method not only is SOTA in terms of accuracy, but also is the most FLOPs-efficient method given a specific accuracy. The strong performance suggests that a deep network's ability to model spatial relationships could also be applied to model temporal relationships across frames in a video, which is an orthogonal direction to having explicit components in the network modeling temporal relationships. Furthermore, being able to connect action recognition with image classification enables existing image classification techniques to be applied to action recognition, which could potentially accelerate the field. [1]: Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. arXiv.org, March 2021. | SP:5d9783cb0a70b17938f30263aac12ab010d63844 |
Exploring the Robustness of Distributional Reinforcement Learning against Noisy State Observations | In real scenarios , state observations that an agent observes may contain measurement errors or adversarial noises , misleading the agent to take suboptimal actions or even collapse while training . In this paper , we study the training robustness of distributional Reinforcement Learning ( RL ) , a class of state-of-the-art methods that estimate the whole distribution , as opposed to only the expectation , of the total return . Firstly , we propose State-Noisy Markov Decision Process ( SNMDP ) in the tabular case to incorporate both random and adversarial state observation noises , in which the contraction of both expectation-based and distributional Bellman operators is derived . Beyond SN-MDP with the function approximation , we firstly analyze the vulnerability of least squared loss in expectationbased RL , and by contrast theoretically characterize the bounded gradient norm of histogram-based distributional loss , accounting for the better training robustness of distribution RL . Finally , extensive experiments on the suite of games show that in SN-MDP-like setting both expectation-based and distributional RL can converge albeit corresponding to different levels under various state observation noises . However , distributional RL can enjoys better training robustness in the more complicated noisy state observation settings compared with its expectationbased counterpart . 1 INTRODUCTION . Learning robust and high-performance policies for continuous state-action reinforcement learning ( RL ) domains is crucial to enable the successful adoption of deep RL in robotics , autonomy , and control problems . However , recent works have demonstrated that deep RL algorithms are vulnerable either to model uncertainties or external disturbances ( Huang et al. , 2017 ; Pattanaik et al. , 2017 ; Ilahi et al. , 2020 ; Chen et al. , 2019 ; Zhang et al. , 2020 ; Shen et al. , 2020 ; Singh et al. , 2020 ; Guan et al. , 2020 ) . Particularly , model uncertainties normally occur in a noisy reinforcement learning environment where the agent often encounters systematic or stochastic measurement errors on state observations , such as the inexact locations and velocity obtained from the equipped sensors of a robot . On the other hand , external disturbances are normally adversarial in nature . For instance , the adversary can construct adversarial perturbations on state observations to degrade the performance of deep RL algorithms . These two factors lead to noisy state observations that influence the performance of algorithms , precluding the success of reinforcement learning in real-world applications . Existing works mainly focus on improving the robustness of algorithms in the test environment with noisy state observations . Smooth Regularized Reinforcement Learning ( Shen et al. , 2020 ) introduced a regularization to enforce smoothness in the learned policy , and thus improved its robustness against measurement errors in the test environment . Similarly , the State-Adversarial Markov decision process ( SA-MDP ) ( Zhang et al. , 2020 ) was proposed and the resulting principled policy regularization enhances the adversarial robustness of various kinds of RL algorithms against adversarial noisy state observations . However , both of these works assumed that the agent can access clean state observations during training , which is normally not feasible when the environment is inherently noisy , such as unavoidable measurement errors . Thus , the maintenance and formal analysis of policies robust to noisy state observations during training is a worthwhile area of research . On the other hand , recent distributional reinforcement learning algorithms , including C51 ( Bellemare et al. , 2017 ) , Quantile-Regression DQN ( QRDQN ) ( Dabney et al. , 2018b ) , Implicit Quantile Networks ( Dabney et al. , 2018a ) and Moment-Matching DQN ( MMD ) ( Nguyen et al. , 2020 ) , constantly set new records in Atari games , gaining huge attention in the research community . However , existing literature mainly focuses on the performance of algorithms , other benefits , including the robustness in the noisy environment , of distributional RL algorithms are less studied . As distributional RL can leverage additional information about distribution that captures the uncertainty of the environment more accurately , it is natural to expect that distributional RL with this better representation capability can be less vulnerable to the noisy environment while training , which motivates our research . In this paper , we investigate the robustness of distributional RL against various kinds of state observation noises encountered during training . Firstly , we propose a general State-Noisy MDP in the tabular setting , in which we prove the convergence of distributional Bellman operator . We further extend SN-MDP to the function approximation case by considering more complex noisy state observations . Notably , we analyze the vulnerability of classical RL and in contrast characterize the Lipschitz continuity blessing resulting from the Histogram distributional loss in distributional RL , which leads to a bounded gradient norm . This better behaved gradient mitigates the impact of noisy states on the objective function , accounting for the less vulnerability of distributional RL while training . Finally , extensive experiments demonstrate that both expectation-based and distributional RL algorithms can converge in SN-MDP-like settings . More importantly , distributional RL algorithms tend to achieve better robust performance in the presence of more complex state observation noises compared with its expectation-based counterpart that may even diverge in some cases . These empirical results in Section 5 echo our previous theoretical results in both Section 3 and 4 . Overall , the training robustness advantage of distributional RL algorithms we revealed facilitates their deployment especially in the noisy environment . 2 BACKGROUND . 2.1 DISTRIBUTIONAL REINFORCEMENT LEARNING . In the tabular setting without noisy states , the agent ’ s interaction with its environment can be naturally modeled as a standard Markov Decision Process ( MDP ) , a 5-tuple ( S , A , R , P , γ ) . S and A are the state and action spaces , P : S × A × S → [ 0 , 1 ] is the environment transition dynamics , R : S ×A× S → R is the reward function and γ ∈ ( 0 , 1 ) is the discount factor . Value Function vs Value Distribution . Firstly , we denote the return where st = s as Zπ ( s ) =∑∞ k=0 γ krt+k+1 , representing the cumulative rewards following a policy π , and rt+k+1 is reward scalar obtained in the step t + k + 1 . In the algorithm design , traditional expectation-based RL normally focuses on value function V π ( s ) , the expectation of the random variable Zπ ( s ) : V π ( s ) : = E [ Zπ ( s ) ] = E [ ∞∑ k=0 γkrt+k+1 | st = s ] . ( 1 ) In contrast , in the distributional RL setting , we focus on the value distribution , the full distribution of Zπ ( s ) , and the state-action value distribution Zπ ( s , a ) in the control problem where st = s , at = a . Both of these distributions can better capture the uncertainty of returns in the MDP beyond just its expectation ( Dabney et al. , 2018a ; Mavrin et al. , 2019 ) . Distributional Bellman Operator . In expectation-based RL , we update the value function via the Bellman operator T π , while in distributional RL , the updating is on the value distribution via the distributional Bellman operator Tπ . To derive Tπ , we firstly define the transition operator Pπ : Z → Z : PπZ ( s , a ) : D= Z ( S′ , A′ ) , S′ ∼ P ( ·|s , a ) , A′ ∼ π ( ·|S′ ) , ( 2 ) where we use capital letters S′ and A′ to emphasize the random nature of both , and : D= indicates convergence in distribution . For simplicity , we denote Zπ ( s , a ) by Z ( s , a ) . Thus , the distributional Bellman operator Tπ is defined as : TπZ ( s , a ) : D = R ( s , a , S′ ) + γPπZ ( s , a ) . ( 3 ) More importantly , Tπ is still a contraction for policy evaluation under the maximal form of the Wasserstein metric dp over the true and parametric value distributions ( Bellemare et al. , 2017 ; Dabney et al. , 2018b ) , where the p-Wasserstein metric dp is defined as dp = ( ∫ 1 0 ∣∣F−1Z∗ ( ω ) − F−1Zθ ( ω ) ∣∣p dω ) 1/p , ( 4 ) which minimizes the distance between the true value distribution Z∗ and the parametric distribution Zθ . F−1 is the inverse cumulative distribution function of a random variable with the cumulative distribution function as F . In the control setting , the distributional analogue of the Bellman optimality operator converges to the set of optimal value distributions , although it is in a weak sense and requires more involved arguments ( Dabney et al. , 2018b ) . 2.2 TWO KINDS OF NOISY STATE OBSERVATIONS . We investigate both random and adversarial training robustness , i.e. , the performance of RL algorithms under these two types of noisy state observations , between the expectation-based and distributional RL algorithms . We consider continuous state observations with continuous noises . In the random noisy state case , we apply Gaussian noises with mean 0 and different standard deviations to state features to simulate the measurement error stemming from various sources . In the adversarial state perturbation setting , we construct white-box adversarial perturbations on state observations for the current policy during training , following the strategy proposed in ( Huang et al. , 2017 ; Pattanaik et al. , 2017 ) that leveraged the gradient information of an engineered loss function . In particular , we denote atw as the “ worst ” action , with the lowest probability from the current policy πt ( a|s ) in the training step t. Thus , the optimal adversarial perturbation ηt , constrained in an -ball , can be derived by minimizing the objective function J : min η J ( st + η , πt ) = − n∑ i=1 pti log πt ( ai|st + η ) , s.t.‖η‖ ≤ , ( 5 ) where pti = 1 if i corresponds to the index of the least-chosen action , i.e . the w-th index in the vector a , otherwise pti = 0 . In other words , we construct a target one-hot action p t with 1 assigned to the index of the least-chosen action . Through this minimization in the form of the cross entropy loss , we can construct the state perturbations ηt that can force the policy to choose the least-chosen action atw in each t step . 3 TABULAR CASE : STATE-NOISY MARKOV DECISION PROCESS . In this section , we extend State-Adversarial MDP ( Zhang et al. , 2020 ) to a more general StateNoisy Markov Decision Process ( SN-MDP ) , and particularly provide a proof of the convergence and contraction of distributional Bellman operator in this setting . 3.1 DEFINITIONS . As shown in Figure 1 , SN-MDP is a 6-tuple ( S , A , R , P , γ , N ) , where the noise generating mechanism N ( ·|s ) maps the state from s to v ( s ) using either random or adversarial noise with the Marko- vian and stationary probability N ( v ( s ) |s ) . It is worthwhile to note that the explicit definition of the noise mechanism N here is based on discrete state transitions , but the analysis can be naturally extended to the continuous case if we let the state space go to infinity . Moreover , let B ( s ) be the set that contains the allowed noise space for the noise generating mechanism N , i.e. , v ( s ) ∈ B ( s ) . Following the setting in ( Zhang et al. , 2020 ) , we only manipulate state observations but do not change the underlying environment transition dynamics based on s or the agent ’ s actions directly . As such , our SN-MDP is more suitable to model the random measurement error , e.g. , sensor errors and equipment inaccuracies , and adversarial state observation perturbations in safety-critical scenarios . | This work presented State-Noisy Markov Decision Process (SN-MDP), where there is a noise generating mechanism (either from the environment noise or from the adversary), and the theoretical properties (such as convergence and contraction) for corresponding (expected) Bellman operator and distributional Bellman operator were proved. The theoretical analysis was done for both tabular and linear funcion approximation settings. Especially in function approximation setting, authors characterized the robustness blessing of distributional RL based on histogram distributional loss and analyzed how the noise factor affects TD learning by using influence function that utilizes the perburbation method. Empirical analysis was done for DQN and QRDQN by varying noise standard deviations and the position of noise (state/successor state or both), which aims to support the authors' intuition coming from their theorems. | SP:7535989fca66c0c4e072af700c3dbf5c9f2e42f2 |
Exploring the Robustness of Distributional Reinforcement Learning against Noisy State Observations | In real scenarios , state observations that an agent observes may contain measurement errors or adversarial noises , misleading the agent to take suboptimal actions or even collapse while training . In this paper , we study the training robustness of distributional Reinforcement Learning ( RL ) , a class of state-of-the-art methods that estimate the whole distribution , as opposed to only the expectation , of the total return . Firstly , we propose State-Noisy Markov Decision Process ( SNMDP ) in the tabular case to incorporate both random and adversarial state observation noises , in which the contraction of both expectation-based and distributional Bellman operators is derived . Beyond SN-MDP with the function approximation , we firstly analyze the vulnerability of least squared loss in expectationbased RL , and by contrast theoretically characterize the bounded gradient norm of histogram-based distributional loss , accounting for the better training robustness of distribution RL . Finally , extensive experiments on the suite of games show that in SN-MDP-like setting both expectation-based and distributional RL can converge albeit corresponding to different levels under various state observation noises . However , distributional RL can enjoys better training robustness in the more complicated noisy state observation settings compared with its expectationbased counterpart . 1 INTRODUCTION . Learning robust and high-performance policies for continuous state-action reinforcement learning ( RL ) domains is crucial to enable the successful adoption of deep RL in robotics , autonomy , and control problems . However , recent works have demonstrated that deep RL algorithms are vulnerable either to model uncertainties or external disturbances ( Huang et al. , 2017 ; Pattanaik et al. , 2017 ; Ilahi et al. , 2020 ; Chen et al. , 2019 ; Zhang et al. , 2020 ; Shen et al. , 2020 ; Singh et al. , 2020 ; Guan et al. , 2020 ) . Particularly , model uncertainties normally occur in a noisy reinforcement learning environment where the agent often encounters systematic or stochastic measurement errors on state observations , such as the inexact locations and velocity obtained from the equipped sensors of a robot . On the other hand , external disturbances are normally adversarial in nature . For instance , the adversary can construct adversarial perturbations on state observations to degrade the performance of deep RL algorithms . These two factors lead to noisy state observations that influence the performance of algorithms , precluding the success of reinforcement learning in real-world applications . Existing works mainly focus on improving the robustness of algorithms in the test environment with noisy state observations . Smooth Regularized Reinforcement Learning ( Shen et al. , 2020 ) introduced a regularization to enforce smoothness in the learned policy , and thus improved its robustness against measurement errors in the test environment . Similarly , the State-Adversarial Markov decision process ( SA-MDP ) ( Zhang et al. , 2020 ) was proposed and the resulting principled policy regularization enhances the adversarial robustness of various kinds of RL algorithms against adversarial noisy state observations . However , both of these works assumed that the agent can access clean state observations during training , which is normally not feasible when the environment is inherently noisy , such as unavoidable measurement errors . Thus , the maintenance and formal analysis of policies robust to noisy state observations during training is a worthwhile area of research . On the other hand , recent distributional reinforcement learning algorithms , including C51 ( Bellemare et al. , 2017 ) , Quantile-Regression DQN ( QRDQN ) ( Dabney et al. , 2018b ) , Implicit Quantile Networks ( Dabney et al. , 2018a ) and Moment-Matching DQN ( MMD ) ( Nguyen et al. , 2020 ) , constantly set new records in Atari games , gaining huge attention in the research community . However , existing literature mainly focuses on the performance of algorithms , other benefits , including the robustness in the noisy environment , of distributional RL algorithms are less studied . As distributional RL can leverage additional information about distribution that captures the uncertainty of the environment more accurately , it is natural to expect that distributional RL with this better representation capability can be less vulnerable to the noisy environment while training , which motivates our research . In this paper , we investigate the robustness of distributional RL against various kinds of state observation noises encountered during training . Firstly , we propose a general State-Noisy MDP in the tabular setting , in which we prove the convergence of distributional Bellman operator . We further extend SN-MDP to the function approximation case by considering more complex noisy state observations . Notably , we analyze the vulnerability of classical RL and in contrast characterize the Lipschitz continuity blessing resulting from the Histogram distributional loss in distributional RL , which leads to a bounded gradient norm . This better behaved gradient mitigates the impact of noisy states on the objective function , accounting for the less vulnerability of distributional RL while training . Finally , extensive experiments demonstrate that both expectation-based and distributional RL algorithms can converge in SN-MDP-like settings . More importantly , distributional RL algorithms tend to achieve better robust performance in the presence of more complex state observation noises compared with its expectation-based counterpart that may even diverge in some cases . These empirical results in Section 5 echo our previous theoretical results in both Section 3 and 4 . Overall , the training robustness advantage of distributional RL algorithms we revealed facilitates their deployment especially in the noisy environment . 2 BACKGROUND . 2.1 DISTRIBUTIONAL REINFORCEMENT LEARNING . In the tabular setting without noisy states , the agent ’ s interaction with its environment can be naturally modeled as a standard Markov Decision Process ( MDP ) , a 5-tuple ( S , A , R , P , γ ) . S and A are the state and action spaces , P : S × A × S → [ 0 , 1 ] is the environment transition dynamics , R : S ×A× S → R is the reward function and γ ∈ ( 0 , 1 ) is the discount factor . Value Function vs Value Distribution . Firstly , we denote the return where st = s as Zπ ( s ) =∑∞ k=0 γ krt+k+1 , representing the cumulative rewards following a policy π , and rt+k+1 is reward scalar obtained in the step t + k + 1 . In the algorithm design , traditional expectation-based RL normally focuses on value function V π ( s ) , the expectation of the random variable Zπ ( s ) : V π ( s ) : = E [ Zπ ( s ) ] = E [ ∞∑ k=0 γkrt+k+1 | st = s ] . ( 1 ) In contrast , in the distributional RL setting , we focus on the value distribution , the full distribution of Zπ ( s ) , and the state-action value distribution Zπ ( s , a ) in the control problem where st = s , at = a . Both of these distributions can better capture the uncertainty of returns in the MDP beyond just its expectation ( Dabney et al. , 2018a ; Mavrin et al. , 2019 ) . Distributional Bellman Operator . In expectation-based RL , we update the value function via the Bellman operator T π , while in distributional RL , the updating is on the value distribution via the distributional Bellman operator Tπ . To derive Tπ , we firstly define the transition operator Pπ : Z → Z : PπZ ( s , a ) : D= Z ( S′ , A′ ) , S′ ∼ P ( ·|s , a ) , A′ ∼ π ( ·|S′ ) , ( 2 ) where we use capital letters S′ and A′ to emphasize the random nature of both , and : D= indicates convergence in distribution . For simplicity , we denote Zπ ( s , a ) by Z ( s , a ) . Thus , the distributional Bellman operator Tπ is defined as : TπZ ( s , a ) : D = R ( s , a , S′ ) + γPπZ ( s , a ) . ( 3 ) More importantly , Tπ is still a contraction for policy evaluation under the maximal form of the Wasserstein metric dp over the true and parametric value distributions ( Bellemare et al. , 2017 ; Dabney et al. , 2018b ) , where the p-Wasserstein metric dp is defined as dp = ( ∫ 1 0 ∣∣F−1Z∗ ( ω ) − F−1Zθ ( ω ) ∣∣p dω ) 1/p , ( 4 ) which minimizes the distance between the true value distribution Z∗ and the parametric distribution Zθ . F−1 is the inverse cumulative distribution function of a random variable with the cumulative distribution function as F . In the control setting , the distributional analogue of the Bellman optimality operator converges to the set of optimal value distributions , although it is in a weak sense and requires more involved arguments ( Dabney et al. , 2018b ) . 2.2 TWO KINDS OF NOISY STATE OBSERVATIONS . We investigate both random and adversarial training robustness , i.e. , the performance of RL algorithms under these two types of noisy state observations , between the expectation-based and distributional RL algorithms . We consider continuous state observations with continuous noises . In the random noisy state case , we apply Gaussian noises with mean 0 and different standard deviations to state features to simulate the measurement error stemming from various sources . In the adversarial state perturbation setting , we construct white-box adversarial perturbations on state observations for the current policy during training , following the strategy proposed in ( Huang et al. , 2017 ; Pattanaik et al. , 2017 ) that leveraged the gradient information of an engineered loss function . In particular , we denote atw as the “ worst ” action , with the lowest probability from the current policy πt ( a|s ) in the training step t. Thus , the optimal adversarial perturbation ηt , constrained in an -ball , can be derived by minimizing the objective function J : min η J ( st + η , πt ) = − n∑ i=1 pti log πt ( ai|st + η ) , s.t.‖η‖ ≤ , ( 5 ) where pti = 1 if i corresponds to the index of the least-chosen action , i.e . the w-th index in the vector a , otherwise pti = 0 . In other words , we construct a target one-hot action p t with 1 assigned to the index of the least-chosen action . Through this minimization in the form of the cross entropy loss , we can construct the state perturbations ηt that can force the policy to choose the least-chosen action atw in each t step . 3 TABULAR CASE : STATE-NOISY MARKOV DECISION PROCESS . In this section , we extend State-Adversarial MDP ( Zhang et al. , 2020 ) to a more general StateNoisy Markov Decision Process ( SN-MDP ) , and particularly provide a proof of the convergence and contraction of distributional Bellman operator in this setting . 3.1 DEFINITIONS . As shown in Figure 1 , SN-MDP is a 6-tuple ( S , A , R , P , γ , N ) , where the noise generating mechanism N ( ·|s ) maps the state from s to v ( s ) using either random or adversarial noise with the Marko- vian and stationary probability N ( v ( s ) |s ) . It is worthwhile to note that the explicit definition of the noise mechanism N here is based on discrete state transitions , but the analysis can be naturally extended to the continuous case if we let the state space go to infinity . Moreover , let B ( s ) be the set that contains the allowed noise space for the noise generating mechanism N , i.e. , v ( s ) ∈ B ( s ) . Following the setting in ( Zhang et al. , 2020 ) , we only manipulate state observations but do not change the underlying environment transition dynamics based on s or the agent ’ s actions directly . As such , our SN-MDP is more suitable to model the random measurement error , e.g. , sensor errors and equipment inaccuracies , and adversarial state observation perturbations in safety-critical scenarios . | This paper studies the robustness of distributional reinforcement learning, in particular the robustness on state observations, which have been demonstrated in a few papers on adversarial attacks to deep reinforcement learning. Compared to existing works on robust reinforcement learning on state observations, the main difference in this work is that it considers the distributional RL setting and also considers noise during training time. Theoretically, the authors find that distributional RL can be more robust under this setting, via the lens of Lipschitz continuity of the loss function and the influence function. The findings are also verified empirically on 4 benchmarks. | SP:7535989fca66c0c4e072af700c3dbf5c9f2e42f2 |
On-Target Adaptation | 1 INTRODUCTION . Deep networks achieve tremendous success on various visual tasks at the expense of massive data collection and annotation efforts . Even more data is needed when training ( source ) and testing ( target ) data differ , as the model must be adapted on the new data to maintain accuracy . To reduce the annotation effort on new data , unsupervised domain adaptation ( UDA ) approaches transfer knowledge from labeled source data to unlabeled target data . Standard UDA requires simultaneous optimization on the source and target data to do so . However , this requirement may not be entirely practical , in that shifted or future target data may not be available during training . Furthermore , ( re- ) processing source data during testing may be limited by computation , bandwidth , and privacy . Most importantly , it is the target data that ultimately matters for testing . In this work , we therefore turn our attention from source to target , and how to learn more from it . Recent work adapts to the target data without the source data or even adapts during testing . However , these “ source-free ” and “ test-time ” approaches still rely heavily on the source parameters for finetuning . Source-free adaptation initializes from source parameters then optimizes on target data without the joint use of source data ( Liang et al. , 2020 ; Li et al. , 2020 ; Kundu et al. , 2020 ) . Testtime adaptation partially updates source parameters on the target data while testing ( Sun et al. , 2019 ; Schneider et al. , 2020 ; Wang et al. , 2021 ) . Such approaches reduce reliance on the source data , and can even improve accuracy , but have they made full use of the target data ? Many of the model parameters are fixed ( Liang et al. , 2020 ; Schneider et al. , 2020 ; Wang et al. , 2021 ) or regularized toward the source parameters ( Li et al. , 2020 ; Kundu et al. , 2020 ) . We investigate whether more can be learned from target , and more accuracy gained , by not transferring the source parameters . We propose on-target adaptation to unshackle the target representation from the source representation . To do so , we ( 1 ) factorize the representation from the classifier and ( 2 ) separate the source parameters from the source predictions . By factorizing the representation from the classifier , we can train the representation entirely on the target data by self-supervision . Given this on-target representation , we can then supervise a new classifier from source predictions by distillation ( Hinton et al. , 2015 ) , without transferring the source parameters . Not transferring parameters frees our target model from the constraints of the source architecture , so that we can experiment with distinct target architectures . In this way , we can even change the model size to optimize a target-specific model that is more accurate and more efficient . In contrast to prior work on adaptation , this uniquely allows for learning 100 % of the target model parameters on target data , as illustrated by Figure 1 . To realize our proposed factorization and separation , we employ contrastive learning , sourcefree adaptation , and teacher-student distillation . We initialize the target representation by selfsupervision with contrastive learning . We turn the source model into a teacher model by sourcefree adaptation , and then generate pseudo-labels to supervise distillation . We lastly train the student model on the teacher supervision , starting from the target representation and new classifier parameters , and repeat this teacher-student cycle by resetting the student classifier parameters between epochs . Contrastive learning has recently enabled self-supervised representations to compete with or even surpass supervised representations ( Chen & He , 2020 ; Caron et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ; Grill et al. , 2020 ; Zbontar et al. , 2021 ) . We show it provides a sufficient target representation . Our experiments show on-target adaptation achieves state-of-the-art accuracy and computational efficiency on common domain adaptation benchmarks . For model accuracy , our method brings ∼3 % absolute improvement compared to state-of-the-art unsupervised and source-free domain adaptation methods on VisDA-C ( Peng et al. , 2017 ) and ImageNet Sketch ( Wang et al. , 2019a ) while reducing 50 % + of parameters . For computation , our method reduces FLOPs by 50+ % and memory by 75+ % for each forward pass of the target model . In the long-tailed classification setting , on-target class distribution learning equals the state-of-the-art learnable weight scaling ( Kang et al. , 2019 ) without needing source data . Ablation experiments support the generality of on-target representation learning across architectures , contrastive learning methods , losses , and amount of optimization . Our contribution is to investigate whether the source data should be the primary source of target model parameters , and to propose an alternative : on-target adaptation . Our insight is that the source representation can be fully decoupled from source supervision . Domain adaptation normally emphasizes the representation of source data , by either jointly optimizing on source data or transferring source parameters . On-target adaptation emphasizes the representation of target data instead , by distilling source predictions into a self-supervised target representation . We are the first to show this is feasible , as a new kind of source-free adaptation . Furthermore we show it improves accuracy and reduces computation on standard benchmarks like VisDA-C . 2 RELATED WORK . Adaptation On-target adaptation is unique in its decoupling of the target representation from the source representation . Prior adaptation approaches transfer the source representation to the target , either by joint optimization or by initialization . To transfer the source model to a visually different target domain , unsupervised domain adaptation ( UDA ) learns a joint representation for both domains for visual recognition tasks , such as image classification ( Tzeng et al. , 2014 ) , object detection ( Chen et al. , 2018 ) , semantic segmentation ( Hoffman et al. , 2016 ) . Some of the most representative unsupervised domain adaptation ideas are 1 ) maximum mean discrepancy ( Long et al. , 2015 ; 2017 ) ; 2 ) moment/correlation matching ( Sun et al. , 2016 ; Zellinger et al. , 2017 ) ; 3 ) domain confusion ( Ganin & Lempitsky , 2015 ; Tzeng et al. , 2017 ) ; 4 ) GAN-based alignment ( Liu et al. , 2017 ; Hoffman et al. , 2018 ) . All these UDA methods need simultaneous access to both source and target data . In practice , it might be impossible to meet this requirement due to limited bandwidth , computational power , or privacy concerns . Therefore , test-time training ( Sun et al. , 2019 ) , source-free adaptation ( Liang et al. , 2020 ) , and fully test-time adaptation ( Wang et al. , 2021 ) settings focus on adapting a source model by fine-tuning on the target data without source data . Exciting concurrent work even adapts without the source model by only using source predictions ( Liang et al. , 2021 ; Zhang et al. , 2021 ; Wu et al. , 2021 ) . These “ black-box ” adaptation methods exclusively optimize teacher and student predictions , with distillation losses and output regularizers . While we likewise apply teacher-student learning , our work is complementary in using contrastive learning as a loss on the input for the student representation . Semi-supervised learning Many UDA methods follow the practice of semi-supervised learning , especially pseudo labeling ( Lee , 2013 ) which is to utilize the model prediction to generate supervision for the unlabeled images . The typical setup of unsupervised domain adaptation methods is to jointly optimize with ground truths on the source and pseudo labels on the target ( Zhang et al. , 2018 ; Choi et al. , 2019 ; Long et al. , 2017 ; Zou et al. , 2018 ) . When source data annotations are not available , DeepCluster ( Caron et al. , 2018 ) and SHOT ( Liang et al. , 2020 ) further leverage weighted k-means clustering to reduce the side effects on noisy pseudo labels . Similarly , our method does not require access to labeled source data , while only relying on the target images with generated pseudo labels . In addition , our method heavily benefits from the contrastive learned target domain representation , which is treated as initialization to overcome the misleading of noisy pseudo labels . Long-tailed recognition Long-tailed recognition tackles imbalanced class distributions in realworld data . Existing work divides into three groups : 1 ) re-balancing the data distribution ( Chawla et al. , 2002 ; Han et al. , 2005 ; Shen et al. , 2016 ; Mahajan et al. , 2018 ) ; 2 ) designing class-balanced losses ( Cui et al. , 2019 ; Khan et al. , 2017 ; Cao et al. , 2019 ; Khan et al. , 2019 ; Huang et al. , 2019 ; Lin et al. , 2017 ; Shu et al. , 2019 ; Ren et al. , 2018 ; Hayat et al. , 2019 ) ; 3 ) transfer learning across classes ( Yin et al. , 2019 ; Liu et al. , 2019 ) . All of these methods address imbalance by altering training , so that the model may learn more balanced features , and a classifier that covers common ( head ) and rare ( tail ) classes . We instead adapt the classifier for long-tailed recognition during testing . 3 METHOD : ON-TARGET ADAPTATION . The goal of the proposed on-target adaptation is to tackle domain shift during the test-time with only a source model , without the access of annotation and source data . Specifically , the supervised model with source parameter f ( · ; θs ) trained on source images xs and labels ys needs to generalize on unlabeled target data xt when an unneglectable domain shift happened . Our on-target adaptation ( Figure 2 ) is proposed to obtain target model parameter θt purely during test-time . Stage 0 ( source ) : train model with labeled source data We train a deep ConvNet and learn source parameter θs by minimizing vanilla cross-entropy loss L ( ŷs , ys ) on labeled source data ( xs , ys ) . Specifically , L ( ŷs , ys ) = −Σcp ( ysc ) log ( p ( ŷsc ) ) for the predicted probability ŷsc of class c , where target probability ysgt is 1 for the ground truth class gt and 0 for the rest . Stage 1 ( teacher ) : adapt source model without source data We update the source parameter θs during testing to minimize information maximization ( InfoMax ) loss ( Gomes et al. , 2010 ) . Specifically , InfoMax loss augment entropy loss Lent = −Σcp ( ŷtc ) log ( p ( ŷtc ) with diversity objective Ldiv = DKL ( ŷt || 1C1C ) − log ( C ) . where DKL indicates the KullbackLeibler divergence , 1C is an all-one vector with C dimensions . Here 1C1C indicates the target label vector with evenly distributed 1C probabilities , where Ldiv is propose to enforce the global diversity over classes . As for the parameters to optimize over , we follow the motivation of decoupling the representation and classifier . When the classifier is frozen , the goal of optimization is to mitigate domain shift by deriving proper target features from the source model . In particular , we keep the classifier the same on both source and target domain , and obtain ∆ by the gradient of the test-time objective ( InfoMax ) , to update the representation part of model parameter θs . Stage 2 ( student ) : initialize target model with contrastive learning Instead of fine-tuning from source model , we choose to initialize the target feature purely from target data . Benefiting from the recent advances in contrastive learning methods , we train an unsupervised model with purely unlabeled target images . Specifically , we initialized target representation via improved momentum contrast learning ( MoCo v2 ) ( He et al. , 2020 ; Chen et al. , 2020 ) . It is worth noting that our method does not require a specific contrastive learning method . In other words , the default MoCo v2 could be easily replaced by a more recent self-supervised learning model , such as SwAV ( Caron et al. , 2020 ) , SimSiam ( Chen & He , 2020 ) , Barlow Twins ( Zbontar et al. , 2021 ) . Such a modular design makes it easier to benefit from the latest advance in contrastive learning . We have performed an ablation study on the choice of contrastive learning method in Section 4.5 . Stage 3 ( teacher-student ) : transfer knowledge from teacher to student We use the adapted source model f ( · ; θs +∆ ) as the initial teacher model to generate pseudo labels y′t on unannotated target images xt . Then we fine-tune the student model f ( · ; θt ) initialized by contrastive learning on target data with cross-entropy loss L ( ŷt , y′t ) = −Σcp ( y′tc ) log ( p ( ŷtc ) ) . Specifically , we use normal distribution with a mean of zero and standard deviation of 0.01 for the classification head , since contrastive learned model does not contain classifier . The teacher would be replaced with the latest student to gradually denoise pseudo labels for the subsequent phase . Meanwhile , the contrastive learned model would re-initialize the student feature to eliminate the accumulated errors from imperfect pseudo labels . In other words , the student model would start over one more time with only newer pseudo labels for the next transferring phase . Figure 3 illustrates the procedure of transferring the knowledge from teacher to student . Specifically , the interaction between teacher and student models benefits from consistency regularization and pseudo-labeling , inspired by a recent semi-supervised learning approach called FixMatch ( Sohn et al. , 2020 ) . During the transferring , we augment the target images with random cropping , random flipping , and AutoAugment with ImageNet policy , as “ strong ” augmentation , while the “ weak ” augmentation is the combination of resizing and center cropping when generating pseudo labels . Relying on the assumption that the model should generate similar predictions on data-augmented versions of the same image ( Bachman et al. , 2014 ; Sajjadi et al. , 2016 ; Laine & Aila , 2016 ) , consistency regularization enforces the cross-entropy loss between student output on strongly-augmented images and teacher output on weakly-augmented images . | This work addresses the problem of source-free domain adaptation. Instead of fine-tuning *the source model* on the target data, this work proposes to fine-tune *a representation learned on the target data alone* using e.g. self-supervised contrastive learning. This permits distinct target architectures that can improve performance and/or reduce memory and computational cost. | SP:b2cb7590f48bb18dbe0f70b894ef981acea1874b |
On-Target Adaptation | 1 INTRODUCTION . Deep networks achieve tremendous success on various visual tasks at the expense of massive data collection and annotation efforts . Even more data is needed when training ( source ) and testing ( target ) data differ , as the model must be adapted on the new data to maintain accuracy . To reduce the annotation effort on new data , unsupervised domain adaptation ( UDA ) approaches transfer knowledge from labeled source data to unlabeled target data . Standard UDA requires simultaneous optimization on the source and target data to do so . However , this requirement may not be entirely practical , in that shifted or future target data may not be available during training . Furthermore , ( re- ) processing source data during testing may be limited by computation , bandwidth , and privacy . Most importantly , it is the target data that ultimately matters for testing . In this work , we therefore turn our attention from source to target , and how to learn more from it . Recent work adapts to the target data without the source data or even adapts during testing . However , these “ source-free ” and “ test-time ” approaches still rely heavily on the source parameters for finetuning . Source-free adaptation initializes from source parameters then optimizes on target data without the joint use of source data ( Liang et al. , 2020 ; Li et al. , 2020 ; Kundu et al. , 2020 ) . Testtime adaptation partially updates source parameters on the target data while testing ( Sun et al. , 2019 ; Schneider et al. , 2020 ; Wang et al. , 2021 ) . Such approaches reduce reliance on the source data , and can even improve accuracy , but have they made full use of the target data ? Many of the model parameters are fixed ( Liang et al. , 2020 ; Schneider et al. , 2020 ; Wang et al. , 2021 ) or regularized toward the source parameters ( Li et al. , 2020 ; Kundu et al. , 2020 ) . We investigate whether more can be learned from target , and more accuracy gained , by not transferring the source parameters . We propose on-target adaptation to unshackle the target representation from the source representation . To do so , we ( 1 ) factorize the representation from the classifier and ( 2 ) separate the source parameters from the source predictions . By factorizing the representation from the classifier , we can train the representation entirely on the target data by self-supervision . Given this on-target representation , we can then supervise a new classifier from source predictions by distillation ( Hinton et al. , 2015 ) , without transferring the source parameters . Not transferring parameters frees our target model from the constraints of the source architecture , so that we can experiment with distinct target architectures . In this way , we can even change the model size to optimize a target-specific model that is more accurate and more efficient . In contrast to prior work on adaptation , this uniquely allows for learning 100 % of the target model parameters on target data , as illustrated by Figure 1 . To realize our proposed factorization and separation , we employ contrastive learning , sourcefree adaptation , and teacher-student distillation . We initialize the target representation by selfsupervision with contrastive learning . We turn the source model into a teacher model by sourcefree adaptation , and then generate pseudo-labels to supervise distillation . We lastly train the student model on the teacher supervision , starting from the target representation and new classifier parameters , and repeat this teacher-student cycle by resetting the student classifier parameters between epochs . Contrastive learning has recently enabled self-supervised representations to compete with or even surpass supervised representations ( Chen & He , 2020 ; Caron et al. , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ; Grill et al. , 2020 ; Zbontar et al. , 2021 ) . We show it provides a sufficient target representation . Our experiments show on-target adaptation achieves state-of-the-art accuracy and computational efficiency on common domain adaptation benchmarks . For model accuracy , our method brings ∼3 % absolute improvement compared to state-of-the-art unsupervised and source-free domain adaptation methods on VisDA-C ( Peng et al. , 2017 ) and ImageNet Sketch ( Wang et al. , 2019a ) while reducing 50 % + of parameters . For computation , our method reduces FLOPs by 50+ % and memory by 75+ % for each forward pass of the target model . In the long-tailed classification setting , on-target class distribution learning equals the state-of-the-art learnable weight scaling ( Kang et al. , 2019 ) without needing source data . Ablation experiments support the generality of on-target representation learning across architectures , contrastive learning methods , losses , and amount of optimization . Our contribution is to investigate whether the source data should be the primary source of target model parameters , and to propose an alternative : on-target adaptation . Our insight is that the source representation can be fully decoupled from source supervision . Domain adaptation normally emphasizes the representation of source data , by either jointly optimizing on source data or transferring source parameters . On-target adaptation emphasizes the representation of target data instead , by distilling source predictions into a self-supervised target representation . We are the first to show this is feasible , as a new kind of source-free adaptation . Furthermore we show it improves accuracy and reduces computation on standard benchmarks like VisDA-C . 2 RELATED WORK . Adaptation On-target adaptation is unique in its decoupling of the target representation from the source representation . Prior adaptation approaches transfer the source representation to the target , either by joint optimization or by initialization . To transfer the source model to a visually different target domain , unsupervised domain adaptation ( UDA ) learns a joint representation for both domains for visual recognition tasks , such as image classification ( Tzeng et al. , 2014 ) , object detection ( Chen et al. , 2018 ) , semantic segmentation ( Hoffman et al. , 2016 ) . Some of the most representative unsupervised domain adaptation ideas are 1 ) maximum mean discrepancy ( Long et al. , 2015 ; 2017 ) ; 2 ) moment/correlation matching ( Sun et al. , 2016 ; Zellinger et al. , 2017 ) ; 3 ) domain confusion ( Ganin & Lempitsky , 2015 ; Tzeng et al. , 2017 ) ; 4 ) GAN-based alignment ( Liu et al. , 2017 ; Hoffman et al. , 2018 ) . All these UDA methods need simultaneous access to both source and target data . In practice , it might be impossible to meet this requirement due to limited bandwidth , computational power , or privacy concerns . Therefore , test-time training ( Sun et al. , 2019 ) , source-free adaptation ( Liang et al. , 2020 ) , and fully test-time adaptation ( Wang et al. , 2021 ) settings focus on adapting a source model by fine-tuning on the target data without source data . Exciting concurrent work even adapts without the source model by only using source predictions ( Liang et al. , 2021 ; Zhang et al. , 2021 ; Wu et al. , 2021 ) . These “ black-box ” adaptation methods exclusively optimize teacher and student predictions , with distillation losses and output regularizers . While we likewise apply teacher-student learning , our work is complementary in using contrastive learning as a loss on the input for the student representation . Semi-supervised learning Many UDA methods follow the practice of semi-supervised learning , especially pseudo labeling ( Lee , 2013 ) which is to utilize the model prediction to generate supervision for the unlabeled images . The typical setup of unsupervised domain adaptation methods is to jointly optimize with ground truths on the source and pseudo labels on the target ( Zhang et al. , 2018 ; Choi et al. , 2019 ; Long et al. , 2017 ; Zou et al. , 2018 ) . When source data annotations are not available , DeepCluster ( Caron et al. , 2018 ) and SHOT ( Liang et al. , 2020 ) further leverage weighted k-means clustering to reduce the side effects on noisy pseudo labels . Similarly , our method does not require access to labeled source data , while only relying on the target images with generated pseudo labels . In addition , our method heavily benefits from the contrastive learned target domain representation , which is treated as initialization to overcome the misleading of noisy pseudo labels . Long-tailed recognition Long-tailed recognition tackles imbalanced class distributions in realworld data . Existing work divides into three groups : 1 ) re-balancing the data distribution ( Chawla et al. , 2002 ; Han et al. , 2005 ; Shen et al. , 2016 ; Mahajan et al. , 2018 ) ; 2 ) designing class-balanced losses ( Cui et al. , 2019 ; Khan et al. , 2017 ; Cao et al. , 2019 ; Khan et al. , 2019 ; Huang et al. , 2019 ; Lin et al. , 2017 ; Shu et al. , 2019 ; Ren et al. , 2018 ; Hayat et al. , 2019 ) ; 3 ) transfer learning across classes ( Yin et al. , 2019 ; Liu et al. , 2019 ) . All of these methods address imbalance by altering training , so that the model may learn more balanced features , and a classifier that covers common ( head ) and rare ( tail ) classes . We instead adapt the classifier for long-tailed recognition during testing . 3 METHOD : ON-TARGET ADAPTATION . The goal of the proposed on-target adaptation is to tackle domain shift during the test-time with only a source model , without the access of annotation and source data . Specifically , the supervised model with source parameter f ( · ; θs ) trained on source images xs and labels ys needs to generalize on unlabeled target data xt when an unneglectable domain shift happened . Our on-target adaptation ( Figure 2 ) is proposed to obtain target model parameter θt purely during test-time . Stage 0 ( source ) : train model with labeled source data We train a deep ConvNet and learn source parameter θs by minimizing vanilla cross-entropy loss L ( ŷs , ys ) on labeled source data ( xs , ys ) . Specifically , L ( ŷs , ys ) = −Σcp ( ysc ) log ( p ( ŷsc ) ) for the predicted probability ŷsc of class c , where target probability ysgt is 1 for the ground truth class gt and 0 for the rest . Stage 1 ( teacher ) : adapt source model without source data We update the source parameter θs during testing to minimize information maximization ( InfoMax ) loss ( Gomes et al. , 2010 ) . Specifically , InfoMax loss augment entropy loss Lent = −Σcp ( ŷtc ) log ( p ( ŷtc ) with diversity objective Ldiv = DKL ( ŷt || 1C1C ) − log ( C ) . where DKL indicates the KullbackLeibler divergence , 1C is an all-one vector with C dimensions . Here 1C1C indicates the target label vector with evenly distributed 1C probabilities , where Ldiv is propose to enforce the global diversity over classes . As for the parameters to optimize over , we follow the motivation of decoupling the representation and classifier . When the classifier is frozen , the goal of optimization is to mitigate domain shift by deriving proper target features from the source model . In particular , we keep the classifier the same on both source and target domain , and obtain ∆ by the gradient of the test-time objective ( InfoMax ) , to update the representation part of model parameter θs . Stage 2 ( student ) : initialize target model with contrastive learning Instead of fine-tuning from source model , we choose to initialize the target feature purely from target data . Benefiting from the recent advances in contrastive learning methods , we train an unsupervised model with purely unlabeled target images . Specifically , we initialized target representation via improved momentum contrast learning ( MoCo v2 ) ( He et al. , 2020 ; Chen et al. , 2020 ) . It is worth noting that our method does not require a specific contrastive learning method . In other words , the default MoCo v2 could be easily replaced by a more recent self-supervised learning model , such as SwAV ( Caron et al. , 2020 ) , SimSiam ( Chen & He , 2020 ) , Barlow Twins ( Zbontar et al. , 2021 ) . Such a modular design makes it easier to benefit from the latest advance in contrastive learning . We have performed an ablation study on the choice of contrastive learning method in Section 4.5 . Stage 3 ( teacher-student ) : transfer knowledge from teacher to student We use the adapted source model f ( · ; θs +∆ ) as the initial teacher model to generate pseudo labels y′t on unannotated target images xt . Then we fine-tune the student model f ( · ; θt ) initialized by contrastive learning on target data with cross-entropy loss L ( ŷt , y′t ) = −Σcp ( y′tc ) log ( p ( ŷtc ) ) . Specifically , we use normal distribution with a mean of zero and standard deviation of 0.01 for the classification head , since contrastive learned model does not contain classifier . The teacher would be replaced with the latest student to gradually denoise pseudo labels for the subsequent phase . Meanwhile , the contrastive learned model would re-initialize the student feature to eliminate the accumulated errors from imperfect pseudo labels . In other words , the student model would start over one more time with only newer pseudo labels for the next transferring phase . Figure 3 illustrates the procedure of transferring the knowledge from teacher to student . Specifically , the interaction between teacher and student models benefits from consistency regularization and pseudo-labeling , inspired by a recent semi-supervised learning approach called FixMatch ( Sohn et al. , 2020 ) . During the transferring , we augment the target images with random cropping , random flipping , and AutoAugment with ImageNet policy , as “ strong ” augmentation , while the “ weak ” augmentation is the combination of resizing and center cropping when generating pseudo labels . Relying on the assumption that the model should generate similar predictions on data-augmented versions of the same image ( Bachman et al. , 2014 ; Sajjadi et al. , 2016 ; Laine & Aila , 2016 ) , consistency regularization enforces the cross-entropy loss between student output on strongly-augmented images and teacher output on weakly-augmented images . | The paper proposes a multi-stage approach for source-free domain adaptation, namely when source data is not available and one can only use the model pre-trained on the source and adapt it based on unlabelled target domain data. The paper advocates for learning on target not via fine-tuning the source model, but rather distill from it initializing on source using contrastive learning (the authors use Moco V2). The source model is also adapted on target via InfoMax loss before being used as the teacher for the distillation. The authors propose to use the FixMatch strategy (with strong and weak aug taken from AutoAugment) for the distillation. The authors show some gains when combining with SOTA source-free adaptation methods: TENT and SHOT. The authors also show that improved accuracy can be obtained with much smaller models trained on target using their method (e.g. replacing Res50 or Res101 with Res18 on Visda-C. Extensive experiments, ablations, and results are provided. | SP:b2cb7590f48bb18dbe0f70b894ef981acea1874b |
The Effect of diversity in Meta-Learning | 1 INTRODUCTION . It is widely recognized that humans can learn new concepts based on very little supervision , i.e. , with few examples ( or ” shots ” ) , and generalize these concepts to unseen data as mentioned by Lake et al . ( 2011 ) . Recent advances in deep learning , on the other hand , have primarily relied on datasets with large amounts of labeled examples , primarily due to overfitting concerns in low data regimes . Although the development of better data augmentation and regularization techniques can alleviate these concerns , many researchers now assume that future breakthroughs in low data regimes will emerge from meta-learning , or ” learning to learn. ” Here , we study the effect of task diversity in the low data regime and its effect on various models . In this meta-learning setting , a model is trained on a handful of labeled examples at a time under the assumption that it will learn how to correctly project examples of different classes and generalize this knowledge to unseen labels at test time . Although this setting is often used to illustrate the remaining gap between human capabilities and machine learning , we could argue that the domain of meta-learning is still nascent . The domain of task selection has remained virtually unexplored in this setting . Conventional wisdom is that the performance of the model will improve as we train on more diverse tasks . To test this hypothesis to its limits , we define various task samplers which either limit task diversity by selecting a subset of overall tasks or improving task diversity using approaches such as Determinantal Point Processes ( DPPs ) proposed by Macchi ( 1975 ) . Our contributions in this work are as follows : • We show that , against conventional wisdom , task diversity does not significantly boost performance in meta-learning . Instead , limiting task diversity and repeating the same tasks over the training phase allows the model to obtain performances similar to models trained on Uniform Sampler without any adverse effects . • We also show that increasing task diversity using sophisticated samplers such as DPP or Online Hard Task Mining ( OHTM ) Samplers do not significantly boost performance . Instead , the dynamic-DPP Sampler harms the model due to the increased task diversity . • We empirically show that repeating tasks over the training phase can perform similarly to a model trained on the Uniform Sampler , achieving similar performance with only a fragment of data . This key finding questions the need to increase the support set pool to improve the model ’ s performance . 2 RELATED WORKS . Meta-learning formulations typically rely on episodic training , wherein an algorithm adapts to a task , given its support set , to minimize the loss incurred on the query set . Meta-learning methods differ in terms of the algorithms they learn , and can be broadly classified under four prominent classes : Metric-based , Model-based , Optimization-based and Bayesian-based approaches . Metricbased methods such as Koch et al . ( 2015 ) ; Vinyals et al . ( 2016 ) ; Snell et al . ( 2017 ) ; Sung et al . ( 2018 ) operate on the core idea similar to nearest neighbors algorithm and kernel density estimation . These methods are also called non-parametric approaches . Model-based methods such as Santoro et al . ( 2016 ) ; Munkhdalai & Yu ( 2017 ) depend on a model designed specifically for fast learning , which updates its parameters rapidly with a few training steps , achieved by its internal architecture or controlled by another meta-learner model . Generic deep learning models learn through backpropagation of gradients , which are neither designed to cope with a small number of training samples nor converge within a few optimization steps . To address this , Optimization-based methods such as Ravi & Larochelle ( 2016 ) ; Finn et al . ( 2017 ) ; Nichol et al . ( 2018 ) were proposed , which were better suited to learn from a small number of samples . However , all the above approaches are deterministic and are not the most suited for few-shot problems that are generally ambiguous . Hence , Bayesian-based methods such as Yoon et al . ( 2018 ) ; Requeima et al . ( 2019 ) were proposed which helped address the above issue . Although research in meta-learning models has attracted much attention recently , the effect of task diversity is virtually unexplored in the domain of meta-learning . However , task sampling and task diversity have been more extensively studied in other closely related problems such as active learning . Active learning involves selecting unlabeled data items in order to improve an existing classifier . Although most of the approaches in this domain are based on heuristics , there are few approaches to sample a batch of samples for active learning . Ravi & Larochelle ( 2018 ) proposed an approach to sample a batch of samples using a protonet as the backbone architecture . The model tries to maximize the query set , given support set and unlabeled data . Other works such as Hsu et al . ( 2018 ) proposed a framework named CACTUs , which samples tasks/examples using relatively simple task construction mechanisms such as clustering embeddings . The unsupervised representations learned via these samples lead to a good performance on various downstream human-specified tasks . Although nascent , a few recent works aim to improve meta-learning by explicitly looking at the task structure and relationships . Among these , Yin et al . ( 2019 ) proposed an approach to handle the lack of mutual exclusiveness among different tasks through an information-theoretic regularized objective . In addition , several popular meta-learning methods Lee et al . ( 2019 ) ; Snell et al . ( 2017 ) improve the meta-test performance by changing the number of ways or shots of the sampled metatraining tasks , thus increasing the complexity and diversity of the tasks . Other works such as Liu et al . ( 2020a ) proposed an approach to sample classes using class-pair-based sampling and classbased sampling . The Class-pair based Sampler selects pairs of classes that confuse the model the most . The class-based Sampler samples each class independently and does not consider the task ’ s difficulty as a whole . Our OHTM sampler is similar to the Class-pair based Sampler . Other works such as Liu et al . ( 2020b ) propose to augment the set of possible tasks by augmenting the predefined set of classes that generate the tasks with varying degrees of rotated inputs as new classes . Other works such as Setlur et al . ( 2020 ) look at the structure and diversity of tasks specifically through the lens of support set diversity , and show that , surprisingly , reducing diversity ( by fixing support set ) not only maintains—but in many cases , significantly improves—the performance of meta-learning . This experiment is very similar to our No Diversity Task Sampler if the size of the support set is equal to the number of classes per task . However , in this work , we extend their work on MetaOptNet , Protonet to many other models and a myriad of samplers to better understand task diversity in meta-learning . To the best of our knowledge , we are the first to study the effect of task diversity in meta-learning to this extent . 3 BACKGROUND . Here , we review some of the fundamental ideas required to understand our few-shot learning experiments better . 3.1 EPISODIC FEW-SHOT LEARNING . In episodic few-shot learning , an episode is represented as a K-way , N-shot classification problem where N is the number of examples per class and K is the number of unique class labels . During training , the data in each episode is provided as a support set S = { ( x1,1 , y1,1 ) , ... , ( xN , K , yN , K ) } where xi , j ∈ RD is the i-th instance of the j-th class , and yj ∈ { 0 , 1 } K is its corresponding one-hot labeling vector . Each episode aims to optimize a function f that classifies new instances provided through a ” query ” set Q , containing instances of the same class as S. This task is difficult because N is typically very small ( e , g , 1 to 10 ) . The classes change every episode . The actual test set used to evaluate a model does not contain classes seen in support sets during training . In the task-distribution view , meta-learning is a general-purpose learning algorithm that can generalize across tasks and ideally enable each new task to be learned better than the last . We can evaluate the performance of ω over a distribution of tasks p ( T ) . Here we loosely define a task to be a dataset and loss function T = { D , L } . Learning how to learn thus becomes : min ω E τ∼p ( τ ) L ( D ; ω ) ( 1 ) whereL ( D ; ω ) measures the performance of a model trained using ω on datasetD and p ( τ ) indicates the task distribution . In this experiment , we extend this setting such that we vary the task diversity in the train split to study the effects on test split , which remains to use uniform or random sampling for tasks . 3.2 DETERMINANTAL POINT PROCESSES ( DPPS ) . A DPP is a probability distribution over subsets of a ground set Y , where we assume Y = { 1 , 2 , ... , N } and N = |Y| . An L-ensemble defines a DPP using a real , symmetric , and positivedefinite matrix L indexed by the elements of Y . The probability of sampling a subset Y = A ⊆ Y can be written as : P ( Y = A ) ∝ det LA , ( 2 ) where LA : = [ Li , j ] i , j∈A is the restriction of L to the entries indexed by the elements of A . As L is a positive semi-definite , there exists a d × N matrix Ψ such that L = ΨTΨ where d ≤ N . Using this principle , we define the probability of sampling as : P ( Y = A ) ∝ det LA = Vol2 ( { Ψi } i∈A ) , ( 3 ) where the RHS is the squared volume of the parallelepiped spanned by { Ψi } i∈A . In Eq . 3 , Ψi is defined as the feature vector of element i , and each element Li , j in L is the similarity measured by dot products between elements i and j . Hence , we can verify that a DPP places higher probabilities on diverse sets because the more orthogonal the feature vectors are , the larger the volume parallelepiped spanned by the feature vector is . In this work , these feature embeddings represent class embeddings , which are derived using either a pre-trained protonet model or the model being trained as discussed in Sec . 3.3 . In a DPP , the cardinality of a sampled subset , |A| , is random in general . A k-DPP is an extension of the DPP proposed in the work of Kuhn et al . ( 2003 ) , where the cardinality of subsets are fixed as k ( i.e. , |A| =k ) . In this work , we use k-DPPs as an off-the-shelf implementation to retrieve classes that represent a task used in the meta-learning step . | In this paper, the authors investigate the effect of task diversity in the training process of meta-learning. The findings indicate that increasing task diversity during the meta-training process does not boost performance. They evaluate the performance on four few-shot image classification datasets. | SP:2c485765c1d5d0ada7730ca804d4a298682bf928 |
The Effect of diversity in Meta-Learning | 1 INTRODUCTION . It is widely recognized that humans can learn new concepts based on very little supervision , i.e. , with few examples ( or ” shots ” ) , and generalize these concepts to unseen data as mentioned by Lake et al . ( 2011 ) . Recent advances in deep learning , on the other hand , have primarily relied on datasets with large amounts of labeled examples , primarily due to overfitting concerns in low data regimes . Although the development of better data augmentation and regularization techniques can alleviate these concerns , many researchers now assume that future breakthroughs in low data regimes will emerge from meta-learning , or ” learning to learn. ” Here , we study the effect of task diversity in the low data regime and its effect on various models . In this meta-learning setting , a model is trained on a handful of labeled examples at a time under the assumption that it will learn how to correctly project examples of different classes and generalize this knowledge to unseen labels at test time . Although this setting is often used to illustrate the remaining gap between human capabilities and machine learning , we could argue that the domain of meta-learning is still nascent . The domain of task selection has remained virtually unexplored in this setting . Conventional wisdom is that the performance of the model will improve as we train on more diverse tasks . To test this hypothesis to its limits , we define various task samplers which either limit task diversity by selecting a subset of overall tasks or improving task diversity using approaches such as Determinantal Point Processes ( DPPs ) proposed by Macchi ( 1975 ) . Our contributions in this work are as follows : • We show that , against conventional wisdom , task diversity does not significantly boost performance in meta-learning . Instead , limiting task diversity and repeating the same tasks over the training phase allows the model to obtain performances similar to models trained on Uniform Sampler without any adverse effects . • We also show that increasing task diversity using sophisticated samplers such as DPP or Online Hard Task Mining ( OHTM ) Samplers do not significantly boost performance . Instead , the dynamic-DPP Sampler harms the model due to the increased task diversity . • We empirically show that repeating tasks over the training phase can perform similarly to a model trained on the Uniform Sampler , achieving similar performance with only a fragment of data . This key finding questions the need to increase the support set pool to improve the model ’ s performance . 2 RELATED WORKS . Meta-learning formulations typically rely on episodic training , wherein an algorithm adapts to a task , given its support set , to minimize the loss incurred on the query set . Meta-learning methods differ in terms of the algorithms they learn , and can be broadly classified under four prominent classes : Metric-based , Model-based , Optimization-based and Bayesian-based approaches . Metricbased methods such as Koch et al . ( 2015 ) ; Vinyals et al . ( 2016 ) ; Snell et al . ( 2017 ) ; Sung et al . ( 2018 ) operate on the core idea similar to nearest neighbors algorithm and kernel density estimation . These methods are also called non-parametric approaches . Model-based methods such as Santoro et al . ( 2016 ) ; Munkhdalai & Yu ( 2017 ) depend on a model designed specifically for fast learning , which updates its parameters rapidly with a few training steps , achieved by its internal architecture or controlled by another meta-learner model . Generic deep learning models learn through backpropagation of gradients , which are neither designed to cope with a small number of training samples nor converge within a few optimization steps . To address this , Optimization-based methods such as Ravi & Larochelle ( 2016 ) ; Finn et al . ( 2017 ) ; Nichol et al . ( 2018 ) were proposed , which were better suited to learn from a small number of samples . However , all the above approaches are deterministic and are not the most suited for few-shot problems that are generally ambiguous . Hence , Bayesian-based methods such as Yoon et al . ( 2018 ) ; Requeima et al . ( 2019 ) were proposed which helped address the above issue . Although research in meta-learning models has attracted much attention recently , the effect of task diversity is virtually unexplored in the domain of meta-learning . However , task sampling and task diversity have been more extensively studied in other closely related problems such as active learning . Active learning involves selecting unlabeled data items in order to improve an existing classifier . Although most of the approaches in this domain are based on heuristics , there are few approaches to sample a batch of samples for active learning . Ravi & Larochelle ( 2018 ) proposed an approach to sample a batch of samples using a protonet as the backbone architecture . The model tries to maximize the query set , given support set and unlabeled data . Other works such as Hsu et al . ( 2018 ) proposed a framework named CACTUs , which samples tasks/examples using relatively simple task construction mechanisms such as clustering embeddings . The unsupervised representations learned via these samples lead to a good performance on various downstream human-specified tasks . Although nascent , a few recent works aim to improve meta-learning by explicitly looking at the task structure and relationships . Among these , Yin et al . ( 2019 ) proposed an approach to handle the lack of mutual exclusiveness among different tasks through an information-theoretic regularized objective . In addition , several popular meta-learning methods Lee et al . ( 2019 ) ; Snell et al . ( 2017 ) improve the meta-test performance by changing the number of ways or shots of the sampled metatraining tasks , thus increasing the complexity and diversity of the tasks . Other works such as Liu et al . ( 2020a ) proposed an approach to sample classes using class-pair-based sampling and classbased sampling . The Class-pair based Sampler selects pairs of classes that confuse the model the most . The class-based Sampler samples each class independently and does not consider the task ’ s difficulty as a whole . Our OHTM sampler is similar to the Class-pair based Sampler . Other works such as Liu et al . ( 2020b ) propose to augment the set of possible tasks by augmenting the predefined set of classes that generate the tasks with varying degrees of rotated inputs as new classes . Other works such as Setlur et al . ( 2020 ) look at the structure and diversity of tasks specifically through the lens of support set diversity , and show that , surprisingly , reducing diversity ( by fixing support set ) not only maintains—but in many cases , significantly improves—the performance of meta-learning . This experiment is very similar to our No Diversity Task Sampler if the size of the support set is equal to the number of classes per task . However , in this work , we extend their work on MetaOptNet , Protonet to many other models and a myriad of samplers to better understand task diversity in meta-learning . To the best of our knowledge , we are the first to study the effect of task diversity in meta-learning to this extent . 3 BACKGROUND . Here , we review some of the fundamental ideas required to understand our few-shot learning experiments better . 3.1 EPISODIC FEW-SHOT LEARNING . In episodic few-shot learning , an episode is represented as a K-way , N-shot classification problem where N is the number of examples per class and K is the number of unique class labels . During training , the data in each episode is provided as a support set S = { ( x1,1 , y1,1 ) , ... , ( xN , K , yN , K ) } where xi , j ∈ RD is the i-th instance of the j-th class , and yj ∈ { 0 , 1 } K is its corresponding one-hot labeling vector . Each episode aims to optimize a function f that classifies new instances provided through a ” query ” set Q , containing instances of the same class as S. This task is difficult because N is typically very small ( e , g , 1 to 10 ) . The classes change every episode . The actual test set used to evaluate a model does not contain classes seen in support sets during training . In the task-distribution view , meta-learning is a general-purpose learning algorithm that can generalize across tasks and ideally enable each new task to be learned better than the last . We can evaluate the performance of ω over a distribution of tasks p ( T ) . Here we loosely define a task to be a dataset and loss function T = { D , L } . Learning how to learn thus becomes : min ω E τ∼p ( τ ) L ( D ; ω ) ( 1 ) whereL ( D ; ω ) measures the performance of a model trained using ω on datasetD and p ( τ ) indicates the task distribution . In this experiment , we extend this setting such that we vary the task diversity in the train split to study the effects on test split , which remains to use uniform or random sampling for tasks . 3.2 DETERMINANTAL POINT PROCESSES ( DPPS ) . A DPP is a probability distribution over subsets of a ground set Y , where we assume Y = { 1 , 2 , ... , N } and N = |Y| . An L-ensemble defines a DPP using a real , symmetric , and positivedefinite matrix L indexed by the elements of Y . The probability of sampling a subset Y = A ⊆ Y can be written as : P ( Y = A ) ∝ det LA , ( 2 ) where LA : = [ Li , j ] i , j∈A is the restriction of L to the entries indexed by the elements of A . As L is a positive semi-definite , there exists a d × N matrix Ψ such that L = ΨTΨ where d ≤ N . Using this principle , we define the probability of sampling as : P ( Y = A ) ∝ det LA = Vol2 ( { Ψi } i∈A ) , ( 3 ) where the RHS is the squared volume of the parallelepiped spanned by { Ψi } i∈A . In Eq . 3 , Ψi is defined as the feature vector of element i , and each element Li , j in L is the similarity measured by dot products between elements i and j . Hence , we can verify that a DPP places higher probabilities on diverse sets because the more orthogonal the feature vectors are , the larger the volume parallelepiped spanned by the feature vector is . In this work , these feature embeddings represent class embeddings , which are derived using either a pre-trained protonet model or the model being trained as discussed in Sec . 3.3 . In a DPP , the cardinality of a sampled subset , |A| , is random in general . A k-DPP is an extension of the DPP proposed in the work of Kuhn et al . ( 2003 ) , where the cardinality of subsets are fixed as k ( i.e. , |A| =k ) . In this work , we use k-DPPs as an off-the-shelf implementation to retrieve classes that represent a task used in the meta-learning step . | The paper studies how the diversity of tasks in the training phase affects the performance of meta-learning algorithms. The paper finds negative evidence, which is consistent with Setlur et al. (2021). Compared with the existing work, the paper performs more extensive experiments with different meta-learning algorithms, different task samplers, and different datasets. | SP:2c485765c1d5d0ada7730ca804d4a298682bf928 |
Multi-Tailed, Multi-Headed, Spatial Dynamic Memory refined Text-to-Image Synthesis | 1 INTRODUCTION . Generative Adversarial Networks ( GANs ) have shown great promise for the generation of photo-realistic synthetic images ( Goodfellow et al. , 2014 ; Radford et al. , 2015 ; Denton et al. , 2015 ; Salimans et al. , 2016 ) , and the highly-compelling nature of images generated by GANs has driven research into conditional image-generation and multimodal learning . In this paper , we focus on the task of text-to-image generation , that has emerged as an area of active research in recent years . Although much progress has been made in this area , the synthesis of high-quality , realistic images from text-descriptions remains a challenging task . Current state-of-the-art methods ( Xu et al. , 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) employ multiple-stages of image generation - typically , an initial image is first generated from a global sentence-level vector , and subsequent stages incorporate fine-grained information extracted from word-level vectors to refine image details . However , these methods suffer from three important limitations . The first problem is that by attempting to synthesize image features directly from a sentence-level vector , the initial generation stage fails to cleanly separate image attributes at a word-level . If potentially distinct objects such as ‘ cat ’ and ‘ tree ’ for example , are entangled in the sentence-level representation , then the presence of either word in a sentence could prompt the initial stage to generate the same hybrid image attributes . This is important because the subsequent refinement stage relies upon the initial image features to provide a meaningful basis for word-level refinement . By feeding it ambiguous and poorly formed initial features , we limit the scope of refinement . Secondly , current methods do not construct region-specific representations of text at refinement stages . This prevents us from interpreting words in fundamentally different ways based on the content of image regions . Whereas , in complex real-world scenes , the requirement for a region-contextualized interpretation of words is commonplace - based on the region under consideration , the same word often dictates fundamentally different types of refinement within a single image . The word ‘ raining ’ for example dictates a requirement in the sky that is fundamentally different from the requirement that it dictates in the region of the ground . While the sky becomes more cloudy , the ground must become wet . To generate realistic images from natural text descriptions , it is important that we construct a refinement architecture that allows different image regions to assimilate region-contextualized information from text descriptions . Finally , we note that current methods generate refinement features ( that modify previous image features ) only once at each refinement stage and attempt to address all image aspects within a single-shot . This single-shot refinement limits the precision with which each refinement stage can learn to improve the prior image . In this paper , we propose a Multi-Headed and Spatial Dynamic Memory image refinement mechanism with a Multi-Tailed Word-level Initial Generation stage ( MSMT-GAN ) to address these three issues . Our contributions are summarized as follows : • We introduce a novel `` Multi-Tailed '' Word-level Initial Generation stage ( MTWIG ) , that generates a separate set of image features for each word n-gram , and iteratively fuses these sets together to obtain initial image features . We demonstrate that it is possible to improve the performance of previous methods by replacing their initial generation stage with ours . • We introduce a novel Spatial Dynamic Memory module ( SDM ) that fuses word-information in a custom way with each prior image region , to obtain region-contextualized textrepresentations . At each refinement stage we retrieve features for image improvement from this SDM module . • We introduce a novel Iterative Multi-Headed Mechanism ( IMHM ) of image refinement - wherein we explicitly allow each stage of refinement to make multiple distinct modifications to the prior image , under common discriminator feedback . We evaluate our MSMT-GAN model on the Caltech-UCSD Birds 200 ( CUB ) dataset ( Wah et al. , 2011 ) and the Microsoft Common Objects in Context ( COCO ) dataset ( Lin et al. , 2014 ) . Experiment results demonstrate that MSMT-GAN is competitive with current methods on the COCO dataset and significantly outperforms the previous state-of-the art on the CUB dataset , decreasing the lowest reported Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) by 21.58 % for CUB . 2 RELATED WORK . Text-to-Image Generators : Reed et al . ( 2016 ) first demonstrated that a translation model from natural language to image pixels could be learnt by conditioning both generator and discriminator networks of a GAN on input text-descriptions . There has since been a surge of interest in training multi-stage attention based GAN architectures for this task . While the conventional setting ( Zhang et al. , 2017 ; Xu et al. , 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) assumes only the availability of ( text , image ) pairs at training time , recently a second setting has emerged that assumes availability of bounding-box/shape-mask information of objects attributes during training ( Li et al. , 2019b ; Hinz et al. , 2019 ; Cho et al. , 2020 ; Liang et al. , 2020 ) . We highlight that this represents a significantly easier problem setting and that such methods are not feasible where bounding-box/shape information is unavailable ( such as the CUB dataset ) . Our method does not assume the availability of bounding-box/shape information , and we make comparisons against prior work of the same setting . Memory Networks : Memory Networks ( Weston et al. , 2014 ) combine inference components with a long-term memory module that can be dynamically written to and read from . Current methods ( Miller et al. , 2016 ) query “ key encodings '' of memory slots to retrieve a set of weights . These weights are used to combine separate “ value encodings '' of the slots into a single response . A Dynamic Memory Generative Adversarial Network ( DM-GAN ) ( Zhu et al. , 2019 ) that retrieves information for image refinement from a memory module was recently proposed for text-to-image synthesis . In our SDM module , we too employ the memory-writing , key-addressing , value-reading paradigm introduced by ( Miller et al. , 2016 ) , but our method differs from ( Zhu et al. , 2019 ) in all three memory operations ( Section 3.2 ) . Fundamentally , DM-GAN does not create region-contextualized representations of text . Multi-Headed Attention : Transformers ( Vaswani et al. , 2017 ) utilize a key-value mechanism similar to memory networks and introduced the idea of multi-headed attention . They linearly project query , keys and values to h separate encodings , called “ attention heads '' , and each head is separately used to extract an output vector . These vectors are concatenated together and linearly projected to a single response . Inspired by the success of Transformers , we introduce the IMHM method for image refinement . However , our method differs in a few respects . We maintain separate SDM modules for each head and we obtain queries and fuse outputs in an iterative fashion . We also adopt a “ redundancy loss '' ( Section 3.4 ) to encourage each head to focus on separate image aspects . 3 MSMT-GAN . Our MSMT-GAN architecture ( Figure 1 ) comprises of three stages - a Multi-Tailed Word-level Initial Generation ( MTWIG ) stage , and two refinement stages . Each refinement stage is Multi-Headed , and each refinement head has a separate Spatial Dynamic Memory ( SDM ) module . Section 3.1 presents our MTWIG stage , Section 3.2 presents our SDM module for a single refinement head , and the details of our Iterative Multi-Headed Mechanism ( IMHM ) are presented in Section 3.3 . 3.1 MULTI-TAILED WORD-LEVEL INITIAL GENERATION ( MTWIG ) . We highlight that previous multi-stage methods ( Zhang et al. , 2017 ; 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) all rely on the same type of initial generation stage and focus only on improving the refinement stages - making the conventional assumption that the performance of multi-stage generators is primarily determined by the refinement stages , and that the quality of the `` rough initial image '' is of little importance . In our paper , we break from this tradition and demonstrate for the first time that gains can be achieved in the final stage of image refinement by making an improvement to the initial images . The conventional approach synthesizes initial images directly from a sentence-level vector without attempting to separate image attributes at a word-level . As a result , words that are entangled at the sentence-level representation generate initial image attributes that are inherently ambiguous in nature . In our novel Multi-Tailed Word-level Initial Generation ( MTWIG ) stage , we overcome this shortcoming by explicitly creating separate sets of image attributes for each word n-gram . First , we sample a vector of random noise z from a normal distribution and use a pretrained text-encoder to extract a sentence-level vector and word-level vectors : s and W from the input text . W = { w1 , w2 , ... , wL } ; wl ∈ RNw ; s ∈ RNs ; zn ∼ N ( 0 , 1 ) ; z ∈ RNz ( 1 ) Where L is the number of words in the text-description , and Nz , Ns and Nw are the dimensions of the noise vector , sentence vector and word vectors respectively . To mitigate over-fitting , the Conditioning Augmentation technique ( Zhang et al. , 2017 ) is used to resample the sentence-vector from an independent Gaussian distribution . This resampled sentence vector s′ and the noise vector z are then concatenated with each word-level vector wl from the input text sequence , and the sequence of concatenated vectors are passed through a 1D convolutional operation V of stride 1 ( see Figure 1 ) . F = V ( { concat ( s′ , z , wl ) | ∀ wl ∈W } ) ( 2 ) The length T of the output sequence F depends on the kernel size used by V and the vectors of the output sequence ft ∈ F are each separately passed through a series of upsampling blocks to generate corresponding sets of image features St . These sets of image features or `` tails '' each correspond to a different word n-gram from the input text sequence . If we use a kernel size of 1 for V , then each tail St corresponds to a single word . If we use a kernel size of 2 , then each tail St corresponds to a word bi-gram , and so on . We combine our sequence of tails { St } together in an iterative fashion using the adaptive gating fusion mechanism introduced by Zhu et al . ( 2019 ) ( discussed in Section A.1 ) . S1 : t = fuse ( S1 : t−1 , St , P MTWIG , ρMTWIG ) ; R1 = S1 : T ( 3 ) Where PMTWIG and ρMTWIG denote parameter matrix and bias terms , S1 : t denotes a combination of the first t tails , and S1:1 denotes the first tail S1 . The combination of all T tails gives us the final image features R1 for our initial stage . Notice that by concatenating each word vector wl with s′ and z before the 1D convolution , each tail is created with some common information , so they may learn to fuse together coherently . Each upsampling block consists of a nearest neighbor upsampling layer and a 3×3 convolution operation . An initial image is predicted from R1 using a 3×3 convolution . | The paper proposed a new method to tackle text-to-image generation challenge. In the paper, authors introduced a potential problem that current methods only use sentence embedding at beginning of the network to generate initial images, where different attributes may be entangled and are hard to be refined during following states. Based on this, authors proposed three components to address this limitation. | SP:0c0df2e874c35381bda95487f3278aea4ae0922f |
Multi-Tailed, Multi-Headed, Spatial Dynamic Memory refined Text-to-Image Synthesis | 1 INTRODUCTION . Generative Adversarial Networks ( GANs ) have shown great promise for the generation of photo-realistic synthetic images ( Goodfellow et al. , 2014 ; Radford et al. , 2015 ; Denton et al. , 2015 ; Salimans et al. , 2016 ) , and the highly-compelling nature of images generated by GANs has driven research into conditional image-generation and multimodal learning . In this paper , we focus on the task of text-to-image generation , that has emerged as an area of active research in recent years . Although much progress has been made in this area , the synthesis of high-quality , realistic images from text-descriptions remains a challenging task . Current state-of-the-art methods ( Xu et al. , 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) employ multiple-stages of image generation - typically , an initial image is first generated from a global sentence-level vector , and subsequent stages incorporate fine-grained information extracted from word-level vectors to refine image details . However , these methods suffer from three important limitations . The first problem is that by attempting to synthesize image features directly from a sentence-level vector , the initial generation stage fails to cleanly separate image attributes at a word-level . If potentially distinct objects such as ‘ cat ’ and ‘ tree ’ for example , are entangled in the sentence-level representation , then the presence of either word in a sentence could prompt the initial stage to generate the same hybrid image attributes . This is important because the subsequent refinement stage relies upon the initial image features to provide a meaningful basis for word-level refinement . By feeding it ambiguous and poorly formed initial features , we limit the scope of refinement . Secondly , current methods do not construct region-specific representations of text at refinement stages . This prevents us from interpreting words in fundamentally different ways based on the content of image regions . Whereas , in complex real-world scenes , the requirement for a region-contextualized interpretation of words is commonplace - based on the region under consideration , the same word often dictates fundamentally different types of refinement within a single image . The word ‘ raining ’ for example dictates a requirement in the sky that is fundamentally different from the requirement that it dictates in the region of the ground . While the sky becomes more cloudy , the ground must become wet . To generate realistic images from natural text descriptions , it is important that we construct a refinement architecture that allows different image regions to assimilate region-contextualized information from text descriptions . Finally , we note that current methods generate refinement features ( that modify previous image features ) only once at each refinement stage and attempt to address all image aspects within a single-shot . This single-shot refinement limits the precision with which each refinement stage can learn to improve the prior image . In this paper , we propose a Multi-Headed and Spatial Dynamic Memory image refinement mechanism with a Multi-Tailed Word-level Initial Generation stage ( MSMT-GAN ) to address these three issues . Our contributions are summarized as follows : • We introduce a novel `` Multi-Tailed '' Word-level Initial Generation stage ( MTWIG ) , that generates a separate set of image features for each word n-gram , and iteratively fuses these sets together to obtain initial image features . We demonstrate that it is possible to improve the performance of previous methods by replacing their initial generation stage with ours . • We introduce a novel Spatial Dynamic Memory module ( SDM ) that fuses word-information in a custom way with each prior image region , to obtain region-contextualized textrepresentations . At each refinement stage we retrieve features for image improvement from this SDM module . • We introduce a novel Iterative Multi-Headed Mechanism ( IMHM ) of image refinement - wherein we explicitly allow each stage of refinement to make multiple distinct modifications to the prior image , under common discriminator feedback . We evaluate our MSMT-GAN model on the Caltech-UCSD Birds 200 ( CUB ) dataset ( Wah et al. , 2011 ) and the Microsoft Common Objects in Context ( COCO ) dataset ( Lin et al. , 2014 ) . Experiment results demonstrate that MSMT-GAN is competitive with current methods on the COCO dataset and significantly outperforms the previous state-of-the art on the CUB dataset , decreasing the lowest reported Fréchet Inception Distance ( FID ) ( Heusel et al. , 2017 ) by 21.58 % for CUB . 2 RELATED WORK . Text-to-Image Generators : Reed et al . ( 2016 ) first demonstrated that a translation model from natural language to image pixels could be learnt by conditioning both generator and discriminator networks of a GAN on input text-descriptions . There has since been a surge of interest in training multi-stage attention based GAN architectures for this task . While the conventional setting ( Zhang et al. , 2017 ; Xu et al. , 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) assumes only the availability of ( text , image ) pairs at training time , recently a second setting has emerged that assumes availability of bounding-box/shape-mask information of objects attributes during training ( Li et al. , 2019b ; Hinz et al. , 2019 ; Cho et al. , 2020 ; Liang et al. , 2020 ) . We highlight that this represents a significantly easier problem setting and that such methods are not feasible where bounding-box/shape information is unavailable ( such as the CUB dataset ) . Our method does not assume the availability of bounding-box/shape information , and we make comparisons against prior work of the same setting . Memory Networks : Memory Networks ( Weston et al. , 2014 ) combine inference components with a long-term memory module that can be dynamically written to and read from . Current methods ( Miller et al. , 2016 ) query “ key encodings '' of memory slots to retrieve a set of weights . These weights are used to combine separate “ value encodings '' of the slots into a single response . A Dynamic Memory Generative Adversarial Network ( DM-GAN ) ( Zhu et al. , 2019 ) that retrieves information for image refinement from a memory module was recently proposed for text-to-image synthesis . In our SDM module , we too employ the memory-writing , key-addressing , value-reading paradigm introduced by ( Miller et al. , 2016 ) , but our method differs from ( Zhu et al. , 2019 ) in all three memory operations ( Section 3.2 ) . Fundamentally , DM-GAN does not create region-contextualized representations of text . Multi-Headed Attention : Transformers ( Vaswani et al. , 2017 ) utilize a key-value mechanism similar to memory networks and introduced the idea of multi-headed attention . They linearly project query , keys and values to h separate encodings , called “ attention heads '' , and each head is separately used to extract an output vector . These vectors are concatenated together and linearly projected to a single response . Inspired by the success of Transformers , we introduce the IMHM method for image refinement . However , our method differs in a few respects . We maintain separate SDM modules for each head and we obtain queries and fuse outputs in an iterative fashion . We also adopt a “ redundancy loss '' ( Section 3.4 ) to encourage each head to focus on separate image aspects . 3 MSMT-GAN . Our MSMT-GAN architecture ( Figure 1 ) comprises of three stages - a Multi-Tailed Word-level Initial Generation ( MTWIG ) stage , and two refinement stages . Each refinement stage is Multi-Headed , and each refinement head has a separate Spatial Dynamic Memory ( SDM ) module . Section 3.1 presents our MTWIG stage , Section 3.2 presents our SDM module for a single refinement head , and the details of our Iterative Multi-Headed Mechanism ( IMHM ) are presented in Section 3.3 . 3.1 MULTI-TAILED WORD-LEVEL INITIAL GENERATION ( MTWIG ) . We highlight that previous multi-stage methods ( Zhang et al. , 2017 ; 2018 ; Li et al. , 2019a ; Zhu et al. , 2019 ) all rely on the same type of initial generation stage and focus only on improving the refinement stages - making the conventional assumption that the performance of multi-stage generators is primarily determined by the refinement stages , and that the quality of the `` rough initial image '' is of little importance . In our paper , we break from this tradition and demonstrate for the first time that gains can be achieved in the final stage of image refinement by making an improvement to the initial images . The conventional approach synthesizes initial images directly from a sentence-level vector without attempting to separate image attributes at a word-level . As a result , words that are entangled at the sentence-level representation generate initial image attributes that are inherently ambiguous in nature . In our novel Multi-Tailed Word-level Initial Generation ( MTWIG ) stage , we overcome this shortcoming by explicitly creating separate sets of image attributes for each word n-gram . First , we sample a vector of random noise z from a normal distribution and use a pretrained text-encoder to extract a sentence-level vector and word-level vectors : s and W from the input text . W = { w1 , w2 , ... , wL } ; wl ∈ RNw ; s ∈ RNs ; zn ∼ N ( 0 , 1 ) ; z ∈ RNz ( 1 ) Where L is the number of words in the text-description , and Nz , Ns and Nw are the dimensions of the noise vector , sentence vector and word vectors respectively . To mitigate over-fitting , the Conditioning Augmentation technique ( Zhang et al. , 2017 ) is used to resample the sentence-vector from an independent Gaussian distribution . This resampled sentence vector s′ and the noise vector z are then concatenated with each word-level vector wl from the input text sequence , and the sequence of concatenated vectors are passed through a 1D convolutional operation V of stride 1 ( see Figure 1 ) . F = V ( { concat ( s′ , z , wl ) | ∀ wl ∈W } ) ( 2 ) The length T of the output sequence F depends on the kernel size used by V and the vectors of the output sequence ft ∈ F are each separately passed through a series of upsampling blocks to generate corresponding sets of image features St . These sets of image features or `` tails '' each correspond to a different word n-gram from the input text sequence . If we use a kernel size of 1 for V , then each tail St corresponds to a single word . If we use a kernel size of 2 , then each tail St corresponds to a word bi-gram , and so on . We combine our sequence of tails { St } together in an iterative fashion using the adaptive gating fusion mechanism introduced by Zhu et al . ( 2019 ) ( discussed in Section A.1 ) . S1 : t = fuse ( S1 : t−1 , St , P MTWIG , ρMTWIG ) ; R1 = S1 : T ( 3 ) Where PMTWIG and ρMTWIG denote parameter matrix and bias terms , S1 : t denotes a combination of the first t tails , and S1:1 denotes the first tail S1 . The combination of all T tails gives us the final image features R1 for our initial stage . Notice that by concatenating each word vector wl with s′ and z before the 1D convolution , each tail is created with some common information , so they may learn to fuse together coherently . Each upsampling block consists of a nearest neighbor upsampling layer and a 3×3 convolution operation . An initial image is predicted from R1 using a 3×3 convolution . | This paper is motivated by that most existing text-to-image methods suffer from three limitations and solutions are proposed to address the different limitations. Firstly, it introduces multi-tailed word-level initial generation to enhance global sentence representation with distinct n-gram word presentation. Second, the spatial dynamic memory module is proposed to create a separate region-contextualized text representation for each image region. Finally, it introduces an iterative multi-headed mechanism to make multiple distinct modifications to the prior image features. | SP:0c0df2e874c35381bda95487f3278aea4ae0922f |
Generalization of Neural Combinatorial Solvers Through the Lens of Adversarial Robustness | 1 INTRODUCTION . Combinatorial Optimization covers some of the oldest and most studied computational problems . Well-known examples are the study of the NP-complete SATisfiability problem for boolean statements or the Traveling Salesperson Problem ( TSP ) . Today , these problems can be solved efficiently with approximate solvers that have been crafted over the previous decades ( Festa , 2014 ) . As an alternative to engineered , application-specific heuristics , learning seems to be a good candidate ( Bengio et al. , 2021 ) and was studied as a component in traditional solvers ( e.g . Haim & Walsh ( 2009 ) ; Singh et al . ( 2009 ) ) . Recently , end-to-end deep learning for NP-hard combinatorial optimization has gained attention , triggered by the widespread success of ( geometric ) deep learning . Nevertheless , it is still an open question if and to what extent end-to-end deep learning can effectively and efficiently approximate such NP-hard combinatorial optimization problems . Moreover , there is a “ Catch-22 “ ; even if neural networks could approximate the solutions for NP-hard problems , generating the training data is either ( a ) incomplete but efficient or ( b ) complete but inefficient/approximate . An incomplete data generator ( a ) crafts the problem instances s.t . their labels are know and a complete data generator ( b ) solves the NP-hard problem instances to obtain the labels . Moreover , regardless of case ( a ) or ( b ) , it is intractable to obtain a dense sample even for moderate problem sizes due to the large problem space . For the special case of ( a ) exact polynomial-time data-generators , Yehuda et al . ( 2020 ) detail two challenges as a result of the NP-hardness : ( 1 ) Easier subproblem : a dataset from an efficient data generator only captures a strictly easier subproblem . ( 2 ) Spurious features : due to the lack of completeness , the resulting dataset can be trivially solvable due to superficial/spurious features . These findings extrapolate to case ( b ) for a sufficiently sparse sample ( i.e . the data could have been generated by an efficient data generator ) . As a consequence , it is even more concerning that often the same ( potentially flawed or biased ) data generator is used for training and evaluation . At best , neural solvers are additionally evaluated on small independent datasets ( e.g . from benchmarks ) . We propose to study neural combinatorial optimization through the lens of adversarial robustness . It is a challenging generalization property that offers a way of fixing the too optimistic model performance estimates that are the result of evaluations on incomplete datasets . We illustrate in Fig . 1 how adversarial attacks practically address the aforementioned challenges for two relevant cases in neural combinatorial optimization : ( a ) to the left we discuss an incomplete , efficient data generator and ( b ) to the right we discuss a sparse sample of a potentially complete data generator . With a suitable choice of perturbation model , we ( a ) possibly extend the reachable space by an efficient data generator or ( b ) cover the space around each instance in the sparse dataset . In other words , such adversarial attacks aim to find the intersection of the uncovered regions and hard , model-specific samples . Therefore , it is possible to detect the described defects . Adversarial robustness more realistically evaluates a model ’ s generalization ability instead of simply testing on the same data generation procedure or a sparse external dataset . Adversarial robustness is a desirable property for neural combinatorial optimization , since , in contrast to general learning tasks , in combinatorial optimization we do not have an accuracy robustness trade-off in the sense of Suggala et al . ( 2019 ) . This means , there exists a model with high accuracy and high robustness . One key factor to avoid the accuracy robustness trade-off is choosing a perturbation model that guarantees the correct label of the perturbed sample ( we call them sound ) . This is in stark contrast to other domains where one relies on imperceptible/unnoticeable perturbations . We instantiate our adversarial attack framework for the NP-complete SAT and TSP . Nevertheless , most of the principles can be transferred to other combinatorial optimization problems . Note that often such problems can be even reduced onto one another , as is the case for e.g . SAT and the maximum independent set . Having said this , we select SAT because of its general applicability and the notoriously challenging TSP due to its practical importance ( e.g . for supply chain optimization ) . We then use our attacks to show that the evaluated neural SAT and TSP solvers are highly non-robust . Contributions . ( 1 ) We bring the study of adversarial robustness to the field of neural combinatorial solvers to tackle fundamental problems in the evaluation of neural solvers . ( 2 ) We propose perturbation models for SAT and TSP s.t . we efficiently determine the updated solution . ( 3 ) We show that the models for SAT and TSP can be easily fooled with small perturbations of the problem instance and ( 4 ) that adversarial training can improve the robustness and generalization . 2 BACKGROUND ON NEURAL SOLVERS . Intuitively , combinatorial optimization is the task of finding an optimal element from the finite set of possible solutions ( e.g . the truth assignment for a boolean statement ) . We formalize this as Y = arg minY ′∈g ( x ) c ( x , Y ′ ) where x is a problem instance , g ( x ) = Y the finite set of feasible solutions , and c ( · ) a cost function . Typically , there is also an associated binary decision problem y , such as finding the optimal route vs. checking whether a route of at most cost c0 exists ( see § 4 and § 5 ) . Then , for example , a neural solver ŷ = fθ ( x ) learns a mapping fθ : X → { 0 , 1 } to approximate the decision problem . In this work , θ are the parameters , x ∈ X is the problem instance , and ŷ ( or Ŷ ) the prediction . In case of supervised learning , we then optimize the parameters θ w.r.t . a loss ` ( fθ ( x ) , y ) over a finite set of labeled training instances ( x , y ) . However , to obtain the exact labels y for a given x is intractable for larger problem instances due to the exponential or worse runtime . The two important strategies are mentioned in the introduction and visualized in Fig . 1 : ( a ) an efficient but incomplete data generator ( b ) using a solver to obtain the labels for random samples . 3 ADVERSARIAL ROBUSTNESS . Adversarial robustness refers to the phenomenon that machine learning models can be fooled by small perturbations of the input instance ( Szegedy et al. , 2014 ) . We define an adversarial attack in Eq . 1 , where the parameters θ are constant and G denotes the perturbation model that describes the possible perturbed instances x̃ around the clean sample x ( i.e . the perturbation space ) given the original solution Y . We introduce the term h ( x̃ , x , Y ) since Ỹ 6= Y in the general case . ` adv , G ( x , Y ) = max x̃ ` ( fθ ( x̃ ) , Ỹ ) s.t . x̃ ∈ G ( x , Y ) ∧ Ỹ = h ( x̃ , x , Y ) ( 1 ) Sound and efficient perturbation model . Our framework for a neural combinatorial solver fθ stands out from many other works on adversarial robustness since we choose the perturbation model G s.t . we provably know a solution Ỹ = h ( x̃ , x , Y ) for all possible x̃ . We call such a perturbation model sound . This stands in contrast to other domains , where we usually hope to preserve the label using the subjective concept of imperceptible/unnoticable perturbations ( Szegedy et al. , 2014 ) . While we can naively obtain a sound perturbation model for combinatorial optimization using a solver , this is intractable for realistic problem sizes . We therefore propose to use perturbation models that are efficient and sound . That is , we can determine Ỹ without applying a solver on the perturbed instance x̃ . For example , if we add a node to a TSP instance , the optimal route including the new node will change , but we can efficiently determine Ỹ for the chosen G. Important technical details arise due to ( a ) the potentially non-unique Y and ( b ) non-constant Ỹ while perturbing the input . One way to handle both effects is through the choice of the loss ` . ( a ) We can deal with the ambiguity in Y if the loss is equal for any two optimal solutions/predictions . This can be achieved naturally through incorporating the cost c ( Y ) of the combinatorial optimization problem . ( b ) Since the solution Y can change throughout the optimization , it is important to choose a loss that assesses the difference between prediction fθ ( x̃ ) and ground truth Ỹ . For example , a viable loss for TSP is the optimality gap ` OG ( Ŷ , Y ) = |c ( Ŷ ) −c ( Y ) |/c ( Y ) ) that is normalized by c ( Y ) . Perturbation strength . With a sound perturbation model , all generated instances x̃ are valid problem instances regardless of how much they differ from x . Hence , in the context of combinatorial optimization , the perturbation strength/budget models the severity of a potential distribution shift between training data and test data . This again highlights the differences to other domains . For example in image classification with the common Lp perturbation model ‖x − x̃‖p ≤ r , the instance changes its true label or becomes meaningless ( e.g . a gray image ) for a large enough r. Generalization . Specifically , adversarial robustness is one way to measure the generalization over perturbed instances x̃ is in the proximity of x. Adversarial robustness is important in the context of neural combinatorial solvers since training and validation/test distribution differ from the actual data distribution p ( x ) . First , the data distribution p ( x ) is typically unknown and highly application-specific . Second , due to theoretical limitations of the data generation process the train and validation/test distribution only captures a simpler sub-problem likely suffering from spurious features ( Yehuda et al. , 2020 ) . Third , we ultimately desire a general-purpose solver that performs well regardless of p ( x ) ( in the limits of a polynomial approximation ) . We stress that in the context of combinatorial optimization , adversarial examples are neither anomalous nor statistical defects since all generated instances correspond to valid problem instances . In contrast to other domains , the set of valid problems is not just a low-dimensional manifold in a high-dimensional space . Thus , the so-called manifold hypothesis ( Stutz et al. , 2019 ) does not apply for combinatorial optimization . Or in other words , it is critical for neural solvers to perform well on adversarial examples when striving for generalization . Accuracy robustness trade-off . A trade-off between adversarial robustness and standard generalization was reported for many learning tasks ( Tsipras et al. , 2019 ) . That is , with increasing robustness the accuracy on the test data decreases . Interestingly , with a sound perturbation model and the purely deterministic labels in combinatorial optimization ( the solution is either optimal or not ) , no such trade-off exists . Hence , if the model was expressive enough and we had sufficient compute , there would exist a model with high accuracy and robustness ( see § A for more details ) . Adversarial training . In adversarial training , we leverage adversarially perturbed instances with the desire of training a robust model with improved generalization . For this , adversarial attacks reveal the regions that are both difficult for the model and not covered by training samples ( see Fig . 1 ) . Hence , adversarial training can be understood as a powerful data augmentation using hard modelspecific samples . Though it is not the main focus of this work , in § 6 , we show that adversarial training can be used to improve the robustness and generalization of a neural combinatorial solver . Remarks on decision problems . For the binary decision problems , we typically are not required to know Ỹ ; it suffices to know ỹ . Moreover , for such binary problems , we keep the solution constant y = ỹ . Nevertheless , there also exist practical perturbations that change decision the label . For example for SAT , we can add a set of clauses that are false in isolation which makes ỹ = 0 . Requirements for neural solvers . We study neural combinatorial solvers fθ that are often a Graph Neural Network ( GNN ) . We then solve Eq . 1 using different variants of Projected Gradient Descent ( PGD ) and therefore assume the model to be differentiable w.r.t . its inputs ( see § D ) . For nondifferentiable models , one can use derivative-free optimization ( Yang & Long , 2021 ) . | In this paper, the authors propose to evaluate and improve the robustness and generalization of neural combinatorial solvers with adversarial examples, that is, perturbed inputs that fool the neural network to generate outputs with high loss. The authors claim that their proposal reconciles the tension between the hardness results from Yehuda et. al. (2020) and the overly-optimistic evaluation results from previous work. Furthermore, they instantiate their proposal with two classic combinatorial problems -- SAT and TSP, where adversarial examples are generated without the need to run potentially exponential-time solvers. They show that adversarial examples not only expose the fragility of common neural solvers, but can also help improve their generalization and robustness via adversarial training. | SP:c0a87b8792e2ec4144737c3b48439aebe4f9f915 |
Generalization of Neural Combinatorial Solvers Through the Lens of Adversarial Robustness | 1 INTRODUCTION . Combinatorial Optimization covers some of the oldest and most studied computational problems . Well-known examples are the study of the NP-complete SATisfiability problem for boolean statements or the Traveling Salesperson Problem ( TSP ) . Today , these problems can be solved efficiently with approximate solvers that have been crafted over the previous decades ( Festa , 2014 ) . As an alternative to engineered , application-specific heuristics , learning seems to be a good candidate ( Bengio et al. , 2021 ) and was studied as a component in traditional solvers ( e.g . Haim & Walsh ( 2009 ) ; Singh et al . ( 2009 ) ) . Recently , end-to-end deep learning for NP-hard combinatorial optimization has gained attention , triggered by the widespread success of ( geometric ) deep learning . Nevertheless , it is still an open question if and to what extent end-to-end deep learning can effectively and efficiently approximate such NP-hard combinatorial optimization problems . Moreover , there is a “ Catch-22 “ ; even if neural networks could approximate the solutions for NP-hard problems , generating the training data is either ( a ) incomplete but efficient or ( b ) complete but inefficient/approximate . An incomplete data generator ( a ) crafts the problem instances s.t . their labels are know and a complete data generator ( b ) solves the NP-hard problem instances to obtain the labels . Moreover , regardless of case ( a ) or ( b ) , it is intractable to obtain a dense sample even for moderate problem sizes due to the large problem space . For the special case of ( a ) exact polynomial-time data-generators , Yehuda et al . ( 2020 ) detail two challenges as a result of the NP-hardness : ( 1 ) Easier subproblem : a dataset from an efficient data generator only captures a strictly easier subproblem . ( 2 ) Spurious features : due to the lack of completeness , the resulting dataset can be trivially solvable due to superficial/spurious features . These findings extrapolate to case ( b ) for a sufficiently sparse sample ( i.e . the data could have been generated by an efficient data generator ) . As a consequence , it is even more concerning that often the same ( potentially flawed or biased ) data generator is used for training and evaluation . At best , neural solvers are additionally evaluated on small independent datasets ( e.g . from benchmarks ) . We propose to study neural combinatorial optimization through the lens of adversarial robustness . It is a challenging generalization property that offers a way of fixing the too optimistic model performance estimates that are the result of evaluations on incomplete datasets . We illustrate in Fig . 1 how adversarial attacks practically address the aforementioned challenges for two relevant cases in neural combinatorial optimization : ( a ) to the left we discuss an incomplete , efficient data generator and ( b ) to the right we discuss a sparse sample of a potentially complete data generator . With a suitable choice of perturbation model , we ( a ) possibly extend the reachable space by an efficient data generator or ( b ) cover the space around each instance in the sparse dataset . In other words , such adversarial attacks aim to find the intersection of the uncovered regions and hard , model-specific samples . Therefore , it is possible to detect the described defects . Adversarial robustness more realistically evaluates a model ’ s generalization ability instead of simply testing on the same data generation procedure or a sparse external dataset . Adversarial robustness is a desirable property for neural combinatorial optimization , since , in contrast to general learning tasks , in combinatorial optimization we do not have an accuracy robustness trade-off in the sense of Suggala et al . ( 2019 ) . This means , there exists a model with high accuracy and high robustness . One key factor to avoid the accuracy robustness trade-off is choosing a perturbation model that guarantees the correct label of the perturbed sample ( we call them sound ) . This is in stark contrast to other domains where one relies on imperceptible/unnoticeable perturbations . We instantiate our adversarial attack framework for the NP-complete SAT and TSP . Nevertheless , most of the principles can be transferred to other combinatorial optimization problems . Note that often such problems can be even reduced onto one another , as is the case for e.g . SAT and the maximum independent set . Having said this , we select SAT because of its general applicability and the notoriously challenging TSP due to its practical importance ( e.g . for supply chain optimization ) . We then use our attacks to show that the evaluated neural SAT and TSP solvers are highly non-robust . Contributions . ( 1 ) We bring the study of adversarial robustness to the field of neural combinatorial solvers to tackle fundamental problems in the evaluation of neural solvers . ( 2 ) We propose perturbation models for SAT and TSP s.t . we efficiently determine the updated solution . ( 3 ) We show that the models for SAT and TSP can be easily fooled with small perturbations of the problem instance and ( 4 ) that adversarial training can improve the robustness and generalization . 2 BACKGROUND ON NEURAL SOLVERS . Intuitively , combinatorial optimization is the task of finding an optimal element from the finite set of possible solutions ( e.g . the truth assignment for a boolean statement ) . We formalize this as Y = arg minY ′∈g ( x ) c ( x , Y ′ ) where x is a problem instance , g ( x ) = Y the finite set of feasible solutions , and c ( · ) a cost function . Typically , there is also an associated binary decision problem y , such as finding the optimal route vs. checking whether a route of at most cost c0 exists ( see § 4 and § 5 ) . Then , for example , a neural solver ŷ = fθ ( x ) learns a mapping fθ : X → { 0 , 1 } to approximate the decision problem . In this work , θ are the parameters , x ∈ X is the problem instance , and ŷ ( or Ŷ ) the prediction . In case of supervised learning , we then optimize the parameters θ w.r.t . a loss ` ( fθ ( x ) , y ) over a finite set of labeled training instances ( x , y ) . However , to obtain the exact labels y for a given x is intractable for larger problem instances due to the exponential or worse runtime . The two important strategies are mentioned in the introduction and visualized in Fig . 1 : ( a ) an efficient but incomplete data generator ( b ) using a solver to obtain the labels for random samples . 3 ADVERSARIAL ROBUSTNESS . Adversarial robustness refers to the phenomenon that machine learning models can be fooled by small perturbations of the input instance ( Szegedy et al. , 2014 ) . We define an adversarial attack in Eq . 1 , where the parameters θ are constant and G denotes the perturbation model that describes the possible perturbed instances x̃ around the clean sample x ( i.e . the perturbation space ) given the original solution Y . We introduce the term h ( x̃ , x , Y ) since Ỹ 6= Y in the general case . ` adv , G ( x , Y ) = max x̃ ` ( fθ ( x̃ ) , Ỹ ) s.t . x̃ ∈ G ( x , Y ) ∧ Ỹ = h ( x̃ , x , Y ) ( 1 ) Sound and efficient perturbation model . Our framework for a neural combinatorial solver fθ stands out from many other works on adversarial robustness since we choose the perturbation model G s.t . we provably know a solution Ỹ = h ( x̃ , x , Y ) for all possible x̃ . We call such a perturbation model sound . This stands in contrast to other domains , where we usually hope to preserve the label using the subjective concept of imperceptible/unnoticable perturbations ( Szegedy et al. , 2014 ) . While we can naively obtain a sound perturbation model for combinatorial optimization using a solver , this is intractable for realistic problem sizes . We therefore propose to use perturbation models that are efficient and sound . That is , we can determine Ỹ without applying a solver on the perturbed instance x̃ . For example , if we add a node to a TSP instance , the optimal route including the new node will change , but we can efficiently determine Ỹ for the chosen G. Important technical details arise due to ( a ) the potentially non-unique Y and ( b ) non-constant Ỹ while perturbing the input . One way to handle both effects is through the choice of the loss ` . ( a ) We can deal with the ambiguity in Y if the loss is equal for any two optimal solutions/predictions . This can be achieved naturally through incorporating the cost c ( Y ) of the combinatorial optimization problem . ( b ) Since the solution Y can change throughout the optimization , it is important to choose a loss that assesses the difference between prediction fθ ( x̃ ) and ground truth Ỹ . For example , a viable loss for TSP is the optimality gap ` OG ( Ŷ , Y ) = |c ( Ŷ ) −c ( Y ) |/c ( Y ) ) that is normalized by c ( Y ) . Perturbation strength . With a sound perturbation model , all generated instances x̃ are valid problem instances regardless of how much they differ from x . Hence , in the context of combinatorial optimization , the perturbation strength/budget models the severity of a potential distribution shift between training data and test data . This again highlights the differences to other domains . For example in image classification with the common Lp perturbation model ‖x − x̃‖p ≤ r , the instance changes its true label or becomes meaningless ( e.g . a gray image ) for a large enough r. Generalization . Specifically , adversarial robustness is one way to measure the generalization over perturbed instances x̃ is in the proximity of x. Adversarial robustness is important in the context of neural combinatorial solvers since training and validation/test distribution differ from the actual data distribution p ( x ) . First , the data distribution p ( x ) is typically unknown and highly application-specific . Second , due to theoretical limitations of the data generation process the train and validation/test distribution only captures a simpler sub-problem likely suffering from spurious features ( Yehuda et al. , 2020 ) . Third , we ultimately desire a general-purpose solver that performs well regardless of p ( x ) ( in the limits of a polynomial approximation ) . We stress that in the context of combinatorial optimization , adversarial examples are neither anomalous nor statistical defects since all generated instances correspond to valid problem instances . In contrast to other domains , the set of valid problems is not just a low-dimensional manifold in a high-dimensional space . Thus , the so-called manifold hypothesis ( Stutz et al. , 2019 ) does not apply for combinatorial optimization . Or in other words , it is critical for neural solvers to perform well on adversarial examples when striving for generalization . Accuracy robustness trade-off . A trade-off between adversarial robustness and standard generalization was reported for many learning tasks ( Tsipras et al. , 2019 ) . That is , with increasing robustness the accuracy on the test data decreases . Interestingly , with a sound perturbation model and the purely deterministic labels in combinatorial optimization ( the solution is either optimal or not ) , no such trade-off exists . Hence , if the model was expressive enough and we had sufficient compute , there would exist a model with high accuracy and robustness ( see § A for more details ) . Adversarial training . In adversarial training , we leverage adversarially perturbed instances with the desire of training a robust model with improved generalization . For this , adversarial attacks reveal the regions that are both difficult for the model and not covered by training samples ( see Fig . 1 ) . Hence , adversarial training can be understood as a powerful data augmentation using hard modelspecific samples . Though it is not the main focus of this work , in § 6 , we show that adversarial training can be used to improve the robustness and generalization of a neural combinatorial solver . Remarks on decision problems . For the binary decision problems , we typically are not required to know Ỹ ; it suffices to know ỹ . Moreover , for such binary problems , we keep the solution constant y = ỹ . Nevertheless , there also exist practical perturbations that change decision the label . For example for SAT , we can add a set of clauses that are false in isolation which makes ỹ = 0 . Requirements for neural solvers . We study neural combinatorial solvers fθ that are often a Graph Neural Network ( GNN ) . We then solve Eq . 1 using different variants of Projected Gradient Descent ( PGD ) and therefore assume the model to be differentiable w.r.t . its inputs ( see § D ) . For nondifferentiable models , one can use derivative-free optimization ( Yang & Long , 2021 ) . | Motivated by the emergence and fast development of the area of neural optimisation solvers having been proposed for a vast number of combinatorial problems, this paper is devoted to studying the adversarial robustness of such solvers. In particular, given the intractability of the target combinatorial problems, the paper proposes to evaluate neural solvers based on adversarial robustness. As an example, the authors aim at perturbing SAT and TSP problems and evaluating the robustness of the corresponding state-of-the-art neural solvers on the perturbed problem instances. The paper shows that the existing solvers are susceptible to adversarial attacks. Moreover, the paper claims that the issue may be alleviated if additional training of the solvers is performed on the perturbed instances. | SP:c0a87b8792e2ec4144737c3b48439aebe4f9f915 |
ClimateGAN: Raising Climate Change Awareness by Generating Images of Floods | 1 INTRODUCTION . Climate change is a serious danger to our planet , with warming temperatures causing extreme weather events that affect the livelihood of an increasing number of people globally ( HoeghGuldberg et al. , 2018 ) . In particular , rising sea levels , increasing precipitation and faster snow melt exacerbate extreme floods , presenting a major risk to populations worldwide ( Dottori et al. , 2016 ) . One common barrier to climate action and behavioral change is distancing , a psychological phenomenon resulting in climate change being perceived as temporally and spatially distant and uncertain . Previous research has shown that showing or simulating first-person perspectives of climate change-related extreme weather events can contribute to reducing distancing ( Chapman et al. , 2016 ; Sevillano et al. , 2007 ) . Digital technologies are increasingly used for this purpose ( Herring et al. , 2017 ; Ahn et al. , 2014 ) , but they often target specific regions or render manually their effects . In this context , we have developed ClimateGAN , which can generate extreme flooding based on arbitrary street-level scenes , such as Google Street View images . We generate floods of 1 m , which is consistent with the definition of ” extreme flooding ” in the literature ( Kulp & Strauss , 2019 ) , and we divide the task of flooding into two parts : a Masker model to predict which pixel locations of a given image would be under water if a flood occurred , and a Painter model to generate contextualized water textures conditioned on both the input and the Masker ’ s prediction . Our contributions are : proposing and motivating the novel task of street-level flood generation , a data set of pairs of images with/without flooding from a virtual world , the ClimateGAN model which includes a novel multitask architecture for generating geometry- and semantics-informed binary masks and a procedure to thoroughly evaluate it in the absence of ground-truth data . We also compare our model to existing generative modeling frameworks and provide an ablation study of the components of our model . 2 RELATED WORK . While the task of generating extreme flooding in street-level images is novel , related work has been carried out in applying Deep Learning for flood segmentation ( Sazara et al. , 2019 ) and flood depth estimation ( Kharazi & Behzadan , 2021 ) . Generative modeling has also been used for transferring weather conditions on street scenes using both imagery ( Li et al. , 2021 ) and semantic maps ( Wenzel et al. , 2018 ) . For the purposes of our task and given its unique constraints , we frame our approach in the context of image-to-image translation , involving conditional image synthesis and domain adaptation . We present relevant related work from these three areas in the sections below . Image-to-image translation ( IIT ) is a computer vision task whose goal is to map a given image from one domain to another ( Liu et al. , 2017 ) . IIT approaches can either carry out the translation on the entire input image or utilize masks to guide the translation task . In the first case , initial IIT approaches relied on the existence of two aligned domains such as photographs and sketches of the same objects . CycleGAN ( Zhu et al. , 2017 ) this constraint , allowing the domains to remain unaligned , and further progress was made by architectures such as MUNIT ( Huang et al. , 2018 ) and CUT ( Park et al. , 2020 ) . The second category of IIT focuses the translation process on particular input image areas , typically by leveraging attention or segmentation masks . This more closely resembles our case , as we aim to flood only part of the image . Notable examples of this category include Attention-Guided GANs ( Tang et al. , 2019 ) and InstaGAN ( Mo et al. , 2019 ) which uses instance-level semantic masks to guide the translation process . Conditional image synthesis differs from IIT in that the input can be a label , text or a segmentation map , instead of another image ( Mirza & Osindero , 2014 ) . One approach from this category that is particularly relevant to our work is SPADE ( Park et al. , 2019 ) , a module that enables the transformation of a semantic layout—such as that of a street scene or landscape—into an image that semantically matches this layout . The idea behind SPADE is to create residual blocks where the input is first normalized and then denormalized in a spatially relevant way by small convolutional networks , functions of spatial conditioning variables . This approach also introduced the GauGAN generator , which leverages SPADE blocks to learn a spatially-adaptive transformation , enabling the synthesis of realistic images based on the input maps . Domain adaptation aims at transferring knowledge from one domain to another using different data sources ( Ganin & Lempitsky , 2015 ) . This can be particularly useful in tasks where more ( labeled ) data is available from a simulated world than in the real world , like in our case . Domain adaptation techniques can then be used to bridge the distributional gap between real and simulated scenes , learning useful tasks such as semantic segmentation and depth prediction , which function both in real and simulated scenarios . Examples of domain adaptation approaches that adopt these techniques include : CYCADA ( Hoffman et al. , 2018 ) , which leverages cycle-consistency constraints similar to those proposed by CycleGAN to improve domain adaptation , ADVENT ( Vu et al. , 2019a ) , which uses Adversarial Entropy Minimization to achieve high performance in unsupervised domain adaptation for semantic segmentation , and Depth-aware Domain Adaptation ( DADA ) ( Vu et al. , 2019b ) , which improves on ADVENT by leveraging dense depth maps . 3 CREATING IMAGES OF FLOODS . Our task of generating flooding resembles that of unsupervised image-to-image translation . However , this framework poses two major problems : first , the translation needs to be restricted to the portion of the image that would contain water , which advises against approaches which alter the im- age globally . Second , we are only concerned with adding water and not the reverse , which eliminates the need for cycle-consistent approaches . Therefore , in order to undertake this task , we developed a novel conditional image synthesis approach that consists of two models : a Masker that produces a binary mask of where water would plausibly go in the case of a flood , and a Painter that renders realistic water given a mask and an image . We provide an overview of this procedure in Fig . 2 , and detail the individual components in the remainder of this section . 3.1 DATA . Real Data First-person images of floods are scarce ; moreover , even when such pictures exist , it is exceedingly rare to find the corresponding image of the same location before and after flooding . We therefore pursued several alternate approaches for gathering real flooded street-level images , spanning from web-scraping to creating a website and a mobile app to collect crowd-sourced images . We complemented flooded images with images without floods , i.e . of normal streets and houses . We aimed to cover a broad scope of geographical regions and types of scenery : urban , suburban and rural , with an emphasis on images from the Cityscapes Cordts et al . ( 2016 ) and Mapillary Neuhold et al . ( 2017 ) data sets . We collected a total of 6740 images : 5540 non-flooded scenes to train the Masker , and 1200 flooded images to train the Painter . Simulated Data Besides the lack of paired data , another limitation of real-world images is that they do not contain scene geometry annotations and semantic segmentation labels , which we want to leverage during model training . To solve both of these problems , we created a 1.5 km2 virtual world using the Unity3D game engine . To be as realistic as possible , it contains urban , suburban and rural areas , which we flooded with 1m of water to gather ‘ with ’ and ‘ without ’ pairs ( see A ) . For each pair of images obtained , we also captured the corresponding depth map and semantic segmentation layout of the scene . In the end , we gathered approximately 20000 images from 2000 different viewpoints in the simulated world , which we used to train the Masker . We make this data set publicly available1 to enable further research . 3.2 MASKER . To leverage the information available in the simulated domain and transfer performance to real data , we adapted DADA ( Vu et al. , 2019b ) to train the Masker . The main objective of this procedure is to inform segmentation with depth . A naive use of DADA for our task would miss a crucial difference : the Masker produces information about what could be in an image , not what is present in it . The core contribution of our Masker ’ s architecture is therefore to structure it as a multi-headed network with depth and segmentation decoders to learn what is present in the current scene , then conditioning the flood mask decoder on this information ( and the input image ) to predict where water could be . In the following section , subscripts s and r respectively identify the simulated and real domains ; we use i ∈ { r , s } to refer to an arbitrary domain . E is an encoder network while D , S and M , are the depth , segmentation and flood mask decoders , respectively , as per Fig . 2 . To guide decoders in the early training stages , we used pseudo labels as supervision targets for real data . In other words , we considered predictions of ad hoc pretrained models as ground truth . However , because those labels are noisy , we limited that procedure to the beginning of training . Depth decoder We consider depth in the disparity space , and predict the normalized inverse depth di = D ( E ( xi ) ) from an input image xi . We used the scale-invariant loss from MiDaS ( Lasinger et al. , 2019 ) , which is composed of a scale and shift-invariant MSE loss term LSSIMSE and a gradient matching term LGM . We used the following targets to compute this loss : ground-truth depth maps for simulated input images and pseudo labels inferred from the MiDaS v2.1 model for real input images . The complete depth loss is : LDepth = λ1LSSIMSE + λ2LGM . ( 1 ) Segmentation decoder The segmentation decoder S is implemented such that S ◦E corresponds to the DeepLabv3+ architecture ( Chen et al. , 2018 ) . It is trained as described in DADA , leveraging 1URL hidden for peer-review depth information available in the simulated world to improve segmentation predictions by giving more attention to closer objects , producing si = S ( E ( xi ) , di ) . Two fusion mechanisms encourage this : feature fusion , which multiplies element-wise the latent vector zi = E ( xi ) by a depth vector obtained from the depth decoder , and DADA fusion , which multiplies the self-information map ( Vu et al. , 2019a ) I ( si ) = −si · log si element-wise with the depth predictions di to obtain the depthaware self-information map Î ( si ) = I ( si ) di . In addition to DADA we used pseudo labels inferred from a pre-trained segmentation model in the real domain . The rest of the training of S is however similar to DADA : 1/ to encourage real domain predictions to be confident and reduce the gap with simulated predictions an entropy minimization ( EM ) term LEM ( sr ) is added and 2/ the domain gap between the distributions of real and simulated self-information maps is shrunk using WGAN-based adversarial training ( Arjovsky et al. , 2017 ) . LSeg = λ3LCE + λ4LEM + λ5LWGAN . ( 2 ) Flood mask decoder This decoder is structured to be conditioned not only on the input image , but also on predictions di and si from other decoders . To implement this dependence , we propose a new use of SPADE ( Park et al. , 2019 ) conditional blocks . In our case , for an input xi , the conditioning variable is therefore U i = [ xi , di , si ] , where the tensors are concatenated along the channel axis . The mask mi = M ( zi , U i ) and its self-information map I ( mi ) are computed from the latent representation zi = E ( xi ) . We also implemented a total variation ( TV ) loss on the mask mi for both domains in order to encourage the predictions to be smooth , ensuring that neighboring pixels have similar values ( Johnson et al. , 2016 ) —note that ∆ is the spatial difference of the image mesh : LTV ( mi ) = En , h , w [ ( ∆hmi ) 2 + ( ∆wmi ) 2 ] . ( 3 ) In the simulated domain , we used a binary cross-entropy loss LBCE ( yms , ms ) with the groundtruth mask yms . In the real domain , absent of any ground truth , we encouraged the predicted flood mask mr to at least encompass the ground by introducing a ground intersection ( GI ) loss , penalizing masks that assign a low probability to locations where a pre-trained model detected ground gr : LGI ( gr , mr ) = En , h , w [ 1 ( gr−mr ) > 0.5 ] . ( 4 ) As per the DADA approach , we also added an entropy minimization loss to increase the mask decoder ’ s confidence in its real domain predictions : LEM ( mr ) = En , c , h , w [ −mr logmr ] . ( 5 ) Lastly , similarly to the segmentation decoder , we adversarially trained the flood mask decoder with a WGAN loss LWGAN to produce self-information maps Î ( mi ) indistinguishable by a discriminator . M ’ s total loss is a weighted sum of all of the above losses : LMask = λ6LTV + λ7LGI + λ8LBCE + λ9LEM + λ10LWGAN . ( 6 ) The Masker ’ s final loss sums the losses of the three decoders : LMasker = LDepth+LSeg+LMask . | In this paper, the authors introduce ClimateGAN, a framework for the generation of images of flooded scenarios in order to raise climate change awareness and prompt action. In particular, the authors consider the realistic case of scarcity of training data and propose and unsupervised approach. An evaluation of each ClimateGAN components is performed, both quantitative (through metrics) and qualitative (through human feedback). ClimateGAN is also compared against other generative modeling frameworks. | SP:10884b56b4745dacc61afa80933661fd3786a4cc |
ClimateGAN: Raising Climate Change Awareness by Generating Images of Floods | 1 INTRODUCTION . Climate change is a serious danger to our planet , with warming temperatures causing extreme weather events that affect the livelihood of an increasing number of people globally ( HoeghGuldberg et al. , 2018 ) . In particular , rising sea levels , increasing precipitation and faster snow melt exacerbate extreme floods , presenting a major risk to populations worldwide ( Dottori et al. , 2016 ) . One common barrier to climate action and behavioral change is distancing , a psychological phenomenon resulting in climate change being perceived as temporally and spatially distant and uncertain . Previous research has shown that showing or simulating first-person perspectives of climate change-related extreme weather events can contribute to reducing distancing ( Chapman et al. , 2016 ; Sevillano et al. , 2007 ) . Digital technologies are increasingly used for this purpose ( Herring et al. , 2017 ; Ahn et al. , 2014 ) , but they often target specific regions or render manually their effects . In this context , we have developed ClimateGAN , which can generate extreme flooding based on arbitrary street-level scenes , such as Google Street View images . We generate floods of 1 m , which is consistent with the definition of ” extreme flooding ” in the literature ( Kulp & Strauss , 2019 ) , and we divide the task of flooding into two parts : a Masker model to predict which pixel locations of a given image would be under water if a flood occurred , and a Painter model to generate contextualized water textures conditioned on both the input and the Masker ’ s prediction . Our contributions are : proposing and motivating the novel task of street-level flood generation , a data set of pairs of images with/without flooding from a virtual world , the ClimateGAN model which includes a novel multitask architecture for generating geometry- and semantics-informed binary masks and a procedure to thoroughly evaluate it in the absence of ground-truth data . We also compare our model to existing generative modeling frameworks and provide an ablation study of the components of our model . 2 RELATED WORK . While the task of generating extreme flooding in street-level images is novel , related work has been carried out in applying Deep Learning for flood segmentation ( Sazara et al. , 2019 ) and flood depth estimation ( Kharazi & Behzadan , 2021 ) . Generative modeling has also been used for transferring weather conditions on street scenes using both imagery ( Li et al. , 2021 ) and semantic maps ( Wenzel et al. , 2018 ) . For the purposes of our task and given its unique constraints , we frame our approach in the context of image-to-image translation , involving conditional image synthesis and domain adaptation . We present relevant related work from these three areas in the sections below . Image-to-image translation ( IIT ) is a computer vision task whose goal is to map a given image from one domain to another ( Liu et al. , 2017 ) . IIT approaches can either carry out the translation on the entire input image or utilize masks to guide the translation task . In the first case , initial IIT approaches relied on the existence of two aligned domains such as photographs and sketches of the same objects . CycleGAN ( Zhu et al. , 2017 ) this constraint , allowing the domains to remain unaligned , and further progress was made by architectures such as MUNIT ( Huang et al. , 2018 ) and CUT ( Park et al. , 2020 ) . The second category of IIT focuses the translation process on particular input image areas , typically by leveraging attention or segmentation masks . This more closely resembles our case , as we aim to flood only part of the image . Notable examples of this category include Attention-Guided GANs ( Tang et al. , 2019 ) and InstaGAN ( Mo et al. , 2019 ) which uses instance-level semantic masks to guide the translation process . Conditional image synthesis differs from IIT in that the input can be a label , text or a segmentation map , instead of another image ( Mirza & Osindero , 2014 ) . One approach from this category that is particularly relevant to our work is SPADE ( Park et al. , 2019 ) , a module that enables the transformation of a semantic layout—such as that of a street scene or landscape—into an image that semantically matches this layout . The idea behind SPADE is to create residual blocks where the input is first normalized and then denormalized in a spatially relevant way by small convolutional networks , functions of spatial conditioning variables . This approach also introduced the GauGAN generator , which leverages SPADE blocks to learn a spatially-adaptive transformation , enabling the synthesis of realistic images based on the input maps . Domain adaptation aims at transferring knowledge from one domain to another using different data sources ( Ganin & Lempitsky , 2015 ) . This can be particularly useful in tasks where more ( labeled ) data is available from a simulated world than in the real world , like in our case . Domain adaptation techniques can then be used to bridge the distributional gap between real and simulated scenes , learning useful tasks such as semantic segmentation and depth prediction , which function both in real and simulated scenarios . Examples of domain adaptation approaches that adopt these techniques include : CYCADA ( Hoffman et al. , 2018 ) , which leverages cycle-consistency constraints similar to those proposed by CycleGAN to improve domain adaptation , ADVENT ( Vu et al. , 2019a ) , which uses Adversarial Entropy Minimization to achieve high performance in unsupervised domain adaptation for semantic segmentation , and Depth-aware Domain Adaptation ( DADA ) ( Vu et al. , 2019b ) , which improves on ADVENT by leveraging dense depth maps . 3 CREATING IMAGES OF FLOODS . Our task of generating flooding resembles that of unsupervised image-to-image translation . However , this framework poses two major problems : first , the translation needs to be restricted to the portion of the image that would contain water , which advises against approaches which alter the im- age globally . Second , we are only concerned with adding water and not the reverse , which eliminates the need for cycle-consistent approaches . Therefore , in order to undertake this task , we developed a novel conditional image synthesis approach that consists of two models : a Masker that produces a binary mask of where water would plausibly go in the case of a flood , and a Painter that renders realistic water given a mask and an image . We provide an overview of this procedure in Fig . 2 , and detail the individual components in the remainder of this section . 3.1 DATA . Real Data First-person images of floods are scarce ; moreover , even when such pictures exist , it is exceedingly rare to find the corresponding image of the same location before and after flooding . We therefore pursued several alternate approaches for gathering real flooded street-level images , spanning from web-scraping to creating a website and a mobile app to collect crowd-sourced images . We complemented flooded images with images without floods , i.e . of normal streets and houses . We aimed to cover a broad scope of geographical regions and types of scenery : urban , suburban and rural , with an emphasis on images from the Cityscapes Cordts et al . ( 2016 ) and Mapillary Neuhold et al . ( 2017 ) data sets . We collected a total of 6740 images : 5540 non-flooded scenes to train the Masker , and 1200 flooded images to train the Painter . Simulated Data Besides the lack of paired data , another limitation of real-world images is that they do not contain scene geometry annotations and semantic segmentation labels , which we want to leverage during model training . To solve both of these problems , we created a 1.5 km2 virtual world using the Unity3D game engine . To be as realistic as possible , it contains urban , suburban and rural areas , which we flooded with 1m of water to gather ‘ with ’ and ‘ without ’ pairs ( see A ) . For each pair of images obtained , we also captured the corresponding depth map and semantic segmentation layout of the scene . In the end , we gathered approximately 20000 images from 2000 different viewpoints in the simulated world , which we used to train the Masker . We make this data set publicly available1 to enable further research . 3.2 MASKER . To leverage the information available in the simulated domain and transfer performance to real data , we adapted DADA ( Vu et al. , 2019b ) to train the Masker . The main objective of this procedure is to inform segmentation with depth . A naive use of DADA for our task would miss a crucial difference : the Masker produces information about what could be in an image , not what is present in it . The core contribution of our Masker ’ s architecture is therefore to structure it as a multi-headed network with depth and segmentation decoders to learn what is present in the current scene , then conditioning the flood mask decoder on this information ( and the input image ) to predict where water could be . In the following section , subscripts s and r respectively identify the simulated and real domains ; we use i ∈ { r , s } to refer to an arbitrary domain . E is an encoder network while D , S and M , are the depth , segmentation and flood mask decoders , respectively , as per Fig . 2 . To guide decoders in the early training stages , we used pseudo labels as supervision targets for real data . In other words , we considered predictions of ad hoc pretrained models as ground truth . However , because those labels are noisy , we limited that procedure to the beginning of training . Depth decoder We consider depth in the disparity space , and predict the normalized inverse depth di = D ( E ( xi ) ) from an input image xi . We used the scale-invariant loss from MiDaS ( Lasinger et al. , 2019 ) , which is composed of a scale and shift-invariant MSE loss term LSSIMSE and a gradient matching term LGM . We used the following targets to compute this loss : ground-truth depth maps for simulated input images and pseudo labels inferred from the MiDaS v2.1 model for real input images . The complete depth loss is : LDepth = λ1LSSIMSE + λ2LGM . ( 1 ) Segmentation decoder The segmentation decoder S is implemented such that S ◦E corresponds to the DeepLabv3+ architecture ( Chen et al. , 2018 ) . It is trained as described in DADA , leveraging 1URL hidden for peer-review depth information available in the simulated world to improve segmentation predictions by giving more attention to closer objects , producing si = S ( E ( xi ) , di ) . Two fusion mechanisms encourage this : feature fusion , which multiplies element-wise the latent vector zi = E ( xi ) by a depth vector obtained from the depth decoder , and DADA fusion , which multiplies the self-information map ( Vu et al. , 2019a ) I ( si ) = −si · log si element-wise with the depth predictions di to obtain the depthaware self-information map Î ( si ) = I ( si ) di . In addition to DADA we used pseudo labels inferred from a pre-trained segmentation model in the real domain . The rest of the training of S is however similar to DADA : 1/ to encourage real domain predictions to be confident and reduce the gap with simulated predictions an entropy minimization ( EM ) term LEM ( sr ) is added and 2/ the domain gap between the distributions of real and simulated self-information maps is shrunk using WGAN-based adversarial training ( Arjovsky et al. , 2017 ) . LSeg = λ3LCE + λ4LEM + λ5LWGAN . ( 2 ) Flood mask decoder This decoder is structured to be conditioned not only on the input image , but also on predictions di and si from other decoders . To implement this dependence , we propose a new use of SPADE ( Park et al. , 2019 ) conditional blocks . In our case , for an input xi , the conditioning variable is therefore U i = [ xi , di , si ] , where the tensors are concatenated along the channel axis . The mask mi = M ( zi , U i ) and its self-information map I ( mi ) are computed from the latent representation zi = E ( xi ) . We also implemented a total variation ( TV ) loss on the mask mi for both domains in order to encourage the predictions to be smooth , ensuring that neighboring pixels have similar values ( Johnson et al. , 2016 ) —note that ∆ is the spatial difference of the image mesh : LTV ( mi ) = En , h , w [ ( ∆hmi ) 2 + ( ∆wmi ) 2 ] . ( 3 ) In the simulated domain , we used a binary cross-entropy loss LBCE ( yms , ms ) with the groundtruth mask yms . In the real domain , absent of any ground truth , we encouraged the predicted flood mask mr to at least encompass the ground by introducing a ground intersection ( GI ) loss , penalizing masks that assign a low probability to locations where a pre-trained model detected ground gr : LGI ( gr , mr ) = En , h , w [ 1 ( gr−mr ) > 0.5 ] . ( 4 ) As per the DADA approach , we also added an entropy minimization loss to increase the mask decoder ’ s confidence in its real domain predictions : LEM ( mr ) = En , c , h , w [ −mr logmr ] . ( 5 ) Lastly , similarly to the segmentation decoder , we adversarially trained the flood mask decoder with a WGAN loss LWGAN to produce self-information maps Î ( mi ) indistinguishable by a discriminator . M ’ s total loss is a weighted sum of all of the above losses : LMask = λ6LTV + λ7LGI + λ8LBCE + λ9LEM + λ10LWGAN . ( 6 ) The Masker ’ s final loss sums the losses of the three decoders : LMasker = LDepth+LSeg+LMask . | This paper proposes to generate images of floods, that is, simulate photo-realistic floods, with a model named ClimateGAN, which consists of a Masker to generate masks for floods and a Painter to draw floods on images. The proposed ClimateGAN is a two-stage solution for generating flood masks on input images and painting the images with floods respectively, and each stage (Masker and Painter) is designed based on many popular related techniques, like DADA for depth-aware semantic segmentation, SPADE for injecting extra information into cGANs, and WGAN as well as TV, BCE and EM losses. For training ClimateGAN, this work also collects a real dataset with street-level floods and generates a simulated dataset using Unity3D. The outputs of Masker and Painter are evaluated separately compared to several previous image-to-image translation methods, also the ablation study is conducted to validate the effectiveness of each component in ClimateGAN. | SP:10884b56b4745dacc61afa80933661fd3786a4cc |
Sparse Attention with Learning to Hash | 1 INTRODUCTION . The Transformer architecture ( Vaswani et al. , 2017 ) has been successfully applied to various tasks , including natural language processing ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ; Dai et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ) , computer vision ( Carion et al. , 2020 ; Dosovitskiy et al. , 2020 ) , and time series forecasting ( Zhou et al. , 2020 ; Wu et al. , 2021 ) . Such a success is mainly due to the self-attention component , which enables each token to directly interact with any other tokens in the entire sequence . But self-attention has a quadratic time and space complexity with respect to the sequence length and hence does not scale efficiently to long sequences as a result . To address this inefficiency problem , one of the solutions is to approximate the full attention matrix with a sparse one , as the softmax operation is dominated by the largest elements . Some recent efforts focus on dynamic learning of sparse attention patterns via Approximate Nearest Neighbors ( ANN ) approaches , including Locality Sensitive Hashing ( LSH ) ( Kitaev et al. , 2020 ; Daras et al. , 2020 ) and mini-batch spherical k-means ( Roy et al. , 2021 ; Wang et al. , 2020a ) . The queries and keys are hashed or clustered into different buckets , hoping that the queries and keys in the same bucket are similar with a high probability . The effectiveness of those ANN approaches rely on the assumption that the ( transformed ) query and key vectors should lie in the same space , which could be sub-optimal in dealing with different sparsity patterns , as analyzed in this paper ( Section 3.2 ) . Besides , the hash functions in LSH are randomized and data-agnostic , which can not fully utilize the rich information in real-world data distributions . In this paper , we address the above limitations of existing ANN-based methods for attention sparsification . Firstly , we analyze two imbalance issues in LSH-produced sparse attention patterns , i.e. , unbalanced hash bucket sizes and unbalanced query-key ratios . Secondly , we design a new metric called attention utility to quantify how well the sparse patterns approximate the full attention , and we show that ANN-derived sparse patterns are substantially inferior to their counterparts . Thirdly , we propose a novel solution , namely Learning-to-Hash Attention ( LHA ) , for dynamic attention sparsification with enhanced model expressiveness . LHA directly optimizes our newly defined attention utility metric in an end-to-end manner via separate learnable hash functions for queries and keys , respectively . As for reducing the computational complexity in the training phase , LHA uses unbiased kernelized attention techniques ( Choromanski et al. , 2020 ; Peng et al. , 2021 ) to efficiently approximate the attention utilities . Similar to other sparse attention models ( Kitaev et al. , 2020 ; Roy et al. , 2021 ) , LHA reduces the overall complexity of self-attention from O ( N2 ) to O ( N1.5 ) for sequence length N . Our experiments in a wide range of tasks on the evaluation benchmarks for language modeling , natural language understanding , and Long-Range-Arena show that LHA achieves better performance compared to strong transformer baselines . 2 RELATED WORK . Related work can be roughly divided into three categories , i.e. , location-based sparse attention , content-based sparse attention , and dense approximation of attention , as outlined below . Location-based sparse attention methods aim to improve the computational efficiency by using pre-specified global or local sparsification patterns over token locations . Liu et al . ( 2018 ) proposed to alternate coarse attention layers and local attention layers . Child et al . ( 2019 ) used a strided sparse attention pattern in image generation . Sukhbaatar et al . ( 2019 ) imposed sparsity based on the predicted temporal window size for each token . Other methods ( Zhang et al. , 2021 ; Beltagy et al. , 2020 ; Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) used a pre-specified subset of locations in the input as the global memory , and only allow non-local attentions from this subset to all the other tokens . Location-based sparse attention can not leverage more flexible content-based interactions among arbitrary positions , as a limitation . Content-based sparse attention allows more flexible sparse patterns than location-based ones . Malaviya et al . ( 2018 ) used sparsemax to obtain a sparse attention matrix , while ( Correia et al. , 2019 ) used entmax . These methods require to compute the full attention matrix before sparsification and hence can not reduce the quadratic computation complexity . Approximate Nearest Neighbor ( ANN ) methods address this limitation by calculating the content-based sparse patterns in advance ( Roy et al. , 2021 ; Kitaev et al. , 2020 ; Daras et al. , 2020 ; Wang et al. , 2020a ) ( which will be discussed more in Section 3.1 ) . Those methods usually apply an ANN module as the shared hash function to both queries and keys . Vyas et al . ( 2020 ) and Zhou et al . ( 2020 ) sparsified the attention maps by eliminating redundant queries . Tay et al . ( 2020b ) designed a differentiable sorting algorithm of internal representations to enable efficient quasi-global local attention . Contemporary to our work , SparseFinder ( Treviso et al. , 2021 ) learns sparse attention patterns that approximate entmax attention , but its bucketing strategies are still based on ANN approaches . In contrast , LHA directly predicts a bucketing strategy ( i.e. , learnable hash functions ) that maximizes the attention utility . Another line of research explored low-rank or kernelized dense approximation of attention matrices , instead of computing the attention scores exactly for only a few pairs . Wang et al . ( 2020b ) applied a low-rank decomposition to the attention matrix . Xiong et al . ( 2021 ) approximated the attention matrix with Nyström approximation . Katharopoulos et al . ( 2020 ) utilized the association property of Key-Query-Value multiplication and reduce the quadratic complexity to linear complexity with kernelized approximation to the softmax operation . Choromanski et al . ( 2020 ) and Peng et al . ( 2021 ) further proposed an unbiased approximation of softmax with random Fourier features . Our work in this paper is directly related to the second category , i.e. , content-based attention sparsification . Specially , we address the limitations of existing ANN-based methods by modeling queries and keys in separate vector spaces and by proposing a novel approach to learn the hash functions for attention sparsification . 3 RE-EXAMINATION OF CONTENT-BASED SPARSE PATTERNS . 3.1 PRELIMINARY . The self-attention mechanism ( Vaswani et al. , 2017 ) can be formulated as the weighted sum of the value vectors V ∈ RN×dh where the weights are calculated using query vectors Q ∈ RN×dh and key vectors K ∈ RN×dh as : Attention ( Q , K , V ) = A · V = softmax ( QKT√ dh ) · V , ( 1 ) where A denotes the matrix of normalized attention weights , dh is the dimension of hidden representations , and N is the sequence length . self-attention has a quadratic time and space complexity with respect to the sequence length and hence does not scale efficiently to long sequences . Content-based sparse attention methods usually apply randomized hash functions or a clustering algorithm to queries { Qi } and keys { Kj } , and hope that similar queries and keys are hashed or clustered into the same bucket . The queries can thus only attend to the keys if both are in the same bucket . Formally , a content-based sparse attention strategy with B hash buckets is defined as : Sparse-Attention ( Qi , K , V ) = ∑ j : hQ ( Qi ) =hK ( Kj ) ĀijVj , ( 2 ) where hK , hQ : Rdh 7→ [ B ] are the hash functions for keys and queries , and Āij ∝ Aij is the re-normalized attention weights such that ∀i , ∑ j : hQ ( Qi ) =hK ( Kj ) Āij = 1 . In general ( Kitaev et al. , 2020 ; Roy et al. , 2021 ) , calculating the hash function and performing local attention for each query have the time complexity of O ( B ) and O ( N/B ) , respectively . Thus , the overall complexity1 of self-attention can be reduced fromO ( N2 ) toO ( N ·B+N2/B ) ≈ O ( N1.5 ) whenB ≈ N/B ≈ √ N . Since the hash functions are not differentiable , Approximate Nearest Neighbor ( ANN ) methods are used to derive an effective content-based hash function . Reformer ( Kitaev et al. , 2020 ) applies Locality Sensitive Hashing ( LSH ) to the tied queries and keys , where several hyper-planes are randomly generated to divide tokens into different buckets . SMYRF ( Daras et al. , 2020 ) improves Reformer by introducing asymmetric transformation to queries and keys , i.e. , F ( Qi ) = [ Qi ; 0 ; √ M2Q +M 2 K − ||Qi||22 ] , G ( Kj ) = [ Kj ; √ M2Q +M 2 K − ||Kj ||22 ; 0 ] , ( 3 ) where MQ = maxQi ||Qi||2 and MK = maxKj ||Kj ||2 , such that ||F ( Qi ) −G ( Kj ) ||22 = const− Qi · Kj . Routing Transformer ( Roy et al. , 2021 ) and Cluster-former ( Wang et al. , 2020a ) use mini-batch spherical k-means to partition tokens into different clusters . 3.2 BUCKET IMBALANCE ISSUES . Previous content-based sparse attention models take it for granted that the ANN-derived sparse pattern can effectively approximate the full attention . However , it is only verified via empirical evaluation on the down-stream tasks yet , which can not reflect the true attention map approximation ability . Notice that there are two necessary conditions for sparse attention to work effectively and efficiently : 1 . The number of queries and the number of keys in each bucket should be reasonably balanced , as queries should attend to enough keys to get a good approximation of the full-attention ; 2 . The bucket sizes should be nearly equal in order to effectively reduce the overall complexity . We first analyze how badly the two conditions would be violated by LSH2 , a typical ANN method . We apply LSH to 10 attention heads in the 3rd layer of a Transformer3 pre-trained on language modeling and obtain the results shown in Figure 1 ( up ) . We can see that the imbalance issue not only exists in the query-key ratios , but also in the bucket sizes . To go a step further , we apply LSH to all 16× 10 = 160 attention heads in the pre-trained Transformer and find that around 61.3 % buckets have the query-key imbalance problem , where the query-key ratios are either greater than 2:1 or smaller than 1:2 . Around 35.9 % buckets have the bucket size imbalance problem , where the bucket 1Notice that we only consider the setting of single-round hashing in our paper , but our analysis and the proposed LHA method can be generalized to the multi-round hashing setting . 2We use the same LSH technique as in ( Kitaev et al. , 2020 ) , except that we do not impose extra constraints to queries and keys . This is because we would like to develop a plug-and-play replacement for dense attention layers without imposing extra constraints for queries and keys 3The detailed experimental setting can be found in the appendix . sizes are twice greater than half smaller than the expected bucket size of 512 . Clearly , neither of the two aforementioned conditions are well satisfied in this LSH-sparsified Transformer model . There can be several possible reasons that cause the imbalance problem : 1 ) the Euclidean distance metric in ANN methods does not monotonically decrease with the dot-product metric used in attention mechanism ; 2 ) the queries and keys are from different distribution and not normalized , and thus restricts the effectiveness of ANN methods . To investigate the root cause , we apply the SMYRF asymmetric transformation ( Equation 3 ) to queries and keys , which creates a monotonic relation between Euclidean distances and dot-products . The new analysis results are shown in Figure 1 ( down ) . We can see that the asymmetric transformation would only exacerbate the imbalance problem , with respect to both query-key ratios and bucket sizes . Therefore , we can conclude that the root cause of the imbalance problem is the mismatch between the query and key distributions , that could be further magnified by the asymmetric transformation . | This paper proposes a learning to hash attention (LHA) to learn sparse attention for Transformer. The proposed LHA addresses the limitation of ANN-based sparse attention method by separate learnable hash functions for queries and keys and utilizes kernelized techniques for efficient approximation of attention utilities. Experiments on several applications validate the effectiveness of the proposed LHA. | SP:20b37598155521a49e41e344d8ddf8c8567cde1b |
Sparse Attention with Learning to Hash | 1 INTRODUCTION . The Transformer architecture ( Vaswani et al. , 2017 ) has been successfully applied to various tasks , including natural language processing ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ; Dai et al. , 2019 ; Liu et al. , 2019 ; Yang et al. , 2019 ) , computer vision ( Carion et al. , 2020 ; Dosovitskiy et al. , 2020 ) , and time series forecasting ( Zhou et al. , 2020 ; Wu et al. , 2021 ) . Such a success is mainly due to the self-attention component , which enables each token to directly interact with any other tokens in the entire sequence . But self-attention has a quadratic time and space complexity with respect to the sequence length and hence does not scale efficiently to long sequences as a result . To address this inefficiency problem , one of the solutions is to approximate the full attention matrix with a sparse one , as the softmax operation is dominated by the largest elements . Some recent efforts focus on dynamic learning of sparse attention patterns via Approximate Nearest Neighbors ( ANN ) approaches , including Locality Sensitive Hashing ( LSH ) ( Kitaev et al. , 2020 ; Daras et al. , 2020 ) and mini-batch spherical k-means ( Roy et al. , 2021 ; Wang et al. , 2020a ) . The queries and keys are hashed or clustered into different buckets , hoping that the queries and keys in the same bucket are similar with a high probability . The effectiveness of those ANN approaches rely on the assumption that the ( transformed ) query and key vectors should lie in the same space , which could be sub-optimal in dealing with different sparsity patterns , as analyzed in this paper ( Section 3.2 ) . Besides , the hash functions in LSH are randomized and data-agnostic , which can not fully utilize the rich information in real-world data distributions . In this paper , we address the above limitations of existing ANN-based methods for attention sparsification . Firstly , we analyze two imbalance issues in LSH-produced sparse attention patterns , i.e. , unbalanced hash bucket sizes and unbalanced query-key ratios . Secondly , we design a new metric called attention utility to quantify how well the sparse patterns approximate the full attention , and we show that ANN-derived sparse patterns are substantially inferior to their counterparts . Thirdly , we propose a novel solution , namely Learning-to-Hash Attention ( LHA ) , for dynamic attention sparsification with enhanced model expressiveness . LHA directly optimizes our newly defined attention utility metric in an end-to-end manner via separate learnable hash functions for queries and keys , respectively . As for reducing the computational complexity in the training phase , LHA uses unbiased kernelized attention techniques ( Choromanski et al. , 2020 ; Peng et al. , 2021 ) to efficiently approximate the attention utilities . Similar to other sparse attention models ( Kitaev et al. , 2020 ; Roy et al. , 2021 ) , LHA reduces the overall complexity of self-attention from O ( N2 ) to O ( N1.5 ) for sequence length N . Our experiments in a wide range of tasks on the evaluation benchmarks for language modeling , natural language understanding , and Long-Range-Arena show that LHA achieves better performance compared to strong transformer baselines . 2 RELATED WORK . Related work can be roughly divided into three categories , i.e. , location-based sparse attention , content-based sparse attention , and dense approximation of attention , as outlined below . Location-based sparse attention methods aim to improve the computational efficiency by using pre-specified global or local sparsification patterns over token locations . Liu et al . ( 2018 ) proposed to alternate coarse attention layers and local attention layers . Child et al . ( 2019 ) used a strided sparse attention pattern in image generation . Sukhbaatar et al . ( 2019 ) imposed sparsity based on the predicted temporal window size for each token . Other methods ( Zhang et al. , 2021 ; Beltagy et al. , 2020 ; Ainslie et al. , 2020 ; Zaheer et al. , 2020 ) used a pre-specified subset of locations in the input as the global memory , and only allow non-local attentions from this subset to all the other tokens . Location-based sparse attention can not leverage more flexible content-based interactions among arbitrary positions , as a limitation . Content-based sparse attention allows more flexible sparse patterns than location-based ones . Malaviya et al . ( 2018 ) used sparsemax to obtain a sparse attention matrix , while ( Correia et al. , 2019 ) used entmax . These methods require to compute the full attention matrix before sparsification and hence can not reduce the quadratic computation complexity . Approximate Nearest Neighbor ( ANN ) methods address this limitation by calculating the content-based sparse patterns in advance ( Roy et al. , 2021 ; Kitaev et al. , 2020 ; Daras et al. , 2020 ; Wang et al. , 2020a ) ( which will be discussed more in Section 3.1 ) . Those methods usually apply an ANN module as the shared hash function to both queries and keys . Vyas et al . ( 2020 ) and Zhou et al . ( 2020 ) sparsified the attention maps by eliminating redundant queries . Tay et al . ( 2020b ) designed a differentiable sorting algorithm of internal representations to enable efficient quasi-global local attention . Contemporary to our work , SparseFinder ( Treviso et al. , 2021 ) learns sparse attention patterns that approximate entmax attention , but its bucketing strategies are still based on ANN approaches . In contrast , LHA directly predicts a bucketing strategy ( i.e. , learnable hash functions ) that maximizes the attention utility . Another line of research explored low-rank or kernelized dense approximation of attention matrices , instead of computing the attention scores exactly for only a few pairs . Wang et al . ( 2020b ) applied a low-rank decomposition to the attention matrix . Xiong et al . ( 2021 ) approximated the attention matrix with Nyström approximation . Katharopoulos et al . ( 2020 ) utilized the association property of Key-Query-Value multiplication and reduce the quadratic complexity to linear complexity with kernelized approximation to the softmax operation . Choromanski et al . ( 2020 ) and Peng et al . ( 2021 ) further proposed an unbiased approximation of softmax with random Fourier features . Our work in this paper is directly related to the second category , i.e. , content-based attention sparsification . Specially , we address the limitations of existing ANN-based methods by modeling queries and keys in separate vector spaces and by proposing a novel approach to learn the hash functions for attention sparsification . 3 RE-EXAMINATION OF CONTENT-BASED SPARSE PATTERNS . 3.1 PRELIMINARY . The self-attention mechanism ( Vaswani et al. , 2017 ) can be formulated as the weighted sum of the value vectors V ∈ RN×dh where the weights are calculated using query vectors Q ∈ RN×dh and key vectors K ∈ RN×dh as : Attention ( Q , K , V ) = A · V = softmax ( QKT√ dh ) · V , ( 1 ) where A denotes the matrix of normalized attention weights , dh is the dimension of hidden representations , and N is the sequence length . self-attention has a quadratic time and space complexity with respect to the sequence length and hence does not scale efficiently to long sequences . Content-based sparse attention methods usually apply randomized hash functions or a clustering algorithm to queries { Qi } and keys { Kj } , and hope that similar queries and keys are hashed or clustered into the same bucket . The queries can thus only attend to the keys if both are in the same bucket . Formally , a content-based sparse attention strategy with B hash buckets is defined as : Sparse-Attention ( Qi , K , V ) = ∑ j : hQ ( Qi ) =hK ( Kj ) ĀijVj , ( 2 ) where hK , hQ : Rdh 7→ [ B ] are the hash functions for keys and queries , and Āij ∝ Aij is the re-normalized attention weights such that ∀i , ∑ j : hQ ( Qi ) =hK ( Kj ) Āij = 1 . In general ( Kitaev et al. , 2020 ; Roy et al. , 2021 ) , calculating the hash function and performing local attention for each query have the time complexity of O ( B ) and O ( N/B ) , respectively . Thus , the overall complexity1 of self-attention can be reduced fromO ( N2 ) toO ( N ·B+N2/B ) ≈ O ( N1.5 ) whenB ≈ N/B ≈ √ N . Since the hash functions are not differentiable , Approximate Nearest Neighbor ( ANN ) methods are used to derive an effective content-based hash function . Reformer ( Kitaev et al. , 2020 ) applies Locality Sensitive Hashing ( LSH ) to the tied queries and keys , where several hyper-planes are randomly generated to divide tokens into different buckets . SMYRF ( Daras et al. , 2020 ) improves Reformer by introducing asymmetric transformation to queries and keys , i.e. , F ( Qi ) = [ Qi ; 0 ; √ M2Q +M 2 K − ||Qi||22 ] , G ( Kj ) = [ Kj ; √ M2Q +M 2 K − ||Kj ||22 ; 0 ] , ( 3 ) where MQ = maxQi ||Qi||2 and MK = maxKj ||Kj ||2 , such that ||F ( Qi ) −G ( Kj ) ||22 = const− Qi · Kj . Routing Transformer ( Roy et al. , 2021 ) and Cluster-former ( Wang et al. , 2020a ) use mini-batch spherical k-means to partition tokens into different clusters . 3.2 BUCKET IMBALANCE ISSUES . Previous content-based sparse attention models take it for granted that the ANN-derived sparse pattern can effectively approximate the full attention . However , it is only verified via empirical evaluation on the down-stream tasks yet , which can not reflect the true attention map approximation ability . Notice that there are two necessary conditions for sparse attention to work effectively and efficiently : 1 . The number of queries and the number of keys in each bucket should be reasonably balanced , as queries should attend to enough keys to get a good approximation of the full-attention ; 2 . The bucket sizes should be nearly equal in order to effectively reduce the overall complexity . We first analyze how badly the two conditions would be violated by LSH2 , a typical ANN method . We apply LSH to 10 attention heads in the 3rd layer of a Transformer3 pre-trained on language modeling and obtain the results shown in Figure 1 ( up ) . We can see that the imbalance issue not only exists in the query-key ratios , but also in the bucket sizes . To go a step further , we apply LSH to all 16× 10 = 160 attention heads in the pre-trained Transformer and find that around 61.3 % buckets have the query-key imbalance problem , where the query-key ratios are either greater than 2:1 or smaller than 1:2 . Around 35.9 % buckets have the bucket size imbalance problem , where the bucket 1Notice that we only consider the setting of single-round hashing in our paper , but our analysis and the proposed LHA method can be generalized to the multi-round hashing setting . 2We use the same LSH technique as in ( Kitaev et al. , 2020 ) , except that we do not impose extra constraints to queries and keys . This is because we would like to develop a plug-and-play replacement for dense attention layers without imposing extra constraints for queries and keys 3The detailed experimental setting can be found in the appendix . sizes are twice greater than half smaller than the expected bucket size of 512 . Clearly , neither of the two aforementioned conditions are well satisfied in this LSH-sparsified Transformer model . There can be several possible reasons that cause the imbalance problem : 1 ) the Euclidean distance metric in ANN methods does not monotonically decrease with the dot-product metric used in attention mechanism ; 2 ) the queries and keys are from different distribution and not normalized , and thus restricts the effectiveness of ANN methods . To investigate the root cause , we apply the SMYRF asymmetric transformation ( Equation 3 ) to queries and keys , which creates a monotonic relation between Euclidean distances and dot-products . The new analysis results are shown in Figure 1 ( down ) . We can see that the asymmetric transformation would only exacerbate the imbalance problem , with respect to both query-key ratios and bucket sizes . Therefore , we can conclude that the root cause of the imbalance problem is the mismatch between the query and key distributions , that could be further magnified by the asymmetric transformation . | This paper introduces a new method based on learnable hash functions to reduce the O(N^2) cost of self-attention in transformers to O(N^1.5). As previously known for bucket-based approaches, this cost is only achieved when buckets are balanced. The paper investigates the effectiveness of related approaches regarding bucket imbalance issues by showing statistics for several attention heads of a pre-trained transformer. A precise metric is designed to quantify this notion of efficiency ("attention utility"), and later this metric is optimized by learning separate parameterized hash functions for queries and keys. To be able to optimize this metric, the authors use the unbiased approximation to the softmax function proposed by Performer (Choromanski et al., 2020) as a regularization term. Experiments on several NLP and CV tasks show that the proposed method achieves better results than previous fast-transformers while being faster than a standard transformer. | SP:20b37598155521a49e41e344d8ddf8c8567cde1b |
Evaluating Distributional Distortion in Neural Language Modeling | A fundamental characteristic of natural language is the high rate at which speakers produce novel expressions . Because of this novelty , a heavy-tail of rare events accounts for a significant amount of the total probability mass of distributions in language ( Baayen , 2001 ) . Standard language modeling metrics such as perplexity quantify performance of language models ( LM ) in aggregate . As a result , we have relatively little understanding of whether neural LMs accurately estimate the probability of sequences in this heavy-tail of rare events . To address this gap , we develop a controlled evaluation scheme which uses generative models trained on natural data as artificial languages from which we can exactly compute sequence probabilities . Training LMs on generations from these artificial languages , we compare the sequence-level probability estimates given by LMs to the true probabilities in the target language . Our experiments reveal that LSTM and Transformer language models ( i ) systematically underestimate the probability of sequences drawn from the target language , and ( ii ) do so more severely for lessprobable sequences . Investigating where this probability mass went , ( iii ) we find that LMs tend to overestimate the probability of ill-formed ( perturbed ) sequences . In addition , we find that this underestimation behaviour ( iv ) is weakened , but not eliminated by greater amounts of training data , and ( v ) is exacerbated for target distributions with lower entropy . 1 INTRODUCTION . Natural language is fundamentally creative—speakers and listeners frequently produce and comprehend sentences which have never been produced before ( Fodor , 1975 ; Fodor & Pylyshyn , 1988 ; Chomsky , 1975 , 1955 ) . As a side-effect of this property , distributions in natural language are characterized by a heavy-tail of individually improbable events which collectively account for a significant amount of the total probability mass of the distribution ( Khmaladze , 1988 ; Baayen , 2001 ) . Precisely approximating this large number of rare events is one of the foundational challenges for models of natural language ( Good , 1953 ; Jelinek , 1980 ; Katz , 1987 ; Kneser & Ney , 1995 ; Wood et al. , 2011 ; Goldwater et al. , 2011 ) . Autoregressive neural language models ( Bengio et al. , 2003 ; Mikolov et al. , 2013 ; Radford et al. , 2019 ) attempt to do so by decomposing the probability of an event ( a sequence ) into a series of conditional distributions , each parameterized by a shared neural network . Recently , a growing body work has sought to understand how these language models ( LM ) fit the distribution of a language beyond standard measures such as perplexity . Meister & Cotterell ( 2021 ) , for example , investigated the statistical tendencies of the distribution defined by neural LMs , whereas Kulikov et al . ( 2021 ) explored whether they adequately capture the modes of the distribution they attempt to model . At the same time , increased focus has been given to performance on rare or novel events in the data distribution , both for models of natural language ( Lent et al. , 2021 ; Dudy & Bedrick , 2020 ; Oren et al. , 2019 ) and neural models more generally ( see , for example Sagawa et al. , 2020 ; D ’ souza et al. , 2021 ; Chen et al. , 2021 ; Blevins & Zettlemoyer , 2020 ; Czarnowska et al. , 2019 ; Horn & Perona , 2017 ; Ouyang et al. , 2016 ; Bengio , 2015 ; Zhu et al. , 2014 ) . Neither of these branches of work , however , has explored instance-level LM performance on rare sequences in the distribution . As a result , we have relatively little understanding of how neural LMs approximate sequences in the heavy-tail characteristic of natural language . In this work , we introduce a controlled methodology to explore how LMs estimate the probability of sequences in the heavy-tail of the distribution . Our instance-level evaluation scheme explicitly compares the target probability distribution of the language to the distribution defined by the LM . Since the true distribution of any natural language is in practice unknown , we use a Transformer LM trained on natural data as a generative model to define target artificial languages for which we can exactly compute sequence probabilities . Training LSTM and Transformer LMs on sequences sampled from these target artificial languages , we compare the sequence-level probability estimates given by neural LMs to the target probabilities in the language . By controlling the entropy of the generative model ’ s conditional distributions , we create a set of artificial languages with varying distributional properties , and analyze how LM estimation behaviour is modulated by the properties of the target distribution . Our experiments uncover the extent to which neural LMs provide a distorted fit of the language they are trained to model . We find that LSTM and Transformer LMs ( i ) systematically underestimate the probability of sequences drawn from the target language and ( ii ) do so more when such sequences are rare . Where did this underestimated probability mass go ? We do not find that the underestimation is accompanied by overestimation in the head of distribution . Rather , we find that LMs tend to ( iii ) overestimate the probability of rare perturbed ( ill-formed ) sequences . Interpreted together , these findings indicate that on the one hand , neural LMs under-represent well-formed sequences in the tail of the language they attempt to model , and on the other hand , over-represent ill-formed sequences far away from high probability zones in sequence-space . In addition , we find that ( iv ) greater amounts of training data lessen underestimation but do not eliminate it and that ( v ) underestimation is exacerbated for target distributions with lower entropy . 2 BACKGROUND . We begin by briefly characterizing why distributions with a large number of rare events ( LNRE ) emerge in natural language , and why these events pose challenges for LMs . Furthermore , we motivate the need for instance-level evaluation when dealing with a large number of rare events . Productivity In the context of language production , a language user has the ability to produce , at any given point in their linguistic lifespan , an utterance which they have never produced before . This creativity is the result of the generative property of productivity , which states that on the basis of finite linguistic experience , a language user can produce and comprehend an unbounded number of grammatically acceptable utterances ( Chomsky , 1975 , 1955 ) . Productive processes induce a distribution which places non-zero probability on unseen events at all practical sample sizes . Because of this property , many of the distributions in natural language—particularly the distribution over the sequences of a language—are characterized by a heavy-tail of rare events . LNRE Zone To make explicit the connection between productivity and a heavy-tail of rare events , let PN denote the probability of sampling a novel ( previously unseen ) event from some distribution after having sampled N events . Then productivity as described above states that PN > 0 for all sample sizes N that occur in practice . The range of sample sizes N for which it is the case that PN > 0 is known as the LNRE zone ( Khmaladze , 1988 ; Baayen , 2001 ) . The LNRE zone for natural language appears to be very large , and it seems likely that PN will remain greater than 0 for samples of natural language many orders of magnitude larger than all the data currently available for training LMs.1 In the LNRE zone , it is difficult to obtain accurate estimates of the probability of events using straightforward maximum likelihood estimation ( MLE ) . Accounting for this enormous amount of novelty is thus a central challenge in language modeling . Language modeling A model M of the language L attempts to define a distribution pM over variable length sequences x = ( x1 , . . . , x|x| ) which closely resembles the true distribution of the language pL . That is , pM ( x ) ≈ pL ( x ) for all x ∈ Σ∗ , where Σ denotes the vocabulary of M , and Σ∗ is the set of all strings of finite length , known as the Kleene closure of Σ . In the LNRE zone , this means that a LM must define a distribution over a support containing a very large set of sequences 1For an empirical validation of this claim on a sample of practical size from the OpenWebText corpus , see the Appendix . which have never occurred in a training corpus ( or equivalently , have all occurred with frequency 0 ) , which take on a very wide array of differing probabilities . For example , while the sequences x1 , x2 ∈ Σ∗ have likely never occurred in any sample of English , most would agree that x1 is far more probable than x2 : x1 : The East pond in Parc Lafontaine was filled to the brim with diet Coke . x2 : Certain nak indicate liberationing among theorter codity voters vandalized . LM Evaluation For a perfect LM of English , we would expect the estimated probabilities of the sequences x1 and x2 to match their probabilities under the true distribution pEnglish . However , since pEnglish and it ’ s underlying generative process are unknown , it is not possible to explicitly evaluate how closely instance-level probability estimates align . As a proxy , the mean perplexity of the model on a holdout set of sequences D is typically used : PP ( pM , D ) = 1 |D| |D|∑ i=1 exp − 1|x ( i ) | |x ( i ) |∑ t=1 log pM ( x ( i ) t | x ( i ) < t ) ( 1 ) which measures whether the model , on average , assigns high likelihood to unseen instances . This measure does not , however , tell us whether instance-level estimates align with their true counterparts , nor is it necessarily indicative of performance on rare , idiosyncratic events in D. In this way , the lack of access to the ground-truth distribution severely complicates LM evaluation on the heavy-tail of rare sequences in language . In the following section , we introduce a methodology to overcome these limitations . 3 LANGUAGE MODEL EVALUATION IN THE LNRE ZONE . We propose evaluating language model performance on the heavy-tail of rare events by working with a known probability distribution over sequences . Specifically , we train a Transformer LM on sequences sampled from a corpus of natural language to define a generative model L. The distribution over sequences induced by a sampling scheme from L , denoted pL , is then our artificial language . We expect a model M of this artificial language to assign probabilities pM ( x ) to sequences x which match the target probabilities pL ( x ) of x under pL . Here we define pL using an ancestral sampling scheme with softmax T = 0.85 . One could , for example , define an artificial language pL′ by sampling from the top-k tokens of the distribution defined by L at each time step , or using an ancestral sampling scheme with softmax T = T ′ . To characterize neural LM behaviour on rare events , we train Transformer and LSTM LMs on data sampled from pL , and compare the instance-level probability estimates given by pM to target probabilities under pL . We summarize the components of this methodology in Table 1 , and overview it in greater detail in the following section . | The paper conducts experiments to evaluate whether neural sequence models such as LSTMs and Transformers are able to correctly assess the probability of rare sentences, which collectively constitute a large probability mass in natural language productions (heavy-tail phenomenon). In order to do so, it performs experiments in a controlled synthetic environment where a first language model $P_L$ is trained on a corpus of natural sentences, and a second model $P_M$ is trained to emulate the first model. The authors observe that the second model systematically tends to underestimate the probability of rare $P_L$ sentences, the more so the rarer such sentences are, and show that some artificially corrupted sentences tend to receive higher probability from $P_M$ than from $P_L$, partly explaining where the missing probability mass over rare well-formed sentences went. | SP:2a936f08edc99fef3191aebe7fce8c3d69dadb63 |
Evaluating Distributional Distortion in Neural Language Modeling | A fundamental characteristic of natural language is the high rate at which speakers produce novel expressions . Because of this novelty , a heavy-tail of rare events accounts for a significant amount of the total probability mass of distributions in language ( Baayen , 2001 ) . Standard language modeling metrics such as perplexity quantify performance of language models ( LM ) in aggregate . As a result , we have relatively little understanding of whether neural LMs accurately estimate the probability of sequences in this heavy-tail of rare events . To address this gap , we develop a controlled evaluation scheme which uses generative models trained on natural data as artificial languages from which we can exactly compute sequence probabilities . Training LMs on generations from these artificial languages , we compare the sequence-level probability estimates given by LMs to the true probabilities in the target language . Our experiments reveal that LSTM and Transformer language models ( i ) systematically underestimate the probability of sequences drawn from the target language , and ( ii ) do so more severely for lessprobable sequences . Investigating where this probability mass went , ( iii ) we find that LMs tend to overestimate the probability of ill-formed ( perturbed ) sequences . In addition , we find that this underestimation behaviour ( iv ) is weakened , but not eliminated by greater amounts of training data , and ( v ) is exacerbated for target distributions with lower entropy . 1 INTRODUCTION . Natural language is fundamentally creative—speakers and listeners frequently produce and comprehend sentences which have never been produced before ( Fodor , 1975 ; Fodor & Pylyshyn , 1988 ; Chomsky , 1975 , 1955 ) . As a side-effect of this property , distributions in natural language are characterized by a heavy-tail of individually improbable events which collectively account for a significant amount of the total probability mass of the distribution ( Khmaladze , 1988 ; Baayen , 2001 ) . Precisely approximating this large number of rare events is one of the foundational challenges for models of natural language ( Good , 1953 ; Jelinek , 1980 ; Katz , 1987 ; Kneser & Ney , 1995 ; Wood et al. , 2011 ; Goldwater et al. , 2011 ) . Autoregressive neural language models ( Bengio et al. , 2003 ; Mikolov et al. , 2013 ; Radford et al. , 2019 ) attempt to do so by decomposing the probability of an event ( a sequence ) into a series of conditional distributions , each parameterized by a shared neural network . Recently , a growing body work has sought to understand how these language models ( LM ) fit the distribution of a language beyond standard measures such as perplexity . Meister & Cotterell ( 2021 ) , for example , investigated the statistical tendencies of the distribution defined by neural LMs , whereas Kulikov et al . ( 2021 ) explored whether they adequately capture the modes of the distribution they attempt to model . At the same time , increased focus has been given to performance on rare or novel events in the data distribution , both for models of natural language ( Lent et al. , 2021 ; Dudy & Bedrick , 2020 ; Oren et al. , 2019 ) and neural models more generally ( see , for example Sagawa et al. , 2020 ; D ’ souza et al. , 2021 ; Chen et al. , 2021 ; Blevins & Zettlemoyer , 2020 ; Czarnowska et al. , 2019 ; Horn & Perona , 2017 ; Ouyang et al. , 2016 ; Bengio , 2015 ; Zhu et al. , 2014 ) . Neither of these branches of work , however , has explored instance-level LM performance on rare sequences in the distribution . As a result , we have relatively little understanding of how neural LMs approximate sequences in the heavy-tail characteristic of natural language . In this work , we introduce a controlled methodology to explore how LMs estimate the probability of sequences in the heavy-tail of the distribution . Our instance-level evaluation scheme explicitly compares the target probability distribution of the language to the distribution defined by the LM . Since the true distribution of any natural language is in practice unknown , we use a Transformer LM trained on natural data as a generative model to define target artificial languages for which we can exactly compute sequence probabilities . Training LSTM and Transformer LMs on sequences sampled from these target artificial languages , we compare the sequence-level probability estimates given by neural LMs to the target probabilities in the language . By controlling the entropy of the generative model ’ s conditional distributions , we create a set of artificial languages with varying distributional properties , and analyze how LM estimation behaviour is modulated by the properties of the target distribution . Our experiments uncover the extent to which neural LMs provide a distorted fit of the language they are trained to model . We find that LSTM and Transformer LMs ( i ) systematically underestimate the probability of sequences drawn from the target language and ( ii ) do so more when such sequences are rare . Where did this underestimated probability mass go ? We do not find that the underestimation is accompanied by overestimation in the head of distribution . Rather , we find that LMs tend to ( iii ) overestimate the probability of rare perturbed ( ill-formed ) sequences . Interpreted together , these findings indicate that on the one hand , neural LMs under-represent well-formed sequences in the tail of the language they attempt to model , and on the other hand , over-represent ill-formed sequences far away from high probability zones in sequence-space . In addition , we find that ( iv ) greater amounts of training data lessen underestimation but do not eliminate it and that ( v ) underestimation is exacerbated for target distributions with lower entropy . 2 BACKGROUND . We begin by briefly characterizing why distributions with a large number of rare events ( LNRE ) emerge in natural language , and why these events pose challenges for LMs . Furthermore , we motivate the need for instance-level evaluation when dealing with a large number of rare events . Productivity In the context of language production , a language user has the ability to produce , at any given point in their linguistic lifespan , an utterance which they have never produced before . This creativity is the result of the generative property of productivity , which states that on the basis of finite linguistic experience , a language user can produce and comprehend an unbounded number of grammatically acceptable utterances ( Chomsky , 1975 , 1955 ) . Productive processes induce a distribution which places non-zero probability on unseen events at all practical sample sizes . Because of this property , many of the distributions in natural language—particularly the distribution over the sequences of a language—are characterized by a heavy-tail of rare events . LNRE Zone To make explicit the connection between productivity and a heavy-tail of rare events , let PN denote the probability of sampling a novel ( previously unseen ) event from some distribution after having sampled N events . Then productivity as described above states that PN > 0 for all sample sizes N that occur in practice . The range of sample sizes N for which it is the case that PN > 0 is known as the LNRE zone ( Khmaladze , 1988 ; Baayen , 2001 ) . The LNRE zone for natural language appears to be very large , and it seems likely that PN will remain greater than 0 for samples of natural language many orders of magnitude larger than all the data currently available for training LMs.1 In the LNRE zone , it is difficult to obtain accurate estimates of the probability of events using straightforward maximum likelihood estimation ( MLE ) . Accounting for this enormous amount of novelty is thus a central challenge in language modeling . Language modeling A model M of the language L attempts to define a distribution pM over variable length sequences x = ( x1 , . . . , x|x| ) which closely resembles the true distribution of the language pL . That is , pM ( x ) ≈ pL ( x ) for all x ∈ Σ∗ , where Σ denotes the vocabulary of M , and Σ∗ is the set of all strings of finite length , known as the Kleene closure of Σ . In the LNRE zone , this means that a LM must define a distribution over a support containing a very large set of sequences 1For an empirical validation of this claim on a sample of practical size from the OpenWebText corpus , see the Appendix . which have never occurred in a training corpus ( or equivalently , have all occurred with frequency 0 ) , which take on a very wide array of differing probabilities . For example , while the sequences x1 , x2 ∈ Σ∗ have likely never occurred in any sample of English , most would agree that x1 is far more probable than x2 : x1 : The East pond in Parc Lafontaine was filled to the brim with diet Coke . x2 : Certain nak indicate liberationing among theorter codity voters vandalized . LM Evaluation For a perfect LM of English , we would expect the estimated probabilities of the sequences x1 and x2 to match their probabilities under the true distribution pEnglish . However , since pEnglish and it ’ s underlying generative process are unknown , it is not possible to explicitly evaluate how closely instance-level probability estimates align . As a proxy , the mean perplexity of the model on a holdout set of sequences D is typically used : PP ( pM , D ) = 1 |D| |D|∑ i=1 exp − 1|x ( i ) | |x ( i ) |∑ t=1 log pM ( x ( i ) t | x ( i ) < t ) ( 1 ) which measures whether the model , on average , assigns high likelihood to unseen instances . This measure does not , however , tell us whether instance-level estimates align with their true counterparts , nor is it necessarily indicative of performance on rare , idiosyncratic events in D. In this way , the lack of access to the ground-truth distribution severely complicates LM evaluation on the heavy-tail of rare sequences in language . In the following section , we introduce a methodology to overcome these limitations . 3 LANGUAGE MODEL EVALUATION IN THE LNRE ZONE . We propose evaluating language model performance on the heavy-tail of rare events by working with a known probability distribution over sequences . Specifically , we train a Transformer LM on sequences sampled from a corpus of natural language to define a generative model L. The distribution over sequences induced by a sampling scheme from L , denoted pL , is then our artificial language . We expect a model M of this artificial language to assign probabilities pM ( x ) to sequences x which match the target probabilities pL ( x ) of x under pL . Here we define pL using an ancestral sampling scheme with softmax T = 0.85 . One could , for example , define an artificial language pL′ by sampling from the top-k tokens of the distribution defined by L at each time step , or using an ancestral sampling scheme with softmax T = T ′ . To characterize neural LM behaviour on rare events , we train Transformer and LSTM LMs on data sampled from pL , and compare the instance-level probability estimates given by pM to target probabilities under pL . We summarize the components of this methodology in Table 1 , and overview it in greater detail in the following section . | This paper investigates how language models allocate their probability mass, with an emphasis on rare sequences that are part of the 'heavy tail' of the distribution of natural language sequences. The authors use a language model to define a target distribution with access to samples and ground-truth probabilities. A language model is trained on an empirical estimate of the target distribution, and the authors study the gap between the learned model's and target distribution's probability assignments. Using this methodology, the authors uncover various interesting phenomena: the model systematically assigns lower probabilities than the target distribution, but assigns unusually high probabilities to unnatural, perturbed sequences (suggesting an explanation for where the probability mass moved to). The authors include several fine-grained analyses with additional interesting findings. | SP:2a936f08edc99fef3191aebe7fce8c3d69dadb63 |
Structured Pruning Meets Orthogonality | Several recent works empirically found finetuning learning rate is crucial to the final performance in structured neural network pruning . It is shown that the dynamical isometry broken by pruning answers for this phenomenon . How to develop a filter pruning method that maintains or recovers dynamical isometry and is scalable to modern deep networks remains elusive up to now . In this paper , we present orthogonality preserving pruning ( OPP ) , a regularization-based structured pruning method that maintains the dynamical isometry during pruning . Specifically , OPP regularizes the gram matrix of convolutional kernels to encourage kernel orthogonality among the important filters meanwhile driving the unimportant weights towards zero . We also propose to regularize batch-normalization parameters for better preserving dynamical isometry for the whole network . Empirically , OPP can compete with the ideal dynamical isometry recovery method on linear networks . On non-linear networks ( ResNet56/VGG19 , CIFAR datasets ) , it outperforms the available solutions by a large margin . Moreover , OPP can also work effectively with modern deep networks ( ResNets ) on ImageNet , delivering encouraging performance in comparison to many recent filter pruning methods . To our best knowledge , this is the first method that effectively maintains dynamical isometry during pruning for large-scale deep neural networks . 1 INTRODUCTION . Neural network pruning aims to remove the parameters without seriously compromising the performance . It normally consists of three steps ( Reed , 1993 ; Han et al. , 2015 ; 2016b ) : pretrain a dense model ; prune the unnecessary connections or neurons with some criteria ; finetune to regain performance . Pruning is usually categorized into two groups , unstructured pruning ( a.k.a . element-wise pruning ) and structured pruning ( a.k.a . filter pruning or channel pruning ) . The former chooses a scalar weight as the basic pruning element ; the latter chooses a 3d filter as the basic pruning element . In general , structured pruning is more favored for acceleration on commodity hardware because of its consequent regular sparsity ; unstructured pruning results in irregular sparsity , which can be considerable without performance degradation but hard to exploit for acceleration if not using customized hardware ( Han et al. , 2016a ; 2017 ) . Recent structured pruning works ( Renda et al. , 2020 ; Le & Hua , 2021 ; Wang et al. , 2021a ) showed an interesting phenomenon : in the finetuning step , using a larger learning rate ( LR ) helps to achieve a significantly better final performance ( e.g. , ResNet34 pruned at speedup 1.32× can be improved by over 1 % top-1 accuracy on ImageNet ( Deng et al. , 2009 ) using finetuning LR 1e-2 vs. 1e-3 ) . The reason behind is shown by ( Wang et al. , 2021a ) relevant to dynamical isometry ( Saxe et al. , 2014 ) , a nice property of neural networks that are easy to train without gradient vanishing or explosion ( Glorot & Bengio , 2010 ; Pascanu et al. , 2013 ) . They mainly made two observations for explanation . First , the weights removal operation immediately breaks the dynamical isometry of the pretrained network . Second , SGD training in finetuning can help recover it ; a larger LR help recover it faster and better , thus making the final performance stronger . Although ( Wang et al. , 2021a ) provided a sound explanation , a more practical issue is how to recover the broken dynamical isometry or maintain it during pruning . In this regard , ( Wang et al. , 2021a ) proposed to apply weight orthogonalization based on QR decomposition ( Trefethen & Bau III , 1997 ; Mezzadri , 2006 ) to the pruned model . However , the method was shown to only work for linear networks . On modern deep convolutional neural networks ( CNNs ) , the method is still far from satisfactory . In this paper , we present orthogonality preserving pruning ( OPP ) , a new filter pruning method that maintains dynamical isometry well during pruning . The main idea of OPP is to promote kernel orthogonality among the kept filters meanwhile pushing the weights to be pruned rather close to zero . By doing so , the subsequent weights removal operation will barely hurt the dynamical isometry of the network . Specifically , we propose to regularize the gram matrix of weights : all the entries representing the correlation between the pruned filters and the others are encourage to diminish to zero . This is the first technical contribution of our method . The second one lies in how to treat the cross-correlation entries of kept filters . Inspired by the proposed orthogonalization initialization in ( Saxe et al. , 2014 ) , we add a kernel orthogonality term to the kept filters , which promotes dynamical isometry during pruning . In addition , modern deep models are typically equipped with batch normalization ( BN ) ( Ioffe & Szegedy , 2015 ) . However , previous filter pruning papers rarely explicitly take BN into account ( except two ( Liu et al. , 2017 ; Ye et al. , 2018 ) ; the differences between our work and theirs will be discussed in Sec . 3.2 ) to mitigate the side effect when it is removed because its associated filter is removed . By the idea of preserving dynamical isometry , they should not be ignored since their removal breaks dynamical isometry as well . Therefore , we propose to regularize the learnable parameters of BN to minimize the influence of its absence . Empirically , the proposed pruning algorithm is easy to implement and delivers encouraging results compared to many existing filter pruning methods . Notably , this is the first method that effectively maintains dynamical isometry during pruning on modern large-scale deep networks . Contributions . We make three contributions in this paper : • We present the first filter pruning method ( orthogonality preserving pruning ) that can effectively maintain dynamical isometry when pruning modern deep networks , through a customized weight gram matrix as regularization target . • Apart from weight regularization , we also propose to regularize the batch normalization parameters to better maintain dynamical isometry . This has been overlooked by most previous pruning papers , while we show it is an indispensable part if we aim to maintain dynamical isometry for the whole network . • Practically , the proposed method is scalable to modern large-scale deep neural networks ( e.g. , ResNets ) and datasets ( e.g. , ImageNet ) . It achieves promising pruning performance in comparison to many state-of-the-art filter pruning methods . 2 RELATED WORK . Neural network pruning . In terms of pruning granularity , pruning methods mainly fall into structured pruning ( a.k.a . filter pruning or channel pruning ) ( Li et al. , 2017 ; Wen et al. , 2016 ; He et al. , 2017 ; 2018a ; Wang et al. , 2021c ) and unstructured pruning ( a.k.a . element-wise pruning ) ( Han et al. , 2015 ; 2016b ; LeCun et al. , 1990 ; Hassibi & Stork , 1993 ; Singh & Alistarh , 2020 ) . Structured pruning results in regular sparsity after pruning , easy to be translated to acceleration on commodity hardware . In contrast , unstructured pruning produces irregular sparsity , beneficial to compression while hard to leverage for practical acceleration ( Wen et al. , 2016 ; Wang et al. , 2019b ) unless with special hardware support ( Han et al. , 2016a ; 2017 ) . For more comprehensive coverage , we recommend surveys ( Sze et al. , 2017 ; Cheng et al. , 2018a ; b ; Deng et al. , 2020 ; Wang et al. , 2021b ) . We focus on filter pruning in this work for acceleration . Most pruning papers focus on finding a better pruning criterion to select unimportant parameters to remove . The solutions primarily follow two paradigms ( Reed , 1993 ) : regularization-based and importance-based . The former selects unimportant parameters by adding a sparsity-inducing penalty term , which is jointly optimized with the original loss objective function ( e.g. , ( Wen et al. , 2016 ; Lebedev & Lempitsky , 2016 ; Louizos et al. , 2018 ; Liu et al. , 2017 ; Ye et al. , 2018 ) ) . The latter selects unimportant parameters through certain derived mathematical formula ( e.g. , ( LeCun et al. , 1990 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; 2016b ; Li et al. , 2017 ; Molchanov et al. , 2017 ; 2019 ) ) . Notably , there is no strict boundary between the two paradigms . Several works ( Ding et al. , 2018 ; Wang et al. , 2019b ; 2021c ) manage to get the best from both worlds – they select unimportant weights by an importance criterion and add a penalty term for sparsity as well . Our method in this paper also belongs to this group , while it achieves stronger performances . Dynamical isometry and orthogonality . Dynamical isometry was first introduced by ( Saxe et al. , 2014 ) , where it can be achieved ( for linear MLP models ) by the orthogonality of weight matrix at initialization . Recent works on this topic mainly focus on how to maintain dynamical isometry during training instead of only for initialization ( Xie et al. , 2017 ; Huang et al. , 2018 ; Bansal et al. , 2018 ; Huang et al. , 2020 ; Wang et al. , 2020 ) . These methods are developed independent of pruning , thus not directly relevant to the proposed method in this work . However , the insights from these works inspire us to our proposed approach ( see Sec . 3.2 ) and possibly more in the future . Pruning + dynamical isometry . One particular paper that inspires us to this work is ( Wang et al. , 2021a ) , where the authors leverage dynamical isometry ( Saxe et al. , 2014 ) to explain the performance boosting effect ( also noted by ( Renda et al. , 2020 ; Le & Hua , 2021 ) ) of using a larger finetuning LR in pruning : pruning hurts dynamical isometry ; finetuning can recover dynamical isometry and a larger LR helps recover it faster ( and possibly better ) , thus delivering superior final performance . The explanation further clears the mystery about the value of network pruning ( Liu et al. , 2019 ; Crowley et al. , 2018 ) . Previously , ( Liu et al. , 2019 ; Crowley et al. , 2018 ) found the small models can be trained from scratch with comparable accuracy to the counterparts pruned from a pretrained large model , thus they argue no value of inheriting weights in structured pruning . ( Wang et al. , 2021a ) pointed out that this argument is actually built upon sub-optimal finetuning LR setups . With the proper ones , filter pruning consistently outperforms training from scratch . 3 METHODOLOGY . 3.1 PRELIMINARIES : DYNAMICAL ISOMETRY AND ORTHOGONALITY . The definition of dynamical isometry is that the input-output Jacobian of a network has as many singular values ( JSVs ) as possible close to 1 ( Saxe et al. , 2014 ) . With it , the error signal can preserve its norm under propagation without serious amplification or attenuation , which in turn helps the convergence of ( very deep ) networks . For a single fully-connected layer W , a sufficient and necessary condition to realize dynamical isometry is orthogonality , i.e. , WTW = I , as shown below , y = Wx , ||y|| = √ yTy = √ xTWTWx = ||x|| , iff . WTW = I , ( 1 ) where I stands for identity matrix . Orthogonality of a weight matrix can be easily realized by matrix orthogonalization techniques such as QR decomposition ( Trefethen & Bau III , 1997 ; Mezzadri , 2006 ) . Exact ( namely all the Jacobian singular values are exactly 1 ) dynamical isometry can be achieved for linear networks since multiple linear layers essentially reduce to a single 2d weight matrix . In contrast , the convolutional and non-linear cases are much complicated . Previous work ( Wang et al. , 2021a ) has shown that merely considering convolution or ReLU ( Nair & Hinton , 2010 ) renders the weight orthogonalization method much less effective in terms of recovering dynamical isometry after pruning , let alone considering modern deep networks with BN ( Ioffe & Szegedy , 2015 ) and residuals ( He et al. , 2016 ) . The primary goal of our paper is to bridge this gap . Following the seminal work of ( Saxe et al. , 2014 ) , several papers propose to maintain orthogonality during training instead of sorely for the initialization . There are primarily two groups of orthogonalization methods for convolutional neural networks : kernel orthogonality ( Xie et al. , 2017 ; Huang et al. , 2018 ; 2020 ) and orthogonal convolution ( Wang et al. , 2020 ) : KKT = I ⇒ Lorth = KKT − I , / kernel orthogonality KKT = I ⇒ Lorth = KKT − I , / orthogonal convolution ( 2 ) where clearly the difference lies in the weight matrix K vs. K. ( 1 ) K denotes the original weight matrix in a convolutional layer . Weights of a conv layer make up a 4d tensor RN×C×H×W , where N stands for the number of output channels , C for the number of input channels , H and W for the height and width of conv kernel . Then , K is a reshaped version of the 4d tensor : K ∈ RN×CHW ( if N < CHW ; otherwise , K ∈ RCHW×N ) . ( 2 ) In contrast , K ∈ RNHfoWfo×CHfiWfi stands for the doubly block-Toeplitz ( DBT ) matrix representation of K ( Hfo stands for the output feature map height , Hfi for the input feature map height . Wfo and Wfi can be inferred the same way for width ) . It was showed by ( Wang et al. , 2020 ) that orthogonal convolution is more effective than kernel orthogonality ( Xie et al. , 2017 ) in that the latter is only a necessary but insufficient condition of the former . In this work , we will evaluate both methods to see how effective they are in maintaining/recovering the broken dynamical isometry . | Dynamic isometry is shown to be a useful property that enable effective gradient propagation through the forward/backward. However, pruning will largely damage such a structure. This paper studies how to maintain the “dynamic isometry” property during pruning. Specifically, after getting an initial assessment of filter importance, the algorithm will maintain the partially kernel orthogonality of the important filters. They also propose to regularize the BN parameters to future boost the performance. | SP:7cee15b5f46a918a6448434840696f3a0d3739ee |
Structured Pruning Meets Orthogonality | Several recent works empirically found finetuning learning rate is crucial to the final performance in structured neural network pruning . It is shown that the dynamical isometry broken by pruning answers for this phenomenon . How to develop a filter pruning method that maintains or recovers dynamical isometry and is scalable to modern deep networks remains elusive up to now . In this paper , we present orthogonality preserving pruning ( OPP ) , a regularization-based structured pruning method that maintains the dynamical isometry during pruning . Specifically , OPP regularizes the gram matrix of convolutional kernels to encourage kernel orthogonality among the important filters meanwhile driving the unimportant weights towards zero . We also propose to regularize batch-normalization parameters for better preserving dynamical isometry for the whole network . Empirically , OPP can compete with the ideal dynamical isometry recovery method on linear networks . On non-linear networks ( ResNet56/VGG19 , CIFAR datasets ) , it outperforms the available solutions by a large margin . Moreover , OPP can also work effectively with modern deep networks ( ResNets ) on ImageNet , delivering encouraging performance in comparison to many recent filter pruning methods . To our best knowledge , this is the first method that effectively maintains dynamical isometry during pruning for large-scale deep neural networks . 1 INTRODUCTION . Neural network pruning aims to remove the parameters without seriously compromising the performance . It normally consists of three steps ( Reed , 1993 ; Han et al. , 2015 ; 2016b ) : pretrain a dense model ; prune the unnecessary connections or neurons with some criteria ; finetune to regain performance . Pruning is usually categorized into two groups , unstructured pruning ( a.k.a . element-wise pruning ) and structured pruning ( a.k.a . filter pruning or channel pruning ) . The former chooses a scalar weight as the basic pruning element ; the latter chooses a 3d filter as the basic pruning element . In general , structured pruning is more favored for acceleration on commodity hardware because of its consequent regular sparsity ; unstructured pruning results in irregular sparsity , which can be considerable without performance degradation but hard to exploit for acceleration if not using customized hardware ( Han et al. , 2016a ; 2017 ) . Recent structured pruning works ( Renda et al. , 2020 ; Le & Hua , 2021 ; Wang et al. , 2021a ) showed an interesting phenomenon : in the finetuning step , using a larger learning rate ( LR ) helps to achieve a significantly better final performance ( e.g. , ResNet34 pruned at speedup 1.32× can be improved by over 1 % top-1 accuracy on ImageNet ( Deng et al. , 2009 ) using finetuning LR 1e-2 vs. 1e-3 ) . The reason behind is shown by ( Wang et al. , 2021a ) relevant to dynamical isometry ( Saxe et al. , 2014 ) , a nice property of neural networks that are easy to train without gradient vanishing or explosion ( Glorot & Bengio , 2010 ; Pascanu et al. , 2013 ) . They mainly made two observations for explanation . First , the weights removal operation immediately breaks the dynamical isometry of the pretrained network . Second , SGD training in finetuning can help recover it ; a larger LR help recover it faster and better , thus making the final performance stronger . Although ( Wang et al. , 2021a ) provided a sound explanation , a more practical issue is how to recover the broken dynamical isometry or maintain it during pruning . In this regard , ( Wang et al. , 2021a ) proposed to apply weight orthogonalization based on QR decomposition ( Trefethen & Bau III , 1997 ; Mezzadri , 2006 ) to the pruned model . However , the method was shown to only work for linear networks . On modern deep convolutional neural networks ( CNNs ) , the method is still far from satisfactory . In this paper , we present orthogonality preserving pruning ( OPP ) , a new filter pruning method that maintains dynamical isometry well during pruning . The main idea of OPP is to promote kernel orthogonality among the kept filters meanwhile pushing the weights to be pruned rather close to zero . By doing so , the subsequent weights removal operation will barely hurt the dynamical isometry of the network . Specifically , we propose to regularize the gram matrix of weights : all the entries representing the correlation between the pruned filters and the others are encourage to diminish to zero . This is the first technical contribution of our method . The second one lies in how to treat the cross-correlation entries of kept filters . Inspired by the proposed orthogonalization initialization in ( Saxe et al. , 2014 ) , we add a kernel orthogonality term to the kept filters , which promotes dynamical isometry during pruning . In addition , modern deep models are typically equipped with batch normalization ( BN ) ( Ioffe & Szegedy , 2015 ) . However , previous filter pruning papers rarely explicitly take BN into account ( except two ( Liu et al. , 2017 ; Ye et al. , 2018 ) ; the differences between our work and theirs will be discussed in Sec . 3.2 ) to mitigate the side effect when it is removed because its associated filter is removed . By the idea of preserving dynamical isometry , they should not be ignored since their removal breaks dynamical isometry as well . Therefore , we propose to regularize the learnable parameters of BN to minimize the influence of its absence . Empirically , the proposed pruning algorithm is easy to implement and delivers encouraging results compared to many existing filter pruning methods . Notably , this is the first method that effectively maintains dynamical isometry during pruning on modern large-scale deep networks . Contributions . We make three contributions in this paper : • We present the first filter pruning method ( orthogonality preserving pruning ) that can effectively maintain dynamical isometry when pruning modern deep networks , through a customized weight gram matrix as regularization target . • Apart from weight regularization , we also propose to regularize the batch normalization parameters to better maintain dynamical isometry . This has been overlooked by most previous pruning papers , while we show it is an indispensable part if we aim to maintain dynamical isometry for the whole network . • Practically , the proposed method is scalable to modern large-scale deep neural networks ( e.g. , ResNets ) and datasets ( e.g. , ImageNet ) . It achieves promising pruning performance in comparison to many state-of-the-art filter pruning methods . 2 RELATED WORK . Neural network pruning . In terms of pruning granularity , pruning methods mainly fall into structured pruning ( a.k.a . filter pruning or channel pruning ) ( Li et al. , 2017 ; Wen et al. , 2016 ; He et al. , 2017 ; 2018a ; Wang et al. , 2021c ) and unstructured pruning ( a.k.a . element-wise pruning ) ( Han et al. , 2015 ; 2016b ; LeCun et al. , 1990 ; Hassibi & Stork , 1993 ; Singh & Alistarh , 2020 ) . Structured pruning results in regular sparsity after pruning , easy to be translated to acceleration on commodity hardware . In contrast , unstructured pruning produces irregular sparsity , beneficial to compression while hard to leverage for practical acceleration ( Wen et al. , 2016 ; Wang et al. , 2019b ) unless with special hardware support ( Han et al. , 2016a ; 2017 ) . For more comprehensive coverage , we recommend surveys ( Sze et al. , 2017 ; Cheng et al. , 2018a ; b ; Deng et al. , 2020 ; Wang et al. , 2021b ) . We focus on filter pruning in this work for acceleration . Most pruning papers focus on finding a better pruning criterion to select unimportant parameters to remove . The solutions primarily follow two paradigms ( Reed , 1993 ) : regularization-based and importance-based . The former selects unimportant parameters by adding a sparsity-inducing penalty term , which is jointly optimized with the original loss objective function ( e.g. , ( Wen et al. , 2016 ; Lebedev & Lempitsky , 2016 ; Louizos et al. , 2018 ; Liu et al. , 2017 ; Ye et al. , 2018 ) ) . The latter selects unimportant parameters through certain derived mathematical formula ( e.g. , ( LeCun et al. , 1990 ; Hassibi & Stork , 1993 ; Han et al. , 2015 ; 2016b ; Li et al. , 2017 ; Molchanov et al. , 2017 ; 2019 ) ) . Notably , there is no strict boundary between the two paradigms . Several works ( Ding et al. , 2018 ; Wang et al. , 2019b ; 2021c ) manage to get the best from both worlds – they select unimportant weights by an importance criterion and add a penalty term for sparsity as well . Our method in this paper also belongs to this group , while it achieves stronger performances . Dynamical isometry and orthogonality . Dynamical isometry was first introduced by ( Saxe et al. , 2014 ) , where it can be achieved ( for linear MLP models ) by the orthogonality of weight matrix at initialization . Recent works on this topic mainly focus on how to maintain dynamical isometry during training instead of only for initialization ( Xie et al. , 2017 ; Huang et al. , 2018 ; Bansal et al. , 2018 ; Huang et al. , 2020 ; Wang et al. , 2020 ) . These methods are developed independent of pruning , thus not directly relevant to the proposed method in this work . However , the insights from these works inspire us to our proposed approach ( see Sec . 3.2 ) and possibly more in the future . Pruning + dynamical isometry . One particular paper that inspires us to this work is ( Wang et al. , 2021a ) , where the authors leverage dynamical isometry ( Saxe et al. , 2014 ) to explain the performance boosting effect ( also noted by ( Renda et al. , 2020 ; Le & Hua , 2021 ) ) of using a larger finetuning LR in pruning : pruning hurts dynamical isometry ; finetuning can recover dynamical isometry and a larger LR helps recover it faster ( and possibly better ) , thus delivering superior final performance . The explanation further clears the mystery about the value of network pruning ( Liu et al. , 2019 ; Crowley et al. , 2018 ) . Previously , ( Liu et al. , 2019 ; Crowley et al. , 2018 ) found the small models can be trained from scratch with comparable accuracy to the counterparts pruned from a pretrained large model , thus they argue no value of inheriting weights in structured pruning . ( Wang et al. , 2021a ) pointed out that this argument is actually built upon sub-optimal finetuning LR setups . With the proper ones , filter pruning consistently outperforms training from scratch . 3 METHODOLOGY . 3.1 PRELIMINARIES : DYNAMICAL ISOMETRY AND ORTHOGONALITY . The definition of dynamical isometry is that the input-output Jacobian of a network has as many singular values ( JSVs ) as possible close to 1 ( Saxe et al. , 2014 ) . With it , the error signal can preserve its norm under propagation without serious amplification or attenuation , which in turn helps the convergence of ( very deep ) networks . For a single fully-connected layer W , a sufficient and necessary condition to realize dynamical isometry is orthogonality , i.e. , WTW = I , as shown below , y = Wx , ||y|| = √ yTy = √ xTWTWx = ||x|| , iff . WTW = I , ( 1 ) where I stands for identity matrix . Orthogonality of a weight matrix can be easily realized by matrix orthogonalization techniques such as QR decomposition ( Trefethen & Bau III , 1997 ; Mezzadri , 2006 ) . Exact ( namely all the Jacobian singular values are exactly 1 ) dynamical isometry can be achieved for linear networks since multiple linear layers essentially reduce to a single 2d weight matrix . In contrast , the convolutional and non-linear cases are much complicated . Previous work ( Wang et al. , 2021a ) has shown that merely considering convolution or ReLU ( Nair & Hinton , 2010 ) renders the weight orthogonalization method much less effective in terms of recovering dynamical isometry after pruning , let alone considering modern deep networks with BN ( Ioffe & Szegedy , 2015 ) and residuals ( He et al. , 2016 ) . The primary goal of our paper is to bridge this gap . Following the seminal work of ( Saxe et al. , 2014 ) , several papers propose to maintain orthogonality during training instead of sorely for the initialization . There are primarily two groups of orthogonalization methods for convolutional neural networks : kernel orthogonality ( Xie et al. , 2017 ; Huang et al. , 2018 ; 2020 ) and orthogonal convolution ( Wang et al. , 2020 ) : KKT = I ⇒ Lorth = KKT − I , / kernel orthogonality KKT = I ⇒ Lorth = KKT − I , / orthogonal convolution ( 2 ) where clearly the difference lies in the weight matrix K vs. K. ( 1 ) K denotes the original weight matrix in a convolutional layer . Weights of a conv layer make up a 4d tensor RN×C×H×W , where N stands for the number of output channels , C for the number of input channels , H and W for the height and width of conv kernel . Then , K is a reshaped version of the 4d tensor : K ∈ RN×CHW ( if N < CHW ; otherwise , K ∈ RCHW×N ) . ( 2 ) In contrast , K ∈ RNHfoWfo×CHfiWfi stands for the doubly block-Toeplitz ( DBT ) matrix representation of K ( Hfo stands for the output feature map height , Hfi for the input feature map height . Wfo and Wfi can be inferred the same way for width ) . It was showed by ( Wang et al. , 2020 ) that orthogonal convolution is more effective than kernel orthogonality ( Xie et al. , 2017 ) in that the latter is only a necessary but insufficient condition of the former . In this work , we will evaluate both methods to see how effective they are in maintaining/recovering the broken dynamical isometry . | This paper proposes regularizing learnable parameters of NNs to maintain the dynamical isometry during pruning and improve their accuracy. In the experimental analyses, the proposed OPP outperforms baseline methods on benchmark datasets. The paper is well written in general, and the proposed methods are intuitive. In the experimental analyses, the proposed methods outperform baseline on various benchmark datasets. | SP:7cee15b5f46a918a6448434840696f3a0d3739ee |
Dynamic Parameterized Network for CTR Prediction | 1 INTRODUCTION . Click-through rate ( CTR ) prediction , which aims to estimate the probability of a user clicking an item , is of great importance in recommendation systems and online advertising systems ( Cheng et al. , 2016 ; Guo et al. , 2017 ; Rendle , 2010 ; Zhou et al. , 2018b ) . Effective feature modeling and user behavior modeling are two critical parts of CTR prediction . Deep neural networks ( DNNs ) have achieved tremendous success on a variety of CTR prediction methods for feature modeling ( Cheng et al. , 2016 ; Guo et al. , 2017 ; Wang et al. , 2017 ) . Under the hood , its core component is a linear transformation followed by a nonlinear function , which models weighted interaction between the flattened inputs and contexts by fixed kernels , regardless of the intrinsic decoupling relations from specific contexts ( Rendle et al. , 2020 ) . This property makes DNN learn interaction in an implicit manner , while limiting its ability to model explicit relation , which is often captured by feature crossing component ( Rendle , 2010 ; Song et al. , 2019 ) . Most existing solutions exploit a combinatorial framework ( feature crossing component + DNN component ) to leverage both implicit and explicit feature interactions , which is suboptimal and inefficient ( Cheng et al. , 2016 ; Wang et al. , 2017 ) . For instance , wide & deep combines a linear module in the wide part for explicit low-order interaction and a DNN module to learn high-order feature interactions . Follow-up works such as Deep & Cross Network ( DCN ) follows a similar manner by replacing the wide part with more sophistic networks , however , posits restriction to input size which is inflexible . Above-mentioned methods pay little attention to user behavior modeling . Recently , attention-based methods like DIN and DIEN have attracted many interests that attempt to capture user preferences based on users ’ historical behaviors ( Zhou et al. , 2018b ; 2019 ; Feng et al. , 2019 ) . With regard to the interaction of characteristics , the use of attention mechanisms in these methods can be treated as an explicit modelling of the interaction of characteristics while neglecting the modelling of implicit interactions of characteristics . The methods mentioned above either model implicit and explicit feature interactions isolated or adopt a suboptimal way to combine them , which can be inefficient . In this work , we aim to address these problems by introducing a small MLP layer that dynamically generates kernels conditioned by the current instance to capture both implicit and explicit feature interactions . The core idea is to first generate context weights and biases from the context stream , and then aggregate them with the input stream adaptively . We formulate a generic function and implement it with an efficient dynamic parameterized operation ( DPO ) . The first weight generator projects contextual features into high-dimensional representation , which models implicit conditional bias . The second feature aggregator aims to fuse input features and projected contextual representation in a multiplicative way , e.g. , matrix multiplication and convolution , maintaining both low- and high-order information . For feature-based modeling , we introduce feature-based DPO where the weight-generate operation dynamically produces instance-wise filters conditioned on the embedded context . The featureaggregate function then applies instance-wise filters to the flattened input by matrix multiplication , allowing to learn multiplicative features . In particular , we further propose a new class of DPO , called field-based DPO , which is not only instance-specific but also field-specific . In that case , the filters vary from field to field and from instance to instance , allowing more complex interactions along the field dimension . For user behavior modeling , we introduce sequence-based DPO that consists of two variants : behaviorbehavior dynamic operation and query-behavior dynamic operation . A representative method of dynamic convolution ( Chen et al. , 2020 ; Yang et al. , 2019 ) shares the convolution kernel , which is generated by the global average of the inputs . Similarly , ( Wu et al. , 2019 ) proposed DyConv , a lightweight fine-grained convolution that depends only on time-step , reinforcing the encoder-based language modeling framework . However , our methods incorporate both local and global information as they jointly use locality-aware methods ( e.g. , convolution or separable convolution ) followed by a global average pooling layer to produce instance-wise weights . The query-behavior dynamic operation is specialized designed for the decoder-based framework in CTR prediction , aiming to capture target-behavior dependency . To our best knowledge , this is the first attempt to extend the business of dynamic neural networks to CTR prediction with extensive experiments on two fundamental scenarios . The comprehensive study against existing solutions validates the superiority of our proposed method . Moreover , we demonstrate that incorporating DPO into the real-world ranking system is beneficial . Our contribution can be summarized as followed : • We propose a generic formulation for capturing multiplicative interaction via weightgenerate and feature-aggregate function , termed DPO . • For feature-based modeling , we propose two variants , named field-based and feature-based DPO , offering a unifying view of implicit and explicit feature interaction . Decomposing these operations , we find they implicitly inherit low- and second-order representation . • For user behavior modeling , we propose two sequence-based variants : behavior-behavior and query-behavior DPO . The first one computes locally perceptual dynamic filters and the second one learns target-behavior dependency in a multiplicative manner . We demonstrate that such operations can benefit the self-attention layers by higher computational efficiency through modeling locality as inductive bias . • The proposed dynamic parameterized networks outperform state-of-the-art methods by a significant margin on both public and real-world production datasets . We also give a comprehensive study about the relationship of our proposed methods to previous Factorization Machine ( Rendle , 2010 ) and CrossLayer ( Wang et al. , 2017 ) . We further demonstrate the effectiveness and superiority of our method with an online A/B test in real-world applications by incorporating it into the fine-rank stage of the real-world ads system . 2 METHOD . We first review the mainstream approaches of feature-based and user behavior ( sequence-based ) modeling under the situation of CTR prediction1 . After that , we introduce DPO and provide several specific instantiations designed for traditional feature-based and sequence-based modeling . 1Related work is in Appendix A due to space limitation . 2.1 PRELIMINARY . Traditional CTR prediction methods mainly predict a probability of a user click an item , which serves as a fundamental evaluation criterion for computing advertising systems . Typically , in a given scenario ( the contexts ) , users click on certain items ( item profiles ) based on their own needs ( query ) and pautorferences ( user profiles ) . Consequently , a model considers four fields of features , i.e. , query , user profile , item profile , and contexts to predict : CTR = F ( query , user profile , item profile , contexts ) ( 1 ) where item and user profiles contain up to tens of fine-grained static attributes depending on the specific circumstances . Sequence-based CTR prediction involves user behaviors additionally : CTR = F ( query , user behavior , user profile , item profile , contexts ) ( 2 ) where the models can learn from the behaviors that have occurred under certain contexts and query in the past to make judgments on the current items . As mentioned in KFAtt ( Liu et al. , 2020 ) , the behavior module can be formulated as : v̂q = UserBehavior ( q , k1 : T , v1 : T ) , where k1 : T and v1 : T are given T historical clicked items and corresponding query words . The most used strategy is to adopt the the self-attention mechanism ( Vaswani et al. , 2017 ) , which naturally learns multiplicative interaction between query and the historical behavior . 2.2 FORMULATION . Namely , multiplicative interaction ( Jayakumar et al. , 2020 ) has been proposed to fuse two different sources of information with the goal of approximating function ftarget ( x , z ) ∈ Rc , where x and z are the input and context respectively . Similarly , we give a generic formulation of DPO in CTR prediction task as : yi = 1 C ( z ) ∑ ∀j f ( xi ; gi ( zj ; θ ) ) ( 3 ) Here i is the index of a position ( in the field , or sequence ) , whose response is calculated with the generated output of z over all existing positions . x is the input embedding , while z denotes any specified context . The generate function g aims to compute dynamic weights and bias followed as one of the inputs of the pairwise aggregate function f , which learns the interactive features reflecting the relationship between xi and zj . The output is finally normalized by a factor C ( z ) . MLP and convolution typically process input and context features in an additive way with fixed weights . While in Eqn . ( 3 ) , using instance-wise generated weights and bias from contexts z , the additive nature is transformed to multiplicative . DPO is also different from bilinear layer ( Lin et al. , 2015 ; He & Chua , 2017 ) for Eqn . ( 3 ) computes representation based on the generated weights over all positions , whereas bilinear layer aggregates information over all positions between x and z , leading to large memory consumption . Furthermore , our generated dynamic weights can maintain more local information , which complements the global counterpart , e.g. , self-attention . DPO is a flexible block and can easily work together with MLP and self-attention layers . 2.3 FEATURE-BASED DPO . Given x ∈ Rm and z ∈ Rn as inputs and context , due to the lack of position information , the generic formulation degrades as y = f ( x ; g ( z ; θ ) ) . For simplicity , we consider f in the form of a linear transformation : f ( x ; z ) =W ( z ) x , where W ( z ) is an instance-wise two-dimensional matrix generated by function g. Now , We discuss the choice of function g. Following the hypernetworks ( Ha et al. , 2016 ) , a natural choice of g is a fully-connected layer to form dynamic weights and bias : y = ( Ŵ Tz + b̂ ) T︸ ︷︷ ︸ DyWeights x+ ( Ẇ Tz + ḃ ) ︸ ︷︷ ︸ DyBias = zTŴx︸ ︷︷ ︸ explicit + Ẇ Tz + B̂Tx+ ḃ︸ ︷︷ ︸ implicit ( 4 ) where ( Ŵ , b̂ , Ẇ , ḃ ) ∈ ( Rn×mc , Rmc , Rn×c , Rc ) . However , the size of Ŵ has quadratic space complexity , unsuitable for deployment in real-world application . Here , we consider a low-rank method in practice , e.g. , a two-layer MLP : g ( z ) =W T2 σ ( W T 1 z + b1 ) + b2 ( 5 ) where ( W1 , b1 ) ∈ ( Rn×l , Rl ) and ( W2 , b2 ) ∈ ( Rl× ( mc+c ) , Rmc+c ) , σ is a non-linear function . Then , we can decompose the output into explicit dynamic weights and bias . The right inductive bias depends on how we select context z and g. We denote the complexity of f is O ( mc ) less than O ( mc+ nc ) of plain MLP layer , while g scales up to O ( lmc+ ln ) . To reduce the complexity , we set l as a small number and use a multi-head mechanism ( Vaswani et al. , 2017 ) . Relation to Cross Network : A cross layer ( Wang et al. , 2017 ) take the feature interaction formulation as xi+1 = x0 · xiwi + bi+1 + xi , where xiwi is scalar . We prove CrossLayer is the simplest formulation of DPO . Let ’ s take x0 as z , xi as x and only use 1-layer MLP as weight-generate function , whose hidden states are 1 , ( i.e . z = x0 , Ŵ ∈ Rn , Ẇ = 0 , B̂ = 1 ) . Thus , we get a scalar output of g as the same as the multiplicative term of CrossLayer . In this way , DPO aims to imitate multiplicative operation . | This submission is on modeling feature interactions for CTR prediction. It proposes a framework that follows meta-learning. Specifically, to model the interaction between feature F1 and feature F2, it uses a meta neural-network g(F1) that takes F1 and produces the parameter for another neural network f(F2) that takes F2, i.e., the outcome of feature crossing is f(F2) where f's parameter is g(F1). It outperforms the baselines and is deployed online. | SP:d9337a6584f85065622b88caf23629b10c563ebd |
Dynamic Parameterized Network for CTR Prediction | 1 INTRODUCTION . Click-through rate ( CTR ) prediction , which aims to estimate the probability of a user clicking an item , is of great importance in recommendation systems and online advertising systems ( Cheng et al. , 2016 ; Guo et al. , 2017 ; Rendle , 2010 ; Zhou et al. , 2018b ) . Effective feature modeling and user behavior modeling are two critical parts of CTR prediction . Deep neural networks ( DNNs ) have achieved tremendous success on a variety of CTR prediction methods for feature modeling ( Cheng et al. , 2016 ; Guo et al. , 2017 ; Wang et al. , 2017 ) . Under the hood , its core component is a linear transformation followed by a nonlinear function , which models weighted interaction between the flattened inputs and contexts by fixed kernels , regardless of the intrinsic decoupling relations from specific contexts ( Rendle et al. , 2020 ) . This property makes DNN learn interaction in an implicit manner , while limiting its ability to model explicit relation , which is often captured by feature crossing component ( Rendle , 2010 ; Song et al. , 2019 ) . Most existing solutions exploit a combinatorial framework ( feature crossing component + DNN component ) to leverage both implicit and explicit feature interactions , which is suboptimal and inefficient ( Cheng et al. , 2016 ; Wang et al. , 2017 ) . For instance , wide & deep combines a linear module in the wide part for explicit low-order interaction and a DNN module to learn high-order feature interactions . Follow-up works such as Deep & Cross Network ( DCN ) follows a similar manner by replacing the wide part with more sophistic networks , however , posits restriction to input size which is inflexible . Above-mentioned methods pay little attention to user behavior modeling . Recently , attention-based methods like DIN and DIEN have attracted many interests that attempt to capture user preferences based on users ’ historical behaviors ( Zhou et al. , 2018b ; 2019 ; Feng et al. , 2019 ) . With regard to the interaction of characteristics , the use of attention mechanisms in these methods can be treated as an explicit modelling of the interaction of characteristics while neglecting the modelling of implicit interactions of characteristics . The methods mentioned above either model implicit and explicit feature interactions isolated or adopt a suboptimal way to combine them , which can be inefficient . In this work , we aim to address these problems by introducing a small MLP layer that dynamically generates kernels conditioned by the current instance to capture both implicit and explicit feature interactions . The core idea is to first generate context weights and biases from the context stream , and then aggregate them with the input stream adaptively . We formulate a generic function and implement it with an efficient dynamic parameterized operation ( DPO ) . The first weight generator projects contextual features into high-dimensional representation , which models implicit conditional bias . The second feature aggregator aims to fuse input features and projected contextual representation in a multiplicative way , e.g. , matrix multiplication and convolution , maintaining both low- and high-order information . For feature-based modeling , we introduce feature-based DPO where the weight-generate operation dynamically produces instance-wise filters conditioned on the embedded context . The featureaggregate function then applies instance-wise filters to the flattened input by matrix multiplication , allowing to learn multiplicative features . In particular , we further propose a new class of DPO , called field-based DPO , which is not only instance-specific but also field-specific . In that case , the filters vary from field to field and from instance to instance , allowing more complex interactions along the field dimension . For user behavior modeling , we introduce sequence-based DPO that consists of two variants : behaviorbehavior dynamic operation and query-behavior dynamic operation . A representative method of dynamic convolution ( Chen et al. , 2020 ; Yang et al. , 2019 ) shares the convolution kernel , which is generated by the global average of the inputs . Similarly , ( Wu et al. , 2019 ) proposed DyConv , a lightweight fine-grained convolution that depends only on time-step , reinforcing the encoder-based language modeling framework . However , our methods incorporate both local and global information as they jointly use locality-aware methods ( e.g. , convolution or separable convolution ) followed by a global average pooling layer to produce instance-wise weights . The query-behavior dynamic operation is specialized designed for the decoder-based framework in CTR prediction , aiming to capture target-behavior dependency . To our best knowledge , this is the first attempt to extend the business of dynamic neural networks to CTR prediction with extensive experiments on two fundamental scenarios . The comprehensive study against existing solutions validates the superiority of our proposed method . Moreover , we demonstrate that incorporating DPO into the real-world ranking system is beneficial . Our contribution can be summarized as followed : • We propose a generic formulation for capturing multiplicative interaction via weightgenerate and feature-aggregate function , termed DPO . • For feature-based modeling , we propose two variants , named field-based and feature-based DPO , offering a unifying view of implicit and explicit feature interaction . Decomposing these operations , we find they implicitly inherit low- and second-order representation . • For user behavior modeling , we propose two sequence-based variants : behavior-behavior and query-behavior DPO . The first one computes locally perceptual dynamic filters and the second one learns target-behavior dependency in a multiplicative manner . We demonstrate that such operations can benefit the self-attention layers by higher computational efficiency through modeling locality as inductive bias . • The proposed dynamic parameterized networks outperform state-of-the-art methods by a significant margin on both public and real-world production datasets . We also give a comprehensive study about the relationship of our proposed methods to previous Factorization Machine ( Rendle , 2010 ) and CrossLayer ( Wang et al. , 2017 ) . We further demonstrate the effectiveness and superiority of our method with an online A/B test in real-world applications by incorporating it into the fine-rank stage of the real-world ads system . 2 METHOD . We first review the mainstream approaches of feature-based and user behavior ( sequence-based ) modeling under the situation of CTR prediction1 . After that , we introduce DPO and provide several specific instantiations designed for traditional feature-based and sequence-based modeling . 1Related work is in Appendix A due to space limitation . 2.1 PRELIMINARY . Traditional CTR prediction methods mainly predict a probability of a user click an item , which serves as a fundamental evaluation criterion for computing advertising systems . Typically , in a given scenario ( the contexts ) , users click on certain items ( item profiles ) based on their own needs ( query ) and pautorferences ( user profiles ) . Consequently , a model considers four fields of features , i.e. , query , user profile , item profile , and contexts to predict : CTR = F ( query , user profile , item profile , contexts ) ( 1 ) where item and user profiles contain up to tens of fine-grained static attributes depending on the specific circumstances . Sequence-based CTR prediction involves user behaviors additionally : CTR = F ( query , user behavior , user profile , item profile , contexts ) ( 2 ) where the models can learn from the behaviors that have occurred under certain contexts and query in the past to make judgments on the current items . As mentioned in KFAtt ( Liu et al. , 2020 ) , the behavior module can be formulated as : v̂q = UserBehavior ( q , k1 : T , v1 : T ) , where k1 : T and v1 : T are given T historical clicked items and corresponding query words . The most used strategy is to adopt the the self-attention mechanism ( Vaswani et al. , 2017 ) , which naturally learns multiplicative interaction between query and the historical behavior . 2.2 FORMULATION . Namely , multiplicative interaction ( Jayakumar et al. , 2020 ) has been proposed to fuse two different sources of information with the goal of approximating function ftarget ( x , z ) ∈ Rc , where x and z are the input and context respectively . Similarly , we give a generic formulation of DPO in CTR prediction task as : yi = 1 C ( z ) ∑ ∀j f ( xi ; gi ( zj ; θ ) ) ( 3 ) Here i is the index of a position ( in the field , or sequence ) , whose response is calculated with the generated output of z over all existing positions . x is the input embedding , while z denotes any specified context . The generate function g aims to compute dynamic weights and bias followed as one of the inputs of the pairwise aggregate function f , which learns the interactive features reflecting the relationship between xi and zj . The output is finally normalized by a factor C ( z ) . MLP and convolution typically process input and context features in an additive way with fixed weights . While in Eqn . ( 3 ) , using instance-wise generated weights and bias from contexts z , the additive nature is transformed to multiplicative . DPO is also different from bilinear layer ( Lin et al. , 2015 ; He & Chua , 2017 ) for Eqn . ( 3 ) computes representation based on the generated weights over all positions , whereas bilinear layer aggregates information over all positions between x and z , leading to large memory consumption . Furthermore , our generated dynamic weights can maintain more local information , which complements the global counterpart , e.g. , self-attention . DPO is a flexible block and can easily work together with MLP and self-attention layers . 2.3 FEATURE-BASED DPO . Given x ∈ Rm and z ∈ Rn as inputs and context , due to the lack of position information , the generic formulation degrades as y = f ( x ; g ( z ; θ ) ) . For simplicity , we consider f in the form of a linear transformation : f ( x ; z ) =W ( z ) x , where W ( z ) is an instance-wise two-dimensional matrix generated by function g. Now , We discuss the choice of function g. Following the hypernetworks ( Ha et al. , 2016 ) , a natural choice of g is a fully-connected layer to form dynamic weights and bias : y = ( Ŵ Tz + b̂ ) T︸ ︷︷ ︸ DyWeights x+ ( Ẇ Tz + ḃ ) ︸ ︷︷ ︸ DyBias = zTŴx︸ ︷︷ ︸ explicit + Ẇ Tz + B̂Tx+ ḃ︸ ︷︷ ︸ implicit ( 4 ) where ( Ŵ , b̂ , Ẇ , ḃ ) ∈ ( Rn×mc , Rmc , Rn×c , Rc ) . However , the size of Ŵ has quadratic space complexity , unsuitable for deployment in real-world application . Here , we consider a low-rank method in practice , e.g. , a two-layer MLP : g ( z ) =W T2 σ ( W T 1 z + b1 ) + b2 ( 5 ) where ( W1 , b1 ) ∈ ( Rn×l , Rl ) and ( W2 , b2 ) ∈ ( Rl× ( mc+c ) , Rmc+c ) , σ is a non-linear function . Then , we can decompose the output into explicit dynamic weights and bias . The right inductive bias depends on how we select context z and g. We denote the complexity of f is O ( mc ) less than O ( mc+ nc ) of plain MLP layer , while g scales up to O ( lmc+ ln ) . To reduce the complexity , we set l as a small number and use a multi-head mechanism ( Vaswani et al. , 2017 ) . Relation to Cross Network : A cross layer ( Wang et al. , 2017 ) take the feature interaction formulation as xi+1 = x0 · xiwi + bi+1 + xi , where xiwi is scalar . We prove CrossLayer is the simplest formulation of DPO . Let ’ s take x0 as z , xi as x and only use 1-layer MLP as weight-generate function , whose hidden states are 1 , ( i.e . z = x0 , Ŵ ∈ Rn , Ẇ = 0 , B̂ = 1 ) . Thus , we get a scalar output of g as the same as the multiplicative term of CrossLayer . In this way , DPO aims to imitate multiplicative operation . | The paper proposed a new method to handle feature/context interactions within the eCTR prediction neural networks. Details are provided in different scenarios. Experiments are conducted for offline and real-world experiments with promising results. | SP:d9337a6584f85065622b88caf23629b10c563ebd |
PROMISSING: Pruning Missing Values in Neural Networks | 1 INTRODUCTION . Missing and incomplete data are abundant in real-world problems ; however , the learning and inference procedures in machine learning ( ML ) models highly rely on high-quality and complete data . Therefore , it is necessary to develop new methods to deal with data imperfections in rugged environments . Currently , the most popular way to deal with imperfect data is to impute the missing values . However , if we consider the learning and inference procedures in our brain as a role model for ML algorithms , data imputation barely follows the natural principles of incomplete data processing in our brain . This is because the imputation is generally based on using a heuristic for replacing missing values . Our brain does not impute incomplete sensory information but instead uses its incompleteness as a separate source of information for decision making . For example , by only hearing the rain we can estimate how hard it is raining , and we do not necessarily need to receive visual information . Instead , we direct our attention more toward our auditory inputs to decide whether to go out with an umbrella . In addition , the more we miss sensory information , the more cautious we get in decision-making . That is why we are more careful in darker environments . Neural networks ( NNs ) are brain-inspired algorithms that are very popular these days ( under the name of deep learning ) for learning complex relationships between inputs and target variables . However , they are in principle unable to handle incomplete data with missing values . They mainly rely on matrix operations which can not operate on not-a-number ( NaN ) values . Only one NaN in a dataset impairs the forward propagation in a network . There are three solutions to this problem ( Garcı́aLaencina et al. , 2010 ) : i ) removing samples or features with missing values , ii ) imputing the missing values , and iii ) modeling the incomplete data . Removing the samples with missing values can be very costly , especially in small-sample size and high-dimensional datasets . For example , data collection in clinical applications is an expensive procedure in terms of time , finance , and patient burden . Moreover , removing even a few samples from small datasets can affect negatively the generalization performance of the final model . Removing informative features with missing values is also compensated with lower model performance . Therefore , filling the information gaps is inevitable . There are various techniques for data imputation , ranging from simply imputing missing values with a constant to more sophisticated ML-based imputation approaches ( Little & Rubin , 2019 ; Garcı́aLaencina et al. , 2010 ) . One can categorize the most common techniques into three main categories : i ) constant imputation , ii ) regression-based imputation , and iii ) ML-based imputation . In constant imputation , the missing values are replaced with a constant , e.g. , zeros or mean/median of features . It has been shown that constant imputation is Bayes consistent when the missing features are not informative ( Josse et al. , 2019 ) . In the regression-based imputation , a linear or non-linear regression model is derived to predict the missing values . This method can be used to impute a single or multiple features . The most popular regression-based imputation is Multiple Imputation by Chained Equations ( MICE ) ( Van Buuren & Groothuis-Oudshoorn , 2011 ; Azur et al. , 2011 ) . In MICE , an iterative procedure of predicting missing values and re-training regressors with updated predictions is performed for a limited number of cycles . The central assumption behind the MICE approach is that the missing values are missed at random ( see Rubin ( 1976 ) and Appendix A.1 for definitions of missing value mechanisms including missing completely at random ( MCAR ) , missing at random ( MAR ) , and missing not at random ( MNAR ) ) . Applying MICE can result in biased estimations if this assumption is not satisfied ( Azur et al. , 2011 ) . Another critical limitation of regression-based imputation is its high computational complexity ( Caiafa et al. , 2021 ) . If we do not know which feature will be missed at the test time , for d features , we need to train d different regression models . In the ML-based approach ML algorithms , such as a K-nearest neighbor ( KNN ) , regularized linear model ( Jiang et al. , 2021 ) , decision trees ( Twala et al. , 2008 ) , random forest ( Xia et al. , 2017 ) , neural network ( Bengio & Gingras , 1996 ) , or generative model ( Yoon et al. , 2018 ; Ipsen et al. , 2020 ; Collier et al. , 2020 ; Nazabal et al. , 2020 ) , are used for handling missing data . As an alternative solution to data imputation , one can use the elegance of probabilistic modeling to model the incomplete data under certain assumptions . One seminal work in this direction is presented by Ghahramani & Jordan ( 1994 ) , where a Gaussian Mixture Model ( GMM ) is used to estimate the joint density function on incomplete data using an Expectation-Maximization ( EM ) algorithm . This approach is later adopted and extended to logistic regression ( Williams et al. , 2005 ) , Gaussian processes , support vector machines ( Smola et al. , 2005 ) , and multi-class non-linear classification ( Liao et al. , 2007 ) . However , despite their good performance on small-size datasets , their application remained limited on big and high-dimensional data due to the high computational complexity ( Caiafa et al. , 2021 ) . To overcome this issue , Caiafa et al . ( 2021 ) proposed a sparse dictionary learning algorithm that is trained end-to-end , and simultaneously learns the parameters of the classifier and sparse dictionary representation . Le Morvan et al . ( 2020 ) proposed NeuMiss , a neural-network architecture that uses a differentiable imputation procedure in a impute-then-regress scheme ( Morvan et al. , 2021 ) . A notable feature of NeuMiss is its robustness to MNAR data . Inverse probability weighted estimation ( Wooldridge , 2007 ; Seaman & White , 2013 ) is another probabilistic approach for handling missing values without imputation in which the weights for samples with many missing values are inflated based on an estimation of the sampling probability . Recently , Smieja et al . ( 2018 ) proposed a modified neuron structure that uses GMM with a diagonal covariance matrix ( assuming MAR ) to estimate the density of missing data . GMM parameters are learned with other network parameters . Conveniently , it handles missing values in the first layer of the network , and the rest of the architecture remains unchanged . Elsewhere , Nowicki et al . ( 2016 ) proposed a new neural network architecture based on rough set theory ( Pawlak , 1998 ) for learning from imperfect data . It is fascinating that this method can say “ I do not know ” when a large portion of input values are missing , unlike traditional models trained on imputed data that may predict definite outcomes even on completely unmeasured samples , i.e. , they run in the absolute darkness . These predictions can be dangerous with catastrophic consequences in more delicate applications of ML for example in autonomous driving , robotic surgery , or clinical decision-making . In this work , we attack the problem of modeling incomplete data using artificial neural networks without data imputation . We propose a simple technique for pruning missing values ( PROMISSING ) in which the effect of missing values on the activation of a neuron is neutralized . In this strategy , a missing value is not replaced by arbitrary values ( e.g. , through imputation ) ; it is naturally considered a missing piece of the puzzle ; we learn a problem-specific numerical representation for unknowns . The key feature of PROMISSING is its simplicity ; it is plug-and-play ; it deals with missing values in the first layer of the network without the need to change anything in the rest of the network architecture or optimization process . PROMISSING in its original form does not add extra parameters to the network , and its computational overhead remains negligible . Our experiments on simulated data and several classification/regression problems show that the proposed pruning method does not negatively affect the model accuracy and provides competitive results compared to several data imputation techniques . In a clinical application , making prognostic predictions for patients with a psychotic disorder , we present an application of PROMISSING on a multi-modal clinical dataset . We demonstrate how the NN model trained using PROMISSING becomes indecisive when facing many unknowns . This is a crucial feature for developing trustworthy prediction models in clinical applications . Furthermore , we show a side application of PROMISSING for counterfactual interpretation ( Mothilal et al. , 2020 ) of NNs decisions that can be valuable in clinics . 2 METHODS . Let x ∈ Rp represent a vector of an input sample with p features . We assume that the features in x are divided into two sets of q observed xo ∈ Rq and r missing features xm ( where p = q + r ) . In this study , we do not put any assumption on the pattern of missing values in x . Then , the activation of the kth ( k ∈ { 1 , 2 , . . . , s } ) neuron in the first hidden layer of an ordinary NN is : a ( k ) = ∑ xi∈xo xiw ( k ) i + ∑ xj∈xm xjw ( k ) j + b ( k ) . ( 1 ) This activation can not be computed unless the values in xm are imputed with real numbers . Here , in PROMISSING , we propose to alternatively replace the missing values with a neutralizer that 1 ) prunes the missing values from inputs of a neuron , 2 ) neutralizes the effect of missing values on the neuron ’ s activation by cancelling the second term in Eq . 1 and modifying the neuron ’ s bias . A missing value xj ∈ xm is replaced with its corresponding neutralizer u ( k ) j at the kth neuron , where : u ( k ) j = −b ( k ) pw ( k ) j . ( 2 ) The value of a neutralizer depends on its corresponding weight ( w ( k ) j ) , the bias of the corresponding neuron ( b ( k ) ) , and the number of features ( p ) ; thus , it can be computed on the fly during the training or inference procedures . A small value is added to weights before computing neutralizers to avoid division by zero . Inserting the neutralizer into Eq . 1 , the activation of the kth neuron is rewritten as : a ( k ) = ∑ xi∈xo xiw ( k ) i + qb ( k ) p , ( 3 ) in which the effect of weights of missing values on the activation of the neuron is eliminated , and the neuron ’ s bias is reduced by a factor of r/p . If all input values for a specific sample are missing then the neuron is completely neutralized . Proposition 1 If all input values are missing ( q = 0 and xo = ∅ ) then the activation of a PROMISSING neuron is zero ( see Appendix A.2.2 for the proof ) . Proposition 2 If there are no missing values in inputs ( q = p and xm = ∅ ) then the activation of a PROMISSING neuron is equal to a normal neuron ( see Appendix A.2.3 for the proof ) .. We should emphasize that , when using PROMISSING , the user does not need to apply any change to the input vectors , and the missing values ( generally represented as nans in the input matrix ) are fed directly to the network . After the training procedure , we eventually learn U ∈ Rs×p , a matrix representation for unknowns ( or metaphorically the dark matter ) : u ∗ ( k ) j = −b∗ ( k ) pw ∗ ( k ) j j ∈ { 1 , 2 , . . . , p } , k ∈ { 1 , 2 , . . . , s } , ( 4 ) where b∗ and w∗ are representing the final learned bias and weight . At the prediction stage , a missing value at jth input feature will be replaced with its corresponding neutralizer from U . It is worth emphasizing that the missing values are replaced with different neutralizers at different neurons ; therefore , it can not be considered a constant imputation . In fact , each neuron perceives differently a missing value in the input space . Metaphorically , the neurons can be seen as blind men in the parable of “ the blind men and an elephant ” 1 when facing unknowns . Furthermore , it is different from regression-based imputation and model-based approaches in the sense that a missing value in a specific feature is not inferred from other observed features , or the distribution of observed values ; i.e. , unknowns remain unknowns . In PROMISSING , we do not assume any certain missing value mechanism ( e.g. , MAR ) in advance . Instead , we try to learn the patterns of missing values from data that maybe advantageous in more difficult scenarios such as MNAR ( see results in Sec . 3.1 ) . One possible drawback of using PROMISSING is in high-dimensional input spaces and when the number of missing values is large , i.e. , when p → ∞ and r q . In this case , the neuron will undershoot ; hence the effect of few non-missing values are ignored . 2 To address this problem , we propose a modified version of PROMISSING ( mPROMISSING ) in which the effect of large r can be compensated with a compensatory weight , wc . The compensatory weight receives a fixed input of r/p for a specific sample ; thus , the activation of the neuron will change to : a ( k ) = ∑ xi∈xo xiw ( k ) i + qb ( k ) + rw ( k ) c p . ( 5 ) w ( k ) c is learned alongside the rest of the network parameters in the optimization process . On training data with few missing values , data augmentation ( e.g. , by simulating different patterns and size of missing values ) is advisable to ensure the sensibility of the learned compensatory weight . Since the input for this weight ( r/p ) is computed at the run time , no modification to input vectors is required . Proposition 3 If there are no missing values ( q = p , r = 0 , and xm = ∅ ) then the activation of an mPROMISSING neuron is equal to a normal neuron ( see Appendix A.2.4 for the proof ) . The proposed PROMISSING approach is straightforward to implement and use . It can be incorporated into the current implementations of different types of NN layers by adding/modifying few lines of code . We have implemented a nanDense layer , inheriting from Keras ( Chollet et al. , 2015 ) Dense layer , using PROMISSING and mPROMISSING neurons ( see appendix A.3 ) . The nanDense layer can be directly imported and used with any Keras model . In its general usage , the nanDense layer is only used for the first layer of an NN to handle missing values in inputs , unless we expect some missing values in the intermediate layers . | The present paper proposes an alternative to imputation or list-wise deletion in the context of neural networks and incomplete features. Missing values are replaced by a data-specific numerical representation that is learned at the same time as the rest of the network. The handling of the missing values is located in the neurons of the first layer and each missing value is "replaced" by a neuron-specific neutralizer in its activation function. They empirically show that their approach is comparable to several imputation techniques. In a clinical application they show that their model becomes indecisive as the amount of missingness (in terms of missing features) increases, which is a potentially interesting feature for clinical prediction models. | SP:11a1972c3e8ea1c2dda4776b0d751fd47300ae29 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.